1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Fix typography logic in cowyo.js

This commit is contained in:
Corbin Royer 2021-04-28 12:53:55 -08:00
parent a58f4ca346
commit 8c5c025dd1
3 changed files with 158 additions and 143 deletions

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@ import (
) )
func TestListFiles(t *testing.T) { func TestListFiles(t *testing.T) {
pathToData = "testdata" pathToData := "testdata"
os.MkdirAll(pathToData, 0755) os.MkdirAll(pathToData, 0755)
defer os.RemoveAll(pathToData) defer os.RemoveAll(pathToData)
s := Site{PathToData: pathToData} s := Site{PathToData: pathToData}
@ -34,7 +34,7 @@ func TestListFiles(t *testing.T) {
} }
func TestGeneral(t *testing.T) { func TestGeneral(t *testing.T) {
pathToData = "testdata" pathToData := "testdata"
os.MkdirAll(pathToData, 0755) os.MkdirAll(pathToData, 0755)
defer os.RemoveAll(pathToData) defer os.RemoveAll(pathToData)
s := Site{PathToData: pathToData} s := Site{PathToData: pathToData}

View File

@ -270,7 +270,13 @@ $(window).load(function() {
$("#lockPage").click(function(e) { $("#lockPage").click(function(e) {
e.preventDefault(); e.preventDefault();
var passphrase = prompt("Please enter a passphrase to lock", "");
var passphrase;
if ($('#lockPage').text() == "Lock")
passphrase = prompt("Please enter a passphrase to lock", "");
else
passphrase = prompt("Please enter a passphrase to unlock", "");
if (passphrase != null) { if (passphrase != null) {
if ($('#lockPage').text() == "Lock") { if ($('#lockPage').text() == "Lock") {
$('#saveEditButton').removeClass(); $('#saveEditButton').removeClass();