Skip to content

Commit

Permalink
Merge pull request #103 from Sav22999/beta
Browse files Browse the repository at this point in the history
4.0.1.5
  • Loading branch information
Sav22999 authored Jun 6, 2024
2 parents 3e885ca + a3bd987 commit bf98a5f
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 23 deletions.
6 changes: 3 additions & 3 deletions js/definitions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions js/inject/sticky-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ function getCSS(notes, x = "10px", y = "10px", w = "200px", h = "300px", opacity
margin: 0px !important;
box-sizing: border-box !important;
border-radius: 10px;
/*border-bottom-right-radius: 0px;*/
cursor: default;
box-shadow: 0px 0px 5px rgba(255,98,0,0.27);
font-family: inherit;
Expand Down Expand Up @@ -778,7 +777,7 @@ function getCSS(notes, x = "10px", y = "10px", w = "200px", h = "300px", opacity
right: 0px;
}
#commands-container--sticky-notes-notefox-addon:hover, #commands-container--sticky-notes-notefox-addon:hover * {
#commands-container--sticky-notes-notefox-addon:hover, #commands-container--sticky-notes-notefox-addon:hover *, #commands-container--sticky-notes-notefox-addon:active, #commands-container--sticky-notes-notefox-addon:active * {
visibility: visible !important;
}
Expand Down
6 changes: 3 additions & 3 deletions js/languages/en-UK/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,15 @@ strings[lang] = {
"notefox-account-button-settings-synced": "Synced",
"notefox-account-button-settings-sync-failed": "Sync failed",
"notefox-account-settings-sync-text": "Automatic syncing with your Notefox account is enabled because you are signed in. You can also force sync manually by clicking the <span {{parameters}}>Sync now</span> button.",
"notefox-account-settings-logout-text": "You can logout from the Notefox account. If you logout, the add-on will stop syncing your data.",
"notefox-account-settings-logout-all-devices-text": "You can log out from <b>all devices</b> where you are logged in with this account. If you logout, the add-on will stop syncing your data.",
"notefox-account-settings-logout-text": "You can logout from the Notefox account. If you logout, the add-on will stop syncing your data and your local data will be deleted.",
"notefox-account-settings-logout-all-devices-text": "You can log out from <b>all devices</b> where you are logged in with this account. If you logout, the add-on will stop syncing your data and your local data will be deleted.",
"notefox-account-settings-change-password-text": "You can change the password of your Notefox account: this will cause the logout from all devices where you are logged in, except the current one.",
"notefox-account-settings-delete-data-text": "You can delete permanently all data saved with the Notefox account. If you delete data, you can't recover it in any way.",
"notefox-account-label-last-sync-text": "Last sync: <span {{parameters}}>{{last-sync}}</span>",
"notefox-account-button-settings-login-or-signup": "Login or Sign up",
"notefox-account-button-settings-change-password": "Change password",
"notefox-account-button-settings-password-changed": "Password changed successfully.",
"notefox-account-settings-delete-text": "If you delete your Notefox account, all data saved with the account will be deleted at all. The process can't be stopped once started and you can't recover the data once deleted.",
"notefox-account-settings-delete-text": "If you delete your Notefox account, all data saved with the account will be deleted at all – and also local data will be deleted. The process can't be stopped once started and you can't recover the data once deleted.",
"notefox-account-button-settings-account-deleted": "Account permanently deleted.",
"notefox-account-deleting-account-text": "Sending request to delete account…",
"notefox-account-button-settings-last-sync": "Last sync: {{date_time}}",
Expand Down
39 changes: 25 additions & 14 deletions js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ function exportToFile() {
document.getElementById("export-to-file-button").value = all_strings["exported-notes-to-file-button"];
}

function notefoxAccountLoginSignupManage(action = null, data = null) {
function notefoxAccountLoginSignupManage(action = null, data = null, firstTime = false) {
showBackgroundOpacity();

var elements = document.getElementsByClassName("button-close-notefox-account");
Expand Down Expand Up @@ -1296,6 +1296,10 @@ function notefoxAccountLoginSignupManage(action = null, data = null) {

//console.log(savedData["notefox-account"]);

if (firstTime) {
browser.runtime.sendMessage({"sync-now": true});
}

let managing_account = false;
if ((action === null || action === "manage") && savedData["notefox-account"] !== undefined && savedData["notefox-account"] !== {}) {
if (savedData["notefox-account"] !== undefined && savedData["notefox-account"] !== {} && savedData["notefox-account"]["expiry"] !== undefined) {
Expand Down Expand Up @@ -1369,10 +1373,6 @@ function notefoxAccountLoginSignupManage(action = null, data = null) {
"login-id": savedData["notefox-account"]["login-id"]
}
});
browser.storage.sync.remove("notefox-account").then(result => {
notefoxAccountLoginSignupManage();
});
location.reload();
}

document.getElementById("manage-logout-all-devices").onclick = function () {
Expand All @@ -1383,10 +1383,6 @@ function notefoxAccountLoginSignupManage(action = null, data = null) {
"login-id": savedData["notefox-account"]["login-id"]
}
});
browser.storage.sync.remove("notefox-account").then(result => {
notefoxAccountLoginSignupManage();
});
location.reload();
}

document.getElementById("manage-delete-account-button").onclick = function () {
Expand Down Expand Up @@ -1707,6 +1703,12 @@ function notefoxAccountLoginSignupManage(action = null, data = null) {
delete_submit_element.disabled = true;
cancel_element.disabled = true;
disableAside = true;

browser.storage.sync.remove("notefox-account").then(result => {
browser.storage.local.remove(["last-sync", "last-update", "opened-by-shortcut", "settings", "sticky-notes", "websites"]).then(result => {
notefoxAccountLoginSignupManage();
});
});
}
}
} else if (action === "delete-verify") {
Expand Down Expand Up @@ -2395,10 +2397,9 @@ function loginVerifyResponse(data) {
if (data !== undefined && data.code !== undefined && data.status !== undefined) {
if (data.code === 200) {
//Success
notefoxAccountLoginSignupManage("manage", data["data"]);
location.reload();
notefoxAccountLoginSignupManage("manage", data["data"], firstTime = true);

browser.runtime.sendMessage({"sync-now": true});
//location.reload();
} else if (data.code === 400 || data.code === 401) {
//Error
showMessageNotefoxAccount(all_strings["notefox-account-message-error-" + data.code], true);
Expand All @@ -2422,7 +2423,11 @@ function logoutResponse(data) {
if (data !== undefined && data.code !== undefined && data.status !== undefined) {
if (data.code === 200) {
//Success
notefoxAccountLoginSignupManage("login");
browser.storage.sync.remove("notefox-account").then(result => {
browser.storage.local.remove(["last-sync", "last-update", "opened-by-shortcut", "settings", "sticky-notes", "websites"]).then(result => {
notefoxAccountLoginSignupManage("login");
});
});
} else if (data.code === 400 || data.code === 401) {
//Error
showMessageNotefoxAccount(all_strings["notefox-account-message-error-" + data.code], true);
Expand All @@ -2442,7 +2447,11 @@ function logoutAllResponse(data) {
if (data !== undefined && data.code !== undefined && data.status !== undefined) {
if (data.code === 200) {
//Success
notefoxAccountLoginSignupManage("login");
browser.storage.sync.remove("notefox-account").then(result => {
browser.storage.local.remove(["last-sync", "last-update", "opened-by-shortcut", "settings", "sticky-notes", "websites"]).then(result => {
notefoxAccountLoginSignupManage("login");
});
});
} else if (data.code === 400 || data.code === 401) {
//Error
showMessageNotefoxAccount(all_strings["notefox-account-message-error-" + data.code], true);
Expand Down Expand Up @@ -2552,6 +2561,8 @@ function deleteVerifyResponse(data) {
//Success

browser.storage.sync.remove("notefox-account").then(result => {
browser.storage.local.remove(["last-sync", "last-update", "opened-by-shortcut", "settings", "sticky-notes", "websites"]).then(result => {
});
});

document.getElementById("notefox-account-settings-button").value = all_strings["notefox-account-button-settings-login-or-signup"];
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Notefox: Websites notes",
"author": "Saverio Morelli (Sav22999)",
"version": "4.0.1.4",
"version": "4.0.1.5",
"description": "Take notes on every website in a smart and simple way!",
"icons": {
"16": "./img/icon.svg",
Expand Down
Binary file modified screenshots/4.0/2.afphoto
Binary file not shown.
Binary file modified screenshots/4.0/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bf98a5f

Please sign in to comment.