You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@senssoft.apache.org by ms...@apache.org on 2017/07/24 21:19:45 UTC
incubator-senssoft-useralejs git commit: SENSSOFT-215: Expanded web
extension configurations
Repository: incubator-senssoft-useralejs
Updated Branches:
refs/heads/SENSSOFT-175-integrate-webext-with-build 3498d06b6 -> 653bf0270
SENSSOFT-215: Expanded web extension configurations
Project: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/commit/653bf027
Tree: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/tree/653bf027
Diff: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/diff/653bf027
Branch: refs/heads/SENSSOFT-175-integrate-webext-with-build
Commit: 653bf02704d35b42c5cfa06c403782c7b4e6849c
Parents: 3498d06
Author: msbeard <ms...@apache.org>
Authored: Mon Jul 24 17:19:40 2017 -0400
Committer: msbeard <ms...@apache.org>
Committed: Mon Jul 24 17:19:40 2017 -0400
----------------------------------------------------------------------
src/UserALEWebExtension/globals.js | 5 ++++-
src/UserALEWebExtension/options.js | 12 +++++++++++-
src/UserALEWebExtension/optionsPage.html | 12 ++++++++++++
src/UserALEWebExtension/user-ale-ext.js | 14 +++++++++++---
4 files changed, 38 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/blob/653bf027/src/UserALEWebExtension/globals.js
----------------------------------------------------------------------
diff --git a/src/UserALEWebExtension/globals.js b/src/UserALEWebExtension/globals.js
index 4d1d4de..7680769 100644
--- a/src/UserALEWebExtension/globals.js
+++ b/src/UserALEWebExtension/globals.js
@@ -1,3 +1,6 @@
// these are default values, which can be overridden by the user on the options page
var userAleHost = 'http://localhost:8000';
-var userAleScript = 'userale-0.2.1.min.js';
\ No newline at end of file
+var userAleScript = 'userale-0.2.1.min.js';
+var toolUser = 'nobody';
+var toolName = 'test_app';
+var toolVersion = '0.1.0';
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/blob/653bf027/src/UserALEWebExtension/options.js
----------------------------------------------------------------------
diff --git a/src/UserALEWebExtension/options.js b/src/UserALEWebExtension/options.js
index ace66df..16bbb32 100644
--- a/src/UserALEWebExtension/options.js
+++ b/src/UserALEWebExtension/options.js
@@ -8,13 +8,19 @@ if (chrome) {
// the value specified is the default value if one doesn't exist in the storage
let store = browser.storage.local.get({
userAleHost: userAleHost,
- userAleScript: userAleScript
+ userAleScript: userAleScript,
+ toolUser: toolUser,
+ toolName: toolName,
+ toolVersion: toolVersion,
}, storeCallback);
function storeCallback(item) {
console.log(item);
document.getElementById("host").value = item.userAleHost;
document.getElementById("clientScript").value = item.userAleScript;
+ document.getElementById("toolUser").value = item.toolUser;
+ document.getElementById("toolName").value = item.toolName;
+ document.getElementById("toolVersion").value = item.toolVersion;
}
function onError(error) {
@@ -26,6 +32,10 @@ function saveOptions(e) {
browser.storage.local.set({
userAleHost: document.getElementById("host").value,
userAleScript: document.getElementById("clientScript").value,
+ toolUser: document.getElementById("toolUser").value,
+ toolName: document.getElementById("toolName").value,
+ toolVersion: document.getElementById("toolVersion").value,
+
});
}
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/blob/653bf027/src/UserALEWebExtension/optionsPage.html
----------------------------------------------------------------------
diff --git a/src/UserALEWebExtension/optionsPage.html b/src/UserALEWebExtension/optionsPage.html
index 89f1229..d2c4b59 100644
--- a/src/UserALEWebExtension/optionsPage.html
+++ b/src/UserALEWebExtension/optionsPage.html
@@ -17,6 +17,18 @@
<input id="clientScript"/>
<br/>
+ <label>User:</label>
+ <input id="toolUser"/>
+ <br/>
+
+ <label>Tool Name:</label>
+ <input id="toolName"/>
+ <br/>
+
+ <label>Tool Version:</label>
+ <input id="toolVersion"/>
+ <br/>
+
<div align="right">
<button type="submit">Save</button>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/blob/653bf027/src/UserALEWebExtension/user-ale-ext.js
----------------------------------------------------------------------
diff --git a/src/UserALEWebExtension/user-ale-ext.js b/src/UserALEWebExtension/user-ale-ext.js
index d040bd2..b421c5e 100644
--- a/src/UserALEWebExtension/user-ale-ext.js
+++ b/src/UserALEWebExtension/user-ale-ext.js
@@ -15,14 +15,19 @@ if (chrome) {
// the value specified is the default value if one doesn't exist in the storage
let store = browser.storage.local.get({
userAleHost: userAleHost,
- userAleScript: userAleScript
+ userAleScript: userAleScript,
+ toolUser: toolUser,
+ toolName: toolName,
+ toolVersion: toolVersion,
}, storeCallback);
function storeCallback(item) {
console.log(item);
userAleHost = item.userAleHost;
userAleScript = item.userAleScript;
-
+ toolUser = item.toolUser;
+ toolName = item.toolName;
+ toolVersion = item.toolVersion;
injectScript();
}
@@ -36,12 +41,15 @@ function injectScript() {
userAleTag.setAttribute("id", "userale-plugin");
userAleTag.setAttribute("data-url", userAleHost);
userAleTag.setAttribute("data-autostart", true);
+ userAleTag.setAttribute("data-user", toolUser);
+ userAleTag.setAttribute("data-tool", toolName);
+ userAleTag.setAttribute("data-version", toolVersion);
userAleTag.src = browser.extension.getURL(userAleScript);
console.log("Injecting UserALE script into current page! " + userAleHost + " " + userAleScript);
document.head.appendChild(userAleTag);
- document.body.innerHTML += "<br/><br/>SUCCESS! UserALE has been injected onto the page!";
+ // document.body.innerHTML += "<br/><br/>SUCCESS! UserALE has been injected onto the page!";
}