diff --git a/wp-admin/css/colors-classic.css b/wp-admin/css/colors-classic.css
index 10b2ac1b30..83a1141c17 100644
--- a/wp-admin/css/colors-classic.css
+++ b/wp-admin/css/colors-classic.css
@@ -561,7 +561,7 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
}
/* Containers */
-.wp_themeSkin table {
+.wp_themeSkin table, #wp_editbtns {
background: #83B4D5;
}
diff --git a/wp-admin/css/colors-fresh.css b/wp-admin/css/colors-fresh.css
index d901e4f751..1d59940632 100644
--- a/wp-admin/css/colors-fresh.css
+++ b/wp-admin/css/colors-fresh.css
@@ -533,7 +533,7 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
}
/* Containers */
-.wp_themeSkin table {
+.wp_themeSkin table, #wp_editbtns {
background: #cee1ef;
}
diff --git a/wp-admin/gears-manifest.php b/wp-admin/gears-manifest.php
index a48004d86c..6fc01da8d2 100644
--- a/wp-admin/gears-manifest.php
+++ b/wp-admin/gears-manifest.php
@@ -87,7 +87,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
?>
{
"betaManifestVersion" : 1,
-"version" : "_20080602",
+"version" : "_20080606",
"entries" : [
@@ -149,6 +149,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=3091" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=3091" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=3091" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=3091" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=3091" },
@@ -162,6 +163,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
{ "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=3091" },
{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=3091" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=3091" },
{ "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=3091" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=3091" },
@@ -174,6 +176,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
{ "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=3091" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=3091" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=3091" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=3091" },
{ "url" : "../wp-includes/js/tinymce/wordpress.css?ver=3091" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/icons.gif" },
@@ -208,5 +211,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/page.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/image.png" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/help.gif" }
]}
diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css
index 585937e178..f61932bd1b 100644
--- a/wp-admin/wp-admin.css
+++ b/wp-admin/wp-admin.css
@@ -1587,3 +1587,26 @@ fieldset {
margin: 0;
padding: 0 7px;
}
+
+#wp_editbtns {
+ padding: 2px;
+ position: absolute;
+ display: none;
+ z-index: 999998;
+}
+
+#wp_editimgbtn, #wp_delimgbtn {
+ margin: 2px;
+ padding: 2px;
+ border: 1px solid #999;
+ background-color: #eee;
+ -moz-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+}
+
+#wp_editimgbtn:hover, #wp_delimgbtn:hover {
+ border-color: #555;
+ background-color: #ccc;
+}
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css b/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css
new file mode 100644
index 0000000000..48a5a9f567
--- /dev/null
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css
@@ -0,0 +1,167 @@
+
+html, body {
+ background-color: #fff;
+ margin: 0;
+ padding: 0;
+}
+
+.submit input,
+.button {
+ font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+ padding: 3px 5px;
+ font-size: 12px;
+ line-height: 1.5em;
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+ text-decoration: none;
+}
+
+textarea,
+input,
+select {
+ font: 13px Verdana, Arial, Helvetica, sans-serif;
+ margin: 1px;
+ padding: 3px;
+}
+
+body, td {
+ font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+}
+
+abbr.required {
+ color: #FF0000;
+ text-align: left;
+}
+
+.alignright {
+ float: right;
+}
+
+.alignleft {
+ float: left;
+}
+
+.aligncenter {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+label {
+ cursor: pointer;
+}
+
+th.label {
+ width: 128px;
+}
+
+.show-align {
+ padding: 8px;
+ height: 200px;
+ background-color: #f1f1f1;
+ cursor: default;
+ -moz-user-select: none;
+ user-select: none;
+ overflow: hidden;
+}
+
+#media-upload #img-edit {
+ border: 1px solid #c0c0c0;
+ width: 623px;
+ margin: 20px auto auto;
+}
+
+#media-upload .media-upload-form table.describe {
+ border-top-style: none;
+ border-top-width: 0;
+}
+
+#img_demo_txt {
+ font-size: 6px;
+ line-height: 10px;
+ font-family: "Courier New",Courier,monotype;
+ color: #ccc;
+ background-color: #ccc;
+}
+
+#img_demo {
+ padding: 0 5px 4px;
+}
+
+#saveeditimg {
+ padding: 10px 0 0 5px;
+ border-top: 1px solid #ccc;
+}
+
+#sidemenu,
+#sidemenu li {
+ list-style: none;
+
+}
+
+#sidemenu li {
+
+ display: inline;
+}
+
+#sidemenu a {
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+ border-top-style: solid;
+ border-top-width: 1px;
+ display: block;
+ float: left;
+ line-height: 28px;
+ text-decoration: none;
+ text-align: center;
+ white-space: nowrap;
+ margin: 0;
+ padding: 0pt 7px;
+}
+
+#sidemenu a.current {
+ -moz-border-radius-topleft:4px;
+ -moz-border-radius-topright:4px;
+ border-style:solid;
+ border-width:1px;
+ font-weight:normal;
+}
+
+#adv_settings .field label {
+ padding: 0 5px 5px;
+}
+
+#media-upload h3 {
+ clear:both;
+ padding:0pt 0pt 3px;
+ border-bottom-style:solid;
+ border-bottom-width:1px;
+ font-family:Georgia,"Times New Roman",Times,serif;
+ font-size:20px;
+ font-weight:normal;
+ line-height:normal;
+ margin:20px 0 15px -4px;
+ padding:0 0 3px 0;
+ border-bottom-color:#DADADA;
+ color:#5A5A5A;
+}
+
+#img_dim #width,
+#img_dim #height {
+ width:40px;
+}
+
+#img_dim abbr {
+ padding: 0 4px;
+}
+
+#basic .align .field label {
+ margin: 0 10px 0 0;
+ padding: 0 0 0 25px;
+}
+
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html b/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
new file mode 100644
index 0000000000..33ccc5f528
--- /dev/null
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
@@ -0,0 +1,262 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js
new file mode 100644
index 0000000000..4ad1ba3f29
--- /dev/null
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js
@@ -0,0 +1,138 @@
+
+(function() {
+ tinymce.create('tinymce.plugins.wpEditImage', {
+
+ init : function(ed, url) {
+ var t = this;
+
+ t.url = url;
+ t._createButtons();
+
+ // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...');
+ ed.addCommand('WP_EditImage', function() {
+ var el = ed.selection.getNode();
+
+ if ( ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1 || el.nodeName != 'IMG' )
+ return;
+
+ tb_show('', url + '/editimage.html?TB_iframe=true');
+ tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
+ });
+
+ ed.onInit.add(function(ed) {
+ tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) {
+ ed.plugins.wpeditimage.hideButtons();
+ });
+ });
+
+ ed.onExecCommand.add(function(ed, cmd, ui, val) {
+ if ( 'mceFullScreen' == cmd )
+ ed.plugins.wpeditimage.hideButtons();
+ });
+
+ ed.onSaveContent.add(function(ed, o) {
+ ed.plugins.wpeditimage.hideButtons();
+ });
+
+ ed.onMouseUp.add(function(ed, e) {
+ if ( tinymce.isOpera )
+ ed.plugins.wpeditimage.showButtons(e);
+ });
+
+ ed.onMouseDown.add(function(ed, e) {
+ if ( tinymce.isOpera ) return;
+ ed.plugins.wpeditimage.showButtons(e);
+ });
+ },
+
+ showButtons : function(e) {
+ var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y, el = e.target;
+
+ t.hideButtons();
+ if (el.nodeName == 'IMG') {
+ if (ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1)
+ return;
+
+ vp = ed.dom.getViewPort(ed.getWin());
+ p1 = DOM.getPos(ed.getContentAreaContainer());
+ p2 = ed.dom.getPos(el);
+
+ 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'
+ });
+
+ t.btnsTout = window.setTimeout( function(){ed.plugins.wpeditimage.hideButtons();}, 5000 );
+ }
+ },
+
+ hideButtons : function() {
+ tinymce.DOM.hide('wp_editbtns');
+ window.clearTimeout(this.btnsTout);
+ },
+
+ _createButtons : function() {
+ var t = this, ed = tinyMCE.activeEditor, DOM = tinymce.DOM;
+
+ DOM.remove('wp_editbtns');
+
+ var wp_editbtns = DOM.add(document.body, 'div', {
+ id : 'wp_editbtns',
+ style : 'display:none;'
+ });
+
+ var wp_editimgbtn = DOM.add('wp_editbtns', 'img', {
+ src : t.url+'/img/image.png',
+ id : 'wp_editimgbtn',
+ width : '24',
+ height : '24',
+ title : 'Edit'
+ });
+
+ wp_editimgbtn.onmousedown = function(e) {
+ var ed = tinyMCE.activeEditor;
+ ed.windowManager.bookmark = ed.selection.getBookmark('simple');
+ ed.execCommand("WP_EditImage");
+ this.parentNode.style.display = 'none';
+ }
+
+ var wp_delimgbtn = DOM.add('wp_editbtns', 'img', {
+ src : t.url+'/img/delete.png',
+ id : 'wp_delimgbtn',
+ width : '24',
+ height : '24',
+ title : 'Delete'
+ });
+
+ 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 ( (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;
+ }
+ },
+
+ getInfo : function() {
+ return {
+ longname : 'Edit Image',
+ author : 'WordPress',
+ authorurl : 'http://wordpress.org',
+ infourl : '',
+ version : "1.0"
+ };
+ }
+ });
+
+ tinymce.PluginManager.add('wpeditimage', tinymce.plugins.wpEditImage);
+})();
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png b/wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png
new file mode 100644
index 0000000000..d64d8a66eb
Binary files /dev/null and b/wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png differ
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/img/image.png b/wp-includes/js/tinymce/plugins/wpeditimage/img/image.png
new file mode 100644
index 0000000000..f3d4b44902
Binary files /dev/null and b/wp-includes/js/tinymce/plugins/wpeditimage/img/image.png differ
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
new file mode 100644
index 0000000000..8a218a1de3
--- /dev/null
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
@@ -0,0 +1,471 @@
+
+var tinymce = null, tinyMCEPopup, tinyMCE;
+
+tinyMCEPopup = {
+ init: function() {
+ var t = this, w, ti, li, q, i, it;
+
+ li = ('' + document.location.search).replace(/^\?/, '').split('&');
+ q = {};
+ for (i=0; i' );
+ break;
+ }
+ }
+ },
+
+ I : function(e) {
+ return document.getElementById(e);
+ },
+
+ current : '',
+ link : '',
+ link_rel : '',
+
+ setTabs : function(tab) {
+ var t = this;
+
+ if ( 'current' == tab.className ) return false;
+ t.I('div_advanced').style.display = ( 'tab_advanced' == tab.id ) ? 'block' : 'none';
+ t.I('div_basic').style.display = ( 'tab_basic' == tab.id ) ? 'block' : 'none';
+ t.I('tab_basic').className = t.I('tab_advanced').className = '';
+ tab.className = 'current';
+ return false;
+ },
+
+ img_seturl : function(u) {
+ var t = this, rel = t.I('link_rel').value;
+
+ if ( 'current' == u ) {
+ t.I('link_href').value = t.current;
+ t.I('link_rel').value = t.link_rel;
+ } else {
+ t.I('link_href').value = t.link;
+ if ( rel ) {
+ rel = rel.replace( /attachment|wp-att-[0-9]+/gi, '' );
+ t.I('link_rel').value = tinymce.trim(rel);
+ }
+ }
+ },
+
+ imgAlignCls : function(v) {
+ var t = this, cls = t.I('img_classes').value;
+
+ t.I('img_demo').className = v;
+
+ cls = cls.replace( /align[^ "']+/gi, '' );
+ cls += (' ' + v);
+ cls = cls.replace( /\s+/g, ' ' ).replace( /^\s/, '' );
+
+ t.I('img_classes').value = cls;
+ },
+
+ imgSizeCls : function(v) {
+ var t = this, cls = t.I('img_classes').value;
+
+ if (v) {
+ if ( cls.indexOf('size-') != -1 )
+ cls = cls.replace( /size-[^ "']+/i, 'size-' + v );
+ else cls += (' size-' + v);
+ } else {
+ cls = cls.replace( /size-[^ "']+/gi, '' );
+ t.demoSetSize();
+ t.I('thumbnail').checked = '';
+ t.I('medium').checked = '';
+ t.I('full').checked = '';
+ }
+ cls = cls.replace( /\s+/g, ' ' ).replace( /^\s|\s$/, '' );
+
+ t.I('img_classes').value = cls;
+ },
+
+ imgEditSize : function(size) {
+ var t = this, f = document.forms[0], sz, m = null;
+
+ var W = parseInt(t.preloadImg.width), H = parseInt(t.preloadImg.height);
+
+ if ( ! t.preloadImg || W == "" || H == "" )
+ return;
+
+ switch(size) {
+ case 'thumbnail':
+ m = 150;
+ t.imgSizeCls('thumbnail');
+ break;
+ case 'medium':
+ m = 300;
+ t.imgSizeCls('medium');
+ break;
+ case 'full':
+ m = 500;
+ t.imgSizeCls('full');
+ break;
+ }
+
+ if (m) {
+ if ( W > H ) {
+ m = Math.min(W, m);
+ f.width.value = m;
+ f.height.value = Math.floor((m / W) * H);
+ } else {
+ m = Math.min(H, m);
+ f.height.value = m;
+ f.width.value = Math.floor((m / H) * W);
+ }
+
+ t.width = f.width.value;
+ t.height = f.height.value;
+ }
+ t.demoSetSize();
+ },
+
+ demoSetSize : function(img) {
+ var demo = this.I('img_demo'), f = document.forms[0];
+
+ demo.style.width = f.width.value ? Math.floor(f.width.value * 0.6) + 'px' : '';
+ demo.style.height = f.height.value ? Math.floor(f.height.value * 0.6) + 'px' : '60%';
+ },
+
+ origSize : function() {
+ var t = this, f = document.forms[0];
+
+ f.width.value = t.preloadImg.width;
+ f.height.value = t.preloadImg.height;
+ t.demoSetSize();
+ t.imgSizeCls();
+ },
+
+ init : function() {
+ var ed = tinyMCEPopup.editor, h;
+
+ h = document.body.innerHTML;
+
+ // Replace a=x with a="x" in IE
+ if (tinymce.isIE)
+ h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"')
+
+ document.dir = ed.getParam('directionality','');
+ document.body.innerHTML = ed.translate(h);
+ window.setTimeout( function(){wpImage.setup();}, 100 );
+ },
+
+ setup : function() {
+ var t = this, h, c, el, id, link, fname, f = document.forms[0], ed = tinyMCEPopup.editor, d = t.I('img_demo'), tr = ed.translate;
+
+ tinyMCEPopup.restoreSelection();
+ el = ed.selection.getNode();
+ if (el.nodeName != 'IMG') return;
+
+ f.img_src.value = d.src = link = ed.dom.getAttrib(el, 'src');
+
+ f.img_title.value = ed.dom.getAttrib(el, 'title');
+ f.img_alt.value = ed.dom.getAttrib(el, 'alt');
+ 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_style.value = ed.dom.getAttrib(el, 'style');
+ this.updateStyle();
+
+ if (pa = ed.dom.getParent(el, 'A')) {
+ f.link_href.value = t.current = ed.dom.getAttrib(pa, 'href');
+ f.link_title.value = ed.dom.getAttrib(pa, 'title');
+ f.link_rel.value = t.link_rel = ed.dom.getAttrib(pa, 'rel');
+ f.link_rev.value = ed.dom.getAttrib(pa, 'rev');
+ f.link_style.value = ed.dom.getAttrib(pa, 'style');
+ f.link_target.value = ed.dom.getAttrib(pa, 'target');
+ f.link_classes.value = ed.dom.getAttrib(pa, 'class');
+ }
+
+ fname = link.substring( link.lastIndexOf('/') );
+ fname = fname.replace(/-[0-9]{2,4}x[0-9]{2,4}/, '' );
+ t.link = link.substring( 0, link.lastIndexOf('/') ) + fname;
+
+ if ( c.indexOf('size-thumbnail') != -1 )
+ t.I('thumbnail').checked = "checked";
+ else if ( c.indexOf('size-medium') != -1 )
+ t.I('medium').checked = "checked";
+ else if ( c.indexOf('size-full') != -1 )
+ t.I('full').checked = "checked";
+
+ if ( c.indexOf('alignleft') != -1 ) {
+ t.I('alignleft').checked = "checked";
+ d.className = "alignleft";
+ } else if ( c.indexOf('aligncenter') != -1 ) {
+ t.I('aligncenter').checked = "checked";
+ d.className = "aligncenter";
+ } else if ( c.indexOf('alignright') != -1 ) {
+ t.I('alignright').checked = "checked";
+ d.className = "alignright";
+ } else if ( c.indexOf('alignnone') != -1 ) {
+ t.I('alignnone').checked = "checked";
+ d.className = "alignnone";
+ }
+
+ document.body.style.display = '';
+ t.getImageData();
+
+ 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() {
+ var ed = tinyMCEPopup.editor, p, el;
+
+ tinyMCEPopup.restoreSelection();
+ el = ed.selection.getNode();
+ if (el.nodeName != 'IMG') return;
+
+ 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();
+ return;
+ },
+
+ update : function() {
+ var t = this, f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, p, el, b;
+
+ tinyMCEPopup.restoreSelection();
+ el = ed.selection.getNode();
+
+ if (el.nodeName != 'IMG') return;
+ if (f.img_src.value === '') t.remove();
+
+ ed.dom.setAttribs(el, {
+ src : f.img_src.value,
+ title : f.img_title.value,
+ alt : f.img_alt.value,
+ width : f.width.value,
+ height : f.height.value,
+ style : f.img_style.value,
+ 'class' : f.img_classes.value
+ });
+
+ pa = ed.dom.getParent(el, 'A');
+
+ if ( ! f.link_href.value ) {
+ if ( pa ) {
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");
+ b = ed.selection.getBookmark();
+ ed.dom.remove(pa, 1);
+ ed.selection.moveToBookmark(b);
+ tinyMCEPopup.execCommand("mceEndUndoLevel");
+ tinyMCEPopup.close();
+ return;
+ }
+ }
+
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");
+
+ // Create new anchor elements
+ if (pa == null) {
+ tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
+
+ 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,
+ rel : f.link_rel.value,
+ rev : f.link_rev.value,
+ target : f.link_target.value,
+ 'class' : f.link_classes.value,
+ style : f.link_style.value
+ });
+ }
+ });
+ } else {
+ ed.dom.setAttribs(pa, {
+ href : f.link_href.value,
+ title : f.link_title.value,
+ rel : f.link_rel.value,
+ rev : f.link_rev.value,
+ target : f.link_target.value,
+ 'class' : f.link_classes.value,
+ style : f.link_style.value
+ });
+ }
+
+ tinyMCEPopup.execCommand("mceEndUndoLevel");
+ tinyMCEPopup.close();
+ },
+
+ updateStyle : function() {
+ var dom = tinyMCEPopup.dom, st, v, f = document.forms[0];
+
+ if (tinyMCEPopup.editor.settings.inline_styles) {
+ st = tinyMCEPopup.dom.parseStyle(f.img_style.value);
+
+ // Handle align
+ v = f.align.value;
+ if (v) {
+ if (v == 'left' || v == 'right') {
+ st['float'] = v;
+ delete st['vertical-align'];
+ } else {
+ st['vertical-align'] = v;
+ delete st['float'];
+ }
+ } else {
+ delete st['float'];
+ delete st['vertical-align'];
+ }
+
+ // Handle border
+ v = f.border.value;
+ if (v || v == '0') {
+ if (v == '0')
+ st['border'] = '0';
+ else
+ st['border'] = v + 'px solid black';
+ } else
+ delete st['border'];
+
+ // Handle hspace
+ v = f.hspace.value;
+ if (v) {
+ delete st['margin'];
+ st['margin-left'] = v + 'px';
+ st['margin-right'] = v + 'px';
+ } else {
+ delete st['margin-left'];
+ delete st['margin-right'];
+ }
+
+ // Handle vspace
+ v = f.vspace.value;
+ if (v) {
+ delete st['margin'];
+ st['margin-top'] = v + 'px';
+ st['margin-bottom'] = v + 'px';
+ } else {
+ delete st['margin-top'];
+ delete st['margin-bottom'];
+ }
+
+ // Merge
+ st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st));
+ f.img_style.value = dom.serializeStyle(st);
+ }
+ },
+
+ checkVal : function(f) {
+
+ if ( f.value == '' ) {
+ // if ( f.id == 'width' ) f.value = this.width || this.preloadImg.width;
+ // if ( f.id == 'height' ) f.value = this.height || this.preloadImg.height;
+ if ( f.id == 'img_src' ) f.value = this.I('img_demo').src || this.preloadImg.src;
+ }
+ },
+
+ resetImageData : function() {
+ var f = document.forms[0];
+
+ f.width.value = f.height.value = "";
+ },
+
+ updateImageData : function() {
+ var f = document.forms[0], t = wpImage;
+
+ if ( f.width.value == '' || f.height.value == '' ) {
+ f.width.value = t.preloadImg.width;
+ f.height.value = t.preloadImg.height;
+ }
+ t.demoSetSize();
+ },
+
+ getImageData : function() {
+ var t = wpImage, f = document.forms[0];
+
+ t.preloadImg = new Image();
+ t.preloadImg.onload = t.updateImageData;
+ t.preloadImg.onerror = t.resetImageData;
+ t.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.img_src.value);
+ }
+};
+
+window.onload = function(){wpImage.init();}
+wpImage.preInit();
diff --git a/wp-includes/js/tinymce/tiny_mce_config.php b/wp-includes/js/tinymce/tiny_mce_config.php
index f528336a1c..6f7b0cc0bb 100644
--- a/wp-includes/js/tinymce/tiny_mce_config.php
+++ b/wp-includes/js/tinymce/tiny_mce_config.php
@@ -70,7 +70,7 @@ http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker
*/
$mce_spellchecker_languages = apply_filters('mce_spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv');
-$plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen' );
+$plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage' );
/*
The following filter takes an associative array of external plugins for TinyMCE in the form 'plugin_name' => 'url'.
@@ -122,7 +122,7 @@ if ( ! empty($mce_external_plugins) ) {
}
$plugins = implode($plugins, ',');
-$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'image', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' ));
+$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' ));
$mce_buttons = implode($mce_buttons, ',');
$mce_buttons_2 = apply_filters('mce_buttons_2', array('formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'media', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help' ));
@@ -226,7 +226,7 @@ if ( $compress && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
// Setup cache info
if ( $disk_cache ) {
- $cacheKey = apply_filters('tiny_mce_version', '20080602');
+ $cacheKey = apply_filters('tiny_mce_version', '20080606');
foreach ( $initArray as $v )
$cacheKey .= $v;
diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php
index 9258a2dadf..3615d41e1c 100644
--- a/wp-includes/script-loader.php
+++ b/wp-includes/script-loader.php
@@ -35,7 +35,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080325' );
// Modify this version when tinyMCE plugins are changed.
- $mce_version = apply_filters('tiny_mce_version', '20080602');
+ $mce_version = apply_filters('tiny_mce_version', '20080606');
$scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version );
$scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');