diff options
author | CommanderRoot <CommanderRoot@users.noreply.github.com> | 2022-05-03 15:52:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-03 15:52:45 +0300 |
commit | 56640ae815fbace78c62482711cb1733d26cee5e (patch) | |
tree | 18078e6b9ec3e8ffe7cc6ac28e4c8f0a309bce94 /plugins/CoreHome/javascripts | |
parent | 34ea7bbfcbc5a79a5c7b675b8cd2134cdda74cbe (diff) |
Replace deprecated String.prototype.substr() (#19111)
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
Diffstat (limited to 'plugins/CoreHome/javascripts')
-rw-r--r-- | plugins/CoreHome/javascripts/broadcast.js | 8 | ||||
-rw-r--r-- | plugins/CoreHome/javascripts/dataTable.js | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/CoreHome/javascripts/broadcast.js b/plugins/CoreHome/javascripts/broadcast.js index 44ace8fe19..22b7c96e73 100644 --- a/plugins/CoreHome/javascripts/broadcast.js +++ b/plugins/CoreHome/javascripts/broadcast.js @@ -100,7 +100,7 @@ var broadcast = { // hash doesn't contain the first # character. if (hash && 0 === (''+hash).indexOf('/')) { - hash = (''+hash).substr(1); + hash = (''+hash).slice(1); } @@ -773,8 +773,8 @@ var broadcast = { */ getValueFromHash: function (param, url) { var hashStr = broadcast.getHashFromUrl(url); - if (hashStr.substr(0, 1) == '#') { - hashStr = hashStr.substr(1); + if (hashStr.slice(0, 1) == '#') { + hashStr = hashStr.slice(1); } hashStr = hashStr.split('#')[0]; @@ -795,7 +795,7 @@ var broadcast = { var lookFor = param + '='; if (url.indexOf('?') >= 0) { - url = url.substr(url.indexOf('?')+1); + url = url.slice(url.indexOf('?')+1); } var urlPieces = url.split('&'); diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js index 214964a34a..3cd03cbea5 100644 --- a/plugins/CoreHome/javascripts/dataTable.js +++ b/plugins/CoreHome/javascripts/dataTable.js @@ -805,7 +805,7 @@ $.extend(DataTable.prototype, UIControl.prototype, { $.each(patternsToReplace, function (index, pattern) { if (0 === currentPattern.indexOf(pattern.to)) { - currentPattern = pattern.from + currentPattern.substr(2); + currentPattern = pattern.from + currentPattern.slice(2); } }); @@ -881,7 +881,7 @@ $.extend(DataTable.prototype, UIControl.prototype, { $.each(patternsToReplace, function (index, pattern) { if (0 === keyword.indexOf(pattern.from)) { - keyword = pattern.to + keyword.substr(1); + keyword = pattern.to + keyword.slice(1); } }); |