Changeset 5405 for extensions/pwgCumulus


Ignore:
Timestamp:
Mar 27, 2010, 5:57:14 PM (11 years ago)
Author:
nikrou
Message:

Change farbtastic by color picker to choose animation's colors
Make plugin compatible with piwigo 2.1

Location:
extensions/pwgCumulus
Files:
14 added
6 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • extensions/pwgCumulus/CHANGELOG

    r5323 r5405  
    33* traduction en espagnol, hongrois
    44* préparation pour gettext (les clés de traduction sont les valeurs en anglais)
     5* colorpicker pour choisir les couleurs de l'animation
    56
    67pwgCumulus 0.3.0 - 2009-02-28
  • extensions/pwgCumulus/MANIFEST

    r5323 r5405  
    66./template/tags.tpl
    77./template/admin.tpl
     8./js/colorpicker.js
    89./js/swfobject.js
    9 ./js/farbtastic.js
    1010./main.inc.php
    1111./default_values.inc.php
     
    1919./language/hu_HU/plugin.lang.php
    2020./CHANGELOG
     21./.dist/CREDITS
     22./.dist/imgs/cumulus3d.png
     23./.dist/MANIFEST
     24./.dist/maintain.inc.php
     25./.dist/rsync_exclude.txt
     26./.dist/template/tags.tpl
     27./.dist/template/admin.tpl
     28./.dist/js/swfobject.js
     29./.dist/js/farbtastic.js
     30./.dist/js/farbtastic.packed.js
     31./.dist/js/swfobject.packed.js
     32./.dist/main.inc.php
     33./.dist/default_values.inc.php
     34./.dist/language/fr_FR/description.txt
     35./.dist/language/fr_FR/plugin.lang.php
     36./.dist/language/templates/plugin.lang.php
     37./.dist/language/en_UK/plugin.lang.php
     38./.dist/language/es_ES/description.txt
     39./.dist/language/es_ES/plugin.lang.php
     40./.dist/language/hu_HU/description.txt
     41./.dist/language/hu_HU/plugin.lang.php
     42./.dist/CHANGELOG
     43./.dist/include/pwgCumulusContent.class.php
     44./.dist/include/pwgCumulusConfig.class.php
     45./.dist/swf/tagcloud.swf
     46./.dist/admin.php
     47./.dist/Makefile
     48./.dist/COPYING
     49./.dist/css/admin.css
     50./.dist/css/imgs/wheel.png
     51./.dist/css/imgs/mask.png
     52./.dist/css/imgs/marker.png
     53./.dist/css/farbtastic.css
     54./.dist/init.php
     55./.dist/public.php
     56./.dist/TODO
    2157./include/pwgCumulusContent.class.php
    2258./include/pwgCumulusConfig.class.php
     
    2662./COPYING
    2763./css/admin.css
    28 ./css/imgs/wheel.png
    29 ./css/imgs/mask.png
    30 ./css/imgs/marker.png
    31 ./css/farbtastic.css
     64./css/imgs/colorpicker_hex.png
     65./css/imgs/colorpicker_hsb_b.png
     66./css/imgs/colorpicker_rgb_g.png
     67./css/imgs/colorpicker_overlay.png
     68./css/imgs/colorpicker_rgb_b.png
     69./css/imgs/colorpicker_submit.png
     70./css/imgs/colorpicker_select.gif
     71./css/imgs/colorpicker_hsb_h.png
     72./css/imgs/colorpicker_indic.gif
     73./css/imgs/colorpicker_rgb_r.png
     74./css/imgs/colorpicker_hsb_s.png
     75./css/imgs/colorpicker_background.png
     76./css/colorpicker.css
    3277./init.php
    3378./public.php
    34 ./TODO
  • extensions/pwgCumulus/admin.php

    r5323 r5405  
    2323  die('Hacking attempt!');
    2424}
    25 
    26 add_event_handler('loc_end_page_header', 'pwg_cumulus_addAssets');
    2725
    2826load_language('plugin.lang', PWG_CUMULUS_PLUGIN_LANG);
     
    7169
    7270$GLOBALS['template']->set_filenames(array('plugin_admin_content' => PWG_CUMULUS_PLUGIN_TEMPLATE . '/admin.tpl'));
     71$GLOBALS['template']->assign('PWG_CUMULUS_PLUGIN_CSS', PWG_CUMULUS_PLUGIN_CSS);
     72$GLOBALS['template']->assign('PWG_CUMULUS_PLUGIN_JS', PWG_CUMULUS_PLUGIN_JS);
    7373$GLOBALS['template']->assign('PWG_CUMULUS_WIDTH', $me->pwg_cumulus_width);
    7474$GLOBALS['template']->assign('PWG_CUMULUS_HEIGHT', $me->pwg_cumulus_height);
     
    7878$GLOBALS['template']->assign('PWG_CUMULUS_HICOLOR', $me->pwg_cumulus_hicolor);
    7979$GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
    80 
    81 function pwg_cumulus_addAssets() {
    82   $css_format = '<link rel="stylesheet" type="text/css" href="%s/%s.css">'."\n";
    83   $js_format = '<script type="text/javascript" src="%s"></script>'."\n";
    84  
    85   $GLOBALS['template']->append('head_elements',
    86                                sprintf($css_format,
    87                                        PWG_CUMULUS_PLUGIN_CSS,
    88                                        'admin'
    89                                  )
    90     );
    91   $GLOBALS['template']->append('head_elements',
    92                                sprintf($css_format,
    93                                        PWG_CUMULUS_PLUGIN_CSS,
    94                                        'farbtastic'
    95                                  )
    96     );
    97   $GLOBALS['template']->func_known_script(array('id' => 'farbtastic',
    98                                                 'src' => PWG_CUMULUS_PLUGIN_JS. '/farbtastic.js'
    99                                             ),
    100                                           $GLOBALS['template']->smarty
    101     );
    102 
    103 
    104 }
    10580?>
  • extensions/pwgCumulus/default_values.inc.php

    r5323 r5405  
    2424$default_values['pwg_cumulus_coeff'] = 10;
    2525
    26 $default_values['color1'] = "#333333";
    27 $default_values['color2'] = "#FF3363";
    28 $default_values['hicolor'] = "#00CC00";
     26$default_values['color1'] = "333333";
     27$default_values['color2'] = "FF3363";
     28$default_values['hicolor'] = "00CC00";
    2929?>
  • extensions/pwgCumulus/include/pwgCumulusContent.class.php

    r5323 r5405  
    4646    $GLOBALS['template']->assign('PWG_CUMULUS_HREF', get_root_url().'tags.php?display_mode=cumulus');
    4747
    48     $GLOBALS['template']->assign('PWG_CUMULUS_COLOR1', '0x'.substr($this->plugin_config->pwg_cumulus_color1,1));
    49     $GLOBALS['template']->assign('PWG_CUMULUS_COLOR2', '0x'.substr($this->plugin_config->pwg_cumulus_color2,1));
    50     $GLOBALS['template']->assign('PWG_CUMULUS_HICOLOR', '0x'.substr($this->plugin_config->pwg_cumulus_hicolor,1));
     48    $GLOBALS['template']->assign('PWG_CUMULUS_COLOR1', '0x'.$this->plugin_config->pwg_cumulus_color1);
     49    $GLOBALS['template']->assign('PWG_CUMULUS_COLOR2', '0x'.$this->plugin_config->pwg_cumulus_color2);
     50    $GLOBALS['template']->assign('PWG_CUMULUS_HICOLOR', '0x'.$this->plugin_config->pwg_cumulus_hicolor);
    5151
    5252    if (!empty($GLOBALS['template']->smarty->_tpl_vars['tags'])) {
  • extensions/pwgCumulus/language/fr_FR/plugin.lang.php

    r5323 r5405  
    3232$lang['Coefficient for tags size updated'] = "Le coefficient multiplicateur des tags a été mis à jour";
    3333$lang['Show tag cloud in cumulus mode'] = "Utiliser le mode cumulus pour afficher le nuage de tags";
     34$lang['Animation colors'] = "Couleurs de l'animation";
    3435$lang['Color 1'] = "Couleur 1";
    3536$lang['Color 2'] = "Couleur 2";
  • extensions/pwgCumulus/language/templates/plugin.lang.php

    r5323 r5405  
    3232$lang['pwg_cumulus_coeff_changed'] = "Coefficient for tags size updated";
    3333$lang['show tag cloud in cumulus mode'] = "Show tag cloud in cumulus mode";
     34$lang['pwg_cumulus_color'] = "Animation colors";
    3435$lang['pwg_cumulus_color1'] = "Color 1";
    3536$lang['pwg_cumulus_color2'] = "Color 2";
  • extensions/pwgCumulus/template/admin.tpl

    r5323 r5405  
     1{html_head}
     2<link rel="stylesheet" type="text/css" href="{$PWG_CUMULUS_PLUGIN_CSS}/admin.css">
     3<link rel="stylesheet" type="text/css" href="{$PWG_CUMULUS_PLUGIN_CSS}/colorpicker.css">
     4{known_script id="jquery" src=$ROOT_URL|cat:"themes/default/js/jquery.packed.js"}
     5{known_script id="colorpicker" src="$PWG_CUMULUS_PLUGIN_JS/colorpicker.js"}
     6{literal}
     7<script type="text/javascript">
     8$(function() {
     9$('input.pwg-picker')
     10  .each(function() {
     11      if ($(this).val() !== undefined) {
     12        $(this).css('background-color', '#'+$(this).val());
     13      }
     14    })
     15  .ColorPicker({
     16    onSubmit: function(hsb, hex, rgb, el) {
     17        $(el).val(hex);
     18        $(el).ColorPickerHide();
     19        $(el).css('background-color', '#'+hex);
     20      },
     21    onBeforeShow: function () {
     22        $(this).ColorPickerSetColor(this.value);
     23      }
     24})
     25.bind('keyup', function(){
     26        $(this).ColorPickerSetColor(this.value);
     27});
     28});
     29</script>
     30{/literal}
     31{/html_head}
     32
    133<div class="titrePage">
    234  <h2>{'Cumulus Tags Cloud Plugin'|@translate}</h2>
     
    3870
    3971<fieldset>
    40   <legend>{'pwg_cumulus_colors'|@translate}</legend>
     72  <legend>{'Animation colors'|@translate}</legend>
    4173  <div id="picker" style="float: right;"></div>
    4274  <p class="field">
    4375    <label>{'Color 1'|@translate}
    44       <input class="colorwell" type="text" name="pwg_cumulus_color1" value="{$PWG_CUMULUS_COLOR1}">
     76      <input class="pwg-picker" type="text" name="pwg_cumulus_color1" value="{$PWG_CUMULUS_COLOR1}">
    4577    </label>     
    4678  </p>
    4779  <p class="field">
    4880    <label>{'Color 2'|@translate}
    49       <input class="colorwell" type="text" name="pwg_cumulus_color2" value="{$PWG_CUMULUS_COLOR2}">
     81      <input class="pwg-picker" type="text" name="pwg_cumulus_color2" value="{$PWG_CUMULUS_COLOR2}">
    5082    </label>     
    5183  </p>
    5284  <p class="field">
    5385    <label>{'Mouseover color'|@translate}
    54       <input class="colorwell" type="text" name="pwg_cumulus_hicolor" value="{$PWG_CUMULUS_HICOLOR}">
     86      <input class="pwg-picker" type="text" name="pwg_cumulus_hicolor" value="{$PWG_CUMULUS_HICOLOR}">
    5587    </label>     
    5688  </p>
Note: See TracChangeset for help on using the changeset viewer.