|
@@ -731,7 +731,7 @@
|
|
|
<i class="dropdown icon"></i> <span locale="sidebar/vroot/user">User</span>
|
|
|
</summary>
|
|
|
<div id="userroot" class="ts list" style="padding-top:0px !important;">
|
|
|
- <div class="dir item whiteTheme"><i class="loading circle notched rightmargin icon"></i> Initiating</div>
|
|
|
+ <div class="dir item whiteTheme"><i class="loading circle notched rightmargin icon"></i> <span locale="message/initiating">Initiating</span></div>
|
|
|
</div>
|
|
|
</details>
|
|
|
<details class="ts accordion fluid whiteTheme" open>
|
|
@@ -739,7 +739,7 @@
|
|
|
<i class="dropdown icon"></i> <span locale="sidebar/vroot/fsh">Storage</span>
|
|
|
</summary>
|
|
|
<div id="storageroot" class="ts list" style="padding-top:0px !important;">
|
|
|
- <div class="dir item whiteTheme"><i class="loading circle notched rightmargin icon"></i> Initiating</div>
|
|
|
+ <div class="dir item whiteTheme"><i class="loading circle notched rightmargin icon"></i> <span locale="message/initiating">Initiating</span></div>
|
|
|
</div>
|
|
|
</details>
|
|
|
<!--
|
|
@@ -1183,141 +1183,142 @@
|
|
|
let isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
|
|
|
|
//Intiiation functions
|
|
|
- if (applocale){
|
|
|
- //Applocale found. Do localization
|
|
|
- applocale.init("../locale/file_explorer.json", function(){
|
|
|
- applocale.translate();
|
|
|
+ $(document).ready(function(){
|
|
|
+ if (applocale){
|
|
|
+ //Applocale found. Do localization
|
|
|
+ applocale.init("../locale/file_explorer.json", function(){
|
|
|
+ applocale.translate();
|
|
|
+ initRootDirs();
|
|
|
+ initSystemInfo();
|
|
|
+ initUploadMode();
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ //Applocale not found. Is this a trim down version of ArozOS?
|
|
|
+ applocale = {
|
|
|
+ getString: function(key, original){
|
|
|
+ return original;
|
|
|
+ }
|
|
|
+ }
|
|
|
initRootDirs();
|
|
|
initSystemInfo();
|
|
|
initUploadMode();
|
|
|
- });
|
|
|
- }else{
|
|
|
- //Applocale not found. Is this a trim down version of ArozOS?
|
|
|
- applocale = {
|
|
|
- getString: function(key, original){
|
|
|
- return original;
|
|
|
- }
|
|
|
}
|
|
|
- initRootDirs();
|
|
|
- initSystemInfo();
|
|
|
- initUploadMode();
|
|
|
- }
|
|
|
|
|
|
+ if (isMobile){
|
|
|
+ //Mobile css adjustment
|
|
|
+ sideBarShown = false;
|
|
|
+ $("#directorySidebar").hide();
|
|
|
+ $("#directorySidebar").css("width",window.innerWidth + "px");
|
|
|
+ $("body").css("overflow","hidden");
|
|
|
+ directorySidebarWidth = window.innerWidth;
|
|
|
+ $("#folderView").css({
|
|
|
+ "padding-right":"1em",
|
|
|
+ "padding-left":"1em",
|
|
|
+ "padding-top":"1em",
|
|
|
+ });
|
|
|
+ $(".desktopOnly").hide();
|
|
|
+ $(".mobileOnly").show();
|
|
|
|
|
|
- if (isMobile){
|
|
|
- //Mobile css adjustment
|
|
|
- sideBarShown = false;
|
|
|
- $("#directorySidebar").hide();
|
|
|
- $("#directorySidebar").css("width",window.innerWidth + "px");
|
|
|
- $("body").css("overflow","hidden");
|
|
|
- directorySidebarWidth = window.innerWidth;
|
|
|
- $("#folderView").css({
|
|
|
- "padding-right":"1em",
|
|
|
- "padding-left":"1em",
|
|
|
- "padding-top":"1em",
|
|
|
- });
|
|
|
- $(".desktopOnly").hide();
|
|
|
- $(".mobileOnly").show();
|
|
|
+ //Adjust minor css on mobile devices
|
|
|
+ $(".rightPad").css("margin-right", "37px");
|
|
|
+ }else{
|
|
|
+ $(".mobileOnly").hide();
|
|
|
+ $(".desktopOnly").show();
|
|
|
|
|
|
- //Adjust minor css on mobile devices
|
|
|
- $(".rightPad").css("margin-right", "37px");
|
|
|
- }else{
|
|
|
- $(".mobileOnly").hide();
|
|
|
- $(".desktopOnly").show();
|
|
|
+ $(".rightPad").css("margin-right", "37px");
|
|
|
+ }
|
|
|
+ //Initialize view mode buttons
|
|
|
+ updateViewmodeButtons();
|
|
|
+ loadListModeFromDB();
|
|
|
|
|
|
- $(".rightPad").css("margin-right", "37px");
|
|
|
- }
|
|
|
- //Initialize view mode buttons
|
|
|
- updateViewmodeButtons();
|
|
|
- loadListModeFromDB();
|
|
|
+ //Initialize system theme
|
|
|
+ loadPreference("file_explorer/theme",function(data){
|
|
|
+ if (data.error === undefined){
|
|
|
+ if (data == "darkTheme"){
|
|
|
+ toggleDarkTheme();
|
|
|
+ }else{
|
|
|
+ //White theme
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- //Initialize system theme
|
|
|
- loadPreference("file_explorer/theme",function(data){
|
|
|
- if (data.error === undefined){
|
|
|
- if (data == "darkTheme"){
|
|
|
- toggleDarkTheme();
|
|
|
+ if (window.location.hash != ""){
|
|
|
+ //Check if the hash is standard open protocol. If yes, translate it
|
|
|
+ if (ao_module_loadInputFiles() === null){
|
|
|
+ //Window location hash set. List the desire directory
|
|
|
+ currentPath = window.location.hash.substring(1,window.location.hash.length);
|
|
|
+ if (currentPath.substring(currentPath.length -1) != "/"){
|
|
|
+ currentPath = currentPath + "/";
|
|
|
+ }
|
|
|
+ currentPath = decodeURIComponent(currentPath);
|
|
|
+ loadListModeFromDB(function(){
|
|
|
+ listDirectory(currentPath);
|
|
|
+ });
|
|
|
+
|
|
|
}else{
|
|
|
- //White theme
|
|
|
-
|
|
|
+ //This is ao_module load file input. Handle the file opening
|
|
|
+ var filelist = ao_module_loadInputFiles();
|
|
|
+ if (filelist.length > 0){
|
|
|
+ filelist = filelist[0];
|
|
|
+ //Check if this is folder or file. Only opendir when it is folder
|
|
|
+ //Updates 27-12-2020: Open folder and highlight the file if it is file
|
|
|
+ if (filelist.filename.includes(".") == false){
|
|
|
+ //Try to open it and overwrite the hash to filesystem hash
|
|
|
+ loadListModeFromDB(function(){
|
|
|
+ listDirectory(filelist.filepath);
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ //File. Open its parent folder and highlight the target file if exists
|
|
|
+ var parentdir = filelist.filepath.split("/");
|
|
|
+ let focusFilename = JSON.parse(JSON.stringify(filelist.filename));
|
|
|
+ parentdir.pop();
|
|
|
+ parentdir = parentdir.join("/");
|
|
|
+ loadListModeFromDB(function(){
|
|
|
+ listDirectory(parentdir, function(){
|
|
|
+ focusFileObject(focusFilename);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ }else{
|
|
|
|
|
|
- if (window.location.hash != ""){
|
|
|
- //Check if the hash is standard open protocol. If yes, translate it
|
|
|
- if (ao_module_loadInputFiles() === null){
|
|
|
- //Window location hash set. List the desire directory
|
|
|
- currentPath = window.location.hash.substring(1,window.location.hash.length);
|
|
|
- if (currentPath.substring(currentPath.length -1) != "/"){
|
|
|
- currentPath = currentPath + "/";
|
|
|
- }
|
|
|
- currentPath = decodeURIComponent(currentPath);
|
|
|
+ //Initialized directory views
|
|
|
loadListModeFromDB(function(){
|
|
|
listDirectory(currentPath);
|
|
|
});
|
|
|
-
|
|
|
- }else{
|
|
|
- //This is ao_module load file input. Handle the file opening
|
|
|
- var filelist = ao_module_loadInputFiles();
|
|
|
- if (filelist.length > 0){
|
|
|
- filelist = filelist[0];
|
|
|
- //Check if this is folder or file. Only opendir when it is folder
|
|
|
- //Updates 27-12-2020: Open folder and highlight the file if it is file
|
|
|
- if (filelist.filename.includes(".") == false){
|
|
|
- //Try to open it and overwrite the hash to filesystem hash
|
|
|
- loadListModeFromDB(function(){
|
|
|
- listDirectory(filelist.filepath);
|
|
|
- });
|
|
|
- }else{
|
|
|
- //File. Open its parent folder and highlight the target file if exists
|
|
|
- var parentdir = filelist.filepath.split("/");
|
|
|
- let focusFilename = JSON.parse(JSON.stringify(filelist.filename));
|
|
|
- parentdir.pop();
|
|
|
- parentdir = parentdir.join("/");
|
|
|
- loadListModeFromDB(function(){
|
|
|
- listDirectory(parentdir, function(){
|
|
|
- focusFileObject(focusFilename);
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
- }else{
|
|
|
-
|
|
|
- //Initialized directory views
|
|
|
- loadListModeFromDB(function(){
|
|
|
- listDirectory(currentPath);
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- //Create a timer to check change in current folder
|
|
|
- setInterval(function(){
|
|
|
- if (enableAutoRefresh == false){
|
|
|
- return;
|
|
|
- }
|
|
|
- getDirHash(function(hash){
|
|
|
- if (hash.error !== undefined){
|
|
|
- //Something went wrong. Ignore this request
|
|
|
- console.log(hash.error)
|
|
|
- }else{
|
|
|
- //Check if the hash match with the last hash.
|
|
|
- if (hash != currentPathHash){
|
|
|
- //console.log(currentPathHash, hash);
|
|
|
- refreshList();
|
|
|
- currentPathHash = hash;
|
|
|
- if (currentPath == "user:/"){
|
|
|
- //Reload the User root folder list
|
|
|
- initRootDirs();
|
|
|
+
|
|
|
+
|
|
|
+ //Create a timer to check change in current folder
|
|
|
+ setInterval(function(){
|
|
|
+ if (enableAutoRefresh == false){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ getDirHash(function(hash){
|
|
|
+ if (hash.error !== undefined){
|
|
|
+ //Something went wrong. Ignore this request
|
|
|
+ console.log(hash.error)
|
|
|
+ }else{
|
|
|
+ //Check if the hash match with the last hash.
|
|
|
+ if (hash != currentPathHash){
|
|
|
+ //console.log(currentPathHash, hash);
|
|
|
+ refreshList();
|
|
|
+ currentPathHash = hash;
|
|
|
+ if (currentPath == "user:/"){
|
|
|
+ //Reload the User root folder list
|
|
|
+ initRootDirs();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- });
|
|
|
- }, 5000)
|
|
|
+ });
|
|
|
+ }, 5000)
|
|
|
|
|
|
+ });
|
|
|
|
|
|
//END OF INIT FUNCTIONS
|
|
|
|
|
@@ -1493,13 +1494,13 @@
|
|
|
if (currentTheme == "darkTheme"){
|
|
|
$("#folderList").html(`<div style="height: 100px;">
|
|
|
<div class="ts active dimmer">
|
|
|
- <div class="ts text loader">Loading</div>
|
|
|
+ <div class="ts text loader">${applocale.getString("message/loading", "Loading")}</div>
|
|
|
</div>
|
|
|
</div>`);
|
|
|
}else{
|
|
|
$("#folderList").html(`<div style="height: 100px;">
|
|
|
<div class="ts active inverted dimmer">
|
|
|
- <div class="ts text loader">Loading</div>
|
|
|
+ <div class="ts text loader">${applocale.getString("message/loading", "Loading")}</div>
|
|
|
</div>
|
|
|
</div>`);
|
|
|
}
|
|
@@ -3983,7 +3984,7 @@
|
|
|
}
|
|
|
$(".fileObject.selected").removeClass("selected");
|
|
|
hotSearchTimer = setTimeout(function(){
|
|
|
- existHotSearch();
|
|
|
+ exitHotSearch();
|
|
|
}, 1000);
|
|
|
|
|
|
if (hotSearchBuffer.length > 0 && event.key == hotSearchBuffer.substr(hotSearchBuffer.length - 1, 1)){
|