From af1cbac19d7478b935a991abddaa2dd4c8df6c34 Mon Sep 17 00:00:00 2001 From: rvelices Date: Thu, 2 Dec 2010 19:46:30 +0000 Subject: 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 --- themes/default/template/footer.tpl | 1 + themes/default/template/header.tpl | 5 ++++- themes/default/template/include/datepicker.inc.tpl | 14 +++++++------- themes/default/template/include/resize.inc.tpl | 13 ++++++------- themes/default/template/index.tpl | 1 + themes/default/template/picture.tpl | 8 ++++++-- themes/default/template/search.tpl | 15 +++++++-------- 7 files changed, 32 insertions(+), 25 deletions(-) (limited to 'themes/default/template') 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 @@ {'Webmaster'|@translate} {/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) }{/if} {if not empty($page_refresh) }{/if} - +{* +*} +{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} {/html_head} - +{/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} - -{/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'}
  • (?)
  • {/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 @@ {'edit'|@translate} {/if} {if isset($U_CADDIE) }{*caddie management BEGIN*} +{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'} @@ -228,6 +231,7 @@ y.callService( {'Who can see this photo?'|@translate} +{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'} -{/literal} -*} +{/literal}{/footer_script} +
      + {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
    • (?)
    • {'Home'|@translate}
    -- cgit v1.2.3