1
0
mirror of https://github.com/e107inc/e107.git synced 2025-10-10 20:44:48 +02:00

TinyMce upgrade and e107bbcode plugin work

This commit is contained in:
CaMer0n
2012-04-29 08:59:24 +00:00
parent 10712bef1b
commit 611e3ae7e2
90 changed files with 4592 additions and 3680 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1 @@
tinyMCE.addI18n('en.advhr_dlg',{ tinyMCE.addI18n('en.advhr_dlg',{size:"Height",noshade:"No Shadow",width:"Width",normal:"Normal",widthunits:"Units"});
normal:"Normal",
width:"Width",
widthunits:"Units",
size:"Height",
noshade:"No shadow"
});

View File

@@ -1 +1 @@
(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); (function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})();

View File

@@ -14,7 +14,7 @@
// Register commands // Register commands
ed.addCommand('mceAdvImage', function() { ed.addCommand('mceAdvImage', function() {
// Internal image object like a flash placeholder // Internal image object like a flash placeholder
if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1)
return; return;
ed.windowManager.open({ ed.windowManager.open({

View File

@@ -9,13 +9,13 @@ var ImageDialog = {
}, },
init : function(ed) { init : function(ed) {
var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(); var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList');
tinyMCEPopup.resizeToInnerSize(); tinyMCEPopup.resizeToInnerSize();
this.fillClassList('class_list'); this.fillClassList('class_list');
this.fillFileList('src_list', 'tinyMCEImageList'); this.fillFileList('src_list', fl);
this.fillFileList('over_list', 'tinyMCEImageList'); this.fillFileList('over_list', fl);
this.fillFileList('out_list', 'tinyMCEImageList'); this.fillFileList('out_list', fl);
TinyMCE_EditableSelects.init(); TinyMCE_EditableSelects.init();
if (n.nodeName == 'IMG') { if (n.nodeName == 'IMG') {
@@ -171,9 +171,13 @@ var ImageDialog = {
if (el && el.nodeName == 'IMG') { if (el && el.nodeName == 'IMG') {
ed.dom.setAttribs(el, args); ed.dom.setAttribs(el, args);
} else { } else {
ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1}); tinymce.each(args, function(value, name) {
ed.dom.setAttribs('__mce_tmp', args); if (value === "") {
ed.dom.setAttrib('__mce_tmp', 'id', ''); delete args[name];
}
});
ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1});
ed.undoManager.add(); ed.undoManager.add();
} }
@@ -287,7 +291,7 @@ var ImageDialog = {
fillFileList : function(id, l) { fillFileList : function(id, l) {
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
l = window[l]; l = typeof(l) === 'function' ? l() : window[l];
lst.options.length = 0; lst.options.length = 0;
if (l && l.length > 0) { if (l && l.length > 0) {

View File

@@ -1,45 +1 @@
tinyMCE.addI18n('en.advimage_dlg',{ tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image List","align_right":"Right","align_left":"Left","align_textbottom":"Text Bottom","align_texttop":"Text Top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal Space",vspace:"Vertical Space",dimensions:"Dimensions",border:"Border",list:"Image List",alt:"Image Description",src:"Image URL","dialog_title":"Insert/Edit Image","missing_alt":"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.","example_img":"Appearance Preview Image",misc:"Miscellaneous",mouseout:"For Mouse Out",mouseover:"For Mouse Over","alt_image":"Alternative Image","swap_image":"Swap Image",map:"Image Map",id:"ID",rtl:"Right to Left",ltr:"Left to Right",classes:"Classes",style:"Style","long_desc":"Long Description Link",langcode:"Language Code",langdir:"Language Direction","constrain_proportions":"Constrain Proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General",width:"Width",height:"Height"});
tab_general:"General",
tab_appearance:"Appearance",
tab_advanced:"Advanced",
general:"General",
title:"Title",
preview:"Preview",
constrain_proportions:"Constrain proportions",
langdir:"Language direction",
langcode:"Language code",
long_desc:"Long description link",
style:"Style",
classes:"Classes",
ltr:"Left to right",
rtl:"Right to left",
id:"Id",
map:"Image map",
swap_image:"Swap image",
alt_image:"Alternative image",
mouseover:"for mouse over",
mouseout:"for mouse out",
misc:"Miscellaneous",
example_img:"Appearance preview image",
missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.",
dialog_title:"Insert/edit image",
src:"Image URL",
alt:"Image description",
list:"Image list",
border:"Border",
dimensions:"Dimensions",
width:"Width",
height:"Height",
vspace:"Vertical space",
hspace:"Horizontal space",
align:"Alignment",
align_baseline:"Baseline",
align_top:"Top",
align_middle:"Middle",
align_bottom:"Bottom",
align_texttop:"Text top",
align_textbottom:"Text bottom",
align_left:"Left",
align_right:"Right",
image_list:"Image list"
});

View File

@@ -54,6 +54,13 @@ function init() {
document.getElementById('popupurl').style.width = '180px'; document.getElementById('popupurl').style.width = '180px';
elm = inst.dom.getParent(elm, "A"); elm = inst.dom.getParent(elm, "A");
if (elm == null) {
var prospect = inst.dom.create("p", null, inst.selection.getContent());
if (prospect.childNodes.length === 1) {
elm = prospect.firstChild;
}
}
if (elm != null && elm.nodeName == "A") if (elm != null && elm.nodeName == "A")
action = "update"; action = "update";
@@ -503,7 +510,7 @@ function getTargetListHTML(elm_id, target_form_element) {
var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');
var html = ''; var html = '';
html += '<select id="' + elm_id + '" name="' + elm_id + '" onf2ocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value='; html += '<select id="' + elm_id + '" name="' + elm_id + '" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
html += 'this.options[this.selectedIndex].value;">'; html += 'this.options[this.selectedIndex].value;">';
html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>'; html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>';
html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>'; html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>';

View File

@@ -1,54 +1 @@
tinyMCE.addI18n('en.advlink_dlg',{ tinyMCE.addI18n('en.advlink_dlg',{"target_name":"Target Name",classes:"Classes",style:"Style",id:"ID","popup_position":"Position (X/Y)",langdir:"Language Direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox Only)","popup_resizable":"Make Window Resizable","popup_location":"Show Location Bar","popup_menubar":"Show Menu Bar","popup_toolbar":"Show Toolbars","popup_statusbar":"Show Status Bar","popup_scrollbars":"Show Scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window Name","popup_url":"Popup URL",popup:"JavaScript Popup","target_blank":"Open in New Window","target_top":"Open in Top Frame (Replaces All Frames)","target_parent":"Open in Parent Window/Frame","target_same":"Open in This Window/Frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced Properties","event_props":"Events","popup_props":"Popup Properties","general_props":"General Properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link List","is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/Edit Link","link_list":"Link List",rtl:"Right to Left",ltr:"Left to Right",accesskey:"AccessKey",tabindex:"TabIndex",rev:"Relationship Target to Page",rel:"Relationship Page to Target",mime:"Target MIME Type",encoding:"Target Character Encoding",langcode:"Language Code","target_langcode":"Target Language",width:"Width",height:"Height"});
title:"Insert/edit link",
url:"Link URL",
target:"Target",
titlefield:"Title",
is_email:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",
is_external:"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",
list:"Link list",
general_tab:"General",
popup_tab:"Popup",
events_tab:"Events",
advanced_tab:"Advanced",
general_props:"General properties",
popup_props:"Popup properties",
event_props:"Events",
advanced_props:"Advanced properties",
popup_opts:"Options",
anchor_names:"Anchors",
target_same:"Open in this window / frame",
target_parent:"Open in parent window / frame",
target_top:"Open in top frame (replaces all frames)",
target_blank:"Open in new window",
popup:"Javascript popup",
popup_url:"Popup URL",
popup_name:"Window name",
popup_return:"Insert 'return false'",
popup_scrollbars:"Show scrollbars",
popup_statusbar:"Show status bar",
popup_toolbar:"Show toolbars",
popup_menubar:"Show menu bar",
popup_location:"Show location bar",
popup_resizable:"Make window resizable",
popup_dependent:"Dependent (Mozilla/Firefox only)",
popup_size:"Size",
width:"Width",
height:"Height",
popup_position:"Position (X/Y)",
id:"Id",
style:"Style",
classes:"Classes",
target_name:"Target name",
langdir:"Language direction",
target_langcode:"Target language",
langcode:"Language code",
encoding:"Target character encoding",
mime:"Target MIME type",
rel:"Relationship page to target",
rev:"Relationship target to page",
tabindex:"Tabindex",
accesskey:"Accesskey",
ltr:"Left to right",
rtl:"Right to left",
link_list:"Link list"
});

View File

@@ -1 +1 @@
(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this,e=0;if(a.getParam("fullscreen_is_enabled")){return}function b(){var i=a.getDoc(),f=i.body,k=i.documentElement,h=tinymce.DOM,j=d.autoresize_min_height,g;g=tinymce.isIE?f.scrollHeight:k.offsetHeight;g=d.bottom_margin+g;if(g>d.autoresize_min_height){j=g}if(j!==e){h.setStyle(h.get(a.id+"_ifr"),"height",j+"px");e=j}if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=a.getElement().offsetHeight;d.bottom_margin=parseInt(a.getParam("autoresize_bottom_margin",50));a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onInit.add(function(g,f){g.setProgressState(true);d.throbbing=true;g.getBody().style.overflowY="hidden"});a.onLoadContent.add(function(g,f){b();setTimeout(function(){b();g.setProgressState(false);d.throbbing=false},1250)})}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})(); (function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this,e=0;if(a.getParam("fullscreen_is_enabled")){return}function b(){var j,i=a.getDoc(),f=i.body,l=i.documentElement,h=tinymce.DOM,k=d.autoresize_min_height,g;g=tinymce.isIE?f.scrollHeight:(tinymce.isWebKit&&f.clientHeight==0?0:f.offsetHeight);if(g>d.autoresize_min_height){k=g}if(d.autoresize_max_height&&g>d.autoresize_max_height){k=d.autoresize_max_height;f.style.overflowY="auto";l.style.overflowY="auto"}else{f.style.overflowY="hidden";l.style.overflowY="hidden";f.scrollTop=0}if(k!==e){j=k-e;h.setStyle(h.get(a.id+"_ifr"),"height",k+"px");e=k;if(tinymce.isWebKit&&j<0){b()}}}d.editor=a;d.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight));d.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0));a.onInit.add(function(f){f.dom.setStyle(f.getBody(),"paddingBottom",f.getParam("autoresize_bottom_margin",50)+"px")});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onLoad.add(b);a.onLoadContent.add(b)}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();

View File

@@ -35,38 +35,51 @@
* 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 d = ed.getDoc(), b = 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 ? b.scrollHeight : de.offsetHeight; myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
// Bottom margin
myHeight = t.bottom_margin + myHeight;
// 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;
// Resize content element // If a maximum height has been defined don't exceed this height
if ( resizeHeight !== oldSize ) { if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); resizeHeight = t.autoresize_max_height;
oldSize = resizeHeight; body.style.overflowY = "auto";
de.style.overflowY = "auto"; // Old IE
} else {
body.style.overflowY = "hidden";
de.style.overflowY = "hidden"; // Old IE
body.scrollTop = 0;
} }
// if we're throbbing, we'll re-throb to match the new size // Resize content element
if (t.throbbing) { if (resizeHeight !== oldSize) {
ed.setProgressState(false); deltaSize = resizeHeight - oldSize;
ed.setProgressState(true); DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
oldSize = resizeHeight;
// 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
if (tinymce.isWebKit && deltaSize < 0)
resize();
} }
}; };
t.editor = ed; t.editor = ed;
// Define minimum height // Define minimum height
t.autoresize_min_height = ed.getElement().offsetHeight; t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
// Add margin at the bottom for better UX // Define maximum height
t.bottom_margin = parseInt( ed.getParam('autoresize_bottom_margin', 50) ); t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
// Add padding at the bottom for better UX
ed.onInit.add(function(ed){
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);
@@ -76,30 +89,8 @@
ed.onPostRender.add(resize); ed.onPostRender.add(resize);
if (ed.getParam('autoresize_on_init', true)) { if (ed.getParam('autoresize_on_init', true)) {
// Things to do when the editor is ready ed.onLoad.add(resize);
ed.onInit.add(function(ed, l) { ed.onLoadContent.add(resize);
// Show throbber until content area is resized properly
ed.setProgressState(true);
t.throbbing = true;
// Hide scrollbars
ed.getBody().style.overflowY = "hidden";
});
ed.onLoadContent.add(function(ed, l) {
resize();
// Because the content area resizes when its content CSS loads,
// and we can't easily add a listener to its onload event,
// we'll just trigger a resize after a short loading period
setTimeout(function() {
resize();
// Disable throbber
ed.setProgressState(false);
t.throbbing = false;
}, 1250);
});
} }
// 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');

View File

@@ -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|&nbsp;|<\/?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,i=h.storage;if(i){content=i.getItem(h.key);if(content){h.editor.setContent(content);h.onRestoreDraft.dispatch(h,{content:content})}}},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|&nbsp;|<\/?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);

View File

@@ -335,7 +335,7 @@
* @method restoreDraft * @method restoreDraft
*/ */
restoreDraft : function() { restoreDraft : function() {
var self = this, storage = self.storage; var self = this, storage = self.storage, content;
if (storage) { if (storage) {
content = storage.getItem(self.key); content = storage.getItem(self.key);

View File

@@ -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.pageX);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)}}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(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});l._menu=f;f.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(e);f.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(e);f.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((d.nodeName=="A"&&!h.dom.getAttrib(d,"name"))||!e){f.addSeparator();f.add({title:"advanced.link_desc",icon:"link",cmd:h.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator();g=f.addMenu({title:"contextmenu.align"});g.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});g.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});g.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});l.onContextMenu.dispatch(l,f,d,e);return f}});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(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)})();

View File

@@ -53,7 +53,7 @@
if (e.target.nodeName == 'IMG') if (e.target.nodeName == 'IMG')
ed.selection.select(e.target); ed.selection.select(e.target);
t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageX); t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY);
Event.add(ed.getDoc(), 'click', function(e) { Event.add(ed.getDoc(), 'click', function(e) {
hide(ed, e); hide(ed, e);
}); });
@@ -80,6 +80,7 @@
t._menu.removeAll(); t._menu.removeAll();
t._menu.destroy(); t._menu.destroy();
Event.remove(ed.getDoc(), 'click', hide); Event.remove(ed.getDoc(), 'click', hide);
t._menu = null;
} }
}; };
@@ -111,19 +112,18 @@
}, },
_getMenu : function(ed) { _getMenu : function(ed) {
var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2; var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p;
if (m) { if (m) {
m.removeAll(); m.removeAll();
m.destroy(); m.destroy();
} }
p1 = DOM.getPos(ed.getContentAreaContainer()); p = DOM.getPos(ed.getContentAreaContainer());
p2 = DOM.getPos(ed.getContainer());
m = ed.controlManager.createDropMenu('contextmenu', { m = ed.controlManager.createDropMenu('contextmenu', {
offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0), offset_x : p.x + ed.getParam('contextmenu_offset_x', 0),
offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0), offset_y : p.y + ed.getParam('contextmenu_offset_y', 0),
constrain : 1, constrain : 1,
keyboard_focus: true keyboard_focus: true
}); });

View File

@@ -27,7 +27,7 @@
return { return {
longname : 'e107 BBCode Plugin', longname : 'e107 BBCode Plugin',
author : 'Moxiecode Systems AB - Modified by e107 Inc', author : 'Moxiecode Systems AB - Modified by e107 Inc',
authorurl : 'http://tinymce.moxiecode.com', authorurl : 'http://e107.org',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
version : tinymce.majorVersion + "." + tinymce.minorVersion version : tinymce.majorVersion + "." + tinymce.minorVersion
}; };
@@ -43,7 +43,7 @@
s = s.replace(re, str); s = s.replace(re, str);
}; };
//return s; // return s;
rep(/<table(.*)>/gim, "[table]"); rep(/<table(.*)>/gim, "[table]");
rep(/<\/table>/gim, "[/table]"); rep(/<\/table>/gim, "[/table]");
@@ -79,18 +79,29 @@
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"); rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
rep(/<font>(.*?)<\/font>/gi,"$1"); rep(/<font>(.*?)<\/font>/gi,"$1");
rep(/<img.*?style=\"(.*?)\".*?src=\"(.*?)\".*?\/>/gi,"[img style=$1]$2[/img]"); // rep(/<img.*?style=\"(.*?)\".*?src=\"(.*?)\".*?\/>/gi,"[img style=$1]$2[/img]");
rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
// rep(/<img.*?style=\"(.*?)\".*?src=\"(.*?)\" alt=\"(.*?)\" .*?width=\"(.*?)\".*? .*?height=\"(.*?)\" .*?\/>/gi,"[img style=$1;width:$4px; height:$5;]$2[/img]");
// New Image Handler // verified
rep(/<img(?:\s*)?(?:style="(.*)")?\s?(?:src="(\S*)")(?:\s*)?(?:alt="(\S*)")?(?:\s*)?(?:width="([\d]*)")?\s*(?:height="([\d]*)")?(?:\s*)?\/>/gi,"[img style=$1;width:$4px;height:$5px]$2[/img]" )
rep(/;width:px;height:px/gi, ""); // Img cleanup.
rep(/<img\s*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
rep(/<blockquote[^>]*>/gi,"[blockquote]");
rep(/<\/blockquote>/gi,"[/blockquote]");
rep(/<code[^>]*>/gi,"[code]");
rep(/<\/code>/gi,"[/code]");
// rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");
// rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");
// rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");
// rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");
// rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");
// rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");
// rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");
// rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");
rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");
rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");
rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");
rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");
rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");
rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");
rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");
rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");
rep(/<\/(strong|b)>/gi,"[/b]"); rep(/<\/(strong|b)>/gi,"[/b]");
rep(/<(strong|b)>/gi,"[b]"); rep(/<(strong|b)>/gi,"[b]");
rep(/<\/(em|i)>/gi,"[/i]"); rep(/<\/(em|i)>/gi,"[/i]");
@@ -98,8 +109,7 @@
rep(/<\/u>/gi,"[/u]"); rep(/<\/u>/gi,"[/u]");
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"); rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
rep(/<u>/gi,"[u]"); rep(/<u>/gi,"[u]");
rep(/<blockquote[^>]*>/gi,"[quote]");
rep(/<\/blockquote>/gi,"[/quote]");
// Compromise - but BC issues for sure. // Compromise - but BC issues for sure.
rep(/<br \/>/gi,"[br]"); rep(/<br \/>/gi,"[br]");
@@ -165,7 +175,11 @@
rep(/\[br]/gi,"<br />"); // compromise rep(/\[br]/gi,"<br />"); // compromise
// rep(/\n/gi,"<br \/>"); // breaks lists.. need a regex to exclude everything between [list]...[/list] // rep(/\n/gi,"<br \/>"); // breaks lists.. need a regex to exclude everything between [list]...[/list]
rep(/\[blockquote\]/gi,"<blockquote>");
rep(/\[\/blockquote\]/gi,"</blockquote>");
rep(/\[code\]/gi,"<code>");
rep(/\[\/code\]/gi,"</code>");
//rep( /(?<!(\[list]))\r|\n/gim,"<br />" ) //rep( /(?<!(\[list]))\r|\n/gim,"<br />" )
@@ -178,11 +192,13 @@
rep(/\[\/u\]/gi,"</u>"); rep(/\[\/u\]/gi,"</u>");
rep(/\[link=([^\]]+)\](.*?)\[\/link\]/gi,"<a href=\"$1\">$2</a>"); rep(/\[link=([^\]]+)\](.*?)\[\/link\]/gi,"<a href=\"$1\">$2</a>");
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>"); rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
rep(/\[img.*?style=(.*?).*?\](.*?)\[\/img\]/gi,"<img style=\"$1\" src=\"$2\" />"); // rep(/\[img.*?style=(.*?).*?\](.*?)\[\/img\]/gi,"<img style=\"$1\" src=\"$2\" />");
rep(/\[img.*?\](.*?)\[\/img\]/gi,"<img src=\"$1\" />"); rep(/\[img\s*?style=([^\]]*)]([\s\S]*?)\[\/img]/gi,"<img style=\"$1\" src=\"$2\" />");
// rep(/\[img.*?\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
// rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>"); // rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");
rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span>&nbsp;"); // rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span>&nbsp;");
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span>&nbsp;"); // rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span>&nbsp;");

