Changeset 7975 for trunk/themes


Ignore:
Timestamp:
Dec 2, 2010, 8:46:30 PM (13 years ago)
Author:
rvelices
Message:

new template features: combine_script, footer_script and get_combined_scripts
migrated public templates only; need more code doc

Location:
trunk/themes/default/template
Files:
7 edited

Legend:

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

    r5244 r7975  
    1919  {/if}
    2020
     21{get_combined_scripts load='footer'}
    2122
    2223{if isset($footer_elements)}
  • trunk/themes/default/template/header.tpl

    r7474 r7975  
    4141
    4242{if not empty($page_refresh)    }<meta http-equiv="refresh" content="{$page_refresh.TIME};url={$page_refresh.U_REFRESH}">{/if}
    43 
     43{*
    4444<script type="text/javascript" src="{$ROOT_URL}themes/default/js/scripts.js"></script>
     45*}
    4546<!--[if lt IE 7]>
    4647<script type="text/javascript" src="{$ROOT_URL}themes/default/js/pngfix.js"></script>
    4748<![endif]-->
     49
     50{get_combined_scripts load='header'}
    4851
    4952{if not empty($head_elements)}
  • trunk/themes/default/template/include/datepicker.inc.tpl

    r7798 r7975  
    11
    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"}
     2{combine_script id='jquery' load='footer' path='themes/default/js/jquery.packed.js'}
     3{combine_script id='jquery.ui' load='footer' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js'}
     4{combine_script id='jquery.ui.datepicker' load='footer' require='jquery.ui' path='themes/default/js/ui/packed/ui.datepicker.packed.js'}
     5{combine_script id='datepicker.js' load='footer' require='jquery.ui.datepicker' path='themes/default/js/datepicker.js'}
    66
    77{assign var="datepicker_language" value="themes/default/js/ui/i18n/ui.datepicker-"|@cat:$lang_info.code|@cat:".js"}
    88
    99{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}
     10{combine_script id="jquery.ui.datepicker-$lang_info.code" path=$datepicker_language}
    1111{/if}
    1212
     
    1515{/html_head}
    1616
    17 <script type="text/javascript">
     17{footer_script}
    1818function pwg_initialization_datepicker(day, month, year, linked_date, checked_on_change, min_linked_date, max_linked_date)
    1919{ldelim}
     
    2222    day, month, year, linked_date, checked_on_change, min_linked_date, max_linked_date);
    2323}
    24 </script>
     24{/footer_script}
  • trunk/themes/default/template/include/resize.inc.tpl

    r5123 r7975  
    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='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'}
    44
    55{* Resize possible *}
    6 {literal}
    7 <script type="text/javascript">
     6{footer_script}{literal}
    87  jQuery().ready(function(){
    98    // Resize possible for list
     
    1918    });
    2019  });
    21 </script>
    22 {/literal}
     20{/literal}{/footer_script}
     21
  • trunk/themes/default/template/index.tpl

    r6951 r7975  
    2828
    2929      {if isset($U_SEARCH_RULES) }
     30                        {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
    3031      <li><a href="{$U_SEARCH_RULES}" onclick="popuphelp(this.href); return false;" title="{'Search rules'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/search_rules.png" class="button" alt="(?)"></a></li>
    3132      {/if}
  • trunk/themes/default/template/picture.tpl

    r7957 r7975  
    6060    {/if}
    6161    {if isset($U_CADDIE) }{*caddie management BEGIN*}
     62{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
    6263<script type="text/javascript">
    6364{literal}function addToCadie(aElement, rootUrl, id)
     
    209210                        {/if}
    210211                        {/foreach}
     212                        {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
     213                        {combine_script id='rating' load='async' require='core.scripts' path='themes/default/js/rating.js'}
    211214                        <script type="text/javascript">
    212215                                var _pwgRatingAutoQueue = _pwgRatingAutoQueue || [];
     
    214217                                        updateRateText: "{'Update your rating'|@translate|@escape:'javascript'}", updateRateElement: document.getElementById("updateRate"),
    215218                                        ratingSummaryText: "{'%.2f (rated %d times)'|@translate|@escape:'javascript'}", ratingSummaryElement: document.getElementById("ratingSummary") {rdelim} );
    216                                 (function () {ldelim}
     219                                /*(function () {ldelim}
    217220                                var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = '{$ROOT_URL}themes/default/js/rating.js';
    218221                                var s0 = document.getElementsByTagName('script')[0]; s0.parentNode.insertBefore(s, s0);
    219                                 })();
     222                                })();*/
    220223                        </script>
    221224                        </div>
     
    229232                <td class="label">{'Who can see this photo?'|@translate}</td>
    230233                <td class="value">
     234{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
    231235<script type="text/javascript">
    232236{literal}function setPrivacyLevel(selectElement, rootUrl, id, level)
  • trunk/themes/default/template/search.tpl

    r6951 r7975  
    11
    22{* Example of resizeable *}
    3 {*
     3
    44{include file='include/resize.inc.tpl'}
    5 *}
     5
    66
    77{* Example of datepicker *}
    8 {*
     8
    99{include file='include/datepicker.inc.tpl'}
    1010
    11 {literal}
    12 <script type="text/javascript">
     11{footer_script}{literal}
    1312  pwg_initialization_datepicker("#start_day", "#start_month", "#start_year", "#start_linked_date", null, null, "#end_linked_date");
    1413  pwg_initialization_datepicker("#end_day", "#end_month", "#end_year", "#end_linked_date", null, "#start_linked_date", null);
    1514 jQuery().ready(function(){ $(".date_today").hide(); });
    16 </script>
    17 {/literal}
    18 *}
     15{/literal}{/footer_script}
     16
    1917
    2018<div id="content" class="content">
     
    2220  <div class="titrePage">
    2321    <ul class="categoryActions">
     22                        {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
    2423      <li><a href="{$U_HELP}" onclick="popuphelp(this.href); return false;" title="{'Help'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/help.png" class="button" alt="(?)"></a></li>
    2524      <li><a href="{$U_HOME}" title="{'Home'|@translate}" rel="Home"><img src="{$ROOT_URL}{$themeconf.icon_dir}/home.png" class="button" alt="{'Home'|@translate}"></a></li>
Note: See TracChangeset for help on using the changeset viewer.