mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Replace deprecated String.prototype.substr() (#2948)
String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with slice() or substring() which work similarily but aren't deprecated. Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
parent
84951cbc74
commit
8a75e8a165
11 changed files with 72 additions and 72 deletions
|
@ -558,7 +558,7 @@ scApp.filter("sc_filter_number", function(){
|
|||
|
||||
scApp.filter("sc_filter_less", function(){
|
||||
return function(v) {
|
||||
return v? (v.length > 15? v.substr(0, 15) + "...":v):v;
|
||||
return v? (v.length > 15? v.slice(0, 15) + "...":v):v;
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -636,7 +636,7 @@ scApp.provider("$sc_server", [function(){
|
|||
var $location = self.$location;
|
||||
var url = $location.absUrl();
|
||||
if (url.indexOf('?') > 0) {
|
||||
url = url.substr(0, url.indexOf('?'));
|
||||
url = url.slice(0, url.indexOf('?'));
|
||||
}
|
||||
url += '?';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue