Dotclear

Changeset 2495:dc8c7974ff0b for plugins


Ignore:
Timestamp:
10/27/13 09:46:02 (12 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add touch capacity for drag'n'drop gestures on screen, addresses #1802

Location:
plugins
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • plugins/antispam/index.php

    r2322 r2495  
    117117     echo 
    118118          dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     119          dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 
    119120          dcPage::jsLoad('index.php?pf=antispam/antispam.js'); 
    120121  } 
  • plugins/blogroll/index.php

    r2256 r2495  
    2727{ 
    2828     $default_tab = 'import-links'; 
    29       
     29 
    3030     try 
    3131     { 
     
    3535               throw new Exception(__('Unable to move uploaded file.')); 
    3636          } 
    37            
     37 
    3838          require_once dirname(__FILE__).'/class.dc.importblogroll.php'; 
    3939          try { 
     
    4444               throw $e; 
    4545          } 
    46            
    47            
     46 
     47 
    4848          if (empty($imported)) { 
    4949               unset($imported); 
     
    6969          } 
    7070     } 
    71       
     71 
    7272     dcPage::addSuccessNotice(__('links have been successfully imported.')); 
    73      http::redirect($p_url);   
     73     http::redirect($p_url); 
    7474} 
    7575 
    7676if (!empty($_POST['cancel_import'])) { 
    7777     $core->error->add(__('Import operation cancelled.')); 
    78      $default_tab = 'import-links';      
     78     $default_tab = 'import-links'; 
    7979} 
    8080 
     
    8686     $link_desc = $_POST['link_desc']; 
    8787     $link_lang = $_POST['link_lang']; 
    88       
     88 
    8989     try { 
    9090          $blogroll->addLink($link_title,$link_href,$link_desc,$link_lang); 
     
    102102{ 
    103103     $cat_title = $_POST['cat_title']; 
    104       
     104 
    105105     try { 
    106106          $blogroll->addCategory($cat_title); 
     
    124124          } 
    125125     } 
    126       
     126 
    127127     if (!$core->error->flag()) { 
    128128          dcPage::addSuccessNotice(__('Items have been successfully removed.')); 
     
    145145     foreach ($order as $pos => $l) { 
    146146          $pos = ((integer) $pos)+1; 
    147            
     147 
    148148          try { 
    149149               $blogroll->updateOrder($l,$pos); 
     
    152152          } 
    153153     } 
    154       
     154 
    155155     if (!$core->error->flag()) { 
    156156          dcPage::addSuccessNotice(__('Items order has been successfully updated')); 
     
    172172  <title><?php echo __('Blogroll'); ?></title> 
    173173  <?php echo dcPage::jsConfirmClose('links-form','add-link-form','add-category-form'); ?> 
    174   <?php  
     174  <?php 
    175175     $core->auth->user_prefs->addWorkspace('accessibility'); 
    176176     if (!$core->auth->user_prefs->accessibility->nodragdrop) { 
    177177     echo 
    178178          dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     179          dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 
    179180          dcPage::jsLoad('index.php?pf=blogroll/blogroll.js'); 
    180181     } 
     
    213214{ 
    214215     $position = (string) $rs->index()+1; 
    215       
     216 
    216217     echo 
    217218     '<tr class="line" id="l_'.$rs->link_id.'">'. 
    218219     '<td class="handle minimal">'.form::field(array('order['.$rs->link_id.']'),2,5,$position,'position','',false,'title="'.__('position').'"').'</td>'. 
    219220     '<td class="minimal">'.form::checkbox(array('remove[]'),$rs->link_id,'','','',false,'title="'.__('select this link').'"').'</td>'; 
    220       
    221       
     221 
     222 
    222223     if ($rs->is_cat) 
    223224     { 
     
    235236          '<td>'.html::escapeHTML($rs->link_lang).'</td>'; 
    236237     } 
    237       
     238 
    238239     echo '</tr>'; 
    239240} 
     
    245246<p class="col"> 
    246247<?php 
    247      echo  
     248     echo 
    248249     form::hidden('links_order',''). 
    249250     form::hidden(array('p'),'blogroll'). 
     
    252253<input type="submit" name="saveorder" value="<?php echo __('Save order'); ?>" /></p> 
    253254<p class="col right"><input type="submit" class="delete" name="removeaction" 
    254       value="<?php echo __('Delete selected links'); ?>"  
     255      value="<?php echo __('Delete selected links'); ?>" 
    255256      onclick="return window.confirm(' 
    256257      <?php echo html::escapeJS(__('Are you sure you want to delete selected links?')); ?>');" /></p> 
     
    330331          '<th>'.__('Description').'</th>'. 
    331332          '</tr>'; 
    332            
     333 
    333334          $i = 0; 
    334335          foreach ($imported as $entry) { 
     
    336337               $title = html::escapeHTML($entry->title); 
    337338               $desc  = html::escapeHTML($entry->desc); 
    338                 
    339                echo  
     339 
     340               echo 
    340341               '<tr><td>'.form::checkbox(array('entries[]'),$i,'','','').'</td>'. 
    341342               '<td nowrap><a href="'.$url.'">'.$title.'</a>'. 
     
    345346               '<td>'.$desc. 
    346347               '<input type="hidden" name="desc['.$i.']" value="'.$desc.'" />'. 
    347                '</td></tr>'."\n";             
     348               '</td></tr>'."\n"; 
    348349               $i++; 
    349350          } 
     
    352353          '<div class="two-cols">'. 
    353354          '<p class="col checkboxes-helpers"></p>'. 
    354            
     355 
    355356          '<p class="col right">'. 
    356357          form::hidden(array('p'),'blogroll'). 
  • plugins/pages/list.php

    r2256 r2495  
    5555  <title><?php echo __('Pages'); ?></title> 
    5656  <?php 
    57      echo dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     57     echo 
     58          dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     59          dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 
    5860          dcPage::jsLoad('index.php?pf=pages/list.js'). 
    5961          '<script type="text/javascript">'. 
     
    8991     $post_list->display($page,$nb_per_page, 
    9092     '<form action="plugin.php" method="post" id="form-entries">'. 
    91       
     93 
    9294     '%s'. 
    93       
     95 
    9496     '<div class="two-cols">'. 
    9597     '<p class="col checkboxes-helpers"></p>'. 
    96       
     98 
    9799     '<p class="col right"><label for="action" class="classic">'.__('Selected pages action:').'</label> '. 
    98100     form::combo('action',$pages_actions_page->getCombo()). 
  • plugins/simpleMenu/index.php

    r2256 r2495  
    204204               // Fourth step, menu item to be added 
    205205               try { 
    206                     if (($item_label != '') && ($item_url != ''))  
     206                    if (($item_label != '') && ($item_url != '')) 
    207207                    { 
    208208                         // Add new item menu in menu array 
     
    215215                         $core->blog->settings->system->put('simpleMenu',serialize($menu)); 
    216216                         $core->blog->triggerBlog(); 
    217                      
     217 
    218218                         // All done successfully, return to menu items list 
    219219                         dcPage::addSuccessNotice(__('Menu item has been successfully added.')); 
     
    229229     } 
    230230} else { 
    231       
     231 
    232232     # Remove selected menu items 
    233233     if (!empty($_POST['removeaction'])) 
     
    251251                    $core->blog->settings->system->put('simpleMenu',serialize($menu)); 
    252252                    $core->blog->triggerBlog(); 
    253                      
     253 
    254254                    // All done successfully, return to menu items list 
    255255                    dcPage::addSuccessNotice(__('Menu items have been successfully removed.')); 
     
    295295          } 
    296296     } 
    297       
     297 
    298298     # Order menu items 
    299299     $order = array(); 
     
    328328               dcPage::addSuccessNotice(__('Menu items have been successfully updated.')); 
    329329               http::redirect($p_url); 
    330           }  
     330          } 
    331331          catch (Exception $e) { 
    332332               $core->error->add($e->getMessage()); 
    333333          } 
    334334     } 
    335       
     335 
    336336} 
    337337 
     
    342342<head> 
    343343     <title><?php echo $page_title; ?></title> 
    344      <?php  
     344     <?php 
    345345          $core->auth->user_prefs->addWorkspace('accessibility'); 
    346346          if (!$core->auth->user_prefs->accessibility->nodragdrop) { 
    347347               echo 
    348348                    dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     349                    dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 
    349350                    dcPage::jsLoad('index.php?pf=simpleMenu/simplemenu.js'); 
    350351          } 
     
    474475     } 
    475476     // Entête table 
    476      echo  
     477     echo 
    477478          '<div class="table-outer">'. 
    478479          '<table class="dragable">'. 
  • plugins/widgets/index.php

    r2412 r2495  
    5353          } 
    5454     } 
    55            
     55 
    5656     # Append 1 widget 
    5757     $wid = false; 
     
    6060          $wid = $wid[0]; 
    6161     } 
    62       
     62 
    6363     # Append widgets 
    6464     if (!empty($addw)) 
     
    7373               $widgets_custom = new dcWidgets(); 
    7474          } 
    75            
     75 
    7676          foreach ($addw as $k => $v) 
    7777          { 
     
    9191               } 
    9292          } 
    93            
     93 
    9494          try { 
    9595               $core->blog->settings->addNamespace('widgets'); 
     
    151151          $_POST['w'] = array(); 
    152152     } 
    153       
     153 
    154154     try 
    155155     { 
     
    163163               } 
    164164          } 
    165            
     165 
    166166          if (!isset($_POST['w']['nav'])) { 
    167167               $_POST['w']['nav'] = array(); 
     
    173173               $_POST['w']['custom'] = array(); 
    174174          } 
    175            
     175 
    176176          $widgets_nav = dcWidgets::loadArray($_POST['w']['nav'],$__widgets); 
    177177          $widgets_extra = dcWidgets::loadArray($_POST['w']['extra'],$__widgets); 
    178178          $widgets_custom = dcWidgets::loadArray($_POST['w']['custom'],$__widgets); 
    179            
     179 
    180180          $core->blog->settings->addNamespace('widgets'); 
    181181          $core->blog->settings->widgets->put('widgets_nav',$widgets_nav->store()); 
     
    183183          $core->blog->settings->widgets->put('widgets_custom',$widgets_custom->store()); 
    184184          $core->blog->triggerBlog(); 
    185            
     185 
    186186          http::redirect($p_url); 
    187187     } 
     
    200200          $core->blog->settings->widgets->put('widgets_custom',''); 
    201201          $core->blog->triggerBlog(); 
    202            
     202 
    203203          http::redirect($p_url); 
    204204     } 
     
    218218          echo 
    219219               dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     220               dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 
    220221               dcPage::jsLoad('index.php?pf=widgets/widgets.js'); 
    221222  ?> 
    222   <?php  
    223      $core->auth->user_prefs->addWorkspace('accessibility');  
     223  <?php 
     224     $core->auth->user_prefs->addWorkspace('accessibility'); 
    224225     $user_dm_nodragdrop = $core->auth->user_prefs->accessibility->nodragdrop; 
    225226  ?> 
     
    325326     ($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : '').'</dt>'. 
    326327     '<dd>'; 
    327       
     328 
    328329     $w_settings = $w->settings(); 
    329330     if (empty($w_settings)) 
     
    350351                         break; 
    351352               } 
    352                 
     353 
    353354               $widget_elements->content .= 
    354355               '<li>'. 
     
    368369{ 
    369370     $res = '<h3>'.$title.'</h3>'; 
    370       
     371 
    371372     if (!($widgets instanceof dcWidgets)) 
    372373     { 
    373374          $widgets = $default_widgets; 
    374375     } 
    375       
     376 
    376377     $res .= '<ul id="'.$id.'" class="connected">'; 
    377       
     378 
    378379     $res .= '<li class="empty-widgets" '.(!$widgets->isEmpty() ? 'style="display: none;"' : '').'>'.__('No widget for now.').'</li>'; 
    379       
     380 
    380381     $i = 0; 
    381382     foreach ($widgets->elements() as $w) 
     
    383384          $upDisabled = $i == 0 ? '" disabled="" src="images/disabled_' : '" src="images/'; 
    384385          $downDisabled = $i == count($widgets->elements())-1 ? '" disabled="" src="images/disabled_' : '" src="images/'; 
    385            
     386 
    386387          $iname = 'w['.$pr.']['.$i.']'; 
    387            
     388 
    388389          $res .= 
    389390          '<li>'.form::hidden(array($iname.'[id]'),html::escapeHTML($w->id())). 
     
    399400          '<div class="widgetSettings hidden-if-drag">'.$w->formSettings($iname,$j).'</div>'. 
    400401          '</li>'; 
    401            
     402 
    402403          $i++; 
    403404          $j++; 
    404405     } 
    405       
     406 
    406407     $res .= '</ul>'; 
    407       
     408 
    408409     $res .= '<ul class="sortable-delete"'.($i > 0 ? '':' style="display: none;"').'><li class="sortable-delete-placeholder">'. 
    409410               __('Drag widgets here to remove.').'</li></ul>'; 
    410       
     411 
    411412     return $res; 
    412413} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map