Changeset 28494 for trunk/admin/themes/default/template/picture_modify.tpl
- Timestamp:
- May 17, 2014, 2:11:47 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/themes/default/template/picture_modify.tpl
r25748 r28494 3 3 {include file='include/datepicker.inc.tpl'} 4 4 5 {combine_script id='jquery.chosen' load='footer' path='themes/default/js/plugins/chosen.jquery.min.js'} 6 {combine_css path="themes/default/js/plugins/chosen.css"} 7 8 {footer_script}{literal} 9 jQuery(document).ready(function() { 10 jQuery(".chzn-select").chosen(); 11 }); 12 {/literal}{/footer_script} 13 14 {combine_css path='themes/default/js/plugins/jquery.tokeninput.css'} 15 {combine_script id='jquery.tokeninput' load='async' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'} 16 {footer_script require='jquery.tokeninput'} 17 jQuery(document).ready(function() {ldelim} 18 jQuery("#tags").tokenInput( 19 [{foreach from=$tags item=tag name=tags}{ldelim}"name":"{$tag.name|@escape:'javascript'}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}], 20 {ldelim} 21 hintText: '{'Type in a search term'|@translate}', 22 noResultsText: '{'No results'|@translate}', 23 searchingText: '{'Searching...'|@translate}', 24 newText: ' ({'new'|@translate})', 25 animateDropdown: false, 26 preventDuplicates: true, 27 allowFreeTagging: true 5 {combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'} 6 7 {combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'} 8 {combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.default.css"} 9 10 {footer_script} 11 (function(){ 12 {* <!-- CATEGORIES --> *} 13 var categoriesCache = new LocalStorageCache('categoriesAdminList', 60, function(callback) { 14 jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.categories.getAdminList', function(data) { 15 callback(data.result.categories); 16 }); 17 }); 18 19 jQuery('[data-selectize=categories]').selectize({ 20 valueField: 'id', 21 labelField: 'fullname', 22 searchField: ['fullname'], 23 plugins: ['remove_button'] 24 }); 25 26 categoriesCache.get(function(categories) { 27 var selects = jQuery('[data-selectize=categories]'); 28 29 jQuery.each(categories, function(i, category) { 30 selects.each(function() { 31 this.selectize.addOption(category); 32 }); 33 }); 34 35 selects.each(function() { 36 var that = this; 37 38 jQuery.each(jQuery(this).data('value'), function(i, id) { 39 that.selectize.addItem(id); 40 }); 41 }); 42 }); 43 44 {* <!-- TAGS --> *} 45 var tagsCache = new LocalStorageCache('tagsAdminList', 60, function(callback) { 46 jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.tags.getAdminList', function(data) { 47 var tags = data.result.tags; 48 49 for (var i=0, l=tags.length; i<l; i++) { 50 tags[i].id = '~~' + tags[i].id + '~~'; 28 51 } 29 ); 30 }); 31 {/footer_script} 32 33 {footer_script} 52 53 callback(tags); 54 }); 55 }); 56 57 jQuery('[data-selectize=tags]').selectize({ 58 valueField: 'id', 59 labelField: 'name', 60 searchField: ['name'], 61 plugins: ['remove_button'], 62 create: function(input, callback) { 63 tagsCache.clear(); 64 65 callback({ 66 id: input, 67 name: input 68 }); 69 } 70 }); 71 72 tagsCache.get(function(tags) { 73 var selects = jQuery('[data-selectize=tags]'); 74 75 jQuery.each(tags, function(i, tag) { 76 selects.each(function() { 77 this.selectize.addOption(tag); 78 }); 79 }); 80 81 selects.each(function() { 82 var that = this; 83 84 jQuery.each(jQuery(this).data('value'), function(i, tag) { 85 that.selectize.addItem(tag.id); 86 }); 87 }); 88 }); 89 90 {* <!-- DATEPICKER --> *} 34 91 pwg_initialization_datepicker("#date_creation_day", "#date_creation_month", "#date_creation_year", "#date_creation_linked_date", "#date_creation_action_set"); 92 }()); 35 93 {/footer_script} 36 94 … … 113 171 <strong>{'Linked albums'|@translate}</strong> 114 172 <br> 115 <select data-placeholder="Select albums..." class="chzn-select" multiple style="width:700px;" name="associate[]"> 116 {html_options options=$associate_options selected=$associate_options_selected} 117 </select> 173 <select data-selectize="categories" data-value="{$associate_options_selected|@json_encode|escape:html}" 174 name="associate[]" multiple style="width:600px;" ></select> 118 175 </p> 119 176 … … 121 178 <strong>{'Representation of albums'|@translate}</strong> 122 179 <br> 123 <select data-placeholder="Select albums..." class="chzn-select" multiple style="width:700px;" name="represent[]"> 124 {html_options options=$represent_options selected=$represent_options_selected} 125 </select> 180 <select data-selectize="categories" data-value="{$represent_options_selected|@json_encode|escape:html}" 181 name="represent[]" multiple style="width:600px;" ></select> 126 182 </p> 127 183 … … 129 185 <strong>{'Tags'|@translate}</strong> 130 186 <br> 131 <select id="tags" name="tags"> 132 {foreach from=$tag_selection item=tag} 133 <option value="{$tag.id}" class="selected">{$tag.name}</option> 134 {/foreach} 135 </select> 187 <select data-selectize="tags" data-value="{$tag_selection|@json_encode|escape:html}" 188 name="tags[]" multiple style="width:600px;" ></select> 136 189 </p> 137 190
Note: See TracChangeset
for help on using the changeset viewer.