Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File name popover #38

Open
wants to merge 55 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
720ed68
Update gitignore
etc1290 Apr 15, 2023
ab9d6d9
Fix the bug that monitored path still is highlighted after dropping
Paiiimannnoitla Apr 17, 2023
76b5516
Monitored groups highlight
Paiiimannnoitla Apr 17, 2023
6fb9a70
Fix monitored group bug
Paiiimannnoitla Apr 17, 2023
fef5427
Re-import dragging resize function
Paiiimannnoitla Apr 18, 2023
cf504d9
Add smooth animation when dropping
Paiiimannnoitla Apr 18, 2023
955f8e4
Expand check
Paiiimannnoitla Apr 19, 2023
a42798b
Smooth effect missingg bug fix
Paiiimannnoitla Apr 19, 2023
ab2be4f
Fix monitored data highlight effect last permanetly
Paiiimannnoitla Apr 19, 2023
3a8cc7f
Set Light Mode as Default
etc1290 Apr 19, 2023
a4bcd9f
Fix Bug
etc1290 Apr 19, 2023
0a1eae7
Fix execution priority bug
Paiiimannnoitla Apr 19, 2023
3c84810
Rewrite function
Paiiimannnoitla Apr 20, 2023
b774e36
Rewrite mntfunc folder function
Paiiimannnoitla Apr 20, 2023
7855f81
Rewrite mntstyle
Paiiimannnoitla Apr 20, 2023
1b0046d
Fix the bug that drop cannot remove highlight effect
Paiiimannnoitla Apr 20, 2023
19280a4
Rewrite mntfold function
Paiiimannnoitla Apr 20, 2023
37b863a
UI Improvement
etc1290 Apr 21, 2023
46d3ff6
Make a positioncheck for more accurate position spawn
Paiiimannnoitla Apr 24, 2023
70e83f4
Style change for contextmenu
Paiiimannnoitla Apr 24, 2023
765f1c6
Multiple levels for contextmenu
Paiiimannnoitla Apr 25, 2023
ae342bd
Fix the false positioned value bug
Paiiimannnoitla Apr 25, 2023
6397ae8
Prevent contextmenu out of page
Paiiimannnoitla Apr 25, 2023
4607f4c
Prevent submenu status is inherited
Paiiimannnoitla Apr 25, 2023
e6bd4ba
Fix the bug that positioner not work at first click
Paiiimannnoitla Apr 25, 2023
b6ff626
Finish submenu function in contextmenu
Paiiimannnoitla Apr 26, 2023
cf5d61b
Turn off submenu when contextmenu is off
Paiiimannnoitla Apr 26, 2023
01933f8
Auto detect and create essential files before run
Paiiimannnoitla Apr 27, 2023
cb90bde
Database unable to open keeps showing up
Paiiimannnoitla Apr 27, 2023
0867499
Improve UI - File Name Popover
etc1290 Apr 27, 2023
eef6f96
Fix mntmain error when no data
Paiiimannnoitla Apr 27, 2023
5686b52
Fix 'Unable to open database'
Paiiimannnoitla Apr 27, 2023
ddf2cc3
Update index.js
etc1290 Apr 27, 2023
ad17c6c
Merge branch 'Monitor-function' of https://github.com/etc1290/Stembas…
etc1290 Apr 27, 2023
f9233b3
Fix mntfunc path jump function
Paiiimannnoitla Apr 28, 2023
f7e4365
Fix the incorrect behavior of expanding function
Paiiimannnoitla Apr 28, 2023
949a85d
Monitored groups update function
Paiiimannnoitla Apr 28, 2023
5bdab47
Updating monitored group database when dragging
Paiiimannnoitla Apr 28, 2023
85b49c5
Auto load monitored data when app start
Paiiimannnoitla Apr 28, 2023
14f674b
Rewiring monitored group highlight function
Paiiimannnoitla Apr 28, 2023
c72fb12
Add basic structure to contextmenu
Paiiimannnoitla Apr 28, 2023
f4b5415
mnt selected and check function rebuild
Paiiimannnoitla Apr 28, 2023
c9ea951
Fix monitored remove function not refresh window
Paiiimannnoitla May 2, 2023
006680c
Fix duplicated bug in monitored group
Paiiimannnoitla May 2, 2023
4b5654b
Fix collapse height auto adjustment behavior
Paiiimannnoitla May 2, 2023
4a51e93
Fix height adjustment when dropping
Paiiimannnoitla May 2, 2023
e97454e
Fix height adjustment when adding to monitored tag
Paiiimannnoitla May 2, 2023
92077d1
Rewrite uxContextMenuRemove function
Paiiimannnoitla May 2, 2023
91d12a9
Rewrite contextmenu function in delegation way
Paiiimannnoitla May 3, 2023
2ceb74b
Implement global contextmenu target select function
Paiiimannnoitla May 3, 2023
8d38bbd
Merge contextmenu related function
Paiiimannnoitla May 3, 2023
848e1da
Add contextmenu exception handler
Paiiimannnoitla May 3, 2023
8b74f36
Add contextmenu hide option handler
Paiiimannnoitla May 3, 2023
56bed37
Rewrite contextmenu remove function by custom event
Paiiimannnoitla May 4, 2023
d15890d
Test Long File Name Hidden
etc1290 May 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
*.exe
node_modules
*.code-workspace
*.db
中文/1/2/Stemmeta.db
中文/1/Stemmeta.db
中文/Stemmeta.db
2 changes: 2 additions & 0 deletions Stemconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"TemplateDir": "./template/",
"StaticDir": "./static/",
"StemdbStorage":"./data",
"StemdbDir":"./data/Stemdb",
"StemMGDir":"./data/MonitoredGroups",
"StartDir": "./",
"Debugmode": 1,
"Width": 1280,
Expand Down
Binary file removed Stemmeta.db
Binary file not shown.
Binary file removed data/Stemdb.db
Binary file not shown.
183 changes: 182 additions & 1 deletion log.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,188 @@
# Stembase
File tagging system


