WordPress.org

Make WordPress Core

Changeset 10869


Ignore:
Timestamp:
04/04/09 17:07:31 (6 years ago)
Author:
azaozz
Message:

Improved no-js styles

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r10868 r10869  
    6060 
    6161$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix); 
    62 ?> 
    6362 
    64 <noscript> 
    65 <style type="text/css"> 
    66 .hide-if-no-js{display:none} 
    67 .hide-if-js,.closed .inside{display:block} 
    68 </style> 
    69 </noscript> 
     63if ( $is_iphone ) { ?> 
     64<style type="text/css">.row-actions{visibility:visible;}</style> 
     65<?php } ?> 
     66</head> 
     67<body class="wp-admin no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>"> 
    7068<script type="text/javascript"> 
    7169//<![CDATA[ 
    7270(function(){ 
    73     var ns = document.getElementsByTagName('noscript'); 
    74     if ( ns && (ns = ns[0]) ) ns.parentNode.removeChild(ns); 
     71var c = document.body.className; 
     72c = c.replace(/no-js/, 'js'); 
     73<?php if ( get_user_setting('mfold') == 'f' ) { ?> 
     74c += ' folded'; 
     75<?php } ?> 
     76document.body.className = c; 
    7577})(); 
    7678//]]> 
    7779</script> 
    78  
    79 <?php if ( $is_iphone ) { ?> 
    80 <style type="text/css">.row-actions{visibility:visible;}</style> 
    81 <?php } ?> 
    82 </head> 
    83 <body class="wp-admin <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>"> 
    8480 
    8581<div id="wpwrap"> 
     
    119115</div> 
    120116 
    121 <?php if ( get_user_setting('mfold') == 'f' ) { ?> 
    122 <script type="text/javascript">jQuery('#wpcontent').addClass('folded');</script> 
    123 <?php } ?> 
    124  
    125117<div id="wpbody"> 
    126118<?php require(ABSPATH . 'wp-admin/menu-header.php'); ?> 
  • trunk/wp-admin/css/global.css

    r10865 r10869  
    186186 
    187187.hidden, 
    188 .closed .inside, 
    189 .hide-if-js { 
     188.js .closed .inside, 
     189.js .hide-if-js, 
     190.no-js .hide-if-no-js { 
    190191    display: none; 
    191192} 
  • trunk/wp-admin/css/ie.css

    r10843 r10869  
    4343} 
    4444 
    45 * html div.folded #adminmenu { 
     45* html .folded #adminmenu { 
    4646    margin-left: -22px; 
    4747} 
     
    5757} 
    5858 
    59 #wpcontent.folded #adminmenu li.menu-top { 
    60     display: block; 
     59.folded #adminmenu li.menu-top { 
     60    display: block; 
     61    zoom: 100%; 
    6162} 
    6263 
     
    101102} 
    102103 
    103 #wpcontent.folded #adminmenu li.wp-menu-separator { 
     104.folded #adminmenu li.wp-menu-separator { 
    104105    width: 28px; 
    105106} 
     
    110111} 
    111112 
    112 #wpcontent.folded #adminmenu .menu-top { 
     113.folded #adminmenu .menu-top { 
    113114    height: 30px; 
    114115} 
  • trunk/wp-admin/js/common.dev.js

    r10848 r10869  
    1515 
    1616        $('.wp-menu-separator').click(function(){ 
    17             if ( $('#wpcontent').hasClass('folded') ) { 
     17            if ( $('body').hasClass('folded') ) { 
    1818                adminMenu.fold(1); 
    1919                setUserSetting( 'mfold', 'o' ); 
     
    5555    fold : function(off) { 
    5656        if (off) { 
    57             $('#wpcontent').removeClass('folded'); 
     57            $('body').removeClass('folded'); 
    5858            $('#adminmenu li.wp-has-submenu').unbind(); 
    5959        } else { 
    60             $('#wpcontent').addClass('folded'); 
     60            $('body').addClass('folded'); 
    6161            $('#adminmenu li.wp-has-submenu').hoverIntent({ 
    6262                over: function(e){ 
     
    120120    init : function() { 
    121121        $('.screen-option').change(function() { 
    122             var option = $(this).map(function() { return this.id; }).get(); 
    123             var value = $(this).val(); 
     122            var option = $(this).map(function() { return this.id; }).get(), value = $(this).val(); 
    124123            screenOptions.save_screen_option(option, value); 
    125124        }); 
    126125        $('.screen-option').submit(function() { 
    127             var option = $(this).map(function() { return this.id; }).get(); 
    128             var value = $(this).val(); 
     126            var option = $(this).map(function() { return this.id; }).get(), value = $(this).val(); 
    129127            screenOptions.save_screen_option(option, value); 
    130128        }); 
  • trunk/wp-admin/js/common.js

    r10848 r10869  
    1 var showNotice,adminMenu,columns;(function(a){adminMenu={init:function(){a("#adminmenu div.wp-menu-toggle").each(function(){if(a(this).siblings(".wp-submenu").length){a(this).click(function(){adminMenu.toggle(a(this).siblings(".wp-submenu"))})}else{a(this).hide()}});a("#adminmenu li.menu-top .wp-menu-image").click(function(){window.location=a(this).siblings("a.menu-top")[0].href});this.favorites();a(".wp-menu-separator").click(function(){if(a("#wpcontent").hasClass("folded")){adminMenu.fold(1);setUserSetting("mfold","o")}else{adminMenu.fold();setUserSetting("mfold","f")}});if("f"!=getUserSetting("mfold")){this.restoreMenuState()}else{this.fold()}},restoreMenuState:function(){a("#adminmenu li.wp-has-submenu").each(function(c,d){var b=getUserSetting("m"+c);if(a(d).hasClass("wp-has-current-submenu")){return true}if("o"==b){a(d).addClass("wp-menu-open")}else{if("c"==b){a(d).removeClass("wp-menu-open")}}})},toggle:function(b){b.slideToggle(150,function(){b.css("display","")}).parent().toggleClass("wp-menu-open");a("#adminmenu li.wp-has-submenu").each(function(d,f){var c=a(f).hasClass("wp-menu-open")?"o":"c";setUserSetting("m"+d,c)});return false},fold:function(b){if(b){a("#wpcontent").removeClass("folded");a("#adminmenu li.wp-has-submenu").unbind()}else{a("#wpcontent").addClass("folded");a("#adminmenu li.wp-has-submenu").hoverIntent({over:function(i){var c=a(this).find(".wp-submenu"),f=i.clientY,d=a(window).height(),g=c.height(),j;if((f+g+10)>d){j=(f+g+10)-d;c.css({marginTop:"-"+j+"px"})}else{if(c.css("marginTop")){c.css({marginTop:""})}}c.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open").css({marginTop:""})},timeout:220,sensitivity:8,interval:100})}},favorites:function(){a("#favorite-inside").width(a("#favorite-actions").width()-4);a("#favorite-toggle, #favorite-inside").bind("mouseenter",function(){a("#favorite-inside").removeClass("slideUp").addClass("slideDown");setTimeout(function(){if(a("#favorite-inside").hasClass("slideDown")){a("#favorite-inside").slideDown(100);a("#favorite-first").addClass("slide-down")}},200)});a("#favorite-toggle, #favorite-inside").bind("mouseleave",function(){a("#favorite-inside").removeClass("slideDown").addClass("slideUp");setTimeout(function(){if(a("#favorite-inside").hasClass("slideUp")){a("#favorite-inside").slideUp(100,function(){a("#favorite-first").removeClass("slide-down")})}},300)})}};a(document).ready(function(){adminMenu.init()});columns={init:function(){a(".hide-column-tog").click(function(){var c=a(this).val(),b=a(this).attr("checked");if(b){a(".column-"+c).show()}else{a(".column-"+c).hide()}columns.save_manage_columns_state()})},save_manage_columns_state:function(){var b=a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(ajaxurl,{action:"hidden-columns",hidden:b,hiddencolumnsnonce:a("#hiddencolumnsnonce").val(),page:pagenow})}};a(document).ready(function(){columns.init()});screenOptions={init:function(){a(".screen-option").change(function(){var b=a(this).map(function(){return this.id}).get();var c=a(this).val();screenOptions.save_screen_option(b,c)});a(".screen-option").submit(function(){var b=a(this).map(function(){return this.id}).get();var c=a(this).val();screenOptions.save_screen_option(b,c)})},save_screen_option:function(b,c){a.post(ajaxurl,{action:"set-screen-option",option:b,value:c,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})}};a(document).ready(function(){screenOptions.init()})})(jQuery);showNotice={warn:function(){var a=commonL10n.warnDelete||"";if(confirm(a)){return true}return false},note:function(a){alert(a)}};jQuery(document).ready(function(d){var f=false,a,e,c,b;d(".fade").animate({backgroundColor:"#ffffe0"},300).animate({backgroundColor:"#fffbcc"},300).animate({backgroundColor:"#ffffe0"},300).animate({backgroundColor:"#fffbcc"},300);d("div.wrap h2 ~ div.updated, div.wrap h2 ~ div.error").addClass("below-h2");d("div.updated, div.error").not(".below-h2").insertAfter("div.wrap h2:first");d("#doaction, #doaction2").click(function(){if(d('select[name^="action"]').val()=="delete"){return showNotice.warn()}});d("#show-settings-link").click(function(){if(!d("#screen-options-wrap").hasClass("screen-options-open")){d("#contextual-help-link-wrap").addClass("invisible")}d("#screen-options-wrap").slideToggle("fast",function(){if(d(this).hasClass("screen-options-open")){d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#contextual-help-link-wrap").removeClass("invisible");d(this).removeClass("screen-options-open")}else{d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("screen-options-open")}});return false});d("#contextual-help-link").click(function(){if(!d("#contextual-help-wrap").hasClass("contextual-help-open")){d("#screen-options-link-wrap").addClass("invisible")}d("#contextual-help-wrap").slideToggle("fast",function(){if(d(this).hasClass("contextual-help-open")){d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#screen-options-link-wrap").removeClass("invisible");d(this).removeClass("contextual-help-open")}else{d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("contextual-help-open")}});return false});d("#contextual-help-link-wrap, #screen-options-link-wrap").show();d("table:visible tbody .check-column :checkbox").click(function(g){if("undefined"==g.shiftKey){return true}if(g.shiftKey){if(!f){return true}a=d(f).parents("form:first").find(":checkbox");e=a.index(f);c=a.index(this);b=d(this).attr("checked");if(0<e&&0<c&&e!=c){a.slice(e,c).attr("checked",function(){if(d(this).parents("tr").is(":visible")){return b?"checked":""}return""})}}f=this;return true});d("thead :checkbox, tfoot :checkbox").click(function(i){var j=d(this).attr("checked"),h="undefined"==typeof toggleWithKeyboard?false:toggleWithKeyboard,g=i.shiftKey||h;d(this).parents("form:first").find("table tbody:visible").find(".check-column :checkbox").attr("checked",function(){if(d(this).parents("tr").is(":hidden")){return""}if(g){return d(this).attr("checked")?"":"checked"}else{if(j){return"checked"}}return""});d(this).parents("form:first").find("table thead:visible, table tfoot:visible").find(".check-column :checkbox").attr("checked",function(){if(g){return""}else{if(j){return"checked"}}return""})})});(function(){if("undefined"!=typeof google&&google.gears){return}var a=false;if("undefined"!=typeof GearsFactory){a=new GearsFactory()}else{try{a=new ActiveXObject("Gears.Factory");if(factory.getBuildInfo().indexOf("ie_mobile")!=-1){a.privateSetGlobalObject(this)}}catch(b){if(("undefined"!=typeof navigator.mimeTypes)&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a)}}}if(a&&a.hasPermission){return}jQuery(".turbo-nag").show()})(); 
     1var showNotice,adminMenu,columns;(function(a){adminMenu={init:function(){a("#adminmenu div.wp-menu-toggle").each(function(){if(a(this).siblings(".wp-submenu").length){a(this).click(function(){adminMenu.toggle(a(this).siblings(".wp-submenu"))})}else{a(this).hide()}});a("#adminmenu li.menu-top .wp-menu-image").click(function(){window.location=a(this).siblings("a.menu-top")[0].href});this.favorites();a(".wp-menu-separator").click(function(){if(a("body").hasClass("folded")){adminMenu.fold(1);setUserSetting("mfold","o")}else{adminMenu.fold();setUserSetting("mfold","f")}});if("f"!=getUserSetting("mfold")){this.restoreMenuState()}else{this.fold()}},restoreMenuState:function(){a("#adminmenu li.wp-has-submenu").each(function(c,d){var b=getUserSetting("m"+c);if(a(d).hasClass("wp-has-current-submenu")){return true}if("o"==b){a(d).addClass("wp-menu-open")}else{if("c"==b){a(d).removeClass("wp-menu-open")}}})},toggle:function(b){b.slideToggle(150,function(){b.css("display","")}).parent().toggleClass("wp-menu-open");a("#adminmenu li.wp-has-submenu").each(function(d,f){var c=a(f).hasClass("wp-menu-open")?"o":"c";setUserSetting("m"+d,c)});return false},fold:function(b){if(b){a("body").removeClass("folded");a("#adminmenu li.wp-has-submenu").unbind()}else{a("body").addClass("folded");a("#adminmenu li.wp-has-submenu").hoverIntent({over:function(i){var c=a(this).find(".wp-submenu"),f=i.clientY,d=a(window).height(),g=c.height(),j;if((f+g+10)>d){j=(f+g+10)-d;c.css({marginTop:"-"+j+"px"})}else{if(c.css("marginTop")){c.css({marginTop:""})}}c.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open").css({marginTop:""})},timeout:220,sensitivity:8,interval:100})}},favorites:function(){a("#favorite-inside").width(a("#favorite-actions").width()-4);a("#favorite-toggle, #favorite-inside").bind("mouseenter",function(){a("#favorite-inside").removeClass("slideUp").addClass("slideDown");setTimeout(function(){if(a("#favorite-inside").hasClass("slideDown")){a("#favorite-inside").slideDown(100);a("#favorite-first").addClass("slide-down")}},200)});a("#favorite-toggle, #favorite-inside").bind("mouseleave",function(){a("#favorite-inside").removeClass("slideDown").addClass("slideUp");setTimeout(function(){if(a("#favorite-inside").hasClass("slideUp")){a("#favorite-inside").slideUp(100,function(){a("#favorite-first").removeClass("slide-down")})}},300)})}};a(document).ready(function(){adminMenu.init()});columns={init:function(){a(".hide-column-tog").click(function(){var c=a(this).val(),b=a(this).attr("checked");if(b){a(".column-"+c).show()}else{a(".column-"+c).hide()}columns.save_manage_columns_state()})},save_manage_columns_state:function(){var b=a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(ajaxurl,{action:"hidden-columns",hidden:b,hiddencolumnsnonce:a("#hiddencolumnsnonce").val(),page:pagenow})}};a(document).ready(function(){columns.init()});screenOptions={init:function(){a(".screen-option").change(function(){var b=a(this).map(function(){return this.id}).get(),c=a(this).val();screenOptions.save_screen_option(b,c)});a(".screen-option").submit(function(){var b=a(this).map(function(){return this.id}).get(),c=a(this).val();screenOptions.save_screen_option(b,c)})},save_screen_option:function(b,c){a.post(ajaxurl,{action:"set-screen-option",option:b,value:c,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})}};a(document).ready(function(){screenOptions.init()})})(jQuery);showNotice={warn:function(){var a=commonL10n.warnDelete||"";if(confirm(a)){return true}return false},note:function(a){alert(a)}};jQuery(document).ready(function(d){var f=false,a,e,c,b;d(".fade").animate({backgroundColor:"#ffffe0"},300).animate({backgroundColor:"#fffbcc"},300).animate({backgroundColor:"#ffffe0"},300).animate({backgroundColor:"#fffbcc"},300);d("div.wrap h2 ~ div.updated, div.wrap h2 ~ div.error").addClass("below-h2");d("div.updated, div.error").not(".below-h2").insertAfter("div.wrap h2:first");d("#doaction, #doaction2").click(function(){if(d('select[name^="action"]').val()=="delete"){return showNotice.warn()}});d("#show-settings-link").click(function(){if(!d("#screen-options-wrap").hasClass("screen-options-open")){d("#contextual-help-link-wrap").addClass("invisible")}d("#screen-options-wrap").slideToggle("fast",function(){if(d(this).hasClass("screen-options-open")){d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#contextual-help-link-wrap").removeClass("invisible");d(this).removeClass("screen-options-open")}else{d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("screen-options-open")}});return false});d("#contextual-help-link").click(function(){if(!d("#contextual-help-wrap").hasClass("contextual-help-open")){d("#screen-options-link-wrap").addClass("invisible")}d("#contextual-help-wrap").slideToggle("fast",function(){if(d(this).hasClass("contextual-help-open")){d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#screen-options-link-wrap").removeClass("invisible");d(this).removeClass("contextual-help-open")}else{d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("contextual-help-open")}});return false});d("#contextual-help-link-wrap, #screen-options-link-wrap").show();d("table:visible tbody .check-column :checkbox").click(function(g){if("undefined"==g.shiftKey){return true}if(g.shiftKey){if(!f){return true}a=d(f).parents("form:first").find(":checkbox");e=a.index(f);c=a.index(this);b=d(this).attr("checked");if(0<e&&0<c&&e!=c){a.slice(e,c).attr("checked",function(){if(d(this).parents("tr").is(":visible")){return b?"checked":""}return""})}}f=this;return true});d("thead :checkbox, tfoot :checkbox").click(function(i){var j=d(this).attr("checked"),h="undefined"==typeof toggleWithKeyboard?false:toggleWithKeyboard,g=i.shiftKey||h;d(this).parents("form:first").find("table tbody:visible").find(".check-column :checkbox").attr("checked",function(){if(d(this).parents("tr").is(":hidden")){return""}if(g){return d(this).attr("checked")?"":"checked"}else{if(j){return"checked"}}return""});d(this).parents("form:first").find("table thead:visible, table tfoot:visible").find(".check-column :checkbox").attr("checked",function(){if(g){return""}else{if(j){return"checked"}}return""})})});(function(){if("undefined"!=typeof google&&google.gears){return}var a=false;if("undefined"!=typeof GearsFactory){a=new GearsFactory()}else{try{a=new ActiveXObject("Gears.Factory");if(factory.getBuildInfo().indexOf("ie_mobile")!=-1){a.privateSetGlobalObject(this)}}catch(b){if(("undefined"!=typeof navigator.mimeTypes)&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a)}}}if(a&&a.hasPermission){return}jQuery(".turbo-nag").show()})(); 
  • trunk/wp-admin/menu.php

    r10680 r10869  
    3030$menu[4] = array( '', 'read', '', '', 'wp-menu-separator' ); 
    3131 
    32 $menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'wp-menu-open menu-top', 'menu-posts', 'div' ); 
     32$menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top', 'menu-posts', 'div' ); 
    3333    $submenu['edit.php'][5]  = array( __('Edit'), 'edit_posts', 'edit.php' ); 
    3434    /* translators: add new post */ 
  • trunk/wp-admin/wp-admin.css

    r10865 r10869  
    872872} 
    873873 
    874 #adminmenu li.wp-menu-open .wp-submenu { 
     874#adminmenu li.wp-menu-open .wp-submenu, 
     875.no-js #adminmenu .open-if-no-js .wp-submenu { 
    875876    display: block; 
    876877} 
  • trunk/wp-includes/script-loader.php

    r10865 r10869  
    6161    $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20090102' ); 
    6262 
    63     $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20090327' ); 
     63    $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20090404' ); 
    6464    $scripts->add_data( 'common', 'group', 1 ); 
    6565    $scripts->localize( 'common', 'commonL10n', array( 
     
    426426    $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'plugin-install', 'farbtastic' ); 
    427427 
    428     $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20090403' ); 
     428    $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20090404' ); 
    429429    $styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' ); 
    430430 
    431     $styles->add( 'ie', '/wp-admin/css/ie.css', array(), '20081210' ); 
     431    $styles->add( 'ie', '/wp-admin/css/ie.css', array(), '20090404' ); 
    432432    $styles->add_data( 'ie', 'conditional', 'lte IE 7' ); 
    433433 
     
    438438    $styles->add_data( 'colors-classic', 'rtl', true ); 
    439439 
    440     $styles->add( 'global', '/wp-admin/css/global.css', array(), '20090403' ); 
     440    $styles->add( 'global', '/wp-admin/css/global.css', array(), '20090404' ); 
    441441    $styles->add( 'media', '/wp-admin/css/media.css', array(), '20090325' ); 
    442442    $styles->add( 'widgets', '/wp-admin/css/widgets.css', array(), '20081210' ); 
Note: See TracChangeset for help on using the changeset viewer.