X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/11be8dc178e77d0b46189bbd8e33a216a9b90942..0f74cdeda4c069bfbb9c4131ef1352f55b6f8499:/wp-admin/js/common.js diff --git a/wp-admin/js/common.js b/wp-admin/js/common.js index 67e38d81..867f1119 100644 --- a/wp-admin/js/common.js +++ b/wp-admin/js/common.js @@ -1,395 +1,1010 @@ +/* global setUserSetting, ajaxurl, commonL10n, alert, confirm, pagenow */ +var showNotice, adminMenu, columns, validateForm, screenMeta; +( function( $, window, undefined ) { + var $document = $( document ), + $window = $( window ), + $body = $( document.body ); + +// Removed in 3.3. +// (perhaps) needed for back-compat +adminMenu = { + init : function() {}, + fold : function() {}, + restoreMenuState : function() {}, + toggle : function() {}, + favorites : function() {} +}; -var wpCookies = { -// The following functions are from Cookie.js class in TinyMCE, Moxiecode, used under LGPL. +// show/hide/save table columns +columns = { + init : function() { + var that = this; + $('.hide-column-tog', '#adv-settings').click( function() { + var $t = $(this), column = $t.val(); + if ( $t.prop('checked') ) + that.checked(column); + else + that.unchecked(column); - each : function(o, cb, s) { - var n, l; + columns.saveManageColumnsState(); + }); + }, - if (!o) - return 0; + saveManageColumnsState : function() { + var hidden = this.hidden(); + $.post(ajaxurl, { + action: 'hidden-columns', + hidden: hidden, + screenoptionnonce: $('#screenoptionnonce').val(), + page: pagenow + }); + }, - s = s || o; + checked : function(column) { + $('.column-' + column).removeClass( 'hidden' ); + this.colSpanChange(+1); + }, - if (typeof(o.length) != 'undefined') { - for (n=0, l = o.length; n