diff options
Diffstat (limited to 'wp-includes/js')
-rw-r--r-- | wp-includes/js/tinymce/langs/wp-langs.php | 4 | ||||
-rw-r--r-- | wp-includes/js/tinymce/plugins/wpeditimage/editimage.html | 28 | ||||
-rw-r--r-- | wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js | 30 | ||||
-rw-r--r-- | wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js | 30 | ||||
-rw-r--r-- | wp-includes/js/tinymce/tiny_mce_config.php | 5 | ||||
-rw-r--r-- | wp-includes/js/tinymce/wordpress.css | 6 |
6 files changed, 68 insertions, 35 deletions
diff --git a/wp-includes/js/tinymce/langs/wp-langs.php b/wp-includes/js/tinymce/langs/wp-langs.php index f0208f5..75f10a7 100644 --- a/wp-includes/js/tinymce/langs/wp-langs.php +++ b/wp-includes/js/tinymce/langs/wp-langs.php @@ -411,7 +411,6 @@ size:"' . mce_escape( __('Size') ) . '", thumbnail:"' . mce_escape( __('Thumbnail') ) . '", medium:"' . mce_escape( __('Medium') ) . '", full_size:"' . mce_escape( __('Full Size') ) . '", -alt_help:"' . js_escape( __('Alternate text, e.g. "The Mona Lisa"') ) . '", current_link:"' . mce_escape( __('Current Link') ) . '", link_to_img:"' . mce_escape( __('Link to Image') ) . '", link_help:"' . mce_escape( __('Enter a link URL or click above for presets.') ) . '", @@ -435,7 +434,8 @@ s110:"' . mce_escape( __('110%') ) . '", s120:"' . mce_escape( __('120%') ) . '", s130:"' . mce_escape( __('130%') ) . '", img_title:"' . mce_escape( __('Edit Image Title') ) . '", -caption:"' . mce_escape( __('Edit Image Caption') ) . '" +caption:"' . mce_escape( __('Edit Image Caption') ) . '", +alt:"' . mce_escape( __('Edit Alternate Text') ) . '" }); '; ?>
\ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html b/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html index d6adbfc..a9f1c15 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html +++ b/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html @@ -4,11 +4,11 @@ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title></title> -<script type="text/javascript" src="js/editimage.js?ver=311"></script> +<script type="text/javascript" src="js/editimage.js?ver=311d"></script> <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script> -<link rel="stylesheet" href="css/editimage.css?ver=311b" type="text/css" media="all" /> -<link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta1" type="text/css" media="all" /> +<link rel="stylesheet" href="css/editimage.css?ver=311d" type="text/css" media="all" /> +<link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta3" type="text/css" media="all" /> <script type="text/javascript"> if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') ) document.write('<link rel="stylesheet" href="css/editimage-rtl.css?ver=311" type="text/css" media="all" />'); @@ -74,7 +74,7 @@ if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') ) </td> </tr> - <tr class=""> + <tr> <th valign="top" scope="row" class="label"> <label for="img_title"> <span class="alignleft">{#wpeditimage.img_title}</span> @@ -85,19 +85,18 @@ if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') ) </td> </tr> - <tr class="post_excerpt"> + <tr id="cap_field"> <th valign="top" scope="row" class="label"> - <label for="img_alt"> + <label for="img_cap"> <span class="alignleft">{#wpeditimage.caption}</span> </label> </th> <td class="field"> - <input type="text" id="img_alt" name="img_alt" value="" size="60" /> - <p class="help">{#wpeditimage.alt_help}</p> + <input type="text" id="img_cap" name="img_cap" value="" size="60" /> </td> </tr> - <tr class="url"> + <tr> <th valign="top" scope="row" class="label"> <label for="link_href"> <span class="alignleft" id="lb_link_href">{#advanced_dlg.link_url}</span> @@ -129,6 +128,17 @@ if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') ) <input type="text" id="img_src" name="img_src" value="" onblur="wpImage.checkVal(this)" aria-required="true" size="60" /> </td> </tr> + + <tr> + <th valign="top" scope="row" class="label"> + <label for="img_alt"> + <span class="alignleft">{#wpeditimage.alt}</span> + </label> + </th> + <td class="field"> + <input type="text" id="img_alt" name="img_alt" value="" size="60" /> + </td> + </tr> <tr id="img_dim"> <th valign="top" scope="row" class="label"> diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js index de3a972..7dfeca2 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js @@ -15,7 +15,7 @@ if ( ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1 || el.nodeName != 'IMG' ) return; - tb_show('', url + '/editimage.html?ver=311b&TB_iframe=true'); + tb_show('', url + '/editimage.html?ver=311c&TB_iframe=true'); tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); }); @@ -34,9 +34,23 @@ }); ed.onMouseUp.add(function(ed, e) { - if ( ! tinymce.isOpera ) return; - if ( e.target.nodeName == 'IMG' ) - ed.plugins.wpeditimage.showButtons(e.target); + if ( tinymce.isOpera ) { + if ( e.target.nodeName == 'IMG' ) + ed.plugins.wpeditimage.showButtons(e.target); + } else if ( ! tinymce.isWebKit ) { + var n = ed.selection.getNode(), DL; + + if ( n.nodeName == 'IMG' && (DL = ed.dom.getParent(n, 'DL')) ) { + window.setTimeout(function(){ + var ed = tinyMCE.activeEditor, n = ed.selection.getNode(), DL = ed.dom.getParent(n, 'DL'); + + if ( n.width != (parseInt(ed.dom.getStyle(DL, 'width')) - 10) ) { + ed.dom.setStyle(DL, 'width', parseInt(n.width)+10); + ed.execCommand('mceRepaint'); + } + }, 100); + } + } }); ed.onMouseDown.add(function(ed, e) { @@ -73,7 +87,7 @@ }, _do_shcode : function(co) { - return co.replace(/\[wp_caption([^\]]+)\]([\s\S]+?)\[\/wp_caption\][\s\u00a0]*/g, function(a,b,c){ + return co.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g, function(a,b,c){ b = b.replace(/\\'|\\'|\\'/g, ''').replace(/\\"|\\"/g, '"'); c = c.replace(/\\'|\\'/g, ''').replace(/\\"/g, '"'); var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/align=['"]([^'"]+)/i); @@ -87,8 +101,8 @@ 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>'; + 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>'; }); }, @@ -105,7 +119,7 @@ cls = cls.match(/align[^ '"]+/) || 'alignnone'; cap = cap.replace(/<\S[^<>]*>/gi, '').replace(/'/g, ''').replace(/"/g, '"'); - return '[wp_caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/wp_caption]'; + return '[caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/caption]'; }); }, diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js index fb1d2d8..1986a13 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js @@ -245,8 +245,12 @@ 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, DL, caption; + 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 = null; document.dir = tinyMCEPopup.editor.getParam('directionality',''); + + if ( ! tinyMCEPopup.editor.getParam('wpeditimage_do_captions', true) ) + t.I('cap_field').style.display = 'none'; + tinyMCEPopup.restoreSelection(); el = ed.selection.getNode(); if (el.nodeName != 'IMG') return; @@ -255,24 +259,26 @@ var wpImage = { 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 ( dlc && ! dom.hasClass(el, dlc) ) + if ( dlc && ! dom.hasClass(el, dlc) ) { c += ' '+dlc; + tinymce.trim(c); + } tinymce.each(DL.childNodes, function(e) { - if ( e.nodeName == 'DD' && dom.hasClass(e, 'wp_caption_dd') ) { + if ( e.nodeName == 'DD' && dom.hasClass(e, 'wp-caption-dd') ) { caption = e.innerHTML; return; } }); } + f.img_cap.value = caption; f.img_title.value = ed.dom.getAttrib(el, 'title'); - f.img_alt.value = caption; + 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'); @@ -355,7 +361,7 @@ var wpImage = { return; } - if ( f.img_alt.value != '' && f.width.value != '' ) { + if ( f.img_cap.value != '' && f.width.value != '' ) { do_caption = 1; img_class = img_class.replace( /align[^ "']+\s?/gi, '' ); } @@ -370,7 +376,7 @@ var wpImage = { ed.dom.setAttribs(el, { src : f.img_src.value, title : f.img_title.value, - alt : t.img_alt, + alt : f.img_alt.value, width : f.width.value, height : f.height.value, style : f.img_style.value, @@ -421,15 +427,15 @@ var wpImage = { if ( DL ) { ed.dom.setAttribs(DL, { - 'class' : 'wp_caption '+t.align, + '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); + if ( (DT = ed.dom.getParent(el, 'dt')) && (DD = DT.nextSibling) && ed.dom.hasClass(DD, 'wp-caption-dd') ) + ed.dom.setHTML(DD, f.img_cap.value); } else { var lnk = '', pa; @@ -446,8 +452,8 @@ var wpImage = { } } 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>'; + 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_cap.value+'</dd></dl>'; cap = ed.dom.create('div', {'class': div_cls}, html); diff --git a/wp-includes/js/tinymce/tiny_mce_config.php b/wp-includes/js/tinymce/tiny_mce_config.php index 665c4ce..5a8e4c4 100644 --- a/wp-includes/js/tinymce/tiny_mce_config.php +++ b/wp-includes/js/tinymce/tiny_mce_config.php @@ -130,6 +130,8 @@ $mce_buttons_3 = implode($mce_buttons_3, ','); $mce_buttons_4 = apply_filters('mce_buttons_4', array()); $mce_buttons_4 = implode($mce_buttons_4, ','); +$do_captions = ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ? false : true; + // TinyMCE init settings $initArray = array ( 'mode' => 'none', @@ -163,6 +165,7 @@ $initArray = array ( 'tab_focus' => ':next', 'content_css' => "$mce_css", 'save_callback' => 'switchEditors.saveCallback', + 'wpeditimage_do_captions' => $do_captions, 'plugins' => "$plugins", // pass-through the settings for compression and caching, so they can be changed with "tiny_mce_before_init" 'disk_cache' => true, @@ -222,7 +225,7 @@ if ( $compress && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) { // Setup cache info if ( $disk_cache ) { - $cacheKey = apply_filters('tiny_mce_version', '20080708'); + $cacheKey = apply_filters('tiny_mce_version', '20080710'); foreach ( $initArray as $v ) $cacheKey .= $v; diff --git a/wp-includes/js/tinymce/wordpress.css b/wp-includes/js/tinymce/wordpress.css index 0b55d4e..2348d12 100644 --- a/wp-includes/js/tinymce/wordpress.css +++ b/wp-includes/js/tinymce/wordpress.css @@ -15,7 +15,7 @@ dl.aligncenter { float: right; } -.wp_caption { +.wp-caption { border: 1px solid #ddd; text-align: center; background-color: #f3f3f3; @@ -27,13 +27,13 @@ dl.aligncenter { border-radius: 3px; } -.wp_caption img { +.wp-caption img { margin: 0; padding: 0; border: 0 none; } -.wp_caption_dd { +.wp-caption-dd { font-size: 11px; line-height: 17px; padding: 0 4px 5px; |