mirror of
https://github.com/e107inc/e107.git
synced 2025-10-12 05:24:38 +02:00
TinyMce fixes
This commit is contained in:
1
e107_plugins/tinymce/jquery.tinymce.js
Normal file
1
e107_plugins/tinymce/jquery.tinymce.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
(function(c){var b,e,a=[],d=window;c.fn.tinymce=function(j){var p=this,g,k,h,m,i,l="",n="";if(!p.length){return p}if(!j){return tinyMCE.get(p[0].id)}p.css("visibility","hidden");function o(){var r=[],q=0;if(f){f();f=null}p.each(function(t,u){var s,w=u.id,v=j.oninit;if(!w){u.id=w=tinymce.DOM.uniqueId()}s=new tinymce.Editor(w,j);r.push(s);s.onInit.add(function(){var x,y=v;p.css("visibility","");if(v){if(++q==r.length){if(tinymce.is(y,"string")){x=(y.indexOf(".")===-1)?null:tinymce.resolve(y.replace(/\.\w+$/,""));y=tinymce.resolve(y)}y.apply(x||tinymce,r)}}})});c.each(r,function(t,s){s.render()})}if(!d.tinymce&&!e&&(g=j.script_url)){e=1;h=g.substring(0,g.lastIndexOf("/"));if(/_(src|dev)\.js/g.test(g)){n="_src"}m=g.lastIndexOf("?");if(m!=-1){l=g.substring(m+1)}d.tinyMCEPreInit=d.tinyMCEPreInit||{base:h,suffix:n,query:l};if(g.indexOf("gzip")!=-1){i=j.language||"en";g=g+(/\?/.test(g)?"&":"?")+"js=true&core=true&suffix="+escape(n)+"&themes="+escape(j.theme)+"&plugins="+escape(j.plugins)+"&languages="+i;if(!d.tinyMCE_GZ){tinyMCE_GZ={start:function(){tinymce.suffix=n;function q(r){tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(r))}q("langs/"+i+".js");q("themes/"+j.theme+"/editor_template"+n+".js");q("themes/"+j.theme+"/langs/"+i+".js");c.each(j.plugins.split(","),function(s,r){if(r){q("plugins/"+r+"/editor_plugin"+n+".js");q("plugins/"+r+"/langs/"+i+".js")}})},end:function(){}}}}c.ajax({type:"GET",url:g,dataType:"script",cache:true,success:function(){tinymce.dom.Event.domLoaded=1;e=2;if(j.script_loaded){j.script_loaded()}o();c.each(a,function(q,r){r()})}})}else{if(e===1){a.push(o)}else{o()}}return p};c.extend(c.expr[":"],{tinymce:function(g){return !!(g.id&&"tinyMCE" in window&&tinyMCE.get(g.id))}});function f(){function i(l){if(l==="remove"){this.each(function(n,o){var m=h(o);if(m){m.remove()}})}this.find("span.mceEditor,div.mceEditor").each(function(n,o){var m=tinyMCE.get(o.id.replace(/_parent$/,""));if(m){m.remove()}})}function k(n){var m=this,l;if(n!==b){i.call(m);m.each(function(p,q){var o;if(o=tinyMCE.get(q.id)){o.setContent(n)}})}else{if(m.length>0){if(l=tinyMCE.get(m[0].id)){return l.getContent()}}}}function h(m){var l=null;(m)&&(m.id)&&(d.tinymce)&&(l=tinyMCE.get(m.id));return l}function g(l){return !!((l)&&(l.length)&&(d.tinymce)&&(l.is(":tinymce")))}var j={};c.each(["text","html","val"],function(n,l){var o=j[l]=c.fn[l],m=(l==="text");c.fn[l]=function(s){var p=this;if(!g(p)){return o.apply(p,arguments)}if(s!==b){k.call(p.filter(":tinymce"),s);o.apply(p.not(":tinymce"),arguments);return p}else{var r="";var q=arguments;(m?p:p.eq(0)).each(function(u,v){var t=h(v);r+=t?(m?t.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):t.getContent({save:true})):o.apply(c(v),q)});return r}}});c.each(["append","prepend"],function(n,m){var o=j[m]=c.fn[m],l=(m==="prepend");c.fn[m]=function(q){var p=this;if(!g(p)){return o.apply(p,arguments)}if(q!==b){p.filter(":tinymce").each(function(s,t){var r=h(t);r&&r.setContent(l?q+r.getContent():r.getContent()+q)});o.apply(p.not(":tinymce"),arguments);return p}}});c.each(["remove","replaceWith","replaceAll","empty"],function(m,l){var n=j[l]=c.fn[l];c.fn[l]=function(){i.call(this,l);return n.apply(this,arguments)}});j.attr=c.fn.attr;c.fn.attr=function(o,q){var m=this,n=arguments;if((!o)||(o!=="value")||(!g(m))){if(q!==b){return j.attr.apply(m,n)}else{return j.attr.apply(m,n)}}if(q!==b){k.call(m.filter(":tinymce"),q);j.attr.apply(m.not(":tinymce"),n);return m}else{var p=m[0],l=h(p);return l?l.getContent({save:true}):j.attr.apply(c(p),n)}}}})(jQuery);
|
@@ -1,119 +1,119 @@
|
|||||||
/**
|
/**
|
||||||
* editor_plugin_src.js
|
* editor_plugin_src.js
|
||||||
*
|
*
|
||||||
* Copyright 2009, Moxiecode Systems AB
|
* Copyright 2009, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://tinymce.moxiecode.com/license
|
* License: http://tinymce.moxiecode.com/license
|
||||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
/**
|
/**
|
||||||
* Auto Resize
|
* Auto Resize
|
||||||
*
|
*
|
||||||
* This plugin automatically resizes the content area to fit its content height.
|
* This plugin automatically resizes the content area to fit its content height.
|
||||||
* It will retain a minimum height, which is the height of the content area when
|
* It will retain a minimum height, which is the height of the content area when
|
||||||
* it's initialized.
|
* it's initialized.
|
||||||
*/
|
*/
|
||||||
tinymce.create('tinymce.plugins.AutoResizePlugin', {
|
tinymce.create('tinymce.plugins.AutoResizePlugin', {
|
||||||
/**
|
/**
|
||||||
* Initializes the plugin, this will be executed after the plugin has been created.
|
* Initializes the plugin, this will be executed after the plugin has been created.
|
||||||
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
||||||
* of the editor instance to intercept that event.
|
* of the editor instance to intercept that event.
|
||||||
*
|
*
|
||||||
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
||||||
* @param {string} url Absolute URL to where the plugin is located.
|
* @param {string} url Absolute URL to where the plugin is located.
|
||||||
*/
|
*/
|
||||||
init : function(ed, url) {
|
init : function(ed, url) {
|
||||||
var t = this, oldSize = 0;
|
var t = this, oldSize = 0;
|
||||||
|
|
||||||
if (ed.getParam('fullscreen_is_enabled'))
|
if (ed.getParam('fullscreen_is_enabled'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method gets executed each time the editor needs to resize.
|
* This method gets executed each time the editor needs to resize.
|
||||||
*/
|
*/
|
||||||
function resize() {
|
function resize() {
|
||||||
var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
|
var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
|
||||||
|
|
||||||
// Get height differently depending on the browser used
|
// Get height differently depending on the browser used
|
||||||
myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
|
myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
|
||||||
|
|
||||||
// Don't make it smaller than the minimum height
|
// Don't make it smaller than the minimum height
|
||||||
if (myHeight > t.autoresize_min_height)
|
if (myHeight > t.autoresize_min_height)
|
||||||
resizeHeight = myHeight;
|
resizeHeight = myHeight;
|
||||||
|
|
||||||
// If a maximum height has been defined don't exceed this height
|
// If a maximum height has been defined don't exceed this height
|
||||||
if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
|
if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
|
||||||
resizeHeight = t.autoresize_max_height;
|
resizeHeight = t.autoresize_max_height;
|
||||||
body.style.overflowY = "auto";
|
body.style.overflowY = "auto";
|
||||||
de.style.overflowY = "auto"; // Old IE
|
de.style.overflowY = "auto"; // Old IE
|
||||||
} else {
|
} else {
|
||||||
body.style.overflowY = "hidden";
|
body.style.overflowY = "hidden";
|
||||||
de.style.overflowY = "hidden"; // Old IE
|
de.style.overflowY = "hidden"; // Old IE
|
||||||
body.scrollTop = 0;
|
body.scrollTop = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resize content element
|
// Resize content element
|
||||||
if (resizeHeight !== oldSize) {
|
if (resizeHeight !== oldSize) {
|
||||||
deltaSize = resizeHeight - oldSize;
|
deltaSize = resizeHeight - oldSize;
|
||||||
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
|
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
|
||||||
oldSize = resizeHeight;
|
oldSize = resizeHeight;
|
||||||
|
|
||||||
// WebKit doesn't decrease the size of the body element until the iframe gets resized
|
// WebKit doesn't decrease the size of the body element until the iframe gets resized
|
||||||
// So we need to continue to resize the iframe down until the size gets fixed
|
// So we need to continue to resize the iframe down until the size gets fixed
|
||||||
if (tinymce.isWebKit && deltaSize < 0)
|
if (tinymce.isWebKit && deltaSize < 0)
|
||||||
resize();
|
resize();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
t.editor = ed;
|
t.editor = ed;
|
||||||
|
|
||||||
// Define minimum height
|
// Define minimum height
|
||||||
t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
|
t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
|
||||||
|
|
||||||
// Define maximum height
|
// Define maximum height
|
||||||
t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
|
t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
|
||||||
|
|
||||||
// Add padding at the bottom for better UX
|
// Add padding at the bottom for better UX
|
||||||
ed.onInit.add(function(ed){
|
ed.onInit.add(function(ed){
|
||||||
ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px');
|
ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add appropriate listeners for resizing content area
|
// Add appropriate listeners for resizing content area
|
||||||
ed.onChange.add(resize);
|
ed.onChange.add(resize);
|
||||||
ed.onSetContent.add(resize);
|
ed.onSetContent.add(resize);
|
||||||
ed.onPaste.add(resize);
|
ed.onPaste.add(resize);
|
||||||
ed.onKeyUp.add(resize);
|
ed.onKeyUp.add(resize);
|
||||||
ed.onPostRender.add(resize);
|
ed.onPostRender.add(resize);
|
||||||
|
|
||||||
if (ed.getParam('autoresize_on_init', true)) {
|
if (ed.getParam('autoresize_on_init', true)) {
|
||||||
ed.onLoad.add(resize);
|
ed.onLoad.add(resize);
|
||||||
ed.onLoadContent.add(resize);
|
ed.onLoadContent.add(resize);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
||||||
ed.addCommand('mceAutoResize', resize);
|
ed.addCommand('mceAutoResize', resize);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns information about the plugin as a name/value array.
|
* Returns information about the plugin as a name/value array.
|
||||||
* The current keys are longname, author, authorurl, infourl and version.
|
* The current keys are longname, author, authorurl, infourl and version.
|
||||||
*
|
*
|
||||||
* @return {Object} Name/value array containing information about the plugin.
|
* @return {Object} Name/value array containing information about the plugin.
|
||||||
*/
|
*/
|
||||||
getInfo : function() {
|
getInfo : function() {
|
||||||
return {
|
return {
|
||||||
longname : 'Auto Resize',
|
longname : 'Auto Resize',
|
||||||
author : 'Moxiecode Systems AB',
|
author : 'Moxiecode Systems AB',
|
||||||
authorurl : 'http://tinymce.moxiecode.com',
|
authorurl : 'http://tinymce.moxiecode.com',
|
||||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
|
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
|
||||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Register plugin
|
// Register plugin
|
||||||
tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
|
tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
|
||||||
})();
|
})();
|
||||||
|
@@ -1 +1 @@
|
|||||||
(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){h.storeDraft();i.nodeChanged()},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();try{m.save("TinyMCE")}catch(o){}},getItem:function(l){var m=i.getElement();try{m.load("TinyMCE");return m.getAttribute(l)}catch(n){return null}},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,j=h.storage,i;if(j){i=j.getItem(h.key);if(i){h.editor.setContent(i);h.onRestoreDraft.dispatch(h,{content:i})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()<i.getTime()){return b}h.removeDraft()}else{return b}}}return false},removeDraft:function(){var h=this,k=h.storage,i=h.key,j;if(k){j=k.getItem(i);k.removeItem(i);k.removeItem(i+"_expires");if(j){h.onRemoveDraft.dispatch(h,{content:j})}}},"static":{_beforeUnloadHandler:function(h){var i;e.each(tinyMCE.editors,function(j){if(j.plugins.autosave){j.plugins.autosave.storeDraft()}if(j.getParam("fullscreen_is_enabled")){return}if(!i&&j.isDirty()&&j.getParam("autosave_ask_before_unload")){i=j.getLang("autosave.unload_msg")}});return i}}});e.PluginManager.add("autosave",e.plugins.AutoSave)})(tinymce);
|
(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){if(!i.removed){h.storeDraft();i.nodeChanged()}},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();try{m.save("TinyMCE")}catch(o){}},getItem:function(l){var m=i.getElement();try{m.load("TinyMCE");return m.getAttribute(l)}catch(n){return null}},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,j=h.storage,i;if(j){i=j.getItem(h.key);if(i){h.editor.setContent(i);h.onRestoreDraft.dispatch(h,{content:i})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()<i.getTime()){return b}h.removeDraft()}else{return b}}}return false},removeDraft:function(){var h=this,k=h.storage,i=h.key,j;if(k){j=k.getItem(i);k.removeItem(i);k.removeItem(i+"_expires");if(j){h.onRemoveDraft.dispatch(h,{content:j})}}},"static":{_beforeUnloadHandler:function(h){var i;e.each(tinyMCE.editors,function(j){if(j.plugins.autosave){j.plugins.autosave.storeDraft()}if(j.getParam("fullscreen_is_enabled")){return}if(!i&&j.isDirty()&&j.getParam("autosave_ask_before_unload")){i=j.getLang("autosave.unload_msg")}});return i}}});e.PluginManager.add("autosave",e.plugins.AutoSave)})(tinymce);
|
@@ -136,8 +136,10 @@
|
|||||||
|
|
||||||
// Auto save contents each interval time
|
// Auto save contents each interval time
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
self.storeDraft();
|
if (!ed.removed) {
|
||||||
ed.nodeChanged();
|
self.storeDraft();
|
||||||
|
ed.nodeChanged();
|
||||||
|
}
|
||||||
}, settings.autosave_interval);
|
}, settings.autosave_interval);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -1 +1 @@
|
|||||||
(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(e){var h=this,f,d,i;h.editor=e;d=e.settings.contextmenu_never_use_native;h.onContextMenu=new tinymce.util.Dispatcher(this);f=e.onContextMenu.add(function(j,k){if((i!==0?i:k.ctrlKey)&&!d){return}a.cancel(k);if(k.target.nodeName=="IMG"){j.selection.select(k.target)}h._getMenu(j).showMenu(k.clientX||k.pageX,k.clientY||k.pageY);a.add(j.getDoc(),"click",function(l){g(j,l)});j.nodeChanged()});e.onRemove.add(function(){if(h._menu){h._menu.removeAll()}});function g(j,k){i=0;if(k&&k.button==2){i=k.ctrlKey;return}if(h._menu){h._menu.removeAll();h._menu.destroy();a.remove(j.getDoc(),"click",g);h._menu=null}}e.onMouseDown.add(g);e.onKeyDown.add(g);e.onKeyDown.add(function(j,k){if(k.shiftKey&&!k.ctrlKey&&!k.altKey&&k.keyCode===121){a.cancel(k);f(j,k)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
|
(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(f){var i=this,g,d,j,e;i.editor=f;d=f.settings.contextmenu_never_use_native;i.onContextMenu=new tinymce.util.Dispatcher(this);e=function(k){h(f,k)};g=f.onContextMenu.add(function(k,l){if((j!==0?j:l.ctrlKey)&&!d){return}a.cancel(l);if(l.target.nodeName=="IMG"){k.selection.select(l.target)}i._getMenu(k).showMenu(l.clientX||l.pageX,l.clientY||l.pageY);a.add(k.getDoc(),"click",e);k.nodeChanged()});f.onRemove.add(function(){if(i._menu){i._menu.removeAll()}});function h(k,l){j=0;if(l&&l.button==2){j=l.ctrlKey;return}if(i._menu){i._menu.removeAll();i._menu.destroy();a.remove(k.getDoc(),"click",e);i._menu=null}}f.onMouseDown.add(h);f.onKeyDown.add(h);f.onKeyDown.add(function(k,l){if(l.shiftKey&&!l.ctrlKey&&!l.altKey&&l.keyCode===121){a.cancel(l);g(k,l)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
|
@@ -27,7 +27,7 @@
|
|||||||
* @param {string} url Absolute URL to where the plugin is located.
|
* @param {string} url Absolute URL to where the plugin is located.
|
||||||
*/
|
*/
|
||||||
init : function(ed) {
|
init : function(ed) {
|
||||||
var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey;
|
var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey, hideMenu;
|
||||||
|
|
||||||
t.editor = ed;
|
t.editor = ed;
|
||||||
|
|
||||||
@@ -42,6 +42,10 @@
|
|||||||
*/
|
*/
|
||||||
t.onContextMenu = new tinymce.util.Dispatcher(this);
|
t.onContextMenu = new tinymce.util.Dispatcher(this);
|
||||||
|
|
||||||
|
hideMenu = function(e) {
|
||||||
|
hide(ed, e);
|
||||||
|
};
|
||||||
|
|
||||||
showMenu = ed.onContextMenu.add(function(ed, e) {
|
showMenu = ed.onContextMenu.add(function(ed, e) {
|
||||||
// Block TinyMCE menu on ctrlKey and work around Safari issue
|
// Block TinyMCE menu on ctrlKey and work around Safari issue
|
||||||
if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative)
|
if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative)
|
||||||
@@ -54,13 +58,11 @@
|
|||||||
ed.selection.select(e.target);
|
ed.selection.select(e.target);
|
||||||
|
|
||||||
t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY);
|
t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY);
|
||||||
Event.add(ed.getDoc(), 'click', function(e) {
|
Event.add(ed.getDoc(), 'click', hideMenu);
|
||||||
hide(ed, e);
|
|
||||||
});
|
|
||||||
|
|
||||||
ed.nodeChanged();
|
ed.nodeChanged();
|
||||||
});
|
});
|
||||||
|
|
||||||
ed.onRemove.add(function() {
|
ed.onRemove.add(function() {
|
||||||
if (t._menu)
|
if (t._menu)
|
||||||
t._menu.removeAll();
|
t._menu.removeAll();
|
||||||
@@ -78,8 +80,8 @@
|
|||||||
|
|
||||||
if (t._menu) {
|
if (t._menu) {
|
||||||
t._menu.removeAll();
|
t._menu.removeAll();
|
||||||
t._menu.destroy();
|
t._menu.destroy();
|
||||||
Event.remove(ed.getDoc(), 'click', hide);
|
Event.remove(ed.getDoc(), 'click', hideMenu);
|
||||||
t._menu = null;
|
t._menu = null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -19,8 +19,8 @@ if($_POST['mode'] == 'tohtml')
|
|||||||
|
|
||||||
if($_POST['mode'] == 'tobbcode')
|
if($_POST['mode'] == 'tobbcode')
|
||||||
{
|
{
|
||||||
//echo $_POST['content'];
|
// echo $_POST['content'];
|
||||||
echo e107::getBB()->htmltoBBcode($_POST['content']);
|
echo e107::getBB()->htmltoBBcode($_POST['content']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -28,6 +28,10 @@
|
|||||||
["Audio"]
|
["Audio"]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
function normalizeSize(size) {
|
||||||
|
return typeof(size) == "string" ? size.replace(/[^0-9%]/g, '') : size;
|
||||||
|
}
|
||||||
|
|
||||||
function toArray(obj) {
|
function toArray(obj) {
|
||||||
var undef, out, i;
|
var undef, out, i;
|
||||||
|
|
||||||
@@ -258,8 +262,8 @@
|
|||||||
'data-mce-json' : JSON.serialize(data, "'")
|
'data-mce-json' : JSON.serialize(data, "'")
|
||||||
});
|
});
|
||||||
|
|
||||||
img.width = data.width || (data.type == 'audio' ? "300" : "320");
|
img.width = data.width = normalizeSize(data.width || (data.type == 'audio' ? "300" : "320"));
|
||||||
img.height = data.height || (data.type == 'audio' ? "32" : "240");
|
img.height = data.height = normalizeSize(data.height || (data.type == 'audio' ? "32" : "240"));
|
||||||
|
|
||||||
return img;
|
return img;
|
||||||
},
|
},
|
||||||
@@ -386,6 +390,10 @@
|
|||||||
style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img'));
|
style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use node width/height to override the data width/height when the placeholder is resized
|
||||||
|
data.width = node.attr('width') || data.width;
|
||||||
|
data.height = node.attr('height') || data.height;
|
||||||
|
|
||||||
// Handle iframe
|
// Handle iframe
|
||||||
if (typeItem.name === 'Iframe') {
|
if (typeItem.name === 'Iframe') {
|
||||||
replacement = new Node('iframe', 1);
|
replacement = new Node('iframe', 1);
|
||||||
@@ -434,8 +442,8 @@
|
|||||||
// Create new object element
|
// Create new object element
|
||||||
video = new Node('video', 1).attr(tinymce.extend({
|
video = new Node('video', 1).attr(tinymce.extend({
|
||||||
id : node.attr('id'),
|
id : node.attr('id'),
|
||||||
width: node.attr('width'),
|
width: normalizeSize(node.attr('width')),
|
||||||
height: node.attr('height'),
|
height: normalizeSize(node.attr('height')),
|
||||||
style : style
|
style : style
|
||||||
}, data.video.attrs));
|
}, data.video.attrs));
|
||||||
|
|
||||||
@@ -473,8 +481,8 @@
|
|||||||
// Create new object element
|
// Create new object element
|
||||||
audio = new Node('audio', 1).attr(tinymce.extend({
|
audio = new Node('audio', 1).attr(tinymce.extend({
|
||||||
id : node.attr('id'),
|
id : node.attr('id'),
|
||||||
width: node.attr('width'),
|
width: normalizeSize(node.attr('width')),
|
||||||
height: node.attr('height'),
|
height: normalizeSize(node.attr('height')),
|
||||||
style : style
|
style : style
|
||||||
}, data.video.attrs));
|
}, data.video.attrs));
|
||||||
|
|
||||||
@@ -502,8 +510,8 @@
|
|||||||
embed.shortEnded = true;
|
embed.shortEnded = true;
|
||||||
embed.attr({
|
embed.attr({
|
||||||
id: node.attr('id'),
|
id: node.attr('id'),
|
||||||
width: node.attr('width'),
|
width: normalizeSize(node.attr('width')),
|
||||||
height: node.attr('height'),
|
height: normalizeSize(node.attr('height')),
|
||||||
style : style,
|
style : style,
|
||||||
type: node.attr('type')
|
type: node.attr('type')
|
||||||
});
|
});
|
||||||
@@ -531,8 +539,8 @@
|
|||||||
// Create new object element
|
// Create new object element
|
||||||
object = new Node('object', 1).attr({
|
object = new Node('object', 1).attr({
|
||||||
id : node.attr('id'),
|
id : node.attr('id'),
|
||||||
width: node.attr('width'),
|
width: normalizeSize(node.attr('width')),
|
||||||
height: node.attr('height'),
|
height: normalizeSize(node.attr('height')),
|
||||||
style : style
|
style : style
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -576,8 +584,8 @@
|
|||||||
embed.shortEnded = true;
|
embed.shortEnded = true;
|
||||||
embed.attr({
|
embed.attr({
|
||||||
id: node.attr('id'),
|
id: node.attr('id'),
|
||||||
width: node.attr('width'),
|
width: normalizeSize(node.attr('width')),
|
||||||
height: node.attr('height'),
|
height: normalizeSize(node.attr('height')),
|
||||||
style : style,
|
style : style,
|
||||||
type: typeItem.mimes[0]
|
type: typeItem.mimes[0]
|
||||||
});
|
});
|
||||||
@@ -793,8 +801,8 @@
|
|||||||
|
|
||||||
if (iframe) {
|
if (iframe) {
|
||||||
// Get width/height
|
// Get width/height
|
||||||
width = iframe.attr('width');
|
width = normalizeSize(iframe.attr('width'));
|
||||||
height = iframe.attr('height');
|
height = normalizeSize(iframe.attr('height'));
|
||||||
style = style || iframe.attr('style');
|
style = style || iframe.attr('style');
|
||||||
id = iframe.attr('id');
|
id = iframe.attr('id');
|
||||||
hspace = iframe.attr('hspace');
|
hspace = iframe.attr('hspace');
|
||||||
|
@@ -1 +1 @@
|
|||||||
tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" });
|
tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" });
|
||||||
|
@@ -1 +1 @@
|
|||||||
tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",toggle_insert_span:"Insert span at selection",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"});
|
tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",toggle_insert_span:"Insert span at selection",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"});
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,122 +1,122 @@
|
|||||||
/**
|
/**
|
||||||
* editor_plugin_src.js
|
* editor_plugin_src.js
|
||||||
*
|
*
|
||||||
* Copyright 2009, Moxiecode Systems AB
|
* Copyright 2009, Moxiecode Systems AB
|
||||||
* Released under LGPL License.
|
* Released under LGPL License.
|
||||||
*
|
*
|
||||||
* License: http://tinymce.moxiecode.com/license
|
* License: http://tinymce.moxiecode.com/license
|
||||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;
|
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;
|
||||||
|
|
||||||
tinymce.create('tinymce.plugins.TabFocusPlugin', {
|
tinymce.create('tinymce.plugins.TabFocusPlugin', {
|
||||||
init : function(ed, url) {
|
init : function(ed, url) {
|
||||||
function tabCancel(ed, e) {
|
function tabCancel(ed, e) {
|
||||||
if (e.keyCode === 9)
|
if (e.keyCode === 9)
|
||||||
return Event.cancel(e);
|
return Event.cancel(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
function tabHandler(ed, e) {
|
function tabHandler(ed, e) {
|
||||||
var x, i, f, el, v;
|
var x, i, f, el, v;
|
||||||
|
|
||||||
function find(d) {
|
function find(d) {
|
||||||
el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
|
el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
|
||||||
|
|
||||||
function canSelectRecursive(e) {
|
function canSelectRecursive(e) {
|
||||||
return e.nodeName==="BODY" || (e.type != 'hidden' &&
|
return e.nodeName==="BODY" || (e.type != 'hidden' &&
|
||||||
!(e.style.display == "none") &&
|
!(e.style.display == "none") &&
|
||||||
!(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode));
|
!(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode));
|
||||||
}
|
}
|
||||||
function canSelectInOldIe(el) {
|
function canSelectInOldIe(el) {
|
||||||
return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
|
return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
|
||||||
}
|
}
|
||||||
function isOldIe() {
|
function isOldIe() {
|
||||||
return tinymce.isIE6 || tinymce.isIE7;
|
return tinymce.isIE6 || tinymce.isIE7;
|
||||||
}
|
}
|
||||||
function canSelect(el) {
|
function canSelect(el) {
|
||||||
return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
|
return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
each(el, function(e, i) {
|
each(el, function(e, i) {
|
||||||
if (e.id == ed.id) {
|
if (e.id == ed.id) {
|
||||||
x = i;
|
x = i;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (d > 0) {
|
if (d > 0) {
|
||||||
for (i = x + 1; i < el.length; i++) {
|
for (i = x + 1; i < el.length; i++) {
|
||||||
if (canSelect(el[i]))
|
if (canSelect(el[i]))
|
||||||
return el[i];
|
return el[i];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = x - 1; i >= 0; i--) {
|
for (i = x - 1; i >= 0; i--) {
|
||||||
if (canSelect(el[i]))
|
if (canSelect(el[i]))
|
||||||
return el[i];
|
return el[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.keyCode === 9) {
|
if (e.keyCode === 9) {
|
||||||
v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));
|
v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));
|
||||||
|
|
||||||
if (v.length == 1) {
|
if (v.length == 1) {
|
||||||
v[1] = v[0];
|
v[1] = v[0];
|
||||||
v[0] = ':prev';
|
v[0] = ':prev';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find element to focus
|
// Find element to focus
|
||||||
if (e.shiftKey) {
|
if (e.shiftKey) {
|
||||||
if (v[0] == ':prev')
|
if (v[0] == ':prev')
|
||||||
el = find(-1);
|
el = find(-1);
|
||||||
else
|
else
|
||||||
el = DOM.get(v[0]);
|
el = DOM.get(v[0]);
|
||||||
} else {
|
} else {
|
||||||
if (v[1] == ':next')
|
if (v[1] == ':next')
|
||||||
el = find(1);
|
el = find(1);
|
||||||
else
|
else
|
||||||
el = DOM.get(v[1]);
|
el = DOM.get(v[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (el) {
|
if (el) {
|
||||||
if (el.id && (ed = tinymce.get(el.id || el.name)))
|
if (el.id && (ed = tinymce.get(el.id || el.name)))
|
||||||
ed.focus();
|
ed.focus();
|
||||||
else
|
else
|
||||||
window.setTimeout(function() {
|
window.setTimeout(function() {
|
||||||
if (!tinymce.isWebKit)
|
if (!tinymce.isWebKit)
|
||||||
window.focus();
|
window.focus();
|
||||||
el.focus();
|
el.focus();
|
||||||
}, 10);
|
}, 10);
|
||||||
|
|
||||||
return Event.cancel(e);
|
return Event.cancel(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ed.onKeyUp.add(tabCancel);
|
ed.onKeyUp.add(tabCancel);
|
||||||
|
|
||||||
if (tinymce.isGecko) {
|
if (tinymce.isGecko) {
|
||||||
ed.onKeyPress.add(tabHandler);
|
ed.onKeyPress.add(tabHandler);
|
||||||
ed.onKeyDown.add(tabCancel);
|
ed.onKeyDown.add(tabCancel);
|
||||||
} else
|
} else
|
||||||
ed.onKeyDown.add(tabHandler);
|
ed.onKeyDown.add(tabHandler);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getInfo : function() {
|
getInfo : function() {
|
||||||
return {
|
return {
|
||||||
longname : 'Tabfocus',
|
longname : 'Tabfocus',
|
||||||
author : 'Moxiecode Systems AB',
|
author : 'Moxiecode Systems AB',
|
||||||
authorurl : 'http://tinymce.moxiecode.com',
|
authorurl : 'http://tinymce.moxiecode.com',
|
||||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',
|
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',
|
||||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Register plugin
|
// Register plugin
|
||||||
tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);
|
tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);
|
||||||
})();
|
})();
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -247,7 +247,10 @@ function insertTable() {
|
|||||||
|
|
||||||
// Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document
|
// Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document
|
||||||
if (tinymce.isIE && node.nextSibling == null) {
|
if (tinymce.isIE && node.nextSibling == null) {
|
||||||
dom.insertAfter(dom.create('p'), node);
|
if (inst.settings.forced_root_block)
|
||||||
|
dom.insertAfter(dom.create(inst.settings.forced_root_block), node);
|
||||||
|
else
|
||||||
|
dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -304,6 +307,15 @@ function init() {
|
|||||||
var formObj = document.forms[0];
|
var formObj = document.forms[0];
|
||||||
var elm = dom.getParent(inst.selection.getNode(), "table");
|
var elm = dom.getParent(inst.selection.getNode(), "table");
|
||||||
|
|
||||||
|
// Hide advanced fields that isn't available in the schema
|
||||||
|
tinymce.each("summary id rules dir style frame".split(" "), function(name) {
|
||||||
|
var tr = tinyMCEPopup.dom.getParent(name, "tr") || tinyMCEPopup.dom.getParent("t" + name, "tr");
|
||||||
|
|
||||||
|
if (tr && !tinyMCEPopup.editor.schema.isValid("table", name)) {
|
||||||
|
tr.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
action = tinyMCEPopup.getWindowArg('action');
|
action = tinyMCEPopup.getWindowArg('action');
|
||||||
|
|
||||||
if (!action)
|
if (!action)
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -154,19 +154,27 @@
|
|||||||
t.editor = ed;
|
t.editor = ed;
|
||||||
t.url = url;
|
t.url = url;
|
||||||
t.onResolveName = new tinymce.util.Dispatcher(this);
|
t.onResolveName = new tinymce.util.Dispatcher(this);
|
||||||
|
s = ed.settings;
|
||||||
|
|
||||||
ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast();
|
ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast();
|
||||||
ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin;
|
ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin;
|
||||||
|
|
||||||
|
// Setup default buttons
|
||||||
|
if (!s.theme_advanced_buttons1) {
|
||||||
|
s = extend({
|
||||||
|
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",
|
||||||
|
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",
|
||||||
|
theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap"
|
||||||
|
}, s);
|
||||||
|
}
|
||||||
|
|
||||||
// Default settings
|
// Default settings
|
||||||
t.settings = s = extend({
|
t.settings = s = extend({
|
||||||
theme_advanced_path : true,
|
theme_advanced_path : true,
|
||||||
theme_advanced_toolbar_location : 'bottom',
|
theme_advanced_toolbar_location : 'top',
|
||||||
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",
|
|
||||||
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",
|
|
||||||
theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap",
|
|
||||||
theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
|
theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
|
||||||
theme_advanced_toolbar_align : "center",
|
theme_advanced_toolbar_align : "left",
|
||||||
|
theme_advanced_statusbar_location : "bottom",
|
||||||
theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
|
theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
|
||||||
theme_advanced_more_colors : 1,
|
theme_advanced_more_colors : 1,
|
||||||
theme_advanced_row_height : 23,
|
theme_advanced_row_height : 23,
|
||||||
@@ -176,7 +184,7 @@
|
|||||||
theme_advanced_font_selector : "span",
|
theme_advanced_font_selector : "span",
|
||||||
theme_advanced_show_current_color: 0,
|
theme_advanced_show_current_color: 0,
|
||||||
readonly : ed.settings.readonly
|
readonly : ed.settings.readonly
|
||||||
}, ed.settings);
|
}, s);
|
||||||
|
|
||||||
// Setup default font_size_style_values
|
// Setup default font_size_style_values
|
||||||
if (!s.font_size_style_values)
|
if (!s.font_size_style_values)
|
||||||
|
@@ -40,11 +40,13 @@ var AnchorDialog = {
|
|||||||
if (elm) {
|
if (elm) {
|
||||||
elm.setAttribute(attribName, name);
|
elm.setAttribute(attribName, name);
|
||||||
elm[attribName] = name;
|
elm[attribName] = name;
|
||||||
|
ed.undoManager.add();
|
||||||
} else {
|
} else {
|
||||||
// create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it
|
// create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it
|
||||||
var attrs = {'class' : 'mceItemAnchor'};
|
var attrs = {'class' : 'mceItemAnchor'};
|
||||||
attrs[attribName] = name;
|
attrs[attribName] = name;
|
||||||
ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', attrs, '\uFEFF'));
|
ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', attrs, '\uFEFF'));
|
||||||
|
ed.nodeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
tinyMCEPopup.close();
|
tinyMCEPopup.close();
|
||||||
|
@@ -1,345 +1,345 @@
|
|||||||
tinyMCEPopup.requireLangPack();
|
tinyMCEPopup.requireLangPack();
|
||||||
|
|
||||||
var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
|
var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
|
||||||
|
|
||||||
var colors = [
|
var colors = [
|
||||||
"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
|
"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
|
||||||
"#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
|
"#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
|
||||||
"#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
|
"#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
|
||||||
"#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
|
"#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
|
||||||
"#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
|
"#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
|
||||||
"#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
|
"#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
|
||||||
"#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
|
"#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
|
||||||
"#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
|
"#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
|
||||||
"#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
|
"#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
|
||||||
"#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
|
"#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
|
||||||
"#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
|
"#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
|
||||||
"#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
|
"#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
|
||||||
"#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
|
"#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
|
||||||
"#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
|
"#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
|
||||||
"#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
|
"#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
|
||||||
"#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
|
"#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
|
||||||
"#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
|
"#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
|
||||||
"#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
|
"#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
|
||||||
"#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
|
"#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
|
||||||
"#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
|
"#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
|
||||||
"#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
|
"#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
|
||||||
"#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
|
"#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
|
||||||
"#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
|
"#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
|
||||||
"#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
|
"#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
|
||||||
"#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
|
"#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
|
||||||
"#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
|
"#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
|
||||||
"#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
|
"#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
|
||||||
];
|
];
|
||||||
|
|
||||||
var named = {
|
var named = {
|
||||||
'#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
|
'#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
|
||||||
'#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown',
|
'#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown',
|
||||||
'#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue',
|
'#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue',
|
||||||
'#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod',
|
'#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod',
|
||||||
'#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green',
|
'#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green',
|
||||||
'#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue',
|
'#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue',
|
||||||
'#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue',
|
'#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue',
|
||||||
'#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green',
|
'#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green',
|
||||||
'#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey',
|
'#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey',
|
||||||
'#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory',
|
'#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory',
|
||||||
'#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue',
|
'#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue',
|
||||||
'#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green',
|
'#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green',
|
||||||
'#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey',
|
'#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey',
|
||||||
'#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
|
'#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
|
||||||
'#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue',
|
'#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue',
|
||||||
'#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin',
|
'#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin',
|
||||||
'#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid',
|
'#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid',
|
||||||
'#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff',
|
'#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff',
|
||||||
'#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue',
|
'#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue',
|
||||||
'#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver',
|
'#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver',
|
||||||
'#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green',
|
'#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green',
|
||||||
'#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
|
'#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
|
||||||
'#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green'
|
'#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green'
|
||||||
};
|
};
|
||||||
|
|
||||||
var namedLookup = {};
|
var namedLookup = {};
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value;
|
var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value;
|
||||||
|
|
||||||
tinyMCEPopup.resizeToInnerSize();
|
tinyMCEPopup.resizeToInnerSize();
|
||||||
|
|
||||||
generatePicker();
|
generatePicker();
|
||||||
generateWebColors();
|
generateWebColors();
|
||||||
generateNamedColors();
|
generateNamedColors();
|
||||||
|
|
||||||
if (inputColor) {
|
if (inputColor) {
|
||||||
changeFinalColor(inputColor);
|
changeFinalColor(inputColor);
|
||||||
|
|
||||||
col = convertHexToRGB(inputColor);
|
col = convertHexToRGB(inputColor);
|
||||||
|
|
||||||
if (col)
|
if (col)
|
||||||
updateLight(col.r, col.g, col.b);
|
updateLight(col.r, col.g, col.b);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (key in named) {
|
for (key in named) {
|
||||||
value = named[key];
|
value = named[key];
|
||||||
namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase();
|
namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toHexColor(color) {
|
function toHexColor(color) {
|
||||||
var matches, red, green, blue, toInt = parseInt;
|
var matches, red, green, blue, toInt = parseInt;
|
||||||
|
|
||||||
function hex(value) {
|
function hex(value) {
|
||||||
value = parseInt(value).toString(16);
|
value = parseInt(value).toString(16);
|
||||||
|
|
||||||
return value.length > 1 ? value : '0' + value; // Padd with leading zero
|
return value.length > 1 ? value : '0' + value; // Padd with leading zero
|
||||||
};
|
};
|
||||||
|
|
||||||
color = tinymce.trim(color);
|
color = tinymce.trim(color);
|
||||||
color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#'
|
color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#'
|
||||||
color = namedLookup[color] || color;
|
color = namedLookup[color] || color;
|
||||||
|
|
||||||
matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color);
|
matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color);
|
||||||
|
|
||||||
if (matches) {
|
if (matches) {
|
||||||
red = toInt(matches[1]);
|
red = toInt(matches[1]);
|
||||||
green = toInt(matches[2]);
|
green = toInt(matches[2]);
|
||||||
blue = toInt(matches[3]);
|
blue = toInt(matches[3]);
|
||||||
} else {
|
} else {
|
||||||
matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color);
|
matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color);
|
||||||
|
|
||||||
if (matches) {
|
if (matches) {
|
||||||
red = toInt(matches[1], 16);
|
red = toInt(matches[1], 16);
|
||||||
green = toInt(matches[2], 16);
|
green = toInt(matches[2], 16);
|
||||||
blue = toInt(matches[3], 16);
|
blue = toInt(matches[3], 16);
|
||||||
} else {
|
} else {
|
||||||
matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color);
|
matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color);
|
||||||
|
|
||||||
if (matches) {
|
if (matches) {
|
||||||
red = toInt(matches[1] + matches[1], 16);
|
red = toInt(matches[1] + matches[1], 16);
|
||||||
green = toInt(matches[2] + matches[2], 16);
|
green = toInt(matches[2] + matches[2], 16);
|
||||||
blue = toInt(matches[3] + matches[3], 16);
|
blue = toInt(matches[3] + matches[3], 16);
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return '#' + hex(red) + hex(green) + hex(blue);
|
return '#' + hex(red) + hex(green) + hex(blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
function insertAction() {
|
function insertAction() {
|
||||||
var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
|
var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
|
||||||
|
|
||||||
var hexColor = toHexColor(color);
|
var hexColor = toHexColor(color);
|
||||||
|
|
||||||
if (hexColor === '') {
|
if (hexColor === '') {
|
||||||
var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value');
|
var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value');
|
||||||
tinyMCEPopup.alert(text + ': ' + color);
|
tinyMCEPopup.alert(text + ': ' + color);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tinyMCEPopup.restoreSelection();
|
tinyMCEPopup.restoreSelection();
|
||||||
|
|
||||||
if (f)
|
if (f)
|
||||||
f(hexColor);
|
f(hexColor);
|
||||||
|
|
||||||
tinyMCEPopup.close();
|
tinyMCEPopup.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showColor(color, name) {
|
function showColor(color, name) {
|
||||||
if (name)
|
if (name)
|
||||||
document.getElementById("colorname").innerHTML = name;
|
document.getElementById("colorname").innerHTML = name;
|
||||||
|
|
||||||
document.getElementById("preview").style.backgroundColor = color;
|
document.getElementById("preview").style.backgroundColor = color;
|
||||||
document.getElementById("color").value = color.toUpperCase();
|
document.getElementById("color").value = color.toUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertRGBToHex(col) {
|
function convertRGBToHex(col) {
|
||||||
var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
|
var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
|
||||||
|
|
||||||
if (!col)
|
if (!col)
|
||||||
return col;
|
return col;
|
||||||
|
|
||||||
var rgb = col.replace(re, "$1,$2,$3").split(',');
|
var rgb = col.replace(re, "$1,$2,$3").split(',');
|
||||||
if (rgb.length == 3) {
|
if (rgb.length == 3) {
|
||||||
r = parseInt(rgb[0]).toString(16);
|
r = parseInt(rgb[0]).toString(16);
|
||||||
g = parseInt(rgb[1]).toString(16);
|
g = parseInt(rgb[1]).toString(16);
|
||||||
b = parseInt(rgb[2]).toString(16);
|
b = parseInt(rgb[2]).toString(16);
|
||||||
|
|
||||||
r = r.length == 1 ? '0' + r : r;
|
r = r.length == 1 ? '0' + r : r;
|
||||||
g = g.length == 1 ? '0' + g : g;
|
g = g.length == 1 ? '0' + g : g;
|
||||||
b = b.length == 1 ? '0' + b : b;
|
b = b.length == 1 ? '0' + b : b;
|
||||||
|
|
||||||
return "#" + r + g + b;
|
return "#" + r + g + b;
|
||||||
}
|
}
|
||||||
|
|
||||||
return col;
|
return col;
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertHexToRGB(col) {
|
function convertHexToRGB(col) {
|
||||||
if (col.indexOf('#') != -1) {
|
if (col.indexOf('#') != -1) {
|
||||||
col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
|
col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
|
||||||
|
|
||||||
r = parseInt(col.substring(0, 2), 16);
|
r = parseInt(col.substring(0, 2), 16);
|
||||||
g = parseInt(col.substring(2, 4), 16);
|
g = parseInt(col.substring(2, 4), 16);
|
||||||
b = parseInt(col.substring(4, 6), 16);
|
b = parseInt(col.substring(4, 6), 16);
|
||||||
|
|
||||||
return {r : r, g : g, b : b};
|
return {r : r, g : g, b : b};
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function generatePicker() {
|
function generatePicker() {
|
||||||
var el = document.getElementById('light'), h = '', i;
|
var el = document.getElementById('light'), h = '', i;
|
||||||
|
|
||||||
for (i = 0; i < detail; i++){
|
for (i = 0; i < detail; i++){
|
||||||
h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
|
h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
|
||||||
+ ' onclick="changeFinalColor(this.style.backgroundColor)"'
|
+ ' onclick="changeFinalColor(this.style.backgroundColor)"'
|
||||||
+ ' onmousedown="isMouseDown = true; return false;"'
|
+ ' onmousedown="isMouseDown = true; return false;"'
|
||||||
+ ' onmouseup="isMouseDown = false;"'
|
+ ' onmouseup="isMouseDown = false;"'
|
||||||
+ ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
|
+ ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
|
||||||
+ ' onmouseover="isMouseOver = true;"'
|
+ ' onmouseover="isMouseOver = true;"'
|
||||||
+ ' onmouseout="isMouseOver = false;"'
|
+ ' onmouseout="isMouseOver = false;"'
|
||||||
+ '></div>';
|
+ '></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
el.innerHTML = h;
|
el.innerHTML = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateWebColors() {
|
function generateWebColors() {
|
||||||
var el = document.getElementById('webcolors'), h = '', i;
|
var el = document.getElementById('webcolors'), h = '', i;
|
||||||
|
|
||||||
if (el.className == 'generated')
|
if (el.className == 'generated')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.
|
// TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.
|
||||||
h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" border="0" cellspacing="1" cellpadding="0">'
|
h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" border="0" cellspacing="1" cellpadding="0">'
|
||||||
+ '<tr>';
|
+ '<tr>';
|
||||||
|
|
||||||
for (i=0; i<colors.length; i++) {
|
for (i=0; i<colors.length; i++) {
|
||||||
h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
|
h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
|
||||||
+ '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="web_colors_' + i + '" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">';
|
+ '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="web_colors_' + i + '" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">';
|
||||||
if (tinyMCEPopup.editor.forcedHighContrastMode) {
|
if (tinyMCEPopup.editor.forcedHighContrastMode) {
|
||||||
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
|
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
|
||||||
}
|
}
|
||||||
h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>';
|
h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>';
|
||||||
h += '</a></td>';
|
h += '</a></td>';
|
||||||
if ((i+1) % 18 == 0)
|
if ((i+1) % 18 == 0)
|
||||||
h += '</tr><tr>';
|
h += '</tr><tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
h += '</table></div>';
|
h += '</table></div>';
|
||||||
|
|
||||||
el.innerHTML = h;
|
el.innerHTML = h;
|
||||||
el.className = 'generated';
|
el.className = 'generated';
|
||||||
|
|
||||||
paintCanvas(el);
|
paintCanvas(el);
|
||||||
enableKeyboardNavigation(el.firstChild);
|
enableKeyboardNavigation(el.firstChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
function paintCanvas(el) {
|
function paintCanvas(el) {
|
||||||
tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {
|
tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {
|
||||||
var context;
|
var context;
|
||||||
if (canvas.getContext && (context = canvas.getContext("2d"))) {
|
if (canvas.getContext && (context = canvas.getContext("2d"))) {
|
||||||
context.fillStyle = canvas.getAttribute('data-color');
|
context.fillStyle = canvas.getAttribute('data-color');
|
||||||
context.fillRect(0, 0, 10, 10);
|
context.fillRect(0, 0, 10, 10);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function generateNamedColors() {
|
function generateNamedColors() {
|
||||||
var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
|
var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
|
||||||
|
|
||||||
if (el.className == 'generated')
|
if (el.className == 'generated')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (n in named) {
|
for (n in named) {
|
||||||
v = named[n];
|
v = named[n];
|
||||||
h += '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="named_colors_' + i + '" onfocus="showColor(\'' + n + '\',\'' + v + '\');" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '">';
|
h += '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="named_colors_' + i + '" onfocus="showColor(\'' + n + '\',\'' + v + '\');" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '">';
|
||||||
if (tinyMCEPopup.editor.forcedHighContrastMode) {
|
if (tinyMCEPopup.editor.forcedHighContrastMode) {
|
||||||
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
|
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
|
||||||
}
|
}
|
||||||
h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>';
|
h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>';
|
||||||
h += '</a>';
|
h += '</a>';
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
el.innerHTML = h;
|
el.innerHTML = h;
|
||||||
el.className = 'generated';
|
el.className = 'generated';
|
||||||
|
|
||||||
paintCanvas(el);
|
paintCanvas(el);
|
||||||
enableKeyboardNavigation(el);
|
enableKeyboardNavigation(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableKeyboardNavigation(el) {
|
function enableKeyboardNavigation(el) {
|
||||||
tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
|
tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
|
||||||
root: el,
|
root: el,
|
||||||
items: tinyMCEPopup.dom.select('a', el)
|
items: tinyMCEPopup.dom.select('a', el)
|
||||||
}, tinyMCEPopup.dom);
|
}, tinyMCEPopup.dom);
|
||||||
}
|
}
|
||||||
|
|
||||||
function dechex(n) {
|
function dechex(n) {
|
||||||
return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
|
return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
function computeColor(e) {
|
function computeColor(e) {
|
||||||
var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);
|
var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);
|
||||||
|
|
||||||
x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
|
x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
|
||||||
y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);
|
y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);
|
||||||
|
|
||||||
partWidth = document.getElementById('colors').width / 6;
|
partWidth = document.getElementById('colors').width / 6;
|
||||||
partDetail = detail / 2;
|
partDetail = detail / 2;
|
||||||
imHeight = document.getElementById('colors').height;
|
imHeight = document.getElementById('colors').height;
|
||||||
|
|
||||||
r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
|
r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
|
||||||
g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
|
g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
|
||||||
b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
|
b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
|
||||||
|
|
||||||
coef = (imHeight - y) / imHeight;
|
coef = (imHeight - y) / imHeight;
|
||||||
r = 128 + (r - 128) * coef;
|
r = 128 + (r - 128) * coef;
|
||||||
g = 128 + (g - 128) * coef;
|
g = 128 + (g - 128) * coef;
|
||||||
b = 128 + (b - 128) * coef;
|
b = 128 + (b - 128) * coef;
|
||||||
|
|
||||||
changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
|
changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
|
||||||
updateLight(r, g, b);
|
updateLight(r, g, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateLight(r, g, b) {
|
function updateLight(r, g, b) {
|
||||||
var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
|
var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
|
||||||
|
|
||||||
for (i=0; i<detail; i++) {
|
for (i=0; i<detail; i++) {
|
||||||
if ((i>=0) && (i<partDetail)) {
|
if ((i>=0) && (i<partDetail)) {
|
||||||
finalCoef = i / partDetail;
|
finalCoef = i / partDetail;
|
||||||
finalR = dechex(255 - (255 - r) * finalCoef);
|
finalR = dechex(255 - (255 - r) * finalCoef);
|
||||||
finalG = dechex(255 - (255 - g) * finalCoef);
|
finalG = dechex(255 - (255 - g) * finalCoef);
|
||||||
finalB = dechex(255 - (255 - b) * finalCoef);
|
finalB = dechex(255 - (255 - b) * finalCoef);
|
||||||
} else {
|
} else {
|
||||||
finalCoef = 2 - i / partDetail;
|
finalCoef = 2 - i / partDetail;
|
||||||
finalR = dechex(r * finalCoef);
|
finalR = dechex(r * finalCoef);
|
||||||
finalG = dechex(g * finalCoef);
|
finalG = dechex(g * finalCoef);
|
||||||
finalB = dechex(b * finalCoef);
|
finalB = dechex(b * finalCoef);
|
||||||
}
|
}
|
||||||
|
|
||||||
color = finalR + finalG + finalB;
|
color = finalR + finalG + finalB;
|
||||||
|
|
||||||
setCol('gs' + i, '#'+color);
|
setCol('gs' + i, '#'+color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeFinalColor(color) {
|
function changeFinalColor(color) {
|
||||||
if (color.indexOf('#') == -1)
|
if (color.indexOf('#') == -1)
|
||||||
color = convertRGBToHex(color);
|
color = convertRGBToHex(color);
|
||||||
|
|
||||||
setCol('preview', color);
|
setCol('preview', color);
|
||||||
document.getElementById('color').value = color;
|
document.getElementById('color').value = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCol(e, c) {
|
function setCol(e, c) {
|
||||||
try {
|
try {
|
||||||
document.getElementById(e).style.backgroundColor = c;
|
document.getElementById(e).style.backgroundColor = c;
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
// Ignore IE warning
|
// Ignore IE warning
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tinyMCEPopup.onInit.add(init);
|
tinyMCEPopup.onInit.add(init);
|
||||||
|
@@ -68,10 +68,16 @@ var LinkDialog = {
|
|||||||
} else {
|
} else {
|
||||||
ed.dom.setAttribs(e, {
|
ed.dom.setAttribs(e, {
|
||||||
href : href,
|
href : href,
|
||||||
title : f.linktitle.value,
|
title : f.linktitle.value
|
||||||
target : f.target_list ? getSelectValue(f, "target_list") : null,
|
|
||||||
'class' : f.class_list ? getSelectValue(f, "class_list") : null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (f.target_list) {
|
||||||
|
ed.dom.setAttrib(e, 'target', getSelectValue(f, "target_list"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (f.class_list) {
|
||||||
|
ed.dom.setAttrib(e, 'class', getSelectValue(f, "class_list"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't move caret if selection was image
|
// Don't move caret if selection was image
|
||||||
|
@@ -1 +1 @@
|
|||||||
tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value","":""});
|
tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value","":""});
|
||||||
|
@@ -48,4 +48,3 @@ font[face=mceinline] {font-family:inherit !important}
|
|||||||
.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)}
|
.mceItemEmbeddedAudio {background-image:url(../../img/video.gif)}
|
||||||
.mceItemIframe {background-image:url(../../img/iframe.gif)}
|
.mceItemIframe {background-image:url(../../img/iframe.gif)}
|
||||||
.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
|
.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
|
||||||
.mceHideBrInPre pre br {display: none}
|
|
||||||
|
@@ -46,4 +46,3 @@ font[face=mceinline] {font-family:inherit !important}
|
|||||||
.mceItemAudio {background-image:url(../../img/video.gif)}
|
.mceItemAudio {background-image:url(../../img/video.gif)}
|
||||||
.mceItemIframe {background-image:url(../../img/iframe.gif)}
|
.mceItemIframe {background-image:url(../../img/iframe.gif)}
|
||||||
.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
|
.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
|
||||||
.mceHideBrInPre pre br {display: none}
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||||
<script type="text/javascript" src="js/source_editor.js"></script>
|
<script type="text/javascript" src="js/source_editor.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
|
<body onresize="resizeInputs();" style="display:none; overflow:hidden;" spellcheck="false">
|
||||||
<form name="source" onsubmit="saveContent();return false;" action="#">
|
<form name="source" onsubmit="saveContent();return false;" action="#">
|
||||||
<div style="float: left" class="title"><label for="htmlSource">{#advanced_dlg.code_title}</label></div>
|
<div style="float: left" class="title"><label for="htmlSource">{#advanced_dlg.code_title}</label></div>
|
||||||
|
|
||||||
|
2
e107_plugins/tinymce/tiny_mce.js
vendored
2
e107_plugins/tinymce/tiny_mce.js
vendored
File diff suppressed because one or more lines are too long
2
e107_plugins/tinymce/tiny_mce_popup.js
vendored
2
e107_plugins/tinymce/tiny_mce_popup.js
vendored
@@ -2,4 +2,4 @@
|
|||||||
// Uncomment and change this document.domain value if you are loading the script cross subdomains
|
// Uncomment and change this document.domain value if you are loading the script cross subdomains
|
||||||
// document.domain = 'moxiecode.com';
|
// document.domain = 'moxiecode.com';
|
||||||
|
|
||||||
var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
|
var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
|
788
e107_plugins/tinymce/tiny_mce_src.js
vendored
788
e107_plugins/tinymce/tiny_mce_src.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -272,7 +272,7 @@ class wysiwyg
|
|||||||
'theme_advanced_buttons4' => $config['tinymce_buttons4'],
|
'theme_advanced_buttons4' => $config['tinymce_buttons4'],
|
||||||
'theme_advanced_toolbar_location' => 'top',
|
'theme_advanced_toolbar_location' => 'top',
|
||||||
'theme_advanced_toolbar_align' => 'left',
|
'theme_advanced_toolbar_align' => 'left',
|
||||||
'theme_advanced_blockformats' => 'p,h2,blockquote,code',
|
'theme_advanced_blockformats' => 'p,h2,h3,blockquote,code',
|
||||||
'dialog_type' => "modal",
|
'dialog_type' => "modal",
|
||||||
|
|
||||||
|
|
||||||
@@ -289,9 +289,9 @@ class wysiwyg
|
|||||||
'auto_resize' => 'true',
|
'auto_resize' => 'true',
|
||||||
'debug' => 'false',
|
'debug' => 'false',
|
||||||
'force_br_newlines' => 'true',
|
'force_br_newlines' => 'true',
|
||||||
'forced_root_block' => '',
|
// 'forced_root_block' => '',
|
||||||
'convert_newlines_to_brs' => 'true', // will break [list] if set to true
|
'convert_newlines_to_brs' => 'true', // will break [list] if set to true
|
||||||
'force_p_newlines' => 'false',
|
// 'force_p_newlines' => 'false',
|
||||||
'entity_encoding' => 'raw',
|
'entity_encoding' => 'raw',
|
||||||
'convert_fonts_to_styles' => 'true',
|
'convert_fonts_to_styles' => 'true',
|
||||||
'remove_script_host' => 'true',
|
'remove_script_host' => 'true',
|
||||||
|
Reference in New Issue
Block a user