Skip to content

Tweaks #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,23 @@ gulp.task('bootstrap', () => {
.pipe(gulp.dest('src/dist/bootstrap'))
})

gulp.task('fontawesome', () => {
return gulp
.src(
[
'node_modules/@fortawesome/fontawesome-free/css/all.min.css',
'node_modules/@fortawesome/fontawesome-free/webfonts/fa-regular-*',
'node_modules/@fortawesome/fontawesome-free/webfonts/fa-solid-*',
],
{ base: 'node_modules/@fortawesome/fontawesome-free' }
)
.pipe(gulp.dest('src/dist/fontawesome'))
})

gulp.task('jquery', () => {
return gulp
.src('node_modules/jquery/dist/jquery.min.js')
.pipe(gulp.dest('src/dist/jquery'))
})

gulp.task('default', gulp.parallel('bootstrap', 'jquery'))
gulp.task('default', gulp.parallel('bootstrap', 'fontawesome', 'jquery'))
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build": "npm run build:chrome && npm run build:firefox"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^6.5.1",
"bootstrap": "^5.3.2",
"jquery": "^3.7.1"
},
Expand Down
21 changes: 8 additions & 13 deletions src/html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<title>SMWC Web Extension</title>
<link rel="icon" href="../images/logo16.png" sizes="any">
<link rel="stylesheet" type="text/css" href="../dist/bootstrap/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../dist/fontawesome/css/all.min.css">
<link rel="stylesheet" type="text/css" href="../css/main.css">
<link rel="stylesheet" type="text/css" href="../css/options.css">
<script type="text/javascript" src="../js/theme.js"></script>
Expand All @@ -15,9 +16,10 @@
<div class="col-xl-6 col-md-8 col-12 m-auto">
<div class="card" >
<div class="card-body">
<div class="justify-content-center align-items-center d-flex">
<img src="../images/logo48.png" class="img-fluid float-start me-2" alt="SMWC Web Extension" height="48" width="48">
<h1 class="align-middle">SMWC Web Extension</h1>
<div class="d-flex justify-content-center align-items-center">
<img src="../images/logo48.png" class="me-2" height="48" width="48"
alt="SMWC Web Extension" title="SMWC Web Extension">
<h1>SMWC Web Extension</h1>
</div>
<div class="clearfix"></div>
<p class="text-center lead">v<span id="version"></span></p>
Expand All @@ -26,7 +28,7 @@ <h1 class="align-middle">SMWC Web Extension</h1>
<thead class="visually-hidden"><tr><th>Description</th><th>Shortcut</th></tr></thead>
<tbody>
<tr>
<td>Show Popup Action <svg class="ms-1"><use xlink:href="#bi-keyboard" /></svg></td>
<td>Show Popup Action <i class="fa-regular fa-keyboard ms-1"></i></td>
<td class="text-end" title="Keyboard Shortcut"><kbd id="mainKey">Unknown</kbd></td>
</tr>
</tbody>
Expand All @@ -38,7 +40,7 @@ <h1 class="align-middle">SMWC Web Extension</h1>
<label class="form-check-label" for="contextMenu" aria-describedby="contextMenuHelp">
Enable Right Click Menu
<span data-bs-toggle="tooltip" data-bs-title="Show Context Menu on Right Click.">
<svg class="ms-1"><use xlink:href="#bi-info-circle-fill" /></svg>
<i class="fa-solid fa-circle-info ms-1"></i>
</span>
</label>
</div>
Expand All @@ -47,7 +49,7 @@ <h1 class="align-middle">SMWC Web Extension</h1>
<label class="form-check-label" for="showUpdate" aria-describedby="showUpdateHelp">
Show Release Notes on Update
<span data-bs-toggle="tooltip" data-bs-title="Show Release Notes on Version Update.">
<svg class="ms-1"><use xlink:href="#bi-info-circle-fill" /></svg>
<i class="fa-solid fa-circle-info ms-1"></i>
</span>
</label>
</div>
Expand Down Expand Up @@ -108,13 +110,6 @@ <h1 class="align-middle">SMWC Web Extension</h1>
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" id="bi-dot" viewBox="0 0 16 16">
<path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" id="bi-info-circle-fill" viewBox="0 0 16 16">
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" id="bi-keyboard" viewBox="0 0 16 16">
<path d="M14 5a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zM2 4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"/>
<path d="M13 10.25a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm0-2a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm-5 0A.25.25 0 0 1 8.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 8 8.75zm2 0a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25zm1 2a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm-5-2A.25.25 0 0 1 6.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 6 8.75zm-2 0A.25.25 0 0 1 4.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 4 8.75zm-2 0A.25.25 0 0 1 2.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 2 8.75zm11-2a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm-2 0a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm-2 0A.25.25 0 0 1 9.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 9 6.75zm-2 0A.25.25 0 0 1 7.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 7 6.75zm-2 0A.25.25 0 0 1 5.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 5 6.75zm-3 0A.25.25 0 0 1 2.25 6h1.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-1.5A.25.25 0 0 1 2 6.75zm0 4a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm2 0a.25.25 0 0 1 .25-.25h5.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-5.5a.25.25 0 0 1-.25-.25z"/>
</svg>
</div>

