TinyMCE 3.5.8 update; some fixes
This commit is contained in:
parent
c9cce9873d
commit
d39a2e8a9d
48 changed files with 2213 additions and 2054 deletions
File diff suppressed because one or more lines are too long
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
// Generates a preview for a format
|
||||
function getPreviewCss(ed, fmt) {
|
||||
var previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName;
|
||||
var name, previewElm, dom = ed.dom, previewCss = '', parentFontSize, previewStylesName;
|
||||
|
||||
previewStyles = ed.settings.preview_styles;
|
||||
|
||||
|
|
@ -150,23 +150,31 @@
|
|||
|
||||
init : function(ed, url) {
|
||||
var t = this, s, v, o;
|
||||
|
||||
|
||||
t.editor = ed;
|
||||
t.url = url;
|
||||
t.onResolveName = new tinymce.util.Dispatcher(this);
|
||||
s = ed.settings;
|
||||
|
||||
ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast();
|
||||
ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin;
|
||||
|
||||
// Setup default buttons
|
||||
if (!s.theme_advanced_buttons1) {
|
||||
s = extend({
|
||||
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",
|
||||
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",
|
||||
theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap"
|
||||
}, s);
|
||||
}
|
||||
|
||||
// Default settings
|
||||
t.settings = s = extend({
|
||||
theme_advanced_path : true,
|
||||
theme_advanced_toolbar_location : 'bottom',
|
||||
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",
|
||||
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",
|
||||
theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap",
|
||||
theme_advanced_toolbar_location : 'top',
|
||||
theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
|
||||
theme_advanced_toolbar_align : "center",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
|
||||
theme_advanced_more_colors : 1,
|
||||
theme_advanced_row_height : 23,
|
||||
|
|
@ -176,7 +184,7 @@
|
|||
theme_advanced_font_selector : "span",
|
||||
theme_advanced_show_current_color: 0,
|
||||
readonly : ed.settings.readonly
|
||||
}, ed.settings);
|
||||
}, s);
|
||||
|
||||
// Setup default font_size_style_values
|
||||
if (!s.font_size_style_values)
|
||||
|
|
@ -670,7 +678,7 @@
|
|||
if (DOM.get(ed.id + '_path_row')) {
|
||||
Event.add(ed.id + '_tbl', 'mouseover', function(e) {
|
||||
var re;
|
||||
|
||||
|
||||
e = e.target;
|
||||
|
||||
if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {
|
||||
|
|
@ -823,6 +831,7 @@
|
|||
var f = Event.add(ed.id + '_external_close', 'click', function() {
|
||||
DOM.hide(ed.id + '_external');
|
||||
Event.remove(ed.id + '_external_close', 'click', f);
|
||||
return false;
|
||||
});
|
||||
|
||||
DOM.show(e);
|
||||
|
|
@ -947,7 +956,7 @@
|
|||
a = s.theme_advanced_toolbar_align.toLowerCase();
|
||||
a = 'mce' + t._ufirst(a);
|
||||
|
||||
n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"});
|
||||
n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"toolbar"});
|
||||
|
||||
// Create toolbar and add the controls
|
||||
for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
|
||||
|
|
@ -977,7 +986,7 @@
|
|||
var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;
|
||||
|
||||
n = DOM.add(tb, 'tr');
|
||||
n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
|
||||
n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
|
||||
n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'});
|
||||
if (s.theme_advanced_path) {
|
||||
DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path'));
|
||||
|
|
@ -985,7 +994,7 @@
|
|||
} else {
|
||||
DOM.add(n, 'span', {}, ' ');
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (s.theme_advanced_resizing) {
|
||||
DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize', tabIndex:"-1"});
|
||||
|
|
@ -1030,6 +1039,8 @@
|
|||
width = startWidth + (e.screenX - startX);
|
||||
height = startHeight + (e.screenY - startY);
|
||||
t.resizeTo(width, height, true);
|
||||
|
||||
ed.nodeChanged();
|
||||
};
|
||||
|
||||
e.preventDefault();
|
||||
|
|
@ -1089,19 +1100,17 @@
|
|||
|
||||
p = getParent('A');
|
||||
if (c = cm.get('link')) {
|
||||
if (!p || !p.name) {
|
||||
c.setDisabled(!p && co);
|
||||
c.setActive(!!p);
|
||||
}
|
||||
c.setDisabled((!p && co) || (p && !p.href));
|
||||
c.setActive(!!p && (!p.name && !p.id));
|
||||
}
|
||||
|
||||
if (c = cm.get('unlink')) {
|
||||
c.setDisabled(!p && co);
|
||||
c.setActive(!!p && !p.name);
|
||||
c.setActive(!!p && !p.name && !p.id);
|
||||
}
|
||||
|
||||
if (c = cm.get('anchor')) {
|
||||
c.setActive(!co && !!p && p.name);
|
||||
c.setActive(!co && !!p && (p.name || (p.id && !p.href)));
|
||||
}
|
||||
|
||||
p = getParent('IMG');
|
||||
|
|
@ -1145,7 +1154,7 @@
|
|||
|
||||
if (!fn && n.style.fontFamily)
|
||||
fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();
|
||||
|
||||
|
||||
if (!fc && n.style.color)
|
||||
fc = n.style.color;
|
||||
|
||||
|
|
@ -1176,7 +1185,7 @@
|
|||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (s.theme_advanced_show_current_color) {
|
||||
function updateColor(controlId, color) {
|
||||
if (c = cm.get(controlId)) {
|
||||
|
|
@ -1280,7 +1289,7 @@
|
|||
ti += 'id: ' + v + ' ';
|
||||
|
||||
if (v = n.className) {
|
||||
v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '')
|
||||
v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '');
|
||||
|
||||
if (v) {
|
||||
ti += 'class: ' + v + ' ';
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
|
@ -6,7 +6,7 @@ var AnchorDialog = {
|
|||
|
||||
this.editor = ed;
|
||||
elm = ed.dom.getParent(ed.selection.getNode(), 'A');
|
||||
v = ed.dom.getAttrib(elm, 'name');
|
||||
v = ed.dom.getAttrib(elm, 'name') || ed.dom.getAttrib(elm, 'id');
|
||||
|
||||
if (v) {
|
||||
this.action = 'update';
|
||||
|
|
@ -17,7 +17,7 @@ var AnchorDialog = {
|
|||
},
|
||||
|
||||
update : function() {
|
||||
var ed = this.editor, elm, name = document.forms[0].anchorName.value;
|
||||
var ed = this.editor, elm, name = document.forms[0].anchorName.value, attribName;
|
||||
|
||||
if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) {
|
||||
tinyMCEPopup.alert('advanced_dlg.anchor_invalid');
|
||||
|
|
@ -29,13 +29,25 @@ var AnchorDialog = {
|
|||
if (this.action != 'update')
|
||||
ed.selection.collapse(1);
|
||||
|
||||
var aRule = ed.schema.getElementRule('a');
|
||||
if (!aRule || aRule.attributes.name) {
|
||||
attribName = 'name';
|
||||
} else {
|
||||
attribName = 'id';
|
||||
}
|
||||
|
||||
elm = ed.dom.getParent(ed.selection.getNode(), 'A');
|
||||
if (elm) {
|
||||
elm.setAttribute('name', name);
|
||||
elm.name = name;
|
||||
} else
|
||||
elm.setAttribute(attribName, name);
|
||||
elm[attribName] = name;
|
||||
ed.undoManager.add();
|
||||
} else {
|
||||
// create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it
|
||||
ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '\uFEFF'));
|
||||
var attrs = {'class' : 'mceItemAnchor'};
|
||||
attrs[attribName] = name;
|
||||
ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', attrs, '\uFEFF'));
|
||||
ed.nodeChanged();
|
||||
}
|
||||
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,10 +68,16 @@ var LinkDialog = {
|
|||
} else {
|
||||
ed.dom.setAttribs(e, {
|
||||
href : href,
|
||||
title : f.linktitle.value,
|
||||
target : f.target_list ? getSelectValue(f, "target_list") : null,
|
||||
'class' : f.class_list ? getSelectValue(f, "class_list") : null
|
||||
title : f.linktitle.value
|
||||
});
|
||||
|
||||
if (f.target_list) {
|
||||
ed.dom.setAttrib(e, 'target', getSelectValue(f, "target_list"));
|
||||
}
|
||||
|
||||
if (f.class_list) {
|
||||
ed.dom.setAttrib(e, 'class', getSelectValue(f, "class_list"));
|
||||
}
|
||||
}
|
||||
|
||||
// Don't move caret if selection was image
|
||||
|
|
|
|||
|
|
@ -48,4 +48,3 @@ font[face=mceinline] {font-family:inherit !important}
|
|||
.mceItemEmbeddedAudio {background-image:url(../../img/video.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;}
|
||||
.mceHideBrInPre pre br {display: none}
|
||||
|
|
|
|||
|
|
@ -105,11 +105,12 @@ h3 {font-size:14px;}
|
|||
#plugintable, #about #plugintable td {border:1px solid #919B9C;}
|
||||
#plugintable {width:96%; margin-top:10px;}
|
||||
#pluginscontainer {height:290px; overflow:auto;}
|
||||
#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
|
||||
#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px}
|
||||
#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline}
|
||||
#colorpicker #preview_wrapper { text-align:center; padding-top:4px; white-space: nowrap}
|
||||
#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
|
||||
#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
|
||||
#colorpicker #light div {overflow:hidden;}
|
||||
#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
|
||||
#colorpicker .panel_wrapper div.current {height:175px;}
|
||||
#colorpicker #namedcolors {width:150px;}
|
||||
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@
|
|||
.defaultSkin table td {vertical-align:middle}
|
||||
|
||||
/* Containers */
|
||||
.defaultSkin table {direction:ltr; background:#FFF}
|
||||
.defaultSkin iframe {display:block; background:#FFF}
|
||||
.defaultSkin table {direction:ltr;background:transparent}
|
||||
.defaultSkin iframe {display:block;}
|
||||
.defaultSkin .mceToolbar {height:26px}
|
||||
.defaultSkin .mceLeft {text-align:left}
|
||||
.defaultSkin .mceRight {text-align:right}
|
||||
|
||||
/* External */
|
||||
.defaultSkin .mceExternalToolbar {position:absolute; border:2px solid #CCC; border-bottom:0; display:none;}
|
||||
.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;}
|
||||
.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
|
||||
.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}
|
||||
|
||||
|
|
@ -20,9 +20,9 @@
|
|||
.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC}
|
||||
.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC}
|
||||
.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;}
|
||||
.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top}
|
||||
.defaultSkin .mceIframeContainer { /*border-top:1px solid #CCC; border-bottom:1px solid #CCC */ border: none;}
|
||||
.defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}
|
||||
.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top}
|
||||
.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC}
|
||||
.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}
|
||||
.defaultSkin .mceStatusbar div {float:left; margin:2px}
|
||||
.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
|
||||
.defaultSkin .mceStatusbar a:hover {text-decoration:underline}
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
.defaultSkin td.mceRight table {margin:0 0 0 auto;}
|
||||
|
||||
/* Button */
|
||||
.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:10px}
|
||||
.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px}
|
||||
.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}
|
||||
.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0}
|
||||
.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px}
|
||||
|
||||
/* Menu */
|
||||
.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8}
|
||||
.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8; direction:ltr}
|
||||
.defaultSkin .mceNoIcons span.mceIcon {width:0;}
|
||||
.defaultSkin .mceNoIcons a .mceText {padding-left:10px}
|
||||
.defaultSkin .mceMenu table {background:#FFF}
|
||||
|
|
@ -103,11 +103,16 @@
|
|||
.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}
|
||||
.defaultSkin .mceMenu span.mceMenuLine {display:none}
|
||||
.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}
|
||||
.defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal}
|
||||
|
||||
/* 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 .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
|
||||
|
||||
/* Rtl */
|
||||
.mceRtl .mceListBox .mceText {text-align: right; padding: 0 4px 0 0}
|
||||
.mceRtl .mceMenuItem .mceText {text-align: right}
|
||||
|
||||
/* Formats */
|
||||
.defaultSkin .mce_formatPreview a {font-size:10px}
|
||||
.defaultSkin .mce_p span.mceText {}
|
||||
|
|
@ -211,3 +216,4 @@
|
|||
.defaultSkin span.mce_pagebreak {background-position:0 -40px}
|
||||
.defaultSkin span.mce_restoredraft {background-position:-20px -40px}
|
||||
.defaultSkin span.mce_spellchecker {background-position:-540px -20px}
|
||||
.defaultSkin span.mce_visualblocks {background-position: -40px -40px}
|
||||
|
|
|
|||
|
|
@ -22,4 +22,3 @@ abbr {border-bottom:1px dashed #CCC; cursor:help}
|
|||
img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
|
||||
font[face=mceinline] {font-family:inherit !important}
|
||||
*[contentEditable]:focus {outline:0}
|
||||
.mceHideBrInPre pre br {display: none}
|
||||
|
|
|
|||
|
|
@ -46,4 +46,3 @@ font[face=mceinline] {font-family:inherit !important}
|
|||
.mceItemAudio {background-image:url(../../img/video.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;}
|
||||
.mceHideBrInPre pre br {display: none}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="js/source_editor.js"></script>
|
||||
</head>
|
||||
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
|
||||
<body onresize="resizeInputs();" style="display:none; overflow:hidden;" spellcheck="false">
|
||||
<form name="source" onsubmit="saveContent();return false;" action="#">
|
||||
<div style="float: left" class="title"><label for="htmlSource">{#advanced_dlg.code_title}</label></div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue