diff --git a/src/core/routes/Routes.py b/src/core/routes/Routes.py index 0ef5408..f5e675a 100644 --- a/src/core/routes/Routes.py +++ b/src/core/routes/Routes.py @@ -86,7 +86,6 @@ def fileManagerAction(_type, _hash = None): view.set_to_home() return redirect("/") - folder = view.get_current_directory() file = view.get_path_part_from_hash(_hash) fpath = os.path.join(folder, file) @@ -100,6 +99,7 @@ def fileManagerAction(_type, _hash = None): # I.E....this is stupid but for now works better than nothing return view.remuxVideo(_hash, fpath) if _type == "run-locally": + msg = "Opened media..." view.openFilelocally(fpath) return msgHandler.createMessageJSON("success", msg) @@ -140,7 +140,7 @@ def manageFavorites(_action): if request.method == 'POST': ACTION = _action.strip() view = get_window_controller().get_window(1).get_view(0) - path = view.getPath() + path = view.get_current_directory() if ACTION == "add": fave = Favorites(link=path) diff --git a/src/core/static/css/fonts/Dosis-VariableFont_wght.ttf b/src/core/static/css/fonts/Dosis-VariableFont_wght.ttf new file mode 100644 index 0000000..78af21c Binary files /dev/null and b/src/core/static/css/fonts/Dosis-VariableFont_wght.ttf differ diff --git a/src/core/static/css/fonts/dosis/Dosis-Bold.ttf b/src/core/static/css/fonts/dosis/Dosis-Bold.ttf new file mode 100644 index 0000000..a9cf34a Binary files /dev/null and b/src/core/static/css/fonts/dosis/Dosis-Bold.ttf differ diff --git a/src/core/static/css/fonts/dosis/Dosis-ExtraBold.ttf b/src/core/static/css/fonts/dosis/Dosis-ExtraBold.ttf new file mode 100644 index 0000000..71f25b0 Binary files /dev/null and b/src/core/static/css/fonts/dosis/Dosis-ExtraBold.ttf differ diff --git a/src/core/static/css/fonts/dosis/Dosis-ExtraLight.ttf b/src/core/static/css/fonts/dosis/Dosis-ExtraLight.ttf new file mode 100644 index 0000000..b47296d Binary files /dev/null and b/src/core/static/css/fonts/dosis/Dosis-ExtraLight.ttf differ diff --git a/src/core/static/css/fonts/dosis/Dosis-Light.ttf b/src/core/static/css/fonts/dosis/Dosis-Light.ttf new file mode 100644 index 0000000..9da0907 Binary files /dev/null and b/src/core/static/css/fonts/dosis/Dosis-Light.ttf differ diff --git a/src/core/static/css/fonts/dosis/Dosis-Medium.ttf b/src/core/static/css/fonts/dosis/Dosis-Medium.ttf new file mode 100644 index 0000000..8b47958 Binary files /dev/null and b/src/core/static/css/fonts/dosis/Dosis-Medium.ttf differ diff --git a/src/core/static/css/fonts/dosis/Dosis-Regular.ttf b/src/core/static/css/fonts/dosis/Dosis-Regular.ttf new file mode 100644 index 0000000..f31a36a Binary files /dev/null and b/src/core/static/css/fonts/dosis/Dosis-Regular.ttf differ diff --git a/src/core/static/css/fonts/dosis/Dosis-SemiBold.ttf b/src/core/static/css/fonts/dosis/Dosis-SemiBold.ttf new file mode 100644 index 0000000..9648025 Binary files /dev/null and b/src/core/static/css/fonts/dosis/Dosis-SemiBold.ttf differ diff --git a/src/core/static/css/webfonts/fa-brands-400.ttf b/src/core/static/css/fonts/fa-brands-400.ttf similarity index 100% rename from src/core/static/css/webfonts/fa-brands-400.ttf rename to src/core/static/css/fonts/fa-brands-400.ttf diff --git a/src/core/static/css/webfonts/fa-brands-400.woff b/src/core/static/css/fonts/fa-brands-400.woff similarity index 100% rename from src/core/static/css/webfonts/fa-brands-400.woff rename to src/core/static/css/fonts/fa-brands-400.woff diff --git a/src/core/static/css/webfonts/fa-brands-400.woff2 b/src/core/static/css/fonts/fa-brands-400.woff2 similarity index 100% rename from src/core/static/css/webfonts/fa-brands-400.woff2 rename to src/core/static/css/fonts/fa-brands-400.woff2 diff --git a/src/core/static/css/webfonts/fa-regular-400.ttf b/src/core/static/css/fonts/fa-regular-400.ttf similarity index 100% rename from src/core/static/css/webfonts/fa-regular-400.ttf rename to src/core/static/css/fonts/fa-regular-400.ttf diff --git a/src/core/static/css/webfonts/fa-regular-400.woff b/src/core/static/css/fonts/fa-regular-400.woff similarity index 100% rename from src/core/static/css/webfonts/fa-regular-400.woff rename to src/core/static/css/fonts/fa-regular-400.woff diff --git a/src/core/static/css/webfonts/fa-regular-400.woff2 b/src/core/static/css/fonts/fa-regular-400.woff2 similarity index 100% rename from src/core/static/css/webfonts/fa-regular-400.woff2 rename to src/core/static/css/fonts/fa-regular-400.woff2 diff --git a/src/core/static/css/webfonts/fa-solid-900.ttf b/src/core/static/css/fonts/fa-solid-900.ttf similarity index 100% rename from src/core/static/css/webfonts/fa-solid-900.ttf rename to src/core/static/css/fonts/fa-solid-900.ttf diff --git a/src/core/static/css/webfonts/fa-solid-900.woff b/src/core/static/css/fonts/fa-solid-900.woff similarity index 100% rename from src/core/static/css/webfonts/fa-solid-900.woff rename to src/core/static/css/fonts/fa-solid-900.woff diff --git a/src/core/static/css/webfonts/fa-solid-900.woff2 b/src/core/static/css/fonts/fa-solid-900.woff2 similarity index 100% rename from src/core/static/css/webfonts/fa-solid-900.woff2 rename to src/core/static/css/fonts/fa-solid-900.woff2 diff --git a/src/core/static/css/fonts/fontawesome-webfont.ttf b/src/core/static/css/fonts/fontawesome-webfont.ttf new file mode 100644 index 0000000..e89738d Binary files /dev/null and b/src/core/static/css/fonts/fontawesome-webfont.ttf differ diff --git a/src/core/static/css/fonts/fontawesome-webfont.woff b/src/core/static/css/fonts/fontawesome-webfont.woff new file mode 100644 index 0000000..8c1748a Binary files /dev/null and b/src/core/static/css/fonts/fontawesome-webfont.woff differ diff --git a/src/core/static/css/fonts/fontawesome-webfont.woff2 b/src/core/static/css/fonts/fontawesome-webfont.woff2 new file mode 100644 index 0000000..4d13fc6 Binary files /dev/null and b/src/core/static/css/fonts/fontawesome-webfont.woff2 differ diff --git a/src/core/static/css/overrides.css b/src/core/static/css/overrides.css index f431ccc..3b54a12 100644 --- a/src/core/static/css/overrides.css +++ b/src/core/static/css/overrides.css @@ -1,3 +1,28 @@ +@font-face { + font-family: Dosis; + src: url("/static/css/fonts/dosis/Dosis-Regular.ttf"), + url("/static/css/fonts/dosis/Dosis-Medium.ttf"), + url("/static/css/fonts/dosis/Dosis-Light.ttf"), + url("/static/css/fonts/dosis/Dosis-ExtraLight.ttf"), + url("/static/css/fonts/dosis/Dosis-Bold.ttf"), + url("/static/css/fonts/dosis/Dosis-ExtraBold.ttf"), + url("/static/css/fonts/dosis/Dosis-SemiBold.ttf"), + url("/static/css/fonts/Dosis-VariableFont_wght.ttf"), + url("/static/css/fonts/fa-brands-400.ttf"), + url("/static/css/fonts/fa-regular-400.ttf"), + url("/static/css/fonts/fa-solid-900.ttf"); + font-style: normal; + font-display: auto; +} + +body { + font-family: Dosis; +} + +ul, li { + list-style: none; +} + ul, li { list-style: none; } diff --git a/src/core/static/js/cookie-manager.js b/src/core/static/js/cookie-manager.js new file mode 100644 index 0000000..9282ebe --- /dev/null +++ b/src/core/static/js/cookie-manager.js @@ -0,0 +1,8 @@ +const getCookie = (cookieKey) => { + return Cookies.get(cookieKey); +} + +const setCookie = (key, value, args = { expires: new Date('December 31, 2034 03:24:00'), + path: '/' }) => { + Cookies.set(key, value, args); +} diff --git a/src/core/static/js/events.js b/src/core/static/js/events.js index ad65c21..b42b1ec 100644 --- a/src/core/static/js/events.js +++ b/src/core/static/js/events.js @@ -11,10 +11,10 @@ document.body.onload = (eve) => { elm.parentElement.removeChild(elm); // Stylesheet for iframe views - var link = document.createElement("link"); + let link = document.createElement("link"); link.href = formatURL("static/css/iframe.css"); link.type = "text/css"; - link.rel = "stylesheet"; + link.rel = "stylesheet"; document.getElementsByTagName("head")[0].appendChild(link); }, 500); } @@ -22,47 +22,30 @@ document.body.onload = (eve) => { + const openFile = (eve) => { - let target = eve.target; - let hash = target.getAttribute("app"); - listFilesAjax(hash); + const target = eve.target; + const ftype = target.getAttribute("ftype"); + const title = target.getAttribute("title"); + const hash = target.getAttribute("hash"); + const parts = title.split('.'); + const extension = "." + parts[parts.length - 1].toLowerCase(); + + if (ftype === "dir") { + listFilesAjax(hash); + } else if (ftype === "video") { + showMedia(hash, extension, "video"); + } else { + showMedia(hash, extension, "file"); + } } const openFileLocally = (eve) => { - let target = eve.target; - let hash = target.getAttribute("app"); + const target = eve.target; + const hash = target.getAttribute("hash"); openWithLocalProgram(hash); } -// Actions for content -// document.getElementById('file-grid').ondblclick = (event) => { -// let target = event.target; -// let className = target.className; -// -// // Left click detect -// if (event.which == 1) { -// // If clicking on container -// if (className === "dir-style" || className === "video-style" || -// className === "file-style" || className === "image-style") { -// const title = target.getAttribute("title"); -// const hash = target.getAttribute("hash"); -// const parts = title.split('.'); -// const extension = "." + parts[parts.length - 1].toLowerCase(); -// -// if (className === "dir-style") { -// listFilesAjax(hash); -// } else if (className === "video-style") { -// showMedia(hash, extension, "video"); -// } else { -// showMedia(hash, extension, "file"); -// } -// } -// } -// } - - - - diff --git a/src/core/static/js/post-ajax.js b/src/core/static/js/post-ajax.js index cf1e251..b47255e 100644 --- a/src/core/static/js/post-ajax.js +++ b/src/core/static/js/post-ajax.js @@ -68,7 +68,5 @@ const updateHTMLDirList = async (data) => { else tggl_faves_btn.classList.remove("btn-info"); - console.log(data.list); - renderFilesList(data.list); } diff --git a/src/core/static/js/react-ui-logic.js b/src/core/static/js/react-ui-logic.js index 1e5912e..757530a 100644 --- a/src/core/static/js/react-ui-logic.js +++ b/src/core/static/js/react-ui-logic.js @@ -86,8 +86,8 @@ class FilesList extends React.Component { {card_body}
diff --git a/src/core/static/js/ui-logic.js b/src/core/static/js/ui-logic.js index f35c0a7..8366dc7 100644 --- a/src/core/static/js/ui-logic.js +++ b/src/core/static/js/ui-logic.js @@ -121,7 +121,7 @@ const setupFile = async (hash, extension) => { const openWithLocalProgram = async (hash, extension = "") => { - const url = "run-locally/" + hash; + const url = "api/file-manager-action/run-locally/" + hash; let data = await fetchData(url); let message = data.message; displayMessage(message.text, message.type); @@ -186,6 +186,30 @@ const updateBackground = (srcLink, isvideo = true) => { } +const manageFavorites = (elm) => { + const classType = "btn-info"; + const hasClass = elm.classList.contains(classType); + if (hasClass) { + elm.classList.remove(classType); + action = "delete"; + } else { + elm.classList.add(classType); + action = "add"; + } + + manageFavoritesAjax(action); +} + + +const loadFave = (id) => { + loadFavoriteLink(id); + document.getElementById("favorites-modal") + .getElementsByClassName("modal-footer")[0] + .children[0].click() +} + + + // Message handler const displayMessage = (message, type, timeout, msgWindow = "page-alert-zone") => { let alertField = document.getElementById(msgWindow); diff --git a/src/core/templates/body-header.html b/src/core/templates/body-header.html index 58714b2..935800e 100644 --- a/src/core/templates/body-header.html +++ b/src/core/templates/body-header.html @@ -8,11 +8,21 @@