From: Jan Szejko Date: Mon, 7 Mar 2016 16:18:13 +0000 (+0100) Subject: fixed absolute image links X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/d18eca472089480206cd023276c1d8fe5439a172 fixed absolute image links --- diff --git a/src/editor/modules/documentCanvas/canvas/documentElement.js b/src/editor/modules/documentCanvas/canvas/documentElement.js index 993064a..dcf05b2 100644 --- a/src/editor/modules/documentCanvas/canvas/documentElement.js +++ b/src/editor/modules/documentCanvas/canvas/documentElement.js @@ -43,7 +43,7 @@ $.extend(DocumentElement.prototype, { this.state[key] = changes[key] = toUpdate[key]; } }.bind(this)); - console.log(changes); + // console.log(changes); if(_.isFunction(this.onStateChange)) { this.onStateChange(changes); if(_.isBoolean(changes.active)) { diff --git a/src/editor/plugins/core/img/imgElement.js b/src/editor/plugins/core/img/imgElement.js index a83fb33..47b1467 100644 --- a/src/editor/plugins/core/img/imgElement.js +++ b/src/editor/plugins/core/img/imgElement.js @@ -114,7 +114,7 @@ _.extend(linkElement, { getUrl: function(link) { var pattern = /^[a-z]*:\/\//g; - if(!pattern.test(link)) { + if(!pattern.test(link) && !/^\//.test(link)) { link = 'http://' + link; } return this.wlxmlNode.document.getUrlForLink(link);