diff --git a/index.html b/index.html
index 8462253..7c8a0f3 100644
--- a/index.html
+++ b/index.html
@@ -22,13 +22,6 @@
diff --git a/main.js b/main.js
index 6d73cf8..ce7a6cc 100644
--- a/main.js
+++ b/main.js
@@ -15,7 +15,8 @@ var defaultsettings =
titlebydefault: false,
linksinnewtab: true,
colors: true,
- bulletrendering: "•"
+ bulletrendering: "•",
+ password: ""
};
//builtin
@@ -128,10 +129,6 @@ var commands = [
action: searchtags,
shortcut: "ctrl+shift+T"
},
-{
- hint: "Log out",
- action: logout,
-},
{
hint: "Toggle split view",
action: togglesplit
@@ -993,15 +990,6 @@ function isremote()
return currentvault == "remote";
}
-function logout()
-{
- if (isremote())
- {
- window.localStorage.removeItem("password");
- togglepassword();
- }
-}
-
function tagslist()
{
tags = {};
@@ -1340,7 +1328,12 @@ function init()
window.localStorage.setItem("remote", JSON.stringify(data));
loadstorage();
})
- .catch(remotecallfailed);
+ .catch(err =>
+ {
+ settings.password = prompt("Password: ", settings.password);
+ savesettings();
+ init();
+ });
}
else
{
@@ -1367,15 +1360,6 @@ function init()
}
}
-function togglepassword()
-{
- password.value = "";
- authentpage.hidden = false;
- notepage.style.display = "none";
- document.title = "notes";
- password.focus();
-}
-
function cvdt(text)
{
var day = text.substr(0,8);
@@ -1445,7 +1429,7 @@ function queryremote(params)
stat.cur.q++;
stat.ses.q++;
- params.password = window.localStorage.getItem("password");
+ params.password = settings.password;
var paramlist = [];
for (var i in params)
@@ -1484,8 +1468,7 @@ function queryremote(params)
{
if (data.error == "authent")
{
- failed();
- togglepassword();
+ failed("Authent failed");
}
else
{
@@ -1498,7 +1481,6 @@ function queryremote(params)
}
else
{
- authentpage.hidden = true;
notepage.style.display = "table";
apply(data);
}
@@ -2846,16 +2828,6 @@ function loadnote(name)
}
}
-function sendpassword()
-{
- if (!authentpage.hidden && (event.type == "blur" || event.key == "Enter"))
- {
- event.preventDefault();
- window.localStorage.setItem("password", password.value);
- init();
- }
-}
-
function focuseditor()
{
if (document.documentElement == event.srcElement)
diff --git a/style.css b/style.css
index 53249af..63d5dc4 100644
--- a/style.css
+++ b/style.css
@@ -131,11 +131,4 @@ body::-webkit-scrollbar-thumb {
cursor: pointer;
background-color: darkgray;
margin: 2px 2px 2px 2px;
-}
-
-/* authent */
-
-#bigtitle {
- font-size: 50px;
- line-height: 100%;
}
\ No newline at end of file