File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ window.websocket_host = 'localhost'
99window . websocket_port = '23958'
1010window . post_max_length = 10000
1111window . max_image_size = 10485760
12+ window . max_avatar_size = 102400
1213window . portal = { enabled : false }
1314window . currentYear = new Date ( ) . getFullYear ( )
1415// window.GAKey = config.gaKey
Original file line number Diff line number Diff line change @@ -20,30 +20,21 @@ export default {
2020
2121 let files = e .target .files || e .dataTransfer .files
2222 if (! files .length ) return
23- console .log (e .target .files )
2423 let images = []
25- for (var i = 0 ; i < files .length ; i++ ) {
24+ for (let i = 0 ; i < files .length ; i++ ) {
2625 let file = files[i]
2726 if (! file .type .match (/ image. * / )) continue
2827 images .push (file)
2928 }
30- console .log (props .purpose )
3129 if (props .purpose === ' avatar' || props .purpose === ' logo' || props .purpose === ' favicon' ) { images = [images[0 ]] }
3230
33- console .log (images)
34-
35- if (images .length > 0 ) {
36- // if (v.fileInput.files.length > 10) {
37- // return $timeout(function() { Alert.error('Error: Exceeded 10 images.'); });
38- // }
39-
31+ if (images .length > 10 ) return handleError (' Error: Exceeded 10 images.' )
32+ else if (images .length > 0 ) {
4033 // (re)prime loading and progress variables
4134 v .imagesUploading = true
4235 // let imagesProgress = 0
4336 // let imagesProgressSum = 0
4437 let errImages = []
45- let maxImageSize = props .purpose === ' avatar' ? 102400 : 10485760 // TODO(akinsey): forumData.max_image_size;
46-
4738 /**
4839 * Image = {
4940 * name: {string} The filename of the string (provided by host computer),
@@ -215,6 +206,7 @@ export default {
215206 imagesProgress: 0 ,
216207 imagesProgressSum: 0 ,
217208 uploadingImages: 0 ,
209+ maxImageSize: props .purpose === ' avatar' ? window .max_avatar_size : window .max_image_size ,
218210 warningMsg: ' ' ,
219211 model: null ,
220212 status: null
You can’t perform that action at this time.
0 commit comments