* Updates uri of all active which matches the oldUrl as location * of the file * @param {String} oldUrl * @param {String} newUrl
(oldUrl, newUrl)
| 272 | * @param {String} newUrl |
| 273 | */ |
| 274 | updateUriOfAllActiveFiles(oldUrl, newUrl) { |
| 275 | const files = editorManager.files; |
| 276 | const { url } = Url.parse(oldUrl); |
| 277 | |
| 278 | for (let file of files) { |
| 279 | if (!file.uri) continue; |
| 280 | const fileUrl = Url.parse(file.uri).url; |
| 281 | if (new RegExp("^" + escapeStringRegexp(url)).test(fileUrl)) { |
| 282 | if (newUrl) { |
| 283 | file.uri = Url.join(newUrl, file.filename); |
| 284 | } else { |
| 285 | file.uri = null; |
| 286 | } |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | editorManager.onupdate("file-delete"); |
| 291 | editorManager.emit("update", "file-delete"); |
| 292 | }, |
| 293 | canShowAds() { |
| 294 | return Boolean(!config.HAS_PRO && adRewards.canShowAds()); |
| 295 | }, |
nothing calls this directly
no outgoing calls
no test coverage detected