1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Load resources in WebView and put todos on top

This commit is contained in:
Laurent Cozic
2017-07-26 19:36:16 +01:00
parent 76914d6c28
commit f80263ab71
10 changed files with 156 additions and 43 deletions

View File

@ -44,6 +44,15 @@ class Resource extends BaseItem {
return this.fsDriver().writeBinaryFile(this.fullPath(resource), content);
}
static isResourceUrl(url) {
return url.length === 34 && url[0] === ':' && url[1] === '/';
}
static urlToId(url) {
if (!this.isResourceUrl(url)) throw new Error('Not a valid resource URL: ' + url);
return url.substr(2);
}
}
export { Resource };