TinyMCE: show an error in the console when a plugin attempts to use the 'wpdialogs' plugin but wpdialog.js is not enqueued, fixes #16284

git-svn-id: https://develop.svn.wordpress.org/trunk@28012 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2014-04-07 21:34:18 +00:00
parent f96adcea2d
commit 5706a463bd

View File

@ -29,13 +29,22 @@ tinymce.WPWindowManager = tinymce.InlineWindowManager = function( editor ) {
return;
}
if ( typeof jQuery === 'undefined' || ! jQuery.wp || ! jQuery.wp.wpdialog ) {
// wpdialod.js is not loaded
if ( window.console && window.console.error ) {
window.console.error('wpdialog.js is not loaded. Please set it as dependency for your script when calling wp_enqueue_script().');
}
return;
}
wp.$element = $element = jQuery( '#' + args.id );
if ( ! $element.length ) {
return;
}
if ( window && window.console ) {
if ( window.console && window.console.log ) {
window.console.log('tinymce.WPWindowManager is deprecated. Use the default editor.windowManager to open dialogs with inline HTML.');
}