Changeset 10389 for trunk/admin/themes/default
- Timestamp:
- Apr 15, 2011, 5:40:23 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/themes/default/template/batch_manager_global.tpl
r10380 r10389 7 7 8 8 {combine_script id='jquery.fcbkcomplete' load='footer' require='jquery' path='themes/default/js/plugins/jquery.fcbkcomplete.js'} 9 {combine_script id='jquery.progressBar' load='footer' path='plugins/regenerateThumbnails/js/jquery.progressbar.min.js'} 10 {combine_script id='jquery.ajaxmanager' load='footer' path='themes/default/js/plugins/jquery.ajaxmanager.js'} 9 11 10 12 {footer_script require='jquery.fcbkcomplete'}{literal} … … 27 29 var nb_thumbs_set = {$nb_thumbs_set}; 28 30 var applyOnDetails_pattern = "{'on the %d selected photos'|@translate}"; 31 var elements = new Array(); 32 var all_elements = [{','|@implode:$all_elements}]; 29 33 30 34 var selectedMessage_pattern = "{'%d of %d photos selected'|@translate}"; 31 35 var selectedMessage_none = "{'No photo selected, %d photos in current set'|@translate}"; 32 36 var selectedMessage_all = "{'All %d photos are selected'|@translate}"; 37 var regenerateThumbnailsMessage = "{'Thumbnails generation in progress...'|@translate}"; 33 38 {literal} 39 var queuedManagerThumbnails = $.manageAjax.create('queued', { 40 queue: true, 41 cacheResponse: false, 42 maxRequests: 3 43 }); 44 34 45 function str_repeat(i, m) { 35 46 for (var o = []; m > 0; o[--m] = i); … … 79 90 } 80 91 92 function progress(val, max, success) { 93 jQuery('#progressBar').progressBar(val, { 94 max: max, 95 textFormat: 'fraction', 96 boxImage: 'themes/default/images/progressbar.gif', 97 barImage: 'themes/default/images/progressbg_orange.gif' 98 }); 99 type = success ? 'regenerateSuccess': 'regenerateError' 100 s = jQuery('[name="'+type+'"]').val(); 101 jQuery('[name="'+type+'"]').val(++s); 102 103 if (val == max) 104 jQuery('#applyAction').click(); 105 } 106 81 107 $(document).ready(function() { 82 108 function checkPermitAction() { … … 299 325 }); 300 326 return false; 327 }); 328 329 jQuery('#applyAction').click(function() { 330 if (jQuery('[name="selectAction"]').val() == 'regenerateThumbnails') { 331 if (elements.length != 0) 332 return true; 333 334 if (jQuery('input[name="setSelected"]').attr('checked')) 335 elements = all_elements; 336 else 337 jQuery('input[name="selection[]"]').each(function() { 338 if (jQuery(this).attr('checked')) { 339 elements.push(jQuery(this).val()); 340 } 341 }); 342 343 maxwidth = jQuery('input[name="thumb_maxwidth"]').val(); 344 maxheight = jQuery('input[name="thumb_maxheight"]').val(); 345 progressBar_max = elements.length; 346 todo = 0; 347 348 jQuery('#thumb_config').hide(); 349 jQuery('#applyActionBlock').hide(); 350 jQuery('select[name="selectAction"]').hide(); 351 jQuery('#regenerationMsg').show(); 352 jQuery('#regenerationText').html(regenerateThumbnailsMessage); 353 jQuery('#progressBar').progressBar(0, { 354 max: progressBar_max, 355 textFormat: 'fraction', 356 boxImage: 'themes/default/images/progressbar.gif', 357 barImage: 'themes/default/images/progressbg_orange.gif' 358 }); 359 360 for (i=0;i<elements.length;i++) { 361 queuedManagerThumbnails.add({ 362 type: 'GET', 363 url: 'ws.php', 364 data: { 365 method: 'pwg.images.resize', 366 type: 'thumbnail', 367 maxwidth: maxwidth, 368 maxheight: maxheight, 369 image_id: elements[i], 370 format: 'json' 371 }, 372 dataType: 'json', 373 success: ( function(data) { progress(++todo, progressBar_max, data['result']) }), 374 error: ( function(data) { progress(++todo, progressBar_max, false) }) 375 }); 376 } 377 return false; 378 } 301 379 }); 302 380 … … 474 552 <option value="add_to_caddie">{'add to caddie'|@translate}</option> 475 553 {/if} 554 <option value="regenerateThumbnails">{'Regenerate Thumbnails'|@translate}</option> 476 555 {if !empty($element_set_global_plugins_actions)} 477 556 {foreach from=$element_set_global_plugins_actions item=action} … … 560 639 </div> 561 640 641 <!-- regenerate thumbnails --> 642 <div id="action_regenerateThumbnails" class="bulkAction"> 643 <table style="margin-left:20px;" id="thumb_config"> 644 <tr> 645 <th>{'Maximum Width'|@translate}</th> 646 <td><input type="text" name="thumb_maxwidth" value="{$upload_form_settings.thumb_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}</td> 647 </tr> 648 <tr> 649 <th>{'Maximum Height'|@translate}</th> 650 <td><input type="text" name="thumb_maxheight" value="{$upload_form_settings.thumb_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}</td> 651 </tr> 652 <tr> 653 <th>{'Image Quality'|@translate}</th> 654 <td><input type="text" name="thumb_quality" value="{$upload_form_settings.thumb_quality}" size="3" maxlength="3"> %</td> 655 </tr> 656 </table> 657 </div> 658 659 <!-- progress bar --> 660 <div id="regenerationMsg" style="display:none;"> 661 <p id="regenerationText" style="margin-bottom:10px;"></p> 662 <span class="progressBar" id="progressBar"></span> 663 <input type="hidden" name="regenerateSuccess" value="0"> 664 <input type="hidden" name="regenerateError" value="0"> 665 </div> 666 562 667 <!-- plugins --> 563 668 {if !empty($element_set_global_plugins_actions)}
Note: See TracChangeset
for help on using the changeset viewer.