]> insang Git - ZipProject.git/commitdiff
f2 이름변경기능 추가, 각종 에러 픽스, zipexplore 이름길게 변경 후 마우스로 땅찍었을때 label에 dir로 안들어감. 수정중
authorjocloud <dhkq92@icloud.com>
Fri, 22 May 2020 06:49:54 +0000 (06:49 +0000)
committerjocloud <dhkq92@icloud.com>
Fri, 22 May 2020 06:49:54 +0000 (06:49 +0000)
ZipProject/Models/ZipModel.cs
ZipProject/Views/WebZip/Index.cshtml
ZipProject/Views/WebZip/partial_zip.cshtml
ZipProject/wwwroot/Language/en.json
ZipProject/wwwroot/Language/kr.json
ZipProject/wwwroot/js/Zip/partial_zip.js

index 02cb861bd10d24e92d4a05832cd0741dfe18e48c..c170715cf94c41435205e67acfbcca299d617eb4 100644 (file)
@@ -76,7 +76,14 @@ namespace ZipProject {
         if (per != (double) (e.BytesTransferred * 100 / e.TotalBytesToTransfer) / (double) 100) {
           per = (double) (e.BytesTransferred * 100 / e.TotalBytesToTransfer) / (double) 100;
           nows = Math.Truncate (nows) + per;
-          SimpleLongPolling.Publish (uuid, nows + "");
+          try{
+            SimpleLongPolling.Publish (uuid, nows + "");
+          }
+          catch(InvalidOperationException ee){
+            ee.Data["result"]= "complate";
+            Console.WriteLine("error fix");
+            SimpleLongPolling.Publish(uuid, "-1");
+          }
         }
       }
     }
index 3af63065e17b0e6297987177293b43e6dc8d94b7..fe3918a9570be500d1f83c8807579def18e2a5a0 100644 (file)
   \r
   <script src="/static/js:Zip:Index.js" asp-append-version="true"></script>\r
 \r
+  <script>\r
+    $(document).bind('keydown', function(e){\r
+      if (e.keyCode == 113 && selected_nameChange != undefined){\r
+        NameFormToggle();\r
+      }\r
+    });\r
+  </script>\r
 <!-- #region 모바일 클릭, 더블클릭, 드래그(메뉴소환) 이벤트 -->\r
   <script>\r
     var bStartEvent= false;\r
index 056e8082dfc1e45164679b76cf12519ea49b821e..a85494e70f1e01823a63220fd674e23bcca6aac8 100644 (file)
@@ -74,7 +74,7 @@
     <i class="fas fa-circle" style="color: rgb(70, 186, 33);"></i>\r
   </div>\r
   <div class="modal">\r
-    <span>@LanguagePack.GetText(lang, "pleasewait") <div><progress value="0" max="1"></progress></div></span>\r
+    <span><label>@LanguagePack.GetText(lang, "readyforcompress1")<br>@LanguagePack.GetText(lang, "readyforcompress2")</label><div><progress value="0" max="1"></progress></div></span>\r
   </div>\r
   <div class="webzip-btn-complate">\r
     <div class="webzip-btn" onclick="$('.modal').css('display', 'table');RequestCompress();">\r
@@ -88,7 +88,7 @@
   <directory>\r
     <bullet is="zip"></bullet>\r
     <label onmousedown="Clicked($(this))" key="0" id="zip_default">\r
-      example\r
+      @LanguagePack.GetText(lang, "newzipfile")\r
     </label>\r
     <input type="text" value="example" onkeypress="ChangeKeypress($(this));" style="display:none; line-height:1" onblur="ChangeInput($(this));" onfocus="var a= this.value;this.value= null;this.value= a;" />\r
     <ul class="sort-disabled">\r
index 501574a48ab7e6e96389e712fbb3aa7064ab137f..9e2a8ae91e0b24253dc73a86a13fe9dbde56ed09 100644 (file)
   "renameZip": "Rename zipfile",
   "usersguide": "User's Guide",
   "guide1": "1. Click on the file to select it.",
-  "guide2": "2. The file can be dragged into the folder. <br> ",
+  "guide2": "2. The file can be dragged into the folder.",
   "guide3": "3. Folder is folded when double-clicked and opens when double-clicking again.",
   "guide4": "4. Right-click contextmenu appears.",
   "guide5": "5. For mobile users, the directory function is not possible, and the menu is dragged to the right.",
   "complate": "Complate",
