More quicktags back-compat, see #16695

git-svn-id: https://develop.svn.wordpress.org/trunk@18628 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2011-09-02 20:40:47 +00:00
parent 8094c89b39
commit 1205b09cf6
3 changed files with 26 additions and 3 deletions

View File

@ -55,6 +55,25 @@ function edButton(id, display, tagStart, tagEnd, access, open) {
return QTags.addButton( id, display, tagStart, tagEnd, open, access, '', -1 );
}
/**
* Back-compat
*
* Define all former global functions so plugins that hask quicktags.js directly don't cause fatal errors.
*/
var edAddTag = function(){},
edCheckOpenTags = function(){},
edCloseAllTags = function(){},
edInsertImage = function(){},
edInsertLink = function(){},
edInsertTag = function(){},
edLink = function(){},
edQuickLink = function(){},
edRemoveTag = function(){},
edShowButton = function(){},
edShowLinks = function(){},
edSpell = function(){},
edToolbar = function(){};
(function(){
// private stuff is prefixed with an underscore
var _domReady = function(func) {
@ -269,8 +288,12 @@ function edButton(id, display, tagStart, tagEnd, access, open) {
}
}
for ( i in theButtons )
for ( i in theButtons ) {
if ( !theButtons[i] || !theButtons[i].html )
continue;
html += theButtons[i].html(name + '_');
}
instance.toolbar.innerHTML = html;
instance.theButtons = theButtons;

File diff suppressed because one or more lines are too long

View File

@ -68,7 +68,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'sack', "/wp-includes/js/tw-sack$suffix.js", false, '1.6.1', 1 );
$scripts->add( 'quicktags', "/wp-includes/js/quicktags$suffix.js", false, '20110828', 1 );
$scripts->add( 'quicktags', "/wp-includes/js/quicktags$suffix.js", false, '20110902', 1 );
$scripts->add_script_data( 'quicktags', 'quicktagsL10n', array(
'wordLookup' => __('Enter a word to look up:'),
'dictionaryLookup' => esc_attr(__('Dictionary lookup')),