Parcourir la source

Merge branch 'develop' of http://112.172.147.34:4936/style24/style24.admin.git into develop

eskim il y a 4 ans
Parent
commit
9589b6a942

+ 1 - 4
src/main/webapp/WEB-INF/views/display/LookbookBannerPopupForm.html

@@ -188,10 +188,7 @@
 
 	var fnBannerImgFileUpload = function (obj, idx){
 		var file = obj.files[0];
-		// 파일 용량 체크 10MB
-		if(!gagajf.checkFileSize(file)){
-			return;
-		}
+
 		file.name = 'test';
 		if (typeof(file) == 'undefined'){
 			return;

+ 2 - 17
src/main/webapp/WEB-INF/views/display/MainContentsPopupForm.html

@@ -973,10 +973,7 @@
 
 	var fnVideoFileUpload = function (obj, idx){
 		var file = obj.files[0];
-		// 파일 용량 체크 10MB
-		if(!gagajf.checkFileSize(file)){
-			return;
-		}
+
 		gagaKollus.upload('Display', file, $(obj).find('input[name=kufKey]'));
 	}
 
@@ -1526,10 +1523,6 @@
 	var fnPopFileUpload = function (obj, ind){
 		var file = obj.files[0];
 
-		// 파일 용량 체크 10MB
-		if(!gagajf.checkFileSize(file)){
-			return;
-		}
 		file.name = 'test';
 		if (typeof(file) == 'undefined'){
 			return;
@@ -1553,11 +1546,6 @@
 	var fnGnbFileUpload = function (obj, ind, num){
 		var file = obj.files[0];
 
-		// 파일 용량 체크 10MB
-		if(!gagajf.checkFileSize(file)){
-			return;
-		}
-
 		file.name = 'test';
 		if (typeof(file) == 'undefined'){
 			return;
@@ -1863,10 +1851,7 @@
 	// 동영상파일 선택 시
 	$('#popSortable input[name=file]').on('change', function() {
 		var file = this.files[0];
-		// 파일 용량 체크 10MB
-		if(!gagajf.checkFileSize(file)){
-			return;
-		}
+
 		gagaKollus.upload('Display', file, $('input[name=kufKey]'));
 	});
 

+ 2 - 8
src/main/webapp/WEB-INF/views/display/MainMultiContentsPopupForm.html

@@ -454,10 +454,7 @@ console.log('brandGroupNo:'+brandGroupNo);
 	 */
 	var fnBrandImgFileUpload = function (obj, ind){
 		var file = obj.files[0];
-		// 파일 용량 체크 10MB
-		if(!gagajf.checkFileSize(file)){
-			return;
-		}
+
 		file.name = 'test';
 		if (typeof(file) == 'undefined'){
 			return;
@@ -588,10 +585,7 @@ console.log('brandGroupNo:'+brandGroupNo);
 	// 기획전/배너 파일첨부
 	var fnPlanFileUpload = function (obj, ind){
 		var file = obj.files[0];
-		// 파일 용량 체크 10MB
-		if(!gagajf.checkFileSize(file)){
-			return;
-		}
+
 		file.name = 'test';
 		if (typeof(file) == 'undefined'){
 			return;

+ 22 - 13
src/main/webapp/ux/plugins/gaga/gaga.validation.js

@@ -714,6 +714,11 @@ var gagajf = {
 		if (typeof policy != 'undefined') {
 			formData.append("policy", policy);
 		}
+		
+		// 파일 사이즈 체크
+		if (!gagajf.checkFileSize(file)) {
+			return;
+		}
 
 		$.ajax({
 			type : 'POST',
@@ -1042,22 +1047,26 @@ var gagajf = {
 		});
 
 		return arrValue;
-	} ,
-	checkFileSize : function (data){
-		var isInvalid = true;
-
-		var fileSize = data.size;
-		var maxSize = 1024 * 1024 * 10;
-		if(fileSize > maxSize){
-			alert("파일용량이 10MB을 초과했습니다.");
-			isInvalid = false;
+	},
+	
+	/**
+	 * 파일의 사이즈를 체크한다.
+	 * 예)
+	 * 		gagajf.checkFileSize(file);
+	 * @param  : file - 선택된 파일
+	 * @author : gagamel
+	 * @since  : 2021. 7. 16
+	 */
+	checkFileSize : function(file) {
+		var fileSize = file.size;
+		var maxSize = 1024 * 1024 * 10; // 10MByte
+		
+		if (fileSize > maxSize) {
+			mcxDialog.alert('파일 용량이 10MB를 초과했습니다.');
 			return false;
-		}else{
-			isInvalid = true
-			return true;
 		}
 
-		return isInvalid;
+		return true;
 	}
 };