-  "pleasewait": "Compressing files Please wait.",
+  "pleasewait": "Compressing files...",
+  "readyforcompress1": "We are preparing for compression, so please wait ...",
+  "readyforcompress2": "The larger the capacity, the longer it may take to prepare.",
   "iscompress": "proceed with compression? FileSize: ",
   "toolargesize": "The capacity of the files exceeds the maximum file size of 2 GB and can not proceed.",
   "nofilesadded": "No files added.",
   "footIntroduce": "Easy and convenient file compression! Please find NiceZip.",
-  "removefilefolder": "remove file,directory"
+  "removefilefolder": "remove file,directory",
+  "newzipfile": "New zipfile"
 }
index a7fa5872e3337b8415f7b6e49af9886f11363506..db850e401aa82885aa82b26937a9c53e5fbd2680 100644 (file)
   "guide4": "4. 우클릭시 메뉴가 나타납니다",
   "guide5": "5. 모바일사용자는 디렉토리이동은 불가하며, 메뉴는 오른쪽으로 드래그하시면 나옵니다",
   "complate": "완료",
-  "pleasewait": "압축중입니다 잠시만 기다려주세요.",
+  "pleasewait": "압축중입니다...",
+  "readyforcompress1": "압축을 준비중이니 잠시 기다려주세요...",
+  "readyforcompress2": "용량이 많을수록 준비가 오래걸릴 수 있습니다",
   "iscompress": "압축을 진행하시겠습니까? FileSize: ",
   "toolargesize": "파일들의 용량이 최대파일크기인 2GB를 넘어가서 진행할 수 없습니다.",
   "nofilesadded": "추가된 파일이 없습니다.",
   "footIntroduce": "쉽고 편리한 압축! NiceZip을 찾아주세요.",
-  "removefilefolder": "파일,폴더 제거"
+  "removefilefolder": "파일,폴더 제거",
+  "newzipfile": "새 압축파일"
 }
index f015dddaa74a929a65a6661909bf2022fa1fd8a6..b1ff912884452cbef77a22d360dac34f03802265 100644 (file)
@@ -362,9 +362,11 @@ function RequestCompress() {
         success: function(data2) {
           $("progress").attr("value", data2);
           if (data2 != "-1") {
+            $(".modal span label").text(_Language["pleasewait"]);
             Getprogress();
           } else {
             //modal display none바꾸고
+            $(".modal span label").html(_Language["readyforcompress1"]+"<br>"+_Language["readyforcompress2"]);
             $(".modal").css("display", "none");
             //파일다운로드 요청.
             var a = document.createElement("a");
@@ -391,19 +393,24 @@ function ChangeKeypress($elem) {
 }
 
 function ChangeInput($elem) {
-  if ($elem.val() == "") {
+  input= $elem.val();
+  input= input.replace(/  /gi, " ");
+  input= input.replace(/ /gi, " ");
+  input= $.trim(input);
+  if (input == "") {
     NotEmptyOrSame($elem.prev());
   }
-  if (isErrFileName($elem.val())) {
+  if (isErrFileName(input)) {
+    $elem.val("dir " + ++sameDir);
     alert(_Language["err_violationFileName"]);
+  } else if (isTooLongFileName(input)) {
     $elem.val("dir " + ++sameDir);
-  } else if (isTooLongFileName($elem.val())) {
     alert(_Language["err_tooLongFileName"]);
-    $elem.val("dir " + ++sameDir);
   } else {
-    directories.put($elem.prev().attr("key"), $elem.val());
+    $elem.val(input);
+    directories.put($elem.prev().attr("key"), input);
   }
-  $elem.prev().text($elem.val());
+  $elem.prev().text(input);
   $elem.css("display", "none");
   $elem.prev().css("display", "");
 }
@@ -486,7 +493,7 @@ document.getElementById("zipExplore").addEventListener("contextmenu", event => {
 //초기세팅(bullet, sort, 기본 zip label 세팅)
 SetBulletIcon();
 SetSortable();
-directories.put(0, "example");
+directories.put(0, _Language["newzipfile"]);
 
 //웹소켓(안씀)
 // var protocol = location.protocol === "https:" ? "wss:" : "ws:";