diff --git a/manifest.json b/manifest.json index 1b46d65..03aff14 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "PasswordMaker", - "version": "0.2.3", + "version": "0.2.4", "description": "Generates a unique password for every site from a single master password.", "browser_action": { "default_icon": "icon16.png", diff --git a/passwordmaker-custom.js b/passwordmaker-custom.js index d26cf38..2acfc08 100644 --- a/passwordmaker-custom.js +++ b/passwordmaker-custom.js @@ -1,4 +1,5 @@ // Copyright (c) 2009 Matt Perry. All rights reserved. +// 2013 Chris Juelg: minor user experience changes // Use of this source code is governed by the LGPL that can be found in the // LICENSE file. @@ -30,9 +31,7 @@ function saveSettings() { chrome.storage.sync.set(storage); } -function initCustom() { - init(); - +function insertTabURL() { // Get the site's URL and fill in the input field. chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { if (tabs && tabs[0]) { @@ -41,8 +40,30 @@ function initCustom() { populateURL(); } }); +} + +// wrap loadProfile() and insertTabURL if none given in profile +var alias_loadProfile = loadProfile; +var loadProfile = function loadProfile() { + alias_loadProfile(); + +// don't insert if isOptions or defined in profile var isOptions = location.search.indexOf("options=true") >= 0; + if (!isOptions && (preUrl.value == undefined || preUrl.value == "")) insertTabURL(); +} + +function initCustom() { + init(); + + chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { + if (tabs && tabs[0]) { + window.contentTab = tabs[0]; + } + }); + + var isOptions = location.search.indexOf("options=true") >= 0; + if (!isOptions) insertTabURL(); var elemTable = document.getElementsByTagName('table')[0]; elemTable = elemTable.getElementsByTagName('tbody')[0]; @@ -185,6 +206,11 @@ function showOptions() { for (var i = 0; i < options.length; ++i) { options[i].style.display = 'table-row'; } + + var activateEdits = document.getElementsByClassName("activateEdit"); + for (var i = 0; i < activateEdits.length; ++i) { + activateEdits[i].style.display = 'inline'; + } } // Regenerates the password and verifier code. diff --git a/passwordmaker.crx b/passwordmaker.crx index 93c48fc..29d44cc 100644 Binary files a/passwordmaker.crx and b/passwordmaker.crx differ diff --git a/passwordmaker.html b/passwordmaker.html index a1f41aa..68c7605 100644 --- a/passwordmaker.html +++ b/passwordmaker.html @@ -126,6 +126,9 @@ option.activateEdit { font-style : italic; color : #800; + +/* display set again in showOptions() */ + display: none; } diff --git a/passwordmaker.js b/passwordmaker.js index 9ae8fa6..1cec39d 100644 --- a/passwordmaker.js +++ b/passwordmaker.js @@ -649,8 +649,8 @@ function init() { preGeneratePassword(); } populateURL(); // in case passwdUrl.value is using document.location instead of cookie value, this calculates the correct URL - passwdMaster.focus(); - initDone = true; + passwdMaster.focus(); + initDone = true; } // Loads a certain profile. diff --git a/profileList.js b/profileList.js index 21ca85a..d909be8 100644 --- a/profileList.js +++ b/profileList.js @@ -1,6 +1,6 @@ /* profileLB = new Bs_Dropdown(); - profileLB.imgDir = 'scripts/blueShoes/components/dropdown/img/win2k/'; +profileLB.imgDir = 'scripts/blueShoes/components/dropdown/img/win2k/'; profileLB.setValue('Default'); profileLB.drawInto('profileLB'); profileLB.attachEvent('onChange', loadProfile);