Skip to content

Commit

Permalink
normalized names + minor fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ilse-langnar committed Nov 9, 2022
1 parent c20b582 commit b7b2702
Show file tree
Hide file tree
Showing 43 changed files with 757 additions and 561 deletions.
2 changes: 1 addition & 1 deletion javascript/web/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ilse-langnar-notebook",
"productName": "Ilse Langnar's Notebook",
"version": "1.2.0",
"version": "1.3.0",
"private": true,
"author": "ilse",
"scripts": {
Expand Down
64 changes: 59 additions & 5 deletions javascript/web/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<template lang="pug">
#app( v-cloak )
#setup( v-show="!ilse.target_directories.length || !ilse.has_loaded " v-html="ilse.components.setup" )

.ilse( v-show="ilse.target_directories.length && ilse.has_loaded" :data-theme="get_data_theme" )
#setup( v-if="!ilse.target_directories.length" v-html="ilse.components.setup" )

.ilse( v-if="ilse.target_directories.length" :data-theme="get_data_theme" )
.html-render( v-for="( item, index ) in ilse.htmls.list" :key="index" )
.div( v-html="item.html" :id="item.id" )

// template( x-data="{ list: window.ilse.tabs.list }" x-for="tab in list" x-init=" list = window.ilse.tabs.list" )
// p( x-text="tab" )
// .htmll( x-html="tab" style="overflow: auto;" )
.app( v-show="ilse.has_loaded" :key="ilse.keys.app" )

// .app( v-show="ilse.has_loaded" :key="ilse.keys.app" )
.wrapper( v-for="( tab, tab_index ) in ilse.tabs.list" :key="tab_index" )
.htmll( v-if="ilse.tabs.selected === tab_index" v-html="tab" style="overflow: auto; " )
.app( v-show="ilse.has_loaded" :key="ilse.keys.app" )
.loop( v-for="( tab, tab_index ) in ilse.tabs.list" :key="tab_index" )
.htmll( v-if="tab.is_active" v-html="tab.html" style="overflow: auto; " )

</template>
<script>
// eslint-disable-next-line
Expand Down Expand Up @@ -147,13 +150,64 @@ export default {
}
/*
:root, .ilse[data-theme='light'] {
--background-color: #EFEFEF;
--secondary-background-color: #CED8E0;
--terciary-background-color: #CED8E0;
--text-color: #717171;
--secondary-text-color: #3c3b3b;
--terciary-text-color: #8D9EAC;
--border: 1px solid #4a4a4a;
--border-radius: 6px;
--padding: 4px;
--font-family: Mary, Helvetica, Georgia, Times New Roman, serif, -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
--font-size: 1em;
--link-color: #5ec7b8;
--secondary-link-color: #70a7a8;
}
.ilse[data-theme="dark"] {
--background-color: #131313ff;
--secondary-background-color: #DCEAF8;
--terciary-background-color: #5a6269;
--text-color: #F8F8F8;
--secondary-text-color: #000;
--terciary-text-color: #8D9EAC;
--border: 2px solid #777;
--border-radius: 6px;
--padding: 4px;
--font-family: Mary, Helvetica, Georgia, Times New Roman, serif, -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
--font-size: 1em;
--box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
--link-color: #5ec7b8;
--secondary-link-color: #99c6c2;
}
*/
.no-outline:focus {
outline: none;
}
@font-face {
font-family: Mary;
font-style: normal;
font-weight: lighter;
src: url("assets/mary.ttf");
}
*/
::selection {
color: var( --background-color );
Expand Down
63 changes: 0 additions & 63 deletions javascript/web/src/assets/tailwind.js

This file was deleted.

14 changes: 14 additions & 0 deletions javascript/web/src/assets/world-www.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 11 additions & 10 deletions javascript/web/src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,16 +330,17 @@ async function createWindow() {
})
*/

if (process.env.WEBPACK_DEV_SERVER_URL) {
// Load the url of the dev server if in development mode
printf( "!!!!" )
await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL)
if (!process.env.IS_TEST) win.webContents.openDevTools()
} else {
createProtocol('app')
// Load the index.html when not in development
win.loadURL('app://./index.html')
}
if (process.env.WEBPACK_DEV_SERVER_URL) {
// Load the url of the dev server if in development mode
printf( "!!!!" )
await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL)
if (!process.env.IS_TEST) win.webContents.openDevTools()
} else {
createProtocol('app')
// Load the index.html when not in development
win.loadURL('app://./index.html')
}

}

