Skip to content

Commit

Permalink
Merge branch 'GPII-3053'
Browse files Browse the repository at this point in the history
* GPII-3053:
  GPII-3053: linting
  GPII-3053: Updating remaning outdate packages.
  GPII-3053: updating dependencies.
  GPII-3053: Updated to use gpii-grunt-lint-all
  GPII-3053: Adding package-lock.json to gitignore
  GPII-3053: Removing package-lock.json file.
  GPII-3053: Updating to latest dev release of Infusion
  GPII-3053: Removed dictionary preference and related code.
  • Loading branch information
amb26 committed Aug 6, 2018
2 parents fdc7d4e + 4f88b52 commit f05d12e
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 987 deletions.
38 changes: 15 additions & 23 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@
"use strict";

module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("fluid-grunt-eslint");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-stylus");
grunt.loadNpmTasks("grunt-crx");
grunt.loadNpmTasks("grunt-jsonlint");

var files = {
extensionLib: [
Expand Down Expand Up @@ -160,9 +153,7 @@ module.exports = function (grunt) {
],
extension: [
"extension/src/lib/chromeEvented.js",
"extension/src/lib/chromeNotification.js",
"extension/src/lib/domSettingsApplier.js",
"extension/src/lib/extensionHolder.js",
"extension/src/lib/highContrast.js",
"extension/src/lib/chromeSettings.js",
"extension/src/lib/wsConnector.js",
Expand All @@ -173,19 +164,13 @@ module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
manifest: grunt.file.readJSON("extension/manifest.json"),
jsonlint: {
all: [
"*.json",
"extension/**/*.json",
"tests/**/*.json"
]
},
eslint: {
all: [
"*.js",
"extension/**/*.js",
"tests/**/*.js"
]
lintAll: {
sources: {
md: [ "./*.md"],
js: ["./tests/**/*.js", "./extension/**/*.js", "./*.js"],
json: ["./extension/**/*.json", "./*.json"],
other: ["./.*"]
}
},
uglify: {
options: {
Expand Down Expand Up @@ -338,7 +323,14 @@ module.exports = function (grunt) {
}
});

grunt.registerTask("lint", "Lint the source code", ["jsonlint", "eslint"]);
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-stylus");
grunt.loadNpmTasks("grunt-crx");
grunt.loadNpmTasks("gpii-grunt-lint-all");

grunt.registerTask("lint", "Perform all standard lint checks.", ["lint-all"]);
grunt.registerTask("bundle", "Bundle dependencies and source code into a single .min.js file", ["uglify"]);
grunt.registerTask("build", "Build the extension so you can start using it unpacked", ["clean", "bundle", "stylus", "copy"]);
grunt.registerTask("buildPkg", "Create a .crx package ready to be distributed", ["lint", "build", "crx"]);
Expand Down
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# UI Options Plus (UIO+)

User Interface Options Plus (UIO+) allows you to customize websites to match your own personal needs and preferences. Settings for the adaptations can be set via the UIO+ adjuster panel or, if on a GPII (Global Public Inclusive Infrastructure) enable machine, from a keyed in preference set.
User Interface Options Plus (UIO+) allows you to customize websites to match your own personal needs and preferences.
Settings for the adaptations can be set via the UIO+ adjuster panel or, if on a GPII (Global Public Inclusive
Infrastructure) enable machine, from a keyed in preference set.

The following adaptations are supported:

Expand All @@ -14,11 +16,13 @@ The following adaptations are supported:
* Reading Mode
* Table of Contents
* Enhance Inputs
* Dictionary (requires the Google dictionary extension)

_**Note**: The ability to apply an adaptation will vary from page to page_

UI Options Plus is the result of a joint effort of the Inclusive Design Research Centre at OCAD University and the Trace R&D Center at University of Maryland under funding for the FLOE Project from the William and Flora Hewlett Foundation and the National Institute on Disability, Independent Living, and Rehabilitation Research (NIDILRR), Administration for Community Living under grant #90RE5027.
UI Options Plus is the result of a joint effort of the Inclusive Design Research Centre at OCAD University and the Trace
R&D Center at University of Maryland under funding for the FLOE Project from the William and Flora Hewlett Foundation
and the National Institute on Disability, Independent Living, and Rehabilitation Research (NIDILRR), Administration for
Community Living under grant #90RE5027.

## Building the extension

Expand All @@ -38,12 +42,12 @@ You can also create a development build which creates an unpacked version that i

grunt buildDev


If you want to create a [crx](https://developer.chrome.com/extensions/crx) package to be distributed, run:

grunt buildPkg

**Note that you need to use a [PEM](http://how2ssl.com/articles/working_with_pem_files/) file to sign the crx package with. This file needs to be called *key.pem* and needs to be placed into the top level folder of this repository.**
**Note that you need to use a [PEM](http://how2ssl.com/articles/working_with_pem_files/) file to sign the crx package
with. This file needs to be called *key.pem* and needs to be placed into the top level folder of this repository.**

## Testing

Expand All @@ -55,23 +59,21 @@ Run the browser based tests:

http://localhost/tests/browser/all-tests.html



_**NOTE:** Browser tests should be served through a web server. The exact URL may vary._

## Trying out the extension

Requirements:

* [Google Chrome browser](https://www.google.com/chrome/browser/desktop/)

Follow these steps if you want to use the unpacked version of the extension:

1. Visit *chrome://extensions* in your browser. Alternatively, open the Chrome menu by clicking the icon to the far right of the Omnibox; the menu's icon is three horizontal bars. Select *Extensions* under the *Tools* menu to open Chrome's extension settings.

1. Visit *chrome://extensions* in your browser. Alternatively, open the Chrome menu by clicking the icon to the far
right of the Omnibox; the menu's icon is three horizontal bars. Select *Extensions* under the *Tools* menu to open
Chrome's extension settings.
2. Ensure that the *Developer mode* checkbox in the top right-hand corner is checked.

3. Click *Load unpacked extension* to pop up a file-selection dialog.

4. Navigate to the directory in which your local copy of the extension lives, and select the *build* folder.

Published versions can be installed from the Chrome Web Store.
Expand Down
6 changes: 0 additions & 6 deletions extension/messages/dictionary.json

This file was deleted.

8 changes: 4 additions & 4 deletions extension/src/content_scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
* jQuery object with 1 or more elements. If no elements found, it returns
* either an empty jQuery object or the default, if a default is provided.
*
* @param that {Object} - a fluid.viewComponent
* @param selectors {String|Array} - one or more selector names to search through in the order to try.
* @param {Component} that - a fluid.viewComponent
* @param {String|Array} selectorNames - one or more selector names to search through in the order to try.
* The selector names must correspond to selectors in the component's
* selectors block.
* @param deflt {Any} - a default value to use if no elements found for any of the selector names
* @returns {Any} - a jQuery object if found. If nothing found, either the deflt value or undefined is returned.
* @param {Any} deflt - a default value to use if no elements found for any of the selector names
* @return {Any} - a jQuery object if found. If nothing found, either the `deflt` value or undefined is returned.
*/
gpii.chrome.utils.findFirstSelector = function (that, selectorNames, deflt) {
selectorNames = fluid.makeArray(selectorNames);
Expand Down
34 changes: 5 additions & 29 deletions extension/src/lib/PrefsEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"preferences.gpii_chrome_prefs_textSize": "settings.fontSize",
"preferences.fluid_prefs_speak": "settings.selfVoicingEnabled",
"preferences.gpii_chrome_prefs_simplify": "settings.simplifiedUiEnabled",
"preferences.gpii_chrome_prefs_dictionary": "settings.dictionaryEnabled",
"preferences.gpii_chrome_prefs_highlight": "settings.selectionTheme",
"preferences.gpii_chrome_prefs_clickToSelect": "settings.clickToSelectEnabled"
},
Expand Down Expand Up @@ -148,6 +147,11 @@
* Sends the prefsEditor.model to the store and fires onSave
* Overrides the default writeImpl functionality as all of the model, including the default values, must be sent
* to the store.
*
* @param {Component} that - the component
* @param {Object} modelToSave - the model to be written
*
* @return {Promise} promise - a promise that is resolved when the model is saved.
*/
gpii.chrome.prefs.extensionPanel.writeImpl = function (that, modelToSave) {
var promise = fluid.promise();
Expand Down Expand Up @@ -206,15 +210,6 @@
}
});

fluid.defaults("gpii.chrome.prefs.panel.dictionary", {
gradeNames: ["fluid.prefs.panel.switchAdjuster"],
preferenceMap: {
"gpii.chrome.prefs.dictionary": {
"model.value": "default"
}
}
});

fluid.defaults("gpii.chrome.prefs.panel.clickToSelect", {
gradeNames: ["fluid.prefs.panel.switchAdjuster"],
preferenceMap: {
Expand Down Expand Up @@ -325,15 +320,6 @@
"message": "%messagePrefix/simplify.json"
}
},
"dictionary": {
"type": "gpii.chrome.prefs.dictionary",
"panel": {
"type": "gpii.chrome.prefs.panel.dictionary",
"container": ".flc-prefsEditor-dictionary",
"template": "%templatePrefix/DictionaryPanelTemplate.html",
"message": "%messagePrefix/dictionary.json"
}
},
"selectionHighlight": {
"type": "gpii.chrome.prefs.highlight",
"classes": {
Expand Down Expand Up @@ -427,16 +413,6 @@
}
});

fluid.defaults("gpii.chrome.prefs.schemas.dictionary", {
gradeNames: ["fluid.prefs.schemas"],
schema: {
"gpii.chrome.prefs.dictionary": {
"type": "boolean",
"default": false
}
}
});

fluid.defaults("gpii.chrome.prefs.schemas.clickToSelect", {
gradeNames: ["fluid.prefs.schemas"],
schema: {
Expand Down
131 changes: 0 additions & 131 deletions extension/src/lib/chromeNotification.js

This file was deleted.

Loading

0 comments on commit f05d12e

Please sign in to comment.