summaryrefslogtreecommitdiffstats
path: root/wp-includes/js
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-03 17:00:59 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-03 17:00:59 +0000
commit2b6348978ec434e2fa4114085783cf9ada097b22 (patch)
treea3745bb9ace00b0a8f687bc8c1bfb74bb885077c /wp-includes/js
parent102dc1d903d95fd7abdf2243d7e047b4b20099d3 (diff)
downloadwordpress-mu-2b6348978ec434e2fa4114085783cf9ada097b22.tar.gz
wordpress-mu-2b6348978ec434e2fa4114085783cf9ada097b22.tar.xz
wordpress-mu-2b6348978ec434e2fa4114085783cf9ada097b22.zip
WP Merge to rev 8249
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1347 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/js')
-rw-r--r--wp-includes/js/tinymce/langs/wp-langs.php7
-rw-r--r--wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js44
-rw-r--r--wp-includes/js/tinymce/plugins/wordpress/img/audio.gifbin0 -> 146 bytes
-rw-r--r--wp-includes/js/tinymce/plugins/wordpress/img/image.gifbin0 -> 101 bytes
-rw-r--r--wp-includes/js/tinymce/plugins/wordpress/img/media.gifbin0 -> 149 bytes
-rw-r--r--wp-includes/js/tinymce/plugins/wordpress/img/video.gifbin0 -> 99 bytes
-rw-r--r--wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js130
-rw-r--r--wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js148
-rw-r--r--wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css6
-rw-r--r--wp-includes/js/tinymce/tiny_mce_config.php2
-rw-r--r--wp-includes/js/tinymce/wordpress.css32
11 files changed, 282 insertions, 87 deletions
diff --git a/wp-includes/js/tinymce/langs/wp-langs.php b/wp-includes/js/tinymce/langs/wp-langs.php
index 86b3e08..6922831 100644
--- a/wp-includes/js/tinymce/langs/wp-langs.php
+++ b/wp-includes/js/tinymce/langs/wp-langs.php
@@ -395,11 +395,16 @@ wp_more_desc:"' . mce_escape( __('Insert More tag') ) . ' (Alt+Shift+T)",
wp_page_desc:"' . mce_escape( __('Insert Page break') ) . ' (Alt+Shift+P)",
wp_help_desc:"' . mce_escape( __('Help') ) . ' (Alt+Shift+H)",
wp_more_alt:"' . mce_escape( __('More...') ) . '",
-wp_page_alt:"' . mce_escape( __('Next page...') ) . '"
+wp_page_alt:"' . mce_escape( __('Next page...') ) . '",
+add_media:"' . mce_escape( __('Add Media') ) . '",
+add_image:"' . mce_escape( __('Add an Image') ) . '",
+add_video:"' . mce_escape( __('Add Video') ) . '",
+add_audio:"' . mce_escape( __('Add Audio') ) . '"
});
tinyMCE.addI18n("' . $language . '.wpeditimage",{
edit_img:"' . mce_escape( __('Edit Image') ) . '",
+del_img:"' . mce_escape( __('Delete Image') ) . '",
adv_settings:"' . mce_escape( __('Advanced Settings') ) . '",
none:"' . mce_escape( __('None') ) . '",
size:"' . mce_escape( __('Size') ) . '",
diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js
index 418f3a4..ab3eb12 100644
--- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js
+++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js
@@ -89,6 +89,50 @@
cmd : 'WP_Adv'
});
+ // Add Media buttons
+ ed.addButton('add_media', {
+ title : 'wordpress.add_media',
+ image : url + '/img/media.gif',
+ onclick : function() {
+ tb_show('', tinymce.DOM.get('add_media').href);
+ tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
+ }
+ });
+
+ ed.addButton('add_image', {
+ title : 'wordpress.add_image',
+ image : url + '/img/image.gif',
+ onclick : function() {
+ tb_show('', tinymce.DOM.get('add_image').href);
+ tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
+ }
+ });
+
+ ed.addButton('add_video', {
+ title : 'wordpress.add_video',
+ image : url + '/img/video.gif',
+ onclick : function() {
+ tb_show('', tinymce.DOM.get('add_video').href);
+ tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
+ }
+ });
+
+ ed.addButton('add_audio', {
+ title : 'wordpress.add_audio',
+ image : url + '/img/audio.gif',
+ onclick : function() {
+ tb_show('', tinymce.DOM.get('add_audio').href);
+ tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
+ }
+ });
+
+ // Add Media buttons to fullscreen
+ ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) {
+ if ( 'mceFullScreen' != cmd ) return;
+ if ( 'mce_fullscreen' != ed.id )
+ ed.settings.theme_advanced_buttons1 += ',|,add_image,add_video,add_audio,add_media';
+ });
+
// Add class "alignleft", "alignright" and "aligncenter" when selecting align for images.
ed.onExecCommand.add(function( ed, cmd ) {
var n, bl, dom = ed.dom;
diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/audio.gif b/wp-includes/js/tinymce/plugins/wordpress/img/audio.gif
new file mode 100644
index 0000000..f8ad223
--- /dev/null
+++ b/wp-includes/js/tinymce/plugins/wordpress/img/audio.gif
Binary files differ
diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/image.gif b/wp-includes/js/tinymce/plugins/wordpress/img/image.gif
new file mode 100644
index 0000000..6736e6b
--- /dev/null
+++ b/wp-includes/js/tinymce/plugins/wordpress/img/image.gif
Binary files differ
diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/media.gif b/wp-includes/js/tinymce/plugins/wordpress/img/media.gif
new file mode 100644
index 0000000..786e4f5
--- /dev/null
+++ b/wp-includes/js/tinymce/plugins/wordpress/img/media.gif
Binary files differ
diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/video.gif b/wp-includes/js/tinymce/plugins/wordpress/img/video.gif
new file mode 100644
index 0000000..b8e0975
--- /dev/null
+++ b/wp-includes/js/tinymce/plugins/wordpress/img/video.gif
Binary files differ
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js
index 33edd24..230746e 100644
--- a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js
@@ -34,27 +34,76 @@
});
ed.onMouseUp.add(function(ed, e) {
- if ( tinymce.isOpera )
- ed.plugins.wpeditimage.showButtons(e);
+ if ( ! tinymce.isOpera ) return;
+ if ( e.target.nodeName == 'IMG' )
+ ed.plugins.wpeditimage.showButtons(e.target);
});
ed.onMouseDown.add(function(ed, e) {
- if ( tinymce.isOpera ) return;
- ed.plugins.wpeditimage.showButtons(e);
+ if ( tinymce.isOpera || e.target.nodeName != 'IMG' ) {
+ t.hideButtons();
+ return;
+ }
+ ed.plugins.wpeditimage.showButtons(e.target);
});
-/*
- ed.onSetContent.add(function() {
- t._fixCenter(ed.getBody());
+
+ ed.onKeyPress.add(function(ed, e) {
+ var DL, DIV;
+
+ if ( e.keyCode == 13 && (DL = ed.dom.getParent(ed.selection.getNode(), 'DL')) ) {
+ var P = ed.dom.create('p', {}, '&nbsp;');
+ if ( (DIV = DL.parentNode) && DIV.nodeName == 'DIV' )
+ ed.dom.insertAfter( P, DIV );
+ else ed.dom.insertAfter( P, DL );
+
+ tinymce.dom.Event.cancel(e);
+ ed.selection.select(P);
+ return false;
+ }
});
- ed.onPreProcess.add(function(ed, o) {
- if (o.set)
- t._fixCenter(o.node);
+ ed.onBeforeSetContent.add(function(ed, o) {
+ o.content = t._do_shcode(o.content);
+ });
+ ed.onPostProcess.add(function(ed, o) {
if (o.get)
- ed.dom.removeClass(ed.dom.select('p', o.node), 'mce_iecenter');
+ o.content = t._get_shcode(o.content);
+ });
+ },
+
+ _do_shcode : function(co) {
+ return co.replace(/\[wp_caption([^\]]+)\]([\s\S]+?)\[\/wp_caption\][\s\u00a0]*/g, function(a,b,c){
+ var id = b.match(/id=['"]([^'"]+)/), cls = b.match(/align=['"]([^'"]+)/);
+ var w = b.match(/width=['"]([0-9]+)/), cap = b.match(/caption=['"]([^'"]+)/);
+
+ id = ( id && id[1] ) ? id[1] : '';
+ cls = ( cls && cls[1] ) ? cls[1] : 'alignnone';
+ w = ( w && w[1] ) ? w[1] : '';
+ cap = ( cap && cap[1] ) ? cap[1] : '';
+ if ( ! w || ! cap ) return c;
+
+ var div_cls = (cls == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp';
+
+ return '<div class="'+div_cls+'"><dl id="'+id+'" class="wp_caption '+cls+'" style="width: '+(10+parseInt(w))+
+ 'px"><dt class="wp_caption_dt">'+c+'</dt><dd class="wp_caption_dd">'+cap+'</dd></dl></div>';
+ });
+ },
+
+ _get_shcode : function(co) {
+ return co.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>([^<]+)<\/dd>\s*<\/dl>\s*<\/div>\s*/g, function(a,b,c,cap){
+ var id = b.match(/id=['"]([^'"]+)/), cls = b.match(/class=['"]([^'"]+)/);
+ var w = c.match(/width=['"]([0-9]+)/);
+
+ id = ( id && id[1] ) ? id[1] : '';
+ cls = ( cls && cls[1] ) ? cls[1] : 'alignnone';
+ w = ( w && w[1] ) ? w[1] : '';
+
+ if ( ! w || ! cap ) return c;
+ cls = cls ? cls.match(/align[^ '"]+/) : '';
+
+ return '[wp_caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/wp_caption]';
});
-*/
},
_fixCenter : function(c) {
@@ -71,32 +120,31 @@
});
},
- showButtons : function(e) {
- var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y, el = e.target;
+ showButtons : function(n) {
+ var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y;
- t.hideButtons();
- if (el.nodeName == 'IMG') {
- if (ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1)
- return;
+ if (ed.dom.getAttrib(n, 'class').indexOf('mceItem') != -1)
+ return;
- vp = ed.dom.getViewPort(ed.getWin());
- p1 = DOM.getPos(ed.getContentAreaContainer());
- p2 = ed.dom.getPos(el);
+ vp = ed.dom.getViewPort(ed.getWin());
+ p1 = DOM.getPos(ed.getContentAreaContainer());
+ p2 = ed.dom.getPos(n);
- X = Math.max(p2.x - vp.x, 0) + p1.x;
- Y = Math.max(p2.y - vp.y, 0) + p1.y;
+ X = Math.max(p2.x - vp.x, 0) + p1.x;
+ Y = Math.max(p2.y - vp.y, 0) + p1.y;
- DOM.setStyles('wp_editbtns', {
- 'top' : Y+5+'px',
- 'left' : X+5+'px',
- 'display' : 'block'
- });
+ DOM.setStyles('wp_editbtns', {
+ 'top' : Y+5+'px',
+ 'left' : X+5+'px',
+ 'display' : 'block'
+ });
- t.btnsTout = window.setTimeout( function(){ed.plugins.wpeditimage.hideButtons();}, 5000 );
- }
+ t.btnsTout = window.setTimeout( function(){ed.plugins.wpeditimage.hideButtons();}, 5000 );
},
hideButtons : function() {
+ if ( tinymce.DOM.isHidden('wp_editbtns') ) return;
+
tinymce.DOM.hide('wp_editbtns');
window.clearTimeout(this.btnsTout);
},
@@ -116,7 +164,7 @@
id : 'wp_editimgbtn',
width : '24',
height : '24',
- title : 'Edit'
+ title : ed.getLang('wpeditimage.edit_img')
});
wp_editimgbtn.onmousedown = function(e) {
@@ -131,21 +179,23 @@
id : 'wp_delimgbtn',
width : '24',
height : '24',
- title : 'Delete'
+ title : ed.getLang('wpeditimage.del_img')
});
wp_delimgbtn.onmousedown = function(e) {
var ed = tinyMCE.activeEditor, el = ed.selection.getNode(), p;
- if ( el.nodeName != 'IMG' || ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1 ) return;
+ if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('mceItem') == -1 ) {
+ if ( (p = ed.dom.getParent(el, 'div')) && ed.dom.hasClass(p, 'mceTemp') )
+ ed.dom.remove(p);
+ else if ( (p = ed.dom.getParent(el, 'A')) && p.childNodes.length == 1 )
+ ed.dom.remove(p);
+ else ed.dom.remove(el);
- if ( (p = ed.dom.getParent(el, 'A')) && p.childNodes.length == 1)
- ed.dom.remove(p);
- else ed.dom.remove(el);
-
- this.parentNode.style.display = 'none';
- ed.execCommand('mceRepaint');
- return false;
+ this.parentNode.style.display = 'none';
+ ed.execCommand('mceRepaint');
+ return false;
+ }
}
},
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
index 869dfd1..89b4d71 100644
--- a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
@@ -95,6 +95,8 @@ var wpImage = {
current_size_sel : 's100',
width : '',
height : '',
+ align : '',
+ img_alt : '',
setTabs : function(tab) {
var t = this;
@@ -125,7 +127,7 @@ var wpImage = {
imgAlignCls : function(v) {
var t = this, cls = t.I('img_classes').value;
- t.I('img_demo').className = v;
+ t.I('img_demo').className = t.align = v;
cls = cls.replace( /align[^ "']+/gi, '' );
cls += (' ' + v);
@@ -135,7 +137,7 @@ var wpImage = {
t.I('hspace').value = '';
t.updateStyle('hspace');
}
-
+
t.I('img_classes').value = cls;
},
@@ -153,7 +155,7 @@ var wpImage = {
showSizeSet : function() {
var t = this;
-
+
if ( (t.width * 1.3) > parseInt(t.preloadImg.width) ) {
var s130 = t.I('s130'), s120 = t.I('s120'), s110 = t.I('s110');
@@ -243,7 +245,7 @@ var wpImage = {
},
setup : function() {
- var t = this, h, c, el, id, link, fname, f = document.forms[0], ed = tinyMCEPopup.editor, d = t.I('img_demo'), dom = tinyMCEPopup.dom;
+ var t = this, h, c, el, id, link, fname, f = document.forms[0], ed = tinyMCEPopup.editor, d = t.I('img_demo'), dom = tinyMCEPopup.dom, DL, caption;
document.dir = tinyMCEPopup.editor.getParam('directionality','');
tinyMCEPopup.restoreSelection();
el = ed.selection.getNode();
@@ -252,16 +254,32 @@ var wpImage = {
f.img_src.value = d.src = link = ed.dom.getAttrib(el, 'src');
ed.dom.setStyle(el, 'float', '');
t.getImageData();
+ c = ed.dom.getAttrib(el, 'class');
+ caption = t.img_alt = ed.dom.getAttrib(el, 'alt');
+
+ if ( DL = dom.getParent(el, 'dl') ) {
+ var dlc = ed.dom.getAttrib(DL, 'class');
+ dlc = dlc.match(/align[^ "']+/i);
+ if ( ! dom.hasClass(el, dlc) )
+ c += ' '+dlc;
+
+ tinymce.each(DL.childNodes, function(e) {
+ if ( e.nodeName == 'DD' ) {
+ caption = e.innerHTML;
+ return;
+ }
+ });
+ }
f.img_title.value = ed.dom.getAttrib(el, 'title');
- f.img_alt.value = ed.dom.getAttrib(el, 'alt');
+ f.img_alt.value = caption;
f.border.value = ed.dom.getAttrib(el, 'border');
f.vspace.value = ed.dom.getAttrib(el, 'vspace');
f.hspace.value = ed.dom.getAttrib(el, 'hspace');
f.align.value = ed.dom.getAttrib(el, 'align');
f.width.value = t.width = ed.dom.getAttrib(el, 'width');
f.height.value = t.height = ed.dom.getAttrib(el, 'height');
- f.img_classes.value = c = ed.dom.getAttrib(el, 'class');
+ f.img_classes.value = c;
f.img_style.value = ed.dom.getAttrib(el, 'style');
// Move attribs to styles
@@ -291,27 +309,20 @@ var wpImage = {
if ( c.indexOf('alignleft') != -1 ) {
t.I('alignleft').checked = "checked";
- d.className = "alignleft";
+ d.className = t.align = "alignleft";
} else if ( c.indexOf('aligncenter') != -1 ) {
t.I('aligncenter').checked = "checked";
- d.className = "aligncenter";
+ d.className = t.align = "aligncenter";
} else if ( c.indexOf('alignright') != -1 ) {
t.I('alignright').checked = "checked";
- d.className = "alignright";
+ d.className = t.align = "alignright";
} else if ( c.indexOf('alignnone') != -1 ) {
t.I('alignnone').checked = "checked";
- d.className = "alignnone";
+ d.className = t.align = "alignnone";
}
if ( t.width && t.preloadImg.width ) t.showSizeSet();
document.body.style.display = '';
-/*
- // Test if is attachment
- if ( (id = c.match( /wp-image-([0-9]{1,6})/ )) && id[1] ) {
- t.I('tab_attachment').href = tinymce.documentBaseURL + 'media.php?action=edit&attachment_id=' + id[1];
- t.I('tab_attachment').style.display = 'inline';
- }
-*/
},
remove : function() {
@@ -321,10 +332,11 @@ var wpImage = {
el = ed.selection.getNode();
if (el.nodeName != 'IMG') return;
- if ( (p = ed.dom.getParent(el, 'A')) && p.childNodes.length == 1)
+ if ( (p = ed.dom.getParent(el, 'div')) && ed.dom.hasClass(p, 'mceTemp') )
ed.dom.remove(p);
- else
- ed.dom.remove(el);
+ else if ( (p = ed.dom.getParent(el, 'A')) && p.childNodes.length == 1 )
+ ed.dom.remove(p);
+ else ed.dom.remove(el);
ed.execCommand('mceRepaint');
tinyMCEPopup.close();
@@ -332,31 +344,37 @@ var wpImage = {
},
update : function() {
- var t = this, f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, el, P, A, v = f.img_classes.value;
+ var t = this, f = document.forms[0], ed = tinyMCEPopup.editor, el, b, fixSafari = null, DL, P, A, DIV, do_caption = null, img_class = f.img_classes.value, html;
tinyMCEPopup.restoreSelection();
el = ed.selection.getNode();
if (el.nodeName != 'IMG') return;
- if (f.img_src.value === '') t.remove();
+ if (f.img_src.value === '') {
+ t.remove();
+ return;
+ }
+
+ if ( f.img_alt.value != '' && f.width.value != '' ) {
+ do_caption = 1;
+ img_class = img_class.replace( /align[^ "']+\s?/gi, '' );
+ }
- A = ed.dom.getParent(el, 'A');
+ A = ed.dom.getParent(el, 'a');
P = ed.dom.getParent(el, 'p');
+ DL = ed.dom.getParent(el, 'dl');
+ DIV = ed.dom.getParent(el, 'div');
+
tinyMCEPopup.execCommand("mceBeginUndoLevel");
-/* if ( tinymce.isIE ) {
- if ( f.img_classes.value.indexOf('aligncenter') != -1 )
- ed.dom.addClass(P, 'mce_iecenter');
- else ed.dom.removeClass(P, 'mce_iecenter');
- }
-*/
+
ed.dom.setAttribs(el, {
src : f.img_src.value,
title : f.img_title.value,
- alt : f.img_alt.value,
+ alt : t.img_alt,
width : f.width.value,
height : f.height.value,
style : f.img_style.value,
- 'class' : '' //f.img_classes.value
+ 'class' : img_class
});
if ( ! f.link_href.value ) {
@@ -368,15 +386,20 @@ var wpImage = {
} else {
// Create new anchor elements
if ( A == null ) {
-
if ( ! f.link_href.value.match(/https?:\/\//) )
f.link_href.value = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.link_href.value);
-
+
+ if ( tinymce.isWebKit && ed.dom.hasClass(el, 'aligncenter') ) {
+ ed.dom.removeClass(el, 'aligncenter');
+ fixSafari = 1;
+ }
+
tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
-
+ if ( fixSafari ) ed.dom.addClass(el, 'aligncenter');
+
tinymce.each(ed.dom.select("a"), function(n) {
if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {
-
+
ed.dom.setAttribs(n, {
href : f.link_href.value,
title : f.link_title.value,
@@ -399,15 +422,62 @@ var wpImage = {
}
}
- ed.dom.setAttrib(el, 'class', f.img_classes.value);
-
- if ( v.indexOf('aligncenter') != -1 ) {
+ if ( do_caption ) {
+ var id, cap_id = '', cap, DT, DD, cap_width = 10 + parseInt(f.width.value), align = t.align.substring(5), div_cls = (t.align == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp';
+
+ if ( DL ) {
+ ed.dom.setAttribs(DL, {
+ 'class' : 'wp_caption '+t.align,
+ style : 'width: '+cap_width+'px;'
+ });
+
+ if ( DIV )
+ ed.dom.setAttrib(DIV, 'class', div_cls);
+
+ if ( (DT = ed.dom.getParent(el, 'dt')) && (DD = DT.nextSibling) && ed.dom.hasClass(DD, 'wp_caption_dd') )
+ ed.dom.setHTML(DD, f.img_alt.value);
+
+ } else {
+ if ( (id = f.img_classes.value.match( /wp-image-([0-9]{1,6})/ )) && id[1] )
+ cap_id = 'attachment_'+id[1];
+
+ if ( f.link_href.value ) html = ed.dom.getOuterHTML(ed.dom.getParent(el, 'a'));
+ else html = ed.dom.getOuterHTML(el);
+
+ html = '<dl id="'+cap_id+'" class="wp_caption '+t.align+'" style="width: '+cap_width+
+ 'px"><dt class="wp_caption_dt">'+html+'</dt><dd class="wp_caption_dd">'+f.img_alt.value+'</dd></dl>';
+
+ cap = ed.dom.create('div', {'class': div_cls}, html);
+
+ if ( P ) {
+ P.parentNode.insertBefore(cap, P);
+ ed.dom.remove(P);
+ }
+ }
+
+ tinyMCEPopup.execCommand("mceEndUndoLevel");
+ ed.execCommand('mceRepaint');
+ tinyMCEPopup.close();
+ return;
+ } else {
+ if ( DL && DIV ) {
+ if ( f.link_href.value ) html = ed.dom.getOuterHTML(ed.dom.getParent(el, 'a'));
+ else html = ed.dom.getOuterHTML(el);
+
+ P = ed.dom.create('p', {}, html);
+ DIV.parentNode.insertBefore(P, DIV);
+ ed.dom.remove(DIV);
+ }
+ }
+
+ if ( f.img_classes.value.indexOf('aligncenter') != -1 ) {
if ( P && ( ! P.style || P.style.textAlign != 'center' ) )
ed.dom.setStyle(P, 'textAlign', 'center');
} else {
if ( P && P.style && P.style.textAlign == 'center' )
ed.dom.setStyle(P, 'textAlign', '');
}
+
tinyMCEPopup.execCommand("mceEndUndoLevel");
ed.execCommand('mceRepaint');
tinyMCEPopup.close();
@@ -496,7 +566,7 @@ var wpImage = {
f.width.value = t.width = t.preloadImg.width;
f.height.value = t.height = t.preloadImg.height;
}
-
+
t.showSizeSet();
t.demoSetSize();
if ( f.img_style.value )
diff --git a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css
index 1a94d83..df1e059 100644
--- a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css
+++ b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css
@@ -1,4 +1,4 @@
-body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
+body, td {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
body {background:#FFF;}
body.mceForceColors {background:#FFF; color:#000;}
h1 {font-size: 2em}
@@ -17,7 +17,3 @@ ins {border-bottom:1px solid green; text-decoration: none; color:green}
del {color:red; text-decoration:line-through}
cite {border-bottom:1px dashed blue}
acronym {border-bottom:1px dotted #CCC; cursor:help}
-
-p.mce_iecenter {
- text-align: center;
-}
diff --git a/wp-includes/js/tinymce/tiny_mce_config.php b/wp-includes/js/tinymce/tiny_mce_config.php
index 8a2ff72..8a72ad4 100644
--- a/wp-includes/js/tinymce/tiny_mce_config.php
+++ b/wp-includes/js/tinymce/tiny_mce_config.php
@@ -222,7 +222,7 @@ if ( $compress && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
// Setup cache info
if ( $disk_cache ) {
- $cacheKey = apply_filters('tiny_mce_version', '20080626');
+ $cacheKey = apply_filters('tiny_mce_version', '20080703');
foreach ( $initArray as $v )
$cacheKey .= $v;
diff --git a/wp-includes/js/tinymce/wordpress.css b/wp-includes/js/tinymce/wordpress.css
index 1596f59..0b55d4e 100644
--- a/wp-includes/js/tinymce/wordpress.css
+++ b/wp-includes/js/tinymce/wordpress.css
@@ -1,6 +1,7 @@
/* This file contains the CSS data for the editable area(iframe) of TinyMCE */
-.aligncenter {
+.aligncenter,
+dl.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
@@ -14,6 +15,31 @@
float: right;
}
+.wp_caption {
+ border: 1px solid #ddd;
+ text-align: center;
+ background-color: #f3f3f3;
+ padding-top: 4px;
+ margin: 10px;
+ -moz-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+}
+
+.wp_caption img {
+ margin: 0;
+ padding: 0;
+ border: 0 none;
+}
+
+.wp_caption_dd {
+ font-size: 11px;
+ line-height: 17px;
+ padding: 0 4px 5px;
+ margin: 0;
+}
+
body.mceContentBody {
background: #fff;
color: #000;
@@ -63,3 +89,7 @@ a.mceItemAnchor {
padding-left: 12px;
background: url(img/items.gif) no-repeat bottom left;
}
+
+.mceIEcenter {
+ text-align: center;
+}