Changeset 7995


Ignore:
Timestamp:
Dec 4, 2010, 9:32:44 PM (10 years ago)
Author:
rvelices
Message:

trunk admin theme goes with combine_script instead of old style known_script

Location:
trunk
Files:
25 edited

Legend:

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

    r6993 r7995  
    1 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js" }
    2 {known_script id="jquery.ui.accordion" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.accordion.packed.js" }
    3 {known_script id="jquery.tipTip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.tipTip.minified.js" }
    4 
    5 <script type="text/javascript">
    6 jQuery().ready(function(){ldelim}
    7   jQuery('#menubar').accordion({ldelim}
    8     header: "dt.rdion",
    9     event: "click",
    10     autoHeight: false,
    11     active: {$ACTIVE_MENU}
    12   });
     1{combine_script id='jquery.ui' load='header' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js' }
     2{combine_script id='jquery.ui.accordion' load='header' require='jquery.ui' path='themes/default/js/ui/packed/ui.accordion.packed.js' }
     3{footer_script require='jquery.ui.accordion'}
     4jQuery(document).ready(function(){ldelim}
     5        jQuery('#menubar').accordion({ldelim}
     6                header: "dt.rdion",
     7                event: "click",
     8                autoHeight: false,
     9                active: {$ACTIVE_MENU}
     10        });
    1311});
    14 </script>
     12{/footer_script}
    1513
    1614<div id="menubar">
     
    105103  {/if}
    106104  {if isset($U_HELP)}
     105        {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
    107106  <ul class="HelpActions">
    108107    <li><a href="{$U_HELP}" onclick="popuphelp(this.href); return false;" title="{'Help'|@translate}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/help.png" class="button" alt="(?)"></a></li>
  • trunk/admin/themes/default/template/cat_list.tpl

    r7024 r7995  
    1 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
    2 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js" }
    3 {known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.sortable.packed.js" }
     1{combine_script id='jquery.ui' load='async' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js' }
     2{combine_script id='jquery.ui.sortable' load='async' require='jquery.ui' path='themes/default/js/ui/packed/ui.sortable.packed.js' }
     3{footer_script require='jquery.ui.sortable'}
     4jQuery(document).ready(function(){ldelim}
     5        jQuery(".catPos").hide();
     6        jQuery(".drag_button").show();
     7        jQuery(".categoryLi").css("cursor","move");
     8        jQuery(".categoryUl").sortable({ldelim}
     9                axis: "y",
     10                opacity: 0.8
     11        });
     12        jQuery("#categoryOrdering").submit(function(){ldelim}
     13                ar = jQuery('.categoryUl').sortable('toArray');
     14                for(i=0;i<ar.length;i++) {ldelim}
     15                        cat = ar[i].split('cat_');
     16                        document.getElementsByName('catOrd[' + cat[1] + ']')[0].value = i;
     17                }
     18        });
    419
    5 <script type="text/javascript">
    6   jQuery().ready(function(){ldelim}
    7     jQuery(".catPos").hide();
    8     jQuery(".drag_button").show();
    9     jQuery(".categoryLi").css("cursor","move");
    10     jQuery(".categoryUl").sortable({ldelim}
    11       axis: "y",
    12       opacity: 0.8
    13     });
    14     jQuery("#categoryOrdering").submit(function(){ldelim}
    15       ar = jQuery('.categoryUl').sortable('toArray');
    16       for(i=0;i<ar.length;i++) {ldelim}
    17         cat = ar[i].split('cat_');
    18         document.getElementsByName('catOrd[' + cat[1] + ']')[0].value = i;
    19       }
    20     });
    21 
    22     jQuery("input[name=order_type]").click(function () {ldelim}
    23       jQuery("#automatic_order_params").hide();
    24       if (jQuery("input[name=order_type]:checked").val() == "automatic") {ldelim}
    25         jQuery("#automatic_order_params").show();
    26       }
    27     });
    28   });
    29 </script>
     20        jQuery("input[name=order_type]").click(function () {ldelim}
     21                jQuery("#automatic_order_params").hide();
     22                if (jQuery("input[name=order_type]:checked").val() == "automatic") {ldelim}
     23                        jQuery("#automatic_order_params").show();
     24                }
     25        });
     26});
     27{/footer_script}
    3028
    3129<h2>{'Album list management'|@translate}</h2>
  • trunk/admin/themes/default/template/element_set_global.tpl

    r6988 r7995  
    22{include file='include/datepicker.inc.tpl'}
    33
    4 {literal}
    5 <script type="text/javascript">
    6   pwg_initialization_datepicker("#date_creation_day", "#date_creation_month", "#date_creation_year", "#date_creation_linked_date", "#date_creation_action_set");
     4{footer_script}{literal}
     5        pwg_initialization_datepicker("#date_creation_day", "#date_creation_month", "#date_creation_year", "#date_creation_linked_date", "#date_creation_action_set");
    76</script>
    8 {/literal}
    9 
    10 {known_script id="jquery.fcbkcomplete" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.fcbkcomplete.js"}
    11 {literal}
    12 <script type="text/javascript">
    13   $(document).ready(function() {
    14     $("#tags").fcbkcomplete({
    15       json_url: "admin.php?fckb_tags=1",
    16       cache: false,
    17       filter_case: false,
    18       filter_hide: true,
    19       firstselected: true,
    20       filter_selected: true,
    21       maxitems: 100,
    22       newel: true
    23     });
    24   });
    25 </script>
    26 {/literal}
     7{/literal}{/footer_script}
     8
     9{combine_script id='jquery.fcbkcomplete' load='async' require='jquery' path='themes/default/js/plugins/jquery.fcbkcomplete.js'}
     10{footer_script require='jquery.fcbkcomplete'}{literal}
     11jQuery(document).ready(function() {
     12        jQuery("#tags").fcbkcomplete({
     13                json_url: "admin.php?fckb_tags=1",
     14                cache: false,
     15                filter_case: false,
     16                filter_hide: true,
     17                firstselected: true,
     18                filter_selected: true,
     19                maxitems: 100,
     20                newel: true
     21        });
     22});
     23{/literal}{/footer_script}
    2724
    2825<h2>{'Batch management'|@translate}</h2>
  • trunk/admin/themes/default/template/element_set_ranks.tpl

    r6951 r7995  
    1 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
    2 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js" }
    3 {known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.sortable.packed.js" }
    4 {html_head}
    5 {literal}
    6 <script type="text/javascript">
    7   $(function() {
    8   $('ul.thumbnails')
    9   .sortable(
    10   { revert: true,
    11   opacity: 0.7,
    12   handle: $('.rank-of-image').add('.rank-of-image img'),
    13   update: function() {
    14   $(this).find('li').each(function(i) {
    15   $(this).find("input[name^=rank_of_image]")
    16   .each(function() { $(this).attr('value', (i+1)*10)});
    17   });
    18   $('#image_order_rank').attr('checked', true);
    19   }
    20   });
    21   });
    22 
    23 </script>
    24 {/literal}
    25 {/html_head}
     1{combine_script id='jquery.ui' load='async' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js' }
     2{combine_script id='jquery.ui.sortable' load='async' require='jquery.ui' path='themes/default/js/ui/packed/ui.sortable.packed.js' }
     3{footer_script require='jquery.ui.sortable'}{literal}
     4jQuery(document).ready(function() {
     5        jQuery('ul.thumbnails').sortable( {
     6                revert: true,   opacity: 0.7,
     7                handle: $('.rank-of-image').add('.rank-of-image img'),
     8                update: function() {
     9                        $(this).find('li').each(function(i) {
     10                        $(this).find("input[name^=rank_of_image]")
     11                        .each(function() { $(this).attr('value', (i+1)*10)});
     12                        });
     13                        $('#image_order_rank').attr('checked', true);
     14                        }
     15        });
     16});
     17{/literal}{/footer_script}
    2618
    2719<h2>{'Manage image ranks'|@translate}</h2>
  • trunk/admin/themes/default/template/element_set_unit.tpl

    r6587 r7995  
    33{include file='include/datepicker.inc.tpl'}
    44
    5 {known_script id="jquery.fcbkcomplete" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.fcbkcomplete.js"}
    6 {html_head}
    7 <script type="text/javascript">
    8   var tag_boxes_selector = "";
     5{combine_script id='jquery.fcbkcomplete' load='async' require='jquery' path='themes/default/js/plugins/jquery.fcbkcomplete.js'}
     6{footer_script require='jquery.fcbkcomplete'}
     7var tag_boxes_selector = "";
    98{foreach from=$elements item=element name=element}
    10   {if $smarty.foreach.element.first}
    11   var prefix = "";
    12   {else}
    13   prefix = ", ";
    14   {/if}
    15   tag_boxes_selector = tag_boxes_selector + prefix + "#tags-" + {$element.ID};
     9{if $smarty.foreach.element.first}
     10var prefix = "";
     11{else}
     12prefix = ", ";
     13{/if}
     14        tag_boxes_selector = tag_boxes_selector + prefix + "#tags-" + {$element.ID};
    1615{/foreach}
    1716{literal}
    18   $(document).ready(function() {
    19     $(tag_boxes_selector).fcbkcomplete({
    20       json_url: "admin.php?fckb_tags=1",
    21       cache: false,
    22       filter_case: false,
    23       filter_hide: true,
    24       firstselected: true,
    25       filter_selected: true,
    26       maxitems: 100,
    27       newel: true
    28     });
    29   });
    30 </script>
    31 {/literal}
    32 {/html_head}
     17jQuery(document).ready(function() {
     18        $(tag_boxes_selector).fcbkcomplete({
     19                json_url: "admin.php?fckb_tags=1",
     20                cache: false,
     21                filter_case: false,
     22                filter_hide: true,
     23                firstselected: true,
     24                filter_selected: true,
     25                maxitems: 100,
     26                newel: true
     27        });
     28});
     29{/literal}{/footer_script}
    3330
    3431<h2>{'Batch management'|@translate}</h2>
     
    9794               value="{$element.DATE_CREATION_YEAR}">
    9895        <input id="date_creation_linked_date-{$element.ID}" name="date_creation_linked_date-{$element.ID}" type="hidden" size="10" disabled="disabled">
    99         <script type="text/javascript">
     96        {footer_script}
    10097          pwg_initialization_datepicker("#date_creation_day-{$element.ID}", "#date_creation_month-{$element.ID}", "#date_creation_year-{$element.ID}", "#date_creation_linked_date-{$element.ID}", "#date_creation_action_set-{$element.ID}");
    101         </script>
     98        {/footer_script}
    10299      </td>
    103100    </tr>
  • trunk/admin/themes/default/template/footer.tpl

    r6365 r7995  
    4343</div> <!-- the_page -->
    4444
     45
     46{combine_script id='jquery.tipTip' load='async' path='themes/default/js/plugins/jquery.tipTip.minified.js'}
     47{footer_script require='jquery.tipTip'}
     48jQuery(document).ready(function() {ldelim}
     49        jQuery('#pwgHead A, #footer A, .themeActions A, .themeActions SPAN, .languageActions A, .languageActions SPAN').tipTip({ldelim}
     50                        'delay' : 0,
     51                        'fadeIn' : 200,
     52                        'fadeOut' : 200,
     53        });
     54});
     55{/footer_script}
     56
     57<!-- BEGIN get_combined_scripts -->
     58{get_combined_scripts load='footer'}
     59<!-- END get_combined_scripts -->
     60
    4561{literal}
    4662<script type='text/javascript'>
    47   $(function() {
    48     $('#pwgHead A, #footer A, .themeActions A, .themeActions SPAN, .languageActions A, .languageActions SPAN').tipTip({
    49         'delay' : 0,
    50         'fadeIn' : 200,
    51         'fadeOut' : 200,
    52     });
    53   });
    54 
    55   $(document).ready(function() {
     63  jQuery(document).ready(function() {
    5664    $("a.externalLink").click(function() {
    5765      window.open($(this).attr("href"));
  • trunk/admin/themes/default/template/header.tpl

    r7990 r7995  
    2222{/foreach}
    2323
    24 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=1} {*jQuery is always available by default*}
     24<!-- BEGIN get_combined_scripts -->
     25{get_combined_scripts load='header'}
     26<!-- END get_combined_scripts -->
    2527
    26 <script type="text/javascript" src="{$ROOT_URL}themes/default/js/scripts.js"></script>
     28{combine_script id='jquery' path='themes/default/js/jquery.packed.js}
     29
    2730<!--[if lt IE 7]>
    2831<script type="text/javascript" src="{$ROOT_URL}themes/default/js/pngfix.js"></script>
  • trunk/admin/themes/default/template/history.tpl

    r6993 r7995  
    22{include file='include/datepicker.inc.tpl'}
    33
    4 {literal}
    5 <script type="text/javascript">
    6   pwg_initialization_datepicker("#start_day", "#start_month", "#start_year", "#start_linked_date", null, null, "#end_linked_date");
    7   pwg_initialization_datepicker("#end_day", "#end_month", "#end_year", "#end_linked_date", null, "#start_linked_date", null);
    8 </script>
    9 {/literal}
     4{footer_script}{literal}
     5        pwg_initialization_datepicker("#start_day", "#start_month", "#start_year", "#start_linked_date", null, null, "#end_linked_date");
     6        pwg_initialization_datepicker("#end_day", "#end_month", "#end_year", "#end_linked_date", null, "#start_linked_date", null);
     7{/literal}{/footer_script}
    108
    119<div class="titrePage">
  • trunk/admin/themes/default/template/include/autosize.inc.tpl

    r5123 r7995  
    1 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
    2 {known_script id="jquery.autogrow" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.autogrow-textarea.js"}
    3 
     1{combine_script id='jquery' load='async' path='themes/default/js/jquery.packed.js'}
     2{combine_script id='jquery.autogrow' load='async' require='jquery' path='themes/default/js/plugins/jquery.autogrow-textarea.js'}
    43{* Auto size and auto grow textarea *}
    5 {literal}
    6 <script type="text/javascript">
    7   jQuery().ready(function(){
    8     jQuery('textarea').css('overflow-y', 'hidden');
    9     // Auto size and auto grow for all text area
    10     jQuery('textarea').autogrow();
    11   });
    12 </script>
    13 {/literal}
     4{footer_script require='jquery.autogrow'}{literal}
     5jQuery(document).ready(function(){
     6        jQuery('textarea').css('overflow-y', 'hidden');
     7        // Auto size and auto grow for all text area
     8        jQuery('textarea').autogrow();
     9});
     10{/literal}{/footer_script}
  • trunk/admin/themes/default/template/include/datepicker.inc.tpl

    r5200 r7995  
    1 
    2 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
    3 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
    4 {known_script id="jquery.ui.datepicker" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.datepicker.packed.js"}
    5 {known_script id="datepicker.js" src=$ROOT_URL|@cat:"themes/default/js/datepicker.js"}
     1{combine_script id='jquery' load='footer' path='themes/default/js/jquery.packed.js'}
     2{combine_script id='jquery.ui' load='footer' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js'}
     3{combine_script id='jquery.ui.datepicker' load='footer' require='jquery.ui' path='themes/default/js/ui/packed/ui.datepicker.packed.js'}
     4{combine_script id='datepicker.js' load='footer' require='jquery.ui.datepicker' path='themes/default/js/datepicker.js'}
    65
    76{assign var="datepicker_language" value="themes/default/js/ui/i18n/ui.datepicker-"|@cat:$lang_info.code|@cat:".js"}
    87
    98{if "PHPWG_ROOT_PATH"|@constant|@cat:$datepicker_language|@file_exists}
    10 {known_script id="jquery.ui.datepicker-$lang_info.code" src=$ROOT_URL|@cat:$datepicker_language}
     9{combine_script id="jquery.ui.datepicker-$lang_info.code" path=$datepicker_language}
    1110{/if}
    1211
     
    1514{/html_head}
    1615
    17 <script type="text/javascript">
     16{footer_script}
    1817function pwg_initialization_datepicker(day, month, year, linked_date, checked_on_change, min_linked_date, max_linked_date)
    1918{ldelim}
     
    2120    "{$ROOT_URL}{$themeconf.admin_icon_dir}/datepicker.png",
    2221    day, month, year, linked_date, checked_on_change, min_linked_date, max_linked_date);
    23 }
    24 </script>
     22};
     23{/footer_script}
  • trunk/admin/themes/default/template/include/dbselect.inc.tpl

    r5123 r7995  
    1 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
    2 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
    3 {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"}
    4 
    5 {* Resize possible *}
    6 {literal}
    7 <script type="text/javascript">
    8   jQuery().ready(function(){
    9     // Resize possible for double select list
    10     jQuery(".doubleSelect select.categoryList").resizable({
    11       handles: "w,e",
    12       animate: true,
    13       animateDuration: "slow",
    14       animateEasing: "swing",
    15       preventDefault: true,
    16       preserveCursor: true,
    17       autoHide: true,
    18       ghost: true
    19     });
    20   });
    21 </script>
    22 {/literal}
     1{combine_script id='jquery' load='async' path='themes/default/js/jquery.packed.js'}
     2{combine_script id='jquery.ui' load='async' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js' }
     3{combine_script id='jquery.ui.resizable' load='async' require='jquery.ui' path='themes/default/js/ui/packed/ui.resizable.packed.js' }
     4{footer_script require='jquery.ui.resizable'}{literal}
     5jQuery(document).ready(function(){
     6        // Resize possible for double select list
     7        jQuery(".doubleSelect select.categoryList").resizable({
     8                handles: "w,e",
     9                animate: true,
     10                animateDuration: "slow",
     11                animateEasing: "swing",
     12                preventDefault: true,
     13                preserveCursor: true,
     14                autoHide: true,
     15                ghost: true
     16        });
     17});
     18{/literal}{/footer_script}
  • trunk/admin/themes/default/template/include/resize.inc.tpl

    r5123 r7995  
    1 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
    2 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
    3 {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"}
     1{combine_script id='jquery' load='async' path='themes/default/js/jquery.packed.js'}
     2{combine_script id='jquery.ui' load='async' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js'}
     3{combine_script id='jquery.ui.resizable' load='async' require='jquery.ui' path='themes/default/js/ui/packed/ui.resizable.packed.js'}
    44
    55{* Resize possible *}
    6 {literal}
    7 <script type="text/javascript">
     6{footer_script require='jquery.ui.resizable'}{literal}
    87  jQuery().ready(function(){
    98    // Resize possible for list
     
    1918    });
    2019  });
    21 </script>
    22 {/literal}
     20{/literal}{/footer_script}
  • trunk/admin/themes/default/template/intro.tpl

    r6565 r7995  
    1 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
    2 {known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"}
     1{combine_script id='jquery.cluetip' load='async' require='jquery' path='themes/default/js/plugins/jquery.cluetip.packed.js'}
    32
    4 <script type="text/javascript">
     3{footer_script require='jquery.cluetip'}
    54jQuery().ready(function(){ldelim}
    6   jQuery('.cluetip').cluetip({ldelim}
    7     width: 300,
    8     splitTitle: '|',
    9     positionBy: 'bottomTop'
    10   });
     5        jQuery('.cluetip').cluetip({ldelim}
     6                width: 300,
     7                splitTitle: '|',
     8                positionBy: 'bottomTop'
     9        });
    1110});
    12 </script>
     11{/footer_script}
    1312
    1413<h2>{'Piwigo administration'|@translate}</h2>
  • trunk/admin/themes/default/template/languages_new.tpl

    r6363 r7995  
    1 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
    2 {known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"}
     1{combine_script id='jquery.cluetip' load='async' require='jquery' path='themes/default/js/plugins/jquery.cluetip.packed.js'}
    32
    4 <script type="text/javascript">
     3{footer_script require='jquery.cluetip'}
    54jQuery().ready(function(){ldelim}
    6   jQuery('.cluetip').cluetip({ldelim}
    7     width: 300,
    8     splitTitle: '|'
    9   });
     5        jQuery('.cluetip').cluetip({ldelim}
     6                width: 300,
     7                splitTitle: '|'
     8        });
    109});
    11 </script>
     10{/footer_script}
    1211
    1312<div class="titrePage">
  • trunk/admin/themes/default/template/menubar.tpl

    r6656 r7995  
    1 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
    2 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js" }
    3 {known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.sortable.packed.js" }
    4 
    5 <script type="text/javascript">
    6   jQuery().ready(function(){ldelim}
    7     jQuery(".menuPos").hide();
    8     jQuery(".drag_button").show();
    9     jQuery(".menuLi").css("cursor","move");
    10     jQuery(".menuUl").sortable({ldelim}
    11       axis: "y",
    12       opacity: 0.8
    13     });
    14     jQuery("input[name^='hide_']").click(function() {ldelim}
    15       men = this.name.split('hide_');
    16       if (this.checked) {ldelim}
    17         jQuery("#menu_"+men[1]).addClass('menuLi_hidden');
    18       } else {ldelim}
    19         jQuery("#menu_"+men[1]).removeClass('menuLi_hidden');
    20       }
    21     });
    22     jQuery("#menuOrdering").submit(function(){ldelim}
    23       ar = jQuery('.menuUl').sortable('toArray');
    24       for(i=0;i<ar.length;i++) {ldelim}
    25         men = ar[i].split('menu_');
    26         document.getElementsByName('pos_' + men[1])[0].value = i+1;
    27       }
    28     });
    29   });
    30 </script>
     1{combine_script id='jquery.ui' load='async' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js' }
     2{combine_script id='jquery.ui.sortable' load='async' require='jquery.ui' path='themes/default/js/ui/packed/ui.sortable.packed.js' }
     3{footer_script require='jquery.ui.sortable'}
     4jQuery(document).ready(function(){ldelim}
     5        jQuery(".menuPos").hide();
     6        jQuery(".drag_button").show();
     7        jQuery(".menuLi").css("cursor","move");
     8        jQuery(".menuUl").sortable({ldelim}
     9                axis: "y",
     10                opacity: 0.8
     11        });
     12        jQuery("input[name^='hide_']").click(function() {ldelim}
     13                men = this.name.split('hide_');
     14                if (this.checked) {ldelim}
     15                        jQuery("#menu_"+men[1]).addClass('menuLi_hidden');
     16                } else {ldelim}
     17                        jQuery("#menu_"+men[1]).removeClass('menuLi_hidden');
     18                }
     19        });
     20        jQuery("#menuOrdering").submit(function(){ldelim}
     21                ar = jQuery('.menuUl').sortable('toArray');
     22                for(i=0;i<ar.length;i++) {ldelim}
     23                        men = ar[i].split('menu_');
     24                        document.getElementsByName('pos_' + men[1])[0].value = i+1;
     25                }
     26        });
     27});
     28{/footer_script}
    3129
    3230<div class="titrePage">
  • trunk/admin/themes/default/template/photos_add_direct.tpl

    r6993 r7995  
    1 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
    2 {known_script id="jquery.jgrowl" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.jgrowl_minimized.js"}
     1{combine_script id='jquery.jgrowl' load='footer' require='jquery' path='themes/default/js/plugins/jquery.jgrowl_minimized.js' }
    32
    43{if $upload_mode eq 'multiple'}
    54<script type="text/javascript" src="{$uploadify_path}/swfobject.js"></script>
    6 <script type="text/javascript" src="{$uploadify_path}/jquery.uploadify.v2.1.0.min.js"></script>
     5{combine_script id='jquery.uploadify' load='footer' require='jquery' path='admin/include/uploadify/jquery.uploadify.v2.1.0.min.js' }
    76{/if}
    87{html_head}
     
    109{/html_head}
    1110
    12 {literal}
    13 <script type="text/javascript">
     11{footer_script}{literal}
    1412jQuery(document).ready(function(){
    1513  function checkUploadStart() {
     
    226224{/if}
    227225});
    228 </script>
     226{/footer_script}
    229227
    230228<div class="titrePage">
  • trunk/admin/themes/default/template/picture_modify.tpl

    r6993 r7995  
    33{include file='include/datepicker.inc.tpl'}
    44
    5 {known_script id="jquery.fcbkcomplete" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.fcbkcomplete.js"}
    6 {literal}
    7 <script type="text/javascript">
    8   $(document).ready(function() {
    9     $("#tags").fcbkcomplete({
    10       json_url: "admin.php?fckb_tags=1",
    11       cache: false,
    12       filter_case: false,
    13       filter_hide: true,
    14       firstselected: true,
    15       filter_selected: true,
    16       maxitems: 100,
    17       newel: true
    18     });
    19   });
    20 </script>
    21 {/literal}
    22 
    23 {literal}
    24 <script type="text/javascript">
    25   pwg_initialization_datepicker("#date_creation_day", "#date_creation_month", "#date_creation_year", "#date_creation_linked_date", "#date_creation_action_set");
    26 </script>
    27 {/literal}
     5{combine_script id='jquery.fcbkcomplete' load='async' require='jquery' path='themes/default/js/plugins/jquery.fcbkcomplete.js'}
     6{footer_script require='jquery.fcbkcomplete'}{literal}
     7jQuery(document).ready(function() {
     8        jQuery("#tags").fcbkcomplete({
     9                json_url: "admin.php?fckb_tags=1",
     10                cache: false,
     11                filter_case: false,
     12                filter_hide: true,
     13                firstselected: true,
     14                filter_selected: true,
     15                maxitems: 100,
     16                newel: true
     17        });
     18});
     19{/literal}{/footer_script}
     20
     21{footer_script}
     22pwg_initialization_datepicker("#date_creation_day", "#date_creation_month", "#date_creation_year", "#date_creation_linked_date", "#date_creation_action_set");
     23{/footer_script}
    2824
    2925<h2>{'Modify informations about a picture'|@translate}</h2>
  • trunk/admin/themes/default/template/plugins_new.tpl

    r6363 r7995  
    1 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js" }
    2 {known_script id="jquery.ui.effects" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/effects.core.packed.js" }
    3 {known_script id="jquery.ui.blind" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/effects.blind.packed.js" }
     1{combine_script id='jquery.ui' load='async' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js' }
     2{combine_script id='jquery.ui.effects' load='async' require='jquery.ui' path='themes/default/js/ui/packed/effects.core.packed.js' }
     3{combine_script id='jquery.ui.effects.blind' load='async' require='jquery.ui.effects' path='themes/default/js/ui/packed/effects.blind.packed.js' }
    44
    5 <script type="text/javascript">
    6 jQuery().ready(function(){ldelim}
    7   jQuery("td[id^='desc_']").click(function() {ldelim}
    8     id = this.id.split('_');
    9     nb_lines = jQuery("#bigdesc_"+id[1]).html().split('<br>').length;
     5{footer_script require='jquery.ui.effects.blind'}
     6jQuery(document).ready(function(){ldelim}
     7        jQuery("td[id^='desc_']").click(function() {ldelim}
     8                id = this.id.split('_');
     9                nb_lines = jQuery("#bigdesc_"+id[1]).html().split('<br>').length;
    1010
    11     $("#smalldesc_"+id[1]).toggle('blind', 1);
    12     if ($(this).hasClass('bigdesc')) {ldelim}
    13       $("#bigdesc_"+id[1]).toggle('blind', 1);
    14       $(this).removeClass('bigdesc');
    15     } else {ldelim}
    16       $("#bigdesc_"+id[1]).toggle('blind', 50 + (nb_lines * 30));
    17       $(this).addClass('bigdesc');
    18     }
    19     return false;
    20   });
     11                jQuery("#smalldesc_"+id[1]).toggle('blind', 1);
     12                if (jQuery(this).hasClass('bigdesc')) {ldelim}
     13                        jQuery("#bigdesc_"+id[1]).toggle('blind', 1);
     14                } else {ldelim}
     15                        jQuery("#bigdesc_"+id[1]).toggle('blind', 50 + (nb_lines * 30));
     16                }
     17                jQuery(this).toggleClass('bigdesc');
     18                return false;
     19        });
    2120});
    22 </script>
     21{/footer_script}
    2322
    2423<div class="titrePage">
  • trunk/admin/themes/default/template/plugins_update.tpl

    r6363 r7995  
    1 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
    2 {known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"}
    3 
    4 <script type="text/javascript">
     1{combine_script id='jquery.cluetip' load='async' require='jquery' path='themes/default/js/plugins/jquery.cluetip.packed.js'}
     2{footer_script require='jquery.cluetip'}
    53jQuery().ready(function(){ldelim}
    6   jQuery('.cluetip').cluetip({ldelim}
    7     width: 300,
    8     splitTitle: '|'
    9   });
     4        jQuery('.cluetip').cluetip({ldelim}
     5                width: 300,
     6                splitTitle: '|'
     7        });
    108});
    11 </script>
     9{/footer_script}
    1210
    1311<div class="titrePage">
  • trunk/admin/themes/default/template/popuphelp.tpl

    r6363 r7995  
    1 {known_script id="jquery.tipTip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.tipTip.minified.js" }
    2 
    31<div id="content" class="content">
    42{$HELP_CONTENT}
  • trunk/include/template.class.php

    r7987 r7995  
    4646  const COMBINED_SCRIPTS_TAG = '<!-- COMBINED_SCRIPTS -->';
    4747  var $scriptLoader;
    48   var $html_footer_raw_script = array();
    4948
    5049  const COMBINED_CSS_TAG = '<!-- COMBINED_CSS -->';
    5150  var $css_by_priority = array();
    52  
     51
    5352  function Template($root = ".", $theme= "", $path = "template")
    5453  {
     
    8079      }
    8180    }
    82    
     81
    8382    $compile_dir = $conf['local_data_dir'].'/templates_c';
    8483    mkgetdir( $compile_dir );
     
    188187      $this->smarty->compile_id = $save_compile_id;
    189188      file_put_contents($this->smarty->compile_dir.'/index.htm', 'Not allowed!');
     189      FileCombiner::clear_combined_files();
    190190  }
    191191
     
    408408      } //else maybe error or warning ?
    409409    }
    410    
     410
    411411    if(!empty($this->css_by_priority))
    412412    {
     
    529529    }
    530530  }
    531  
     531
    532532  function func_combine_script($params, &$smarty)
    533533  {
     
    547547      }
    548548    }
    549     $this->scriptLoader->add( $params['id'], $load, 
    550       empty($params['require']) ? array() : explode( ',', $params['require'] ), 
    551       @$params['path'], 
     549    $this->scriptLoader->add( $params['id'], $load,
     550      empty($params['require']) ? array() : explode( ',', $params['require'] ),
     551      @$params['path'],
    552552      isset($params['version']) ? $params['version'] : 0 );
    553553  }
     
    562562    $load = $params['load']=='header' ? 0 : 1;
    563563    $content = array();
    564    
     564
    565565    if ($load==0)
    566566    {
     
    579579          .'"></script>';
    580580      }
    581       if (count($this->html_footer_raw_script))
     581      if (count($this->scriptLoader->inline_scripts))
    582582      {
    583583        $content[]= '<script type="text/javascript">';
    584         $content = array_merge($content, $this->html_footer_raw_script);
     584        $content = array_merge($content, $this->scriptLoader->inline_scripts);
    585585        $content[]= '</script>';
    586586      }
     
    629629    if ( !empty($content) )
    630630    { // second call
    631       $this->html_footer_raw_script[] = $content;
    632     }
    633   }
    634  
     631      $this->scriptLoader->add_inline( $content, @$params['require'] );
     632    }
     633  }
     634
    635635  function func_combine_css($params, &$smarty)
    636636  {
     
    842842      $this->path = $path;
    843843  }
     844 
     845  function is_remote()
     846  {
     847    return url_is_remote( $this->path );
     848  }
    844849}
    845850
     
    850855{
    851856  private $registered_scripts;
     857  public $inline_scripts;
     858
    852859  private $did_head;
     860  private $head_done_scripts;
     861
    853862  private static $known_paths = array(
    854863      'core.scripts' => 'themes/default/js/scripts.js',
     
    865874  {
    866875    $this->registered_scripts = array();
     876    $this->inline_scripts = array();
     877    $this->head_done_scripts = array();
    867878    $this->did_head = false;
     879  }
     880
     881  function add_inline($code, $require)
     882  {
     883    if(!empty($require))
     884    {
     885      if(!isset($this->registered_scripts[$require]))
     886        fatal_error("inline script not found require $require");
     887      $s = $this->registered_scripts[$require];
     888      if($s->load_mode==2)
     889        $s->load_mode=1; // until now the implementation does not allow executing inline script depending on another async script
     890    }
     891    $this->inline_scripts[] = $code;
    868892  }
    869893
     
    900924  }
    901925
     926  function get_head_scripts()
     927  {
     928    self::check_load_dep($this->registered_scripts);
     929    foreach( array_keys($this->registered_scripts) as $id )
     930    {
     931      $this->compute_script_topological_order($id);
     932    }
     933
     934    uasort($this->registered_scripts, array('ScriptLoader', 'cmp_by_mode_and_order'));
     935
     936    foreach( $this->registered_scripts as $id => $script)
     937    {
     938      if ($script->load_mode > 0)
     939        break;
     940      if ( !empty($script->path) )
     941        $this->head_done_scripts[$id] = $script;
     942      else
     943        trigger_error("Script $id has an undefined path", E_USER_WARNING);
     944    }
     945    $this->did_head = true;
     946    return $this->head_done_scripts;
     947  }
     948
     949  function get_footer_scripts()
     950  {
     951    if (!$this->did_head)
     952    {
     953      trigger_error("Attempt to write footer scripts without header scripts", E_USER_ERROR );
     954    }
     955   
     956    $todo = array();
     957    foreach( $this->registered_scripts as $id => $script)
     958    {
     959      if (!isset($this->head_done_scripts[$id]))
     960      {
     961        $todo[$id] = $script;
     962      }
     963    }
     964    foreach( array_keys($todo) as $id )
     965    {
     966      $this->compute_script_topological_order($id);
     967    }
     968
     969    uasort($todo, array('ScriptLoader', 'cmp_by_mode_and_order'));
     970
     971   
     972    $result = array( array(), array() );
     973    foreach( $todo as $id => $script)
     974    {
     975      $result[$script->load_mode-1][$id] = $script;
     976    }
     977    return $result;
     978  }
     979
     980  private static function check_load_dep($scripts)
     981  {
     982    do
     983    {
     984      $changed = false;
     985      foreach( $scripts as $id => $script)
     986      {
     987        $load = $script->load_mode;
     988        if ($load==0)
     989          continue;
     990        foreach( $script->precedents as $precedent)
     991        {
     992          if ( !isset($scripts[$precedent] ) )
     993            continue;
     994          if ( $scripts[$precedent]->load_mode > $load )
     995          {
     996            $scripts[$precedent]->load_mode = $load;
     997            $changed = true;
     998          }
     999          if ($load==2 && $scripts[$precedent]->load_mode==2 && $script->is_remote() )
     1000          {// we are async -> a predecessor cannot be async unlesss it can be merged; otherwise script execution order is not guaranteed
     1001            $scripts[$precedent]->load_mode = 1;
     1002            $changed = true;
     1003          }
     1004        }
     1005      }
     1006    }
     1007    while ($changed);
     1008  }
     1009 
     1010 
    9021011  private static function fill_well_known($id, $script)
    9031012  {
     
    9131022        $script->precedents[] = 'jquery.ui';
    9141023    }
    915   }
    916 
    917   function get_head_scripts()
    918   {
    919     do
    920     {
    921       $changed = false;
    922       foreach( $this->registered_scripts as $id => $script)
    923       {
    924         $load = $script->load_mode;
    925         if ($load==0)
    926           continue;
    927         if ($load==2)
    928           $load=1; // we are async -> a predecessor cannot be async because the script execution order is not guaranteed
    929         foreach( $script->precedents as $precedent)
    930         {
    931           if ( !isset($this->registered_scripts[$precedent] ) )
    932           {
    933             trigger_error("Script $id requires undefined script $precedent", E_USER_WARNING);
    934             continue;
    935           }
    936           if ( $this->registered_scripts[$precedent]->load_mode > $load )
    937           {
    938             $this->registered_scripts[$precedent]->load_mode = $load;
    939             $changed = true;
    940           }
    941         }
    942       }
    943     }
    944     while ($changed);
    945 
    946     foreach( array_keys($this->registered_scripts) as $id )
    947     {
    948       $this->compute_script_topological_order($id);
    949     }
    950 
    951     uasort($this->registered_scripts, array('ScriptLoader', 'cmp_by_mode_and_order'));
    952 
    953     $result = array();
    954     foreach( $this->registered_scripts as $id => $script)
    955     {
    956       if ($script->load_mode > 0)
    957         break;
    958       if ( !empty($script->path) )
    959         $result[$id] = $script;
    960       else
    961         trigger_error("Script $id has an undefined path", E_USER_WARNING);
    962     }
    963     $this->did_head = true;
    964     return $result;
    965   }
    966 
    967   function get_footer_scripts()
    968   {
    969     if (!$this->did_head)
    970     {
    971       trigger_error("Attempt to write footer scripts without header scripts", E_USER_WARNING);
    972     }
    973     $result = array( array(), array() );
    974     foreach( $this->registered_scripts as $id => $script)
    975     {
    976       if ($script->load_mode > 0)
    977       {
    978         if ( !empty( $script->path ) )
    979         {
    980           $result[$script->load_mode-1][$id] = $script;
    981         }
    982         else
    983           trigger_error("Script $id has an undefined path", E_USER_WARNING);
    984       }
    985     }
    986     return $result;
    9871024  }
    9881025
     
    10091046  {
    10101047    $ret = $s1->load_mode - $s2->load_mode;
    1011     if (!$ret)
    1012       $ret = $s1->extra['order'] - $s2->extra['order'];
    1013     return $ret;
     1048    if ($ret) return $ret;
     1049   
     1050    $ret = $s1->extra['order'] - $s2->extra['order'];
     1051    if ($ret) return $ret;
     1052   
     1053    if ($s1->extra['order']==0 and ($s1->is_remote() xor $s2->is_remote()) )
     1054    {
     1055      return $s1->is_remote() ? -1 : 1;
     1056    }
     1057    return strcmp($s1->id,$s2->id);
    10141058  }
    10151059}
     
    10281072    $this->type = $type;
    10291073  }
     1074 
     1075  static function clear_combined_files()
     1076  {
     1077    $dir = opendir(PHPWG_ROOT_PATH.self::OUT_SUB_DIR);
     1078    while ($file = readdir($dir))
     1079    {
     1080      if ( get_extension($file)=='js' || get_extension($file)=='css')
     1081        unlink(PHPWG_ROOT_PATH.self::OUT_SUB_DIR.$file);
     1082    }
     1083    closedir($dir);
     1084  }
    10301085
    10311086  function add($file, $version)
     
    10781133
    10791134    $output = '';
    1080     if ($conf['debug_template'])
    1081       $output .= "/*".join("\n", $this->files)."*/\n";
     1135    $output .= "/* ".count($this->files)."\n".join("\n", $this->files)."*/\n";
    10821136    foreach ($this->files as $input_file)
    10831137    {
  • trunk/profile.php

    r6897 r7995  
    8585  $template->set_filename('profile', 'profile.tpl');
    8686  trigger_action('loc_end_profile');
    87   $template->parse('profile');
     87  $template->pparse('profile');
    8888  include(PHPWG_ROOT_PATH.'include/page_tail.php');
    8989}
  • trunk/themes/default/template/header.tpl

    r7987 r7995  
    3131{if isset($U_UP)          }<link rel="up" title="{'Thumbnails'|@translate}" href="{$U_UP}" >{/if}
    3232
    33 
    3433{get_combined_css}
    35 
    3634{foreach from=$themes item=theme}
    3735{if $theme.load_css}
  • trunk/themes/default/template/include/autosize.inc.tpl

    r5123 r7995  
    1 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
    2 {known_script id="jquery.autogrow" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.autogrow-textarea.js"}
    3 
     1{combine_script id='jquery' load='async' path='themes/default/js/jquery.packed.js'}
     2{combine_script id='jquery.autogrow' load='async' require='jquery' path='themes/default/js/plugins/jquery.autogrow-textarea.js'}
    43{* Auto size and auto grow textarea *}
    5 {literal}
    6 <script type="text/javascript">
    7   jQuery().ready(function(){
    8     jQuery('textarea').css('overflow-y', 'hidden');
    9     // Auto size and auto grow for all text area
    10     jQuery('textarea').autogrow();
    11   });
    12 </script>
    13 {/literal}
     4{footer_script require='jquery.autogrow'}{literal}
     5jQuery(document).ready(function(){
     6        jQuery('textarea').css('overflow-y', 'hidden');
     7        // Auto size and auto grow for all text area
     8        jQuery('textarea').autogrow();
     9});
     10{/literal}{/footer_script}
  • trunk/themes/default/template/include/resize.inc.tpl

    r7975 r7995  
    1 {combine_script id='jquery' load='footer' path='themes/default/js/jquery.packed.js'}
    2 {combine_script id='jquery.ui' load='footer' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js'}
    3 {combine_script id='jquery.ui.resizable' load='footer' require='jquery.ui' path='themes/default/js/ui/packed/ui.resizable.packed.js'}
     1{combine_script id='jquery' load='async' path='themes/default/js/jquery.packed.js'}
     2{combine_script id='jquery.ui' load='async' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js'}
     3{combine_script id='jquery.ui.resizable' load='async' require='jquery.ui' path='themes/default/js/ui/packed/ui.resizable.packed.js'}
    44
    55{* Resize possible *}
    6 {footer_script}{literal}
     6{footer_script require='jquery.ui.resizable'}{literal}
    77  jQuery().ready(function(){
    88    // Resize possible for list
     
    1919  });
    2020{/literal}{/footer_script}
    21 
Note: See TracChangeset for help on using the changeset viewer.