{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="admin/themes/default/uploadify.jGrowl.css"} {/if} {include file='include/colorbox.inc.tpl'} {include file='include/add_album.inc.tpl'} {footer_script} var allowed_extensions = new Array('jpeg','jpg','png','gif'); var errorHead = '{'ERROR'|@translate|@escape:'javascript'}'; var errorMsg = '{'an error happened'|@translate|@escape:'javascript'}'; var lang = new Array(); lang['Invalid file URL'] = '{'Invalid file URL'|@translate|@escape:'javascript'}'; lang['Invalid file type'] = '{'Invalid file type'|@translate|@escape:'javascript'}'; lang['File URL is empty'] = '{'File URL is empty'|@translate|@escape:'javascript'}'; lang['Unable to download file'] = '{'Unable to download file'|@translate|@escape:'javascript'}'; lang['Pending'] = '{'Pending'|@translate|@escape:'javascript'}'; lang['Delete this item'] = '{'Delete this item'|@translate|@escape:'javascript'}'; {literal} jQuery("#hideErrors").click(function() { jQuery("#formErrors").hide(); return false; }); jQuery("#uploadWarningsSummary a.showInfo").click(function() { jQuery("#uploadWarningsSummary").hide(); jQuery("#uploadWarnings").show(); return false; }); jQuery("#showPermissions").click(function() { jQuery(this).parent(".showFieldset").hide(); jQuery("#permissions").show(); return false; }); {/literal} {* *} {if $upload_mode == 'multiple'} {literal} function checkUploadStart() { var nbErrors = 0; jQuery("#formErrors").hide(); jQuery("#formErrors li").hide(); if (jQuery("#albumSelect option:selected").length == 0) { jQuery("#formErrors #noAlbum").show(); nbErrors++; } var nbFiles = jQuery("table#links tr.pending").length; if (nbFiles == 0) { jQuery("#formErrors #noPhoto").show(); nbErrors++; } if (nbErrors != 0) { jQuery("#formErrors").show(); return false; } else { return true; } } function trim (myString) { return myString.replace(/^\s+/g,'').replace(/\s+$/g,'') } jQuery("input[name='add_links']").click(function() { $input = jQuery("textarea#urls"); if ($input.val() != "") { jQuery("table#links").show(); lines = $input.val().split('\n'); $input.val(""); for (i in lines) { line = lines[i].split('|'); item = new Array; // 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, 17) + ' ... ' + item['url'].substring(item['url'].length-17); } // check if consistent url if (uri.is("relative")) { item['status'] = 'error'; item['info'] = lang['Invalid file URL']; } else { // check if good extension if (allowed_extensions.indexOf(uri.suffix().toLowerCase()) == -1) { item['status'] = 'error'; item['info'] = lang['Invalid file type']; } else { item['status'] = 'pending'; item['info'] = lang['Pending']; } } // add link to table jQuery("table#links tbody").append('
{'Add another set of photos'|@translate}
{else} {/if} {* empty($thumbnails) *} {/if} {* $setup_errors *}