Skip to content
Open
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
8 changes: 2 additions & 6 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module.exports = function (grunt) {
"node_modules/infusion/src/framework/core/js/ModelTransformation.js",
"node_modules/infusion/src/framework/core/js/ModelTransformationTransforms.js",
"node_modules/infusion/src/framework/core/js/FluidView.js",
"node_modules/infusion/src/framework/core/js/FluidView-browser.js",
"node_modules/infusion/src/framework/core/js/MessageResolver.js",
"node_modules/infusion/src/framework/core/js/ResourceLoader.js",
"node_modules/infusion/src/framework/core/js/ResourceLoader-browser.js",
Expand Down Expand Up @@ -86,6 +87,7 @@ module.exports = function (grunt) {
"node_modules/infusion/src/framework/core/js/ResourceLoader-browser.js",
"node_modules/infusion/src/framework/core/js/jquery.keyboard-a11y.js",
"node_modules/infusion/src/framework/core/js/FluidView.js",
"node_modules/infusion/src/framework/core/js/FluidView-browser.js",
"node_modules/infusion/src/framework/enhancement/js/ContextAwareness.js",
"node_modules/infusion/src/framework/enhancement/js/ProgressiveEnhancement.js",
"node_modules/infusion/src/lib/fastXmlPull/js/fastXmlPull.js",
Expand All @@ -106,7 +108,6 @@ module.exports = function (grunt) {
"node_modules/infusion/src/framework/preferences/js/UIEnhancer.js",
"node_modules/infusion/src/framework/preferences/js/PrefsEditor.js",
"node_modules/infusion/src/framework/preferences/js/Panels.js",
"node_modules/infusion/src/framework/preferences/js/CaptionsPanel.js",
"node_modules/infusion/src/framework/preferences/js/LetterSpacePanel.js",
"node_modules/infusion/src/framework/preferences/js/SelfVoicingPanel.js",
"node_modules/infusion/src/framework/preferences/js/SyllabificationPanel.js",
Expand All @@ -119,7 +120,6 @@ module.exports = function (grunt) {
"node_modules/infusion/src/framework/preferences/js/PrimaryBuilder.js",
"node_modules/infusion/src/framework/preferences/js/AuxBuilder.js",
"node_modules/infusion/src/framework/preferences/js/StarterSchemas.js",
"node_modules/infusion/src/framework/preferences/js/CaptionsSchemas.js",
"node_modules/infusion/src/framework/preferences/js/LetterSpaceSchemas.js",
"node_modules/infusion/src/framework/preferences/js/SelfVoicingSchemas.js",
"node_modules/infusion/src/framework/preferences/js/SyllabificationSchemas.js",
Expand Down Expand Up @@ -234,10 +234,6 @@ module.exports = function (grunt) {
src: ["extension/src/lib/adjusterScriptLoader.js"],
dest: "build/src/adjusterScriptLoader.js"
},
{
src: ["extension/src/lib/captionsEnactor.js"],
dest: "build/src/captionsEnactor.js"
},
{
src: ["extension/src/lib/portBinding.js"],
dest: "build/src/portBinding.js"
Expand Down
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ machine, from a keyed in preference set.

The following adaptations are supported:

* Captions (embedded YouTube videos)
* Character Space
* Contrast
* Enhance Inputs
Expand Down Expand Up @@ -159,14 +158,10 @@ _**NOTE:** Published versions can be installed from the [Chrome Web Store](
2. The preferences should be tested individually and in combinations to ensure that interactions between the
preferences are working properly. For example (Text-to-Speech and Syllabification, Text-to-Speech with
Reading Mode).
3. Multiple web pages should be tested. However, not all preferences will work with all sites. For example,
YouTube captions will only work with YouTube videos embedded using the iframe API and providing captions
(not autogenerated captions).
1. This [example](http://jsfiddle.net/xpvt214o/628070/show) provides a YouTube video that can be used to
test Captions.
4. Load Morphic and ensure that logging in users (e.g.
[uioPlusCommon](https://github.com/GPII/universal/blob/master/testData/preferences/uioPlusCommon.json5))
applies the preferences to UIO+.
3. Multiple web pages should be tested. However, not all preferences will work with all sites.
4. Load Morphic and ensure that logging in users (e.g. [uioPlusCommon](
https://github.com/GPII/universal/blob/master/testData/preferences/uioPlusCommon.json5)) applies the
preferences to UIO+.
3. Increase the "version" number in the [manifest](
https://github.com/GPII/gpii-chrome-extension/blob/master/extension/manifest.json#L5) file, and push changes to
master.
Expand Down
4 changes: 1 addition & 3 deletions extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,10 @@
"src/background.js"
]
},
"content_security_policy": "script-src 'self' https://youtube.com https://ytimg.com; object-src 'self'",
"web_accessible_resources": [
"images/gpii.png",
"templates/TableOfContents.html",
"messages/tableOfContents-enactor*.json",
"fonts/Orator-Icons.woff",
"src/captionsEnactor.js"
"fonts/Orator-Icons.woff"
]
}
6 changes: 0 additions & 6 deletions extension/messages/ytCaptions.json

This file was deleted.

46 changes: 1 addition & 45 deletions extension/src/content_scripts/domEnactor.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
gradeNames: ["fluid.contextAware", "fluid.viewComponent"],
model: {
// Accepted model values:
// captionsEnabled: Boolean,
// characterSpace: Number,
// contrastTheme: String,
// inputsLargerEnabled: Boolean,
Expand All @@ -38,8 +37,7 @@
onIncomingSettings: null
},
listeners: {
"onIncomingSettings.updateModel": "{that}.updateModel",
"onIncomingSettings.postSettingsToWebPage": "{that}.postSettingsToWebPage"
"onIncomingSettings.updateModel": "{that}.updateModel"
},
contextAwareness: {
simplify: {
Expand All @@ -51,22 +49,7 @@
}
}
},
webSettings: {
type: "gpii.chrome.domEnactor",
filter: {
keys: ["captionsEnabled"],
exclude: false
}
},
invokers: {
postSettingsToWebPage: {
funcName: "gpii.chrome.domEnactor.postSettingsToWebPage",
args: [
"{that}.options.webSettings.type",
"{arguments}.0",
{filter: "{that}.options.webSettings.filter"}
]
},
updateModel: {
funcName: "gpii.chrome.domEnactor.updateModel",
args: ["{that}", "{arguments}.0"]
Expand Down Expand Up @@ -201,33 +184,6 @@
transaction.commit();
};

/**
* Posts a message to the webpage allowing for communication from the content script to the
* web page context. This is typically used to pass the model values from the extension to
* related enactors running in the web page context.
*
* @param {String} type - the value of the "type" field stored in the message's data
* @param {Object} settings - the settings to post to the web page context
* @param {Object} options - optional directives for filtering the settings to be posted.
* this allows the removal of settings that are not handled by
* the web page context, allowing for the remainder to be kept
* private. Options take the following form:
* {filter: {keys: [array of keys], exclude: true/false}} The
* exclude option determines if the filter keys are removed (true)
* or included (false).
*/
gpii.chrome.domEnactor.postSettingsToWebPage = function (type, settings, options) {
var data = {
type: type
};
var keysToFilter = fluid.get(options, ["filter", "keys"]);
if (fluid.isArrayable(keysToFilter)) {
settings = fluid.filterKeys(settings, keysToFilter, options.filter.exclude);
}
data.payload = settings;
window.postMessage(data, "*");
};

fluid.defaults("gpii.chrome.domEnactor.simplify", {
components: {
simplify: {
Expand Down
19 changes: 0 additions & 19 deletions extension/src/content_scripts/webInjection.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
urls: [chrome.runtime.getURL("fonts/Orator-Icons.woff")]
}];

// Listed in the order the scripts will be injected into the page
gpii.chrome.webInjection.scripts = [
"https://www.youtube.com/iframe_api",
chrome.runtime.getURL("src/captionsEnactor.js")
];

gpii.chrome.webInjection.styleTemplate = "<style>@font-face {font-family: \"%fontFamily\"; src: %src;}</style>";

// inject fonts
Expand All @@ -45,19 +39,6 @@

$("head").append(styleElm);
});

// inject scripts
fluid.each(gpii.chrome.webInjection.scripts, function (src) {
var existingScript = $("script[src=\"" + src + "\"]");

// if the script doesn't already exist on the page, inject it.
if (existingScript.length === 0) {
var script = $("<script>").attr("src", src);
$("script").eq(0).before(script);
}
});


})(jQuery, fluid);

// to allow for the pages own instance of jQuery
Expand Down
10 changes: 0 additions & 10 deletions extension/src/lib/PrefsEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
portName: "extensionPanel",
rules: {
"panelIndex": "panelIndex",
"preferences.fluid_prefs_captions": "settings.captionsEnabled",
"preferences.fluid_prefs_enhanceInputs": "settings.inputsLargerEnabled",
"preferences.fluid_prefs_letterSpace": "settings.characterSpace",
"preferences.fluid_prefs_speak": "settings.selfVoicingEnabled",
Expand Down Expand Up @@ -281,15 +280,6 @@
},
"template": "%templatePrefix/PrefsEditorPanel.html",
"message": "%messagePrefix/prefsEditor.json",
"captions": {
"type": "fluid.prefs.captions",
"panel": {
"type": "fluid.prefs.panel.captions",
"container": ".flc-prefsEditor-captions",
"template": "%templatePrefix/PrefsEditorTemplate-captions.html",
"message": "%messagePrefix/ytCaptions.json"
}
},
"charSpace": {
"type": "fluid.prefs.letterSpace",
"panel": {
Expand Down
Loading