File diff suppressed because one or more lines are too long

View File

@@ -351,10 +351,16 @@
}); });
} }
if (styles)
dom.add(self.editor.getDoc().getElementsByTagName('head')[0], 'style', {id : 'fullpage_styles'}, styles);
else
dom.remove('fullpage_styles'); dom.remove('fullpage_styles');
if (styles) {
dom.add(self.editor.getDoc().getElementsByTagName('head')[0], 'style', {id : 'fullpage_styles'}, styles);
// Needed for IE 6/7
elm = dom.get('fullpage_styles');
if (elm.styleSheet)
elm.styleSheet.cssText = styles;
}
}, },
_getDefaultHeader : function() { _getDefaultHeader : function() {
@@ -367,7 +373,7 @@
header += '\n<html>\n<head>\n'; header += '\n<html>\n<head>\n';
if (value = editor.getParam('fullpage_default_title')) if (value = editor.getParam('fullpage_default_title'))
header += '<title>' + v + '</title>\n'; header += '<title>' + value + '</title>\n';
if (value = editor.getParam('fullpage_default_encoding')) if (value = editor.getParam('fullpage_default_encoding'))
header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n'; header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n';

View File

@@ -1,85 +1 @@
tinyMCE.addI18n('en.fullpage_dlg',{ tinyMCE.addI18n('en.fullpage_dlg',{title:"Document Properties","meta_tab":"General","appearance_tab":"Appearance","advanced_tab":"Advanced","meta_props":"Meta Information",langprops:"Language and Encoding","meta_title":"Title","meta_keywords":"Keywords","meta_description":"Description","meta_robots":"Robots",doctypes:"Doctype",langcode:"Language Code",langdir:"Language Direction",ltr:"Left to Right",rtl:"Right to Left","xml_pi":"XML Declaration",encoding:"Character Encoding","appearance_bgprops":"Background Properties","appearance_marginprops":"Body Margins","appearance_linkprops":"Link Colors","appearance_textprops":"Text Properties",bgcolor:"Background Color",bgimage:"Background Image","left_margin":"Left Margin","right_margin":"Right Margin","top_margin":"Top Margin","bottom_margin":"Bottom Margin","text_color":"Text Color","font_size":"Font Size","font_face":"Font Face","link_color":"Link Color","hover_color":"Hover Color","visited_color":"Visited Color","active_color":"Active Color",textcolor:"Color",fontsize:"Font Size",fontface:"Font Family","meta_index_follow":"Index and Follow the Links","meta_index_nofollow":"Index and Don\'t Follow the Links","meta_noindex_follow":"Do Not Index but Follow the Links","meta_noindex_nofollow":"Do Not Index and Don\'t Follow the Links","appearance_style":"Stylesheet and Style Properties",stylesheet:"Stylesheet",style:"Style",author:"Author",copyright:"Copyright",add:"Add New Element",remove:"Remove Selected Element",moveup:"Move Selected Element Up",movedown:"Move Selected Element Down","head_elements":"Head Elements",info:"Information","add_title":"Title Element","add_meta":"Meta Element","add_script":"Script Element","add_style":"Style Element","add_link":"Link Element","add_base":"Base Element","add_comment":"Comment Node","title_element":"Title Element","script_element":"Script Element","style_element":"Style Element","base_element":"Base Element","link_element":"Link Element","meta_element":"Meta Element","comment_element":"Comment",src:"Source",language:"Language",href:"HREF",target:"Target",type:"Type",charset:"Charset",defer:"Defer",media:"Media",properties:"Properties",name:"Name",value:"Value",content:"Content",rel:"Rel",rev:"Rev",hreflang:"HREF Lang","general_props":"General","advanced_props":"Advanced"});
title:"Document properties",
meta_tab:"General",
appearance_tab:"Appearance",
advanced_tab:"Advanced",
meta_props:"Meta information",
langprops:"Language and encoding",
meta_title:"Title",
meta_keywords:"Keywords",
meta_description:"Description",
meta_robots:"Robots",
doctypes:"Doctype",
langcode:"Language code",
langdir:"Language direction",
ltr:"Left to right",
rtl:"Right to left",
xml_pi:"XML declaration",
encoding:"Character encoding",
appearance_bgprops:"Background properties",
appearance_marginprops:"Body margins",
appearance_linkprops:"Link colors",
appearance_textprops:"Text properties",
bgcolor:"Background color",
bgimage:"Background image",
left_margin:"Left margin",
right_margin:"Right margin",
top_margin:"Top margin",
bottom_margin:"Bottom margin",
text_color:"Text color",
font_size:"Font size",
font_face:"Font face",
link_color:"Link color",
hover_color:"Hover color",
visited_color:"Visited color",
active_color:"Active color",
textcolor:"Color",
fontsize:"Font size",
fontface:"Font family",
meta_index_follow:"Index and follow the links",
meta_index_nofollow:"Index and don't follow the links",
meta_noindex_follow:"Do not index but follow the links",
meta_noindex_nofollow:"Do not index and don\'t follow the links",
appearance_style:"Stylesheet and style properties",
stylesheet:"Stylesheet",
style:"Style",
author:"Author",
copyright:"Copyright",
add:"Add new element",
remove:"Remove selected element",
moveup:"Move selected element up",
movedown:"Move selected element down",
head_elements:"Head elements",
info:"Information",
add_title:"Title element",
add_meta:"Meta element",
add_script:"Script element",
add_style:"Style element",
add_link:"Link element",
add_base:"Base element",
add_comment:"Comment node",
title_element:"Title element",
script_element:"Script element",
style_element:"Style element",
base_element:"Base element",
link_element:"Link element",
meta_element:"Meta element",
comment_element:"Comment",
src:"Src",
language:"Language",
href:"Href",
target:"Target",
type:"Type",
charset:"Charset",
defer:"Defer",
media:"Media",
properties:"Properties",
name:"Name",
value:"Value",
content:"Content",
rel:"Rel",
rev:"Rev",
hreflang:"Href lang",
general_props:"General",
advanced_props:"Advanced"
});

View File

@@ -1 +1 @@
(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent({format:"raw"}),{format:"raw"});d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().firstChild);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})(); (function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent());tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent());d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().firstChild);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();

View File

