- Timestamp:
- Mar 9, 2011, 3:22:48 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/themes/default/template/photos_add_direct.tpl
r8682 r9586 1 {if $upload_mode eq 'multiple'} 1 2 {combine_script id='jquery.jgrowl' load='footer' require='jquery' path='themes/default/js/plugins/jquery.jgrowl_minimized.js' } 2 3 {if $upload_mode eq 'multiple'} 4 <script type="text/javascript" src="{$uploadify_path}/swfobject.js"></script> 3 {combine_script id='swfobject' load='footer' path='admin/include/uploadify/swfobject.js'} 5 4 {combine_script id='jquery.uploadify' load='footer' require='jquery' path='admin/include/uploadify/jquery.uploadify.v2.1.0.min.js' } 5 {combine_css path="admin/themes/default/uploadify.jGrowl.css"} 6 {combine_css path="admin/include/uploadify/uploadify.css"} 6 7 {/if} 7 {html_head}8 <link rel="stylesheet" type="text/css" href="{$ROOT_URL}admin/themes/default/uploadify.jGrowl.css">9 {/html_head}10 8 11 9 {footer_script}{literal} … … 13 11 function checkUploadStart() { 14 12 var nbErrors = 0; 15 $("#formErrors").hide();16 $("#formErrors li").hide();17 18 if ( $("input[name=category_type]:checked").val() == "new" && $("input[name=category_name]").val() == "") {19 $("#formErrors #emptyCategoryName").show();13 jQuery("#formErrors").hide(); 14 jQuery("#formErrors li").hide(); 15 16 if (jQuery("input[name=category_type]:checked").val() == "new" && jQuery("input[name=category_name]").val() == "") { 17 jQuery("#formErrors #emptyCategoryName").show(); 20 18 nbErrors++; 21 19 } 22 20 23 21 var nbFiles = 0; 24 if ( $("#uploadBoxes").size() == 1) {25 $("input[name^=image_upload]").each(function() {26 if ( $(this).val() != "") {22 if (jQuery("#uploadBoxes").size() == 1) { 23 jQuery("input[name^=image_upload]").each(function() { 24 if (jQuery(this).val() != "") { 27 25 nbFiles++; 28 26 } … … 30 28 } 31 29 else { 32 nbFiles = $(".uploadifyQueueItem").size();30 nbFiles = jQuery(".uploadifyQueueItem").size(); 33 31 } 34 32 35 33 if (nbFiles == 0) { 36 $("#formErrors #noPhoto").show();34 jQuery("#formErrors #noPhoto").show(); 37 35 nbErrors++; 38 36 } 39 37 40 38 if (nbErrors != 0) { 41 $("#formErrors").show();39 jQuery("#formErrors").show(); 42 40 return false; 43 41 } … … 68 66 } 69 67 70 if ( $("select[name=category] option").length == 0) {71 $('input[name=category_type][value=existing]').attr('disabled', true);72 $('input[name=category_type]').attr('checked', false);73 $('input[name=category_type][value=new]').attr('checked', true);68 if (jQuery("select[name=category] option").length == 0) { 69 jQuery('input[name=category_type][value=existing]').attr('disabled', true); 70 jQuery('input[name=category_type]').attr('checked', false); 71 jQuery('input[name=category_type][value=new]').attr('checked', true); 74 72 } 75 73 76 $("input[name=category_type]").click(function () {77 $("[id^=category_type_]").hide();78 $("#category_type_"+$(this).attr("value")).show();79 }); 80 81 $("#hideErrors").click(function() {82 $("#formErrors").hide();74 jQuery("input[name=category_type]").click(function () { 75 jQuery("[id^=category_type_]").hide(); 76 jQuery("#category_type_"+jQuery(this).attr("value")).show(); 77 }); 78 79 jQuery("#hideErrors").click(function() { 80 jQuery("#formErrors").hide(); 83 81 return false; 84 82 }); … … 89 87 function addUploadBox() { 90 88 var uploadBox = '<p class="file"><input type="file" size="60" name="image_upload[]"></p>'; 91 $(uploadBox).appendTo("#uploadBoxes");89 jQuery(uploadBox).appendTo("#uploadBoxes"); 92 90 } 93 91 94 92 addUploadBox(); 95 93 96 $("#addUploadBox A").click(function () {94 jQuery("#addUploadBox A").click(function () { 97 95 addUploadBox(); 98 96 }); 99 97 100 $("#uploadForm").submit(function() {98 jQuery("#uploadForm").submit(function() { 101 99 return checkUploadStart(); 102 100 }); … … 134 132 } 135 133 else { 136 $("input[name=submit_upload]").click();134 jQuery("input[name=submit_upload]").click(); 137 135 } 138 136 }, … … 158 156 } 159 157 160 $.jGrowl(158 jQuery.jGrowl( 161 159 '<p></p>'+msg, 162 160 { … … 167 165 ); 168 166 169 $("#fileUploadgrowl" + queueID).fadeOut(167 jQuery("#fileUploadgrowl" + queueID).fadeOut( 170 168 250, 171 169 function() { 172 $("#fileUploadgrowl" + queueID).remove()170 jQuery("#fileUploadgrowl" + queueID).remove() 173 171 } 174 172 ); … … 177 175 onCancel: function (a, b, c, d) { 178 176 var msg = "Cancelled uploading: "+c.name; 179 $.jGrowl(177 jQuery.jGrowl( 180 178 '<p></p>'+msg, 181 179 { … … 189 187 onClearQueue: function (a, b) { 190 188 var msg = "Cleared "+b.fileCount+" files from queue"; 191 $.jGrowl(189 jQuery.jGrowl( 192 190 '<p></p>'+msg, 193 191 { … … 201 199 onComplete: function (a, b ,c, d, e) { 202 200 var size = Math.round(c.size/1024); 203 $.jGrowl(201 jQuery.jGrowl( 204 202 '<p></p>'+c.name+' - '+size+'KB', 205 203 { … … 213 211 }); 214 212 215 $("input[type=button]").click(function() {213 jQuery("input[type=button]").click(function() { 216 214 if (!checkUploadStart()) { 217 215 return false; 218 216 } 219 217 220 $("#uploadify").uploadifyUpload();218 jQuery("#uploadify").uploadifyUpload(); 221 219 }); 222 220
Note: See TracChangeset
for help on using the changeset viewer.