<script type="text/javascript" src="../dist/jquery/jquery.min.js"></script>
Expand Down
22 changes: 9 additions & 13 deletions src/html/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<title>SMWC Web Extension</title>
<link rel="icon" href="../images/logo16.png" sizes="any">
<link rel="stylesheet" type="text/css" href="../dist/bootstrap/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../dist/fontawesome/css/all.min.css">
<link rel="stylesheet" type="text/css" href="../css/main.css">
<link rel="stylesheet" type="text/css" href="../css/popup.css">
<script type="text/javascript" src="../js/theme.js"></script>
Expand All @@ -13,8 +14,10 @@
<div class="container-fluid p-3">
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<div class="btn-group btn-group-sm" role="group" aria-label="SMWC.world">
<a role="button" class="btn btn-outline-info" href="https://smwc.world/patcher/">Patcher</a>
<a role="button" class="btn btn-outline-info" href="https://smwc.world/play/">Player</a>
<a role="button" class="btn btn-outline-info" href="https://smwc.world/patcher/">
<i class="fa-solid fa-hard-drive me-1"></i> Patcher</a>
<a role="button" class="btn btn-outline-info" href="https://smwc.world/play/">
<i class="fa-solid fa-gamepad me-1"></i> Player</a>
</div>
<a class="btn btn-success btn-sm w-100" role="button" href="https://www.smwcentral.net/?p=section&s=smwhacks">
SMW Central Rom Hacks</a>
Expand Down Expand Up @@ -48,7 +51,7 @@
<label class="form-check-label" for="contextMenu" aria-describedby="contextMenuHelp">
Enable Right Click Menu
<span data-bs-toggle="tooltip" data-bs-title="Show Context Menu on Right Click.">
<svg class="ms-1"><use xlink:href="#bi-info-circle-fill" /></svg>
<i class="fa-solid fa-circle-info ms-1"></i>
</span>
</label>
</div>
Expand All @@ -57,28 +60,21 @@
<label class="form-check-label" for="showUpdate" aria-describedby="showUpdateHelp">
Show Release Notes on Update
<span data-bs-toggle="tooltip" data-bs-title="Show Release Notes on Version Update.">
<svg class="ms-1"><use xlink:href="#bi-info-circle-fill" /></svg>
<i class="fa-solid fa-circle-info ms-1"></i>
</span>
</label>
</div>
</form>
<a class="btn btn-outline-primary btn-sm w-100" role="button" href="../html/options.html">
Open Options
</a>
<i class="fa-solid fa-sliders me-1"></i> Open Options</a>
<hr>
<div class="justify-content-center align-items-center d-flex text-center small">
<img src="../images/logo16.png" alt="SMWC Web Extension" class="me-1">
<img src="../images/logo16.png" class="me-1" alt="SMWC Web Extension" title="SMWC Web Extension">
<a class="link-offset-2 link-underline link-underline-opacity-0 link-underline-opacity-75-hover mx-2" type="button" rel="noopener"
id="homepage_url" href="">SMWC Web Extension</a> v<span id="version"></span>
</div>
</div>

<div class="d-none">
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" id="bi-info-circle-fill" viewBox="0 0 16 16">
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
</svg>
</div>

<script type="text/javascript" src="../dist/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../dist/bootstrap/bootstrap.bundle.min.js"></script>
<script type="module" src="../js/popup.js"></script>
Expand Down
7 changes: 3 additions & 4 deletions src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ async function initPopup() {
console.log('initPopup')
document.getElementById('patch-input').focus()

document.getElementById('version').textContent =
chrome.runtime.getManifest().version
document.getElementById('homepage_url').href =
chrome.runtime.getManifest().homepage_url
const manifest = chrome.runtime.getManifest()
document.getElementById('version').textContent = manifest.version
document.getElementById('homepage_url').href = manifest.homepage_url

const { options, popup } = await chrome.storage.sync.get([
'options',
Expand Down