@@ -27,7 +27,7 @@
else { else {
DOM.win.setTimeout(function() { DOM.win.setTimeout(function() {
tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc); tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'}); tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent());
tinyMCE.remove(ed); tinyMCE.remove(ed);
DOM.remove('mce_fullscreen_container'); DOM.remove('mce_fullscreen_container');
de.style.overflow = ed.getParam('fullscreen_html_overflow'); de.style.overflow = ed.getParam('fullscreen_html_overflow');
@@ -100,7 +100,7 @@
s.fullscreen_editor_id = ed.id; s.fullscreen_editor_id = ed.id;
s.theme_advanced_resizing = false; s.theme_advanced_resizing = false;
s.save_onsavecallback = function() { s.save_onsavecallback = function() {
ed.setContent(tinyMCE.get(s.id).getContent({format : 'raw'}), {format : 'raw'}); ed.setContent(tinyMCE.get(s.id).getContent());
ed.execCommand('mceSave'); ed.execCommand('mceSave');
}; };

View File

@@ -1,7 +1,8 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title></title> <title></title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script type="text/javascript" src="../../tiny_mce.js"></script> <script type="text/javascript" src="../../tiny_mce.js"></script>
<script type="text/javascript"> <script type="text/javascript">
function patchCallback(settings, key) { function patchCallback(settings, key) {

File diff suppressed because one or more lines are too long

View File

@@ -219,7 +219,10 @@
t.focus(id); t.focus(id);
if (n.nodeName == 'A' || n.nodeName == 'a') { if (n.nodeName == 'A' || n.nodeName == 'a') {
if (n.className == 'mceMax') { if (n.className == 'mceClose') {
t.close(null, id);
return Event.cancel(e);
} else if (n.className == 'mceMax') {
w.oldPos = w.element.getXY(); w.oldPos = w.element.getXY();
w.oldSize = w.element.getSize(); w.oldSize = w.element.getSize();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 818 B

After

Width:  |  Height:  |  Size: 810 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 915 B

After

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 911 B

After

Width:  |  Height:  |  Size: 909 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 B

After

Width:  |  Height:  |  Size: 84 B

View File

@@ -1 +1 @@
(function(){tinymce.create("tinymce.plugins.Layer",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertLayer",c._insertLayer,c);a.addCommand("mceMoveForward",function(){c._move(1)});a.addCommand("mceMoveBackward",function(){c._move(-1)});a.addCommand("mceMakeAbsolute",function(){c._toggleAbsolute()});a.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"});a.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"});a.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"});a.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"});a.onInit.add(function(){if(tinymce.isIE){a.getDoc().execCommand("2D-Position",false,true)}});a.onNodeChange.add(c._nodeChange,c);a.onVisualAid.add(c._visualAid,c)},getInfo:function(){return{longname:"Layer",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var c,d;c=this._getParentLayer(e);d=b.dom.getParent(e,"DIV,P,IMG");if(!d){a.setDisabled("absolute",1);a.setDisabled("moveforward",1);a.setDisabled("movebackward",1)}else{a.setDisabled("absolute",0);a.setDisabled("moveforward",!c);a.setDisabled("movebackward",!c);a.setActive("absolute",c&&c.style.position.toLowerCase()=="absolute")}},_visualAid:function(a,c,b){var d=a.dom;tinymce.each(d.select("div,p",c),function(f){if(/^(absolute|relative|static)$/i.test(f.style.position)){if(b){d.addClass(f,"mceItemVisualAid")}else{d.removeClass(f,"mceItemVisualAid")}}})},_move:function(h){var b=this.editor,f,g=[],e=this._getParentLayer(b.selection.getNode()),c=-1,j=-1,a;a=[];tinymce.walk(b.getBody(),function(d){if(d.nodeType==1&&/^(absolute|relative|static)$/i.test(d.style.position)){a.push(d)}},"childNodes");for(f=0;f<a.length;f++){g[f]=a[f].style.zIndex?parseInt(a[f].style.zIndex):0;if(c<0&&a[f]==e){c=f}}if(h<0){for(f=0;f<g.length;f++){if(g[f]<g[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{if(g[c]>0){a[c].style.zIndex=g[c]-1}}}else{for(f=0;f<g.length;f++){if(g[f]>g[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{a[c].style.zIndex=g[c]+1}}b.execCommand("mceRepaint")},_getParentLayer:function(a){return this.editor.dom.getParent(a,function(b){return b.nodeType==1&&/^(absolute|relative|static)$/i.test(b.style.position)})},_insertLayer:function(){var a=this.editor,b=a.dom.getPos(a.dom.getParent(a.selection.getNode(),"*"));a.dom.add(a.getBody(),"div",{style:{position:"absolute",left:b.x,top:(b.y>20?b.y:20),width:100,height:100},"class":"mceItemVisualAid"},a.selection.getContent()||a.getLang("layer.content"))},_toggleAbsolute:function(){var a=this.editor,b=this._getParentLayer(a.selection.getNode());if(!b){b=a.dom.getParent(a.selection.getNode(),"DIV,P,IMG")}if(b){if(b.style.position.toLowerCase()=="absolute"){a.dom.setStyles(b,{position:"",left:"",top:"",width:"",height:""});a.dom.removeClass(b,"mceItemVisualAid")}else{if(b.style.left==""){b.style.left=20+"px"}if(b.style.top==""){b.style.top=20+"px"}if(b.style.width==""){b.style.width=b.width?(b.width+"px"):"100px"}if(b.style.height==""){b.style.height=b.height?(b.height+"px"):"100px"}b.style.position="absolute";a.dom.setAttrib(b,"data-mce-style","");a.addVisual(a.getBody())}a.execCommand("mceRepaint");a.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})(); (function(){function a(b){do{if(b.className&&b.className.indexOf("mceItemLayer")!=-1){return b}}while(b=b.parentNode)}tinymce.create("tinymce.plugins.Layer",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceInsertLayer",d._insertLayer,d);b.addCommand("mceMoveForward",function(){d._move(1)});b.addCommand("mceMoveBackward",function(){d._move(-1)});b.addCommand("mceMakeAbsolute",function(){d._toggleAbsolute()});b.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"});b.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"});b.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"});b.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"});b.onInit.add(function(){var e=b.dom;if(tinymce.isIE){b.getDoc().execCommand("2D-Position",false,true)}});b.onMouseUp.add(function(f,h){var g=a(h.target);if(g){f.dom.setAttrib(g,"data-mce-style","")}});b.onMouseDown.add(function(f,j){var h=j.target,i=f.getDoc(),g;if(tinymce.isGecko){if(a(h)){if(i.designMode!=="on"){i.designMode="on";h=i.body;g=h.parentNode;g.removeChild(h);g.appendChild(h)}}else{if(i.designMode=="on"){i.designMode="off"}}}});b.onNodeChange.add(d._nodeChange,d);b.onVisualAid.add(d._visualAid,d)},getInfo:function(){return{longname:"Layer",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(c,b,f){var d,e;d=this._getParentLayer(f);e=c.dom.getParent(f,"DIV,P,IMG");if(!e){b.setDisabled("absolute",1);b.setDisabled("moveforward",1);b.setDisabled("movebackward",1)}else{b.setDisabled("absolute",0);b.setDisabled("moveforward",!d);b.setDisabled("movebackward",!d);b.setActive("absolute",d&&d.style.position.toLowerCase()=="absolute")}},_visualAid:function(b,d,c){var f=b.dom;tinymce.each(f.select("div,p",d),function(g){if(/^(absolute|relative|fixed)$/i.test(g.style.position)){if(c){f.addClass(g,"mceItemVisualAid")}else{f.removeClass(g,"mceItemVisualAid")}f.addClass(g,"mceItemLayer")}})},_move:function(j){var c=this.editor,g,h=[],f=this._getParentLayer(c.selection.getNode()),e=-1,k=-1,b;b=[];tinymce.walk(c.getBody(),function(d){if(d.nodeType==1&&/^(absolute|relative|static)$/i.test(d.style.position)){b.push(d)}},"childNodes");for(g=0;g<b.length;g++){h[g]=b[g].style.zIndex?parseInt(b[g].style.zIndex):0;if(e<0&&b[g]==f){e=g}}if(j<0){for(g=0;g<h.length;g++){if(h[g]<h[e]){k=g;break}}if(k>-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{if(h[e]>0){b[e].style.zIndex=h[e]-1}}}else{for(g=0;g<h.length;g++){if(h[g]>h[e]){k=g;break}}if(k>-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{b[e].style.zIndex=h[e]+1}}c.execCommand("mceRepaint")},_getParentLayer:function(b){return this.editor.dom.getParent(b,function(c){return c.nodeType==1&&/^(absolute|relative|static)$/i.test(c.style.position)})},_insertLayer:function(){var c=this.editor,e=c.dom,d=e.getPos(e.getParent(c.selection.getNode(),"*")),b=c.getBody();c.dom.add(b,"div",{style:{position:"absolute",left:d.x,top:(d.y>20?d.y:20),width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},c.selection.getContent()||c.getLang("layer.content"));if(tinymce.isIE){e.setHTML(b,b.innerHTML)}},_toggleAbsolute:function(){var b=this.editor,c=this._getParentLayer(b.selection.getNode());if(!c){c=b.dom.getParent(b.selection.getNode(),"DIV,P,IMG")}if(c){if(c.style.position.toLowerCase()=="absolute"){b.dom.setStyles(c,{position:"",left:"",top:"",width:"",height:""});b.dom.removeClass(c,"mceItemVisualAid");b.dom.removeClass(c,"mceItemLayer")}else{if(c.style.left==""){c.style.left=20+"px"}if(c.style.top==""){c.style.top=20+"px"}if(c.style.width==""){c.style.width=c.width?(c.width+"px"):"100px"}if(c.style.height==""){c.style.height=c.height?(c.height+"px"):"100px"}c.style.position="absolute";b.dom.setAttrib(c,"data-mce-style","");b.addVisual(b.getBody())}b.execCommand("mceRepaint");b.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})();

View File

@@ -9,6 +9,14 @@
*/ */
(function() { (function() {
function findParentLayer(node) {
do {
if (node.className && node.className.indexOf('mceItemLayer') != -1) {
return node;
}
} while (node = node.parentNode);
};
tinymce.create('tinymce.plugins.Layer', { tinymce.create('tinymce.plugins.Layer', {
init : function(ed, url) { init : function(ed, url) {
var t = this; var t = this;
@@ -37,10 +45,43 @@
ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'}); ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'});
ed.onInit.add(function() { ed.onInit.add(function() {
var dom = ed.dom;
if (tinymce.isIE) if (tinymce.isIE)
ed.getDoc().execCommand('2D-Position', false, true); ed.getDoc().execCommand('2D-Position', false, true);
}); });
// Remove serialized styles when selecting a layer since it might be changed by a drag operation
ed.onMouseUp.add(function(ed, e) {
var layer = findParentLayer(e.target);
if (layer) {
ed.dom.setAttrib(layer, 'data-mce-style', '');
}
});
// Fixes edit focus issues with layers on Gecko
// This will enable designMode while inside a layer and disable it when outside
ed.onMouseDown.add(function(ed, e) {
var node = e.target, doc = ed.getDoc(), parent;
if (tinymce.isGecko) {
if (findParentLayer(node)) {
if (doc.designMode !== 'on') {
doc.designMode = 'on';
// Repaint caret
node = doc.body;
parent = node.parentNode;
parent.removeChild(node);
parent.appendChild(node);
}
} else if (doc.designMode == 'on') {
doc.designMode = 'off';
}
}
});
ed.onNodeChange.add(t._nodeChange, t); ed.onNodeChange.add(t._nodeChange, t);
ed.onVisualAid.add(t._visualAid, t); ed.onVisualAid.add(t._visualAid, t);
}, },
@@ -81,11 +122,13 @@
var dom = ed.dom; var dom = ed.dom;
tinymce.each(dom.select('div,p', e), function(e) { tinymce.each(dom.select('div,p', e), function(e) {
if (/^(absolute|relative|static)$/i.test(e.style.position)) { if (/^(absolute|relative|fixed)$/i.test(e.style.position)) {
if (s) if (s)
dom.addClass(e, 'mceItemVisualAid'); dom.addClass(e, 'mceItemVisualAid');
else else
dom.removeClass(e, 'mceItemVisualAid'); dom.removeClass(e, 'mceItemVisualAid');
dom.addClass(e, 'mceItemLayer');
} }
}); });
}, },
@@ -153,9 +196,9 @@
}, },
_insertLayer : function() { _insertLayer : function() {
var ed = this.editor, p = ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(), '*')); var ed = this.editor, dom = ed.dom, p = dom.getPos(dom.getParent(ed.selection.getNode(), '*')), body = ed.getBody();
ed.dom.add(ed.getBody(), 'div', { ed.dom.add(body, 'div', {
style : { style : {
position : 'absolute', position : 'absolute',
left : p.x, left : p.x,
@@ -163,8 +206,12 @@
width : 100, width : 100,
height : 100 height : 100
}, },
'class' : 'mceItemVisualAid' 'class' : 'mceItemVisualAid mceItemLayer'
}, ed.selection.getContent() || ed.getLang('layer.content')); }, ed.selection.getContent() || ed.getLang('layer.content'));
// Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7
if (tinymce.isIE)
dom.setHTML(body, body.innerHTML);
}, },
_toggleAbsolute : function() { _toggleAbsolute : function() {
@@ -184,6 +231,7 @@
}); });
ed.dom.removeClass(le, 'mceItemVisualAid'); ed.dom.removeClass(le, 'mceItemVisualAid');
ed.dom.removeClass(le, 'mceItemLayer');
} else { } else {
if (le.style.left == "") if (le.style.left == "")
le.style.left = 20 + 'px'; le.style.left = 20 + 'px';

File diff suppressed because one or more lines are too long

View File

@@ -23,7 +23,9 @@
["Java", "8ad9c840-044e-11d1-b3e9-00805f499d93", "application/x-java-applet", "http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"], ["Java", "8ad9c840-044e-11d1-b3e9-00805f499d93", "application/x-java-applet", "http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],
["Silverlight", "dfeaf541-f3e1-4c24-acac-99c30715084a", "application/x-silverlight-2"], ["Silverlight", "dfeaf541-f3e1-4c24-acac-99c30715084a", "application/x-silverlight-2"],
["Iframe"], ["Iframe"],
["Video"] ["Video"],
["EmbeddedAudio"],
["Audio"]
]; ];
function toArray(obj) { function toArray(obj) {
@@ -86,11 +88,12 @@
"silverlight=xap;" + "silverlight=xap;" +
"flash=swf,flv;" + "flash=swf,flv;" +
"shockwave=dcr;" + "shockwave=dcr;" +
"quicktime=mov,qt,mpg,mp3,mpeg;" + "quicktime=mov,qt,mpg,mpeg;" +
"shockwave=dcr;" + "shockwave=dcr;" +
"windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;" + "windowsmedia=avi,wmv,wm,asf,asx,wmx,wvx;" +
"realmedia=rm,ra,ram;" + "realmedia=rm,ra,ram;" +
"java=jar" "java=jar;" +
"audio=mp3,ogg"
).split(';'), function(item) { ).split(';'), function(item) {
var i, extensions, type; var i, extensions, type;
@@ -155,7 +158,9 @@
img = ed.selection.getNode(); img = ed.selection.getNode();
if (isMediaImg(img)) { if (isMediaImg(img)) {
data = JSON.parse(ed.dom.getAttrib(img, 'data-mce-json')); data = ed.dom.getAttrib(img, 'data-mce-json');
if (data) {
data = JSON.parse(data);
// Add some extra properties to the data object // Add some extra properties to the data object
tinymce.each(rootAttributes, function(name) { tinymce.each(rootAttributes, function(name) {
@@ -167,6 +172,7 @@
data.type = self.getType(img.className).name.toLowerCase(); data.type = self.getType(img.className).name.toLowerCase();
} }
}
if (!data) { if (!data) {
data = { data = {
@@ -245,13 +251,15 @@
id : data.id, id : data.id,
style : data.style, style : data.style,
align : data.align, align : data.align,
hspace : data.hspace,
vspace : data.vspace,
src : self.editor.theme.url + '/img/trans.gif', src : self.editor.theme.url + '/img/trans.gif',
'class' : 'mceItemMedia mceItem' + self.getType(data.type).name, 'class' : 'mceItemMedia mceItem' + self.getType(data.type).name,
'data-mce-json' : JSON.serialize(data, "'") 'data-mce-json' : JSON.serialize(data, "'")
}); });
img.width = data.width || "320"; img.width = data.width || (data.type == 'audio' ? "300" : "320");
img.height = data.height || "240"; img.height = data.height || (data.type == 'audio' ? "32" : "240");
return img; return img;
}, },
@@ -260,7 +268,7 @@
* Converts the JSON data object to a HTML string. * Converts the JSON data object to a HTML string.
*/ */
dataToHtml : function(data, force_absolute) { dataToHtml : function(data, force_absolute) {
return this.editor.serializer.serialize(this.dataToImg(data, force_absolute), {force_absolute : force_absolute}); return this.editor.serializer.serialize(this.dataToImg(data, force_absolute), {forced_root_block : '', force_absolute : force_absolute});
}, },
/** /**
@@ -320,7 +328,7 @@
imgToObject : function(node, args) { imgToObject : function(node, args) {
var self = this, editor = self.editor, video, object, embed, iframe, name, value, data, var self = this, editor = self.editor, video, object, embed, iframe, name, value, data,
source, sources, params, param, typeItem, i, item, mp4Source, replacement, source, sources, params, param, typeItem, i, item, mp4Source, replacement,
posterSrc, style; posterSrc, style, audio;
// Adds the flash player // Adds the flash player
function addPlayer(video_src, poster_src) { function addPlayer(video_src, poster_src) {
@@ -363,7 +371,11 @@
} }
}; };
data = JSON.parse(node.attr('data-mce-json')); data = node.attr('data-mce-json');
if (!data)
return;
data = JSON.parse(data);
typeItem = this.getType(node.attr('class')); typeItem = this.getType(node.attr('class'));
style = node.attr('data-mce-style') style = node.attr('data-mce-style')
@@ -456,6 +468,57 @@
data.params.src = ''; data.params.src = '';
} }
// Add HTML5 audio element
if (typeItem.name === 'Audio' && data.video.sources[0]) {
// Create new object element
audio = new Node('audio', 1).attr(tinymce.extend({
id : node.attr('id'),
width: node.attr('width'),
height: node.attr('height'),
style : style
}, data.video.attrs));
// Get poster source and use that for flash fallback
if (data.video.attrs)
posterSrc = data.video.attrs.poster;
sources = data.video.sources = toArray(data.video.sources);
if (!sources[0].type) {
audio.attr('src', sources[0].src);
sources.splice(0, 1);
}
for (i = 0; i < sources.length; i++) {
source = new Node('source', 1).attr(sources[i]);
source.shortEnded = true;
audio.append(source);
}
data.params.src = '';
}
if (typeItem.name === 'EmbeddedAudio') {
embed = new Node('embed', 1);
embed.shortEnded = true;
embed.attr({
id: node.attr('id'),
width: node.attr('width'),
height: node.attr('height'),
style : style,
type: node.attr('type')
});
for (name in data.params)
embed.attr(name, data.params[name]);
tinymce.each(rootAttributes, function(name) {
if (data[name] && name != 'type')
embed.attr(name, data[name]);
});
data.params.src = '';
}
// Do we have a params src then we can generate object // Do we have a params src then we can generate object
if (data.params.src) { if (data.params.src) {
// Is flv movie add player for it // Is flv movie add player for it
@@ -474,8 +537,13 @@
}); });
tinymce.each(rootAttributes, function(name) { tinymce.each(rootAttributes, function(name) {
if (data[name] && name != 'type') var value = data[name];
object.attr(name, data[name]);
if (name == 'class' && value)
value = value.replace(/mceItem.+ ?/g, '');
if (value && name != 'type')
object.attr(name, value);
}); });
// Add params // Add params
@@ -548,8 +616,19 @@
} }
} }
if (video || object) if (audio) {
node.replace(video || object); // Insert raw HTML
if (data.video_html) {
value = new Node('#text', 3);
value.raw = true;
value.value = data.video_html;
audio.append(value);
}
}
var n = video || audio || object || embed;
if (n)
node.replace(n);
else else
node.remove(); node.remove();
}, },
@@ -567,7 +646,8 @@
var object, embed, video, iframe, img, name, id, width, height, style, i, html, var object, embed, video, iframe, img, name, id, width, height, style, i, html,
param, params, source, sources, data, type, lookup = this.lookup, param, params, source, sources, data, type, lookup = this.lookup,
matches, attrs, urlConverter = this.editor.settings.url_converter, matches, attrs, urlConverter = this.editor.settings.url_converter,
urlConverterScope = this.editor.settings.url_converter_scope; urlConverterScope = this.editor.settings.url_converter_scope,
hspace, vspace, align, bgcolor;
function getInnerHTML(node) { function getInnerHTML(node) {
return new tinymce.html.Serializer({ return new tinymce.html.Serializer({
@@ -576,6 +656,15 @@
}).serialize(node); }).serialize(node);
}; };
function lookupAttribute(o, attr) {
return lookup[(o.attr(attr) || '').toLowerCase()];
}
function lookupExtension(src) {
var ext = src.replace(/^.*\.([^.]+)$/, '$1');
return lookup[ext.toLowerCase() || ''];
}
// If node isn't in document // If node isn't in document
if (!node.parent) if (!node.parent)
return; return;
@@ -608,7 +697,7 @@
// Video element // Video element
name = node.name; name = node.name;
if (name === 'video') { if (name === 'video' || name == 'audio') {
video = node; video = node;
object = node.getAll('object')[0]; object = node.getAll('object')[0];
embed = node.getAll('embed')[0]; embed = node.getAll('embed')[0];
@@ -624,7 +713,7 @@
source = node.attr('src'); source = node.attr('src');
if (source) if (source)
data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', 'video')}); data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', node.name)});
// Get all sources // Get all sources
sources = video.getAll("source"); sources = video.getAll("source");
@@ -640,7 +729,7 @@
// Convert the poster URL // Convert the poster URL
if (attrs.poster) if (attrs.poster)
attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', 'video'); attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', node.name);
} }
// Object element // Object element
@@ -665,6 +754,11 @@
height = height || object.attr('height'); height = height || object.attr('height');
style = style || object.attr('style'); style = style || object.attr('style');
id = id || object.attr('id'); id = id || object.attr('id');
hspace = hspace || object.attr('hspace');
vspace = vspace || object.attr('vspace');
align = align || object.attr('align');
bgcolor = bgcolor || object.attr('bgcolor');
data.name = object.attr('name');
// Get all object params // Get all object params
params = object.getAll("param"); params = object.getAll("param");
@@ -685,6 +779,10 @@
height = height || embed.attr('height'); height = height || embed.attr('height');
style = style || embed.attr('style'); style = style || embed.attr('style');
id = id || embed.attr('id'); id = id || embed.attr('id');
hspace = hspace || embed.attr('hspace');
vspace = vspace || embed.attr('vspace');
align = align || embed.attr('align');
bgcolor = bgcolor || embed.attr('bgcolor');
// Get all embed attributes // Get all embed attributes
for (name in embed.attributes.map) { for (name in embed.attributes.map) {
@@ -699,6 +797,10 @@
height = iframe.attr('height'); height = 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');
vspace = iframe.attr('vspace');
align = iframe.attr('align');
bgcolor = iframe.attr('bgcolor');
tinymce.each(rootAttributes, function(name) { tinymce.each(rootAttributes, function(name) {
img.attr(name, iframe.attr(name)); img.attr(name, iframe.attr(name));
@@ -721,14 +823,23 @@
if (data.params.src) if (data.params.src)
data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object'); data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object');
if (video) if (video) {
if (node.name === 'video')
type = lookup.video.name; type = lookup.video.name;
else if (node.name === 'audio')
type = lookup.audio.name;
}
if (object && !type) if (object && !type)
type = (lookup[(object.attr('clsid') || '').toLowerCase()] || lookup[(object.attr('type') || '').toLowerCase()] || {}).name; type = (lookupAttribute(object, 'clsid') || lookupAttribute(object, 'classid') || lookupAttribute(object, 'type') || {}).name;
if (embed && !type) if (embed && !type)
type = (lookup[(embed.attr('type') || '').toLowerCase()] || {}).name; type = (lookupAttribute(embed, 'type') || lookupExtension(data.params.src) || {}).name;
// for embedded audio we preserve the original specified type
if (embed && type == 'EmbeddedAudio') {
data.params.type = embed.attr('type');
}
// Replace the video/object/embed element with a placeholder image containing the data // Replace the video/object/embed element with a placeholder image containing the data
node.replace(img); node.replace(img);
@@ -753,13 +864,22 @@
data.video_html = html; data.video_html = html;
} }
data.hspace = hspace;
data.vspace = vspace;
data.align = align;
data.bgcolor = bgcolor;
// Set width/height of placeholder // Set width/height of placeholder
img.attr({ img.attr({
id : id, id : id,
'class' : 'mceItemMedia mceItem' + (type || 'Flash'), 'class' : 'mceItemMedia mceItem' + (type || 'Flash'),
style : style, style : style,
width : width || "320", width : width || (node.name == 'audio' ? "300" : "320"),
height : height || "240", height : height || (node.name == 'audio' ? "32" : "240"),
hspace : hspace,
vspace : vspace,
align : align,
bgcolor : bgcolor,
"data-mce-json" : JSON.serialize(data, "'") "data-mce-json" : JSON.serialize(data, "'")
}); });
} }

View File

@@ -8,6 +8,33 @@
return document.getElementById(id); return document.getElementById(id);
} }
function clone(obj) {
var i, len, copy, attr;
if (null == obj || "object" != typeof obj)
return obj;
// Handle Array
if ('length' in obj) {
copy = [];
for (i = 0, len = obj.length; i < len; ++i) {
copy[i] = clone(obj[i]);
}
return copy;
}
// Handle Object
copy = {};
for (attr in obj) {
if (obj.hasOwnProperty(attr))
copy[attr] = clone(obj[attr]);
}
return copy;
}
function getVal(id) { function getVal(id) {
var elm = get(id); var elm = get(id);
@@ -20,16 +47,17 @@
return elm.value; return elm.value;
} }
function setVal(id, value) { function setVal(id, value, name) {
if (typeof(value) != 'undefined') { if (typeof(value) != 'undefined' && value != null) {
var elm = get(id); var elm = get(id);
if (elm.nodeName == "SELECT") if (elm.nodeName == "SELECT")
selectByValue(document.forms[0], id, value); selectByValue(document.forms[0], id, value);
else if (elm.type == "checkbox") { else if (elm.type == "checkbox") {
if (typeof(value) == 'string') if (typeof(value) == 'string') {
elm.checked = value.toLowerCase() === 'true' ? true : false; value = value.toLowerCase();
else value = (!name && value === 'true') || (name && value === name.toLowerCase());
}
elm.checked = !!value; elm.checked = !!value;
} else } else
elm.value = value; elm.value = value;
@@ -38,19 +66,21 @@
window.Media = { window.Media = {
init : function() { init : function() {
var html, editor; var html, editor, self = this;
this.editor = editor = tinyMCEPopup.editor; self.editor = editor = tinyMCEPopup.editor;
// Setup file browsers and color pickers // Setup file browsers and color pickers
get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');
get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media'); get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media');
get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('filebrowser_altsource1','video_altsource1','media','media'); get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource1','video_altsource1','media','media');
get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('filebrowser_altsource2','video_altsource2','media','media'); get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('video_filebrowser_altsource2','video_altsource2','media','media');
get('audio_altsource1_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource1','audio_altsource1','media','media');
get('audio_altsource2_filebrowser').innerHTML = getBrowserHTML('audio_filebrowser_altsource2','audio_altsource2','media','media');
get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image'); get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image');
html = this.getMediaListHTML('medialist', 'src', 'media', 'media'); html = self.getMediaListHTML('medialist', 'src', 'media', 'media');
if (html == "") if (html == "")
get("linklistrow").style.display = 'none'; get("linklistrow").style.display = 'none';
else else
@@ -59,18 +89,29 @@
if (isVisible('filebrowser')) if (isVisible('filebrowser'))
get('src').style.width = '230px'; get('src').style.width = '230px';
if (isVisible('filebrowser_altsource1')) if (isVisible('video_filebrowser_altsource1'))
get('video_altsource1').style.width = '220px'; get('video_altsource1').style.width = '220px';
if (isVisible('filebrowser_altsource2')) if (isVisible('video_filebrowser_altsource2'))
get('video_altsource2').style.width = '220px'; get('video_altsource2').style.width = '220px';
if (isVisible('audio_filebrowser_altsource1'))
get('audio_altsource1').style.width = '220px';
if (isVisible('audio_filebrowser_altsource2'))
get('audio_altsource2').style.width = '220px';
if (isVisible('filebrowser_poster')) if (isVisible('filebrowser_poster'))
get('video_poster').style.width = '220px'; get('video_poster').style.width = '220px';
this.data = tinyMCEPopup.getWindowArg('data'); editor.dom.setOuterHTML(get('media_type'), self.getMediaTypeHTML(editor));
this.dataToForm();
this.preview(); self.setDefaultDialogSettings(editor);
self.data = clone(tinyMCEPopup.getWindowArg('data'));
self.dataToForm();
self.preview();
updateColor('bgcolor_pick', 'bgcolor');
}, },
insert : function() { insert : function() {
@@ -88,7 +129,7 @@
}, },
moveStates : function(to_form, field) { moveStates : function(to_form, field) {
var data = this.data, editor = this.editor, data = this.data, var data = this.data, editor = this.editor,
mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src; mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src;
defaultStates = { defaultStates = {
@@ -136,7 +177,7 @@
if (type == 'global') if (type == 'global')
list = data; list = data;
else if (type == 'video') { else if (type == 'video' || type == 'audio') {
list = data.video.attrs; list = data.video.attrs;
if (!list && !to_form) if (!list && !to_form)
@@ -146,12 +187,12 @@
if (list) { if (list) {
if (to_form) { if (to_form) {
setVal(formItemName, list[name]); setVal(formItemName, list[name], type == 'video' || type == 'audio' ? name : '');
} else { } else {
delete list[name]; delete list[name];
value = getVal(formItemName); value = getVal(formItemName);
if (type == 'video' && value === true) if ((type == 'video' || type == 'audio') && value === true)
value = name; value = name;
if (defaultStates[formItemName]) { if (defaultStates[formItemName]) {
@@ -184,7 +225,7 @@
setVal('media_type', data.type); setVal('media_type', data.type);
} }
if (data.type == "video") { if (data.type == "video" || data.type == "audio") {
if (!data.video.sources) if (!data.video.sources)
data.video.sources = []; data.video.sources = [];
@@ -194,11 +235,13 @@
// Hide all fieldsets and show the one active // Hide all fieldsets and show the one active
get('video_options').style.display = 'none'; get('video_options').style.display = 'none';
get('audio_options').style.display = 'none';
get('flash_options').style.display = 'none'; get('flash_options').style.display = 'none';
get('quicktime_options').style.display = 'none'; get('quicktime_options').style.display = 'none';
get('shockwave_options').style.display = 'none'; get('shockwave_options').style.display = 'none';
get('windowsmedia_options').style.display = 'none'; get('windowsmedia_options').style.display = 'none';
get('realmedia_options').style.display = 'none'; get('realmedia_options').style.display = 'none';
get('embeddedaudio_options').style.display = 'none';
if (get(data.type + '_options')) if (get(data.type + '_options'))
get(data.type + '_options').style.display = 'block'; get(data.type + '_options').style.display = 'block';
@@ -210,7 +253,9 @@
setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign'); setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign');
setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume'); setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume');
setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks'); setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks');
setOptions('video', 'poster,autoplay,loop,preload,controls'); setOptions('video', 'poster,autoplay,loop,muted,preload,controls');
setOptions('audio', 'autoplay,loop,preload,controls');
setOptions('embeddedaudio', 'autoplay,loop,controls');
setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height'); setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height');
if (to_form) { if (to_form) {
@@ -225,12 +270,23 @@
src = data.video.sources[2]; src = data.video.sources[2];
if (src) if (src)
setVal('video_altsource2', src.src); setVal('video_altsource2', src.src);
} else if (data.type == 'audio') {
if (data.video.sources[0])
setVal('src', data.video.sources[0].src);
src = data.video.sources[1];
if (src)
setVal('audio_altsource1', src.src);
src = data.video.sources[2];
if (src)
setVal('audio_altsource2', src.src);
} else { } else {
// Check flash vars // Check flash vars
if (data.type == 'flash') { if (data.type == 'flash') {
tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) { tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) {
if (value == '$url') if (value == '$url')
data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src; data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src || '';
}); });
} }
@@ -239,6 +295,17 @@
} else { } else {
src = getVal("src"); src = getVal("src");
// YouTube *NEW*
if (src.match(/youtu.be\/[a-z1-9.-_]+/)) {
data.width = 425;
data.height = 350;
data.params.frameborder = '0';
data.type = 'iframe';
src = 'http://www.youtube.com/embed/' + src.match(/youtu.be\/([a-z1-9.-_]+)/)[1];
setVal('src', src);
setVal('media_type', data.type);
}
// YouTube // YouTube
if (src.match(/youtube.com(.+)v=([^&]+)/)) { if (src.match(/youtube.com(.+)v=([^&]+)/)) {
data.width = 425; data.width = 425;
@@ -273,12 +340,25 @@
src = getVal("video_altsource2"); src = getVal("video_altsource2");
if (src) if (src)
data.video.sources[2] = {src : src}; data.video.sources[2] = {src : src};
} else if (data.type == 'audio') {
if (!data.video.sources)
data.video.sources = [];
data.video.sources[0] = {src : src};
src = getVal("audio_altsource1");
if (src)
data.video.sources[1] = {src : src};
src = getVal("audio_altsource2");
if (src)
data.video.sources[2] = {src : src};
} else } else
data.params.src = src; data.params.src = src;
// Set default size // Set default size
setVal('width', data.width || 320); setVal('width', data.width || (data.type == 'audio' ? 300 : 320));
setVal('height', data.height || 240); setVal('height', data.height || (data.type == 'audio' ? 32 : 240));
} }
}, },
@@ -296,7 +376,7 @@
this.panel = 'source'; this.panel = 'source';
} else { } else {
if (this.panel == 'source') { if (this.panel == 'source') {
this.data = this.editor.plugins.media.htmlToData(getVal('source')); this.data = clone(this.editor.plugins.media.htmlToData(getVal('source')));
this.dataToForm(); this.dataToForm();
this.panel = ''; this.panel = '';
} }
@@ -307,16 +387,16 @@
}, },
beforeResize : function() { beforeResize : function() {
this.width = parseInt(getVal('width') || "320", 10); this.width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10);
this.height = parseInt(getVal('height') || "240", 10); this.height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10);
}, },
changeSize : function(type) { changeSize : function(type) {
var width, height, scale, size; var width, height, scale, size;
if (get('constrain').checked) { if (get('constrain').checked) {
width = parseInt(getVal('width') || "320", 10); width = parseInt(getVal('width') || (this.data.type == 'audio' ? "300" : "320"), 10);
height = parseInt(getVal('height') || "240", 10); height = parseInt(getVal('height') || (this.data.type == 'audio' ? "32" : "240"), 10);
if (type == 'width') { if (type == 'width') {
this.height = Math.round((width / this.width) * height); this.height = Math.round((width / this.width) * height);
@@ -344,6 +424,42 @@
} }
return ""; return "";
},
getMediaTypeHTML : function(editor) {
function option(media_type, element) {
if (!editor.schema.getElementRule(element || media_type)) {
return '';
}
return '<option value="'+media_type+'">'+tinyMCEPopup.editor.translate("media_dlg."+media_type)+'</option>'
}
var html = "";
html += '<select id="media_type" name="media_type" onchange="Media.formToData(\'type\');">';
html += option("video");
html += option("audio");
html += option("flash", "object");
html += option("quicktime", "object");
html += option("shockwave", "object");
html += option("windowsmedia", "object");
html += option("realmedia", "object");
html += option("iframe");
if (editor.getParam('media_embedded_audio', false)) {
html += option('embeddedaudio', "object");
}
html += '</select>';
return html;
},
setDefaultDialogSettings : function(editor) {
var defaultDialogSettings = editor.getParam("media_dialog_defaults", {});
tinymce.each(defaultDialogSettings, function(v, k) {
setVal(k, v);
});
} }
}; };

View File

@@ -1,109 +1 @@
tinyMCE.addI18n('en.media_dlg',{ 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" });
title:"Insert / edit embedded media",
general:"General",
advanced:"Advanced",
file:"File/URL",
list:"List",
size:"Dimensions",
preview:"Preview",
constrain_proportions:"Constrain proportions",
type:"Type",
id:"Id",
name:"Name",
class_name:"Class",
vspace:"V-Space",
hspace:"H-Space",
play:"Auto play",
loop:"Loop",
menu:"Show menu",
quality:"Quality",
scale:"Scale",
align:"Align",
salign:"SAlign",
wmode:"WMode",
bgcolor:"Background",
base:"Base",
flashvars:"Flashvars",
liveconnect:"SWLiveConnect",
autohref:"AutoHREF",
cache:"Cache",
hidden:"Hidden",
controller:"Controller",
kioskmode:"Kiosk mode",
playeveryframe:"Play every frame",
targetcache:"Target cache",
correction:"No correction",
enablejavascript:"Enable JavaScript",
starttime:"Start time",
endtime:"End time",
href:"Href",
qtsrcchokespeed:"Choke speed",
target:"Target",
volume:"Volume",
autostart:"Auto start",
enabled:"Enabled",
fullscreen:"Fullscreen",
invokeurls:"Invoke URLs",
mute:"Mute",
stretchtofit:"Stretch to fit",
windowlessvideo:"Windowless video",
balance:"Balance",
baseurl:"Base URL",
captioningid:"Captioning id",
currentmarker:"Current marker",
currentposition:"Current position",
defaultframe:"Default frame",
playcount:"Play count",
rate:"Rate",
uimode:"UI Mode",
flash_options:"Flash options",
qt_options:"Quicktime options",
wmp_options:"Windows media player options",
rmp_options:"Real media player options",
shockwave_options:"Shockwave options",
autogotourl:"Auto goto URL",
center:"Center",
imagestatus:"Image status",
maintainaspect:"Maintain aspect",
nojava:"No java",
prefetch:"Prefetch",
shuffle:"Shuffle",
console:"Console",
numloop:"Num loops",
controls:"Controls",
scriptcallbacks:"Script callbacks",
swstretchstyle:"Stretch style",
swstretchhalign:"Stretch H-Align",
swstretchvalign:"Stretch V-Align",
sound:"Sound",
progress:"Progress",
qtsrc:"QT Src",
qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..",
align_top:"Top",
align_right:"Right",
align_bottom:"Bottom",
align_left:"Left",
align_center:"Center",
align_top_left:"Top left",
align_top_right:"Top right",
align_bottom_left:"Bottom left",
align_bottom_right:"Bottom right",
flv_options:"Flash video options",
flv_scalemode:"Scale mode",
flv_buffer:"Buffer",
flv_starttime:"Start time",
flv_defaultvolume:"Default volumne",
flv_hiddengui:"Hidden GUI",
flv_autostart:"Auto start",
flv_loop:"Loop",
flv_showscalemodes:"Show scale modes",
flv_smoothvideo:"Smooth video",
flv_jscallback:"JS Callback",
html5_video_options:"HTML5 Video Options",
altsource1:"Alternative source 1",
altsource2:"Alternative source 2",
preload:"Preload",
poster:"Poster",
source:"Source"
});

View File

@@ -29,15 +29,7 @@
<tr> <tr>
<td><label for="media_type">{#media_dlg.type}</label></td> <td><label for="media_type">{#media_dlg.type}</label></td>
<td> <td>
<select id="media_type" name="media_type" onchange="Media.formToData('type');"> <select id="media_type"></select>
<option value="video">HTML5 Video</option>
<option value="flash">Flash</option>
<option value="quicktime">QuickTime</option>
<option value="shockwave">Shockwave</option>
<option value="windowsmedia">Windows Media</option>
<option value="realmedia">Real Media</option>
<option value="iframe">Iframe</option>
</select>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -159,6 +151,17 @@
</table> </table>
</td> </td>
</tr> </tr>
<tr>
<td><label for="video_preload">{#media_dlg.preload}</label></td>
<td>
<select id="video_preload" name="video_preload" onchange="Media.formToData();">
<option value="none">{#media_dlg.preload_none}</option>
<option value="metadata">{#media_dlg.preload_metadata}</option>
<option value="auto">{#media_dlg.preload_auto}</option>
</select>
</td>
</tr>
</table> </table>
<table role="presentation" border="0" cellpadding="4" cellspacing="0"> <table role="presentation" border="0" cellpadding="4" cellspacing="0">
@@ -172,6 +175,15 @@
</table> </table>
</td> </td>
<td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="video_muted" name="video_muted" onchange="Media.formToData();" /></td>
<td><label for="video_muted">{#media_dlg.mute}</label></td>
</tr>
</table>
</td>
<td> <td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0"> <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr> <tr>
@@ -184,8 +196,25 @@
<td> <td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0"> <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr> <tr>
<td><input type="checkbox" class="checkbox" id="video_preload" name="video_preload" onchange="Media.formToData();" /></td> <td><input type="checkbox" class="checkbox" id="video_controls" name="video_controls" onchange="Media.formToData();" /></td>
<td><label for="video_preload">{#media_dlg.preload}</label></td> <td><label for="video_controls">{#media_dlg.controls}</label></td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
<fieldset id="embeddedaudio_options">
<legend>{#media_dlg.embedded_audio_options}</legend>
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
<tr>
<td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="embeddedaudio_autoplay" name="audio_autoplay" onchange="Media.formToData();" /></td>
<td><label for="audio_autoplay">{#media_dlg.play}</label></td>
</tr> </tr>
</table> </table>
</td> </td>
@@ -193,8 +222,89 @@
<td> <td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0"> <table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr> <tr>
<td><input type="checkbox" class="checkbox" id="video_controls" name="video_controls" onchange="Media.formToData();" /></td> <td><input type="checkbox" class="checkbox" id="embeddedaudio_loop" name="audio_loop" onchange="Media.formToData();" /></td>
<td><label for="video_controls">{#media_dlg.controls}</label></td> <td><label for="audio_loop">{#media_dlg.loop}</label></td>
</tr>
</table>
</td>
<td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="embeddedaudio_controls" name="audio_controls" onchange="Media.formToData();" /></td>
<td><label for="audio_controls">{#media_dlg.controls}</label></td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
<fieldset id="audio_options">
<legend>{#media_dlg.html5_audio_options}</legend>
<table role="presentation">
<tr>
<td><label for="audio_altsource1">{#media_dlg.altsource1}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="audio_altsource1" name="audio_altsource1" onchange="Media.formToData();" style="width: 240px" /></td>
<td id="audio_altsource1_filebrowser">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="audio_altsource2">{#media_dlg.altsource2}</label></td>
<td>
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="text" id="audio_altsource2" name="audio_altsource2" onchange="Media.formToData();" style="width: 240px" /></td>
<td id="audio_altsource2_filebrowser">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><label for="audio_preload">{#media_dlg.preload}</label></td>
<td>
<select id="audio_preload" name="audio_preload" onchange="Media.formToData();">
<option value="none">{#media_dlg.preload_none}</option>
<option value="metadata">{#media_dlg.preload_metadata}</option>
<option value="auto">{#media_dlg.preload_auto}</option>
</select>
</td>
</tr>
</table>
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
<tr>
<td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="audio_autoplay" name="audio_autoplay" onchange="Media.formToData();" /></td>
<td><label for="audio_autoplay">{#media_dlg.play}</label></td>
</tr>
</table>
</td>
<td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="audio_loop" name="audio_loop" onchange="Media.formToData();" /></td>
<td><label for="audio_loop">{#media_dlg.loop}</label></td>
</tr>
</table>
</td>
<td>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="checkbox" class="checkbox" id="audio_controls" name="audio_controls" onchange="Media.formToData();" /></td>
<td><label for="audio_controls">{#media_dlg.controls}</label></td>
</tr> </tr>
</table> </table>
</td> </td>
@@ -798,7 +908,7 @@
<div id="source_panel" class="panel"> <div id="source_panel" class="panel">
<fieldset> <fieldset>
<legend>{#media_dlg.source}</legend> <legend>{#media_dlg.source}</legend>
<textarea id="source" style="width: 100%; height: 390px"></textarea> <textarea id="source" style="width: 99%; height: 390px"></textarea>
</fieldset> </fieldset>
</div> </div>
</div> </div>

View File

@@ -1 +1 @@
(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?'<span data-mce-bogus="1" class="mceItemHidden mceItemNbsp">&nbsp;</span>':"&nbsp;")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(tinymce.isIE&&f.keyCode==9){d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");tinymce.dom.Event.cancel(f)}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})(); (function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?'<span data-mce-bogus="1" class="mceItemHidden mceItemNbsp">&nbsp;</span>':"&nbsp;")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(f.keyCode==9){f.preventDefault();d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking")}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})();

View File

@@ -25,11 +25,12 @@
if (ed.getParam('nonbreaking_force_tab')) { if (ed.getParam('nonbreaking_force_tab')) {
ed.onKeyDown.add(function(ed, e) { ed.onKeyDown.add(function(ed, e) {
if (tinymce.isIE && e.keyCode == 9) { if (e.keyCode == 9) {
e.preventDefault();
ed.execCommand('mceNonBreaking'); ed.execCommand('mceNonBreaking');
ed.execCommand('mceNonBreaking'); ed.execCommand('mceNonBreaking');
ed.execCommand('mceNonBreaking'); ed.execCommand('mceNonBreaking');
tinymce.dom.Event.cancel(e);
} }
}); });
} }

View File

@@ -1 +1 @@
(function(){var a=tinymce.dom.Event;tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(d,e){var f=this,c,b;f.editor=d;c=d.getParam("noneditable_editable_class","mceEditable");b=d.getParam("noneditable_noneditable_class","mceNonEditable");d.onNodeChange.addToTop(function(h,g,k){var j,i;j=h.dom.getParent(h.selection.getStart(),function(l){return h.dom.hasClass(l,b)});i=h.dom.getParent(h.selection.getEnd(),function(l){return h.dom.hasClass(l,b)});if(j||i){f._setDisabled(1);return false}else{f._setDisabled(0)}})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_block:function(c,d){var b=d.keyCode;if((b>32&&b<41)||(b>111&&b<124)){return}return a.cancel(d)},_setDisabled:function(d){var c=this,b=c.editor;tinymce.each(b.controlManager.controls,function(e){e.setDisabled(d)});if(d!==c.disabled){if(d){b.onKeyDown.addToTop(c._block);b.onKeyPress.addToTop(c._block);b.onKeyUp.addToTop(c._block);b.onPaste.addToTop(c._block);b.onContextMenu.addToTop(c._block)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block);b.onContextMenu.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); (function(){var a=tinymce.dom.Event;tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(d,e){var f=this,c,b,g;f.editor=d;c=d.getParam("noneditable_editable_class","mceEditable");b=d.getParam("noneditable_noneditable_class","mceNonEditable");d.onNodeChange.addToTop(function(i,h,l){var k,j;k=i.dom.getParent(i.selection.getStart(),function(m){return i.dom.hasClass(m,b)});j=i.dom.getParent(i.selection.getEnd(),function(m){return i.dom.hasClass(m,b)});if(k||j){g=1;f._setDisabled(1);return false}else{if(g==1){f._setDisabled(0);g=0}}})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_block:function(c,d){var b=d.keyCode;if((b>32&&b<41)||(b>111&&b<124)){return}return a.cancel(d)},_setDisabled:function(d){var c=this,b=c.editor;tinymce.each(b.controlManager.controls,function(e){e.setDisabled(d)});if(d!==c.disabled){if(d){b.onKeyDown.addToTop(c._block);b.onKeyPress.addToTop(c._block);b.onKeyUp.addToTop(c._block);b.onPaste.addToTop(c._block);b.onContextMenu.addToTop(c._block)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block);b.onContextMenu.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})();

View File

@@ -13,7 +13,7 @@
tinymce.create('tinymce.plugins.NonEditablePlugin', { tinymce.create('tinymce.plugins.NonEditablePlugin', {
init : function(ed, url) { init : function(ed, url) {
var t = this, editClass, nonEditClass; var t = this, editClass, nonEditClass, state;
t.editor = ed; t.editor = ed;
editClass = ed.getParam("noneditable_editable_class", "mceEditable"); editClass = ed.getParam("noneditable_editable_class", "mceEditable");
@@ -33,10 +33,13 @@
// Block or unblock // Block or unblock
if (sc || ec) { if (sc || ec) {
state = 1;
t._setDisabled(1); t._setDisabled(1);
return false; return false;
} else } else if (state == 1) {
t._setDisabled(0); t._setDisabled(0);
state = 0;
}
}); });
}, },

File diff suppressed because one or more lines are too long

View File

@@ -27,7 +27,7 @@
paste_text_sticky : false, paste_text_sticky : false,
paste_text_sticky_default : false, paste_text_sticky_default : false,
paste_text_notifyalways : false, paste_text_notifyalways : false,
paste_text_linebreaktype : "p", paste_text_linebreaktype : "combined",
paste_text_replacements : [ paste_text_replacements : [
[/\u2026/g, "..."], [/\u2026/g, "..."],
[/[\x93\x94\u201c\u201d]/g, '"'], [/[\x93\x94\u201c\u201d]/g, '"'],
@@ -76,7 +76,7 @@
// This function executes the process handlers and inserts the contents // This function executes the process handlers and inserts the contents
// force_rich overrides plain text mode set by user, important for pasting with execCommand // force_rich overrides plain text mode set by user, important for pasting with execCommand
function process(o, force_rich) { function process(o, force_rich) {
var dom = ed.dom, rng, nodes; var dom = ed.dom, rng;
// Execute pre process handlers // Execute pre process handlers
t.onPreProcess.dispatch(t, o); t.onPreProcess.dispatch(t, o);
@@ -89,11 +89,9 @@
if (tinymce.isGecko) { if (tinymce.isGecko) {
rng = ed.selection.getRng(true); rng = ed.selection.getRng(true);
if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) { if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) {
nodes = dom.select('p,h1,h2,h3,h4,h5,h6,pre', o.node);
// Is only one block node and it doesn't contain word stuff // Is only one block node and it doesn't contain word stuff
if (nodes.length == 1 && o.content.indexOf('__MCE_ITEM__') === -1) if (o.node.childNodes.length === 1 && /^(p|h[1-6]|pre)$/i.test(o.node.firstChild.nodeName) && o.content.indexOf('__MCE_ITEM__') === -1)
dom.remove(nodes.reverse(), true); dom.remove(o.node.firstChild, true);
} }
} }
@@ -101,11 +99,11 @@
t.onPostProcess.dispatch(t, o); t.onPostProcess.dispatch(t, o);
// Serialize content // Serialize content
o.content = ed.serializer.serialize(o.node, {getInner : 1}); o.content = ed.serializer.serialize(o.node, {getInner : 1, forced_root_block : ''});
// Plain text option active? // Plain text option active?
if ((!force_rich) && (ed.pasteAsPlainText)) { if ((!force_rich) && (ed.pasteAsPlainText)) {
t._insertPlainText(ed, dom, o.content); t._insertPlainText(o.content);
if (!getParam(ed, "paste_text_sticky")) { if (!getParam(ed, "paste_text_sticky")) {
ed.pasteAsPlainText = false; ed.pasteAsPlainText = false;
@@ -132,7 +130,7 @@
if (getParam(ed, "paste_text_sticky")) { if (getParam(ed, "paste_text_sticky")) {
ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky'));
} else { } else {
ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky')); ed.windowManager.alert(ed.translate('paste.plaintext_mode'));
} }
if (!getParam(ed, "paste_text_notifyalways")) { if (!getParam(ed, "paste_text_notifyalways")) {
@@ -157,7 +155,7 @@
if (ed.pasteAsPlainText) { if (ed.pasteAsPlainText) {
e.preventDefault(); e.preventDefault();
process({content : textContent.replace(/\r?\n/g, '<br />')}); process({content : dom.encode(textContent).replace(/\r?\n/g, '<br />')});
return; return;
} }
} }
@@ -172,13 +170,14 @@
if (body != ed.getDoc().body) if (body != ed.getDoc().body)
posY = dom.getPos(ed.selection.getStart(), body).y; posY = dom.getPos(ed.selection.getStart(), body).y;
else else
posY = body.scrollTop + dom.getViewPort().y; posY = body.scrollTop + dom.getViewPort(ed.getWin()).y;
// Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles
// If also needs to be in view on IE or the paste would fail
dom.setStyles(n, { dom.setStyles(n, {
position : 'absolute', position : 'absolute',
left : -10000, left : tinymce.isGecko ? -40 : 0, // Need to move it out of site on Gecko since it will othewise display a ghost resize rect for the div
top : posY, top : posY - 25,
width : 1, width : 1,
height : 1, height : 1,
overflow : 'hidden' overflow : 'hidden'
@@ -268,8 +267,9 @@
h += n.innerHTML; h += n.innerHTML;
}); });
} else { } else {
// Found WebKit weirdness so force the content into plain text mode // Found WebKit weirdness so force the content into paragraphs this seems to happen when you paste plain text from Nodepad etc
h = '<pre>' + dom.encode(textContent).replace(/\r?\n/g, '<br />') + '</pre>'; // So this logic will replace double enter with paragraphs and single enter with br so it kind of looks the same
h = '<p>' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '</p><p>').replace(/\r?\n/g, '<br />') + '</p>';
} }
// Remove the nodes // Remove the nodes
@@ -359,9 +359,18 @@
} }
// IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser
if (tinymce.isIE && document.documentMode >= 9) if (tinymce.isIE && document.documentMode >= 9) {
// IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser
process([[/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g, '$1']]); process([[/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g, '$1']]);
// IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break
process([
[/<br><br>/g, '<BR><BR>'], // Replace multiple BR elements with uppercase BR to keep them intact
[/<br>/g, ' '], // Replace single br elements with space since they are word wrap BR:s
[/<BR><BR>/g, '<br>'] // Replace back the double brs but into a single BR
]);
}
// Detect Word content and process it more aggressive // Detect Word content and process it more aggressive
if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) { if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) {
o.wordContent = true; // Mark the pasted contents as word specific content o.wordContent = true; // Mark the pasted contents as word specific content
@@ -747,28 +756,24 @@
* plugin, and requires minimal changes to add the new functionality. * plugin, and requires minimal changes to add the new functionality.
* Speednet - June 2009 * Speednet - June 2009
*/ */
_insertPlainText : function(ed, dom, h) { _insertPlainText : function(content) {
var i, len, pos, rpos, node, breakElms, before, after, var ed = this.editor,
w = ed.getWin(),
d = ed.getDoc(),
sel = ed.selection,
is = tinymce.is,
inArray = tinymce.inArray,
linebr = getParam(ed, "paste_text_linebreaktype"), linebr = getParam(ed, "paste_text_linebreaktype"),
rl = getParam(ed, "paste_text_replacements"); rl = getParam(ed, "paste_text_replacements"),
is = tinymce.is;
function process(items) { function process(items) {
each(items, function(v) { each(items, function(v) {
if (v.constructor == RegExp) if (v.constructor == RegExp)
h = h.replace(v, ""); content = content.replace(v, "");
else else
h = h.replace(v[0], v[1]); content = content.replace(v[0], v[1]);
}); });
}; };
if ((typeof(h) === "string") && (h.length > 0)) { if ((typeof(content) === "string") && (content.length > 0)) {
// If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line
if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(h)) { if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(content)) {
process([ process([
/[\n\r]+/g /[\n\r]+/g
]); ]);
@@ -785,114 +790,47 @@
[/<\/t[dh]>\s*<t[dh][^>]*>/gi, "\t"], // Table cells get tabs betweem them [/<\/t[dh]>\s*<t[dh][^>]*>/gi, "\t"], // Table cells get tabs betweem them
/<[a-z!\/?][^>]*>/gi, // Delete all remaining tags /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags
[/&nbsp;/gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*) [/&nbsp;/gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*)
[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"], // Cool little RegExp deletes whitespace around linebreak chars. [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"],// Cool little RegExp deletes whitespace around linebreak chars.
[/\n{3,}/g, "\n\n"], // Max. 2 consecutive linebreaks [/\n{3,}/g, "\n\n"] // Max. 2 consecutive linebreaks
/^\s+|\s+$/g // Trim the front & back
]); ]);
h = dom.decode(tinymce.html.Entities.encodeRaw(h)); content = ed.dom.decode(tinymce.html.Entities.encodeRaw(content));
// Delete any highlighted text before pasting
if (!sel.isCollapsed()) {
d.execCommand("Delete", false, null);
}
// Perform default or custom replacements // Perform default or custom replacements
if (is(rl, "array") || (is(rl, "array"))) { if (is(rl, "array")) {
process(rl); process(rl);
} } else if (is(rl, "string")) {
else if (is(rl, "string")) {
process(new RegExp(rl, "gi")); process(new RegExp(rl, "gi"));
} }
// Treat paragraphs as specified in the config // Treat paragraphs as specified in the config
if (linebr == "none") { if (linebr == "none") {
// Convert all line breaks to space
process([ process([
[/\n+/g, " "] [/\n+/g, " "]
]); ]);
} } else if (linebr == "br") {
else if (linebr == "br") { // Convert all line breaks to <br />
process([ process([
[/\n/g, "<br />"] [/\n/g, "<br />"]
]); ]);
} } else if (linebr == "p") {
else { // Convert all line breaks to <p>...</p>
process([
[/\n+/g, "</p><p>"],
[/^(.*<\/p>)(<p>)$/, '<p>$1']
]);
} else {
// defaults to "combined"
// Convert single line breaks to <br /> and double line breaks to <p>...</p>
process([ process([
/^\s+|\s+$/g,
[/\n\n/g, "</p><p>"], [/\n\n/g, "</p><p>"],
[/^(.*<\/p>)(<p>)$/, '<p>$1'],
[/\n/g, "<br />"] [/\n/g, "<br />"]
]); ]);
} }
// This next piece of code handles the situation where we're pasting more than one paragraph of plain ed.execCommand('mceInsertContent', false, content);
// text, and we are pasting the content into the middle of a block node in the editor. The block
// node gets split at the selection point into "Para A" and "Para B" (for the purposes of explaining).
// The first paragraph of the pasted text is appended to "Para A", and the last paragraph of the
// pasted text is prepended to "Para B". Any other paragraphs of pasted text are placed between
// "Para A" and "Para B". This code solves a host of problems with the original plain text plugin and
// now handles styles correctly. (Pasting plain text into a styled paragraph is supposed to make the
// plain text take the same style as the existing paragraph.)
if ((pos = h.indexOf("</p><p>")) != -1) {
rpos = h.lastIndexOf("</p><p>");
node = sel.getNode();
breakElms = []; // Get list of elements to break
do {
if (node.nodeType == 1) {
// Don't break tables and break at body
if (node.nodeName == "TD" || node.nodeName == "BODY") {
break;
}
breakElms[breakElms.length] = node;
}
} while (node = node.parentNode);
// Are we in the middle of a block node?
if (breakElms.length > 0) {
before = h.substring(0, pos);
after = "";
for (i=0, len=breakElms.length; i<len; i++) {
before += "</" + breakElms[i].nodeName.toLowerCase() + ">";
after += "<" + breakElms[breakElms.length-i-1].nodeName.toLowerCase() + ">";
}
if (pos == rpos) {
h = before + after + h.substring(pos+7);
}
else {
h = before + h.substring(pos+4, rpos+4) + after + h.substring(rpos+7);
}
}
}
// Insert content at the caret, plus add a marker for repositioning the caret
ed.execCommand("mceInsertRawHTML", false, h + '<span id="_plain_text_marker">&nbsp;</span>');
// Reposition the caret to the marker, which was placed immediately after the inserted content.
// Needs to be done asynchronously (in window.setTimeout) or else it doesn't work in all browsers.
// The second part of the code scrolls the content up if the caret is positioned off-screen.
// This is only necessary for WebKit browsers, but it doesn't hurt to use for all.
window.setTimeout(function() {
var marker = dom.get('_plain_text_marker'),
elm, vp, y, elmHeight;
sel.select(marker, false);
d.execCommand("Delete", false, null);
marker = null;
// Get element, position and height
elm = sel.getStart();
vp = dom.getViewPort(w);
y = dom.getPos(elm).y;
elmHeight = elm.clientHeight;
// Is element within viewport if not then scroll it into view
if ((y < vp.y) || (y + elmHeight > vp.y + vp.h)) {
d.body.scrollTop = y < vp.y ? y : y - vp.h + 25;
}
}, 0);
} }
}, },

View File

@@ -1,5 +1 @@
tinyMCE.addI18n('en.paste_dlg',{ tinyMCE.addI18n('en.paste_dlg',{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."});
text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
text_linebreaks:"Keep linebreaks",
word_title:"Use CTRL+V on your keyboard to paste the text into the window."
});

View File

@@ -1,16 +1 @@
tinyMCE.addI18n('en.searchreplace_dlg',{ tinyMCE.addI18n('en.searchreplace_dlg',{findwhat:"Find What",replacewith:"Replace with",direction:"Direction",up:"Up",down:"Down",mcase:"Match Case",findnext:"Find Next",allreplaced:"All occurrences of the search string were replaced.","searchnext_desc":"Find Again",notfound:"The search has been completed. The search string could not be found.","search_title":"Find","replace_title":"Find/Replace",replaceall:"Replace All",replace:"Replace"});
searchnext_desc:"Find again",
notfound:"The search has been completed. The search string could not be found.",
search_title:"Find",
replace_title:"Find/Replace",
allreplaced:"All occurrences of the search string were replaced.",
findwhat:"Find what",
replacewith:"Replace with",
direction:"Direction",
up:"Up",
down:"Down",
mcase:"Match case",
findnext:"Find next",
replace:"Replace",
replaceall:"Replace all"
});

File diff suppressed because one or more lines are too long

View File

@@ -314,6 +314,7 @@
} else } else
m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
if (ed.getParam('show_ignore_words', true)) {
ignoreRpc = t.editor.getParam("spellchecker_enable_ignore_rpc", ''); ignoreRpc = t.editor.getParam("spellchecker_enable_ignore_rpc", '');
m.add({ m.add({
title : 'spellchecker.ignore_word', title : 'spellchecker.ignore_word',
@@ -350,7 +351,7 @@
} }
} }
}); });
}
if (t.editor.getParam("spellchecker_enable_learn_rpc")) { if (t.editor.getParam("spellchecker_enable_learn_rpc")) {
m.add({ m.add({
@@ -372,7 +373,7 @@
m.update(); m.update();
}); });
p1 = dom.getPos(ed.getContentAreaContainer()); p1 = DOM.getPos(ed.getContentAreaContainer());
m.settings.offset_x = p1.x; m.settings.offset_x = p1.x;
m.settings.offset_y = p1.y; m.settings.offset_y = p1.y;

View File

@@ -144,6 +144,8 @@ function setupFormData() {
f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); f.text_overline.checked = inStr(ce.style.textDecoration, 'overline');
f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through');
f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); f.text_blink.checked = inStr(ce.style.textDecoration, 'blink');
f.text_none.checked = inStr(ce.style.textDecoration, 'none');
updateTextDecorations();
// Setup background fields // Setup background fields
@@ -372,7 +374,7 @@ function applyAction() {
generateCSS(); generateCSS();
tinyMCEPopup.restoreSelection(); tinyMCEPopup.restoreSelection();
ed.dom.setAttrib(ed.selection.getNode(), 'style', tinyMCEPopup.editor.dom.serializeStyle(tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText))); ed.dom.setAttrib(ed.selection.getSelectedBlocks(), 'style', tinyMCEPopup.editor.dom.serializeStyle(tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText)));
} }
function updateAction() { function updateAction() {
@@ -632,4 +634,17 @@ function synch(fr, to) {
selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value);
} }
function updateTextDecorations(){
var el = document.forms[0].elements;
var textDecorations = ["text_underline", "text_overline", "text_linethrough", "text_blink"];
var noneChecked = el["text_none"].checked;
tinymce.each(textDecorations, function(id) {
el[id].disabled = noneChecked;
if (noneChecked) {
el[id].checked = false;
}
});
}
tinyMCEPopup.onInit.add(init); tinyMCEPopup.onInit.add(init);

