Skip to content

Commit

Permalink
Merge pull request #2137 from IgniteUI/sstoychev/cherrypick-use-stric…
Browse files Browse the repository at this point in the history
…t-21.1

feat(*): adding use strict to JS files 21.1
  • Loading branch information
ChronosSF authored Aug 17, 2021
2 parents 156cc3a + 804a486 commit f010b21
Show file tree
Hide file tree
Showing 36 changed files with 55 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
node-version: [12.x, 14.x, 15.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
2 changes: 1 addition & 1 deletion demos/tree/api-and-events.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>API and Events Sample - API and Events with Tree Control - Ignite UI for jQuery�</title>

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"scripts": {
"test": "karma start",
"cover": "grunt hint && npm test -- --single-run",
"postinstall": "npm install -g grunt-cli"
"postinstall": "npm install -g grunt-cli",
"build": "grunt build"
},
"dependencies": {
"jquery": "^3.6.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

/*global ko*/
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
define( [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/

/*global ko*/
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
define( [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

/*global ko*/
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
define( [
Expand Down
2 changes: 1 addition & 1 deletion src/js/infragistics.loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* http://www.infragistics.com/
*
*/

"use strict";
if (typeof jQuery !== "function") {
throw new Error("jQuery is undefined");
}
Expand Down
1 change: 1 addition & 0 deletions src/js/modules/infragistics.datasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/

/*global Class, ActiveXObject, DOMParser, XPathResult, XMLSerializer */
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.templating.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
e.g. {{if condition}} do something {{else}} do something else {{/if}}
limitation: Regular expressions are equivalent to finite automatons as described by theory of computation and more precisely the formal languages and automata computability theory. This means that they are limited to recognizing languages of the type AB^nC but noy languages of the type [AB]^n which are recognized by context-free grammars (Regular expressions are still a subset of context-free grammars). However the A^nB^n is recognized due to the fact that we can use greedy regular expressions allowing us to match the last existing token of a type. Thus nested if-statements would not be recognized without stack-tokenizing the block statement.
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.colorpicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* infragistics.util.jquery.js
* infragistics.ui.shared.js
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.colorpickersplitbutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* infragistics.ui.splitbutton.js
* infragistics.ui.colorpicker.js
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.combo.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* </script>
* <input id="combo" />
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* </script>
* <div id="dialog1"></div>
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.editors.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* infragistics.ui.notifier.js
* infragistics.ui.validator.js
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
1 change: 1 addition & 0 deletions src/js/modules/infragistics.ui.htmleditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

/*global Class*/
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.layoutmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* infragistics.util.js
* infragistics.util.jquery.js
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* infragistics.ui.widget.js
* infragistics.ui.popover.js
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
1 change: 1 addition & 0 deletions src/js/modules/infragistics.ui.popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

/*global HTMLElement */
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* </script>
* <div id="rating1"></div>
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
1 change: 1 addition & 0 deletions src/js/modules/infragistics.ui.scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

/*global MSGesture*/
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* infragistics.util.js
* infragistics.util.jquery.js
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.splitbutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* infragistics.ui.shared.js
* infragistics.ui.toolbarbutton.js
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.splitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* infragistics.ui.widget.js
* infragistics.ui.splitter-en.js
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.tilemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* infragistics.ui.layoutmanager.js
* infragistics.ui.tilemanager-en.js
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
1 change: 1 addition & 0 deletions src/js/modules/infragistics.ui.toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

/*global Class */
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.toolbarbutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* infragistics.util.jquery.js
* infragistics.ui.shared.js
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* infragistics.ui.widget.js
* infragistics.ui.tree-en.js
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* infragistics.ui.widget.js
* infragistics.ui.shared.js
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
1 change: 1 addition & 0 deletions src/js/modules/infragistics.ui.validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/

/*global Class */
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.videoplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* infragistics.ui.widget.js
* infragistics.ui.shared.js
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/modules/infragistics.ui.widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* infragistics.util.js
* infragistics.util.jquery.js
*/

"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
1 change: 1 addition & 0 deletions src/js/modules/infragistics.ui.zoombar.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

/*global Class */
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
1 change: 0 additions & 1 deletion src/js/modules/infragistics.util.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*
*/
/*global xyz, Class, ActiveXObject, Modernizr, VBArray, Intl, XDomainRequest, unescape*/ /*jshint -W106*/ /*jshint -W116*/ /*jshint unused:false*/

(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down
30 changes: 20 additions & 10 deletions src/js/modules/infragistics.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// Inspired by base2 and Prototype

/*global xyz, Class, ActiveXObject, Modernizr, VBArray, Intl, XDomainRequest, unescape, $, igRoot*/ /*jshint -W106*/ /*jshint -W116*/ /*jshint unused:false*/
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {

Expand Down Expand Up @@ -55,7 +56,7 @@

// The base Class implementation (does nothing) or expects Class to already be defined as a function
// K.D. August 18, 2016 Bug #242 global scope Class object is overridden by Ignite UI for jQuery Class object
this.Class = this.Class || function () { };
window.Class = window.Class || function () { };

// Create a new Class that inherits from this class
Class.extend = function (prop, doAugment) {
Expand Down Expand Up @@ -1531,17 +1532,26 @@
}

// polyfill for IE11+. ChildNode.remove() is not supported by IE11+.
function removePolyfillIE() {
return this.parentNode && this.parentNode.removeChild(this);
}

// polyfill for IE11+. ChildNode.remove() is not supported by IE11+.
if (!Element.prototype.remove) {
Element.prototype.remove = removePolyfillIE;
if (!Element.hasOwnProperty("remove")) {
Object.defineProperty(Element, 'remove', {
configurable: true,
enumerable: true,
writable: true,
value: function remove() {
this.parentNode.removeChild(this);
}
});
}

if (Text && !Text.prototype.remove) {
Text.prototype.remove = removePolyfillIE;
if (Text && !Text.hasOwnProperty("remove")) {
Object.defineProperty(Text, 'remove', {
configurable: true,
enumerable: true,
writable: true,
value: function remove() {
this.parentNode.removeChild(this);
}
});
}

$.ig.Date.prototype.toStringFormat = function (value, format, provider) {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/scroll/scroll-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1734,7 +1734,7 @@ QUnit.test(testId_57, function (assert) {
scrollbarPixelContentRatio = (self.vhScroll().height() / (contentHeight - scrollContainerHeight)) * (vTrackHeight - vDragHeight),
expectedPosY = self.getTransform3dValueY(self.vDrag(self.vhScrollId));

assert.equal(expectedPosY.toFixed(4), scrollbarPixelContentRatio.toFixed(4), "igScroll did not scroll properly");
assert.equal(expectedPosY.toFixed(2), scrollbarPixelContentRatio.toFixed(2), "igScroll did not scroll properly");
self.vhScroll().remove();
done();
}).catch(function (er) {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/tilemanager/tilemanager/tilemanager-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ QUnit.test('[ID2] igTileManager initialize on markup. Default config', function
});


QUnit.test('[ID3] iigTileManager initialize on markup. ColumnWidth and columnHeight in px', function (assert) {
QUnit.test('[ID3] igTileManager initialize on markup. ColumnWidth and columnHeight in px', function (assert) {
assert.expect(660);
this.assert = assert;

Expand Down

0 comments on commit f010b21

Please sign in to comment.