Changeset 28593


Ignore:
Timestamp:
Jun 2, 2014, 5:26:14 PM (6 years ago)
Author:
mistic100
Message:

fix "missing image_ids" + clean buttons

Location:
extensions/UserCollections
Files:
1 added
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserCollections/include/events.inc.php

    r26854 r28593  
    198198
    199199  // toolbar button
    200   $template->set_filename('usercol_button', realpath(USER_COLLEC_PATH.'template/picture_button.tpl'));
     200  $template->set_filename('usercol_button', realpath(USER_COLLEC_PATH.'template/buttons/picture.tpl'));
    201201  $button = $template->parse('usercol_button', true);
    202202  $template->add_picture_button($button, 50);
  • extensions/UserCollections/template/buttons/clear.tpl

    r25678 r28593  
    1 <a href="{$U_CLEAR}" title="{'Clear this collection'|translate}" class="pwg-state-default pwg-button" rel="nofollow" onClick="return confirm('{'Are you sure?'|translate|escape:javascript}');">
    2   <span class="pwg-icon user-collections-clear-icon" style="background:url('{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/bin.png') center center no-repeat;">&nbsp;</span><span class="pwg-button-text">{'Clear'|translate}</span>
     1<a href="{$U_CLEAR}" title="{'Clear this collection'|translate}" class="pwg-state-default pwg-button" rel="nofollow"
     2  onClick="return confirm('{'Are you sure?'|translate|escape:javascript}');">
     3  <span class="pwg-icon user-collections-clear-icon">&nbsp;</span>
     4  <span class="pwg-button-text">{'Clear'|translate}</span>
    35</a>
  • extensions/UserCollections/template/buttons/delete.tpl

    r25678 r28593  
    1 <a href="{$U_DELETE}" title="{'Delete this collection'|translate}" class="pwg-state-default pwg-button" rel="nofollow" onClick="return confirm('{'Are you sure?'|translate|escape:javascript}');">
    2   <span class="pwg-icon user-collections-delete-icon" style="background:url('{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/delete.png') center center no-repeat;">&nbsp;</span><span class="pwg-button-text">{'Delete'|translate}</span>
     1<a href="{$U_DELETE}" title="{'Delete this collection'|translate}" class="pwg-state-default pwg-button" rel="nofollow"
     2  onClick="return confirm('{'Are you sure?'|translate|escape:javascript}');">
     3  <span class="pwg-icon user-collections-delete-icon">&nbsp;</span>
     4  <span class="pwg-button-text">{'Delete'|translate}</span>
    35</a>
  • extensions/UserCollections/template/buttons/mail.tpl

    r26058 r28593  
    11<a href="#mail_form" title="{'Send this collection by mail'|translate}" class="mail_colorbox_open pwg-state-default pwg-button" rel="nofollow">
    2   <span class="pwg-icon user-collections-mail-icon" style="background:url('{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/mail.png') center center no-repeat;">&nbsp;</span><span class="pwg-button-text">{'Send'|translate}</span>
     2  <span class="pwg-icon user-collections-mail-icon">&nbsp;</span>
     3  <span class="pwg-button-text">{'Send'|translate}</span>
    34</a>
  • extensions/UserCollections/template/buttons/share.tpl

    r25678 r28593  
    11<a href="#share_form" title="{'Share this collection'|translate}" class="share_colorbox_open pwg-state-default pwg-button" rel="nofollow">
    2   <span class="pwg-icon user-collections-share-icon" style="background:url('{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/share.png') center center no-repeat;">&nbsp;</span><span class="pwg-button-text">{'Share'|translate}</span>
     2  <span class="pwg-icon user-collections-share-icon">&nbsp;</span>
     3  <span class="pwg-button-text">{'Share'|translate}</span>
    34</a>
  • extensions/UserCollections/template/style_collections.css

    r25678 r28593  
    126126  filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#333333', endColorstr='#222222',GradientType=0 );
    127127}
     128
     129.user-collections-delete-icon {
     130  background:transparent url('resources/delete.png') center center no-repeat !important;
     131}
     132.user-collections-clear-icon {
     133  background:transparent url('resources/bin.png') center center no-repeat !important;
     134}
     135.user-collections-share-icon {
     136  background:transparent url('resources/share.png') center center no-repeat !important;
     137}
     138.user-collections-mail-icon {
     139  background:transparent url('resources/mail.png') center center no-repeat !important;
     140}
  • extensions/UserCollections/template/style_thumbnails.css

    r23551 r28593  
    4747  display:none;
    4848}
     49
     50.user-collections-icon {
     51  background:transparent url('resources/image_add.png') center center no-repeat !important;
     52}
  • extensions/UserCollections/template/thumbnails_css_js.tpl

    r27747 r28593  
    66var $cdm = jQuery('#collectionsDropdown');
    77
    8 {if not $IN_PICTURE}
    98$cdm.on('mouseleave', function() {
    109  $cdm.hide();
    1110});
    12 {/if}
    1311
    1412// click on "create collection" button
     
    3937      return;
    4038    }
     39   
     40    var first = $cdm.children('.noCollecMsg').length > 0;
    4141
    4242    jQuery.ajax({
     
    5151      success: function(data) {
    5252        if (data.stat == 'ok') {
    53           var col = data.result;
    54           var html = '<span>&#9733;</span> <a class="add" data-id="'+ col.id +'">'+ col.name +'</a> '
     53          var col = data.result,
     54              html =
     55            '<span>&#9733;</span> <a class="add" data-id="'+ col.id +'">'+ col.name +'</a> '
    5556            +'<span class="menuInfoCat">[<span class="nbImagesCollec-'+ col.id +'">'+ col.nb_images +'</span>]</span> '
    5657            +'<a class="remove" data-id="'+ col.id +'">{'(remove)'|translate|escape:javscript}</a>'
     
    5859
    5960          $cdm.children('.switchBoxFooter').before(html);
    60           $cdm.children('.noCollecMsg').remove();
     61         
     62          if (first) {
     63            $cdm.children('.noCollecMsg').remove();
     64            $cdm.children('.add').trigger('click');
     65          }
    6166        }
    6267        else {
     
    7782// add and remove links (delegate for new collections)
    7883$cdm.on('click', '.add, .remove', function(e) {
    79   var img_id = $cdm.data('img_id');
    80   var col_id = jQuery(this).data('id');
    81   var method = jQuery(this).hasClass('add') ? 'pwg.collections.addImages' : 'pwg.collections.removeImages';
     84  var img_id = $cdm.data('img_id'),
     85      col_id = jQuery(this).data('id'),
     86      method = jQuery(this).hasClass('add') ? 'pwg.collections.addImages' : 'pwg.collections.removeImages';
    8287
    8388  jQuery.ajax({
     
    97102
    98103        // update item datas
    99         var $target = jQuery('.addCollection[data-id="'+ img_id +'"]');
    100         var col_ids = $target.data('cols');
     104        var $target = jQuery('.addCollection[data-id="'+ img_id +'"]'),
     105            col_ids = $target.data('cols');
     106
    101107        if (method == 'pwg.collections.addImages' && col_ids.indexOf(col_id) == -1) {
    102108          col_ids[ col_ids.length ] = col_id;
     
    121127
    122128// main button, open the menu
    123 jQuery('#thumbnails').on('click', '.addCollection', function(e) {
    124   var img_id = jQuery(this).data('id');
    125   var col_ids = jQuery(this).data('cols');
     129jQuery(document).on('click', '.addCollection', function(e) {
     130  var img_id = jQuery(this).data('id'),
     131      col_ids = jQuery(this).data('cols');
    126132
    127133  $cdm.data('img_id', img_id);
    128134
    129135  $cdm.children('.add').each(function() {
    130     if (col_ids.indexOf($(this).data('id')) != -1) {
    131       $(this).css('font-weight', 'bold').next().next().show();
     136    if (col_ids.indexOf(jQuery(this).data('id')) != -1) {
     137      jQuery(this).css('font-weight', 'bold').next().next().show();
    132138    }
    133139    else {
    134       $(this).css('font-weight', 'normal').next().next().hide();
    135     }
    136   });
    137 
    138   {if not $IN_PICTURE}
     140      jQuery(this).css('font-weight', 'normal').next().next().hide();
     141    }
     142  });
     143
     144  {if $IN_PICTURE}
    139145  $cdm.css({
    140     'top': e.pageY-5-$(window).scrollTop(),
    141     'left': Math.min(e.pageX-jQuery(window).scrollLeft()-20, jQuery(window).width()-$cdm.outerWidth(true)-5)
    142   });
    143   $cdm.show();
     146    'left': Math.min(jQuery(this).offset().left, jQuery(window).width()-$cdm.outerWidth(true)-5),
     147    'top': jQuery(this).offset().top + jQuery(this).outerHeight(true)
     148  });
     149  {else}
     150  $cdm.css({
     151    'left': Math.min(e.pageX-jQuery(window).scrollLeft()-20, jQuery(window).width()-$cdm.outerWidth(true)-5),
     152    'top': e.pageY-5-$(window).scrollTop()
     153  });
    144154  {/if}
     155  $cdm.toggle();
    145156
    146157  e.preventDefault();
     
    173184{footer_script require='jquery'}
    174185jQuery('#thumbnails').on('click', '.addCollection', function(e) {
    175   var $trigger = jQuery(this);
    176   var img_id = jQuery(this).data('id');
    177   var col_id = {$collection.ID};
     186  var $trigger = jQuery(this),
     187      img_id = jQuery(this).data('id'),
     188      col_id = {$collection.ID};
    178189
    179190  jQuery.ajax({
Note: See TracChangeset for help on using the changeset viewer.