View File

@@ -1,70 +1 @@
tinyMCE.addI18n('en.style_dlg',{ 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",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"});
title:"Edit CSS Style",
apply:"Apply",
text_tab:"Text",
background_tab:"Background",
block_tab:"Block",
box_tab:"Box",
border_tab:"Border",
list_tab:"List",
positioning_tab:"Positioning",
text_props:"Text",
text_font:"Font",
text_size:"Size",
text_weight:"Weight",
text_style:"Style",
text_variant:"Variant",
text_lineheight:"Line height",
text_case:"Case",
text_color:"Color",
text_decoration:"Decoration",
text_overline:"overline",
text_underline:"underline",
text_striketrough:"strikethrough",
text_blink:"blink",
text_none:"none",
background_color:"Background color",
background_image:"Background image",
background_repeat:"Repeat",
background_attachment:"Attachment",
background_hpos:"Horizontal position",
background_vpos:"Vertical position",
block_wordspacing:"Word spacing",
block_letterspacing:"Letter spacing",
block_vertical_alignment:"Vertical alignment",
block_text_align:"Text align",
block_text_indent:"Text indent",
block_whitespace:"Whitespace",
block_display:"Display",
box_width:"Width",
box_height:"Height",
box_float:"Float",
box_clear:"Clear",
padding:"Padding",
same:"Same for all",
top:"Top",
right:"Right",
bottom:"Bottom",
left:"Left",
margin:"Margin",
style:"Style",
width:"Width",
height:"Height",
color:"Color",
list_type:"Type",
bullet_image:"Bullet image",
position:"Position",
positioning_type:"Type",
visibility:"Visibility",
zindex:"Z-index",
overflow:"Overflow",
placement:"Placement",
clip:"Clip",
text:"Text",
background:"Background",
block:"Block",
box:"Box",
border:"Border",
list:"List",
position:"Position"
});

