diff options
author | patdenice <patdenice@piwigo.org> | 2011-05-25 09:00:46 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2011-05-25 09:00:46 +0000 |
commit | c9b7beb12f38890631ab12c8086b1bff28eed4a4 (patch) | |
tree | 7c90d91c8c4d5949abd9d6d378dc9c84680d3163 /admin/themes/default/template/picture_modify.tpl | |
parent | 4c13229cd9c7ce6a8b2e93b922b1e2dbc9b9799c (diff) |
Load tags for tokeninput directly in html page. Ajax is too slow.
git-svn-id: http://piwigo.org/svn/trunk@11039 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/themes/default/template/picture_modify.tpl | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/admin/themes/default/template/picture_modify.tpl b/admin/themes/default/template/picture_modify.tpl index 5c6b2bf08..8cc01c43a 100644 --- a/admin/themes/default/template/picture_modify.tpl +++ b/admin/themes/default/template/picture_modify.tpl @@ -3,26 +3,22 @@ {include file='include/datepicker.inc.tpl'} {combine_script id='jquery.tokeninput' load='async' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'} -{footer_script require='jquery.tokeninput'}{literal} -jQuery(document).ready(function() { - jQuery.getJSON('admin.php?fckb_tags=1', function(data) { - jQuery("#tags").tokenInput( - data, - { - {/literal} - hintText: '{'Type in a search term'|@translate}', - noResultsText: '{'No results'|@translate}', - searchingText: '{'Searching...'|@translate}', - newText: ' ({'new'|@translate})', - animateDropdown: false, - preventDuplicates: true, - allowCreation: true - {literal} - } - ); - }); +{footer_script require='jquery.tokeninput'} +jQuery(document).ready(function() {ldelim} + jQuery("#tags").tokenInput( + [{foreach from=$tags item=tag name=tags}{ldelim}"name":"{$tag.name}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}], + {ldelim} + hintText: '{'Type in a search term'|@translate}', + noResultsText: '{'No results'|@translate}', + searchingText: '{'Searching...'|@translate}', + newText: ' ({'new'|@translate})', + animateDropdown: false, + preventDuplicates: true, + allowCreation: true + } + ); }); -{/literal}{/footer_script} +{/footer_script} {footer_script} pwg_initialization_datepicker("#date_creation_day", "#date_creation_month", "#date_creation_year", "#date_creation_linked_date", "#date_creation_action_set"); @@ -142,7 +138,7 @@ pwg_initialization_datepicker("#date_creation_day", "#date_creation_month", "#da <td><strong>{'Tags'|@translate}</strong></td> <td> <select id="tags" name="tags"> -{foreach from=$tags item=tag} +{foreach from=$tag_selection item=tag} <option value="{$tag.id}" class="selected">{$tag.name}</option> {/foreach} </select> |