---
## 2023.05.04 version 0.5.8.1
-- Rewrite function
# Changed
1. Rewrite the behavior of uxContextMenuRemove in custom event to fix prority bug
-- finished
---
## 2023.05.03 version 0.5.8
-- Rewrite function
-- Function implementation
-- Clear wasted codes
# Added
1. Add customized option hide function(contextmenu) globally
-- finished
2. Add global context menu target select function with exception handler
-- finished
3. Add contextmenu create rxception handler
-- finished
4. Add contextmenu hide setting applier
-- finished
# Changed
1. Rewrite contextmenu removal mechanism
-- finished
2. Rewrite contextmenu function in delegation way and transfer into index-ux
-- finished
3. Merge contextmenu related function
-- finished
---
## 2023.05.02 version 0.5.7.1
-- Bug Fix
-- Remove some wasted codes
# Fixed
1. Fix that remove function not refresh
-- finished
2. Fix data can be duplicated in monitored group
-- finished
3. Fix collapse height auto adjustment bug in some function
3.1 mntremove
3.2 drop
3.3 mntmain
-- finished
---
## 2023.04.28 version 0.5.7
-- Function implementation
-- Function rewiring
-- Style change
-- Clear wasted codes
# Added
1. Updating monitored group database when dragging in
-- finished
2. Auto load monitored data when app ready
-- finished
3. Basic structure of contextmenu function
-- finished
4. Add contextmenu selected function
-- finished
# Changed
1. Merging highlight monitored group function into mntstyle
-- finished
2. Build mntbuild to control the processing of mnt building
-- finished
3. Add submenu hover effect
-- finished
4. Rebuild mntcheck to handle all class type check
-- finished
5. Rebuild mntselected to handle all selected related worked
-- finished
---
## 2023.04.28 version 0.5.6.2
-- Bug fix
# Fixed
1. Fix the incorrect check in mntfunc jump function
-- finished
2. Fix the incorrect behavior of expanding function
-- finished
---
## 2023.04.27 version 0.5.6.1
-- Bug fix
# Fixed
1. Auto detect essential folders existence
-- finished
2. Fix the error in mntmain when no data
-- finished
3. Fix the unable to open database bug
-- finished
---
## 2023.04.26 version 0.5.6
-- Bug fix
-- Clear wasted codes
# Fixed
1. Submenu now can correctly positioning
-- finished
2. Fix the bug that when contextmenu is too low, submenu sink into page bottom
-- finished
3. Fix the submenu is existed after contextmenu is off.
-- finished
---
## 2023.04.25 version 0.5.5.3
-- Bug fix
# Fixed
1. Fix the false position value
-- finished
2. Fix the contextmenu overflow out of page
-- finished
3. Fix the submenu status is inherit to next contextmenu
-- finished
4. Fix position is not worked at first click
-- finished
---
## 2023.04.25 version 0.5.5.2
-- Submenu function
# Added
1. Add multiple layers to contextMenu
-- finished
# Bugged
1. Submenu position is incorrect

---
## 2023.04.24 version 0.5.5.1
-- Rewrite function
-- Improve contextMenu positioning accuracy
-- Style change
# Changed
1. Rewrite function in delegation way
1.1 mntmenu
-- finished
2. Improve positioning accuracy of contextMenu in mnt
-- finished
---
## 2023.04.20 version 0.5.5
-- Bug fix
-- Rewrite function
# Fixed
1. Fix the bug that mntfunc run before mntmain over
-- finished
2. Fix the bug that drop cannot trigger highlight remove
-- finished
# Changed
1. Rewrite function in delegation way
1.1 mntfunc data function
1.2 mntfunc folder function
1.3 mntstyle
1.4 mntfold
-- finished
---
## 2023.04.19 version 0.5.4.1
-- Funcction iplementation
-- Bug fix
-- Code rewrite
-- Remove wasted codes
# Fixed
1. Fix smooth effect missing bug
-- finished
2. Fix monitored data highlight effect last permanently
-- finished
# Added
1. Add expand check in dragging function to prevent collapsing
-- finished
# Changed
1. Rewrite some codes from flexible to fixed due to css poor behaviour
-- finished
---
## 2023.04.18 version 0.5.4
-- Function re-import
# Added
1. Fix the dragenter and dragleave bug and re-import resize function
-- finished
2. Add smooth expansion and collapsing animation to monitored groups
-- finished