View File

@@ -118,7 +118,7 @@
<td><label for="text_blink">{#style_dlg.text_blink}</label></td> <td><label for="text_blink">{#style_dlg.text_blink}</label></td>
</tr> </tr>
<tr> <tr>
<td><input id="text_none" name="text_none" class="checkbox" type="checkbox" /></td> <td><input id="text_none" name="text_none" class="checkbox" type="checkbox" onclick="updateTextDecorations();"/></td>
<td><label for="text_none">{#style_dlg.text_none}</label></td> <td><label for="text_none">{#style_dlg.text_none}</label></td>
</tr> </tr>
</table> </table>
@@ -316,6 +316,8 @@
<td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td> <td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td>
</tr> </tr>
</table> </table>
</fieldset>
<div style="float: left; width: 49%"> <div style="float: left; width: 49%">
<fieldset> <fieldset>
<legend>{#style_dlg.padding}</legend> <legend>{#style_dlg.padding}</legend>
@@ -672,6 +674,7 @@
<td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td> <td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td>
</tr> </tr>
</table> </table>
</fieldset>
<div style="float: left; width: 49%"> <div style="float: left; width: 49%">
<fieldset> <fieldset>
@@ -820,7 +823,6 @@
</div> </div>
<br style="clear: both" /> <br style="clear: both" />
</div> </div>
</fieldset>
</div> </div>
<div class="mceActionPanel"> <div class="mceActionPanel">

View File

@@ -1 +1 @@
(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(r){n=c.select(":input:enabled,*[tabindex]");function i(s){return s.type!="hidden"&&s.tabIndex!="-1"&&!(n[m].style.display=="none")&&!(n[m].style.visibility=="hidden")}d(n,function(t,s){if(t.id==l.id){j=s;return false}});if(r>0){for(m=j+1;m<n.length;m++){if(i(n[m])){return n[m]}}}else{for(m=j-1;m>=0;m--){if(i(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})(); (function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(t){n=c.select(":input:enabled,*[tabindex]");function s(v){return v.nodeName==="BODY"||(v.type!="hidden"&&!(v.style.display=="none")&&!(v.style.visibility=="hidden")&&s(v.parentNode))}function i(v){return v.attributes.tabIndex.specified||v.nodeName=="INPUT"||v.nodeName=="TEXTAREA"}function u(){return tinymce.isIE6||tinymce.isIE7}function r(v){return((!u()||i(v)))&&v.getAttribute("tabindex")!="-1"&&s(v)}d(n,function(w,v){if(w.id==l.id){j=v;return false}});if(t>0){for(m=j+1;m<n.length;m++){if(r(n[m])){return n[m]}}}else{for(m=j-1;m>=0;m--){if(r(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})();

View File

@@ -16,18 +16,27 @@
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]'); el = DOM.select(':input:enabled,*[tabindex]');
function canSelect(e) {
return e.type != 'hidden' && function canSelectRecursive(e) {
e.tabIndex != '-1' && return e.nodeName==="BODY" || (e.type != 'hidden' &&
!(el[i].style.display == "none") && !(e.style.display == "none") &&
!(el[i].style.visibility == "hidden"); !(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode));
}
function canSelectInOldIe(el) {
return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
}
function isOldIe() {
return tinymce.isIE6 || tinymce.isIE7;
}
function canSelect(el) {
return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
} }
each(el, function(e, i) { each(el, function(e, i) {
@@ -36,7 +45,6 @@
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]))
@@ -50,7 +58,7 @@
} }
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')));
@@ -86,7 +94,7 @@
return Event.cancel(e); return Event.cancel(e);
} }
} }
}; }
ed.onKeyUp.add(tabCancel); ed.onKeyUp.add(tabCancel);

View File

@@ -5,6 +5,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="../../utils/mctabs.js"></script> <script type="text/javascript" src="../../utils/mctabs.js"></script>
<script type="text/javascript" src="../../utils/form_utils.js"></script> <script type="text/javascript" src="../../utils/form_utils.js"></script>
<script type="text/javascript" src="../../utils/validate.js"></script>
<script type="text/javascript" src="../../utils/editable_selects.js"></script> <script type="text/javascript" src="../../utils/editable_selects.js"></script>
<script type="text/javascript" src="js/cell.js"></script> <script type="text/javascript" src="js/cell.js"></script>
<link href="css/cell.css" rel="stylesheet" type="text/css" /> <link href="css/cell.css" rel="stylesheet" type="text/css" />
@@ -70,10 +71,10 @@
<tr> <tr>
<td><label for="width">{#table_dlg.width}</label></td> <td><label for="width">{#table_dlg.width}</label></td>
<td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td> <td><input id="width" name="width" type="text" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>
<td><label for="height">{#table_dlg.height}</label></td> <td><label for="height">{#table_dlg.height}</label></td>
<td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td> <td><input id="height" name="height" type="text" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>
</tr> </tr>
<tr id="styleSelectRow"> <tr id="styleSelectRow">
@@ -166,6 +167,7 @@
<select id="action" name="action"> <select id="action" name="action">
<option value="cell">{#table_dlg.cell_cell}</option> <option value="cell">{#table_dlg.cell_cell}</option>
<option value="row">{#table_dlg.cell_row}</option> <option value="row">{#table_dlg.cell_row}</option>
<option value="col">{#table_dlg.cell_col}</option>
<option value="all">{#table_dlg.cell_all}</option> <option value="all">{#table_dlg.cell_all}</option>
</select> </select>
</div> </div>

File diff suppressed because one or more lines are too long

View File

@@ -25,6 +25,10 @@
return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0; return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0;
}; };
function getSpanVal(td, name) {
return parseInt(td.getAttribute(name) || 1);
}
/** /**
* Table Grid class. * Table Grid class.
*/ */
@@ -100,10 +104,6 @@
return row[x]; return row[x];
}; };
function getSpanVal(td, name) {
return parseInt(td.getAttribute(name) || 1);
};
function setSpanVal(td, name, val) { function setSpanVal(td, name, val) {
if (td) { if (td) {
val = parseInt(val); val = parseInt(val);
@@ -752,7 +752,7 @@
tinymce.create('tinymce.plugins.TablePlugin', { tinymce.create('tinymce.plugins.TablePlugin', {
init : function(ed, url) { init : function(ed, url) {
var winMan, clipboardRows; var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload
function createTableGrid(node) { function createTableGrid(node) {
var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table');
@@ -764,7 +764,11 @@
function cleanup() { function cleanup() {
// Restore selection possibilities // Restore selection possibilities
ed.getBody().style.webkitUserSelect = ''; ed.getBody().style.webkitUserSelect = '';
if (hasCellSelection) {
ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
hasCellSelection = false;
}
}; };
// Register buttons // Register buttons
@@ -873,6 +877,7 @@
} }
tableGrid.setEndCell(target); tableGrid.setEndCell(target);
hasCellSelection = true;
} }
// Remove current selection // Remove current selection
@@ -923,7 +928,7 @@
return; return;
} }
} while (node = (start ? walker.next() : walker.prev())); } while (node = (start ? walker.next() : walker.prev()));
}; }
// Try to expand text selection as much as we can only Gecko supports cell selection // Try to expand text selection as much as we can only Gecko supports cell selection
selectedCells = dom.select('td.mceSelected,th.mceSelected'); selectedCells = dom.select('td.mceSelected,th.mceSelected');
@@ -931,6 +936,8 @@
rng = dom.createRng(); rng = dom.createRng();
node = selectedCells[0]; node = selectedCells[0];
endNode = selectedCells[selectedCells.length - 1]; endNode = selectedCells[selectedCells.length - 1];
rng.setStartBefore(node);
rng.setEndAfter(node);
setPoint(node, 1); setPoint(node, 1);
walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table')); walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table'));
@@ -958,6 +965,60 @@
cleanup(); cleanup();
}); });
ed.onKeyDown.add(function (ed, e) {
fixTableCellSelection(ed);
});
ed.onMouseDown.add(function (ed, e) {
if (e.button != 2) {
fixTableCellSelection(ed);
}
});
function tableCellSelected(ed, rng, n, currentCell) {
// The decision of when a table cell is selected is somewhat involved. The fact that this code is
// required is actually a pointer to the root cause of this bug. A cell is selected when the start
// and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases)
// or the parent of the table (in the case of the selection containing the last cell of a table).
var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'),
tableParent, allOfCellSelected, tableCellSelection;
if (table)
tableParent = table.parentNode;
allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE &&
rng.startOffset == 0 &&
rng.endOffset == 0 &&
currentCell &&
(n.nodeName=="TR" || n==tableParent);
tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell;
return allOfCellSelected || tableCellSelection;
// return false;
}
// this nasty hack is here to work around some WebKit selection bugs.
function fixTableCellSelection(ed) {
if (!tinymce.isWebKit)
return;
var rng = ed.selection.getRng();
var n = ed.selection.getNode();
var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH');
if (!tableCellSelected(ed, rng, n, currentCell))
return;
if (!currentCell) {
currentCell=n;
}
// Get the very last node inside the table cell
var end = currentCell.lastChild;
while (end.lastChild)
end = end.lastChild;
// Select the entire table cell. Nothing outside of the table cell should be selected.
rng.setEnd(end, end.nodeValue.length);
ed.selection.setRng(rng);
}
ed.plugins.table.fixTableCellSelection=fixTableCellSelection;
// Add context menu // Add context menu
if (ed && ed.plugins.contextmenu) { if (ed && ed.plugins.contextmenu) {
ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
@@ -1010,6 +1071,150 @@
}); });
} }
// Fix to allow navigating up and down in a table in WebKit browsers.
if (tinymce.isWebKit) {
function moveSelection(ed, e) {
var VK = tinymce.VK;
var key = e.keyCode;
function handle(upBool, sourceNode, event) {
var siblingDirection = upBool ? 'previousSibling' : 'nextSibling';
var currentRow = ed.dom.getParent(sourceNode, 'tr');
var siblingRow = currentRow[siblingDirection];
if (siblingRow) {
moveCursorToRow(ed, sourceNode, siblingRow, upBool);
tinymce.dom.Event.cancel(event);
return true;
} else {
var tableNode = ed.dom.getParent(currentRow, 'table');
var middleNode = currentRow.parentNode;
var parentNodeName = middleNode.nodeName.toLowerCase();
if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) {
var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody');
if (targetParent !== null) {
return moveToRowInTarget(upBool, targetParent, sourceNode, event);
}
}
return escapeTable(upBool, currentRow, siblingDirection, tableNode, event);
}
}
function getTargetParent(upBool, topNode, secondNode, nodeName) {
var tbodies = ed.dom.select('>' + nodeName, topNode);
var position = tbodies.indexOf(secondNode);
if (upBool && position === 0 || !upBool && position === tbodies.length - 1) {
return getFirstHeadOrFoot(upBool, topNode);
} else if (position === -1) {
var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1;
return tbodies[topOrBottom];
} else {
return tbodies[position + (upBool ? -1 : 1)];
}
}
function getFirstHeadOrFoot(upBool, parent) {
var tagName = upBool ? 'thead' : 'tfoot';
var headOrFoot = ed.dom.select('>' + tagName, parent);
return headOrFoot.length !== 0 ? headOrFoot[0] : null;
}
function moveToRowInTarget(upBool, targetParent, sourceNode, event) {
var targetRow = getChildForDirection(targetParent, upBool);
targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool);
tinymce.dom.Event.cancel(event);
return true;
}
function escapeTable(upBool, currentRow, siblingDirection, table, event) {
var tableSibling = table[siblingDirection];
if (tableSibling) {
moveCursorToStartOfElement(tableSibling);
return true;
} else {
var parentCell = ed.dom.getParent(table, 'td,th');
if (parentCell) {
return handle(upBool, parentCell, event);
} else {
var backUpSibling = getChildForDirection(currentRow, !upBool);
moveCursorToStartOfElement(backUpSibling);
return tinymce.dom.Event.cancel(event);
}
}
}
function getChildForDirection(parent, up) {
return parent && parent[up ? 'lastChild' : 'firstChild'];
}
function moveCursorToStartOfElement(n) {
ed.selection.setCursorLocation(n, 0);
}
function isVerticalMovement() {
return key == VK.UP || key == VK.DOWN;
}
function isInTable(ed) {
var node = ed.selection.getNode();
var currentRow = ed.dom.getParent(node, 'tr');
return currentRow !== null;
}
function columnIndex(column) {
var colIndex = 0;
var c = column;
while (c.previousSibling) {
c = c.previousSibling;
colIndex = colIndex + getSpanVal(c, "colspan");
}
return colIndex;
}
function findColumn(rowElement, columnIndex) {
var c = 0;
var r = 0;
each(rowElement.children, function(cell, i) {
c = c + getSpanVal(cell, "colspan");
r = i;
if (c > columnIndex)
return false;
});
return r;
}
function moveCursorToRow(ed, node, row, upBool) {
var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th'));
var tgtColumnIndex = findColumn(row, srcColumnIndex);
var tgtNode = row.childNodes[tgtColumnIndex];
var rowCellTarget = getChildForDirection(tgtNode, upBool);
moveCursorToStartOfElement(rowCellTarget || tgtNode);
}
function shouldFixCaret(preBrowserNode) {
var newNode = ed.selection.getNode();
var newParent = ed.dom.getParent(newNode, 'td,th');
var oldParent = ed.dom.getParent(preBrowserNode, 'td,th');
return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent)
}
function checkSameParentTable(nodeOne, NodeTwo) {
return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE');
}
if (isVerticalMovement() && isInTable(ed)) {
var preBrowserNode = ed.selection.getNode();
setTimeout(function() {
if (shouldFixCaret(preBrowserNode)) {
handle(!e.shiftKey && key === VK.UP, preBrowserNode, e);
}
}, 0);
}
}
ed.onKeyDown.add(moveSelection);
}
// Fixes an issue on Gecko where it's impossible to place the caret behind a table // Fixes an issue on Gecko where it's impossible to place the caret behind a table
// This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
if (!tinymce.isIE) { if (!tinymce.isIE) {
@@ -1062,7 +1267,26 @@
ed.dom.remove(last); ed.dom.remove(last);
}); });
/**
* Fixes bug in Gecko where shift-enter in table cell does not place caret on new line
*/
if (tinymce.isGecko) {
ed.onKeyDown.add(function(ed, e) {
if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) {
var node = ed.selection.getRng().startContainer;
var tableCell = dom.getParent(node, 'td,th');
if (tableCell) {
var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF");
dom.insertAfter(zeroSizedNbsp, node);
}
}
});
}
fixTableCaretPos(); fixTableCaretPos();
ed.startContent = ed.getContent({format : 'raw'});
} }
}); });

