aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-11-08 06:48:50 +0000
committerrvelices <rv-github@modusoptimus.com>2012-11-08 06:48:50 +0000
commit73abb2a12b87cd4aeac3af0266c3ab68d1cbb96a (patch)
tree9d40c25949b83daaf1aa0fe5e444ec3df0b7616e
parent5028378bd332bdb8042972219f49227a3ed96bdf (diff)
js code simplification
git-svn-id: http://piwigo.org/svn/trunk@18974 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/themes/default/template/batch_manager_unit.tpl38
1 files changed, 14 insertions, 24 deletions
diff --git a/admin/themes/default/template/batch_manager_unit.tpl b/admin/themes/default/template/batch_manager_unit.tpl
index fde9c2aa4..7dee4fa51 100644
--- a/admin/themes/default/template/batch_manager_unit.tpl
+++ b/admin/themes/default/template/batch_manager_unit.tpl
@@ -4,19 +4,9 @@
{combine_script id='jquery.tokeninput' load='async' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'}
{footer_script require='jquery.tokeninput'}
-var tag_boxes_selector = "";
-{foreach from=$elements item=element name=element}
-{if $smarty.foreach.element.first}
-var prefix = "";
-{else}
-prefix = ", ";
-{/if}
- tag_boxes_selector = tag_boxes_selector + prefix + "#tags-" + {$element.id};
-{/foreach}
-
jQuery(document).ready(function() {ldelim}
- jQuery(tag_boxes_selector).tokenInput(
- [{foreach from=$tags item=tag name=tags}{ldelim}"name":"{$tag.name|@escape:'javascript'}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}],
+ jQuery('select[name|="tags"]').tokenInput(
+ [{foreach from=$tags item=tag name=tags}{ldelim}name:"{$tag.name|@escape:'javascript'}",id:"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}],
{ldelim}
hintText: '{'Type in a search term'|@translate}',
noResultsText: '{'No results'|@translate}',
@@ -112,7 +102,7 @@ jQuery(document).ready(function() {ldelim}
<td><strong>{'Tags'|@translate}</strong></td>
<td>
-<select id="tags-{$element.id}" name="tags-{$element.id}">
+<select name="tags-{$element.id}">
{foreach from=$element.TAGS item=tag}
<option value="{$tag.id}" class="selected">{$tag.name}</option>
{/foreach}
@@ -131,24 +121,24 @@ jQuery(document).ready(function() {ldelim}
</fieldset>
{/foreach}
-{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
+{if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
<p>
- <input class="submit" type="submit" value="{'Submit'|@translate}" name="submit">
- <input class="submit" type="reset" value="{'Reset'|@translate}">
+ <input type="submit" value="{'Submit'|@translate}" name="submit">
+ <input type="reset" value="{'Reset'|@translate}">
</p>
{/if}
</form>
-<script type="text/javascript">// <![CDATA[
+{footer_script}
{literal}$(document).ready(function() {
- $(".elementEdit img").fadeTo("slow", 0.6); // Opacity on page load
- $(".elementEdit img").hover(function(){
- $(this).fadeTo("slow", 1.0); // Opacity on hover
- },function(){
+ $(".elementEdit img")
+ .fadeTo("slow", 0.6) // Opacity on page load
+ .hover(function(){
+ $(this).fadeTo("slow", 1.0); // Opacity on hover
+ },function(){
$(this).fadeTo("slow", 0.6); // Opacity on mouseout
- });
+ });
});{/literal}
-// ]]>
-</script>
+{/footer_script}