{if $upload_mode eq 'multiple'} {combine_script id='jquery.jgrowl' load='footer' require='jquery' path='themes/default/js/plugins/jquery.jgrowl_minimized.js' } {combine_script id='jquery.uploadify' load='footer' require='jquery' path='admin/include/uploadify/jquery.uploadify.v3.0.0.min.js' } {combine_script id='jquery.ui.progressbar' load='footer'} {combine_css path="admin/themes/default/uploadify.jGrowl.css"} {combine_css path="admin/include/uploadify/uploadify.css"} {/if} {combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'} {combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"} {footer_script}{literal} jQuery(document).ready(function(){ 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 = 0; if (jQuery("#uploadBoxes").size() == 1) { jQuery("input[name^=image_upload]").each(function() { if (jQuery(this).val() != "") { nbFiles++; } }); } else { nbFiles = jQuery(".uploadifyQueueItem").size(); } if (nbFiles == 0) { jQuery("#formErrors #noPhoto").show(); nbErrors++; } if (nbErrors != 0) { jQuery("#formErrors").show(); return false; } else { return true; } } function humanReadableFileSize(bytes) { var byteSize = Math.round(bytes / 1024 * 100) * .01; var suffix = 'KB'; if (byteSize > 1000) { byteSize = Math.round(byteSize *.001 * 100) * .01; suffix = 'MB'; } var sizeParts = byteSize.toString().split('.'); if (sizeParts.length > 1) { byteSize = sizeParts[0] + '.' + sizeParts[1].substr(0,2); } else { byteSize = sizeParts[0]; } return byteSize+suffix; } function fillCategoryListbox(selectId, selectedValue) { jQuery.getJSON( "ws.php?format=json&method=pwg.categories.getList", { recursive: true, fullname: true, format: "json", }, function(data) { jQuery.each( data.result.categories, function(i,category) { var selected = null; if (category.id == selectedValue) { selected = "selected"; } jQuery("