diff options
author | rvelices <rv-github@modusoptimus.com> | 2010-12-02 19:46:30 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2010-12-02 19:46:30 +0000 |
commit | af1cbac19d7478b935a991abddaa2dd4c8df6c34 (patch) | |
tree | 0c9e42aa73da4db5a99537641db9cb46db0f8fcb /themes/default/template | |
parent | 208a5acddcfebc131af01855edbf7f6cdc903bf7 (diff) |
new template features: combine_script, footer_script and get_combined_scripts
migrated public templates only; need more code doc
git-svn-id: http://piwigo.org/svn/trunk@7975 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | themes/default/template/footer.tpl | 1 | ||||
-rw-r--r-- | themes/default/template/header.tpl | 5 | ||||
-rw-r--r-- | themes/default/template/include/datepicker.inc.tpl | 14 | ||||
-rw-r--r-- | themes/default/template/include/resize.inc.tpl | 13 | ||||
-rw-r--r-- | themes/default/template/index.tpl | 1 | ||||
-rw-r--r-- | themes/default/template/picture.tpl | 8 | ||||
-rw-r--r-- | themes/default/template/search.tpl | 15 |
7 files changed, 32 insertions, 25 deletions
diff --git a/themes/default/template/footer.tpl b/themes/default/template/footer.tpl index 671c92d55..90b445ca4 100644 --- a/themes/default/template/footer.tpl +++ b/themes/default/template/footer.tpl @@ -18,6 +18,7 @@ <a href="mailto:{$CONTACT_MAIL}?subject={'A comment on your site'|@translate|@escape:url}">{'Webmaster'|@translate}</a> {/if} +{get_combined_scripts load='footer'} {if isset($footer_elements)} {foreach from=$footer_elements item=v} diff --git a/themes/default/template/header.tpl b/themes/default/template/header.tpl index bb42c7289..36222e268 100644 --- a/themes/default/template/header.tpl +++ b/themes/default/template/header.tpl @@ -40,12 +40,15 @@ {if isset($U_PREFETCH) }<link rel="prefetch" href="{$U_PREFETCH}">{/if} {if not empty($page_refresh) }<meta http-equiv="refresh" content="{$page_refresh.TIME};url={$page_refresh.U_REFRESH}">{/if} - +{* <script type="text/javascript" src="{$ROOT_URL}themes/default/js/scripts.js"></script> +*} <!--[if lt IE 7]> <script type="text/javascript" src="{$ROOT_URL}themes/default/js/pngfix.js"></script> <![endif]--> +{get_combined_scripts load='header'} + {if not empty($head_elements)} {foreach from=$head_elements item=elt}{$elt} {/foreach} diff --git a/themes/default/template/include/datepicker.inc.tpl b/themes/default/template/include/datepicker.inc.tpl index de3918cb3..0ed844942 100644 --- a/themes/default/template/include/datepicker.inc.tpl +++ b/themes/default/template/include/datepicker.inc.tpl @@ -1,24 +1,24 @@ -{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} -{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} -{known_script id="jquery.ui.datepicker" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.datepicker.packed.js"} -{known_script id="datepicker.js" src=$ROOT_URL|@cat:"themes/default/js/datepicker.js"} +{combine_script id='jquery' load='footer' path='themes/default/js/jquery.packed.js'} +{combine_script id='jquery.ui' load='footer' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js'} +{combine_script id='jquery.ui.datepicker' load='footer' require='jquery.ui' path='themes/default/js/ui/packed/ui.datepicker.packed.js'} +{combine_script id='datepicker.js' load='footer' require='jquery.ui.datepicker' path='themes/default/js/datepicker.js'} {assign var="datepicker_language" value="themes/default/js/ui/i18n/ui.datepicker-"|@cat:$lang_info.code|@cat:".js"} {if "PHPWG_ROOT_PATH"|@constant|@cat:$datepicker_language|@file_exists} -{known_script id="jquery.ui.datepicker-$lang_info.code" src=$ROOT_URL|@cat:$datepicker_language} +{combine_script id="jquery.ui.datepicker-$lang_info.code" path=$datepicker_language} {/if} {html_head} <link rel="stylesheet" type="text/css" href="{$ROOT_URL}themes/default/js/ui/theme/ui.datepicker.css"> {/html_head} -<script type="text/javascript"> +{footer_script} function pwg_initialization_datepicker(day, month, year, linked_date, checked_on_change, min_linked_date, max_linked_date) {ldelim} return pwg_common_initialization_datepicker( "{$ROOT_URL}{$themeconf.icon_dir}/datepicker.png", day, month, year, linked_date, checked_on_change, min_linked_date, max_linked_date); } -</script> +{/footer_script} diff --git a/themes/default/template/include/resize.inc.tpl b/themes/default/template/include/resize.inc.tpl index 30a637563..5165f49a5 100644 --- a/themes/default/template/include/resize.inc.tpl +++ b/themes/default/template/include/resize.inc.tpl @@ -1,10 +1,9 @@ -{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} -{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} -{known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"} +{combine_script id='jquery' load='footer' path='themes/default/js/jquery.packed.js'} +{combine_script id='jquery.ui' load='footer' require='jquery' path='themes/default/js/ui/packed/ui.core.packed.js'} +{combine_script id='jquery.ui.resizable' load='footer' require='jquery.ui' path='themes/default/js/ui/packed/ui.resizable.packed.js'} {* Resize possible *} -{literal} -<script type="text/javascript"> +{footer_script}{literal} jQuery().ready(function(){ // Resize possible for list jQuery(".categoryList").resizable({ @@ -18,5 +17,5 @@ ghost: true }); }); -</script> -{/literal} +{/literal}{/footer_script} + diff --git a/themes/default/template/index.tpl b/themes/default/template/index.tpl index 5db0b6e3c..37f577f84 100644 --- a/themes/default/template/index.tpl +++ b/themes/default/template/index.tpl @@ -27,6 +27,7 @@ {/if} {if isset($U_SEARCH_RULES) } + {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'} <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> {/if} diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl index 00e548609..220790059 100644 --- a/themes/default/template/picture.tpl +++ b/themes/default/template/picture.tpl @@ -59,6 +59,7 @@ <a href="{$U_ADMIN}" title="{'Modify information'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/preferences.png" class="button" alt="{'edit'|@translate}"></a> {/if} {if isset($U_CADDIE) }{*caddie management BEGIN*} +{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'} <script type="text/javascript"> {literal}function addToCadie(aElement, rootUrl, id) { @@ -208,15 +209,17 @@ y.callService( <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}"> {/if} {/foreach} + {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'} + {combine_script id='rating' load='async' require='core.scripts' path='themes/default/js/rating.js'} <script type="text/javascript"> var _pwgRatingAutoQueue = _pwgRatingAutoQueue || []; _pwgRatingAutoQueue.push( {ldelim}rootUrl: '{$ROOT_URL|@escape:"javascript"}', image_id: {$current.id}, updateRateText: "{'Update your rating'|@translate|@escape:'javascript'}", updateRateElement: document.getElementById("updateRate"), ratingSummaryText: "{'%.2f (rated %d times)'|@translate|@escape:'javascript'}", ratingSummaryElement: document.getElementById("ratingSummary") {rdelim} ); - (function () {ldelim} + /*(function () {ldelim} var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = '{$ROOT_URL}themes/default/js/rating.js'; var s0 = document.getElementsByTagName('script')[0]; s0.parentNode.insertBefore(s, s0); - })(); + })();*/ </script> </div> </form> @@ -228,6 +231,7 @@ y.callService( <tr id="Privacy"> <td class="label">{'Who can see this photo?'|@translate}</td> <td class="value"> +{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'} <script type="text/javascript"> {literal}function setPrivacyLevel(selectElement, rootUrl, id, level) { diff --git a/themes/default/template/search.tpl b/themes/default/template/search.tpl index 5ad8dee96..cc958f7dd 100644 --- a/themes/default/template/search.tpl +++ b/themes/default/template/search.tpl @@ -1,26 +1,25 @@ {* Example of resizeable *} -{* + {include file='include/resize.inc.tpl'} -*} + {* Example of datepicker *} -{* + {include file='include/datepicker.inc.tpl'} -{literal} -<script type="text/javascript"> +{footer_script}{literal} pwg_initialization_datepicker("#start_day", "#start_month", "#start_year", "#start_linked_date", null, null, "#end_linked_date"); pwg_initialization_datepicker("#end_day", "#end_month", "#end_year", "#end_linked_date", null, "#start_linked_date", null); jQuery().ready(function(){ $(".date_today").hide(); }); -</script> -{/literal} -*} +{/literal}{/footer_script} + <div id="content" class="content"> <div class="titrePage"> <ul class="categoryActions"> + {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'} <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> <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> </ul> |