-
-
Login
-
Logout
+
+
+
+
+
+
+ Please login to Trello to use the extension. You're either logging in for the first time or your previous authentication has expired.
+
+
+ Note: A new secure browser window will open in which you'll have to login to Trello. Afterwards, you'll be asked to grant permission to this extension to create cards on your behalf - in one click :) All data is either stored locally or in your browser's cloud-synced storage (if enabled by you). Please accept in order for this extension to work!
+
+
+
+
+ Login
+
+
-
+
+
-
-
+
+
\ No newline at end of file
diff --git a/src/js/eventPage.js b/src/js/eventPage.js
index ac173f0..60ea0e9 100644
--- a/src/js/eventPage.js
+++ b/src/js/eventPage.js
@@ -205,13 +205,12 @@ chrome.contextMenus.onClicked.addListener(function(info, tab) {
// logout here if triggered in options menu
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
- if (!sender.tab) {
- // message is from extension
- if (request.deauthorize) {
- trelloApi.deauthorize();
- sendResponse({success: true})
- } else if (request.selection) {
- oneClickSendToTrello()
- }
+ if (request.deauthorize) {
+ trelloApi.deauthorize();
+ sendResponse({success: true})
+ } else if (request.selection) {
+ oneClickSendToTrello();
}
+
+ return true;
});
diff --git a/src/js/settings.js b/src/js/settings.js
index 114b176..e41a37e 100644
--- a/src/js/settings.js
+++ b/src/js/settings.js
@@ -1,5 +1,4 @@
var $listSelect, $boardSelect;
-var contentLoaded = false;
var login = function() {
if (!trelloApi.tryAuthorize()) {
@@ -13,18 +12,11 @@ var logout = function () {
chrome.runtime.sendMessage({deauthorize: true}, function(response) {
if (response.success) {
trelloApi.deauthorize();
- update_buttons();
- $('main').toggle(false);
+ location.reload();
}
});
};
-var update_buttons = function() {
- var authorized = Trello.authorized();
- $('#login').toggle(!authorized);
- $('#logout').toggle(authorized);
-};
-
var loadBoards = function (savedBoardId, savedListId) {
Trello.members.get("me/boards", function(boards) {
// success
@@ -79,26 +71,8 @@ var saveChoice = function() {
boardId: $boardSelect.children('option:selected').first().data().id,
listId: $listSelect.children('option:selected').first().data().id
});
-
- if (contentLoaded) {
- // only show "saved" when data was actually changed by the user
- // saveChoice() is executed also every time the option menu is opened
- flashSavedText();
- }
-
- contentLoaded = true;
};
-var flashSavedText = function() {
- $('#saved').stop().css('opacity', 1).fadeTo(1500, 0);
-};
-
-function getChromeVersion () {
- var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
-
- return raw ? parseInt(raw[2], 10) : false;
-}
-
var init = function(savedOptions) {
$('#login').click(login);
$('#logout').click(logout);
@@ -119,19 +93,15 @@ var init = function(savedOptions) {
});
$includeCover.change(function() {
storage.set({includeCover: $includeCover.is(":checked")});
- flashSavedText();
});
$autoClose.change(function() {
storage.set({autoClose: $autoClose.is(":checked")});
- flashSavedText();
});
$showNotification.change(function() {
storage.set({showNotification: $showNotification.is(":checked")});
- flashSavedText();
});
$selectionAsTitle.change(function() {
storage.set({selectionAsTitle: $selectionAsTitle.is(":checked")});
- flashSavedText();
})
$includeCover.prop('checked', savedOptions.includeCover).prop('disabled', false);
@@ -142,13 +112,12 @@ var init = function(savedOptions) {
$('main').toggle(true);
loadBoards(savedOptions.boardId, savedOptions.listId);
-
- if (getChromeVersion() === 78) {
- $('#chrome78warning').toggle(true);
- }
}
- update_buttons();
+ var authorized = Trello.authorized();
+ $('#optionsSection').toggle(authorized);
+ $('#logoutSection').toggle(authorized);
+ $('#loginSection').toggle(!authorized);
};
$(document).ready(function() {
diff --git a/src/js/store.js b/src/js/store.js
index 910e41e..5a69b46 100644
--- a/src/js/store.js
+++ b/src/js/store.js
@@ -1,5 +1,5 @@
var storage = {
- location: chrome.storage.local,
+ location: chrome.storage.sync,
optionNames: ['boardId', 'listId', 'autoClose', 'showNotification', 'selectionAsTitle', 'includeCover'],
defaults: {autoClose: false, showNotification: true, selectionAsTitle: true, includeCover: true},
set: function(obj, callback) {
diff --git a/src/js/trelloWrapper.js b/src/js/trelloWrapper.js
index b8af64a..4475208 100644
--- a/src/js/trelloWrapper.js
+++ b/src/js/trelloWrapper.js
@@ -14,7 +14,7 @@ var trelloApi = {
Trello.setKey(this.key);
Trello.authorize({
type: 'redirect', // options: 'popup', 'redirect'
- name: 'One-click send to Trello',
+ name: 'One-Click Trello',
persist: true,
interactive: true,
scope: {
diff --git a/src/manifest.json b/src/manifest.json
index bf2ae7f..bad85c7 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -1,8 +1,8 @@
{
"manifest_version": 2,
- "name": "One-click send to Trello",
- "description": "Save the current page with only one click on the extension button.",
- "version": "2.5",
+ "name": "One-Click Trello",
+ "description": "Instantly create a new Trello card with a link to the current page in just one click!",
+ "version": "2.6.0",
"background": {
"scripts": [
"js/lib/jquery-3.2.1.min.js",
@@ -24,10 +24,7 @@
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
- "options_ui": {
- "page": "html/settings.html",
- "chrome_style": true
- },
+ "options_page": "html/settings.html",
"permissions": [
"notifications",
"contextMenus",