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
This commit is contained in:
patdenice 2011-05-25 09:00:46 +00:00
commit c9b7beb12f
9 changed files with 76 additions and 80 deletions

View file

@ -9,26 +9,22 @@
{combine_script id='jquery.progressBar' load='footer' path='themes/default/js/plugins/jquery.progressbar.min.js'}
{combine_script id='jquery.ajaxmanager' load='footer' path='themes/default/js/plugins/jquery.ajaxmanager.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}
var nb_thumbs_page = {$nb_thumbs_page};