{combine_css path=$URLUPLOADER_PATH|cat:'template/style.css'} {combine_script id='URI' load='footer' path=$URLUPLOADER_PATH|cat:'template/URI.min.js'} {combine_css path=$URLUPLOADER_PATH|cat:'template/jquery.textarea-lines-numbers.css'} {combine_script id='createTextareaWithLines' load='footer' require='jquery.ui.resizable' path=$URLUPLOADER_PATH|cat:'template/jquery.textarea-lines-numbers.js'} {if $upload_mode == 'multiple'} {combine_script id='jquery.ajaxmanager' load='footer' path='themes/default/js/plugins/jquery.ajaxmanager.js'} {combine_script id='jquery.jgrowl' load='footer' require='jquery' path='themes/default/js/plugins/jquery.jgrowl_minimized.js' } {combine_script id='jquery.ui.progressbar' load='footer'} {combine_css path='themes/default/js/plugins/jquery.jgrowl.css'} {/if} {include file='include/colorbox.inc.tpl'} {include file='include/add_album.inc.tpl'} {footer_script} (function($){ var allowed_extensions = new Array('jpeg','jpg','png','gif'); $('#hideErrors').click(function() { $('#formErrors').hide(); return false; }); $('#uploadWarningsSummary a.showInfo').click(function() { $('#uploadWarningsSummary').hide(); $('#uploadWarnings').show(); return false; }); $('#showPermissions').click(function() { $(this).parent('.showFieldset').hide(); $('#permissions').show(); return false; }); {* *} {if $upload_mode == 'multiple'} function checkUploadStart() { var nbErrors = 0; $('#formErrors').hide(); $('#formErrors li').hide(); if ($('#albumSelect option:selected').length == 0) { $('#formErrors #noAlbum').show(); nbErrors++; } var nbFiles = $('table#links tr.pending').length; if (nbFiles == 0) { $('#formErrors #noPhoto').show(); nbErrors++; } if (nbErrors != 0) { $('#formErrors').show(); return false; } else { return true; } } function trim (str) { return str.replace(/^\s+/g,'').replace(/\s+$/g,'') } $('input[name=add_links]').click(function() { $input = $('textarea#urls'); if ($input.val() != '') { $('table#links').show(); var lines = $input.val().split('\n'); var html = ''; $input.val(''); for (i in lines) { line = lines[i].split('|'); item = {}; // no name given if (line.length == 1) { uri = new URI(trim(line[0])); item.name = ''; } // name given else { uri = new URI(trim(line[1])); item.name = trim(line[0]); } uri.fragment(''); item.url = uri.href(); item.short_url = item.url; // shortened url for display if (item.url.length > 40) { item.short_url = item.url.substring(0, 15) + ' ... ' + item.url.substring(item.url.length-15); } // check if consistent url if (uri.is('relative')) { item.status = 'error'; item.info = '{'Invalid file URL'|translate|escape:javascript}'; } else { // check if good extension if (allowed_extensions.indexOf(uri.suffix().toLowerCase()) == -1) { item.status = 'error'; item.info = '{'Invalid file type'|translate|escape:javascript}'; } else { item.status = 'pending'; item.info = '{'Pending'|translate|escape:javascript}'; } } // add link to table html+= '
{'Add another set of photos'|translate}
{else} {/if} {* empty($thumbnails) *} {/if} {* $setup_errors *}