-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* GPII-3154: GPII-3154: Added the build as a postinstall step. GPII-3154: Generating a unique prefix to use with id's. GPII-3154: Using infusion-all.js for tests. GPII-3154: Modifying check for keysToFilter GPII-3154: Fixing comment GPII-3154: Refactored message posting structure, and caption disabling. GPII-3154: Inject scripts in order. GPII-3154: Removing commented out code. GPII-3154: Updating readme info to include captions as a preference. GPII-3154: Touching up captions integration and tests. GPII-3154: In progress captions integration. GPII-3154: removing package-lock.json
- Loading branch information
Showing
24 changed files
with
930 additions
and
112 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
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,6 @@ | ||
{ | ||
"label": "youtube Captions", | ||
"description": "Request embedded YouTube videos to display captions.", | ||
"switchOn": "ON", | ||
"switchOff": "OFF" | ||
} |
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 was deleted.
Oops, something went wrong.
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,67 @@ | ||
/* | ||
* GPII Chrome Extension for Google Chrome | ||
* | ||
* Copyright 2018 OCAD University | ||
* | ||
* Licensed under the New BSD license. You may not use this file except in | ||
* compliance with this license. | ||
* | ||
* You may obtain a copy of the license at | ||
* https://github.com/GPII/gpii-chrome-extension/blob/master/LICENSE.txt | ||
*/ | ||
|
||
/* global fluid, gpii, chrome */ | ||
"use strict"; | ||
|
||
(function ($, fluid) { | ||
|
||
fluid.registerNamespace("gpii.chrome.webInjection"); | ||
|
||
gpii.chrome.webInjection.fonts = [{ | ||
fontFamily: "Orator-Icons", | ||
urls: [ | ||
chrome.runtime.getURL("fonts/Orator-Icons.ttf"), | ||
chrome.runtime.getURL("fonts/Orator-Icons.eot") | ||
] | ||
}]; | ||
|
||
// 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 | ||
fluid.each(gpii.chrome.webInjection.fonts, function (fontInfo) { | ||
var urls = fluid.transform(fluid.makeArray(fontInfo.urls), function (url) { | ||
return "url(\"" + url + "\")"; | ||
}); | ||
|
||
var info = { | ||
fontFamily: fontInfo.fontFamily, | ||
src: urls.join(",") | ||
}; | ||
|
||
var styleElm = $(fluid.stringTemplate(gpii.chrome.webInjection.styleTemplate, info)); | ||
|
||
$("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 | ||
jQuery.noConflict(); |
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
Oops, something went wrong.