diff --git a/static/cryptopad.html b/static/cryptopad.html
index ec70254..d510997 100644
--- a/static/cryptopad.html
+++ b/static/cryptopad.html
@@ -251,6 +251,18 @@
function init() {
sjcl.random.startCollectors();
+
+ $("#data").keydown(function(e) {
+ if(e.keyCode === 9) { // from http://stackoverflow.com/questions/6140632/how-to-handle-tab-in-textarea
+ var start = this.selectionStart;
+ var end = this.selectionEnd;
+
+ var $this = $(this);
+ $this.val($this.val().substring(0, start) + "\t" + $this.val().substring(end));
+ this.selectionStart = this.selectionEnd = start + 1;
+ return false;
+ }
+ });
if (!supportsStorage()) {
alert("Your browser does not have Local Storage support. Come back when you've upgraded.");
@@ -270,8 +282,17 @@
$("#localButton").click(function() {
useRemote = false;
});
-
- $("#myModal").modal({backdrop: "static", keyboard: false}); // undocumented trick to not hide the dialog
+
+ $("#myModal").modal({backdrop: "static", keyboard: false}); // undocumented trick to not hide the dialog
+
+ var crypt_key=window.location.hash.substring(1);
+
+ if (crypt_key != "") {
+ console.log("poopfuck")
+ $("#password").val(crypt_key)
+ login()
+ }
+
// set up buttons
$("#backuper").click(doBackup);