From ffcea1be20d3ec30fb15583fa7d9033e609da079 Mon Sep 17 00:00:00 2001 From: tschudin Date: Wed, 31 Jul 2024 09:30:58 +0200 Subject: [PATCH] Create top-level categories (prod, games), stubs for productivity tool list and game list, reenable Kanban, move some JS files to subdirectories --- .../src/main/assets/web/{ => kanban}/board.js | 6 +- .../main/assets/web/{ => kanban}/board_ui.js | 6 +- .../app/src/main/assets/web/tremola.css | 23 +++++++ .../app/src/main/assets/web/tremola.html | 32 +++++---- .../app/src/main/assets/web/tremola.js | 65 ++++++++++++++++++- .../app/src/main/assets/web/tremola_ui.js | 41 +++++++----- .../src/main/assets/web/{ => util}/bipf.js | 0 .../main/assets/web/{ => util}/pako.min.js | 0 .../assets/web/{ => util}/pinch-zoom.min.js | 0 .../main/assets/web/{ => util}/qrcode.min.js | 0 .../main/assets/web/{ => util}/scuttlesort.js | 0 11 files changed, 133 insertions(+), 40 deletions(-) rename android/tinySSB/app/src/main/assets/web/{ => kanban}/board.js (99%) rename android/tinySSB/app/src/main/assets/web/{ => kanban}/board_ui.js (99%) rename android/tinySSB/app/src/main/assets/web/{ => util}/bipf.js (100%) rename android/tinySSB/app/src/main/assets/web/{ => util}/pako.min.js (100%) rename android/tinySSB/app/src/main/assets/web/{ => util}/pinch-zoom.min.js (100%) rename android/tinySSB/app/src/main/assets/web/{ => util}/qrcode.min.js (100%) rename android/tinySSB/app/src/main/assets/web/{ => util}/scuttlesort.js (100%) diff --git a/android/tinySSB/app/src/main/assets/web/board.js b/android/tinySSB/app/src/main/assets/web/kanban/board.js similarity index 99% rename from android/tinySSB/app/src/main/assets/web/board.js rename to android/tinySSB/app/src/main/assets/web/kanban/board.js index b6c951e..b3a157f 100644 --- a/android/tinySSB/app/src/main/assets/web/board.js +++ b/android/tinySSB/app/src/main/assets/web/kanban/board.js @@ -293,7 +293,7 @@ function kanban_new_event(e) { if (op == Operation.LEAVE && e.header.fid == myId) { delete board.pendingInvitations[myId] board.subscribed = false - load_board_list() + load_kanban_list() } if (board.subscribed) { @@ -318,7 +318,7 @@ function kanban_new_event(e) { if (curr_scenario != 'board' || curr_board != bid) board.unreadEvents++ - load_board_list() + load_kanban_list() // invite selected users (during Kanban board creation) if (op == Operation.BOARD_CREATE && e.header.fid == myId) { @@ -366,7 +366,7 @@ function kanban_new_event(e) { board.lastUpdate = Date.now() board.unreadEvents++ board.curr_prev = board.sortedOperations.get_tips() - load_board_list() + load_kanban_list() return } diff --git a/android/tinySSB/app/src/main/assets/web/board_ui.js b/android/tinySSB/app/src/main/assets/web/kanban/board_ui.js similarity index 99% rename from android/tinySSB/app/src/main/assets/web/board_ui.js rename to android/tinySSB/app/src/main/assets/web/kanban/board_ui.js index 79022d4..bc35e83 100644 --- a/android/tinySSB/app/src/main/assets/web/board_ui.js +++ b/android/tinySSB/app/src/main/assets/web/kanban/board_ui.js @@ -69,7 +69,7 @@ function dragDrop(ev) { } } -function load_board_list() { +function load_kanban_list() { document.getElementById('lst:kanban').innerHTML = ''; if (Object.keys(tremola.board).length === 0) return @@ -428,7 +428,7 @@ function menu_rename_board() { function ui_update_board_title(bid) { var board = tremola.board[bid] // update board list - load_board_list() + load_kanban_list() // update title name if (curr_board == bid) { var title = document.getElementById("conversationTitle"), bg, box; @@ -445,7 +445,7 @@ function board_toggle_forget() { board.forgotten = !board.forgotten persist() closeOverlay() - load_board_list() + load_kanban_list() setScenario('kanban') } diff --git a/android/tinySSB/app/src/main/assets/web/tremola.css b/android/tinySSB/app/src/main/assets/web/tremola.css index 36214b2..c833633 100644 --- a/android/tinySSB/app/src/main/assets/web/tremola.css +++ b/android/tinySSB/app/src/main/assets/web/tremola.css @@ -219,6 +219,29 @@ textarea { display: inline-block; } +.app_icon { + height: 3em; + width: 3em; + border: none; + border-radius: 50%; + background: transparent; + font-size: medium; + box-shadow: 0 0 5px rgba(0,0,0,0.7); +} + +.prod_item_button { + border: none; + text-align: left; + vertical-align: top; + width: calc(100%-10em); + font-size: medium; + border-radius: 4pt; + box-shadow: 0 0 5px rgba(0,0,0,0.7); + display: inline-block; + padding-top: 5px; + padding-bottom: 8px; +} + .menu_item_button { border: none; text-align: left; diff --git a/android/tinySSB/app/src/main/assets/web/tremola.html b/android/tinySSB/app/src/main/assets/web/tremola.html index bcf7443..ff765b9 100644 --- a/android/tinySSB/app/src/main/assets/web/tremola.html +++ b/android/tinySSB/app/src/main/assets/web/tremola.html @@ -3,16 +3,16 @@ - - + + - - - - - + + + + + @@ -48,7 +48,10 @@
-
+
+ + + - @@ -341,10 +343,10 @@
About
-

tinySSB, August 2023 +

tinySSB, August 2024


-

Software (c) 2021-2023:
+

Software (c) 2021-2024:
Jannick Heisch
Etienne Mettaz
Cedrik Schimschar
@@ -355,6 +357,7 @@ https://www.flaticon.com/authors/kiranshastry
https://icon-icons.com/icon/kanban-board/120442
https://icon-icons.com/icon/paper-clip/102692
+ http://www.onlinewebfonts.com/icon


@@ -535,9 +538,10 @@
-
- - + + + +
diff --git a/android/tinySSB/app/src/main/assets/web/tremola.js b/android/tinySSB/app/src/main/assets/web/tremola.js index ceb8274..978031c 100644 --- a/android/tinySSB/app/src/main/assets/web/tremola.js +++ b/android/tinySSB/app/src/main/assets/web/tremola.js @@ -674,6 +674,64 @@ function save_content_alias() { closeOverlay(); } +// --- productivity + +function load_prod_list() { + document.getElementById("lst:prod").innerHTML = ''; + load_prod_item('Kanban', 'img/kanban.svg', 'setScenario("kanban")', + 'text text text h aghjwd gldfhjs hlgsf hgljksf hgls fdhglf sdhgl hfgskj hls dfhgjl shgjkls hgl sfdhgjk sdfjklg hljs hfgl dfjlsfs'); + load_prod_item('Scheduler', 'img/schedule.svg', 'xyz', + 'text text text h aghjwd gldfhjs hlgsf hgljksf hgls fdhglf sdhgl hfgskj hls dfhgjl shgjkls hgl sfdhgjk sdfjklg hljs hfgl dfjlsfs'); + load_prod_item('Kahoot Quiz', 'img/quiz.svg', 'xyz', + 'text text text h aghjwd gldfhjs hlgsf hgljksf hgls fdhglf sdhgl hfgskj hls dfhgjl shgjkls hgl sfdhgjk sdfjklg hljs hfgl dfjlsfs'); + load_prod_item('Lokens (coming soon)', 'img/hand_and_coins.svg', 'xyz', + 'crypto tokens based on CRDTs, no mining needed. Ideal for fidelity cards, bartering, recognition tokens in open SW communities, and more.'); + load_prod_item('(dummy entry)', 'img/contacts.svg', 'xyz', + 'dah dah dah'); +} + +function load_prod_item(title, imageName, cb, descr) { + var row, item = document.createElement('div'), bg; + item.setAttribute('style', 'padding: 0px 5px 10px 5px;'); // old JS (SDK 23) + bg = ' light'; // c[1].forgotten ? ' gray' : ' light'; + row = `"; + item.innerHTML = row; + document.getElementById('lst:prod').appendChild(item); +} + +// --- games + +function load_game_list() { + document.getElementById("lst:games").innerHTML = ''; + load_game_item('Kanban', 'img/kanban.svg', + 'text text text h aghjwd gldfhjs hlgsf hgljksf hgls fdhglf sdhgl hfgskj hls dfhgjl shgjkls hgl sfdhgjk sdfjklg hljs hfgl dfjlsfs'); + load_game_item('Scheduler', 'img/schedule.svg', + 'text text text h aghjwd gldfhjs hlgsf hgljksf hgls fdhglf sdhgl hfgskj hls dfhgjl shgjkls hgl sfdhgjk sdfjklg hljs hfgl dfjlsfs'); + load_game_item('Kahoot Quiz', 'img/quiz.svg', + 'text text text h aghjwd gldfhjs hlgsf hgljksf hgls fdhglf sdhgl hfgskj hls dfhgjl shgjkls hgl sfdhgjk sdfjklg hljs hfgl dfjlsfs'); + load_game_item('Lokens (coming soon)', 'img/hand_and_coins.svg', + 'crypto tokens based on CRDTs, no mining needed. Ideal for fidelity cards, bartering, recognition tokens in open SW communities, and more.'); + load_game_item('(dummy entry)', 'img/contacts.svg', + 'dah dah dah'); +} + +function load_game_item(title, imageName, descr) { + var row, item = document.createElement('div'), bg; + item.setAttribute('style', 'padding: 0px 5px 10px 5px;'); // old JS (SDK 23) + bg = ' light'; // c[1].forgotten ? ' gray' : ' light'; + row = `"; + item.innerHTML = row; + document.getElementById('lst:games').appendChild(item); +} + +// --- chats + function new_conversation() { // { "alias":"local notes (for my eyes only)", "posts":{}, "members":[myId], "touched": millis } var recps = [] @@ -1188,7 +1246,7 @@ function b2f_new_event(e) { // incoming SSB log event: we get map with three ent contact.alias = e.public[1] == "" ? id2b32(e.header.fid) : e.public[1] contact.initial = contact.alias.substring(0, 1).toUpperCase() load_contact_list() - load_board_list() + load_kanban_list() // update names in connected devices menu for (var l in localPeers) { @@ -1271,8 +1329,11 @@ function b2f_initialize(id, settings) { for (nm in tremola.settings) setSetting(nm, tremola.settings[nm]) load_chat_list() + load_prod_list() + load_game_list() load_contact_list() - load_board_list() + + load_kanban_list() closeOverlay(); setScenario('chats'); diff --git a/android/tinySSB/app/src/main/assets/web/tremola_ui.js b/android/tinySSB/app/src/main/assets/web/tremola_ui.js index 83b53a8..f53ca8e 100644 --- a/android/tinySSB/app/src/main/assets/web/tremola_ui.js +++ b/android/tinySSB/app/src/main/assets/web/tremola_ui.js @@ -5,10 +5,11 @@ var overlayIsActive = false; var display_or_not = [ - 'div:qr', 'div:back', - 'core', 'lst:chats', 'div:posts', 'lst:contacts', 'lst:members', 'the:connex', - 'lst:kanban', 'div:footer', 'div:textarea', 'div:confirm-members', 'plus', - 'div:settings', 'div:board' + 'div:qr', 'div:back', 'core', + 'lst:chats', 'lst:prod', 'lst:games', 'lst:contacts', + 'lst:members', 'the:connex', + 'div:posts', 'lst:kanban', 'div:board', + 'div:footer', 'div:textarea', 'div:confirm-members', 'plus', 'div:settings' ]; var prev_scenario = 'chats'; @@ -19,7 +20,9 @@ var scenarioDisplay = { 'contacts': ['div:qr', 'core', 'lst:contacts', 'div:footer', 'plus'], 'posts': ['div:back', 'core', 'div:posts', 'div:textarea'], 'connex': ['div:qr', 'core', 'the:connex', 'div:footer', 'plus'], + 'games': ['div:qr', 'core', 'lst:games', 'div:footer'], 'members': ['div:back', 'core', 'lst:members', 'div:confirm-members'], + 'productivity': ['div:qr', 'core', 'lst:prod', 'div:footer'], 'settings': ['div:back', 'div:settings', 'core'], 'kanban': ['div:qr', 'core', 'lst:kanban', 'div:footer', 'plus'], 'board': ['div:back', 'core', 'div:board'] @@ -29,6 +32,12 @@ var scenarioMenu = { 'chats': [['Connected Devices', 'menu_connection'], // '['New conversation', 'menu_new_conversation'],' TODO reactivate when encrypted chats are implemented ['Settings', 'menu_settings'], ['About', 'menu_about']], + 'productivity': [['Connected Devices', 'menu_connection'], + ['Settings', 'menu_settings'], + ['About', 'menu_about']], + 'games': [['Connected Devices', 'menu_connection'], + ['Settings', 'menu_settings'], + ['About', 'menu_about']], 'contacts': [['New contact', 'menu_new_contact'], ['Connected Devices', 'menu_connection'], ['Settings', 'menu_settings'], @@ -39,17 +48,6 @@ var scenarioMenu = { // ['Force sync', 'menu_sync'], ['Settings', 'menu_settings'], ['About', 'menu_about']], - /* - ['Redraw', 'menu_redraw'], - ['Sync', 'menu_sync'], - ['Redraw', 'menu_redraw'], - ['Restream', 'menu_stream_all_posts'], - ['Import ID', 'menu_import_id'], - ['Process msgs', 'menu_process_msgs'], - ['Add pub', 'menu_add_pub'], - ['Dump', 'menu_dump'], - ['Reset', 'menu_reset']] - */ 'posts': [/* ['Take picture', 'menu_take_picture'], ['Pick image', 'menu_pick_image'], */ ['Rename this chat', 'menu_edit_convname'], @@ -112,7 +110,7 @@ function setScenario(s) { var lst = scenarioDisplay[s]; if (lst) { // if (s != 'posts' && curr_scenario != "members" && curr_scenario != 'posts') { - if (['chats', 'contacts', 'connex', 'kanban'].indexOf(curr_scenario) >= 0) { + if (['chats', 'productivity', 'games', 'contacts', 'connex', ].indexOf(curr_scenario) >= 0) { var cl = document.getElementById('btn:' + curr_scenario).classList; cl.toggle('active', false); cl.toggle('passive', true); @@ -146,7 +144,7 @@ function setScenario(s) { prev_scenario = s; } curr_scenario = s; - if (['chats', 'contacts', 'connex', 'kanban'].indexOf(curr_scenario) >= 0) { + if (['chats', 'productivity', 'games', 'contacts', 'connex'].indexOf(curr_scenario) >= 0) { var cl = document.getElementById('btn:' + curr_scenario).classList; cl.toggle('active', true); cl.toggle('passive', false); @@ -157,6 +155,11 @@ function setScenario(s) { document.getElementById('core').style.height = 'calc(100% - 118px)'; if (s == 'kanban') { + document.getElementById("tremolaTitle").style.display = 'none'; + var c = document.getElementById("conversationTitle"); + c.style.display = null; + c.innerHTML = "List of Kanban Boards
Pick or create a board"; + var personalBoardAlreadyExists = false for (var b in tremola.board) { var board = tremola.board[b] @@ -175,7 +178,9 @@ function setScenario(s) { function btnBridge(e) { var e = e.id, m = ''; - if (['btn:chats', 'btn:posts', 'btn:contacts', 'btn:connex', 'btn:kanban'].indexOf(e) >= 0) { + if (['btn:chats', 'btn:connex', 'btn:contacts', 'btn:games', + 'btn:posts', 'btn:productivity'].indexOf(e) >= 0) { + console.log('btn', e) setScenario(e.substring(4)); } if (e == 'btn:menu') { diff --git a/android/tinySSB/app/src/main/assets/web/bipf.js b/android/tinySSB/app/src/main/assets/web/util/bipf.js similarity index 100% rename from android/tinySSB/app/src/main/assets/web/bipf.js rename to android/tinySSB/app/src/main/assets/web/util/bipf.js diff --git a/android/tinySSB/app/src/main/assets/web/pako.min.js b/android/tinySSB/app/src/main/assets/web/util/pako.min.js similarity index 100% rename from android/tinySSB/app/src/main/assets/web/pako.min.js rename to android/tinySSB/app/src/main/assets/web/util/pako.min.js diff --git a/android/tinySSB/app/src/main/assets/web/pinch-zoom.min.js b/android/tinySSB/app/src/main/assets/web/util/pinch-zoom.min.js similarity index 100% rename from android/tinySSB/app/src/main/assets/web/pinch-zoom.min.js rename to android/tinySSB/app/src/main/assets/web/util/pinch-zoom.min.js diff --git a/android/tinySSB/app/src/main/assets/web/qrcode.min.js b/android/tinySSB/app/src/main/assets/web/util/qrcode.min.js similarity index 100% rename from android/tinySSB/app/src/main/assets/web/qrcode.min.js rename to android/tinySSB/app/src/main/assets/web/util/qrcode.min.js diff --git a/android/tinySSB/app/src/main/assets/web/scuttlesort.js b/android/tinySSB/app/src/main/assets/web/util/scuttlesort.js similarity index 100% rename from android/tinySSB/app/src/main/assets/web/scuttlesort.js rename to android/tinySSB/app/src/main/assets/web/util/scuttlesort.js