Ignore:
Timestamp:
May 25, 2011, 11:00:46 AM (13 years ago)
Author:
patdenice
Message:

Load tags for tokeninput directly in html page. Ajax is too slow.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/batch_manager_global.tpl

    r11008 r11039  
    1010{combine_script id='jquery.ajaxmanager' load='footer' path='themes/default/js/plugins/jquery.ajaxmanager.js'}
    1111
    12 {footer_script require='jquery.tokeninput'}{literal}
    13 jQuery(document).ready(function() {
    14   jQuery.getJSON('admin.php?fckb_tags=1', function(data) {
    15     jQuery("#tags").tokenInput(
    16       data,
    17       {
    18     {/literal}
    19         hintText: '{'Type in a search term'|@translate}',
    20         noResultsText: '{'No results'|@translate}',
    21         searchingText: '{'Searching...'|@translate}',
    22         newText: ' ({'new'|@translate})',
    23         animateDropdown: false,
    24         preventDuplicates: true,
    25         allowCreation: true
    26     {literal}
    27       }
    28     );
    29   });
     12{footer_script require='jquery.tokeninput'}
     13jQuery(document).ready(function() {ldelim}
     14  jQuery("#tags").tokenInput(
     15    [{foreach from=$tags item=tag name=tags}{ldelim}"name":"{$tag.name}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}],
     16    {ldelim}
     17      hintText: '{'Type in a search term'|@translate}',
     18      noResultsText: '{'No results'|@translate}',
     19      searchingText: '{'Searching...'|@translate}',
     20      newText: ' ({'new'|@translate})',
     21      animateDropdown: false,
     22      preventDuplicates: true,
     23      allowCreation: true
     24    }
     25  );
    3026});
    31 {/literal}{/footer_script}
     27{/footer_script}
    3228
    3329{footer_script}
Note: See TracChangeset for help on using the changeset viewer.