diff --git a/manifest.json b/manifest.json index 7e7d8cd..727efdc 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "name": "VSTS GO", "short_name": "VSTS GO", "description": "This extension will send you to a specific workitem in your VSTS, given the id", - "version": "1.5", + "version": "1.5.2", "icons": { "128": "VSTS-GO.png" }, diff --git a/options.js b/options.js index 5a77d03..45db1eb 100644 --- a/options.js +++ b/options.js @@ -16,7 +16,7 @@ function save_options() { userCollection: inCollection.value }, function() { // Update status to let user know options were saved. - txtStatus.textContent = '> Options saved!'; + txtStatus.textContent = '> Options saved, you are good to GO!'; // reset status message setTimeout(function() { txtStatus.textContent = ''; @@ -56,9 +56,21 @@ function restoreOptions() { }); } +function focusInAccessToken(){ + if(inAccessToken.value=='') + inAccessToken.value=''; +} + +function blurInAccessToken(){ + if(inAccessToken.value=='') + inAccessToken.value=''; +} + function whenPageHasLoaded() { btnSave.addEventListener('click', save_options); + inAccessToken.addEventListener('focus', focusInAccessToken); + inAccessToken.addEventListener('blur', blurInAccessToken); restoreOptions(); } diff --git a/popup.js b/popup.js index 090275a..d79c138 100644 --- a/popup.js +++ b/popup.js @@ -1,18 +1,27 @@ var accesstoken; var domain; var collection; -var analyticsId = 'UA-102907431-1'; -var analyticsService = 'vsts-go'; -var vstsApiVersion = "?api-version=3.0"; -var vstsApiUrl = "_apis/wit/workItems/"; + var err = new errMsg(); var recentItems = []; +var settings = { + + analytics:{ + id: 'UA-102907431-1', + service: 'vsts-go' + }, + vsts:{ + apiVersion: 'api-version=3.0', + apiUrl: '_apis/wit/workItems', + } +} + //----------------Chrome Platform Analytics------------------------ // https://github.com/GoogleChrome/chrome-platform-analytics/wiki -var service = analytics.getService(analyticsService); -var tracker = service.getTracker(analyticsId); +var service = analytics.getService(settings.analytics.service); +var tracker = service.getTracker(settings.analytics.id); tracker.sendAppView('MainView'); //----------------Chrome Platform Analytics------------------------- @@ -81,7 +90,11 @@ function showRecentItems(){ } function formVstsApiUrl(wId){ - var fullVstsApiUrl = domain+"/"+collection+"/"+vstsApiUrl+wId+vstsApiVersion; + var fullVstsApiUrl = domain + + "/" + collection + + "/" + settings.vsts.apiUrl + + "/" + wId + + "?" +settings.vsts.apiVersion; return fullVstsApiUrl; } @@ -115,9 +128,9 @@ function getAccountName(strDomainUrl){ } //If the url doesn't contain a '.', return the URL return strDomainUrl; - } + function idIsValid(id){ if(id && id>1 && id<999999999){ return true;