From 490794dfb9875eceaddea648919fa5cd54ebf23b Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 9 Oct 2010 19:22:28 +0000 Subject: [PATCH] More XPI fixes for TinyMCE --- chrome/content/zotero/tinymce/tiny_mce.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/tinymce/tiny_mce.js b/chrome/content/zotero/tinymce/tiny_mce.js index 5d8db23f8..5092334fe 100755 --- a/chrome/content/zotero/tinymce/tiny_mce.js +++ b/chrome/content/zotero/tinymce/tiny_mce.js @@ -537,21 +537,26 @@ tinymce.create('tinymce.util.Dispatcher', { return; } + // Added by Dan S./Zotero + u = u.replace("jar:file", "jarfile"); + u = u.replace("zotero@chnm.gmu.edu", "zotero.chnm.gmu.edu"); + // Absolute path with no host, fake host and protocol if (u.indexOf('/') === 0 && u.indexOf('//') !== 0) u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u; // Relative path http:// or protocol relative //path if (!/^\w*:?\/\//.test(u)) - u = (s.base_uri.protocol || 'http') + '://mce_host' + t.toAbsPath(s.base_uri.path, u); + // Modified by Dan S./Zotero + //u = (s.base_uri.protocol || 'http') + '://mce_host' + t.toAbsPath(s.base_uri.path, u); + u = s.base_uri.protocol + '://' + s.base_uri.path + '/' + u; + + // Added by Dan S./Zotero + u = u.replace("jar:file", "jarfile"); + u = u.replace("zotero@chnm.gmu.edu", "zotero.chnm.gmu.edu"); // Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri) u = u.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something - - // Added by Dan S./Zotero - u = u.replace("jar:file", "jarfile"); - u = u.replace("zotero@chnm.gmu.edu", "zotero.chnm.gmu.edu"); - u = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u); each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) { var s = u[i];