+ },
+ getUrlForLink: function(link) {
+ var cfg = this.options.editorConfig;
+ if(link.substr(0, 7) === 'file://' && cfg && cfg.documentAttachmentUrl) {
+ 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;
+ },
+ setProperty: function(propName, propValue) {
+ if(this.properties[propName] !== propValue) {
+ this.properties[propName] = propValue;
+ this.trigger('propertyChanged', propName, propValue);
+ }