Ignore:
Timestamp:
Dec 21, 2013, 5:33:24 PM (10 years ago)
Author:
mistic100
Message:

update for Piwigo 2.6 + code clean

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/GuestBook/admin/template/pending.tpl

    r15940 r26065  
    1 {combine_css path=$GUESTBOOK_PATH|@cat:'admin/template/style.css'}
     1{combine_css path=$GUESTBOOK_PATH|cat:'admin/template/style.css'}
    22
    33<div class="titrePage">
    4   <h2>{'GuestBook'|@translate}</h2>
     4  <h2>GuestBook</h2>
    55</div>
    66
    7 {footer_script}{literal}
    8 jQuery(document).ready(function(){
    9   function highlighComments() {
    10     jQuery(".checkComment").each(function() {
    11       var parent = jQuery(this).parent('tr');
    12       if (jQuery(this).children("input[type=checkbox]").is(':checked')) {
    13         jQuery(parent).addClass('selectedComment');
    14       }
    15       else {
    16         jQuery(parent).removeClass('selectedComment');
    17       }
    18     });
     7{footer_script}
     8function highlighComments() {
     9  jQuery(".checkComment").each(function() {
     10    var parent = jQuery(this).parent('tr');
     11    if (jQuery(this).children("input[type=checkbox]").is(':checked')) {
     12      jQuery(parent).addClass('selectedComment');
     13    }
     14    else {
     15      jQuery(parent).removeClass('selectedComment');
     16    }
     17  });
     18}
     19
     20jQuery(".checkComment").click(function(event) {
     21  var checkbox = jQuery(this).children("input[type=checkbox]");
     22  if (event.target.type !== 'checkbox') {
     23    jQuery(checkbox).attr('checked', !jQuery(checkbox).is(':checked'));
    1924  }
     25  highlighComments();
     26});
    2027
    21   jQuery(".checkComment").click(function(event) {
    22     var checkbox = jQuery(this).children("input[type=checkbox]");
    23     if (event.target.type !== 'checkbox') {
    24       jQuery(checkbox).attr('checked', !jQuery(checkbox).is(':checked'));
    25     }
    26     highlighComments();
     28jQuery("#commentSelectAll").click(function() {
     29  jQuery(".checkComment input[type=checkbox]").attr('checked', true);
     30  highlighComments();
     31  return false;
     32});
     33
     34jQuery("#commentSelectNone").click(function() {
     35  jQuery(".checkComment input[type=checkbox]").attr('checked', false);
     36  highlighComments();
     37  return false;
     38});
     39
     40jQuery("#commentSelectInvert").click(function() {
     41  jQuery(".checkComment input[type=checkbox]").each(function() {
     42    jQuery(this).attr('checked', !$(this).is(':checked'));
    2743  });
     44  highlighComments();
     45  return false;
     46});
     47{/footer_script}
    2848
    29   jQuery("#commentSelectAll").click(function () {
    30     jQuery(".checkComment input[type=checkbox]").attr('checked', true);
    31     highlighComments();
    32     return false;
    33   });
    3449
    35   jQuery("#commentSelectNone").click(function () {
    36     jQuery(".checkComment input[type=checkbox]").attr('checked', false);
    37     highlighComments();
    38     return false;
    39   });
    40 
    41   jQuery("#commentSelectInvert").click(function () {
    42     jQuery(".checkComment input[type=checkbox]").each(function() {
    43       jQuery(this).attr('checked', !$(this).is(':checked'));
    44     });
    45     highlighComments();
    46     return false;
    47   });
    48 
    49 });
    50 {/literal}{/footer_script}
    51 
    52 {if !empty($comments) }
     50{if !empty($comments)}
    5351<form method="post" action="{$F_ACTION}" id="pendingComments">
    5452 
     
    7472
    7573  <p class="checkActions">
    76     {'Select:'|@translate}
    77     <a href="#" id="commentSelectAll">{'All'|@translate}</a>,
    78     <a href="#" id="commentSelectNone">{'None'|@translate}</a>,
    79     <a href="#" id="commentSelectInvert">{'Invert'|@translate}</a>
     74    {'Select:'|translate}
     75    <a href="#" id="commentSelectAll">{'All'|translate}</a>,
     76    <a href="#" id="commentSelectNone">{'None'|translate}</a>,
     77    <a href="#" id="commentSelectInvert">{'Invert'|translate}</a>
    8078  </p>
    8179
    8280  <p class="bottomButtons">
    83     <input class="submit" type="submit" name="validate" value="{'Validate'|@translate}">
    84     <input class="submit" type="submit" name="reject" value="{'Reject'|@translate}">
     81    <input class="submit" type="submit" name="validate" value="{'Validate'|translate}">
     82    <input class="submit" type="submit" name="reject" value="{'Reject'|translate}">
    8583  </p>
    8684
    8785</form>
    8886{else}
    89 {'No pending comment'|@translate}
     87{'No pending comment'|translate}
    9088{/if}
Note: See TracChangeset for help on using the changeset viewer.