-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Set up W2D functionalities, custom domain Pages deployment, add…
… ToC
- Loading branch information
Showing
5 changed files
with
153 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Simple workflow for deploying static content to GitHub Pages | ||
name: Deploy static content to Pages | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: [$default-branch] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
# Single deploy job since we're just deploying | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
# Upload entire repository | ||
path: '.' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
w2d.js.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* document.addEventListener("click", (e) => { | ||
var id = e.target.id; | ||
if (id) openMenu(id); | ||
}, true); */ | ||
|
||
/** Invoke configure mozActivity/webActivity and redirect user to a Settings page | ||
* | ||
* @author Tom Barrasso <tom@barrasso.me> | ||
* @author Luxferre | ||
* @author the Gaia Team at Mozilla | ||
* @author KaiOS Technologies | ||
* @param section: section ID for the page in the Settings app | ||
* @implements mozActivity (KaiOS 2.5) | ||
* @implements webActivity (KaiOS 3 and later) | ||
* @see https://gitlab.com/project-pris/system/-/blob/master/src/system/b2g/webapps/settings.gaiamobile.org/src/index.html?ref_type=heads | ||
* @see https://gitlab.com/project-pris/system/-/tree/master/src/system/b2g/webapps/settings.gaiamobile.org/src/elements?ref_type=heads | ||
*/ | ||
function openMenu(section) { | ||
// KaiOS 2.5 | ||
if (window.MozActivity) { | ||
var act = new MozActivity({ | ||
name: "configure", | ||
data: { | ||
target: "device", | ||
section: section, | ||
}, | ||
}); | ||
act.onerror = function (e) { | ||
console.error(act, e); | ||
window.alert("Error:", JSON.stringify(act), e); | ||
}; | ||
} | ||
// KaiOS 3 and later | ||
else if (window.WebActivity) { | ||
var act = new WebActivity("configure", { | ||
target: "device", | ||
section: section, | ||
}); | ||
act.start().catch(function (e) { | ||
console.error(e, act); | ||
window.alert("Error: " + e); | ||
}); | ||
} | ||
// Not a KaiOS device? | ||
else { | ||
window.alert('It appears your device doesn\'t support the mozActivity or webActivity API. Please open this page on a KaiOS device for this function to work.'); | ||
} | ||
}; | ||
|
||
/** Configure adbd port to 5555 for wireless ADB connection | ||
* | ||
* @requires navigator.engmodeExtension | ||
* @requires navigator.jrdExtension | ||
* @requires navigator.kaiosExtension | ||
*/ | ||
function wadb() { | ||
var masterExt = navigator.engmodeExtension || navigator.jrdExtension || navigator.kaiosExtension; | ||
if (!masterExt) { | ||
window.alert('No supported extension found for configuring adbd.'); | ||
return; | ||
} | ||
var propSet = { | ||
'service.adb.tcp.port': 5555, | ||
'ctl.stop': 'adbd', | ||
'ctl.start': 'adbd' | ||
}; | ||
try { | ||
for (var key in propSet) { | ||
masterExt.setPropertyValue(key, propSet[key]); | ||
} | ||
window.alert('ADB port has been set to 5555.'); | ||
} catch (e) { | ||
console.error('Error setting adbd properties:', e); | ||
window.alert('Failed to set adbd properties. Please try again.'); | ||
} | ||
} |