diff --git a/assets/images/GitHub-Mark-120px-plus.png b/assets/images/GitHub-Mark-120px-plus.png new file mode 100644 index 0000000..ea6ff54 Binary files /dev/null and b/assets/images/GitHub-Mark-120px-plus.png differ diff --git a/assets/images/GitHub-Mark-32px.png b/assets/images/GitHub-Mark-32px.png new file mode 100644 index 0000000..8b25551 Binary files /dev/null and b/assets/images/GitHub-Mark-32px.png differ diff --git a/assets/images/GitHub-Mark-64px.png b/assets/images/GitHub-Mark-64px.png new file mode 100644 index 0000000..182a1a3 Binary files /dev/null and b/assets/images/GitHub-Mark-64px.png differ diff --git a/assets/images/GitHub-Mark-Light-120px-plus.png b/assets/images/GitHub-Mark-Light-120px-plus.png new file mode 100644 index 0000000..192846a Binary files /dev/null and b/assets/images/GitHub-Mark-Light-120px-plus.png differ diff --git a/assets/images/GitHub-Mark-Light-32px.png b/assets/images/GitHub-Mark-Light-32px.png new file mode 100644 index 0000000..628da97 Binary files /dev/null and b/assets/images/GitHub-Mark-Light-32px.png differ diff --git a/assets/images/GitHub-Mark-Light-64px.png b/assets/images/GitHub-Mark-Light-64px.png new file mode 100644 index 0000000..73db1f6 Binary files /dev/null and b/assets/images/GitHub-Mark-Light-64px.png differ diff --git a/assets/main/board_page.css b/assets/main/board_page.css index eba3ee9..0c7a594 100644 --- a/assets/main/board_page.css +++ b/assets/main/board_page.css @@ -376,7 +376,17 @@ commands group.unrolled .icon-right { text-align: center; font-weight: normal; } -#circup_page table .name { width: 100%; } +#circup_page table .name { + width: 100%; +} +#circup_page table .name .repo_link { + margin-left: 8px; +} +#circup_page table .name .repo_link img { + height: 18px; + opacity: 0.5; + vertical-align: bottom; +} #circup_page table .board_version { white-space: nowrap; } #circup_page table .bundle_version { white-space: nowrap; } #circup_page table .status_icon { @@ -449,6 +459,16 @@ commands group.unrolled .icon-right { padding: 2px 4px; } #bundle_list .liste p.hide { display: none; } +#bundle_list .liste p .repo_link { + margin-left: 8px; +} +#bundle_list .liste p .repo_link img { + height: 16px; + vertical-align: bottom; + opacity: 0.5; + /* filter: var(--svg-glow); */ +} + .pair0 { background: var(--color-pair0); } diff --git a/assets/main/board_page.js b/assets/main/board_page.js index 04355ba..e42a7eb 100644 --- a/assets/main/board_page.js +++ b/assets/main/board_page.js @@ -3,7 +3,7 @@ SPDX-FileCopyrightText: Copyright (c) 2022 Neradoc, https://neradoc.me SPDX-License-Identifier: MIT */ -import { BUNDLE_ACCESS, OPEN_IN_BROWSER } from "../../config.js" +import { BUNDLE_ACCESS, OPEN_IN_BROWSER, DISPLAY_GITHUB_LINK } from "../../config.js" import * as common from "../main/common.js" import * as tools from "../lib/tools.js" import { setup_directory, refresh_list } from "../main/list_directory.js" @@ -267,12 +267,21 @@ async function run_update_process(imports) { var module = common.library_bundle.get_module(dependency) var file_name = module.name + (module.package ? "" : ".mpy") var icon = module.package ? "📁" : "📄" - var new_line = $("#circup_row_template").clone(); // clone the template + if(DISPLAY_GITHUB_LINK && module.repo) { + var github = $("#template-icons .repo_link").clone() + github.prop("href", module.repo) + github.on("click", tools.open_outside_sync) + github.show() + } + var new_line = $("#circup_row_template").clone() // clone the template new_line.prop("id", "") new_line.find(".upload button").on("click", upload_button_call) new_line.find(".upload button").val(dependency) new_line.find(".icon").html(icon) new_line.find(".name").html(dependency) + if(DISPLAY_GITHUB_LINK && module.repo) { + new_line.find(".name").append(github) + } new_line.find(".bundle_version").html(module.version) new_line.find(".board_version").html("...") if (imports.includes(dependency)) { diff --git a/assets/main/bundler_select.js b/assets/main/bundler_select.js index 76346d1..8107e84 100644 --- a/assets/main/bundler_select.js +++ b/assets/main/bundler_select.js @@ -3,7 +3,8 @@ SPDX-FileCopyrightText: Copyright (c) 2022 Neradoc, https://neradoc.me SPDX-License-Identifier: MIT */ -import { DEBUG } from "../lib/tools.js" +import { DISPLAY_GITHUB_LINK } from "../../config.js" +import * as tools from "../lib/tools.js" import * as jq from "../extlib/jquery.min.js" export var modules_list = [] @@ -150,14 +151,20 @@ async function fill_modules_list() { keys.forEach((module_name, pair) => { var nd1 = circup.all_the_modules[module_name].dependencies.length var nd2 = circup.all_the_modules[module_name].external_dependencies.length + var repo = circup.all_the_modules[module_name].repo var num_deps = "" - if(DEBUG) { num_deps = `(${nd1+nd2})`; } - $("#bundle_modules").append( - `
- - ${module_name} ${num_deps} -
` - ) + if(tools.DEBUG) { num_deps = `(${nd1+nd2})`; } + var line_to_add = $(`+ + ${module_name} ${num_deps} +
`) + if(DISPLAY_GITHUB_LINK && repo) { + var github = $("#template-icons .repo_link").clone() + github.prop("href", repo) + github.on("click", tools.open_outside_sync) + line_to_add.find(".module").append(github) + } + $("#bundle_modules").append(line_to_add) }) filter_the_modules() } diff --git a/assets/main/common.css b/assets/main/common.css index a22556d..d05f5dc 100644 --- a/assets/main/common.css +++ b/assets/main/common.css @@ -57,6 +57,10 @@ SPDX-License-Identifier: MIT --caret-color: white; --color-editor-zebra: rgba(50, 50, 50, 0.2); } + .light-mode { display: none; } +} +@media (prefers-color-scheme: light) { + .dark-mode { display: none; } } body { @@ -85,3 +89,7 @@ button, input { border-radius: 4px; padding: 2px 4px; } + +#template-icons { + display: none; +} \ No newline at end of file diff --git a/assets/svg/external-link.svg b/assets/svg/external-link.svg new file mode 100644 index 0000000..f697f97 --- /dev/null +++ b/assets/svg/external-link.svg @@ -0,0 +1,13 @@ + + + + diff --git a/config.js b/config.js index f1946b6..0adea20 100644 --- a/config.js +++ b/config.js @@ -9,3 +9,4 @@ export var WORKFLOW_USERNAME = "" // can only be empty for now export var WORKFLOW_PASSWORD = "passw0rd" // default, overriden by the password field export var DEBUG_DEFAULT = null // override the "default" param or set to null export var OPEN_IN_BROWSER = false // open links to web workflow files/serial in browser +export var DISPLAY_GITHUB_LINK = true // show link to github repositories diff --git a/html/board-template.html b/html/board-template.html index 94823f3..f7d4d59 100644 --- a/html/board-template.html +++ b/html/board-template.html @@ -53,5 +53,6 @@