Bläddra i källkod

Updated download page for share

TC pushbot 5 4 år sedan
förälder
incheckning
55ca2804e3
2 ändrade filer med 65 tillägg och 3 borttagningar
  1. 43 3
      system/share/downloadPageFolder.html
  2. 22 0
      web/SystemAO/security/authreq.html

+ 43 - 3
system/share/downloadPageFolder.html

@@ -48,6 +48,19 @@
           -ms-user-select: none; /* Internet Explorer/Edge */
           user-select: none;
         }
+
+        #filelistWrapper{
+          position: relative;
+          padding: 12px;
+          border-top: 4px solid #ffe46c;
+          -webkit-box-shadow: 11px 9px 23px 0px rgba(54,54,54,0.31); 
+          box-shadow: 11px 9px 23px 0px rgba(54,54,54,0.31);
+        }
+
+        td{
+          word-wrap: anywhere;
+          word-break: break-all;
+        }
     </style>
     </head>
     <body>
@@ -90,7 +103,7 @@
                     <p>Request File ID: {{reqid}}</p>
                     <p>Request Timestamp: {{reqtime}}</p>
                 </div>
-                <div class="one-half column" id="filelistWrapper" style="overflow-y: auto; padding-right: 0.5em;">
+                <div class="one-half column" id="filelistWrapper" style="overflow-y: auto; padding-right: 0.5em; min-height: 400px;">
                   <table class="u-full-width">
                     <thead>
                       <tr>
@@ -119,7 +132,20 @@
       var selectedFile = null;
       renderFileList(treeFileList["."]);
 
-      console.log(treeFileList);
+      handleWindowResize();
+      $(window).on("resize", function(e){
+        handleWindowResize();
+      });
+
+      function handleWindowResize(){
+        if (window.innerWidth < 550){
+          //Assume mobile
+          $(".footer").css("height", "20px");
+        }else{
+          $(".footer").css("height", "50px");
+        }
+      }
+      
 
       function renderFileList(filelist){
         $("#folderList").html("");
@@ -134,10 +160,24 @@
           var filetype = "File";
           var displayName = "";
           if (file.IsDir == true){
+            //Folder
             filetype = "Folder";
             displayName = "📁 " + file.Filename;
           }else{
-            displayName = "📄 " + file.Filename;
+            //File
+            var ext = file.Filename.split(".").pop();
+            var icon = "📄"
+            ext = ext.toLowerCase();
+            if (ext == "mp3" || ext == "wav" || ext == "flac" || ext == "aac" || ext == "ogg" || ext == ""){
+              icon = "🎵";
+            }else if (ext == "mp4" || ext == "avi" || ext == "webm" || ext == "mkv" || ext == "mov" || ext == "rvmb"){
+              icon = "🎞️";
+            }else if (ext == "png" || ext == "jpeg" || ext == "jpg" || ext == "bmp" || ext == "gif"){
+              icon = "🖼️";
+            }
+
+            displayName =  icon + " " + file.Filename;
+            
           }
           $("#folderList").append(`<tr class="fileobject noselect" onclick="highlightThis(this);" filename="${file.Filename}" relpath="${file.RelPath}" type="${filetype.toLocaleLowerCase()}" ondblclick="event.preventDefault(); openThis(this);">
               <td style="padding-left: 8px;">${displayName}</td>

+ 22 - 0
web/SystemAO/security/authreq.html

@@ -54,6 +54,28 @@
     </div>
     
     <script>
+        /*
+            Usage Example:
+            var apiObject = {
+                api: "/system/myfunction",
+                data: {message: "Hello World"},
+                title: "<i class='red exclamation triangle icon'></i> Danger Operation <i class='red exclamation triangle icon'></i>",
+                desc: "Please enter your password to confirm operation.",
+                thisuser: true, //This username as default, set to false for allowing other user name to be entered
+                method: "GET"
+            }
+
+            ao_module_newfw({
+                url: "SystemAO/security/authreq.html#" + encodeURIComponent(JSON.stringify(apiObject)),
+                width: 480,
+                height: 300,
+                appicon: "SystemAO/security/img/lock.svg",
+                title: "Authentication Required",
+                parent: ao_module_windowID,
+                callback: "handleAuthCallback"
+            });
+
+        */
        ao_module_setFixedWindowSize();
        ao_module_setWindowSize(420, 260);
        var actionObject = {};