View File

@@ -63,6 +63,11 @@ function init() {
function updateAction() { function updateAction() {
var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];
if (!AutoValidator.validate(formObj)) {
tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');
return false;
}
tinyMCEPopup.restoreSelection(); tinyMCEPopup.restoreSelection();
el = ed.selection.getStart(); el = ed.selection.getStart();
tdElm = ed.dom.getParent(el, "td,th"); tdElm = ed.dom.getParent(el, "td,th");
@@ -123,6 +128,36 @@ function updateAction() {
break; break;
case "col":
var curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName("tr");
if (cell.nodeName != "TD" && cell.nodeName != "TH")
cell = nextCell(cell);
do {
if (cell == tdElm)
break;
col += cell.getAttribute("colspan");
} while ((cell = nextCell(cell)) != null);
for (var i=0; i<rows.length; i++) {
cell = rows[i].firstChild;
if (cell.nodeName != "TD" && cell.nodeName != "TH")
cell = nextCell(cell);
curr = 0;
do {
if (curr == col) {
cell = updateCell(cell, true);
break;
}
curr += cell.getAttribute("colspan");
} while ((cell = nextCell(cell)) != null);
}
break;
case "all": case "all":
var rows = tableElm.getElementsByTagName("tr"); var rows = tableElm.getElementsByTagName("tr");

View File

@@ -56,6 +56,11 @@ function updateAction() {
var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0]; var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0];
var action = getSelectValue(formObj, 'action'); var action = getSelectValue(formObj, 'action');
if (!AutoValidator.validate(formObj)) {
tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');
return false;
}
tinyMCEPopup.restoreSelection(); tinyMCEPopup.restoreSelection();
trElm = dom.getParent(inst.selection.getStart(), "tr"); trElm = dom.getParent(inst.selection.getStart(), "tr");
tableElm = dom.getParent(inst.selection.getStart(), "table"); tableElm = dom.getParent(inst.selection.getStart(), "table");

View File

@@ -60,7 +60,19 @@ function insertTable() {
if (action == "update") { if (action == "update") {
dom.setAttrib(elm, 'cellPadding', cellpadding, true); dom.setAttrib(elm, 'cellPadding', cellpadding, true);
dom.setAttrib(elm, 'cellSpacing', cellspacing, true); dom.setAttrib(elm, 'cellSpacing', cellspacing, true);
if (!isCssSize(border)) {
dom.setAttrib(elm, 'border', border); dom.setAttrib(elm, 'border', border);
} else {
dom.setAttrib(elm, 'border', '');
}
if (border == '') {
dom.setStyle(elm, 'border-width', '');
dom.setStyle(elm, 'border', '');
dom.setAttrib(elm, 'border', '');
}
dom.setAttrib(elm, 'align', align); dom.setAttrib(elm, 'align', align);
dom.setAttrib(elm, 'frame', frame); dom.setAttrib(elm, 'frame', frame);
dom.setAttrib(elm, 'rules', rules); dom.setAttrib(elm, 'rules', rules);
@@ -119,7 +131,7 @@ function insertTable() {
if (bordercolor != "") { if (bordercolor != "") {
elm.style.borderColor = bordercolor; elm.style.borderColor = bordercolor;
elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;
elm.style.borderWidth = border == "" ? "1px" : border; elm.style.borderWidth = cssSize(border);
} else } else
elm.style.borderColor = ''; elm.style.borderColor = '';
@@ -132,7 +144,7 @@ function insertTable() {
//elm.outerHTML = elm.outerHTML; //elm.outerHTML = elm.outerHTML;
inst.nodeChanged(); inst.nodeChanged();
inst.execCommand('mceEndUndoLevel'); inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true});
// Repaint if dimensions changed // Repaint if dimensions changed
if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)
@@ -146,7 +158,10 @@ function insertTable() {
html += '<table'; html += '<table';
html += makeAttrib('id', id); html += makeAttrib('id', id);
if (!isCssSize(border)) {
html += makeAttrib('border', border); html += makeAttrib('border', border);
}
html += makeAttrib('cellpadding', cellpadding); html += makeAttrib('cellpadding', cellpadding);
html += makeAttrib('cellspacing', cellspacing); html += makeAttrib('cellspacing', cellspacing);
html += makeAttrib('data-mce-new', '1'); html += makeAttrib('data-mce-new', '1');
@@ -228,12 +243,15 @@ function insertTable() {
inst.execCommand('mceInsertContent', false, html); inst.execCommand('mceInsertContent', false, html);
tinymce.each(dom.select('table[data-mce-new]'), function(node) { tinymce.each(dom.select('table[data-mce-new]'), function(node) {
var td = dom.select('td', node); // 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) {
dom.insertAfter(dom.create('p'), node);
}
var tdorth = dom.select('td,th', node);
try { try {
// IE9 might fail to do this selection // IE9 might fail to do this selection
inst.selection.select(td[0], true); inst.selection.setCursorLocation(tdorth[0], 0);
inst.selection.collapse();
} catch (ex) { } catch (ex) {
// Ignore // Ignore
} }
@@ -242,7 +260,7 @@ function insertTable() {
}); });
inst.addVisual(); inst.addVisual();
inst.execCommand('mceEndUndoLevel'); inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true});
tinyMCEPopup.close(); tinyMCEPopup.close();
} }
@@ -384,6 +402,20 @@ function changedSize() {
formObj.style.value = dom.serializeStyle(st); formObj.style.value = dom.serializeStyle(st);
} }
function isCssSize(value) {
return /^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)$/.test(value);
}
function cssSize(value, def) {
value = tinymce.trim(value || def);
if (!isCssSize(value)) {
return parseInt(value, 10) + 'px';
}
return value;
}
function changedBackgroundImage() { function changedBackgroundImage() {
var formObj = document.forms[0]; var formObj = document.forms[0];
var st = dom.parseStyle(formObj.style.value); var st = dom.parseStyle(formObj.style.value);
@@ -398,8 +430,14 @@ function changedBorder() {
var st = dom.parseStyle(formObj.style.value); var st = dom.parseStyle(formObj.style.value);
// Update border width if the element has a color // Update border width if the element has a color
if (formObj.border.value != "" && formObj.bordercolor.value != "") if (formObj.border.value != "" && (isCssSize(formObj.border.value) || formObj.bordercolor.value != ""))
st['border-width'] = formObj.border.value + "px"; st['border-width'] = cssSize(formObj.border.value);
else {
if (!formObj.border.value) {
st['border'] = '';
st['border-width'] = '';
}
}
formObj.style.value = dom.serializeStyle(st); formObj.style.value = dom.serializeStyle(st);
} }
@@ -415,7 +453,7 @@ function changedColor() {
// Add border-width if it's missing // Add border-width if it's missing
if (!st['border-width']) if (!st['border-width'])
st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px"; st['border-width'] = cssSize(formObj.border.value, 1);
} }
formObj.style.value = dom.serializeStyle(st); formObj.style.value = dom.serializeStyle(st);

