@@ -7,8 +7,13 @@ loaded_pages = {}
77current_pages = []
88summit = {
99 tlds: (system_url ++ "tlds.json").httpGet().JsonParse(),
10+ redirect_url: ""
1011}
1112
13+ page_len = 0
14+ tab_info = null
15+ current_tab_name = {}
16+
1217each key window.getKeys() (
1318 if window[key]["type"] == "function" (
1419 window[key] = () -> ()
@@ -148,7 +153,6 @@ def "draw_page" "url, page_type, tab_id" (
148153 if page_protocol == "web" (
149154 local parts = url.split("/")
150155 local current_tld = parts[1].split(".").last()
151- // get the tld of the page
152156 fetch_url = "https://" ++ summit.tlds[current_tld] ++ url
153157 local data = fetch_url.getAsync()
154158 ) else if page_protocol == "local" (
@@ -259,7 +263,6 @@ sidebar = {
259263
260264sidebar.main = def() -> (
261265 sidebar = sidebar.handleSize()
262- // sidebar.handleSize()
263266
264267 if mouse_x < window.left + 30 and onclick (
265268 sidebar.target_x = 0
@@ -319,10 +322,16 @@ sidebar.main = def() -> (
319322 square frame.width - 20 30 15 : c#global_accent
320323 square frame.width - 20 30 10 : c#window_colour
321324 if onclick (
322- if current_tabs.contains(tab.id) (
323- current_tabs.delete(tab.id)
325+ if "shift".isKeyDown() (
326+ if current_tabs.contains(tab.id) (
327+ if current_tabs.len > 1 (
328+ current_tabs.delete(tab.id)
329+ )
330+ ) else (
331+ current_tabs.append(tab.id)
332+ )
324333 ) else (
325- current_tabs.append( tab.id)
334+ current_tabs = [ tab.id]
326335 )
327336 )
328337 )
@@ -368,18 +377,28 @@ sidebar.main()
368377local left = sidebar.edge + 10
369378local right = window.right - 10
370379local w = right - left
371- local tab_w = w / current_tabs.len
372- local right = left + tab_w
373380
374381for i tabs_queue.len (
375- tabs.append(tabs_queue.shift())
382+ local new_tab = tabs_queue.shift()
383+ tabs.append(new_tab)
384+ if tabs.len == 1 or current_tabs.len == 0 (
385+ current_tabs = [new_tab.id]
386+ )
376387)
377- current_tabs = [tabs.last().id]
378388
379- each this.tab current_tabs (
380- page_frame left window.top - 10 right window.bottom + 10 tab
381- local left += tab_w
382- local right += tab_w
389+ local tab_count = current_tabs.len
390+ if tab_count == 0 (
391+ tab_count = 1
392+ )
393+ local tab_w = w / tab_count
394+
395+ local current_left = left
396+ local current_right = left + tab_w
397+
398+ each this.tab_id current_tabs (
399+ page_frame current_left window.top - 10 current_right window.bottom + 10 tab_id
400+ local current_left += tab_w
401+ local current_right += tab_w
383402)
384403
385404import "win-buttons"
0 commit comments