From 10806dadacde148d335aaa70f8f61f654b598d84 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 9 Jun 2012 17:18:04 -0400 Subject: [PATCH] Switch to a main() funciton --- core.html | 11 +---------- core.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/core.html b/core.html index 2bd9534..8603e00 100644 --- a/core.html +++ b/core.html @@ -4,13 +4,7 @@ Skeleton Key - + @@ -46,8 +40,5 @@
- diff --git a/core.js b/core.js index 8363756..54a8f8a 100644 --- a/core.js +++ b/core.js @@ -19,6 +19,18 @@ * DEALINGS IN THE SOFTWARE. */ +(function main() { + if (typeof chrome !== 'undefined') { + // TODO: load the extension JS + } else { + // TODO: load the hosted JS + } + + document.addEventListener('DOMContentLoaded', function() { + var controller = new SkeletonKey(document); + }); +})(); + /** * SkeletonKey is view controller for generating secure passwords. * @@ -72,6 +84,8 @@ SkeletonKey.prototype._onGenerate = function(e) { var hexString = key.toString(); hexString = this._capitalizeKey(hexString); this._password.value = hexString; + this._password.focus(); + this._password.select(); }; /** -- 2.22.5