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
This commit is contained in:
Andrew Nacin 2013-04-22 20:17:25 +00:00
parent f1aeebf00b
commit 00b7fa589a
6 changed files with 8 additions and 40 deletions

View File

@ -63,7 +63,7 @@ if ( !defined('ABSPATH') )
<div id="postdiv" class="postarea">
<?php
$quicktags_settings = array( 'buttons' => '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 ); ?>
</div>

View File

@ -2395,7 +2395,7 @@ function edit_form_image_editor() {
<?php endif; ?>
<?php
$quicktags_settings = array( 'buttons' => '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,

View File

@ -345,7 +345,7 @@ function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single',
<div id="replycontainer">
<?php
$quicktags_settings = array( 'buttons' => '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 ) );
?>
</div>

View File

@ -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';

View File

@ -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<li>','</li>\n','l'),
edButtons[110] = new qt.TagButton('code','code','<code>','</code>','c'),
edButtons[120] = new qt.TagButton('more','more','<!--more-->','','t'),
edButtons[130] = new qt.SpellButton(),
edButtons[140] = new qt.CloseButton()
})();

View File

@ -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'),