vault update: 2024-06-16 18:25:00
Affected files: Index.md config.yml output/mod/arguments.yml output/mod/capabilities.json output/mod/config.yml output/mod/graphers.json output/mod/guid.txt output/mod/html/dynamic_footer_inclusions.html output/mod/html/dynamic_inclusions.html output/mod/html/graph.template.html output/mod/html/graph_full_page.template.html output/mod/html/note.template.html output/mod/modfile_dependencies.json output/mod/paths.json output/mod/user_config.yml
This commit is contained in:
1
output/mod/html/dynamic_footer_inclusions.html
Normal file
1
output/mod/html/dynamic_footer_inclusions.html
Normal file
@ -0,0 +1 @@
|
||||
|
1
output/mod/html/dynamic_inclusions.html
Normal file
1
output/mod/html/dynamic_inclusions.html
Normal file
@ -0,0 +1 @@
|
||||
|
26
output/mod/html/graph.template.html
Normal file
26
output/mod/html/graph.template.html
Normal file
@ -0,0 +1,26 @@
|
||||
<div class="graph requires_js {graph_classes}">
|
||||
<div id="A{id}{level}" class="graph_div"></div>
|
||||
|
||||
<div class="graph-instructions" id="D{id}{level}">
|
||||
Left-click: follow link, Right-click: select node, Scroll: zoom
|
||||
</div>
|
||||
|
||||
<div class="graph-button-row" style="display:flex;">
|
||||
<button class="graph_button graph_show_button" id="B{id}{level}" level="{level}" note_temp_id="{id}" onclick="window.ObsHtmlGraph.run(this, '{id}', '{pinnedNode}');">
|
||||
Show Graph
|
||||
</button>
|
||||
<button class="graph_button graph_type_button" id="C{id}{level}" style="flex:1" onclick="window.ObsHtmlGraph.switch_graph_type(this);">
|
||||
2D
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="module">
|
||||
if (window.ObsHtmlGraph == undefined){
|
||||
import('{html_url_prefix}/obs.html/static/graph.js').then((Module) => {
|
||||
window.ObsHtmlGraph = Module;
|
||||
window.ObsHtmlGraph.arm_page(document.getElementById('page_holder'))
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
114
output/mod/html/graph_full_page.template.html
Normal file
114
output/mod/html/graph_full_page.template.html
Normal file
@ -0,0 +1,114 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<!-- Page information -->
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="node_id" content="{node_id}">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="shortcut icon" href="{html_url_prefix}/favicon.ico" />
|
||||
|
||||
<!-- Set title -->
|
||||
<title>{title}</title>
|
||||
|
||||
<!-- Includes -->
|
||||
{dynamic_includes}
|
||||
|
||||
<!-- Onload tweaks -->
|
||||
<script>
|
||||
const CURRENT_NODE = '{pinnedNode}';
|
||||
const HTML_URL_PREFIX = '{html_url_prefix}';
|
||||
const PAGE_DEPTH = {page_depth};
|
||||
const CONFIGURED_HTML_URL_PREFIX = '{configured_html_url_prefix}';
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="theme-obs-light">
|
||||
<div id="antiflash" style="display: none;"></div>
|
||||
<script>
|
||||
document.getElementById('antiflash').style.display = 'block';
|
||||
</script>
|
||||
{search_html}
|
||||
|
||||
<div id="page_holder" class="flex_col">
|
||||
<div id="header" class="header">
|
||||
<div id="header_flex" class="flex_row">
|
||||
<a href="{html_url_prefix}/index.html" id="homelink" title="Clear screen and go to homepage">{title}</a>
|
||||
<div class="navbar-button" onclick="toggle_menu()">
|
||||
≡
|
||||
</div>
|
||||
<div id="navbar" class="navbar">
|
||||
{{navbar_links}}
|
||||
<div class="icon-tray">
|
||||
{theme_button}
|
||||
{search_button}
|
||||
{graph_button}
|
||||
{dirtree_button}
|
||||
{tags_page_button}
|
||||
{rss_button}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{theme_popup}
|
||||
</div>
|
||||
|
||||
<div class="graph_full_page">
|
||||
<div class="graph-button-row" style="display:flex;">
|
||||
<button class="graph_button graph_show_button" id="Bgraph_full_page" level="" note_temp_id="graph_full_page" style="visibility: hidden; margin:0px">
|
||||
Show Graph
|
||||
</button>
|
||||
<button class="graph_button graph_type_button" id="Cgraph_full_page" style="flex:1; margin:0px; margin-right:0.2rem;" onclick="window.ObsHtmlGraph.switch_graph_type(this);">
|
||||
2D
|
||||
</button>
|
||||
</div>
|
||||
<div id="Agraph_full_page" class="graph_div_full"></div>
|
||||
<div class="graph-instructions fadein" id="Dgraph_full_page">
|
||||
Left-click: follow link, Right-click: select node, Scroll: zoom
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script type="module">
|
||||
document.addEventListener('DOMContentLoaded', load_fullpage_graph);
|
||||
|
||||
function load_fullpage_graph(){
|
||||
|
||||
// set graph_type button correctly
|
||||
let type_d = ls_get('graph_type_d');
|
||||
if (!type_d){
|
||||
ls_set('graph_type_d', '2D');
|
||||
type_d = '2D';
|
||||
}
|
||||
document.getElementById('Cgraph_full_page').innerHTML = type_d;
|
||||
|
||||
import('{html_url_prefix}/obs.html/static/graph.js').then((Module) => {
|
||||
window.ObsHtmlGraph = Module;
|
||||
window.ObsHtmlGraph.arm_page(document.getElementById('page_holder'))
|
||||
|
||||
// overwrites
|
||||
window.ObsHtmlGraph.default_actions['open_link'] = function (args){
|
||||
console.log('hi openlink')
|
||||
return window.ObsHtmlGraph.graph_open_link_normal(args)()
|
||||
}
|
||||
|
||||
|
||||
// Get node id from the page where we clicked on the icon for the fullpage graph
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const pinnedNode = urlParams.get('node');
|
||||
|
||||
// Immediately run graph instead of waiting for button click
|
||||
window.ObsHtmlGraph.run(document.getElementById('Bgraph_full_page'), 'graph_full_page', pinnedNode);
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
{footer_js_inclusions}
|
||||
{dynamic_footer_includes}
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
171
output/mod/html/note.template.html
Normal file
171
output/mod/html/note.template.html
Normal file
@ -0,0 +1,171 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<!-- Page information -->
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="node_id" content="{node_id}">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="shortcut icon" href="{html_url_prefix}/favicon.ico" />
|
||||
|
||||
<!-- Set title -->
|
||||
<title>{title}</title>
|
||||
|
||||
<!-- Includes -->
|
||||
{dynamic_includes}
|
||||
|
||||
<!-- Onload tweaks -->
|
||||
<script>
|
||||
const CURRENT_NODE = '{pinnedNode}';
|
||||
const HTML_URL_PREFIX = '{html_url_prefix}';
|
||||
const PAGE_DEPTH = {page_depth};
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="theme-obs-light">
|
||||
<div id="antiflash" style="display: none;"></div>
|
||||
<script>
|
||||
document.getElementById('antiflash').style.display = 'block';
|
||||
</script>
|
||||
{search_html}
|
||||
|
||||
<div id="page_holder" class="flex_col">
|
||||
{header}
|
||||
<div class="flex_row">
|
||||
{left_pane}
|
||||
<div class="container">
|
||||
{content}
|
||||
<!-- end content -->
|
||||
</div>
|
||||
<div class="container_filler">
|
||||
</div>
|
||||
{right_pane}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function handle_toggle_side_bar(e){
|
||||
let header;
|
||||
let pane;
|
||||
let target = e.target
|
||||
|
||||
// switch out the navbar button click for a header click
|
||||
if (target.id == 'left_pane_toggle_nav'){
|
||||
target = document.getElementById('left_pane_fold_header')
|
||||
}
|
||||
else if (target.id == 'right_pane_toggle_nav'){
|
||||
target = document.getElementById('right_pane_fold_header')
|
||||
}
|
||||
|
||||
// get header and pane
|
||||
if (target.classList.contains('fold_header')) {
|
||||
header = target;
|
||||
pane = target.parentElement;
|
||||
}
|
||||
else {
|
||||
pane = target;
|
||||
header = target.getElementsByClassName('fold_header')[0];
|
||||
}
|
||||
toggle_side_bar(pane, header, true)
|
||||
e.stopPropagation();
|
||||
}
|
||||
function handle_toggle_side_bar_button(e){
|
||||
document.getElementById('menu_toggle_button').click()
|
||||
handle_toggle_side_bar(e);
|
||||
}
|
||||
|
||||
function toggle_side_bar(pane, header, save) {
|
||||
let active = (pane.classList.contains('active'))
|
||||
if (active){
|
||||
disable_side_bar(pane, header, save);
|
||||
}
|
||||
else {
|
||||
enable_side_bar(pane, header, save);
|
||||
}
|
||||
}
|
||||
function enable_side_bar(pane, header, save){
|
||||
pane.classList.add('active');
|
||||
pane.removeEventListener('click', handle_toggle_side_bar);
|
||||
header.addEventListener('click', handle_toggle_side_bar);
|
||||
set_correct_header_symbol(header);
|
||||
if (save){ save_panel_folding_state(header, true) }
|
||||
}
|
||||
function disable_side_bar(pane, header, save){
|
||||
pane.classList.remove('active');
|
||||
pane.addEventListener('click', handle_toggle_side_bar);
|
||||
header.removeEventListener('click', handle_toggle_side_bar);
|
||||
set_correct_header_symbol(header);
|
||||
if (save){ save_panel_folding_state(header, false) }
|
||||
}
|
||||
function set_correct_header_symbol(header){
|
||||
let pane = header.parentElement;
|
||||
let symbol = [['>', '<'],['<', '>']]
|
||||
symbol = symbol[Number(header.classList.contains('right_pane_fold_header'))][Number(pane.classList.contains('active'))];
|
||||
console.log(symbol);
|
||||
header.innerHTML = symbol
|
||||
return header;
|
||||
}
|
||||
function panel_folding_get_panel_name(header){
|
||||
return ['left', 'right'][Number(header.classList.contains('right_pane_fold_header'))]
|
||||
}
|
||||
function save_panel_folding_state(header, active){
|
||||
ls_set('pane_folding_state_'+panel_folding_get_panel_name(header), Number(active));
|
||||
}
|
||||
function load_panel_folding_state(panel_name){
|
||||
val = ls_get('pane_folding_state_'+panel_name)
|
||||
if (!val){ return {'exists': false, 'value': null}}
|
||||
return {'exists': true, 'value': Boolean(Number(val))}
|
||||
}
|
||||
function set_pane_folding_start(left_header, right_header){
|
||||
// small screen = closed
|
||||
let right_pane_enabled = true;
|
||||
let left_pane_enabled = true;
|
||||
let w = window.visualViewport.width
|
||||
if (w < 1000){
|
||||
left_pane_enabled = false
|
||||
}
|
||||
if (w < 800){
|
||||
right_pane_enabled = false
|
||||
}
|
||||
|
||||
// get saved values if present
|
||||
let rval = load_panel_folding_state('right')
|
||||
if (rval['exists']){
|
||||
right_pane_enabled = rval['value']
|
||||
}
|
||||
let lval = load_panel_folding_state('left')
|
||||
if (lval['exists']){
|
||||
left_pane_enabled = lval['value']
|
||||
}
|
||||
|
||||
// default = enabled, so we only need to disable
|
||||
if (!left_pane_enabled){
|
||||
disable_side_bar(document.getElementById('left_pane'), document.getElementById('left_pane_fold_header'))
|
||||
}
|
||||
if (!right_pane_enabled){
|
||||
disable_side_bar(document.getElementById('right_pane'), document.getElementById('right_pane_fold_header'))
|
||||
}
|
||||
}
|
||||
|
||||
function init_pane_folding(header){
|
||||
set_correct_header_symbol(header);
|
||||
header.addEventListener('click', handle_toggle_side_bar);
|
||||
}
|
||||
|
||||
|
||||
set_pane_folding_start()
|
||||
init_pane_folding(document.getElementById('left_pane_fold_header'));
|
||||
init_pane_folding(document.getElementById('right_pane_fold_header'));
|
||||
|
||||
document.getElementById('left_pane_toggle_nav').addEventListener('click', handle_toggle_side_bar_button);
|
||||
document.getElementById('right_pane_toggle_nav').addEventListener('click', handle_toggle_side_bar_button);
|
||||
</script>
|
||||
|
||||
{footer_js_inclusions}
|
||||
{dynamic_footer_includes}
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user