/*
Expand Down
61 changes: 52 additions & 9 deletions javascript/web/src/classes/Commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,7 @@ class Commands {
{
id: "open-command-pallet-modal",
fn: function() {
// ilse.htmls.add( "command-pallet", ilse.components["command-pallet"] )
// ilse.htmls.modal( ilse.components["command-pallet"] )
ilse.htmls.modal( ilse.htmls.render('command-pallet', { search: '' }) )
ilse.htmls.modal( ilse.htmls.render('command_pallet', { search: '' }) )
},
undo: args => {
ilse.htmls.list.shift()
Expand Down Expand Up @@ -207,9 +205,21 @@ class Commands {
document.body.style.cursor = "crosshair";
ilse.cursor = async function on_click( event ) {

// BUGFIX:
event.preventDefault()

let dom = event.target
let id = get_parent_with_attr( dom, "data-component-id" )
if( id ) ilse.htmls.modal( ilse.components[id] )

let string = ilse.components[id]

let html = `
<div class="no-outline" contentEditable x-text="ilse.components['${id}']" > </div>
<div x-html="ilse.components['${id}']" > </div>
`
// let html = div.outerHTML
printf( ">>> html -> ", html )
if( id ) ilse.htmls.modal( html, { overflow: "auto" })

document.body.style.cursor = "auto"
document.body.removeEventListener( "click", ilse.cursor )
Expand Down Expand Up @@ -265,14 +275,36 @@ class Commands {
props: {},
},

{
id: "open-directory-manager-tab",
fn: function() {
window.ilse.tabs.add_with_component('directory_manager', { title: 'Brains', autoselect: true })
},
description: "Open Directory Manager Tab",
name: "Open Directory Manager Tab",
props: {},
},

{
id: "open-study-tab",
fn: function() {
window.ilse.tabs.add_with_component('study', { title: 'Study', autoselect: true })
},
description: "Will Open a new study tab",
name: "Open Study Tab",
props: {},
},

{
id: "go-to-next-tab",
fn: function() {

let copy = ilse.selected
if( ilse.tabs.list[--copy] ) {
ilse.select = copy
}
ilse.tabs.select_next_tab()

// let copy = ilse.selected
// if( ilse.tabs.list[--copy] ) {
// ilse.select = copy
// }

/*
let tabs = ilse.tabs
Expand Down Expand Up @@ -340,6 +372,7 @@ class Commands {
id: "save",
icon: "save.svg",
fn: function() {
ilse.notes.save()
ilse.save()
},
undo: args =>{}, // TODO
Expand Down Expand Up @@ -443,7 +476,17 @@ class Commands {
},

{
id: "open-search-modal",
id: "open-files-search-modal",
icon: "lupe.svg",
fn: async function() {
},
description: "Open Files Search Modal",
name: "Open Files Search Modal",
props: {},
},

{
id: "open-notes-search-modal",
icon: "lupe.svg",
fn: async function() {
// ilse.is_search_on = !ilse.is_search_on
Expand Down
9 changes: 6 additions & 3 deletions javascript/web/src/classes/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import printf from "@/functions/printf.js"
import Messager from "@/classes/Messager.js"

// HTML
import info from "@/html/dialog-info.html"
import input from "@/html/dialog-input.html"
import confirm from "@/html/dialog-confirm.html"
import info from "@/html/dialog_info.html"
import input from "@/html/dialog_input.html"
import confirm from "@/html/dialog_confirm.html"

export default class Dialog {

Expand Down Expand Up @@ -76,10 +76,13 @@ export default class Dialog {

async input( title = "Title", description = "Description" ) {

printf( "before -> ", input )
let html = input
.replace( "$title", title )
.replace( "$description", description )

printf( "after -> ", html )

let id = "dialog-input-" + Math.random()
ilse.htmls.add( id, html )

Expand Down
2 changes: 1 addition & 1 deletion javascript/web/src/classes/FSFilesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class FSFilesystem {

constructor( dir ) {

target_directory = dir // target_directory = dir + "/"
target_directory = dir

this.file = {

Expand Down
43 changes: 30 additions & 13 deletions javascript/web/src/classes/Ilse.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,25 @@ import printf from "@/functions/printf.js"
import SVG_TABLE from "@/constants/SVG_TABLE.js"

// html
import component_not_found from "@/html/component-not-found.html"
import component_not_found from "@/html/component_not_found.html"
import template from "@/html/template.html"
import top_menu from "@/html/top-menu.html"
import dialog_info from "@/html/dialog-info.html"
import top_menu from "@/html/top_menu.html"
import help from "@/html/help.html"
import setup from "@/html/setup.html"
import search from "@/html/search.html"
import marketplace from "@/html/marketplace.html"
import configuration from "@/html/configuration.html"
import command_pallet from "@/html/command-pallet.html"
import command_pallet from "@/html/command_pallet.html"
import references from "@/html/references.html"
import ghost_note from "@/html/ghost-note.html"
import outline from "@/html/outline.html"
import daily_notes from "@/html/daily-notes.html"
import status_line from "@/html/status-line.html"
import new_tab from "@/html/new-tab.html"
import daily_notes from "@/html/daily_notes.html"
import status_line from "@/html/status_line.html"
import new_tab from "@/html/new_tab.html"
import filesystem from "@/html/filesystem.html"
import file from "@/html/file.html"
import study from "@/html/study.html"
import web from "@/html/web.html"
import directory_manager from "@/html/directory_manager.html"

// Frame
const JSFrame = require("@/assets/jsframe.min.js")
Expand Down Expand Up @@ -101,19 +104,23 @@ export default class Ilse {

this.components = {
"top-menu": top_menu,
"dialog-info": dialog_info,
"setup": setup,
"help": help,
"search": search,
"marketplace": marketplace,
"configuration": configuration,
"command-pallet": command_pallet,
"references": references,
"ghost-note": ghost_note,
"outline": outline,
"daily-notes": daily_notes,
"status-line": status_line,
"new-tab": new_tab,
"filesystem": filesystem,
"file": file,
"study": study,
"web": web,
"directory-manager": directory_manager,
"hello-world": `<p> Hello, World </p>`,
}

this.tabs = new Tabs()
Expand Down Expand Up @@ -177,13 +184,23 @@ export default class Ilse {
let list = window.localStorage.getItem( "target-directories" )

let bugfix_is_string = typeof list === "string"
if( bugfix_is_string ) list = JSON.parse( list )
if( bugfix_is_string ) {

try {
list = JSON.parse( list )
} catch( e ) {
list = []
}

}

let bugfix_list_has_items = list && list.length
printf( "bugfix_list_has_items -> ", bugfix_list_has_items )
printf( "list -> ", list )
printf( "this.target_directories -> ", this.target_directories )
if( bugfix_list_has_items ) this.target_directories = list

// if( this.platform === "quine" ) this.target_directories = [ "/" ] // quine
if( this.platform === "quine" ) {
if( this.platform === "quine" ) { // Autoselects "/"

let quine_dir = window.location.pathname

Expand Down
13 changes: 7 additions & 6 deletions javascript/web/src/classes/KeyboardShortcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,13 @@ class KeyboardShortcut {
{ combo: "ctrl+space r r", command: "open-random-note", category: "Random" },

// s
{ combo: "ctrl+space s s", command: "open-search-modal", category: "Search" },
{ combo: "ctrl+space s g", command: "open-glyph-search", category: "Search" },
{ combo: "ctrl+space s w w", command: "open-website-on-window", category: "Search" },
{ combo: "ctrl+space s w e", command: "open-external-website-on-window", category: "Search" },
{ combo: "ctrl+space s h", command: "open-html-on-window", category: "Search" },
{ combo: "ctrl+space s v", command: "open-vim", category: "Search"},
{ combo: "ctrl+space s s", command: "open-notes-search-modal", category: "Search", prevent_default: true },
{ combo: "ctrl+space s shift+s", command: "open-files-search-modal", category: "Search", prevent_default: true },
{ combo: "ctrl+space s g", command: "open-glyph-search", category: "Search" },
{ combo: "ctrl+space s w w", command: "open-website-on-window", category: "Search" },
{ combo: "ctrl+space s w e", command: "open-external-website-on-window", category: "Search" },
{ combo: "ctrl+space s h", command: "open-html-on-window", category: "Search" },
{ combo: "ctrl+space s v", command: "open-vim", category: "Search"},

// t

Expand Down
Loading

0 comments on commit b7b2702

Please sign in to comment.