View File

@@ -1,74 +1 @@
tinyMCE.addI18n('en.table_dlg',{ tinyMCE.addI18n('en.table_dlg',{"rules_border":"border","rules_box":"box","rules_vsides":"vsides","rules_rhs":"rhs","rules_lhs":"lhs","rules_hsides":"hsides","rules_below":"below","rules_above":"above","rules_void":"void",rules:"Rules","frame_all":"all","frame_cols":"cols","frame_rows":"rows","frame_groups":"groups","frame_none":"none",frame:"Frame",caption:"Table Caption","missing_scope":"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.","cell_limit":"You\'ve exceeded the maximum number of cells of {$cells}.","row_limit":"You\'ve exceeded the maximum number of rows of {$rows}.","col_limit":"You\'ve exceeded the maximum number of columns of {$cols}.",colgroup:"Col Group",rowgroup:"Row Group",scope:"Scope",tfoot:"Footer",tbody:"Body",thead:"Header","row_all":"Update All Rows in Table","row_even":"Update Even Rows in Table","row_odd":"Update Odd Rows in Table","row_row":"Update Current Row","cell_all":"Update All Cells in Table","cell_row":"Update All Cells in Row","cell_cell":"Update Current Cell",th:"Header",td:"Data",summary:"Summary",bgimage:"Background Image",rtl:"Right to Left",ltr:"Left to Right",mime:"Target MIME Type",langcode:"Language Code",langdir:"Language Direction",style:"Style",id:"ID","merge_cells_title":"Merge Table Cells",bgcolor:"Background Color",bordercolor:"Border Color","align_bottom":"Bottom","align_top":"Top",valign:"Vertical Alignment","cell_type":"Cell Type","cell_title":"Table Cell Properties","row_title":"Table Row Properties","align_middle":"Center","align_right":"Right","align_left":"Left","align_default":"Default",align:"Alignment",border:"Border",cellpadding:"Cell Padding",cellspacing:"Cell Spacing",rows:"Rows",cols:"Columns",height:"Height",width:"Width",title:"Insert/Edit Table",rowtype:"Row Type","advanced_props":"Advanced Properties","general_props":"General Properties","advanced_tab":"Advanced","general_tab":"General","cell_col":"Update all cells in column"});
general_tab:"General",
advanced_tab:"Advanced",
general_props:"General properties",
advanced_props:"Advanced properties",
rowtype:"Row in table part",
title:"Insert/Modify table",
width:"Width",
height:"Height",
cols:"Columns",
rows:"Rows",
cellspacing:"Cellspacing",
cellpadding:"Cellpadding",
border:"Border",
align:"Alignment",
align_default:"Default",
align_left:"Left",
align_right:"Right",
align_middle:"Center",
row_title:"Table row properties",
cell_title:"Table cell properties",
cell_type:"Cell type",
valign:"Vertical alignment",
align_top:"Top",
align_bottom:"Bottom",
bordercolor:"Border color",
bgcolor:"Background color",
merge_cells_title:"Merge table cells",
id:"Id",
style:"Style",
langdir:"Language direction",
langcode:"Language code",
mime:"Target MIME type",
ltr:"Left to right",
rtl:"Right to left",
bgimage:"Background image",
summary:"Summary",
td:"Data",
th:"Header",
cell_cell:"Update current cell",
cell_row:"Update all cells in row",
cell_all:"Update all cells in table",
row_row:"Update current row",
row_odd:"Update odd rows in table",
row_even:"Update even rows in table",
row_all:"Update all rows in table",
thead:"Table Head",
tbody:"Table Body",
tfoot:"Table Foot",
scope:"Scope",
rowgroup:"Row Group",
colgroup:"Col Group",
col_limit:"You've exceeded the maximum number of columns of {$cols}.",
row_limit:"You've exceeded the maximum number of rows of {$rows}.",
cell_limit:"You've exceeded the maximum number of cells of {$cells}.",
missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",
caption:"Table caption",
frame:"Frame",
frame_none:"none",
frame_groups:"groups",
frame_rows:"rows",
frame_cols:"cols",
frame_all:"all",
rules:"Rules",
rules_void:"void",
rules_above:"above",
rules_below:"below",
rules_hsides:"hsides",
rules_lhs:"lhs",
rules_rhs:"rhs",
rules_vsides:"vsides",
rules_box:"box",
rules_border:"border"
});

View File

