X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/b9558104eca9970ffba7f8e461e4878e70214114..796338e669626012da93ebea5ec7afa482a70ed7:/src/editor/modules/data/document.js diff --git a/src/editor/modules/data/document.js b/src/editor/modules/data/document.js index db2b7a8..23aa000 100644 --- a/src/editor/modules/data/document.js +++ b/src/editor/modules/data/document.js @@ -45,6 +45,14 @@ _.extend(Document.prototype, { link = cfg.documentAttachmentUrl(link.substr(7)); } return link; + }, + getLinkForUrl: function(url) { + /* globals window */ + var baseUrl = function(url) {return url.split('/').slice(0,-1).join('/');}; + if(baseUrl(url) === baseUrl(window.location.origin + this.getUrlForLink('file://test'))) { + return 'file://' + _.last(url.split('/')); + } + return url; } });