From 500a95a70492fc319ad1984da36773952a2086e6 Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 31 Jul 2015 18:38:02 -0700 Subject: init commit --- app/_locales/en/messages.json | 10 ++++++++++ app/images/icon-128.png | Bin 0 -> 5356 bytes app/images/icon-16.png | Bin 0 -> 758 bytes app/images/icon-19.png | Bin 0 -> 1967 bytes app/images/icon-38.png | Bin 0 -> 4265 bytes app/manifest.json | 41 +++++++++++++++++++++++++++++++++++++++++ app/popup.html | 25 +++++++++++++++++++++++++ app/scripts/background.js | 9 +++++++++ app/scripts/chromereload.js | 22 ++++++++++++++++++++++ app/scripts/contentscript.js | 8 ++++++++ app/scripts/popup.js | 3 +++ app/scripts/web3.js | 2 ++ app/styles/main.css | 3 +++ 13 files changed, 123 insertions(+) create mode 100644 app/_locales/en/messages.json create mode 100644 app/images/icon-128.png create mode 100644 app/images/icon-16.png create mode 100644 app/images/icon-19.png create mode 100644 app/images/icon-38.png create mode 100644 app/manifest.json create mode 100644 app/popup.html create mode 100644 app/scripts/background.js create mode 100644 app/scripts/chromereload.js create mode 100644 app/scripts/contentscript.js create mode 100644 app/scripts/popup.js create mode 100644 app/scripts/web3.js create mode 100644 app/styles/main.css (limited to 'app') diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json new file mode 100644 index 000000000..4414e6533 --- /dev/null +++ b/app/_locales/en/messages.json @@ -0,0 +1,10 @@ +{ + "appName": { + "message": "metamask", + "description": "The name of the application" + }, + "appDescription": { + "message": "Ethereum Identity Management", + "description": "The description of the application" + } +} diff --git a/app/images/icon-128.png b/app/images/icon-128.png new file mode 100644 index 000000000..75c023a53 Binary files /dev/null and b/app/images/icon-128.png differ diff --git a/app/images/icon-16.png b/app/images/icon-16.png new file mode 100644 index 000000000..7df748fba Binary files /dev/null and b/app/images/icon-16.png differ diff --git a/app/images/icon-19.png b/app/images/icon-19.png new file mode 100644 index 000000000..20c54d41f Binary files /dev/null and b/app/images/icon-19.png differ diff --git a/app/images/icon-38.png b/app/images/icon-38.png new file mode 100644 index 000000000..c453adcc1 Binary files /dev/null and b/app/images/icon-38.png differ diff --git a/app/manifest.json b/app/manifest.json new file mode 100644 index 000000000..f053ef594 --- /dev/null +++ b/app/manifest.json @@ -0,0 +1,41 @@ +{ + "name": "__MSG_appName__", + "version": "0.0.1", + "manifest_version": 2, + "description": "__MSG_appDescription__", + "icons": { + "16": "images/icon-16.png", + "128": "images/icon-128.png" + }, + "default_locale": "en", + "background": { + "scripts": [ + "scripts/chromereload.js", + "scripts/background.js" + ] + }, + "browser_action": { + "default_icon": { + "19": "images/icon-19.png", + "38": "images/icon-38.png" + }, + "default_title": "metamask", + "default_popup": "popup.html" + }, + "content_scripts": [ + { + "matches": [ + "http://*/*", + "https://*/*" + ], + "js": [ + "scripts/contentscript.js" + ], + "run_at": "document_start", + "all_frames": false + } + ], + "web_accessible_resources": [ + "scripts/web3.js" + ] +} diff --git a/app/popup.html b/app/popup.html new file mode 100644 index 000000000..bc8b6411b --- /dev/null +++ b/app/popup.html @@ -0,0 +1,25 @@ + + + + + + + + + + + + + +

'Allo, 'Allo!

+ + + + + + + + + + + diff --git a/app/scripts/background.js b/app/scripts/background.js new file mode 100644 index 000000000..87a27d0db --- /dev/null +++ b/app/scripts/background.js @@ -0,0 +1,9 @@ +'use strict'; + +chrome.runtime.onInstalled.addListener(function (details) { + console.log('previousVersion', details.previousVersion); +}); + +chrome.browserAction.setBadgeText({text: '2'}); + +console.log('\'Allo \'Allo! Event Page for Browser Action'); diff --git a/app/scripts/chromereload.js b/app/scripts/chromereload.js new file mode 100644 index 000000000..a01466484 --- /dev/null +++ b/app/scripts/chromereload.js @@ -0,0 +1,22 @@ +'use strict'; + +// Reload client for Chrome Apps & Extensions. +// The reload client has a compatibility with livereload. +// WARNING: only supports reload command. + +var LIVERELOAD_HOST = 'localhost:'; +var LIVERELOAD_PORT = 35729; +var connection = new WebSocket('ws://' + LIVERELOAD_HOST + LIVERELOAD_PORT + '/livereload'); + +connection.onerror = function (error) { + console.log('reload connection got error:', error); +}; + +connection.onmessage = function (e) { + if (e.data) { + var data = JSON.parse(e.data); + if (data && data.command === 'reload') { + chrome.runtime.reload(); + } + } +}; diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js new file mode 100644 index 000000000..30cf50ef9 --- /dev/null +++ b/app/scripts/contentscript.js @@ -0,0 +1,8 @@ +console.log('\'Allo \'Allo! Content script') + +var scriptTag = document.createElement('script') +// TODO: add "script.js" to web_accessible_resources in manifest.json +scriptTag.src = chrome.extension.getURL('scripts/web3.js') + +// scriptTag.onload = function() { this.parentNode.removeChild(this) } +;(document.head||document.documentElement).appendChild(scriptTag) \ No newline at end of file diff --git a/app/scripts/popup.js b/app/scripts/popup.js new file mode 100644 index 000000000..815abcb42 --- /dev/null +++ b/app/scripts/popup.js @@ -0,0 +1,3 @@ +'use strict'; + +console.log('\'Allo \'Allo! Popup'); diff --git a/app/scripts/web3.js b/app/scripts/web3.js new file mode 100644 index 000000000..2bbf95ac3 --- /dev/null +++ b/app/scripts/web3.js @@ -0,0 +1,2 @@ +console.log('injecting web3....') +window.web3 = {} \ No newline at end of file diff --git a/app/styles/main.css b/app/styles/main.css new file mode 100644 index 000000000..41c133c89 --- /dev/null +++ b/app/styles/main.css @@ -0,0 +1,3 @@ +body { + padding: 20px; +} -- cgit v1.2.3