Changeset 3806 for extensions


Ignore:
Timestamp:
Aug 30, 2009, 9:31:13 PM (15 years ago)
Author:
nikrou
Message:

Feature 1144 : allow admin to choose mouse event to show medium picture

  • refactoring (only on javascript file)
  • bug fix : allow to choose click !
Location:
extensions/akBookStyle/trunk
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • extensions/akBookStyle/trunk/admin.php

    r3802 r3806  
    2525}
    2626
     27$ThumbnailsLocations = array('top','left','bottom','right');
     28$MouseEvents = array('click' => 'ak_event_click',
     29                     'mouseover' => 'ak_event_mouseover');
     30
    2731load_language('plugin.lang', AK_PLUGIN_LANG);
    2832
     
    4347  }
    4448
    45   if (!empty($_POST['ak_show_over']) && $_POST['ak_show_over']!=$me->ak_show_over) {
    46     $me->ak_show_over = ($_POST['ak_show_over']=='true')?'true':'false';
    47     array_push($GLOBALS['page']['infos'], $lang['ak_show_over_changed']);
     49  if (!empty($_POST['ak_mouse_event']) && $_POST['ak_mouse_event']!=$me->ak_mouse_event) {
     50    $me->ak_mouse_event = isset($MouseEvents[$_POST['ak_mouse_event']])?$_POST['ak_mouse_event']:'click';
     51    array_push($GLOBALS['page']['infos'], $lang['ak_mouse_event_changed']);
    4852    $save_config = true;
    4953  }
    5054
    5155  if (!empty($_POST['ak_thumbnails_loc']) && $_POST['ak_thumbnails_loc']!=$me->ak_thumbnails_loc) {
    52     $me->ak_thumbnails_loc = (in_array($_POST['ak_thumbnails_loc'],array('top','left','bottom','right')))?$_POST['ak_thumbnails_loc']:'left';
     56    $me->ak_thumbnails_loc = in_array($_POST['ak_thumbnails_loc'],$ThumbnailsLocations)?$_POST['ak_thumbnails_loc']:'left';
    5357    array_push($GLOBALS['page']['infos'], $lang['ak_thumbnails_loc_changed']);
    5458    $save_config = true;
     
    6367$GLOBALS['template']->assign('AK_BY_LINE', $me->ak_by_line);
    6468$GLOBALS['template']->assign('AK_THUMBNAIL_SIZE', $me->ak_thumbnail_size);
    65 $GLOBALS['template']->assign('AK_SHOW_OVER', $me->ak_show_over);
     69$GLOBALS['template']->assign('AK_MOUSE_EVENT', $me->ak_mouse_event);
     70$GLOBALS['template']->assign('AK_AVAILABLE_EVENTS', array_keys($MouseEvents));
     71$GLOBALS['template']->assign('AK_EVENTS_LABELS', array_values($MouseEvents));
    6672$GLOBALS['template']->assign('AK_THUMBNAILS_LOC', $me->ak_thumbnails_loc);
     73$GLOBALS['template']->assign('AK_THUMBNAILS_LOCATIONS', $ThumbnailsLocations);
    6774$GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
    6875?>
  • extensions/akBookStyle/trunk/css/ak_admin_style.css

    r3802 r3806  
    44}
    55
    6 fieldset p.field {
    7   text-align: center;
     6fieldset, fieldset p {
     7  text-align: left;
    88}
    99
  • extensions/akBookStyle/trunk/default_values.inc.php

    r3802 r3806  
    2727$default_values['ak_by_line'] = 2;
    2828$default_values['ak_thumbnail_size'] = 100;
    29 $default_values['ak_show_over'] = 'true';
     29$default_values['ak_mouse_event'] = 'click';
    3030$default_values['ak_thumbnails_loc'] = 'left';
    3131?>
  • extensions/akBookStyle/trunk/include/akContent.class.php

    r3804 r3806  
    5252    $template->assign('AK_PIC_SRC', get_image_url($images[$this->current_picture]));
    5353    $template->assign('AK_BY_LINE', $this->plugin_config->ak_by_line);
     54    $template->assign('AK_MOUSE_EVENT', $this->plugin_config->ak_mouse_event);
    5455    $template->assign('AK_THUMBNAIL_SIZE', $this->plugin_config->ak_thumbnail_size);
    5556    $template->assign('AK_RELOADED_IMAGE_TPL', AK_PLUGIN_TEMPLATE. '/ak_reloaded_image.tpl');
    56                 $template->assign('AK_VERTICAL_TPL', AK_PLUGIN_TEMPLATE. '/ak_vertical.tpl');
    57     if ($this->plugin_config->ak_show_over) $template->assign('AK_SHOW_OVER', $this->plugin_config->ak_show_over);
     57    $template->assign('AK_VERTICAL_TPL', AK_PLUGIN_TEMPLATE. '/ak_vertical.tpl');
    5858    $template->assign('AK_THUMBNAILS_LOC', $this->plugin_config->ak_thumbnails_loc);
    59     }
     59  }
    6060
    6161
  • extensions/akBookStyle/trunk/js/ak_jquery-load.js

    r3791 r3806  
    11$(function() {
    22    $("a.load")
    3       .click(function() {
     3      .bind(ak_mouse_event, function() {
    44          $('#akPicture').attr('src', $(this).children('img').attr('src').replace(dir_thumbnail+'\/'+prefix_thumbnail, ''));
    55          return false;
  • extensions/akBookStyle/trunk/language/en_UK/plugin.lang.php

    r3804 r3806  
    1111$lang['ak_by_line_changed'] = "Thumbnail size has been updated";
    1212
    13 $lang['ak_show_over'] = "Over mode";
    14 $lang['ak_show_over_changed'] = "Over mode has been changed";
     13$lang['ak_event_click'] = "click";
     14$lang['ak_event_mouseover'] = "mouseover";
     15$lang['ak_mouse_event'] = "Event to show medium picture.";
     16$lang['ak_mouse_event_changed'] = "Event to show medium picture has been updated.";
    1517$lang['ak_thumbnails_loc'] = "Thumbnails location";
    1618$lang['ak_thumbnails_loc_changed'] = "Thumbnails location has been changed";
    17 $lang['Top'] = "Top";
    18 $lang['Left'] = "Left";
    19 $lang['Bottom'] = "Bottom";
    20 $lang['Right'] = "Right";
     19$lang['top'] = "Top";
     20$lang['left'] = "Left";
     21$lang['bottom'] = "Bottom";
     22$lang['right'] = "Right";
    2123$lang['ak_by_column'] = '(or number of lines for Top/Bottom)';
    2224
  • extensions/akBookStyle/trunk/language/fr_FR/plugin.lang.php

    r3804 r3806  
    1111$lang['ak_by_line_changed'] = "La taille des imagette a été mis à jour";
    1212
     13$lang['ak_event_click'] = "clic";
     14$lang['ak_event_mouseover'] = "survol";
     15$lang['ak_mouse_event'] = "Evénement déclenchant l'affichage de l'image.";
     16$lang['ak_mouse_event_changed'] = "Le mode d'affichage de l'image a été modifié.";
    1317
    14 $lang['ak_show_over'] = "Mode survol";
    15 $lang['ak_show_over_changed'] = "Mode survol modifié.";
    1618$lang['ak_thumbnails_loc'] = "Position des miniatures";
    1719$lang['ak_thumbnails_loc_changed'] = "Position des miniatures modifiée.";
    18 $lang['Top'] = "au dessus";
    19 $lang['Left'] = "à gauche";
    20 $lang['Bottom'] = "en bas";
    21 $lang['Right'] = "à droite";
    22 $lang['ak_by_column'] = '(ou nombre de lignes si dessus ou en bas)';
     20$lang['top'] = "au dessus";
     21$lang['left'] = "à gauche";
     22$lang['bottom'] = "en bas";
     23$lang['right'] = "à droite";
     24$lang['ak_by_column'] = '(ou nombre de lignes, si dessus ou en bas)';
    2325
    2426?>
  • extensions/akBookStyle/trunk/language/it_IT/plugin.lang.php

    r3805 r3806  
    1111$lang['ak_by_line_changed'] = "Le dimenzioni delle imaginette sono state aggiornate";
    1212
     13$lang['ak_event_click'] = "click";
     14$lang['ak_event_mouseover'] = "mouseover";
     15$lang['ak_mouse_event'] = "Event to show medium picture.";
     16$lang['ak_mouse_event_changed'] = "Event to show medium picture has been updated.";
    1317
    14 $lang['ak_show_over'] = "Modo sorvolo";
    15 $lang['ak_show_over_changed'] = "Modo sorvolo modificato.";
    1618$lang['ak_thumbnails_loc'] = "Posizione delle miniature";
    1719$lang['ak_thumbnails_loc_changed'] = "Posizione delle miniature modificate.";
    18 $lang['Top'] = "sopra";
    19 $lang['Left'] = "a sinistra";
    20 $lang['Bottom'] = "sotto";
    21 $lang['Right'] = "a destra";
     20$lang['top'] = "sopra";
     21$lang['left'] = "a sinistra";
     22$lang['bottom'] = "sotto";
     23$lang['right'] = "a destra";
    2224$lang['ak_by_column'] = '(o numero di righe se sopra o sotto)';
    2325
  • extensions/akBookStyle/trunk/template/admin.tpl

    r3804 r3806  
    2525  </p>
    2626  <p class="field">
    27     <label>{'ak_show_over'|translate}
    28    {html_radios name='ak_show_over' values='true,false'|@explode output='Yes,No'|@explode|translate selected=$AK_SHOW_OVER}
     27    <label>{'ak_mouse_event'|translate}
     28   {html_radios name='ak_mouse_event' values=$AK_AVAILABLE_EVENTS output=$AK_EVENTS_LABELS|translate selected=$AK_MOUSE_EVENT}
    2929    </label>
    3030  </p>
    3131  <p class="field">
    3232    <label>{'ak_thumbnails_loc'|translate}
    33    {html_radios name='ak_thumbnails_loc' values='top,right,bottom,left'|@explode output='Top,Right,Bottom,Left'|@explode|translate selected=$AK_THUMBNAILS_LOC}
     33   {html_radios name='ak_thumbnails_loc' values=$AK_THUMBNAILS_LOCATIONS output=$AK_THUMBNAILS_LOCATIONS|translate selected=$AK_THUMBNAILS_LOC}
    3434    </label>
    3535  </p>
  • extensions/akBookStyle/trunk/template/ak_thumbnails.tpl

    r3804 r3806  
    4848<link rel="stylesheet" type="text/css" href="{$AK_PLUGIN_CSS}/ak_style.css">
    4949<script type="text/javascript">
    50 var dir_thumbnail = '{$AK_DIR_THUMBNAIL}';prefix_thumbnail = '{$AK_PREFIX_THUMBNAIL}';
     50var dir_thumbnail = '{$AK_DIR_THUMBNAIL}';prefix_thumbnail = '{$AK_PREFIX_THUMBNAIL}';var ak_mouse_event = '{$AK_MOUSE_EVENT}';
    5151</script>
    52 <script type="text/javascript" src="{$AK_PLUGIN_JS}/ak_jquery-load{if isset($AK_SHOW_OVER)}-hover{/if}.js"></script>
     52<script type="text/javascript" src="{$AK_PLUGIN_JS}/ak_jquery-load.js"></script>
    5353{/html_head}
Note: See TracChangeset for help on using the changeset viewer.