@@ -59,7 +59,7 @@ app.service('CalendarFactory', function($window, DavClient, Calendar, WebCal, co
5959 // but some browsers can't parse that *cough cough* Safari 9 *cough cough*
6060 // Safari 10 seems to support this though
6161 if ( colorProp . length === 9 ) {
62- return colorProp . substr ( 0 , 7 ) ;
62+ return colorProp . slice ( 0 , 7 ) ;
6363 }
6464 return colorProp ;
6565 } else {
@@ -114,7 +114,7 @@ app.service('CalendarFactory', function($window, DavClient, Calendar, WebCal, co
114114 const index = owner . indexOf ( '/remote.php/dav/principals/users/' ) ;
115115 if ( index !== - 1 ) {
116116 // '/remote.php/dav/principals/users/'.length === 33
117- return owner . substr ( index + 33 ) ;
117+ return owner . slice ( index + 33 ) ;
118118 }
119119 }
120120
@@ -148,9 +148,9 @@ app.service('CalendarFactory', function($window, DavClient, Calendar, WebCal, co
148148 let displayName = share . getElementsByTagNameNS ( DavClient . NS_OWNCLOUD , 'common-name' ) ;
149149 if ( displayName . length === 0 ) {
150150 if ( href . startsWith ( SHARE_USER_PREFIX ) ) {
151- displayName = href . substr ( SHARE_USER_PREFIX . length ) ;
151+ displayName = href . slice ( SHARE_USER_PREFIX . length ) ;
152152 } else {
153- displayName = href . substr ( SHARE_GROUP_PREFIX . length ) ;
153+ displayName = href . slice ( SHARE_GROUP_PREFIX . length ) ;
154154 }
155155 } else {
156156 displayName = displayName [ 0 ] . textContent ;
@@ -166,21 +166,21 @@ app.service('CalendarFactory', function($window, DavClient, Calendar, WebCal, co
166166 writable = writable . length !== 0 ;
167167
168168 if ( href . startsWith ( SHARE_USER_PREFIX ) ) {
169- if ( href . substr ( SHARE_USER_PREFIX . length ) === owner ) {
169+ if ( href . slice ( SHARE_USER_PREFIX . length ) === owner ) {
170170 // don't overwrite already present displayname
171171 if ( ! ownerDisplayname ) {
172172 ownerDisplayname = displayName ;
173173 }
174174 } else {
175175 shares . users . push ( {
176- id : href . substr ( SHARE_USER_PREFIX . length ) ,
176+ id : href . slice ( SHARE_USER_PREFIX . length ) ,
177177 displayname : displayName ,
178178 writable : writable
179179 } ) ;
180180 }
181181 } else if ( href . startsWith ( SHARE_GROUP_PREFIX ) ) {
182182 shares . groups . push ( {
183- id : href . substr ( SHARE_GROUP_PREFIX . length ) ,
183+ id : href . slice ( SHARE_GROUP_PREFIX . length ) ,
184184 displayname : displayName ,
185185 writable : writable
186186 } ) ;
@@ -219,12 +219,12 @@ app.service('CalendarFactory', function($window, DavClient, Calendar, WebCal, co
219219 if ( angular . isDefined ( props [ '{' + DavClient . NS_CALENDARSERVER + '}publish-url' ] ) ) {
220220 published = true ;
221221 let publishURL = props [ '{' + DavClient . NS_CALENDARSERVER + '}publish-url' ] [ 0 ] . textContent ;
222- if ( publishURL . substr ( - 1 ) === '/' ) {
223- publishURL = publishURL . substr ( 0 , publishURL . length - 1 ) ;
222+ if ( publishURL . slice ( - 1 ) === '/' ) {
223+ publishURL = publishURL . slice ( 0 , - 1 ) ;
224224 }
225225
226226 const lastIndexOfSlash = publishURL . lastIndexOf ( '/' ) ;
227- publicToken = publishURL . substr ( lastIndexOfSlash + 1 ) ;
227+ publicToken = publishURL . slice ( lastIndexOfSlash + 1 ) ;
228228 }
229229
230230 return [ published , publicToken ] ;
@@ -299,7 +299,7 @@ app.service('CalendarFactory', function($window, DavClient, Calendar, WebCal, co
299299 }
300300
301301 const slashIndex = userPrincipal . lastIndexOf ( '/' ) ;
302- return userPrincipal . substr ( slashIndex + 1 ) ;
302+ return userPrincipal . slice ( slashIndex + 1 ) ;
303303 } ;
304304
305305 /**
0 commit comments