diff --git a/bindata.go.REMOVED.git-id b/bindata.go.REMOVED.git-id index f0c00ad..b7bf748 100644 --- a/bindata.go.REMOVED.git-id +++ b/bindata.go.REMOVED.git-id @@ -1 +1 @@ -34bb35db683f8a7a61bc69989052e94f30862994 \ No newline at end of file +5c9e26680d9e507e2c4fe676ac97c5785f72de79 \ No newline at end of file diff --git a/handlers.go b/handlers.go index ac698fb..f4c2024 100755 --- a/handlers.go +++ b/handlers.go @@ -83,7 +83,7 @@ func handlePageRequest(c *gin.Context) { // Destroy page if it is opened and primed if p.IsPrimedForSelfDestruct && !p.IsLocked && !p.IsEncrypted { - p.Update("*This page has now self-destructed.*\n\n" + p.Text.GetCurrent()) + p.Update("*This page has self-destructed. You can not return to it.*\n\n" + p.Text.GetCurrent()) p.Erase() } if command == "/erase" { @@ -176,7 +176,7 @@ func handlePageUpdate(c *gin.Context) { p.Save() message = "Saved" } - c.JSON(http.StatusOK, gin.H{"success": false, "message": message}) + c.JSON(http.StatusOK, gin.H{"success": true, "message": message}) } func handlePrime(c *gin.Context) { diff --git a/templates/index.tmpl b/templates/index.tmpl index 7562885..17eca06 100755 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -43,6 +43,12 @@ .success { color: #5cb85c; + font-weight: bold; + } + + .failure { + color: #d9534f; + font-weight: bold; } .pure-menu a { @@ -147,6 +153,8 @@ $('#saveEditButton').text(data.message); }, error: function(xhr, error) { + $('#saveEditButton').removeClass() + $('#saveEditButton').addClass("failure"); $('#saveEditButton').text(error); }, contentType: "application/json", @@ -171,6 +179,8 @@ $('#saveEditButton').text(data.message); }, error: function(xhr, error) { + $('#saveEditButton').removeClass() + $('#saveEditButton').addClass("failure"); $('#saveEditButton').text(error); }, contentType: "application/json", @@ -235,6 +245,8 @@ } }, error: function(xhr, error) { + $('#saveEditButton').removeClass() + $('#saveEditButton').addClass("failure"); $('#saveEditButton').text(error); }, contentType: "application/json", @@ -262,6 +274,8 @@ } }, error: function(xhr, error) { + $('#saveEditButton').removeClass(); + $('#saveEditButton').addClass("failure"); $('#saveEditButton').text(error); }, contentType: "application/json", @@ -272,7 +286,7 @@ $("#encryptPage").click(function(e) { e.preventDefault(); - var passphrase = prompt("Please enter a passphrase", ""); + var passphrase = prompt("Please enter a passphrase. Note: Encrypting will remove all previous history.", ""); if (passphrase != null) { encryptPage(passphrase); } @@ -306,8 +320,10 @@ var passphrase = prompt("Please enter a passphrase to lock", ""); if (passphrase != null) { if ($('#lockPage').text() == "Lock") { + $('#saveEditButton').removeClass(); $("#saveEditButton").text("Locking"); } else { + $('#saveEditButton').removeClass(); $("#saveEditButton").text("Unlocking"); } lockPage(passphrase); @@ -318,7 +334,7 @@ $("#clearOld").click(function(e) { e.preventDefault(); - var r = confirm("This will erase all cleared list items, are you sure you want to do that?"); + var r = confirm("This will erase all cleared list items, are you sure you want to do that? (Versions will stay in history)."); if (r == true) { clearOld() } else { @@ -383,11 +399,6 @@
  • New

  • {{ if (or (.IsLocked) (.IsEncrypted) )}} - {{ if .IsLocked }} -
  • {{ if .IsLocked }}Unlock{{ else }}Lock{{end}}
  • - {{ else }} -
  • {{ if .IsEncrypted }}Decrypt{{ else }}Encrypt{{end}}
  • - {{ end }} {{ else }}
  • {{ if .IsEncrypted }}Decrypt{{ else }}Encrypt{{end}}
  • {{ if .IsLocked }}Unlock{{ else }}Lock{{end}}
  • @@ -401,9 +412,11 @@
  • View
  • {{ if (or (.IsLocked) (.IsEncrypted) )}} {{ if .IsLocked }} -
  • Locked
  • +
  • {{ if .IsLocked }}Unlock{{ else }}Lock{{end}}
  • +
  • Locked
  • {{ else }} -
  • Encrypted
  • +
  • {{ if .IsEncrypted }}Decrypt{{ else }}Encrypt{{end}}
  • +
  • Encrypted
  • {{ end }} {{else}} {{ if .ListPage }}