Dotclear

Changeset 1659:12fc8eddfa0f


Ignore:
Timestamp:
08/29/13 17:55:07 (12 years ago)
Author:
Lepeltier kévin
Branch:
Ticket #1604 - widgets
Message:

Ticket #1604 : Correction css te bug #1604

Location:
plugins/widgets
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • plugins/widgets/dragdrop.js

    r1657 r1659  
     1/* 
     2# -- BEGIN LICENSE BLOCK --------------------------------------- 
     3# 
     4# This file is part of Dotclear 2. 
     5# 
     6# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear 
     7# Licensed under the GPL version 2.0 license. 
     8# See LICENSE file or 
     9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     10# 
     11# -- END LICENSE BLOCK ----------------------------------------- 
     12*/ 
     13 
    114$(function() { 
    215      
     
    7285      
    7386     // add 
    74      $( "#widgets > li" ).draggable({ 
     87     $( "#widgets-ref > li" ).draggable({ 
    7588          tolerance: "move", 
    7689          cursor: "move", 
     
    7992          revert: "invalid", 
    8093          start: function( event, ui ) { 
    81                ui.helper.css({'width': $('#widgets > li').css('width')}); 
     94               ui.helper.css({'width': $('#widgets-ref > li').css('width')}); 
    8295          } 
    8396     }); 
  • plugins/widgets/index.php

    r1657 r1659  
    195195'<h3>'.__('Available widgets').'</h3>'. 
    196196'<p>'.__('Move widgets from this list to one of the sidebars.').'</p>'. 
    197 '<ul id="widgets">'; 
     197'<ul id="widgets-ref">'; 
    198198 
    199199$j = 0; 
     
    201201     echo 
    202202     '<li>'.form::hidden(array('w[void][0][id]'),html::escapeHTML($w->id())). 
    203      '<p class="widget-name">'.form::field(array('w[void][0][order]'),2,3,0,'hidden-if-drag','',0,'title="'.__('order').'"').' '.$w->name(). 
     203     '<p class="widget-name">'.form::field(array('w[void][0][order]'),2,3,0,'hide','',0,'title="'.__('order').'"').' '.$w->name(). 
    204204     ($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : '').'</p>'. 
    205      '<p class="remove-if-drag"><label class="classic">'.__('Append to:').'</label> '. 
     205     '<p class="manual-move remove-if-drag"><label class="classic">'.__('Append to:').'</label> '. 
    206206     form::combo(array('addw['.$w->id().']'),$append_combo).'</p>'. 
    207207     '<div class="widgetSettings hidden-if-drag">'.$w->formSettings('w[void][0]',$j).'</div>'. 
  • plugins/widgets/style.css

    r1657 r1659  
    1 #listWidgets { 
    2      float: left; 
    3      width: 46%; 
    4      background: #eee; 
    5      padding: 1.5em 1% 0;  
    6      margin: 0 1% 0 0; 
    7 } 
    8 #widgets > li { 
    9      border: 1px solid #ccc; 
    10      margin-bottom: .5em; 
    11      background: #fff; 
    12      min-height: 3em; 
    13      padding: 0 0 4px 0; 
    14      list-style: none; 
    15 } 
    16 #widgets .widget-name, #widgets .js-remove { 
    17      background: #fff; 
    18      margin-bottom: 0; 
    19      padding: 4px 8px;  
    20 } 
    21 #widgets .js-hide { 
    22      display: none; 
    23 } 
    24 #widgets .widget-name { 
    25      min-height: 3em; 
    26      padding-bottom: 0; 
    27 } 
    28 #listWidgets h3 { 
    29      color: #333; 
    30 } 
     1/* 
     2# -- BEGIN LICENSE BLOCK --------------------------------------- 
     3# 
     4# This file is part of Dotclear 2. 
     5# 
     6# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear 
     7# Licensed under the GPL version 2.0 license. 
     8# See LICENSE file or 
     9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     10# 
     11# -- END LICENSE BLOCK ----------------------------------------- 
     12*/ 
    3113 
     14 
     15/* ------------------------------------------------------------- side bars */ 
    3216#sidebarsWidgets { 
    3317     float: left; 
     
    3519     margin: 0 0 0 1%; 
    3620     padding: 0 1%; 
    37 } 
    38 #sidebarsControl { 
    39      clear: left; 
    4021} 
    4122.widgets.fieldset { 
     
    4728    border-bottom: 1px dashed #FF0000; 
    4829} 
    49 #widgets, #dndnav, #dndextra, #dndcustom { 
     30#dndnav, #dndextra, #dndcustom { 
    5031     padding: 1em 0; 
    5132     margin: 1em 0 0; 
     
    6041     list-style: none; 
    6142} 
    62  
    63 .sortable-delete > li { 
    64      margin-bottom: 3px; 
    65 } 
    66 .sortable-delete li.sortable-delete-placeholder { 
    67     border: 0 none; 
    68     color: #666666; 
    69     font-size: 1rem; 
    70     font-weight: normal; 
    71     text-align: center; 
    72 } 
    73  
    74 #dndnav li.ui-sortable-placeholder, 
    75 #dndextra li.ui-sortable-placeholder, 
    76 #dndcustom li.ui-sortable-placeholder, 
    77 .sortable-delete li.ui-sortable-placeholder { 
     43#dndnav > li.ui-sortable-placeholder, 
     44#dndextra > li.ui-sortable-placeholder, 
     45#dndcustom > li.ui-sortable-placeholder, 
     46.sortable-delete > li.ui-sortable-placeholder { 
    7847     border: 1px dashed #999; 
    7948     height: 2rem; 
     
    8150} 
    8251 
    83 #dndnav .form-note, #dndextra .form-note, #dndcustom .form-note { 
     52.sortable-delete { 
    8453     display: none; 
    8554} 
    86  
    87  
    88 .widget-name { 
    89      background: #eef; 
    90      color: #000; 
    91      padding: 4px 6px; 
    92      margin: 0; 
    93      font-weight: bold; 
    94 } 
    95 .widget-name span { 
    96      display: block; 
    97      font-style: normal; 
    98      font-size: 1.1rem; 
    99 } 
    100 .widget-name img { 
    101      cursor: pointer; 
    102      margin-bottom: -1px; 
    103 } 
    104 .removeWidget { 
    105      padding: 8px 6px; 
    106      margin: 0; 
    107 } 
    108  
    109 .widgetSettings { 
    110      border-top: 1px solid #ddd; 
    111      padding: 8px 6px; 
    112      background: #f5f5f5; 
    113 } 
    114  
    115 .sortable-delete { 
    116     display: none; 
    117 } 
    118  
    11955.sortable-delete.if-drag { 
    12056    border: 1px solid #999999; 
     
    12965    display: block; 
    13066} 
     67.sortable-delete > li { 
     68     margin-bottom: 3px; 
     69} 
     70.sortable-delete > li.sortable-delete-placeholder { 
     71    border: 0 none; 
     72    color: #FF0000; 
     73    font-size: 1rem; 
     74    font-weight: normal; 
     75    text-align: center; 
     76} 
    13177 
    132 #widgets .widgetSettings { 
     78.widget-name { 
     79     background: #eef; 
     80     color: #000; 
     81     padding: 4px 6px; 
     82     margin: 0; 
     83     font-weight: bold; 
     84} 
     85.widget-name img { 
     86     cursor: pointer; 
     87     margin-bottom: -1px; 
     88} 
     89.widget-name a.aexpand, 
     90.widget-name a.aexpand:link, 
     91.widget-name a.aexpand:visited { 
     92    border: 0 none; 
     93    color: #000000; 
     94    text-decoration: none; 
     95} 
     96#dndnav .form-note, 
     97#dndextra .form-note, 
     98#dndcustom .form-note { 
    13399     display: none; 
    134100} 
    135 .hideControls .widgetSettings { 
    136      display: none; 
     101.removeWidget { 
     102     padding: 8px 6px; 
     103     margin: 0; 
    137104} 
    138 .hideControl { 
     105.widgetSettings { 
     106     border-top: 1px solid #ddd; 
     107     padding: 8px 6px; 
     108     background: #f5f5f5; 
     109} 
     110 
     111#sidebarsControl { 
     112     clear: left; 
     113} 
     114 
     115/* ------------------------------------------------------------- list Widgets ref */ 
     116#listWidgets { 
     117     float: left; 
     118     width: 46%; 
     119     background: #eee; 
     120     padding: 1.5em 1% 0;  
     121     margin: 0 1% 0 0; 
     122} 
     123#listWidgets h3 { 
     124     color: #333; 
     125} 
     126 
     127#widgets-ref { 
     128     padding: 1em 0; 
     129     margin: 1em 0 0; 
     130} 
     131#widgets-ref > li { 
     132     border: 1px solid #ccc; 
     133     margin-bottom: .5em; 
     134     background: #fff; 
     135     min-height: 3em; 
     136     padding: 0 0 4px 0; 
     137     list-style: none; 
     138} 
     139#widgets-ref .widget-name, 
     140#widgets-ref .manual-move { 
     141     background: #fff; 
     142     margin-bottom: 0; 
     143     padding: 4px 8px 0; 
     144} 
     145#widgets-ref .widget-name { 
     146     min-height: 3em; 
     147} 
     148#widgets-ref .widget-name .form-note { 
     149     display: block; 
     150     font-style: normal; 
     151     font-size: 1.1rem; 
     152} 
     153#widgets-ref .widgetSettings { 
    139154     display: none; 
    140155} 
    141156 
     157/* ------------------------------------------------------------- help */ 
    142158#widgets-tpl dt { 
    143159     margin: 1em 0 0 0; 
  • plugins/widgets/widgets.js

    r1651 r1659  
     1/* 
     2# -- BEGIN LICENSE BLOCK --------------------------------------- 
     3# 
     4# This file is part of Dotclear 2. 
     5# 
     6# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear 
     7# Licensed under the GPL version 2.0 license. 
     8# See LICENSE file or 
     9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     10# 
     11# -- END LICENSE BLOCK ----------------------------------------- 
     12*/ 
     13 
    114dotclear.postExpander = function(line) { 
    215     var title = $(line).find('.widget-name'); 
     16     title.find('.form-note').remove(); 
     17     order = title.find('input[name*=order]'); 
     18     link = $('<a href="#" alt="expand" class="aexpand"/>').append(title.text()); 
     19     title.empty().append(order).append(link); 
    320      
    421     var img = document.createElement('img'); 
     
    724     img.className = 'expand'; 
    825     $(img).css('cursor','pointer'); 
    9      img.line = line; 
    10      img.onclick = function() { dotclear.viewPostContent(this.line); }; 
     26     img.onclick = function() { dotclear.viewPostContent($(this).parents('li')); }; 
     27     link.click(function(e) { 
     28          e.preventDefault(); 
     29          dotclear.viewPostContent($(this).parents('li')); 
     30     }); 
    1131      
    1232     title.prepend(img); 
     
    1535dotclear.viewPostContent = function(line,action) { 
    1636     var action = action || 'toogle'; 
    17      var img = $(line).find('.expand'); 
     37     var img = line.find('.expand'); 
    1838     var isopen = img.attr('alt') == dotclear.img_plus_alt; 
    1939      
    2040     if( action == 'close' || ( action == 'toogle' && !isopen ) ) { 
    21           $(line).find('.widgetSettings').hide(); 
     41          line.find('.widgetSettings').hide(); 
    2242          img.attr('src', dotclear.img_plus_src); 
    2343          img.attr('alt', dotclear.img_plus_alt); 
    2444     } else if ( action == 'open' || ( action == 'toogle' && isopen ) ) { 
    25           $(line).find('.widgetSettings').show(); 
     45          line.find('.widgetSettings').show(); 
    2646          img.attr('src', dotclear.img_minus_src); 
    2747          img.attr('alt', dotclear.img_minus_alt); 
     
    3959     $('#dndnav > li, #dndextra > li, #dndcustom > li').each(function() { 
    4060          dotclear.postExpander(this); 
    41           dotclear.viewPostContent(this, 'close'); 
     61          dotclear.viewPostContent($(this), 'close'); 
    4262     }); 
    4363      
Note: See TracChangeset for help on using the changeset viewer.

Sites map