Ticket #7863: 7863.diff
| File 7863.diff, 2.8 KB (added by , 17 years ago) |
|---|
-
wp-includes/script-loader.php
222 222 'saveText' => attribute_escape(__('Save »')), 223 223 'confirmText' => __("Are you sure you want to delete the file '%title%'?\nClick ok to delete or cancel to go back.") 224 224 ) ); 225 $scripts->add( 'admin-widgets', '/wp-admin/js/widgets.js', array( 'interface' ), '2008 0503' );225 $scripts->add( 'admin-widgets', '/wp-admin/js/widgets.js', array( 'interface' ), '20081010' ); 226 226 $scripts->localize( 'admin-widgets', 'widgetsL10n', array( 227 227 'add' => __('Add'), 228 228 'edit' => __('Edit'), 229 229 'cancel' => __('Cancel'), 230 'lameReminder' => __('Remember to click the "Save Changes" button at the bottom of the Current Widgets column after you\'re all done!'), 231 'lamerReminder' => __("You're about to leave without having saved your changes!") 230 232 )); 231 233 232 234 $scripts->add( 'word-count', '/wp-admin/js/word-count.js', array( 'jquery' ), '20080423' ); -
wp-admin/includes/widgets.php
305 305 306 306 <?php if ( $control ) : ?> 307 307 308 <a class="widget-action widget-control-save hide-if-no-js edit alignleft" href="#save:<?php echo $id_format; ?>"><?php _e(' Change'); ?></a>308 <a class="widget-action widget-control-save hide-if-no-js edit alignleft" href="#save:<?php echo $id_format; ?>"><?php _e('Done'); ?></a> 309 309 310 310 <?php endif; ?> 311 311 -
wp-admin/js/widgets.js
1 1 jQuery(function($) { 2 2 $('.noscript-action').remove(); 3 3 4 var reminded = false; 5 var lameWidgetReminder = function() { 6 if ( reminded ) 7 return; 8 window.onbeforeunload = function () { return widgetsL10n.lamerReminder }; 9 $('div.wrap:first').prepend( '<div class="updated" style="display:none"><p>' + widgetsL10n.lameReminder + '</p></div>' ).children( ':first' ).slideDown(); 10 $('#current-widgets .submit input[name=save-widgets]').css( 'background-color', '#ffffe0' ).click( function() { 11 window.onbeforeunload = null; 12 } ); 13 reminded = true; 14 }; 15 4 16 var increment = 1; 5 17 6 18 // Open or close widget control form … … 84 96 var n = parseInt( $('#widget-count').text(), 10 ) + 1; 85 97 $('#widget-count').text( n.toString() ) 86 98 99 lameWidgetReminder(); 87 100 return false; 88 101 }; 89 102 … … 96 109 97 110 // onclick for save links 98 111 $('a.widget-control-save', context).click( function() { 112 lameWidgetReminder(); 99 113 toggleWidget( $(this).parents('li:first'), false ).blur() 100 114 return false; 101 115 } );