wp/wp-includes/js/tinymce/plugins/wpdialogs/plugin.js
changeset 16 a86126ab1dd4
parent 5 5e2f62d02dcd
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
    28 		} else if ( ! args.id ) {
    28 		} else if ( ! args.id ) {
    29 			return;
    29 			return;
    30 		}
    30 		}
    31 
    31 
    32 		if ( typeof jQuery === 'undefined' || ! jQuery.wp || ! jQuery.wp.wpdialog ) {
    32 		if ( typeof jQuery === 'undefined' || ! jQuery.wp || ! jQuery.wp.wpdialog ) {
    33 			// wpdialog.js is not loaded
    33 			// wpdialog.js is not loaded.
    34 			if ( window.console && window.console.error ) {
    34 			if ( window.console && window.console.error ) {
    35 				window.console.error('wpdialog.js is not loaded. Please set "wpdialogs" as dependency for your script when calling wp_enqueue_script(). You may also want to enqueue the "wp-jquery-ui-dialog" stylesheet.');
    35 				window.console.error('wpdialog.js is not loaded. Please set "wpdialogs" as dependency for your script when calling wp_enqueue_script(). You may also want to enqueue the "wp-jquery-ui-dialog" stylesheet.');
    36 			}
    36 			}
    37 
    37 
    38 			return;
    38 			return;
    52 		wp.params = params;
    52 		wp.params = params;
    53 
    53 
    54 		// Store selection. Takes a snapshot in the FocusManager of the selection before focus is moved to the dialog.
    54 		// Store selection. Takes a snapshot in the FocusManager of the selection before focus is moved to the dialog.
    55 		editor.nodeChanged();
    55 		editor.nodeChanged();
    56 
    56 
    57 		// Create the dialog if necessary
    57 		// Create the dialog if necessary.
    58 		if ( ! $element.data('wpdialog') ) {
    58 		if ( ! $element.data('wpdialog') ) {
    59 			$element.wpdialog({
    59 			$element.wpdialog({
    60 				title: args.title,
    60 				title: args.title,
    61 				width: args.width,
    61 				width: args.width,
    62 				height: args.height,
    62 				height: args.height,
    83 		this.wp.$element.wpdialog('close');
    83 		this.wp.$element.wpdialog('close');
    84 	};
    84 	};
    85 };
    85 };
    86 
    86 
    87 tinymce.PluginManager.add( 'wpdialogs', function( editor ) {
    87 tinymce.PluginManager.add( 'wpdialogs', function( editor ) {
    88 	// Replace window manager
    88 	// Replace window manager.
    89 	editor.on( 'init', function() {
    89 	editor.on( 'init', function() {
    90 		editor.windowManager = new tinymce.WPWindowManager( editor );
    90 		editor.windowManager = new tinymce.WPWindowManager( editor );
    91 	});
    91 	});
    92 });
    92 });