Skip to content

Commit

Permalink
Merge pull request #115 from matatk/options-ui-tweaks
Browse files Browse the repository at this point in the history
Options and Pop-up UI tweaks
  • Loading branch information
matatk committed Nov 6, 2017
2 parents 3547a06 + 6976e3e commit 1a8b0c4
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 90 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -179,7 +179,8 @@ Changes
- Landmarks are now updated when pages change dynamically (not just when the whole page is loaded). This should make the extension much more useful when working with web-apps and pages with pop-ups and slide-out menus, for example. [[#111]](https://github.com/matatk/landmarks/pull/111)
- Add a keyboard shortcut to skip to the main landmark. [[also #111]](https://github.com/matatk/landmarks/pull/111)
- Fix a bug whereby sibling landmarks may not be identified as such. [[#112]](https://github.com/matatk/landmarks/pull/112)
- Use Mozilla's 'addons-linter'
- Adopt more browser-like UI on Firefox (pop-up and options) and Opera (options). [[#115]](https://github.com/matatk/landmarks/pull/115)
- Use Mozilla's 'addons-linter' to check the built extension. [[err, also #111]](https://github.com/matatk/landmarks/pull/111)
- 2.0.8 - 18th of September 2017
- Landmarks now ignores hidden regions. [[#85]](https://github.com/matatk/landmarks/pull/85)
- Fix a bug that caused the pop-up to incorrectly report nesting that changes by more than one level between landmarks. [[#102]](https://github.com/matatk/landmarks/pull/102)
Expand Down
147 changes: 60 additions & 87 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
Expand Up @@ -31,6 +31,7 @@
"is-mergeable-object": "~1.1",
"jsdom": "~11.3",
"one-svg-to-many-sized-pngs": "github:matatk/one-svg-to-many-sized-pngs",
"replace-in-file": "~3.0",
"rimraf": "~2.6",
"test": "~0.6"
}
Expand Down
15 changes: 15 additions & 0 deletions scripts/build.js
Expand Up @@ -6,6 +6,7 @@ const merge = require('deepmerge')
const archiver = require('archiver')
const oneSvgToManySizedPngs = require('one-svg-to-many-sized-pngs')
const packageJson = require(path.join('..', 'package.json'))
const replace = require('replace-in-file')
// For restoring pre-2.0.0 deepmerge behaviour...
const isMergeableObject = require('is-mergeable-object')
const emptyTarget = value => Array.isArray(value) ? [] : {}
Expand Down Expand Up @@ -111,6 +112,20 @@ function pathToBuild(browser) {
function copyStaticFiles(browser) {
logStep('Copying static files...')
fse.copySync(srcStaticDir, pathToBuild(browser))

if (browser === 'firefox') {
try {
const changes = replace.sync({
files: pathToBuild('firefox') + '/*.html',
from: '<script src="compatibility.js"></script>',
to: ''
})
console.log('Removed inclusion of compatibility.js from:',
changes.join(', '))
} catch (error) {
console.error('Error occurred:', error)
}
}
}


Expand Down
4 changes: 4 additions & 0 deletions src/assemble/manifest.firefox.json
Expand Up @@ -13,6 +13,10 @@
}
},

"options_ui": {
"browser_style": true
},

"applications": {
"gecko": {
"id": "ariaLandmarkNav@ibm.com",
Expand Down
4 changes: 4 additions & 0 deletions src/assemble/manifest.opera.json
Expand Up @@ -11,6 +11,10 @@
}
},

"options_ui": {
"chrome_style": true
},

"minimum_opera_version": "44",

"background": {
Expand Down
4 changes: 2 additions & 2 deletions src/static/options.html
Expand Up @@ -8,15 +8,15 @@
<div>
<label for="border-type" data-message="prefsBorderType"></label>

<select id="border-type">
<select id="border-type" class="browser-style">
<option value="momentary" data-message="prefsMomentary"></option>
<option value="persistent" data-message="prefsPersistent"></option>
<option value="none" data-message="prefsNone"></option>
</select>
</div>

<div>
<button id="save" data-message="prefsSaveButton"></button>
<button id="save" data-message="prefsSaveButton" class="browser-style"></button>
<span role="alert" id="status"></span>
</div>

Expand Down
2 changes: 2 additions & 0 deletions src/static/popup.js
Expand Up @@ -55,6 +55,7 @@ function addText(element, message) {
// (Needs to be done this way to avoid CSP violation)
function addReloadButton(element) {
const button = document.createElement('button')
button.className = 'browser-style'
button.appendChild(document.createTextNode(
browser.i18n.getMessage('tryReloading')))
button.addEventListener('click', reloadActivePage)
Expand Down Expand Up @@ -111,6 +112,7 @@ function makeLandmarksTree(landmarks, container) {
// Create the <li> for this landmark
const item = document.createElement('li')
const button = document.createElement('button')
button.className = 'browser-style'
button.appendChild(document.createTextNode(landmarkName(landmark)))
button.addEventListener('click', function() {
focusLandmark(index)
Expand Down

0 comments on commit 1a8b0c4

Please sign in to comment.