1.7.0 -> File opening!

master v1.7.0
Kit Kasune 3 years ago
parent 247abefe2b
commit 17bfc3b1d0
  1. 1
      json/changelogs/1.7.0.json
  2. 4
      package-lock.json
  3. 2
      package.json
  4. 1
      scripts/fileview/load/load.js
  5. 13
      scripts/fileview/load/render.js

@ -0,0 +1 @@
{"log":{"File opening":["Files now open!!","I know right, a file explorer that opens files. Revolutionary.","This feature is dependent on you being on a version of Windows where PowerShell exists. Whether or not it works every single time is a bit untested, so it could cause some twitchy stuff to happen. This has not been written for Linux or Mac yet."]},"version":{"name":"Alpha","semver":"1.7.0"}}

4
package-lock.json generated

@ -1,12 +1,12 @@
{
"name": "filekade",
"version": "1.6.4",
"version": "1.7.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "filekade",
"version": "1.6.4",
"version": "1.7.0",
"license": "ISC",
"dependencies": {
"chalk": "^4.1.2",

@ -1,6 +1,6 @@
{
"name": "filekade",
"version": "1.6.4",
"version": "1.7.0",
"description": "A file explorer (primarily a learning experience for me)",
"main": "main.js",
"scripts": {

@ -16,6 +16,7 @@ module.exports = (check=false) => {
for (const file of ldir) {
let ofile = {};
ofile.icon = fileIcon(`${dir}/${file}`, file);
ofile.trueName = file;
ofile.name = trimext.includes(path.extname(file)) ? file.slice(0, file.length - path.extname(file).length) : file;
try {ofile.type = fs.lstatSync(`${dir}/${file}`).isDirectory() ? "File Folder" : (extensions[(file.startsWith('.') ? file : path.extname(file)).slice(1)] || "File");}
catch {ofile.type = `${path.extname(file)} File`.trim();}

@ -1,4 +1,7 @@
const cp = require('child_process');
const loadHierarchy = require("../hierarchy");
const newToast = require('../../toast/createtoast');
const isOverflowing = require('../../dep/overflowing');
@ -16,7 +19,15 @@ module.exports = (dir, options) => {
if (file.type.toLowerCase().includes('folder')) {cfc.classList.add('folder');}
cfc.onclick = function () {
window.kade.elc = true;
if (cfc.classList.contains('file-active')) {if (file.dir) {refresh(`${window.kade.cpath}/${file.name}`);}}
if (cfc.classList.contains('file-active')) {
if (file.dir) {refresh(`${window.kade.cpath}/${file.name}`);}
else {
try {cp.exec(`${window.kade.cpath}/${file.trueName}`, {shell: 'powershell.exe'}, (error) => {
if (error) {newToast("Error", "Unable to open file.", "#a4052b");}
});}
catch {newToast("Error", "Unable to open file.", "#a4052b");}
}
}
cfc.classList.add('file-active');
if (window.kade.cl && !cfc.isSameNode(window.kade.cl)) {window.kade.cl.classList.remove('file-active');}
window.kade.cl = cfc;

Loading…
Cancel
Save