Dotclear

Changeset 1576:5638c7934641


Ignore:
Timestamp:
08/25/13 15:18:38 (12 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Message:

Issue #1541: hide or display adapted message when js is enabled or not
Add js class to html, removed by jQuery on pageLoad event.
Add some css classes :

  • js-hidden : use to hide element that need to be displayed when js is enabled
  • no-js-hidden : use to hide element that need to be displayed when js is not enabled
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • admin/categories.php

    r1571 r1576  
    8282} 
    8383 
    84 # Actions combo box 
    85 $combo_action = array(); 
    86 if ($core->auth->check('categories',$core->blog->id)) { 
    87      $combo_action[__('Delete')] = 'delete'; 
    88 } 
    89  
    9084 
    9185/* Display 
     
    181175     '</div>'; 
    182176 
    183      if (count($combo_action)>0) { 
    184            echo 
    185            '<div class="two-cols">'. 
    186            '<p class="col checkboxes-helpers"></p>'. 
    187            '<p class="col right" id="mov-cat">'. 
    188            '<label for="mov_cat" class="classic">'.__('Category which will receive entries of deleted categories:').'</label> '. 
    189            form::combo('mov_cat',array_merge(array(__('(No cat)') => ''),$categories_combo),'',''). 
    190            '</p>'. 
    191            '<p class="right">'. 
    192            $core->formNonce(). 
    193            '<input type="submit" value="'.__('Delete selected categories').'"/>'. 
    194            '</p>'. 
    195            '</div>'. 
    196            '</form>'; 
    197      } 
     177     echo 
     178     '<div class="two-cols">'. 
     179     '<p class="col checkboxes-helpers"></p>'. 
     180     '<p class="col right" id="mov-cat">'. 
     181     '<label for="mov_cat" class="classic">'.__('Category which will receive entries of deleted categories:').'</label> '. 
     182     form::combo('mov_cat',array_merge(array(__('(No cat)') => ''),$categories_combo),'',''). 
     183     '</p>'. 
     184     '<p class="right">'. 
     185     $core->formNonce(). 
     186     '<input type="submit" value="'.__('Delete selected categories').'"/>'. 
     187     '</p>'. 
     188     '</div>'. 
     189     '</form>'; 
    198190 
    199191     echo '<h3 class="clear">'.__('Categories order').'</h3>'; 
    200192 
    201      if (!$core->auth->user_prefs->accessibility->nodragdrop 
    202           && $core->auth->check('categories',$core->blog->id) 
    203           && $rs->count()>1) { 
     193     if ($core->auth->check('categories',$core->blog->id) && $rs->count()>1) { 
    204194          echo 
    205           '<form action="categories.php" method="post">'. 
    206           '<p>'.__('To rearrange categories order, move items by drag and drop, then click on “Save categories order” button.').'</p>'. 
     195          '<form action="categories.php" method="post">'; 
     196          if (!$core->auth->user_prefs->accessibility->nodragdrop) { 
     197                  echo '<p class="no-js-hidden">'.__('To rearrange categories order, move items by drag and drop, then click on “Save categories order” button.').'</p>'; 
     198          } 
     199          echo 
     200          '<p class="js-hidden">'.__('To rearrange categories order, change position number and click on “Save categories order” button.').'</p>'. 
    207201          '<p>'. 
    208202          '<input type="hidden" id="categories_order" name="categories_order" value=""/>'. 
     
    210204          $core->formNonce().'</p>'. 
    211205          '</form>'; 
    212  
    213 // Pour le cas de js désactivé, phrase du formulaire ci-dessus :  
    214 // "To rearrange categories order, change position number and click on “Save categories order” button." 
     206     } 
    215207 
    216208     echo 
     
    220212     $core->formNonce().'</p>'. 
    221213     '</form>'; 
    222      } 
    223214} 
    224215 
  • admin/js/common.js

    r1573 r1576  
    338338-------------------------------------------------------- */ 
    339339$(function() { 
     340     // remove class no-js from html tag 
     341     $('html').removeClass('no-js'); 
     342 
    340343     // Blog switcher 
    341344     $('#switchblog').change(function() { 
  • admin/style/default.css

    r1574 r1576  
    3434     text-decoration: underline; 
    3535} 
    36 a img, a:link img, a:visited img {  
     36a img, a:link img, a:visited img { 
    3737     border:none; 
    3838} 
     
    6262     padding: 0 18px 6px; /* ie < 9 sucks */ 
    6363     padding: 0 1.8rem .6rem; 
    64      margin: 0 -18px .5em; /* ie < 9 sucks */  
     64     margin: 0 -18px .5em; /* ie < 9 sucks */ 
    6565     margin: 0 -1.8rem 1rem; 
    6666     background: #fff url(bg_h2.png) repeat-x center bottom; 
     
    114114     cursor: help; 
    115115} 
     116 
     117.no-js .js-hidden { 
     118        display: block; 
     119} 
     120.no-js .no-js-hidden { 
     121        display: none; 
     122} 
     123.js-hidden { 
     124        display: none; 
     125} 
     126 
    116127/* LAYOUT 
    117128-------------------------------------------------------- */ 
     
    173184} 
    174185#top h1 a:hover, #top h1 a:focus { 
    175      background: transparent url(dc_logos/b-dotclear120.png) no-repeat 0 -94px;  
     186     background: transparent url(dc_logos/b-dotclear120.png) no-repeat 0 -94px; 
    176187} 
    177188#info-boxes { 
     
    244255#content { 
    245256     margin: 0 0 0 14.5em; 
    246      padding: 9px 18px 18px; /* ie < 9 sucks */  
     257     padding: 9px 18px 18px; /* ie < 9 sucks */ 
    247258     padding: .9rem 1.8rem 1.8rem; 
    248259     background: #fff; 
     
    376387#search-menu * { 
    377388     height: 20px; /* ie < 9 sucks */ 
    378      height: 2rem;   
     389     height: 2rem; 
    379390} 
    380391#search-menu p { 
     
    392403     background: transparent url(search.png) no-repeat 4px center; 
    393404     text-indent: 18px; 
    394      padding: 0 2px;  
     405     padding: 0 2px; 
    395406     border: none; 
    396407} 
    397 #search-menu input[type="submit"] {  
     408#search-menu input[type="submit"] { 
    398409     padding: 0 3px; 
    399410     padding: 0 .3rem; 
     
    648659#categories input[type="checkbox"] { 
    649660     margin-right: .8em; 
    650 }  
     661} 
    651662#categories h4 { 
    652663     margin: 0; 
     
    888899     display: table-cell; 
    889900     vertical-align: top; 
    890      padding: 0;  
     901     padding: 0; 
    891902     width: 312px; 
    892903     border: 1px solid #ccc; 
    893904     border-radius: 3px; 
    894905} 
    895 #theme-box .theme-shot,  
     906#theme-box .theme-shot, 
    896907#theme-box .theme-info, 
    897908#theme-box .theme-actions { 
     
    11461157     background: #fff; 
    11471158     border: 1px solid #aaa; 
    1148      border-radius: 6px;  
     1159     border-radius: 6px; 
    11491160     padding: 1em .7em .5em; 
    11501161     margin-bottom: 1em; 
     
    12901301     width: 80%; 
    12911302     border: 1px solid #999; 
    1292      margin-bottom: 3em;  
     1303     margin-bottom: 3em; 
    12931304} 
    12941305table.settings th, table.prefs th { 
     
    13851396input.invalid, textarea.invalid, select.invalid { 
    13861397     border: 1px solid red; 
    1387      background: #fff;  
     1398     background: #fff; 
    13881399     color: red; 
    13891400     box-shadow: 0 0 0 1px rgba(218, 62, 90, 0.3) 
     
    14721483p.field { 
    14731484     position: relative; 
    1474       
     1485 
    14751486} 
    14761487p.field label { 
     
    17021713     margin-top: 1em; 
    17031714     line-height: 22px; 
    1704      padding: 0 .75em;  
     1715     padding: 0 .75em; 
    17051716     border: 1px solid #ddd; 
    1706      overflow: hidden;  
    1707      background: #e1e1e1;  
    1708      background: -moz-linear-gradient(center top , #f2f2f2, #e1e1e1);  
    1709      background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f2f2f2), color-stop(100%,#e1e1e1));  
    1710      -moz-border-radius: 4px;  
    1711      -webkit-border-radius: 4px;  
    1712      border-radius: 4px;  
     1717     overflow: hidden; 
     1718     background: #e1e1e1; 
     1719     background: -moz-linear-gradient(center top , #f2f2f2, #e1e1e1); 
     1720     background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f2f2f2), color-stop(100%,#e1e1e1)); 
     1721     -moz-border-radius: 4px; 
     1722     -webkit-border-radius: 4px; 
     1723     border-radius: 4px; 
    17131724     clear: left; 
    17141725} 
     
    17161727     height: 20px; 
    17171728     border: none; 
    1718      padding: 2px 6px;  
     1729     padding: 2px 6px; 
    17191730     background-color : transparent; 
    17201731     background-position : 50% 50%; 
     
    17731784} 
    17741785     #top h1 a:link { 
    1775           background: transparent url(dc_logos/b-dotclear120.png) no-repeat -180px 6px;  
     1786          background: transparent url(dc_logos/b-dotclear120.png) no-repeat -180px 6px; 
    17761787          border-right: 1px solid #ccc; 
    17771788     } 
  • inc/admin/lib.dc.page.php

    r1573 r1576  
    9090          '<html xmlns="http://www.w3.org/1999/xhtml" '. 
    9191          'xml:lang="'.$core->auth->getInfo('user_lang').'" '. 
    92           'lang="'.$core->auth->getInfo('user_lang').'">'."\n". 
     92          'lang="'.$core->auth->getInfo('user_lang').'" class="no-js">'."\n". 
    9393          "<head>\n". 
    9494          '  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'."\n". 
Note: See TracChangeset for help on using the changeset viewer.

Sites map