diff --git a/www/css/style.css b/www/css/style.css index e6989cb..74c7a2c 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -3,4 +3,7 @@ } #navbar{ height:3.1em; +} +#recentlyOpened{ + } \ No newline at end of file diff --git a/www/index.html b/www/index.html index 40c13c8..029f761 100644 --- a/www/index.html +++ b/www/index.html @@ -4,12 +4,10 @@ - - - + @@ -25,14 +23,15 @@ - -
FILE SYSTEM
- +
- +
- +
- + +
+
+
Recent files
+ +
+
+ + +
+
- + @@ -79,4 +87,4 @@
FILE SYSTEM - + \ No newline at end of file diff --git a/www/js/app.js b/www/js/app.js index 61056ad..12c6ada 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -4,6 +4,8 @@ import sett from "./components/tabs/settingsTab.js"; import pasteTab from "./components/tabs/pasteBinTab.js"; import changeLogTab from "./components/tabs/changeLog.js"; import aboutMe from "./components/tabs/aboutMe.js"; +import { writeFile } from "./components/File_System/writeFile.js"; +import { readFile } from "./components/File_System/readFile.js"; $(document).ready(function() { $('[title]').tooltip(); @@ -52,9 +54,9 @@ class CreateTabs { ` } } -let tabIcons = ['fa fa-cog text-info', 'fa fa-paste text-info', 'fa fa-clipboard-list text-info', 'fab fa-github text-info','fa fa-laptop-code text-info'] -let tabs = ["settingstab", "pasteBin", 'changeLog', 'github',"aboutme"] -let tabNames = ["settings", "Paste Bin", "change Log", "git","about"] +let tabIcons = ['fa fa-cog text-info', 'fa fa-paste text-info', 'fa fa-clipboard-list text-info', 'fab fa-github text-info', 'fa fa-laptop-code text-info'] +let tabs = ["settingstab", "pasteBin", 'changeLog', 'github', "aboutme"] +let tabNames = ["settings", "Paste Bin", "change Log", "git", "about"] for (let i = 0; i < tabs.length; i++) { let tab = new CreateTabs(`${tabs[i]}`, tabIcons[i], tabNames[i]); } @@ -67,4 +69,17 @@ ftb.setAttribute('aria-selected', 'true') sett('#settingstaby') pasteTab("#pasteBin") changeLogTab('#changeLog') -aboutMe('#aboutme') \ No newline at end of file +aboutMe('#aboutme') + +// recent files + +export function addRecentlyOpenedFile(name, url, fs) { + let recentFilesTab = document.getElementById('recent_file') + + let openedFile = makeElm('li') + insertAttr(['class=list-group-item'], openedFile) + openedFile.innerText = name + openedFile.addEventListener('click', function() { fs(url) }) + + recentFilesTab.appendChild(openedFile) +} \ No newline at end of file diff --git a/www/js/components/main_FileEntry.js b/www/js/components/main_FileEntry.js index 537e33c..bbcc501 100644 --- a/www/js/components/main_FileEntry.js +++ b/www/js/components/main_FileEntry.js @@ -1,4 +1,4 @@ -import { OPENFS, SAVEFS } from "../app.js"; +import { OPENFS, SAVEFS, addRecentlyOpenedFile } from "../app.js"; import { writeFile } from "./File_System/writeFile.js"; import { readFile } from "./File_System/readFile.js"; import { entryIcon } from "./File_System/fileSysUi.js"; @@ -78,6 +78,7 @@ export async function onDeviceReady() { } else { alert(`file ${filename} is not valid`) } + addRecentlyOpenedFile(filename,fileTruePath,workWithFile) } fs.root.getFile('Android/data/com.ace.code/files/settings.json', { create: true, @@ -89,8 +90,8 @@ export async function onDeviceReady() { aceEditor.setOptions(JSON.parse(this.result)) } reader.readAsText(file) - },(e)=>console.log()); - },(e)=>console.log(e)); + }, (e) => console.log()); + }, (e) => console.log(e)); window.getUrls = getUrls let fE; //Helps to avoid saving the same data in various entries diff --git a/www/js/components/tabs/changeLog.js b/www/js/components/tabs/changeLog.js index 7883f21..ca54a49 100644 --- a/www/js/components/tabs/changeLog.js +++ b/www/js/components/tabs/changeLog.js @@ -1,7 +1,14 @@ -let log = [ - "Added new paste in textarea ", - "support for new language", - "Added about section" +let log = [{ + version: 'v5.0.0 (latest)', + info: `Added tab for recently edited files + implemented saving of setting + ` +}, { + version: 'v 4.0.7', + info: `Added new paste in textarea, + support for new language, + Added about section` +} ] export default function changeLogTab(_par) { @@ -10,20 +17,20 @@ export default function changeLogTab(_par) { insertAttr(['class=container'], listGroup) let listElm = makeElm('ul') insertAttr(['class=list-group'], listElm) - - let versionName = makeElm('h2'); - versionName.innerText = 'v 4.0.7 (latest)' - listElm.appendChild(versionName) - listGroup.appendChild(listElm) - addLogTxt() - parentElm.appendChild(listGroup); - - function addLogTxt() { - let listItem; - log.forEach((lg) => { - listItem = makeElm('li'); - listItem.innerText = lg - listElm.appendChild(listItem) - }) + parentElm.appendChild(listElm) + let version, listItem,title,inform; + for (let i = 0; i < log.length; i++) + { + version = makeElm('li'); + title = makeElm('h2') + version.appendChild(title) + title.innerText = log[i].version + inform = makeElm('p') + inform.innerText=log[i].info + insertAttr(['class=list-group-item'],version) + version.appendChild(inform) + listElm.appendChild(version) + parentElm.appendChild(version); } + } \ No newline at end of file