Dotclear

Changeset 2195:70e4c0552ecc


Ignore:
Timestamp:
10/01/13 23:43:29 (12 years ago)
Author:
Denis Jean-Chirstian <contact@…>
Branch:
dcRepo
Message:

Another way to toggle themes display

Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • admin/js/_blog_theme.js

    r2193 r2195  
    11$(function() { 
    2      $('.module-name').not('.current-theme .module-name').each(function(){ 
    3           $(this) 
    4                .toggleWithLegend($(this).parent().children('.module-infos'),{legend_click: true}) 
    5                .toggleWithLegend($(this).parent().children('.module-actions'),{legend_click: true, 
    6                     img_on_src: '', img_on_alt: '', img_off_src: '', img_off_alt: ''}); 
     2     $('.module-sshot').not('.current-theme .module-sshot').each(function(){ 
     3          var bar = $('<div>').addClass('bloc-toggler'); 
     4          $(this).after( 
     5          $(bar).toggleWithLegend($(this).parent().children('.toggle-bloc'),{ 
     6               img_on_src: dotclear.img_plus_theme_src, 
     7               img_on_alt: dotclear.img_plus_theme_alt, 
     8               img_off_src: dotclear.img_minus_theme_src, 
     9               img_off_alt: dotclear.img_minus_theme_alt,  
     10               legend_click: true 
     11          })); 
    712     }); 
    8 /* Exemple for toggle on screenshot 
    9      $('.module-sshot').not('.current-theme .module-name').each(function(){ 
    10           $(this).toggleWithLegend($(this).parent().children('.module-infos'),{ 
    11                img_on_src: '', 
    12                img_on_alt: '', 
    13                img_off_src: '', 
    14                img_off_alt: '',  
    15                legend_click: true 
    16           }); 
    17      }); 
    18 */ 
    1913}); 
  • admin/style/default.css

    r2194 r2195  
    15671567     margin-bottom: 1em; 
    15681568     } 
     1569.bloc-toggler { 
     1570     text-align: center; 
     1571} 
    15691572/* ------------------------------------------------------------------ categories.php */ 
    15701573#categories { 
  • inc/admin/lib.dc.page.php

    r2175 r2195  
    528528          self::jsVar('dotclear.img_menu_on','images/menu_on.png'). 
    529529          self::jsVar('dotclear.img_menu_off','images/menu_off.png'). 
     530           
     531          self::jsVar('dotclear.img_plus_theme_src','images/plus-theme.png'). 
     532          self::jsVar('dotclear.img_plus_theme_alt',__('uncover')). 
     533          self::jsVar('dotclear.img_minus_theme_src','images/minus-theme.png'). 
     534          self::jsVar('dotclear.img_minus_theme_alt',__('hide')). 
    530535 
    531536          self::jsVar('dotclear.msg.help', 
  • inc/admin/lib.moduleslist.php

    r2194 r2195  
    884884               } 
    885885 
     886               if (in_array('sshot', $cols)) { 
     887                    # Screenshot from url 
     888                    if (preg_match('#^http(s)?://#', $module['sshot'])) { 
     889                         $sshot = $module['sshot']; 
     890                    } 
     891                    # Screenshot from installed module 
     892                    elseif (file_exists($this->core->blog->themes_path.'/'.$id.'/screenshot.jpg')) { 
     893                         $sshot = $this->getPageURL('shot='.rawurlencode($id)); 
     894                    } 
     895                    # Default screenshot 
     896                    else { 
     897                         $sshot = 'images/noscreenshot.png'; 
     898                    } 
     899 
     900                    $line .=  
     901                    '<div class="module-sshot"><img src="'.$sshot.'" alt="'.__('screenshot.').'" /></div>'; 
     902               } 
     903 
    886904               $line .=  
    887                '<div class="module-infos">'. 
     905               '<div class="module-infos toggle-bloc">'. 
    888906               '<p>'; 
    889907 
     
    918936               '</div>'; 
    919937 
    920                if (in_array('sshot', $cols)) { 
    921                     # Screenshot from url 
    922                     if (preg_match('#^http(s)?://#', $module['sshot'])) { 
    923                          $sshot = $module['sshot']; 
    924                     } 
    925                     # Screenshot from installed module 
    926                     elseif (file_exists($this->core->blog->themes_path.'/'.$id.'/screenshot.jpg')) { 
    927                          $sshot = $this->getPageURL('shot='.rawurlencode($id)); 
    928                     } 
    929                     # Default screenshot 
    930                     else { 
    931                          $sshot = 'images/noscreenshot.png'; 
    932                     } 
    933  
    934                     $line .=  
    935                     '<div class="module-sshot"><img src="'.$sshot.'" alt="'.__('screenshot.').'" /></div>'; 
    936                } 
    937  
    938938               $line .=  
    939                '<div class="module-actions">'; 
     939               '<div class="module-actions toggle-bloc">'; 
    940940                
    941941               # _GET actions 
Note: See TracChangeset for help on using the changeset viewer.

Sites map