[8394] | 1 | {include file='include/tag_selection.inc.tpl'} |
---|
| 2 | {include file='include/datepicker.inc.tpl'} |
---|
[12474] | 3 | {include file='include/colorbox.inc.tpl'} |
---|
[13063] | 4 | {include file='include/add_album.inc.tpl'} |
---|
[8394] | 5 | |
---|
| 6 | {footer_script}{literal} |
---|
| 7 | pwg_initialization_datepicker("#date_creation_day", "#date_creation_month", "#date_creation_year", "#date_creation_linked_date", "#date_creation_action_set"); |
---|
| 8 | {/literal}{/footer_script} |
---|
| 9 | |
---|
[13065] | 10 | {footer_script}{literal} |
---|
| 11 | /* Shift-click: select all photos between the click and the shift+click */ |
---|
| 12 | jQuery(document).ready(function() { |
---|
| 13 | var last_clicked=0; |
---|
| 14 | var last_clickedstatus=true; |
---|
| 15 | jQuery.fn.enableShiftClick = function() { |
---|
| 16 | var inputs = []; |
---|
| 17 | var count=0; |
---|
| 18 | var This=$(this); |
---|
| 19 | this.find('input[type=checkbox]').each(function() { |
---|
| 20 | var pos=count; |
---|
| 21 | inputs[count++]=this; |
---|
| 22 | $(this).bind("shclick", function (dummy,event) { |
---|
| 23 | if (event.shiftKey) { |
---|
| 24 | var first = last_clicked; |
---|
| 25 | var last = pos; |
---|
| 26 | if (first > last) { |
---|
| 27 | first=pos; |
---|
| 28 | last=last_clicked; |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | for (var i=first; i<=last;i++) { |
---|
| 32 | input = $(inputs[i]); |
---|
| 33 | $(input).attr('checked', last_clickedstatus); |
---|
| 34 | if (last_clickedstatus) |
---|
| 35 | { |
---|
| 36 | $(input).siblings("span.wrap2").addClass("thumbSelected"); |
---|
| 37 | } |
---|
| 38 | else |
---|
| 39 | { |
---|
| 40 | $(input).siblings("span.wrap2").removeClass("thumbSelected"); |
---|
| 41 | } |
---|
| 42 | } |
---|
| 43 | } |
---|
| 44 | else { |
---|
| 45 | last_clicked = pos; |
---|
| 46 | last_clickedstatus = this.checked; |
---|
| 47 | } |
---|
| 48 | return true; |
---|
| 49 | }); |
---|
| 50 | $(this).click(function(event) {console.log(event.shiftKey);$(this).triggerHandler("shclick",event)}); |
---|
| 51 | }); |
---|
| 52 | } |
---|
| 53 | }); |
---|
| 54 | {/literal}{/footer_script} |
---|
| 55 | |
---|
[10970] | 56 | {combine_script id='jquery.tokeninput' load='footer' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'} |
---|
[10592] | 57 | {combine_script id='jquery.progressBar' load='footer' path='themes/default/js/plugins/jquery.progressbar.min.js'} |
---|
[10389] | 58 | {combine_script id='jquery.ajaxmanager' load='footer' path='themes/default/js/plugins/jquery.ajaxmanager.js'} |
---|
[8394] | 59 | |
---|
[11039] | 60 | {footer_script require='jquery.tokeninput'} |
---|
| 61 | jQuery(document).ready(function() {ldelim} |
---|
[12474] | 62 | jQuery("a.preview-box").colorbox(); |
---|
| 63 | |
---|
[11853] | 64 | var tag_src = [{foreach from=$tags item=tag name=tags}{ldelim}name:"{$tag.name|@escape:'javascript'}",id:"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}]; |
---|
[11039] | 65 | jQuery("#tags").tokenInput( |
---|
[11853] | 66 | tag_src, |
---|
[11039] | 67 | {ldelim} |
---|
| 68 | hintText: '{'Type in a search term'|@translate}', |
---|
| 69 | noResultsText: '{'No results'|@translate}', |
---|
| 70 | searchingText: '{'Searching...'|@translate}', |
---|
| 71 | newText: ' ({'new'|@translate})', |
---|
| 72 | animateDropdown: false, |
---|
| 73 | preventDuplicates: true, |
---|
| 74 | allowCreation: true |
---|
| 75 | } |
---|
| 76 | ); |
---|
[11853] | 77 | |
---|
| 78 | jQuery("#tagsFilter").tokenInput( |
---|
| 79 | tag_src, |
---|
| 80 | {ldelim} |
---|
| 81 | hintText: '{'Type in a search term'|@translate}', |
---|
| 82 | noResultsText: '{'No results'|@translate}', |
---|
| 83 | searchingText: '{'Searching...'|@translate}', |
---|
| 84 | animateDropdown: false, |
---|
| 85 | preventDuplicates: true, |
---|
| 86 | allowCreation: false |
---|
| 87 | } |
---|
| 88 | ); |
---|
| 89 | |
---|
[8394] | 90 | }); |
---|
[11039] | 91 | {/footer_script} |
---|
[8394] | 92 | |
---|
| 93 | {footer_script} |
---|
| 94 | var nb_thumbs_page = {$nb_thumbs_page}; |
---|
| 95 | var nb_thumbs_set = {$nb_thumbs_set}; |
---|
| 96 | var applyOnDetails_pattern = "{'on the %d selected photos'|@translate}"; |
---|
[10637] | 97 | var all_elements = [{if !empty($all_elements)}{','|@implode:$all_elements}{/if}]; |
---|
[13575] | 98 | var derivatives = {ldelim} |
---|
| 99 | elements: null, |
---|
| 100 | done: 0, |
---|
| 101 | total: 0, |
---|
| 102 | |
---|
| 103 | finished: function() {ldelim} |
---|
| 104 | return derivatives.done == derivatives.total && derivatives.elements && derivatives.elements.length==0; |
---|
| 105 | } |
---|
| 106 | }; |
---|
[8394] | 107 | |
---|
| 108 | var selectedMessage_pattern = "{'%d of %d photos selected'|@translate}"; |
---|
| 109 | var selectedMessage_none = "{'No photo selected, %d photos in current set'|@translate}"; |
---|
| 110 | var selectedMessage_all = "{'All %d photos are selected'|@translate}"; |
---|
[10553] | 111 | |
---|
| 112 | var width_str = '{'Width'|@translate}'; |
---|
| 113 | var height_str = '{'Height'|@translate}'; |
---|
| 114 | var max_width_str = '{'Maximum Width'|@translate}'; |
---|
| 115 | var max_height_str = '{'Maximum Height'|@translate}'; |
---|
[8394] | 116 | {literal} |
---|
| 117 | function str_repeat(i, m) { |
---|
| 118 | for (var o = []; m > 0; o[--m] = i); |
---|
| 119 | return o.join(''); |
---|
| 120 | } |
---|
| 121 | |
---|
| 122 | function sprintf() { |
---|
| 123 | var i = 0, a, f = arguments[i++], o = [], m, p, c, x, s = ''; |
---|
| 124 | while (f) { |
---|
| 125 | if (m = /^[^\x25]+/.exec(f)) { |
---|
| 126 | o.push(m[0]); |
---|
| 127 | } |
---|
| 128 | else if (m = /^\x25{2}/.exec(f)) { |
---|
| 129 | o.push('%'); |
---|
| 130 | } |
---|
| 131 | else if (m = /^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)) { |
---|
| 132 | if (((a = arguments[m[1] || i++]) == null) || (a == undefined)) { |
---|
| 133 | throw('Too few arguments.'); |
---|
| 134 | } |
---|
| 135 | if (/[^s]/.test(m[7]) && (typeof(a) != 'number')) { |
---|
| 136 | throw('Expecting number but found ' + typeof(a)); |
---|
| 137 | } |
---|
| 138 | switch (m[7]) { |
---|
| 139 | case 'b': a = a.toString(2); break; |
---|
| 140 | case 'c': a = String.fromCharCode(a); break; |
---|
| 141 | case 'd': a = parseInt(a); break; |
---|
| 142 | case 'e': a = m[6] ? a.toExponential(m[6]) : a.toExponential(); break; |
---|
| 143 | case 'f': a = m[6] ? parseFloat(a).toFixed(m[6]) : parseFloat(a); break; |
---|
| 144 | case 'o': a = a.toString(8); break; |
---|
| 145 | case 's': a = ((a = String(a)) && m[6] ? a.substring(0, m[6]) : a); break; |
---|
| 146 | case 'u': a = Math.abs(a); break; |
---|
| 147 | case 'x': a = a.toString(16); break; |
---|
| 148 | case 'X': a = a.toString(16).toUpperCase(); break; |
---|
| 149 | } |
---|
| 150 | a = (/[def]/.test(m[7]) && m[2] && a >= 0 ? '+'+ a : a); |
---|
| 151 | c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' '; |
---|
| 152 | x = m[5] - String(a).length - s.length; |
---|
| 153 | p = m[5] ? str_repeat(c, x) : ''; |
---|
| 154 | o.push(s + (m[4] ? a + p : p + a)); |
---|
| 155 | } |
---|
| 156 | else { |
---|
| 157 | throw('Huh ?!'); |
---|
| 158 | } |
---|
| 159 | f = f.substring(m[0].length); |
---|
| 160 | } |
---|
| 161 | return o.join(''); |
---|
| 162 | } |
---|
| 163 | |
---|
[13575] | 164 | function progress(success) { |
---|
| 165 | jQuery('#progressBar').progressBar(derivatives.done, { |
---|
| 166 | max: derivatives.total, |
---|
[10389] | 167 | textFormat: 'fraction', |
---|
| 168 | boxImage: 'themes/default/images/progressbar.gif', |
---|
| 169 | barImage: 'themes/default/images/progressbg_orange.gif' |
---|
| 170 | }); |
---|
[13544] | 171 | if (success !== undefined) { |
---|
| 172 | var type = success ? 'regenerateSuccess': 'regenerateError', |
---|
| 173 | s = jQuery('[name="'+type+'"]').val(); |
---|
| 174 | jQuery('[name="'+type+'"]').val(++s); |
---|
| 175 | } |
---|
[10389] | 176 | |
---|
[13575] | 177 | if (derivatives.finished()) { |
---|
[13544] | 178 | jQuery('#applyAction').click(); |
---|
| 179 | } |
---|
[10389] | 180 | } |
---|
| 181 | |
---|
[8394] | 182 | $(document).ready(function() { |
---|
| 183 | function checkPermitAction() { |
---|
| 184 | var nbSelected = 0; |
---|
| 185 | if ($("input[name=setSelected]").is(':checked')) { |
---|
| 186 | nbSelected = nb_thumbs_set; |
---|
| 187 | } |
---|
| 188 | else { |
---|
| 189 | $(".thumbnails input[type=checkbox]").each(function() { |
---|
| 190 | if ($(this).is(':checked')) { |
---|
| 191 | nbSelected++; |
---|
| 192 | } |
---|
| 193 | }); |
---|
| 194 | } |
---|
| 195 | |
---|
| 196 | if (nbSelected == 0) { |
---|
| 197 | $("#permitAction").hide(); |
---|
| 198 | $("#forbidAction").show(); |
---|
| 199 | } |
---|
| 200 | else { |
---|
| 201 | $("#permitAction").show(); |
---|
| 202 | $("#forbidAction").hide(); |
---|
| 203 | } |
---|
| 204 | |
---|
| 205 | $("#applyOnDetails").text( |
---|
| 206 | sprintf( |
---|
| 207 | applyOnDetails_pattern, |
---|
| 208 | nbSelected |
---|
| 209 | ) |
---|
| 210 | ); |
---|
| 211 | |
---|
| 212 | // display the number of currently selected photos in the "Selection" fieldset |
---|
| 213 | if (nbSelected == 0) { |
---|
| 214 | $("#selectedMessage").text( |
---|
| 215 | sprintf( |
---|
| 216 | selectedMessage_none, |
---|
| 217 | nb_thumbs_set |
---|
| 218 | ) |
---|
| 219 | ); |
---|
| 220 | } |
---|
| 221 | else if (nbSelected == nb_thumbs_set) { |
---|
| 222 | $("#selectedMessage").text( |
---|
| 223 | sprintf( |
---|
| 224 | selectedMessage_all, |
---|
| 225 | nb_thumbs_set |
---|
| 226 | ) |
---|
| 227 | ); |
---|
| 228 | } |
---|
| 229 | else { |
---|
| 230 | $("#selectedMessage").text( |
---|
| 231 | sprintf( |
---|
| 232 | selectedMessage_pattern, |
---|
| 233 | nbSelected, |
---|
| 234 | nb_thumbs_set |
---|
| 235 | ) |
---|
| 236 | ); |
---|
| 237 | } |
---|
| 238 | } |
---|
| 239 | |
---|
| 240 | $('img.thumbnail').tipTip({ |
---|
| 241 | 'delay' : 0, |
---|
| 242 | 'fadeIn' : 200, |
---|
[9466] | 243 | 'fadeOut' : 200 |
---|
[8394] | 244 | }); |
---|
| 245 | |
---|
| 246 | $("[id^=action_]").hide(); |
---|
| 247 | |
---|
[9806] | 248 | $("select[name=selectAction]").change(function () { |
---|
[8394] | 249 | $("[id^=action_]").hide(); |
---|
| 250 | $("#action_"+$(this).attr("value")).show(); |
---|
[9806] | 251 | |
---|
[13064] | 252 | /* make sure the #albumSelect is on the right select box so that the */ |
---|
| 253 | /* "add new album" popup fills the right select box */ |
---|
| 254 | if ("associate" == $(this).attr("value") || "move" == $(this).attr("value")) { |
---|
| 255 | jQuery("#albumSelect").removeAttr("id"); |
---|
| 256 | jQuery("#action_"+$(this).attr("value")+" select").attr("id", "albumSelect"); |
---|
| 257 | } |
---|
| 258 | |
---|
[9806] | 259 | if ($(this).val() != -1) { |
---|
| 260 | $("#applyActionBlock").show(); |
---|
| 261 | } |
---|
| 262 | else { |
---|
| 263 | $("#applyActionBlock").hide(); |
---|
| 264 | } |
---|
[8394] | 265 | }); |
---|
| 266 | |
---|
[13065] | 267 | $(".wrap1 label").click(function (event) { |
---|
[8394] | 268 | $("input[name=setSelected]").attr('checked', false); |
---|
| 269 | |
---|
| 270 | var wrap2 = $(this).children(".wrap2"); |
---|
| 271 | var checkbox = $(this).children("input[type=checkbox]"); |
---|
| 272 | |
---|
[13065] | 273 | checkbox.triggerHandler("shclick",event); |
---|
| 274 | |
---|
[8394] | 275 | if ($(checkbox).is(':checked')) { |
---|
| 276 | $(wrap2).addClass("thumbSelected"); |
---|
| 277 | } |
---|
| 278 | else { |
---|
| 279 | $(wrap2).removeClass('thumbSelected'); |
---|
| 280 | } |
---|
| 281 | |
---|
| 282 | checkPermitAction(); |
---|
| 283 | }); |
---|
| 284 | |
---|
| 285 | $("#selectAll").click(function () { |
---|
[9064] | 286 | $("input[name=setSelected]").attr('checked', false); |
---|
| 287 | selectPageThumbnails(); |
---|
| 288 | checkPermitAction(); |
---|
| 289 | return false; |
---|
| 290 | }); |
---|
| 291 | |
---|
| 292 | function selectPageThumbnails() { |
---|
[8394] | 293 | $(".thumbnails label").each(function() { |
---|
| 294 | var wrap2 = $(this).children(".wrap2"); |
---|
| 295 | var checkbox = $(this).children("input[type=checkbox]"); |
---|
| 296 | |
---|
| 297 | $(checkbox).attr('checked', true); |
---|
| 298 | $(wrap2).addClass("thumbSelected"); |
---|
| 299 | }); |
---|
[9064] | 300 | } |
---|
[8394] | 301 | |
---|
| 302 | $("#selectNone").click(function () { |
---|
| 303 | $("input[name=setSelected]").attr('checked', false); |
---|
| 304 | |
---|
| 305 | $(".thumbnails label").each(function() { |
---|
| 306 | var wrap2 = $(this).children(".wrap2"); |
---|
| 307 | var checkbox = $(this).children("input[type=checkbox]"); |
---|
| 308 | |
---|
| 309 | $(checkbox).attr('checked', false); |
---|
| 310 | $(wrap2).removeClass("thumbSelected"); |
---|
| 311 | }); |
---|
| 312 | checkPermitAction(); |
---|
| 313 | return false; |
---|
| 314 | }); |
---|
| 315 | |
---|
| 316 | $("#selectInvert").click(function () { |
---|
| 317 | $("input[name=setSelected]").attr('checked', false); |
---|
| 318 | |
---|
| 319 | $(".thumbnails label").each(function() { |
---|
| 320 | var wrap2 = $(this).children(".wrap2"); |
---|
| 321 | var checkbox = $(this).children("input[type=checkbox]"); |
---|
| 322 | |
---|
| 323 | $(checkbox).attr('checked', !$(checkbox).is(':checked')); |
---|
| 324 | |
---|
| 325 | if ($(checkbox).is(':checked')) { |
---|
| 326 | $(wrap2).addClass("thumbSelected"); |
---|
| 327 | } |
---|
| 328 | else { |
---|
| 329 | $(wrap2).removeClass('thumbSelected'); |
---|
| 330 | } |
---|
| 331 | }); |
---|
| 332 | checkPermitAction(); |
---|
| 333 | return false; |
---|
| 334 | }); |
---|
| 335 | |
---|
| 336 | $("#selectSet").click(function () { |
---|
[9064] | 337 | selectPageThumbnails(); |
---|
[8394] | 338 | $("input[name=setSelected]").attr('checked', true); |
---|
| 339 | checkPermitAction(); |
---|
| 340 | return false; |
---|
| 341 | }); |
---|
| 342 | |
---|
| 343 | $("input[name=remove_author]").click(function () { |
---|
| 344 | if ($(this).is(':checked')) { |
---|
| 345 | $("input[name=author]").hide(); |
---|
| 346 | } |
---|
| 347 | else { |
---|
| 348 | $("input[name=author]").show(); |
---|
| 349 | } |
---|
| 350 | }); |
---|
| 351 | |
---|
[8408] | 352 | $("input[name=remove_title]").click(function () { |
---|
[8394] | 353 | if ($(this).is(':checked')) { |
---|
[8408] | 354 | $("input[name=title]").hide(); |
---|
[8394] | 355 | } |
---|
| 356 | else { |
---|
[8408] | 357 | $("input[name=title]").show(); |
---|
[8394] | 358 | } |
---|
| 359 | }); |
---|
| 360 | |
---|
| 361 | $("input[name=remove_date_creation]").click(function () { |
---|
| 362 | if ($(this).is(':checked')) { |
---|
| 363 | $("#set_date_creation").hide(); |
---|
| 364 | } |
---|
| 365 | else { |
---|
| 366 | $("#set_date_creation").show(); |
---|
| 367 | } |
---|
| 368 | }); |
---|
| 369 | |
---|
| 370 | $(".removeFilter").click(function () { |
---|
| 371 | var filter = $(this).parent('li').attr("id"); |
---|
| 372 | filter_disable(filter); |
---|
| 373 | |
---|
| 374 | return false; |
---|
| 375 | }); |
---|
| 376 | |
---|
| 377 | function filter_enable(filter) { |
---|
| 378 | /* show the filter*/ |
---|
| 379 | $("#"+filter).show(); |
---|
| 380 | |
---|
| 381 | /* check the checkbox to declare we use this filter */ |
---|
| 382 | $("input[type=checkbox][name="+filter+"_use]").attr("checked", true); |
---|
| 383 | |
---|
| 384 | /* forbid to select this filter in the addFilter list */ |
---|
| 385 | $("#addFilter").children("option[value="+filter+"]").attr("disabled", "disabled"); |
---|
| 386 | } |
---|
| 387 | |
---|
| 388 | $("#addFilter").change(function () { |
---|
| 389 | var filter = $(this).attr("value"); |
---|
| 390 | filter_enable(filter); |
---|
| 391 | $(this).attr("value", -1); |
---|
| 392 | }); |
---|
| 393 | |
---|
| 394 | function filter_disable(filter) { |
---|
| 395 | /* hide the filter line */ |
---|
| 396 | $("#"+filter).hide(); |
---|
| 397 | |
---|
| 398 | /* uncheck the checkbox to declare we do not use this filter */ |
---|
| 399 | $("input[name="+filter+"_use]").removeAttr("checked"); |
---|
| 400 | |
---|
| 401 | /* give the possibility to show it again */ |
---|
| 402 | $("#addFilter").children("option[value="+filter+"]").removeAttr("disabled"); |
---|
| 403 | } |
---|
| 404 | |
---|
| 405 | $("#removeFilters").click(function() { |
---|
| 406 | $("#filterList li").each(function() { |
---|
| 407 | var filter = $(this).attr("id"); |
---|
| 408 | filter_disable(filter); |
---|
| 409 | }); |
---|
| 410 | return false; |
---|
| 411 | }); |
---|
| 412 | |
---|
[10389] | 413 | jQuery('#applyAction').click(function() { |
---|
[13575] | 414 | if (jQuery('[name="selectAction"]').val() != 'generate_derivatives' |
---|
| 415 | || derivatives.finished() ) |
---|
[13544] | 416 | { |
---|
| 417 | return true; |
---|
| 418 | } |
---|
[10389] | 419 | |
---|
[13544] | 420 | jQuery('.bulkAction').hide(); |
---|
[10454] | 421 | |
---|
[13544] | 422 | var queuedManager = jQuery.manageAjax.create('queued', { |
---|
| 423 | queue: true, |
---|
| 424 | cacheResponse: false, |
---|
| 425 | maxRequests: 1 |
---|
| 426 | }); |
---|
[10454] | 427 | |
---|
[13575] | 428 | derivatives.elements = []; |
---|
[13544] | 429 | if (jQuery('input[name="setSelected"]').attr('checked')) |
---|
[13575] | 430 | derivatives.elements = all_elements; |
---|
[13544] | 431 | else |
---|
| 432 | jQuery('input[name="selection[]"]').each(function() { |
---|
| 433 | if (jQuery(this).attr('checked')) { |
---|
[13575] | 434 | derivatives.elements.push(jQuery(this).val()); |
---|
[13544] | 435 | } |
---|
| 436 | }); |
---|
[10389] | 437 | |
---|
[13544] | 438 | jQuery('#applyActionBlock').hide(); |
---|
| 439 | jQuery('select[name="selectAction"]').hide(); |
---|
| 440 | jQuery('#regenerationMsg').show(); |
---|
| 441 | |
---|
[13575] | 442 | progress(); |
---|
[13544] | 443 | getDerivativeUrls(); |
---|
| 444 | return false; |
---|
[10389] | 445 | }); |
---|
| 446 | |
---|
[13544] | 447 | function getDerivativeUrls() { |
---|
[13575] | 448 | var ids = derivatives.elements.splice(0, 500); |
---|
[13544] | 449 | var params = {max_urls: 100000, ids: ids, types: []}; |
---|
| 450 | jQuery("#action_generate_derivatives input").each( function(i, t) { |
---|
| 451 | if ($(t).attr("checked")) |
---|
| 452 | params.types.push( t.value ); |
---|
| 453 | } ); |
---|
[10553] | 454 | |
---|
[13544] | 455 | jQuery.ajax( { |
---|
| 456 | type: "POST", |
---|
| 457 | url: 'ws.php?format=json&method=pwg.getMissingDerivatives', |
---|
| 458 | data: params, |
---|
| 459 | dataType: "json", |
---|
| 460 | success: function(data) { |
---|
| 461 | if (!data.stat || data.stat != "ok") { |
---|
| 462 | return; |
---|
| 463 | } |
---|
[13575] | 464 | derivatives.total += data.result.urls.length; |
---|
| 465 | progress(); |
---|
[13544] | 466 | for (var i=0; i < data.result.urls.length; i++) { |
---|
| 467 | jQuery.manageAjax.add("queued", { |
---|
| 468 | type: 'GET', |
---|
| 469 | url: data.result.urls[i] + "&ajaxload=true", |
---|
| 470 | dataType: 'json', |
---|
[13575] | 471 | success: ( function(data) { derivatives.done++; progress(true) }), |
---|
| 472 | error: ( function(data) { derivatives.done++; progress(false) }) |
---|
[13544] | 473 | }); |
---|
| 474 | } |
---|
[13575] | 475 | if (derivatives.elements.length) |
---|
| 476 | setTimeout( getDerivativeUrls, 25 * (derivatives.total-derivatives.done)); |
---|
[13544] | 477 | } |
---|
| 478 | } ); |
---|
| 479 | } |
---|
[10553] | 480 | |
---|
[10164] | 481 | checkPermitAction() |
---|
| 482 | }); |
---|
| 483 | |
---|
| 484 | jQuery(window).load(function() { |
---|
[13544] | 485 | var max_w=0, max_h=0; |
---|
| 486 | $(".thumbnails img").each(function () { |
---|
| 487 | max_w = Math.max(max_w, $(this).width() ); |
---|
| 488 | max_h = Math.max(max_h, $(this).height() ); |
---|
| 489 | }); |
---|
| 490 | max_w += 10; |
---|
| 491 | max_h += 35; |
---|
| 492 | $("ul.thumbnails span, ul.thumbnails label").css('width', max_w+'px').css('height', max_h+'px'); |
---|
| 493 | $('ul.thumbnails').enableShiftClick(); |
---|
[8394] | 494 | }); |
---|
| 495 | {/literal}{/footer_script} |
---|
| 496 | |
---|
[9815] | 497 | <div id="batchManagerGlobal"> |
---|
[8394] | 498 | |
---|
[8408] | 499 | <h2>{'Batch Manager'|@translate}</h2> |
---|
[8394] | 500 | |
---|
| 501 | <form action="{$F_ACTION}" method="post"> |
---|
| 502 | |
---|
| 503 | <fieldset> |
---|
| 504 | <legend>{'Filter'|@translate}</legend> |
---|
| 505 | |
---|
| 506 | <ul id="filterList"> |
---|
| 507 | <li id="filter_prefilter" {if !isset($filter.prefilter)}style="display:none"{/if}> |
---|
[8408] | 508 | <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a> |
---|
[8394] | 509 | <input type="checkbox" name="filter_prefilter_use" class="useFilterCheckbox" {if isset($filter.prefilter)}checked="checked"{/if}> |
---|
[12456] | 510 | {'Predefined filter'|@translate} |
---|
[8394] | 511 | <select name="filter_prefilter"> |
---|
[10380] | 512 | {foreach from=$prefilters item=prefilter} |
---|
| 513 | <option value="{$prefilter.ID}" {if $filter.prefilter eq $prefilter.ID}selected="selected"{/if}>{$prefilter.NAME}</option> |
---|
[10354] | 514 | {/foreach} |
---|
[8394] | 515 | </select> |
---|
| 516 | </li> |
---|
| 517 | <li id="filter_category" {if !isset($filter.category)}style="display:none"{/if}> |
---|
| 518 | <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a> |
---|
| 519 | <input type="checkbox" name="filter_category_use" class="useFilterCheckbox" {if isset($filter.category)}checked="checked"{/if}> |
---|
[12421] | 520 | {'Album'|@translate} |
---|
[8394] | 521 | <select style="width:400px" name="filter_category" size="1"> |
---|
| 522 | {html_options options=$filter_category_options selected=$filter_category_options_selected} |
---|
| 523 | </select> |
---|
| 524 | <label><input type="checkbox" name="filter_category_recursive" {if isset($filter.category_recursive)}checked="checked"{/if}> {'include child albums'|@translate}</label> |
---|
| 525 | </li> |
---|
[12630] | 526 | <li id="filter_tags" {if !isset($filter.tags)}style="display:none"{/if}> |
---|
| 527 | <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a> |
---|
| 528 | <input type="checkbox" name="filter_tags_use" class="useFilterCheckbox" {if isset($filter.tags)}checked="checked"{/if}> |
---|
| 529 | {'Tags'|@translate} |
---|
| 530 | <select id="tagsFilter" name="filter_tags"> |
---|
| 531 | {foreach from=$filter_tags item=tag} |
---|
| 532 | <option value="{$tag.id}">{$tag.name}</option> |
---|
| 533 | {/foreach} |
---|
| 534 | </select> |
---|
| 535 | <label><span><input type="radio" name="tag_mode" value="AND" {if !isset($filter.tag_mode) or $filter.tag_mode eq 'AND'}checked="checked"{/if}> {'All tags'|@translate}</span></label> |
---|
| 536 | <label><span><input type="radio" name="tag_mode" value="OR" {if isset($filter.tag_mode) and $filter.tag_mode eq 'OR'}checked="checked"{/if}> {'Any tag'|@translate}</span></label> |
---|
| 537 | </li> |
---|
[8394] | 538 | <li id="filter_level" {if !isset($filter.level)}style="display:none"{/if}> |
---|
| 539 | <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a> |
---|
| 540 | <input type="checkbox" name="filter_level_use" class="useFilterCheckbox" {if isset($filter.level)}checked="checked"{/if}> |
---|
[13646] | 541 | {'Privacy level'|@translate} |
---|
[8394] | 542 | <select name="filter_level" size="1"> |
---|
| 543 | {html_options options=$filter_level_options selected=$filter_level_options_selected} |
---|
| 544 | </select> |
---|
[13646] | 545 | <label><input type="checkbox" name="filter_level_include_lower" {if isset($filter.level_include_lower)}checked="checked"{/if}> {'include photos with lower privacy level'|@translate}</label> |
---|
[8394] | 546 | </li> |
---|
| 547 | </ul> |
---|
| 548 | |
---|
| 549 | <p class="actionButtons" style=""> |
---|
| 550 | <select id="addFilter"> |
---|
[8408] | 551 | <option value="-1">{'Add a filter'|@translate}</option> |
---|
[8394] | 552 | <option disabled="disabled">------------------</option> |
---|
[12456] | 553 | <option value="filter_prefilter">{'Predefined filter'|@translate}</option> |
---|
[12421] | 554 | <option value="filter_category">{'Album'|@translate}</option> |
---|
[11853] | 555 | <option value="filter_tags">{'Tags'|@translate}</option> |
---|
[13646] | 556 | <option value="filter_level">{'Privacy level'|@translate}</option> |
---|
[8394] | 557 | </select> |
---|
| 558 | <!-- <input id="removeFilters" class="submit" type="submit" value="Remove all filters" name="removeFilters"> --> |
---|
[8408] | 559 | <a id="removeFilters" href="">{'Remove all filters'|@translate}</a> |
---|
[8394] | 560 | </p> |
---|
| 561 | |
---|
| 562 | <p class="actionButtons" id="applyFilterBlock"> |
---|
[8408] | 563 | <input id="applyFilter" class="submit" type="submit" value="{'Refresh photo set'|@translate}" name="submitFilter"> |
---|
[8394] | 564 | </p> |
---|
| 565 | |
---|
| 566 | </fieldset> |
---|
| 567 | |
---|
| 568 | <fieldset> |
---|
| 569 | |
---|
| 570 | <legend>{'Selection'|@translate}</legend> |
---|
| 571 | |
---|
| 572 | {if !empty($thumbnails)} |
---|
| 573 | <p id="checkActions"> |
---|
| 574 | {'Select:'|@translate} |
---|
[8408] | 575 | {if $nb_thumbs_set > $nb_thumbs_page} |
---|
| 576 | <a href="#" id="selectAll">{'The whole page'|@translate}</a>, |
---|
| 577 | <a href="#" id="selectSet">{'The whole set'|@translate}</a>, |
---|
| 578 | {else} |
---|
| 579 | <a href="#" id="selectAll">{'All'|@translate}</a>, |
---|
| 580 | {/if} |
---|
[8394] | 581 | <a href="#" id="selectNone">{'None'|@translate}</a>, |
---|
| 582 | <a href="#" id="selectInvert">{'Invert'|@translate}</a> |
---|
| 583 | |
---|
| 584 | <span id="selectedMessage"></span> |
---|
| 585 | |
---|
| 586 | <input type="checkbox" name="setSelected" style="display:none" {if count($selection) == $nb_thumbs_set}checked="checked"{/if}> |
---|
| 587 | </p> |
---|
| 588 | |
---|
| 589 | <ul class="thumbnails"> |
---|
[13544] | 590 | {foreach from=$thumbnails item=thumbnail} |
---|
| 591 | {if in_array($thumbnail.ID, $selection)} |
---|
| 592 | {assign var='isSelected' value=true} |
---|
| 593 | {else} |
---|
| 594 | {assign var='isSelected' value=false} |
---|
| 595 | {/if} |
---|
| 596 | <li> |
---|
| 597 | <span class="wrap1"> |
---|
| 598 | <label> |
---|
| 599 | <span class="wrap2{if $isSelected} thumbSelected{/if}"> |
---|
| 600 | <div class="actions"><a href="{$thumbnail.FILE_SRC}" class="preview-box">{'Zoom'|@translate}</a> · <a href="{$thumbnail.U_EDIT}" target="_blank">{'Edit'|@translate}</a></div> |
---|
| 601 | {if $thumbnail.LEVEL > 0} |
---|
| 602 | <em class="levelIndicatorB">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.LEVEL))}</em> |
---|
| 603 | <em class="levelIndicatorF" title="{'Who can see these photos?'|@translate} : ">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.LEVEL))}</em> |
---|
| 604 | {/if} |
---|
| 605 | <span> |
---|
| 606 | <img src="{$thumbnail.TN_SRC}" alt="{$thumbnail.FILE}" title="{$thumbnail.TITLE|@escape:'html'}" class="thumbnail"> |
---|
| 607 | </span> |
---|
| 608 | </span> |
---|
| 609 | <input type="checkbox" name="selection[]" value="{$thumbnail.ID}" {if $isSelected}checked="checked"{/if}> |
---|
| 610 | </label> |
---|
| 611 | </span> |
---|
| 612 | </li> |
---|
[8394] | 613 | {/foreach} |
---|
| 614 | </ul> |
---|
| 615 | |
---|
| 616 | {if !empty($navbar) } |
---|
| 617 | <div style="clear:both;"> |
---|
| 618 | |
---|
| 619 | <div style="float:left"> |
---|
| 620 | {include file='navigation_bar.tpl'|@get_extent:'navbar'} |
---|
| 621 | </div> |
---|
| 622 | |
---|
| 623 | <div style="float:right;margin-top:10px;">{'display'|@translate} |
---|
| 624 | <a href="{$U_DISPLAY}&display=20">20</a> |
---|
| 625 | · <a href="{$U_DISPLAY}&display=50">50</a> |
---|
| 626 | · <a href="{$U_DISPLAY}&display=100">100</a> |
---|
| 627 | · <a href="{$U_DISPLAY}&display=all">{'all'|@translate}</a> |
---|
[8723] | 628 | {'photos per page'|@translate} |
---|
[8394] | 629 | </div> |
---|
| 630 | </div> |
---|
| 631 | {/if} |
---|
| 632 | |
---|
| 633 | {else} |
---|
[8408] | 634 | <div>{'No photo in the current set.'|@translate}</div> |
---|
[8394] | 635 | {/if} |
---|
| 636 | </fieldset> |
---|
| 637 | |
---|
| 638 | <fieldset id="action"> |
---|
| 639 | |
---|
| 640 | <legend>{'Action'|@translate}</legend> |
---|
[13575] | 641 | <div id="forbidAction"{if count($selection) != 0} style="display:none"{/if}>{'No photo selected, no action possible.'|@translate}</div> |
---|
| 642 | <div id="permitAction"{if count($selection) == 0} style="display:none"{/if}> |
---|
[8394] | 643 | |
---|
| 644 | <select name="selectAction"> |
---|
[8408] | 645 | <option value="-1">{'Choose an action'|@translate}</option> |
---|
[8394] | 646 | <option disabled="disabled">------------------</option> |
---|
| 647 | {if isset($show_delete_form) } |
---|
| 648 | <option value="delete">{'Delete selected photos'|@translate}</option> |
---|
| 649 | {/if} |
---|
[8408] | 650 | <option value="associate">{'Associate to album'|@translate}</option> |
---|
[13064] | 651 | <option value="move">{'Move to album'|@translate}</option> |
---|
[8394] | 652 | {if !empty($dissociate_options)} |
---|
[8408] | 653 | <option value="dissociate">{'Dissociate from album'|@translate}</option> |
---|
[8394] | 654 | {/if} |
---|
[12456] | 655 | <option value="add_tags">{'Add tags'|@translate}</option> |
---|
[8394] | 656 | {if !empty($DEL_TAG_SELECTION)} |
---|
| 657 | <option value="del_tags">{'remove tags'|@translate}</option> |
---|
| 658 | {/if} |
---|
| 659 | <option value="author">{'Set author'|@translate}</option> |
---|
[8408] | 660 | <option value="title">{'Set title'|@translate}</option> |
---|
[8394] | 661 | <option value="date_creation">{'Set creation date'|@translate}</option> |
---|
| 662 | <option value="level">{'Who can see these photos?'|@translate}</option> |
---|
[12456] | 663 | <option value="metadata">{'Synchronize metadata'|@translate}</option> |
---|
[8394] | 664 | {if ($IN_CADDIE)} |
---|
[9124] | 665 | <option value="remove_from_caddie">{'Remove from caddie'|@translate}</option> |
---|
[8394] | 666 | {else} |
---|
[12456] | 667 | <option value="add_to_caddie">{'Add to caddie'|@translate}</option> |
---|
[8394] | 668 | {/if} |
---|
[13544] | 669 | <option value="delete_derivatives">{'Delete multiple size images'|@translate}</option> |
---|
| 670 | <option value="generate_derivatives">{'Generate multiple size images'|@translate}</option> |
---|
[9916] | 671 | {if !empty($element_set_global_plugins_actions)} |
---|
| 672 | {foreach from=$element_set_global_plugins_actions item=action} |
---|
| 673 | <option value="{$action.ID}">{$action.NAME}</option> |
---|
| 674 | {/foreach} |
---|
| 675 | {/if} |
---|
[8394] | 676 | </select> |
---|
| 677 | |
---|
| 678 | <!-- delete --> |
---|
| 679 | <div id="action_delete" class="bulkAction"> |
---|
| 680 | <p><label><input type="checkbox" name="confirm_deletion" value="1"> {'Are you sure?'|@translate}</label></p> |
---|
| 681 | </div> |
---|
| 682 | |
---|
| 683 | <!-- associate --> |
---|
| 684 | <div id="action_associate" class="bulkAction"> |
---|
[13064] | 685 | <select style="width:400px" name="associate" size="1"> |
---|
[8394] | 686 | {html_options options=$associate_options } |
---|
| 687 | </select> |
---|
[13063] | 688 | <br>{'... or '|@translate}</span><a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a> |
---|
[8394] | 689 | </div> |
---|
| 690 | |
---|
[13064] | 691 | <!-- move --> |
---|
| 692 | <div id="action_move" class="bulkAction"> |
---|
| 693 | <select style="width:400px" name="move" size="1"> |
---|
| 694 | {html_options options=$move_options } |
---|
| 695 | </select> |
---|
| 696 | <br>{'... or '|@translate}</span><a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a> |
---|
| 697 | </div> |
---|
| 698 | |
---|
| 699 | |
---|
[8394] | 700 | <!-- dissociate --> |
---|
| 701 | <div id="action_dissociate" class="bulkAction"> |
---|
| 702 | <select style="width:400px" name="dissociate" size="1"> |
---|
| 703 | {if !empty($dissociate_options)}{html_options options=$dissociate_options }{/if} |
---|
| 704 | </select> |
---|
| 705 | </div> |
---|
| 706 | |
---|
| 707 | |
---|
| 708 | <!-- add_tags --> |
---|
| 709 | <div id="action_add_tags" class="bulkAction"> |
---|
| 710 | <select id="tags" name="add_tags"> |
---|
| 711 | </select> |
---|
| 712 | </div> |
---|
| 713 | |
---|
| 714 | <!-- del_tags --> |
---|
| 715 | <div id="action_del_tags" class="bulkAction"> |
---|
| 716 | {$DEL_TAG_SELECTION} |
---|
| 717 | </div> |
---|
| 718 | |
---|
| 719 | <!-- author --> |
---|
| 720 | <div id="action_author" class="bulkAction"> |
---|
[8408] | 721 | <label><input type="checkbox" name="remove_author"> {'remove author'|@translate}</label><br> |
---|
| 722 | {assign var='authorDefaultValue' value='Type here the author name'|@translate} |
---|
[8394] | 723 | <input type="text" class="large" name="author" value="{$authorDefaultValue}" onfocus="this.value=(this.value=='{$authorDefaultValue}') ? '' : this.value;" onblur="this.value=(this.value=='') ? '{$authorDefaultValue}' : this.value;"> |
---|
| 724 | </div> |
---|
| 725 | |
---|
[8408] | 726 | <!-- title --> |
---|
| 727 | <div id="action_title" class="bulkAction"> |
---|
| 728 | <label><input type="checkbox" name="remove_title"> {'remove title'|@translate}</label><br> |
---|
| 729 | {assign var='titleDefaultValue' value='Type here the title'|@translate} |
---|
| 730 | <input type="text" class="large" name="title" value="{$titleDefaultValue}" onfocus="this.value=(this.value=='{$titleDefaultValue}') ? '' : this.value;" onblur="this.value=(this.value=='') ? '{$titleDefaultValue}' : this.value;"> |
---|
[8394] | 731 | </div> |
---|
| 732 | |
---|
| 733 | <!-- date_creation --> |
---|
| 734 | <div id="action_date_creation" class="bulkAction"> |
---|
[8408] | 735 | <label><input type="checkbox" name="remove_date_creation"> {'remove creation date'|@translate}</label><br> |
---|
[8394] | 736 | <div id="set_date_creation"> |
---|
| 737 | <select id="date_creation_day" name="date_creation_day"> |
---|
| 738 | <option value="0">--</option> |
---|
| 739 | {section name=day start=1 loop=32} |
---|
| 740 | <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$DATE_CREATION_DAY}selected="selected"{/if}>{$smarty.section.day.index}</option> |
---|
| 741 | {/section} |
---|
| 742 | </select> |
---|
| 743 | <select id="date_creation_month" name="date_creation_month"> |
---|
| 744 | {html_options options=$month_list selected=$DATE_CREATION_MONTH} |
---|
| 745 | </select> |
---|
| 746 | <input id="date_creation_year" |
---|
| 747 | name="date_creation_year" |
---|
| 748 | type="text" |
---|
| 749 | size="4" |
---|
| 750 | maxlength="4" |
---|
| 751 | value="{$DATE_CREATION_YEAR}"> |
---|
| 752 | <input id="date_creation_linked_date" name="date_creation_linked_date" type="hidden" size="10" disabled="disabled"> |
---|
| 753 | </div> |
---|
| 754 | </div> |
---|
| 755 | |
---|
| 756 | <!-- level --> |
---|
| 757 | <div id="action_level" class="bulkAction"> |
---|
| 758 | <select name="level" size="1"> |
---|
| 759 | {html_options options=$level_options selected=$level_options_selected} |
---|
| 760 | </select> |
---|
| 761 | </div> |
---|
| 762 | |
---|
[8422] | 763 | <!-- metadata --> |
---|
| 764 | <div id="action_metadata" class="bulkAction"> |
---|
| 765 | </div> |
---|
| 766 | |
---|
[13544] | 767 | <!-- generate derivatives --> |
---|
| 768 | <div id="action_generate_derivatives" class="bulkAction"> |
---|
| 769 | <a href="javascript:selectGenerateDerivAll()">{'All'|@translate}</a>, |
---|
| 770 | <a href="javascript:selectGenerateDerivNone()">{'None'|@translate}</a> |
---|
| 771 | <br> |
---|
| 772 | {foreach from=$generate_derivatives_types key=type item=disp} |
---|
| 773 | <label><input type="checkbox" name="generate_derivatives_type[]" value="{$type}"> {$disp}</label> |
---|
| 774 | {/foreach} |
---|
| 775 | {footer_script} |
---|
| 776 | function selectGenerateDerivAll() {ldelim} |
---|
| 777 | $("#action_generate_derivatives input[type=checkbox]").attr("checked", true); |
---|
| 778 | } |
---|
| 779 | function selectGenerateDerivNone() {ldelim} |
---|
| 780 | $("#action_generate_derivatives input[type=checkbox]").attr("checked", false); |
---|
| 781 | } |
---|
| 782 | {/footer_script} |
---|
| 783 | </div> |
---|
[10389] | 784 | |
---|
[13544] | 785 | <!-- delete derivatives --> |
---|
| 786 | <div id="action_delete_derivatives" class="bulkAction"> |
---|
| 787 | <a href="javascript:selectDelDerivAll()">{'All'|@translate}</a>, |
---|
| 788 | <a href="javascript:selectDelDerivNone()">{'None'|@translate}</a> |
---|
| 789 | <br> |
---|
| 790 | {foreach from=$del_derivatives_types key=type item=disp} |
---|
| 791 | <label><input type="checkbox" name="del_derivatives_type[]" value="{$type}"> {$disp}</label> |
---|
| 792 | {/foreach} |
---|
| 793 | {footer_script} |
---|
| 794 | function selectDelDerivAll() {ldelim} |
---|
| 795 | $("#action_delete_derivatives input[type=checkbox]").attr("checked", true); |
---|
| 796 | } |
---|
| 797 | function selectDelDerivNone() {ldelim} |
---|
| 798 | $("#action_delete_derivatives input[type=checkbox]").attr("checked", false); |
---|
| 799 | } |
---|
| 800 | {/footer_script} |
---|
| 801 | </div> |
---|
| 802 | |
---|
[10389] | 803 | <!-- progress bar --> |
---|
[13544] | 804 | <div id="regenerationMsg" class="bulkAction" style="display:none"> |
---|
| 805 | <p id="regenerationText" style="margin-bottom:10px;">{'Generate multiple size images'|@translate}</p> |
---|
[10389] | 806 | <span class="progressBar" id="progressBar"></span> |
---|
| 807 | <input type="hidden" name="regenerateSuccess" value="0"> |
---|
| 808 | <input type="hidden" name="regenerateError" value="0"> |
---|
| 809 | </div> |
---|
| 810 | |
---|
[9916] | 811 | <!-- plugins --> |
---|
| 812 | {if !empty($element_set_global_plugins_actions)} |
---|
| 813 | {foreach from=$element_set_global_plugins_actions item=action} |
---|
| 814 | <div id="action_{$action.ID}" class="bulkAction"> |
---|
| 815 | {if !empty($action.CONTENT)}{$action.CONTENT}{/if} |
---|
| 816 | </div> |
---|
| 817 | {/foreach} |
---|
| 818 | {/if} |
---|
| 819 | |
---|
[8394] | 820 | <p id="applyActionBlock" style="display:none" class="actionButtons"> |
---|
[8407] | 821 | <input id="applyAction" class="submit" type="submit" value="{'Apply action'|@translate}" name="submit"> <span id="applyOnDetails"></span></p> |
---|
[8394] | 822 | |
---|
| 823 | </div> <!-- #permitAction --> |
---|
| 824 | </fieldset> |
---|
| 825 | |
---|
| 826 | </form> |
---|
[9815] | 827 | |
---|
| 828 | </div> <!-- #batchManagerGlobal --> |
---|