@@ -5,6 +5,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="../../utils/mctabs.js"></script> <script type="text/javascript" src="../../utils/mctabs.js"></script>
<script type="text/javascript" src="../../utils/form_utils.js"></script> <script type="text/javascript" src="../../utils/form_utils.js"></script>
<script type="text/javascript" src="../../utils/validate.js"></script>
<script type="text/javascript" src="../../utils/editable_selects.js"></script> <script type="text/javascript" src="../../utils/editable_selects.js"></script>
<script type="text/javascript" src="js/row.js"></script> <script type="text/javascript" src="js/row.js"></script>
<link href="css/row.css" rel="stylesheet" type="text/css" /> <link href="css/row.css" rel="stylesheet" type="text/css" />
@@ -70,7 +71,7 @@
<tr> <tr>
<td><label for="height">{#table_dlg.height}</label></td> <td><label for="height">{#table_dlg.height}</label></td>
<td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td> <td class="col2"><input name="height" type="text" id="height" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>
</tr> </tr>
</table> </table>
</fieldset> </fieldset>

View File

@@ -46,13 +46,13 @@
<option value="right">{#table_dlg.align_right}</option> <option value="right">{#table_dlg.align_right}</option>
</select></td> </select></td>
<td><label id="borderlabel" for="border">{#table_dlg.border}</label></td> <td><label id="borderlabel" for="border">{#table_dlg.border}</label></td>
<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td> <td><input id="border" name="border" type="text" value="" size="3" maxlength="5" onchange="changedBorder();" class="size" /></td>
</tr> </tr>
<tr id="width_row"> <tr id="width_row">
<td><label id="widthlabel" for="width">{#table_dlg.width}</label></td> <td><label id="widthlabel" for="width">{#table_dlg.width}</label></td>
<td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td> <td><input name="width" type="text" id="width" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>
<td><label id="heightlabel" for="height">{#table_dlg.height}</label></td> <td><label id="heightlabel" for="height">{#table_dlg.height}</label></td>
<td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td> <td><input name="height" type="text" id="height" value="" size="7" maxlength="7" onchange="changedSize();" class="size" /></td>
</tr> </tr>
<tr id="styleSelectRow" > <tr id="styleSelectRow" >
<td><label id="classlabel" for="class">{#class_name}</label></td> <td><label id="classlabel" for="class">{#class_name}</label></td>

View File

@@ -1,15 +1 @@
tinyMCE.addI18n('en.template_dlg',{ tinyMCE.addI18n('en.template_dlg',{title:"Templates",label:"Template","desc_label":"Description",desc:"Insert Predefined Template Content",select:"Select a Template",preview:"Preview",warning:"Warning: Updating a template with a different one may cause data loss.","mdate_format":"%Y-%m-%d %H:%M:%S","cdate_format":"%Y-%m-%d %H:%M:%S","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"});
title:"Templates",
label:"Template",
desc_label:"Description",
desc:"Insert predefined template content",
select:"Select a template",
preview:"Preview",
warning:"Warning: Updating a template with a different one may cause data loss.",
mdate_format:"%Y-%m-%d %H:%M:%S",
cdate_format:"%Y-%m-%d %H:%M:%S",
months_long:"January,February,March,April,May,June,July,August,September,October,November,December",
months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"
});

View File

@@ -1 +1 @@
(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(a,b){var c=this,d=0;c.countre=a.getParam("wordcount_countregex",/[\w\u2019\'-]+/g);c.cleanre=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);c.id=a.id+"-word-count";a.onPostRender.add(function(f,e){var g,h;h=f.getParam("wordcount_target_id");if(!h){g=tinymce.DOM.get(f.id+"_path_row");if(g){tinymce.DOM.add(g.parentNode,"div",{style:"float: right"},f.getLang("wordcount.words","Words: ")+'<span id="'+c.id+'">0</span>')}}else{tinymce.DOM.add(h,"span",{},'<span id="'+c.id+'">0</span>')}});a.onInit.add(function(e){e.selection.onSetContent.add(function(){c._count(e)});c._count(e)});a.onSetContent.add(function(e){c._count(e)});a.onKeyUp.add(function(f,g){if(g.keyCode==d){return}if(13==g.keyCode||8==d||46==d){c._count(f)}d=g.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},2000)},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})(); (function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(c,d){var e=this,f=0,g=tinymce.VK;e.countre=c.getParam("wordcount_countregex",/[\w\u2019\'-]+/g);e.cleanre=c.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);e.update_rate=c.getParam("wordcount_update_rate",2000);e.update_on_delete=c.getParam("wordcount_update_on_delete",false);e.id=c.id+"-word-count";c.onPostRender.add(function(i,h){var j,k;k=i.getParam("wordcount_target_id");if(!k){j=tinymce.DOM.get(i.id+"_path_row");if(j){tinymce.DOM.add(j.parentNode,"div",{style:"float: right"},i.getLang("wordcount.words","Words: ")+'<span id="'+e.id+'">0</span>')}}else{tinymce.DOM.add(k,"span",{},'<span id="'+e.id+'">0</span>')}});c.onInit.add(function(h){h.selection.onSetContent.add(function(){e._count(h)});e._count(h)});c.onSetContent.add(function(h){e._count(h)});function b(h){return h!==f&&(h===g.ENTER||f===g.SPACEBAR||a(f))}function a(h){return h===g.DELETE||h===g.BACKSPACE}c.onKeyUp.add(function(h,i){if(b(i.keyCode)||e.update_on_delete&&a(i.keyCode)){e._count(h)}f=i.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){if(!a.destroyed){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},b.update_rate)}},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})();

View File

@@ -16,10 +16,12 @@
cleanre : null, cleanre : null,
init : function(ed, url) { init : function(ed, url) {
var t = this, last = 0; var t = this, last = 0, VK = tinymce.VK;
t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == &rsquo; t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == &rsquo;
t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g); t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);
t.update_rate = ed.getParam('wordcount_update_rate', 2000);
t.update_on_delete = ed.getParam('wordcount_update_on_delete', false);
t.id = ed.id + '-word-count'; t.id = ed.id + '-word-count';
ed.onPostRender.add(function(ed, cm) { ed.onPostRender.add(function(ed, cm) {
@@ -49,12 +51,18 @@
t._count(ed); t._count(ed);
}); });
ed.onKeyUp.add(function(ed, e) { function checkKeys(key) {
if (e.keyCode == last) return key !== last && (key === VK.ENTER || last === VK.SPACEBAR || checkDelOrBksp(last));
return; }
if (13 == e.keyCode || 8 == last || 46 == last) function checkDelOrBksp(key) {
return key === VK.DELETE || key === VK.BACKSPACE;
}
ed.onKeyUp.add(function(ed, e) {
if (checkKeys(e.keyCode) || t.update_on_delete && checkDelOrBksp(e.keyCode)) {
t._count(ed); t._count(ed);
}
last = e.keyCode; last = e.keyCode;
}); });
@@ -91,11 +99,11 @@
t.block = 1; t.block = 1;
setTimeout(function() { setTimeout(function() {
if (!ed.destroyed) {
var tc = t._getCount(ed); var tc = t._getCount(ed);
tinymce.DOM.setHTML(t.id, tc.toString()); tinymce.DOM.setHTML(t.id, tc.toString());
setTimeout(function() {t.block = 0;}, t.update_rate);
setTimeout(function() {t.block = 0;}, 2000); }
}, 1); }, 1);
}, },

View File

@@ -1,32 +1 @@
tinyMCE.addI18n('en.xhtmlxtras_dlg',{ tinyMCE.addI18n('en.xhtmlxtras_dlg',{"attribs_title":"Insert/Edit Attributes","option_rtl":"Right to Left","option_ltr":"Left to Right","insert_date":"Insert Current Date/Time",remove:"Remove","title_cite_element":"Citation Element","title_abbr_element":"Abbreviation Element","title_acronym_element":"Acronym Element","title_del_element":"Deletion Element","title_ins_element":"Insertion Element","fieldset_events_tab":"Element Events","fieldset_attrib_tab":"Element Attributes","fieldset_general_tab":"General Settings","events_tab":"Events","attrib_tab":"Attributes","general_tab":"General","attribute_attrib_tab":"Attributes","attribute_events_tab":"Events","attribute_label_accesskey":"AccessKey","attribute_label_tabindex":"TabIndex","attribute_label_langcode":"Language","attribute_option_rtl":"Right to Left","attribute_option_ltr":"Left to Right","attribute_label_langdir":"Text Direction","attribute_label_datetime":"Date/Time","attribute_label_cite":"Cite","attribute_label_style":"Style","attribute_label_class":"Class","attribute_label_id":"ID","attribute_label_title":"Title"});
attribute_label_title:"Title",
attribute_label_id:"ID",
attribute_label_class:"Class",
attribute_label_style:"Style",
attribute_label_cite:"Cite",
attribute_label_datetime:"Date/Time",
attribute_label_langdir:"Text Direction",
attribute_option_ltr:"Left to right",
attribute_option_rtl:"Right to left",
attribute_label_langcode:"Language",
attribute_label_tabindex:"TabIndex",
attribute_label_accesskey:"AccessKey",
attribute_events_tab:"Events",
attribute_attrib_tab:"Attributes",
general_tab:"General",
attrib_tab:"Attributes",
events_tab:"Events",
fieldset_general_tab:"General Settings",
fieldset_attrib_tab:"Element Attributes",
fieldset_events_tab:"Element Events",
title_ins_element:"Insertion Element",
title_del_element:"Deletion Element",
title_acronym_element:"Acronym Element",
title_abbr_element:"Abbreviation Element",
title_cite_element:"Citation Element",
remove:"Remove",
insert_date:"Insert current date/time",
option_ltr:"Left to right",
option_rtl:"Right to left",
attribs_title:"Insert/Edit Attributes"
});

View File

@@ -5,7 +5,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/charmap.js"></script> <script type="text/javascript" src="js/charmap.js"></script>
</head> </head>
<body id="charmap" style="display:none"> <body id="charmap" style="display:none" role="application">
<table align="center" border="0" cellspacing="0" cellpadding="2" role="presentation"> <table align="center" border="0" cellspacing="0" cellpadding="2" role="presentation">
<tr> <tr>
<td colspan="2" class="title" ><label for="charmapView" id="charmap_label">{#advanced_dlg.charmap_title}</label></td> <td colspan="2" class="title" ><label for="charmapView" id="charmap_label">{#advanced_dlg.charmap_title}</label></td>
@@ -46,6 +46,10 @@
</table> </table>
</td> </td>
</tr> </tr>
<tr>
<td colspan="2" id="charmap_usage">{#advanced_dlg.charmap_usage}</td>
</tr>
</table> </table>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

View File

@@ -386,7 +386,7 @@
return v == sv; return v == sv;
}); });
if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] == v['class'])) { if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] && cur.value['class'] == v['class'])) {
c.select(null); c.select(null);
} }
@@ -593,6 +593,11 @@
if (evt.altKey) { if (evt.altKey) {
if (evt.keyCode === DOM_VK_F10) { if (evt.keyCode === DOM_VK_F10) {
// Make sure focus is given to toolbar in Safari.
// We can't do this in IE as it prevents giving focus to toolbar when editor is in a frame
if (tinymce.isWebKit) {
window.focus();
}
t.toolbarGroup.focus(); t.toolbarGroup.focus();
return Event.cancel(evt); return Event.cancel(evt);
} else if (evt.keyCode === DOM_VK_F11) { } else if (evt.keyCode === DOM_VK_F11) {
@@ -869,7 +874,7 @@
if (s.theme_advanced_resizing) { if (s.theme_advanced_resizing) {
DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'}); DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"});
if (s.theme_advanced_resizing_use_cookie) { if (s.theme_advanced_resizing_use_cookie) {
ed.onPostRender.add(function() { ed.onPostRender.add(function() {
@@ -936,10 +941,10 @@
}, },
_updateUndoStatus : function(ed) { _updateUndoStatus : function(ed) {
var cm = ed.controlManager; var cm = ed.controlManager, um = ed.undoManager;
cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing); cm.setDisabled('undo', !um.hasUndo() && !um.typing);
cm.setDisabled('redo', !ed.undoManager.hasRedo()); cm.setDisabled('redo', !um.hasRedo());
}, },
_nodeChanged : function(ed, cm, n, co, ob) { _nodeChanged : function(ed, cm, n, co, ob) {
@@ -1095,11 +1100,8 @@
getParent(function(n) { getParent(function(n) {
var na = n.nodeName.toLowerCase(), u, pi, ti = ''; var na = n.nodeName.toLowerCase(), u, pi, ti = '';
if (n.getAttribute('data-mce-bogus')) // Ignore non element and bogus/hidden elements
return; if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))
// Ignore non element and hidden elements
if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')))
return; return;
// Handle prefix // Handle prefix
@@ -1223,7 +1225,7 @@
ed.windowManager.open({ ed.windowManager.open({
url : this.url + '/charmap.htm', url : this.url + '/charmap.htm',
width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),
height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), height : 265 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),
inline : true inline : true
}, { }, {
theme_url : this.url theme_url : this.url

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -30,9 +30,10 @@ var AnchorDialog = {
ed.selection.collapse(1); ed.selection.collapse(1);
elm = ed.dom.getParent(ed.selection.getNode(), 'A'); elm = ed.dom.getParent(ed.selection.getNode(), 'A');
if (elm) if (elm) {
elm.setAttribute('name', name);
elm.name = name; elm.name = name;
else } else
ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '')); ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, ''));
tinyMCEPopup.close(); tinyMCEPopup.close();

View File

@@ -281,13 +281,21 @@ tinyMCEPopup.onInit.add(function() {
function addKeyboardNavigation(){ function addKeyboardNavigation(){
var tableElm, cells, settings; var tableElm, cells, settings;
cells = tinyMCEPopup.dom.select(".charmaplink", "charmapgroup"); cells = tinyMCEPopup.dom.select("a.charmaplink", "charmapgroup");
settings ={ settings ={
root: "charmapgroup", root: "charmapgroup",
items: cells items: cells
}; };
cells[0].tabindex=0;
tinyMCEPopup.dom.addClass(cells[0], "mceFocus");
if (tinymce.isGecko) {
cells[0].focus();
} else {
setTimeout(function(){
cells[0].focus();
}, 100);
}
tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom);
} }
@@ -306,7 +314,7 @@ function renderCharMapHTML() {
previewCharFn = 'previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');'; previewCharFn = 'previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');';
html += '' html += ''
+ '<td class="charmap">' + '<td class="charmap">'
+ '<a class="charmaplink" role="button" onmouseover="'+previewCharFn+'" onfocus="'+previewCharFn+'" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">' + '<a class="charmaplink" role="button" onmouseover="'+previewCharFn+'" onfocus="'+previewCharFn+'" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + ' '+ tinyMCEPopup.editor.translate("advanced_dlg.charmap_usage")+'">'
+ charmap[i][1] + charmap[i][1]
+ '</a></td>'; + '</a></td>';
if ((cols+1) % charsPerRow == 0) if ((cols+1) % charsPerRow == 0)

View File

@@ -1,6 +1,6 @@
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",
@@ -266,10 +266,10 @@ function dechex(n) {
} }
function computeColor(e) { function computeColor(e) {
var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB; 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 - e.target.x : 0); x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.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;

View File

@@ -18,7 +18,7 @@ var ImageDialog = {
e = ed.selection.getNode(); e = ed.selection.getNode();
this.fillFileList('image_list', 'tinyMCEImageList'); this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'));
if (e.nodeName == 'IMG') { if (e.nodeName == 'IMG') {
f.src.value = ed.dom.getAttrib(e, 'src'); f.src.value = ed.dom.getAttrib(e, 'src');
@@ -39,7 +39,7 @@ var ImageDialog = {
fillFileList : function(id, l) { fillFileList : function(id, l) {
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
l = window[l]; l = typeof(l) === 'function' ? l() : window[l];
if (l && l.length > 0) { if (l && l.length > 0) {
lst.options[lst.options.length] = new Option('', ''); lst.options[lst.options.length] = new Option('', '');
@@ -90,9 +90,13 @@ var ImageDialog = {
tinyMCEPopup.editor.execCommand('mceRepaint'); tinyMCEPopup.editor.execCommand('mceRepaint');
tinyMCEPopup.editor.focus(); tinyMCEPopup.editor.focus();
} else { } else {
ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1}); tinymce.each(args, function(value, name) {
ed.dom.setAttribs('__mce_tmp', args); if (value === "") {
ed.dom.setAttrib('__mce_tmp', 'id', ''); delete args[name];
}
});
ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1});
ed.undoManager.add(); ed.undoManager.add();
} }

View File

@@ -1,68 +1 @@
tinyMCE.addI18n('en.advanced',{ tinyMCE.addI18n('en.advanced',{"underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)",dd:"Definition Description",dt:"Definition Term ",samp:"Code Sample",code:"Code",blockquote:"Block Quote",h6:"Heading 6",h5:"Heading 5",h4:"Heading 4",h3:"Heading 3",h2:"Heading 2",h1:"Heading 1",pre:"Preformatted",address:"Address",div:"DIV",paragraph:"Paragraph",block:"Format",fontdefault:"Font Family","font_size":"Font Size","style_select":"Styles","anchor_delta_height":"","anchor_delta_width":"","charmap_delta_height":"","charmap_delta_width":"","colorpicker_delta_height":"","colorpicker_delta_width":"","link_delta_height":"","link_delta_width":"","image_delta_height":"","image_delta_width":"","more_colors":"More Colors...","toolbar_focus":"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",newdocument:"Are you sure you want clear all contents?",path:"Path","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","blockquote_desc":"Block Quote","help_desc":"Help","newdocument_desc":"New Document","image_props_desc":"Image Properties","paste_desc":"Paste (Ctrl+V)","copy_desc":"Copy (Ctrl+C)","cut_desc":"Cut (Ctrl+X)","anchor_desc":"Insert/Edit Anchor","visualaid_desc":"show/Hide Guidelines/Invisible Elements","charmap_desc":"Insert Special Character","backcolor_desc":"Select Background Color","forecolor_desc":"Select Text Color","custom1_desc":"Your Custom Description Here","removeformat_desc":"Remove Formatting","hr_desc":"Insert Horizontal Line","sup_desc":"Superscript","sub_desc":"Subscript","code_desc":"Edit HTML Source","cleanup_desc":"Cleanup Messy Code","image_desc":"Insert/Edit Image","unlink_desc":"Unlink","link_desc":"Insert/Edit Link","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","indent_desc":"Increase Indent","outdent_desc":"Decrease Indent","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","justifyfull_desc":"Align Full","justifyright_desc":"Align Right","justifycenter_desc":"Align Center","justifyleft_desc":"Align Left","striketrough_desc":"Strikethrough","help_shortcut":"Press ALT-F10 for toolbar. Press ALT-0 for help","rich_text_area":"Rich Text Area","shortcuts_desc":"Accessability Help",toolbar:"Toolbar"});
style_select:"Styles",
font_size:"Font size",
fontdefault:"Font family",
block:"Format",
paragraph:"Paragraph",
div:"Div",
address:"Address",
pre:"Preformatted",
h1:"Heading 1",
h2:"Heading 2",
h3:"Heading 3",
h4:"Heading 4",
h5:"Heading 5",
h6:"Heading 6",
blockquote:"Blockquote",
code:"Code",
samp:"Code sample",
dt:"Definition term ",
dd:"Definition description",
bold_desc:"Bold (Ctrl+B)",
italic_desc:"Italic (Ctrl+I)",
underline_desc:"Underline (Ctrl+U)",
striketrough_desc:"Strikethrough",
justifyleft_desc:"Align left",
justifycenter_desc:"Align center",
justifyright_desc:"Align right",
justifyfull_desc:"Align full",
bullist_desc:"Unordered list",
numlist_desc:"Ordered list",
outdent_desc:"Outdent",
indent_desc:"Indent",
undo_desc:"Undo (Ctrl+Z)",
redo_desc:"Redo (Ctrl+Y)",
link_desc:"Insert/edit link",
unlink_desc:"Unlink",
image_desc:"Insert/edit image",
cleanup_desc:"Cleanup messy code",
code_desc:"Edit HTML Source",
sub_desc:"Subscript",
sup_desc:"Superscript",
hr_desc:"Insert horizontal ruler",
removeformat_desc:"Remove formatting",
custom1_desc:"Your custom description here",
forecolor_desc:"Select text color",
backcolor_desc:"Select background color",
charmap_desc:"Insert custom character",
visualaid_desc:"Toggle guidelines/invisible elements",
anchor_desc:"Insert/edit anchor",
cut_desc:"Cut",
copy_desc:"Copy",
paste_desc:"Paste",
image_props_desc:"Image properties",
newdocument_desc:"New document",
help_desc:"Help",
blockquote_desc:"Blockquote",
clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?",
path:"Path",
newdocument:"Are you sure you want clear all contents?",
toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",
more_colors:"More colors",
// Accessibility Strings
shortcuts_desc:'Accessibility Help',
help_shortcut:'. Press ALT F10 for toolbar. Press ALT 0 for help.',
rich_text_area:"Rich Text Area",
toolbar:"Toolbar"
});

View File

@@ -1,54 +1 @@
tinyMCE.addI18n('en.advanced_dlg',{ 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","":""});
about_title:"About TinyMCE",
about_general:"About",
about_help:"Help",
about_license:"License",
about_plugins:"Plugins",
about_plugin:"Plugin",
about_author:"Author",
about_version:"Version",
about_loaded:"Loaded plugins",
anchor_title:"Insert/edit anchor",
anchor_name:"Anchor name",
anchor_invalid:"Please specify a valid anchor name.",
code_title:"HTML Source Editor",
code_wordwrap:"Word wrap",
colorpicker_title:"Select a color",
colorpicker_picker_tab:"Picker",
colorpicker_picker_title:"Color picker",
colorpicker_palette_tab:"Palette",
colorpicker_palette_title:"Palette colors",
colorpicker_named_tab:"Named",
colorpicker_named_title:"Named colors",
colorpicker_color:"Color:",
colorpicker_name:"Name:",
charmap_title:"Select custom character",
image_title:"Insert/edit image",
image_src:"Image URL",
image_alt:"Image description",
image_list:"Image list",
image_border:"Border",
image_dimensions:"Dimensions",
image_vspace:"Vertical space",
image_hspace:"Horizontal space",
image_align:"Alignment",
image_align_baseline:"Baseline",
image_align_top:"Top",
image_align_middle:"Middle",
image_align_bottom:"Bottom",
image_align_texttop:"Text top",
image_align_textbottom:"Text bottom",
image_align_left:"Left",
image_align_right:"Right",
link_title:"Insert/edit link",
link_url:"Link URL",
link_target:"Target",
link_target_same:"Open link in the same window",
link_target_blank:"Open link in a new window",
link_titlefield:"Title",
link_is_email:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",
link_is_external:"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",
link_list:"Link list",
accessibility_help:"Accessibility Help",
accessibility_usage_title:"General Usage"
});

View File

@@ -9,11 +9,11 @@ h4 {font-size: 1em}
h5 {font-size: .83em} h5 {font-size: .83em}
h6 {font-size: .75em} h6 {font-size: .75em}
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat 0 0;} a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center}
span.mceItemNbsp {background: #DDD} span.mceItemNbsp {background: #DDD}
td.mceSelected, th.mceSelected {background-color:#3399ff !important} td.mceSelected, th.mceSelected {background-color:#3399ff !important}
img {border:0;} img {border:0;}
table {cursor:default} table, img, hr, .mceItemAnchor {cursor:default}
table td, table th {cursor:text} table td, table th {cursor:text}
ins {border-bottom:1px solid green; text-decoration: none; color:green} ins {border-bottom:1px solid green; text-decoration: none; color:green}
del {color:red; text-decoration:line-through} del {color:red; text-decoration:line-through}
@@ -35,6 +35,7 @@ scrollbar-track-color:#F5F5F5;
img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
font[face=mceinline] {font-family:inherit !important} font[face=mceinline] {font-family:inherit !important}
*[contentEditable]:focus {outline:0}
.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} .mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc}
.mceItemShockWave {background-image:url(../../img/shockwave.gif)} .mceItemShockWave {background-image:url(../../img/shockwave.gif)}
@@ -43,5 +44,7 @@ font[face=mceinline] {font-family:inherit !important}
.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} .mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)}
.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} .mceItemRealMedia {background-image:url(../../img/realmedia.gif)}
.mceItemVideo {background-image:url(../../img/video.gif)} .mceItemVideo {background-image:url(../../img/video.gif)}
.mceItemAudio {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;}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 64 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -103,6 +103,7 @@
.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} .defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}
.defaultSkin .mceMenu span.mceMenuLine {display:none} .defaultSkin .mceMenu span.mceMenuLine {display:none}
.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} .defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}
.defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal}
/* Progress,Resize */ /* Progress,Resize */
.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} .defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF}

View File

@@ -12,7 +12,7 @@ a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !impo
span.mceItemNbsp {background: #DDD} span.mceItemNbsp {background: #DDD}
td.mceSelected, th.mceSelected {background-color:#3399ff !important} td.mceSelected, th.mceSelected {background-color:#3399ff !important}
img {border:0;} img {border:0;}
table {cursor:default} table, img, hr, .mceItemAnchor {cursor:default}
table td, table th {cursor:text} table td, table th {cursor:text}
ins {border-bottom:1px solid green; text-decoration: none; color:green} ins {border-bottom:1px solid green; text-decoration: none; color:green}
del {color:red; text-decoration:line-through} del {color:red; text-decoration:line-through}
@@ -34,6 +34,7 @@ scrollbar-track-color:#F5F5F5;
img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
font[face=mceinline] {font-family:inherit !important} font[face=mceinline] {font-family:inherit !important}
*[contentEditable]:focus {outline:0}
.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} .mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc}
.mceItemShockWave {background-image:url(../../img/shockwave.gif)} .mceItemShockWave {background-image:url(../../img/shockwave.gif)}
@@ -42,5 +43,6 @@ font[face=mceinline] {font-family:inherit !important}
.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} .mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)}
.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} .mceItemRealMedia {background-image:url(../../img/realmedia.gif)}
.mceItemVideo {background-image:url(../../img/video.gif)} .mceItemVideo {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;}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -51,14 +51,14 @@
.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} .o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}
/* ListBox */ /* ListBox */
.o2k7Skin .mceListBox {margin-left:3px} .o2k7Skin .mceListBox {padding-left: 3px}
.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} .o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block}
.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} .o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} .o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0}
.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} .o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF}
.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} .o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px}
.o2k7Skin .mceListBoxDisabled .mceText {color:gray} .o2k7Skin .mceListBoxDisabled .mceText {color:gray}
.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden} .o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden; margin-left:3px}
.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} .o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px}
.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} .o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;}
@@ -106,6 +106,7 @@
.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} .o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center}
.o2k7Skin .mceMenu span.mceMenuLine {display:none} .o2k7Skin .mceMenu span.mceMenuLine {display:none}
.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} .o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;}
.o2k7Skin .mceMenuItem td, .o2k7Skin .mceMenuItem th {line-height: normal}
/* Progress,Resize */ /* Progress,Resize */
.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} .o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 806 B

View File

@@ -1,11 +1 @@
tinyMCE.addI18n('en.simple',{ tinyMCE.addI18n('en.simple',{"cleanup_desc":"Cleanup Messy Code","redo_desc":"Redo (Ctrl+Y)","undo_desc":"Undo (Ctrl+Z)","numlist_desc":"Insert/Remove Numbered List","bullist_desc":"Insert/Remove Bulleted List","striketrough_desc":"Strikethrough","underline_desc":"Underline (Ctrl+U)","italic_desc":"Italic (Ctrl+I)","bold_desc":"Bold (Ctrl+B)"});
bold_desc:"Bold (Ctrl+B)",
italic_desc:"Italic (Ctrl+I)",
underline_desc:"Underline (Ctrl+U)",
striketrough_desc:"Strikethrough",
bullist_desc:"Unordered list",
numlist_desc:"Ordered list",
undo_desc:"Undo (Ctrl+Z)",
redo_desc:"Redo (Ctrl+Y)",
cleanup_desc:"Cleanup messy code"
});

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,7 @@ var TinyMCE_EditableSelects = {
for (i=0; i<nl.length; i++) { for (i=0; i<nl.length; i++) {
if (nl[i].className.indexOf('mceEditableSelect') != -1) { if (nl[i].className.indexOf('mceEditableSelect') != -1) {
o = new Option('(value)', '__mce_add_custom__'); o = new Option(tinyMCEPopup.editor.translate('value'), '__mce_add_custom__');
o.className = 'mceAddSelectValue'; o.className = 'mceAddSelectValue';

View File

@@ -259,8 +259,12 @@ class wysiwyg
'theme_advanced_buttons2' => $config['tinymce_buttons2'], 'theme_advanced_buttons2' => $config['tinymce_buttons2'],
'theme_advanced_buttons3' => $config['tinymce_buttons3'], 'theme_advanced_buttons3' => $config['tinymce_buttons3'],
'theme_advanced_buttons4' => $config['tinymce_buttons4'], 'theme_advanced_buttons4' => $config['tinymce_buttons4'],
'theme_advanced_toolbar_location' => 'bottom', 'theme_advanced_toolbar_location' => 'top',
'theme_advanced_toolbar_align' => 'center', 'theme_advanced_toolbar_align' => 'left',
'theme_advanced_blockformats' => 'p,h2,blockquote,code',
// 'theme_advanced_statusbar_location' => 'bottom', // 'theme_advanced_statusbar_location' => 'bottom',
'theme_advanced_resizing' => 'true', 'theme_advanced_resizing' => 'true',
'extended_valid_elements' => '', 'extended_valid_elements' => '',