From 00b7fa589a095639f33dd6090ea3f0f11a1901a6 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 22 Apr 2013 20:17:25 +0000 Subject: [PATCH] Remove ancient 'lookup' quicktag from the text editor. This had called up answers.com. props mboynes, jonbishop, SergeyBiryukov. fixes #23322. git-svn-id: http://core.svn.wordpress.org/trunk@24052 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-comment.php | 2 +- wp-admin/includes/media.php | 2 +- wp-admin/includes/template.php | 2 +- wp-includes/class-wp-editor.php | 2 +- wp-includes/js/quicktags.js | 37 ++++----------------------------- wp-includes/script-loader.php | 3 --- 6 files changed, 8 insertions(+), 40 deletions(-) diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php index a6bafc19fa..d9a0523edf 100644 --- a/wp-admin/edit-form-comment.php +++ b/wp-admin/edit-form-comment.php @@ -63,7 +63,7 @@ if ( !defined('ABSPATH') )
'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' ); + $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' ); wp_editor( $comment->comment_content, 'content', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings ) ); wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 59a27fdcc2..3bdbc5254d 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -2395,7 +2395,7 @@ function edit_form_image_editor() { 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' ); + $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' ); $editor_args = array( 'textarea_name' => 'content', 'textarea_rows' => 5, diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 51f7cc12e5..05acd8de63 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -345,7 +345,7 @@ function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single',
'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' ); + $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' ); wp_editor( '', 'replycontent', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings ) ); ?>
diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php index da5ebb5049..6f3a56709b 100644 --- a/wp-includes/class-wp-editor.php +++ b/wp-includes/class-wp-editor.php @@ -176,7 +176,7 @@ final class _WP_Editors { $qtInit = array_merge($qtInit, $set['quicktags']); if ( empty($qtInit['buttons']) ) - $qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close'; + $qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close'; if ( $set['dfw'] ) $qtInit['buttons'] .= ',fullscreen'; diff --git a/wp-includes/js/quicktags.js b/wp-includes/js/quicktags.js index cb4d2bee07..5a60278ea3 100644 --- a/wp-includes/js/quicktags.js +++ b/wp-includes/js/quicktags.js @@ -8,7 +8,7 @@ * settings = { * id : 'my_id', the HTML ID of the textarea, required * buttons: '' Comma separated list of the names of the default buttons to show. Optional. - * Current list of default button names: 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close'; + * Current list of default button names: 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close'; * } * * The settings can also be a string quicktags_id. @@ -229,7 +229,7 @@ function edButton(id, display, tagStart, tagEnd, access, open) { qt._buttonsInit = function() { var t = this, canvas, name, settings, theButtons, html, inst, ed, id, i, use, - defaults = ',strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close,'; + defaults = ',strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,'; for ( inst in t.instances ) { if ( inst == 0 ) @@ -499,36 +499,8 @@ function edButton(id, display, tagStart, tagEnd, access, open) { } }; - // the spell button - qt.SpellButton = function() { - qt.Button.call(this, 'spell', quicktagsL10n.lookup, '', quicktagsL10n.dictionaryLookup); - }; - qt.SpellButton.prototype = new qt.Button(); - qt.SpellButton.prototype.callback = function(element, canvas, ed) { - var word = '', sel, startPos, endPos; - - if ( document.selection ) { - canvas.focus(); - sel = document.selection.createRange(); - if ( sel.text.length > 0 ) { - word = sel.text; - } - } else if ( canvas.selectionStart || canvas.selectionStart == '0' ) { - startPos = canvas.selectionStart; - endPos = canvas.selectionEnd; - if ( startPos != endPos ) { - word = canvas.value.substring(startPos, endPos); - } - } - - if ( word === '' ) { - word = prompt(quicktagsL10n.wordLookup, ''); - } - - if ( word !== null && /^\w[\w ]*$/.test(word)) { - window.open('http://www.answers.com/' + encodeURIComponent(word)); - } - }; + // removed + qt.SpellButton = function() {}; // the close tags button qt.CloseButton = function() { @@ -643,7 +615,6 @@ function edButton(id, display, tagStart, tagEnd, access, open) { edButtons[100] = new qt.TagButton('li','li','\t
  • ','
  • \n','l'), edButtons[110] = new qt.TagButton('code','code','','','c'), edButtons[120] = new qt.TagButton('more','more','','','t'), - edButtons[130] = new qt.SpellButton(), edButtons[140] = new qt.CloseButton() })(); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 65fb36c663..ecffd6b520 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -75,9 +75,6 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'quicktags', "/wp-includes/js/quicktags$suffix.js", array(), false, 1 ); did_action( 'init' ) && $scripts->localize( 'quicktags', 'quicktagsL10n', array( - 'wordLookup' => __('Enter a word to look up:'), - 'dictionaryLookup' => esc_attr(__('Dictionary lookup')), - 'lookup' => esc_attr(__('lookup')), 'closeAllOpenTags' => esc_attr(__('Close all open tags')), 'closeTags' => esc_attr(__('close tags')), 'enterURL' => __('Enter the URL'),