Ignore:
Timestamp:
Jun 26, 2014, 10:23:50 PM (10 years ago)
Author:
rvelices
Message:

moved around 100k of javascript from synchronous loading to async... (a lot more could be done...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/batch_manager_global.tpl

    r28765 r28806  
    1 {include file='include/tag_selection.inc.tpl'}
    2 {include file='include/datepicker.inc.tpl'}
    3 {include file='include/colorbox.inc.tpl'}
     1{include file='include/datepicker.inc.tpl' load_mode='async'}
     2{include file='include/colorbox.inc.tpl' load_mode='async'}
    43{include file='include/add_album.inc.tpl'}
    54
     
    1514{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.`$selectizeTheme`.css"}
    1615
    17 {combine_script id='jquery.progressBar' load='footer' path='themes/default/js/plugins/jquery.progressbar.min.js'}
    18 {combine_script id='jquery.ajaxmanager' load='footer' path='themes/default/js/plugins/jquery.ajaxmanager.js'}
    19 
    20 {footer_script}{literal}
    21 /* Shift-click: select all photos between the click and the shift+click */
     16{combine_script id='jquery.progressBar' load='async' path='themes/default/js/plugins/jquery.progressbar.min.js'}
     17{combine_script id='jquery.ajaxmanager' load='async' path='themes/default/js/plugins/jquery.ajaxmanager.js'}
     18
     19{combine_script id='batchManagerGlobal' load='async' require='jquery,datepicker,jquery.colorbox,addAlbum' path='admin/themes/default/js/batchManagerGlobal.js'}
     20
     21{footer_script}
     22var lang = {
     23        Cancel: '{'Cancel'|translate|escape:'javascript'}'
     24};
     25
    2226jQuery(document).ready(function() {
    23   var last_clicked=0;
    24   var last_clickedstatus=true;
    25   jQuery.fn.enableShiftClick = function() {
    26     var inputs = [];
    27     var count=0;
    28     this.find('input[type=checkbox]').each(function() {
    29       var pos=count;
    30       inputs[count++]=this;
    31       $(this).bind("shclick", function (dummy,event) {
    32         if (event.shiftKey) {
    33           var first = last_clicked;
    34           var last = pos;
    35           if (first > last) {
    36             first=pos;
    37             last=last_clicked;
    38           }
    39 
    40           for (var i=first; i<=last;i++) {
    41             input = $(inputs[i]);
    42             $(input).prop('checked', last_clickedstatus);
    43             if (last_clickedstatus)
    44             {
    45               $(input).siblings("span.wrap2").addClass("thumbSelected");
    46             }
    47             else
    48             {
    49               $(input).siblings("span.wrap2").removeClass("thumbSelected");
    50             }
    51           }
    52         }
    53         else {
    54           last_clicked = pos;
    55           last_clickedstatus = this.checked;
    56         }
    57         return true;
    58       });
    59       $(this).click(function(event) { $(this).triggerHandler("shclick",event)});
    60     });
    61   }
    62         $('ul.thumbnails').enableShiftClick();
    63 });
    64 {/literal}
    65 
    66 jQuery(document).ready(function() {ldelim}
    67   jQuery('[data-datepicker]').pwgDatepicker({
    68     showTimepicker: true,
    69     cancelButton: '{'Cancel'|translate}'
    70   });
    71 
    72   jQuery("a.preview-box").colorbox();
    73  
     27
    7428  {* <!-- TAGS --> *}
    7529  var tagsCache = new TagsCache({
Note: See TracChangeset for help on using the changeset viewer.