---
## 2023.04.17 version 0.5.3.3
-- Bug fix
-- Style change
# Fixed
1. Fix the bug that monitored path is highlighted after dropping
-- finished
2. Fix the bug that all objects in a monitored groups are merged
-- finished
# Changed
1. When hovering, the header of monitored groups would be highlighted
-- finished
---
## 2023.04.14 version 0.5.3.2
-- Bug fix
Expand Down
83 changes: 54 additions & 29 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,60 @@
const { app, BrowserWindow, ipcMain, nativeTheme, dialog, session } = require('electron')
const { app, BrowserWindow, ipcMain, dialog, session } = require('electron')
const path = require('path')
const fs = require('fs')
const glob = require('glob')
const env = require('./static/js/env.js')
const Stemdb= env('StemdbDir')
const sqlite3 = require('sqlite3').verbose()
const db = new sqlite3.Database(Stemdb + '.db')

process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
app.allowRendererProcessReuse = false

// Create a new db
db.get('PRAGMA foreign_keys = ON')
db.run(`create table "File" (
"id" integer not null unique,
"name" text not null unique,
"file" text not null,
primary key("id" autoincrement)
)`,()=>{})
db.run(`create table "Tag" (
"id" integer not null unique,
"tag" text not null unique,
primary key("id" autoincrement)
)`,()=>{})
db.run(`create table "Ref" (
"id" integer not null unique,
"nameref" text,
"tagref" text,
primary key("id" autoincrement)
foreign key('nameref') references File(name) on delete cascade on update cascade,
foreign key('tagref') references Tag(tag) on delete cascade on update cascade,
unique(nameref,tagref)
)`,()=>{})
db.run(`create table "Monitor" (
"id" integer not null unique,
"name" text not null unique,
primary key("id" autoincrement)
)`,()=>{})
const dbBuild = ()=>{
const db = new sqlite3.Database(Stemdb + '.db')
db.get('PRAGMA foreign_keys = ON')
db.run(`create table "File" (
"id" integer not null unique,
"name" text not null unique,
"file" text not null,
primary key("id" autoincrement)
)`,()=>{})
db.run(`create table "Tag" (
"id" integer not null unique,
"tag" text not null unique,
primary key("id" autoincrement)
)`,()=>{})
db.run(`create table "Ref" (
"id" integer not null unique,
"nameref" text,
"tagref" text,
primary key("id" autoincrement)
foreign key('nameref') references File(name) on delete cascade on update cascade,
foreign key('tagref') references Tag(tag) on delete cascade on update cascade,
unique(nameref,tagref)
)`,()=>{})
db.run(`create table "Monitor" (
"id" integer not null unique,
"name" text not null unique,
primary key("id" autoincrement)
)`,()=>{})

}
// Check essential folders
const firstBuild = ()=>{

const dbStorage = env('StemdbStorage')
const mdbStorage = env('StemMGDir')

if (!fs.existsSync(dbStorage)){
fs.mkdir(dbStorage,{recursive:true},()=>{
if (!fs.existsSync(mdbStorage)){
fs.mkdir(mdbStorage,{recursive:true},()=>{})
}
})

}
}



Expand Down Expand Up @@ -75,11 +95,13 @@ exec('NET SESSION', function(err,so,se) {
}) */

const init = () =>{
firstBuild()
dbBuild()
const Taskmanager = () =>{
const funcScript = glob.sync(env('StaticDir') + '/js/*.js')
funcScript.forEach((i) =>{require(i)})
}
Taskmanager()
Taskmanager()
app.whenReady().then(() => {
WindowMain()
// Prevent from multiple windows create
Expand All @@ -90,8 +112,11 @@ const init = () =>{
})

})

}

init()

// Release all resources of the app
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
Expand Down
5 changes: 4 additions & 1 deletion preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ contextBridge.exposeInMainWorld('tag', {

// MonitorSystem
contextBridge.exposeInMainWorld('mnt', {
main: () => ipcRenderer.invoke('mnt-main')
main: () => ipcRenderer.invoke('mnt-main'),
load: (i) => ipcRenderer.invoke('mnt-load',i),
remove: (i,j) => ipcRenderer.invoke('mnt-remove',i,j),
update: (i,j) => ipcRenderer.invoke('mnt-update',i,j)
})


Expand Down
Loading