- Timestamp:
- Dec 26, 2013, 12:07:19 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Google2Piwigo/admin/template/import.list_all.tpl
r25788 r26198 1 1 {footer_script require='jquery.ajaxmanager,jquery.jgrowl'} 2 /* global vars */ 3 var errorHead = '{'ERROR'|@translate|@escape:'javascript'}'; 4 var errorMsg = '{'an error happened'|@translate|@escape:'javascript'}'; 5 var successHead = '{'Success'|@translate|@escape:'javascript'}'; 2 (function($){ 3 /* global vars */ 4 var all_elements = [{if !empty($all_elements)}{','|@implode:$all_elements}{/if}]; 5 var import_done = 0; 6 var import_selected = {$nb_elements}; 7 var queuedManager = $.manageAjax.create('queued', { 8 queue: true, 9 maxRequests: 1 10 }); 6 11 7 var import_done = 0; 8 var import_selected = {$nb_elements}; 9 var queuedManager = jQuery.manageAjax.create('queued', {ldelim} 10 queue: true, 11 maxRequests: 1 12 }); 12 /* import queue */ 13 function performImport(photo, album, fills, pwa_album) { 14 queuedManager.add({ 15 type: 'GET', 16 dataType: 'json', 17 url: 'ws.php', 18 data: { 19 method: 'pwg.images.addPicasa', 20 id: photo, 21 category: album, 22 fills: fills, 23 pwa_album: pwa_album, 24 format: 'json' 25 }, 26 success: function(data) { 27 if (data['stat'] == 'ok') { 28 $.jGrowl(data['result'], { 29 theme: 'success', life: 4000, sticky: false, 30 header: '{'Success'|translate}' 31 }); 32 } 33 else { 34 $.jGrowl(data['result'], { 35 theme: 'error', sticky: true, 36 header: '{'ERROR'|translate}' 37 }); 38 } 39 40 import_done++; 41 $("#progress").html(import_done +"/"+ import_selected); 42 43 if (import_done == import_selected) { 44 $("#import_form").append('<input type="hidden" name="done" value="' + import_done + '">'); 45 $("#import_form").submit(); 46 } 47 }, 48 error: function(data) { 49 $.jGrowl('{'an error happened'|translate|escape:javascript}', { 50 theme: 'error', sticky: true, 51 header: '{'ERROR'|translate}' 52 }); 53 } 54 }); 55 } 13 56 14 {literal}15 /* import queue */16 function performImport(photo, album, fills, pwa_album) {17 queuedManager.add({18 type: 'GET',19 dataType: 'json',20 url: 'ws.php',21 data: { method: 'pwg.images.addPicasa', id: photo, category: album, fills: fills, pwa_album: pwa_album, format: 'json' },22 success: function(data) {23 if (data['stat'] == 'ok') {24 jQuery.jGrowl(data['result'], { theme: 'success', header: successHead, life: 4000, sticky: false });25 } else {26 jQuery.jGrowl(data['result'], { theme: 'error', header: errorHead, sticky: true });27 }28 29 import_done++;30 $("#progress").html(import_done +"/"+ import_selected);31 32 if (import_done == import_selected) {33 $("#import_form").append('<input type="hidden" name="done" value="' + import_done + '">');34 $("#import_form").submit();35 }36 },37 error: function(data) {38 jQuery.jGrowl(errorMsg, { theme: 'error', header: errorHead, sticky: true });39 }40 });41 }42 43 44 $(document).ready(function() {45 var all_elements = {/literal}{$all_elements}{literal};46 57 47 58 /* begin import */ 48 jQuery('#beginImport').click(function() {59 $('#beginImport').click(function() { 49 60 $("#loader_import").fadeIn(); 50 61 51 62 if ($("input[name='album_mode']:checked").val() == 'identical') { 52 63 album = "<!-- create -->"; 53 } else { 64 } 65 else { 54 66 album = $("#albumSelect option:selected").val(); 55 67 } … … 74 86 if ($(this).val() == 'one_album') { 75 87 $("#albumSelectWrapper").slideDown(); 76 } else { 88 } 89 else { 77 90 $("#albumSelectWrapper").slideUp(); 78 91 } 79 92 }); 80 }); 81 {/literal} 93 }(jQuery)); 82 94 {/footer_script} 83 95 … … 85 97 86 98 <fieldset> 87 <legend>{'Selection'| @translate}</legend>99 <legend>{'Selection'|translate}</legend> 88 100 89 101 {if $nb_elements} 90 {'%d elements ready for importation'| @translate|@sprintf:$nb_elements}102 {'%d elements ready for importation'|translate:$nb_elements} 91 103 {else} 92 <div>{'No photo in the current set.'| @translate}</div>104 <div>{'No photo in the current set.'|translate}</div> 93 105 {/if} 94 106 </fieldset> 95 107 96 108 <fieldset> 97 <legend>{'Import options'| @translate}</legend>109 <legend>{'Import options'|translate}</legend> 98 110 99 111 <p> 100 <label><input type="radio" name="album_mode" value="identical" checked="checked"> {'Reproduce Google albums'| @translate}</label><br>101 <label><input type="radio" name="album_mode" value="one_album"> {'Import all photos in this album'| @translate} :</label>112 <label><input type="radio" name="album_mode" value="identical" checked="checked"> {'Reproduce Google albums'|translate}</label><br> 113 <label><input type="radio" name="album_mode" value="one_album"> {'Import all photos in this album'|translate} :</label> 102 114 </p> 103 115 … … 106 118 {html_options options=$category_parent_options} 107 119 </select> 108 {'... or '| @translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>120 {'... or '|translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|translate}">{'create a new album'|translate}</a> 109 121 </p> 110 122 111 123 <p> 112 <b>{'Fill these fields from Google datas'| @translate}:</b>113 <label><input type="checkbox" name="fill_name" checked="checked"> {'Photo name'| @translate}</label>114 <label><input type="checkbox" name="fill_author" checked="checked"> {'Author'| @translate}</label>115 <label><input type="checkbox" name="fill_tags" checked="checked"> {'Tags'| @translate}</label>116 <label><input type="checkbox" name="fill_date" checked="checked"> {'Creation date'| @translate}</label>117 <label><input type="checkbox" name="fill_description" checked="checked"> {'Description'| @translate}</label>118 {if $GMAPS_LOADED}<label><input type="checkbox" name="fill_geotag" checked="checked"> {'Geolocalization'|@translate}</label>{/if}124 <b>{'Fill these fields from Google datas'|translate}:</b> 125 <label><input type="checkbox" name="fill_name" checked="checked"> {'Photo name'|translate}</label> 126 <label><input type="checkbox" name="fill_author" checked="checked"> {'Author'|translate}</label> 127 <label><input type="checkbox" name="fill_tags" checked="checked"> {'Tags'|translate}</label> 128 <label><input type="checkbox" name="fill_date" checked="checked"> {'Creation date'|translate}</label> 129 <label><input type="checkbox" name="fill_description" checked="checked"> {'Description'|translate}</label> 130 <label><input type="checkbox" name="fill_geotag" checked="checked"> {'Geolocalization'|translate}</label> 119 131 </p> 120 132 121 133 <p> 122 <input type="submit" name="import_set" id="beginImport" value="{'Begin transfer'| @translate}" {if not $nb_elements}style="display:none;"{/if}>123 <span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'| @translate}</i> <span id="progress"></span></span>134 <input type="submit" name="import_set" id="beginImport" value="{'Begin transfer'|translate}" {if not $nb_elements}style="display:none;"{/if}> 135 <span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|translate}</i> <span id="progress"></span></span> 124 136 </p> 125 137 </fieldset>
Note: See TracChangeset
for help on using the changeset viewer.