Update TinyMCE to release 3.3.8, jQuery version

Release 2010-06-30 http://tinymce.moxiecode.com/punbb/viewtopic.php?id=22165
This commit is contained in:
Brion Vibber
2010-08-10 15:24:12 -07:00
parent 819d33210d
commit bb711cb98d
46 changed files with 1334 additions and 920 deletions

View File

@@ -2,7 +2,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.charmap_title}</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/charmap.js"></script>
</head>

File diff suppressed because one or more lines are too long

View File

@@ -203,7 +203,8 @@
ed.formatter.register(name, {
inline : 'span',
classes : o['class']
attributes : {'class' : o['class']},
selector : '*'
});
ctrl.add(o['class'], name);
@@ -218,8 +219,24 @@
ctrl = ctrlMan.createListBox('styleselect', {
title : 'advanced.style_select',
onselect : function(name) {
var matches, formatNames = [];
each(ctrl.items, function(item) {
formatNames.push(item.value);
});
ed.focus();
ed.formatter.toggle(name);
ed.undoManager.add();
// Toggle off the current format
matches = ed.formatter.matchAll(formatNames);
if (!name || matches[0] == name)
ed.formatter.remove(matches[0]);
else
ed.formatter.apply(name);
ed.undoManager.add();
ed.nodeChanged();
return false; // No auto select
}
@@ -251,7 +268,8 @@
ed.formatter.register(name, {
inline : 'span',
classes : val
classes : val,
selector : '*'
});
ctrl.add(t.editor.translate(key), name);
@@ -282,7 +300,20 @@
c = ed.controlManager.createListBox('fontselect', {
title : 'advanced.fontdefault',
onselect : function(v) {
var cur = c.items[c.selectedIndex];
if (!v && cur) {
ed.execCommand('FontName', false, cur.value);
return;
}
ed.execCommand('FontName', false, v);
// Fake selection, execCommand will fire a nodeChange and update the selection
c.select(function(sv) {
return v == sv;
});
return false; // No auto select
}
});
@@ -300,17 +331,36 @@
var t = this, ed = t.editor, c, i = 0, cl = [];
c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {
if (v.fontSize)
ed.execCommand('FontSize', false, v.fontSize);
else {
each(t.settings.theme_advanced_font_sizes, function(v, k) {
if (v['class'])
cl.push(v['class']);
});
var cur = c.items[c.selectedIndex];
ed.editorCommands._applyInlineStyle('span', {'class' : v['class']}, {check_classes : cl});
if (!v && cur) {
cur = cur.value;
if (cur['class']) {
ed.formatter.toggle('fontsize_class', {value : cur['class']});
ed.undoManager.add();
ed.nodeChanged();
} else {
ed.execCommand('FontSize', false, cur.fontSize);
}
return;
}
if (v['class']) {
ed.focus();
ed.undoManager.add();
ed.formatter.toggle('fontsize_class', {value : v['class']});
ed.undoManager.add();
ed.nodeChanged();
} else
ed.execCommand('FontSize', false, v.fontSize);
// Fake selection, execCommand will fire a nodeChange and update the selection
c.select(function(sv) {
return v == sv;
});
return false; // No auto select
}});
@@ -522,7 +572,7 @@
},
resizeTo : function(w, h) {
var ed = this.editor, s = ed.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'), dh;
var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr');
// Boundery fix box
w = Math.max(s.theme_advanced_resizing_min_width || 100, w);
@@ -530,12 +580,18 @@
w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w);
h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h);
// Calc difference between iframe and container
dh = e.clientHeight - ifr.clientHeight;
// Resize iframe and container
DOM.setStyle(ifr, 'height', h - dh);
DOM.setStyles(e, {width : w, height : h});
DOM.setStyle(e, 'height', '');
DOM.setStyle(ifr, 'height', h);
if (s.theme_advanced_resize_horizontal) {
DOM.setStyle(e, 'width', '');
DOM.setStyle(ifr, 'width', w);
// Make sure that the size is never smaller than the over all ui
if (w < e.clientWidth)
DOM.setStyle(ifr, 'width', e.clientWidth);
}
},
destroy : function() {
@@ -749,99 +805,53 @@
if (!o)
return;
if (s.theme_advanced_resize_horizontal)
c.style.width = Math.max(10, o.cw) + 'px';
c.style.height = Math.max(10, o.ch) + 'px';
DOM.get(ed.id + '_ifr').style.height = Math.max(10, parseInt(o.ch) + t.deltaHeight) + 'px';
t.resizeTo(o.cw, o.ch);
});
}
ed.onPostRender.add(function() {
Event.add(ed.id + '_resize', 'mousedown', function(e) {
var c, p, w, h, n, pa;
var mouseMoveHandler1, mouseMoveHandler2,
mouseUpHandler1, mouseUpHandler2,
startX, startY, startWidth, startHeight, width, height, ifrElm;
// Measure container
c = DOM.get(ed.id + '_tbl');
w = c.clientWidth;
h = c.clientHeight;
function resizeOnMove(e) {
width = startWidth + (e.screenX - startX);
height = startHeight + (e.screenY - startY);
miw = s.theme_advanced_resizing_min_width || 100;
mih = s.theme_advanced_resizing_min_height || 100;
maw = s.theme_advanced_resizing_max_width || 0xFFFF;
mah = s.theme_advanced_resizing_max_height || 0xFFFF;
// Setup placeholder
p = DOM.add(DOM.get(ed.id + '_parent'), 'div', {'class' : 'mcePlaceHolder'});
DOM.setStyles(p, {width : w, height : h});
// Replace with placeholder
DOM.hide(c);
DOM.show(p);
// Create internal resize obj
r = {
x : e.screenX,
y : e.screenY,
w : w,
h : h,
dx : null,
dy : null
t.resizeTo(width, height);
};
// Start listening
mf = Event.add(DOM.doc, 'mousemove', function(e) {
var w, h;
// Calc delta values
r.dx = e.screenX - r.x;
r.dy = e.screenY - r.y;
// Boundery fix box
w = Math.max(miw, r.w + r.dx);
h = Math.max(mih, r.h + r.dy);
w = Math.min(maw, w);
h = Math.min(mah, h);
// Resize placeholder
if (s.theme_advanced_resize_horizontal)
p.style.width = w + 'px';
p.style.height = h + 'px';
return Event.cancel(e);
});
me = Event.add(DOM.doc, 'mouseup', function(e) {
var ifr;
function endResize(e) {
// Stop listening
Event.remove(DOM.doc, 'mousemove', mf);
Event.remove(DOM.doc, 'mouseup', me);
c.style.display = '';
DOM.remove(p);
if (r.dx === null)
return;
ifr = DOM.get(ed.id + '_ifr');
if (s.theme_advanced_resize_horizontal)
c.style.width = Math.max(10, r.w + r.dx) + 'px';
c.style.height = Math.max(10, r.h + r.dy) + 'px';
ifr.style.height = Math.max(10, ifr.clientHeight + r.dy) + 'px';
Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1);
Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2);
Event.remove(DOM.doc, 'mouseup', mouseUpHandler1);
Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2);
// Store away the size
if (s.theme_advanced_resizing_use_cookie) {
Cookie.setHash("TinyMCE_" + ed.id + "_size", {
cw : r.w + r.dx,
ch : r.h + r.dy
cw : width,
ch : height
});
}
});
};
return Event.cancel(e);
e.preventDefault();
// Get the current rect size
startX = e.screenX;
startY = e.screenY;
ifrElm = DOM.get(t.editor.id + '_ifr');
startWidth = width = ifrElm.clientWidth;
startHeight = height = ifrElm.clientHeight;
// Register envent handlers
mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove);
mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove);
mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize);
mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize);
});
});
}
@@ -851,7 +861,7 @@
},
_nodeChanged : function(ed, cm, n, co, ob) {
var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn;
var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, formatNames, matches;
tinymce.each(t.stateControls, function(c) {
cm.setActive(c, ed.queryCommandState(t.controls[c][1]));
@@ -901,10 +911,13 @@
if (c = cm.get('styleselect')) {
t._importClasses();
// Check each format and update
c.select(function(fmt) {
return !!ed.formatter.match(fmt);
formatNames = [];
each(c.items, function(item) {
formatNames.push(item.value);
});
matches = ed.formatter.matchAll(formatNames);
c.select(matches[0]);
}
if (c = cm.get('formatselect')) {

View File

@@ -9,6 +9,7 @@ h5 {font-size: .83em}
h6 {font-size: .75em}
.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;}
span.mceItemNbsp {background: #DDD}
td.mceSelected, th.mceSelected {background-color:#3399ff !important}
img {border:0;}
table {cursor:default}

View File

@@ -4,7 +4,7 @@
.defaultSkin table td {vertical-align:middle}
/* Containers */
.defaultSkin table {background:#F0F0EE}
.defaultSkin table {direction:ltr; background:#F0F0EE}
.defaultSkin iframe {display:block; background:#FFF}
.defaultSkin .mceToolbar {height:26px}
.defaultSkin .mceLeft {text-align:left}
@@ -24,7 +24,7 @@
.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC}
.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 .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}
.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}
.defaultSkin table.mceToolbar {margin-left:3px}
.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px}
@@ -47,7 +47,6 @@
.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px}
/* ListBox */
.defaultSkin .mceListBox {direction:ltr}
.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block}
.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;}
@@ -108,7 +107,6 @@
/* 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}
.defaultSkin .mcePlaceHolder {border:1px dotted gray}
/* Formats */
.defaultSkin .mce_formatPreview a {font-size:10px}
@@ -212,4 +210,4 @@
.defaultSkin span.mce_ins {background-position:-960px -20px}
.defaultSkin span.mce_pagebreak {background-position:0 -40px}
.defaultSkin span.mce_restoredraft {background-position:-20px -40px}
.defaultSkin .mce_spellchecker span.mceAction {background-position:-540px -20px}
.defaultSkin span.mce_spellchecker {background-position:-540px -20px}

View File

@@ -9,6 +9,7 @@ h5 {font-size: .83em}
h6 {font-size: .75em}
.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(../default/img/items.gif) no-repeat 0 0;}
span.mceItemNbsp {background: #DDD}
td.mceSelected, th.mceSelected {background-color:#3399ff !important}
img {border:0;}
table {cursor:default}

View File

@@ -21,7 +21,7 @@
.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD}
.o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px}
.o2k7Skin .mceStatusbar div {float:left; padding:2px}
.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize}
.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
.o2k7Skin .mceStatusbar a:hover {text-decoration:underline}
.o2k7Skin table.mceToolbar {margin-left:3px}
.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;}
@@ -109,7 +109,6 @@
/* 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 .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
.o2k7Skin .mcePlaceHolder {border:1px dotted gray}
/* Formats */
.o2k7Skin .mce_formatPreview a {font-size:10px}
@@ -213,4 +212,4 @@
.o2k7Skin span.mce_ins {background-position:-960px -20px}
.o2k7Skin span.mce_pagebreak {background-position:0 -40px}
.o2k7Skin span.mce_restoredraft {background-position:-20px -40px}
.o2k7Skin .mce_spellchecker span.mceAction {background-position:-540px -20px}
.o2k7Skin span.mce_spellchecker {background-position:-540px -20px}

View File

@@ -1,6 +1,5 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{#advanced_dlg.code_title}</title>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript" src="js/source_editor.js"></script>