Changeset 28806


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...)

Location:
trunk/admin/themes/default
Files:
1 added
4 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({
  • trunk/admin/themes/default/template/include/add_album.inc.tpl

    r28703 r28806  
    1 {include file='include/colorbox.inc.tpl'}
     1{if empty($load_mode)}{$load_mode='footer'}{/if}
     2{include file='include/colorbox.inc.tpl' load_mode=$load_mode}
    23
    34{assign var="selectizeTheme" value=($themeconf.name=='roma')|ternary:'dark':'default'}
     
    56{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.`$selectizeTheme`.css"}
    67
    7 {combine_script id='addAlbum.js' load='footer' require='jquery.colorbox' path='admin/themes/default/js/addAlbum.js'}
     8{combine_script id='addAlbum' load=$load_mode path='admin/themes/default/js/addAlbum.js'}
    89
    910<div style="display:none">
  • trunk/admin/themes/default/template/include/colorbox.inc.tpl

    r28533 r28806  
    1 {combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
     1{if empty($load_mode)}{$load_mode='footer'}{/if}
     2{combine_script id='jquery.colorbox' load=$load_mode require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
    23{combine_css id='jquery.colorbox' path="themes/default/js/plugins/colorbox/style2/colorbox.css"}
  • trunk/admin/themes/default/template/include/datepicker.inc.tpl

    r28765 r28806  
    1 {combine_script id='jquery.ui.timepicker-addon' load='footer' require='jquery.ui.datepicker,jquery.ui.slider' path="themes/default/js/ui/jquery.ui.timepicker-addon.js"}
    2 {combine_script id='datepicker.js' load='footer' require='jquery.ui.timepicker-addon' path='admin/themes/default/js/datepicker.js'}
     1{if empty($load_mode)}{$load_mode='footer'}{/if}
     2{combine_script id='jquery.ui.timepicker-addon' load=$load_mode require='jquery.ui.datepicker,jquery.ui.slider' path="themes/default/js/ui/jquery.ui.timepicker-addon.js"}
     3{combine_script id='datepicker' load=$load_mode require='jquery.ui.timepicker-addon' path='admin/themes/default/js/datepicker.js'}
    34
    45{assign var="datepicker_language" value="themes/default/js/ui/i18n/jquery.ui.datepicker-`$lang_info.code`.js"}
    56{if "PHPWG_ROOT_PATH"|@constant|@cat:$datepicker_language|@file_exists}
    6 {combine_script id="jquery.ui.datepicker-$lang_info.code" load='footer' require='jquery.ui.datepicker' path=$datepicker_language}
     7{combine_script id="jquery.ui.datepicker-$lang_info.code" load=$load_mode require='jquery.ui.datepicker' path=$datepicker_language}
    78{/if}
    89
    910{assign var="timepicker_language" value="themes/default/js/ui/i18n/jquery.ui.timepicker-`$lang_info.code`.js"}
    1011{if "PHPWG_ROOT_PATH"|@constant|@cat:$datepicker_language|@file_exists}
    11 {combine_script id="jquery.ui.timepicker-$lang_info.code" load='footer' require='jquery.ui.timepicker-addon' path=$timepicker_language}
     12{combine_script id="jquery.ui.timepicker-$lang_info.code" load=$load_mode require='jquery.ui.timepicker-addon' path=$timepicker_language}
    1213{/if}
    1314
Note: See TracChangeset for help on using the changeset viewer.