Dotclear


Ignore:
Timestamp:
08/31/13 15:16:06 (12 years ago)
Author:
Anne Kozlika <kozlika@…>
Branch:
default
Message:

Some enhancements on widgets page (with help from Franck Paul <3)

Location:
plugins/widgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/widgets/index.php

    r1659 r1669  
    165165  <?php echo file_get_contents(dirname(__FILE__).'/style.css'); ?> 
    166166  </style> 
    167      <script type="text/javascript" src="js/jquery/jquery-ui.custom.js"></script> 
    168   <script type="text/javascript" src="index.php?pf=widgets/widgets.js"></script> 
     167  <?php 
     168          echo 
     169               dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     170               dcPage::jsLoad('index.php?pf=widgets/widgets.js'); 
     171  ?> 
    169172  <?php  
    170173     $core->auth->user_prefs->addWorkspace('accessibility');  
     
    220223echo 
    221224'<div id="sidebarNav" class="widgets fieldset">'. 
    222 sidebarWidgets('dndnav',__('Navigation sidebar'),$widgets_nav,'nav',$__default_widgets['nav'],$j). 
    223 '</div>'. 
    224 '<ul class="sortable-delete"><li class="sortable-delete-placeholder">'.__('Drag here to delete').'</li></ul>'; 
     225sidebarWidgets('dndnav',__('Navigation sidebar'),$widgets_nav,'nav',$__default_widgets['nav'],$j); 
     226echo '</div>'; 
    225227 
    226228# Extra sidebar 
    227229echo 
    228230'<div id="sidebarExtra" class="widgets fieldset">'. 
    229 sidebarWidgets('dndextra',__('Extra sidebar'),$widgets_extra,'extra',$__default_widgets['extra'],$j). 
    230 '</div>'. 
    231 '<ul class="sortable-delete"><li class="sortable-delete-placeholder">'.__('Drag here to delete').'</li></ul>'; 
     231sidebarWidgets('dndextra',__('Extra sidebar'),$widgets_extra,'extra',$__default_widgets['extra'],$j); 
     232echo '</div>'; 
    232233 
    233234# Custom sidebar 
    234235echo 
    235236'<div id="sidebarCustom" class="widgets fieldset">'. 
    236 sidebarWidgets('dndcustom',__('Custom sidebar'),$widgets_custom,'custom',$__default_widgets['custom'],$j). 
    237 '</div>'. 
    238 '<ul class="sortable-delete"><li class="sortable-delete-placeholder">'.__('Drag here to delete').'</li></ul>'; 
     237sidebarWidgets('dndcustom',__('Custom sidebar'),$widgets_custom,'custom',$__default_widgets['custom'],$j); 
     238echo '</div>'; 
    239239 
    240240echo 
     
    322322     } 
    323323      
    324      if ($widgets->isEmpty()) { 
    325           $res .= '<p class="empty-widgets">'.__('No widget.').'</p>'; 
    326      } else { 
    327           $res .= '<p class="empty-widgets" style="display: none;">'.__('No widget.').'</p>'; 
    328      } 
     324     $res .= '<p class="empty-widgets" '.(!$widgets->isEmpty() ? 'style="display: none;"' : '').'>'.__('No widget.').'</p>'; 
    329325      
    330326     $res .= '<ul id="'.$id.'" class="connected">'; 
     
    350346      
    351347     $res .= '</ul>'; 
     348 
     349     if ($i > 0) { 
     350          $res .= '<ul class="sortable-delete"><li class="sortable-delete-placeholder">'. 
     351               __('Drag widgets here to remove them from this sidebar.').'</li></ul>'; 
     352     } 
    352353      
    353354     return $res; 
  • plugins/widgets/style.css

    r1661 r1669  
    2424} 
    2525.widgets.fieldset.if-drag { 
    26      margin-bottom: 0; 
    27      border-radius: 6px 6px 0 0; 
    28     border-bottom: 1px dashed #FF0000; 
     26     padding-bottom: 0; 
     27     border-radius: .5em; 
    2928} 
    3029#dndnav, #dndextra, #dndcustom { 
     
    3433#dndnav > li, 
    3534#dndextra > li, 
    36 #dndcustom > li, 
    37 .sortable-delete > li { 
    38      padding: O; 
     35#dndcustom > li { 
     36     padding: 0; 
    3937     border: 1px solid #999; 
    4038     margin-bottom: 1em; 
     
    4644.sortable-delete > li.ui-sortable-placeholder { 
    4745     border: 1px dashed #999; 
    48      height: 2rem; 
    49      padding: 3px; 
     46     height: 2em; 
     47     padding: .3em; 
    5048} 
    51  
     49.sortable-delete > li.ui-sortable-placeholder { 
     50     border-width: 2px; 
     51     border-color: red; 
     52} 
    5253.sortable-delete { 
    5354     display: none; 
    5455} 
    5556.sortable-delete.if-drag { 
    56     border: 1px solid #999999; 
    57     border-top: 0; 
    58     border-radius: 0 0 6px 6px; 
    59     color: #000000; 
     57    border: 1px dotted #999; 
     58    color: #000; 
    6059    font-weight: bold; 
    61     list-style: none outside none; 
    62     margin: 0 0 2em; 
    63     min-height: 25px; 
    64     padding: 4px; 
     60    list-style-type: none; 
     61    margin: 0 0 1em; 
     62    padding: .5em 1em; 
    6563    display: block; 
     64    background: #fafafa; 
    6665} 
    6766.sortable-delete > li { 
     
    7069.sortable-delete > li.sortable-delete-placeholder { 
    7170    border: 0 none; 
    72     color: #FF0000; 
    73     font-size: 1rem; 
    74     font-weight: normal; 
     71    color: #aaa; 
     72    font-size: 1em; 
     73    font-weight: bold; 
    7574    text-align: center; 
    7675} 
    77  
    7876.widget-name { 
    7977     background: #eef; 
     
    9189.widget-name a.aexpand:visited { 
    9290    border: 0 none; 
    93     color: #000000; 
     91    color: #000; 
    9492    text-decoration: none; 
    9593} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map