|
@@ -1118,6 +1118,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
|
|
|
var deleteUrl = controller.scriptLocation() + '?pasteid=' + data.id + '&deletetoken=' + data.deletetoken;
|
|
var deleteUrl = controller.scriptLocation() + '?pasteid=' + data.id + '&deletetoken=' + data.deletetoken;
|
|
|
controller.showStatus('');
|
|
controller.showStatus('');
|
|
|
controller.errorMessage.addClass('hidden');
|
|
controller.errorMessage.addClass('hidden');
|
|
|
|
|
+ history.pushState({type: 'newpaste'}, '', url);
|
|
|
|
|
|
|
|
$('#pastelink').html(
|
|
$('#pastelink').html(
|
|
|
i18n._(
|
|
i18n._(
|
|
@@ -1152,6 +1153,26 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * handle history (pop) state changes
|
|
|
|
|
+ *
|
|
|
|
|
+ * currently this does only handle redirects to the home page.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @name controller.historyChange
|
|
|
|
|
+ * @function
|
|
|
|
|
+ * @param {Event} event
|
|
|
|
|
+ */
|
|
|
|
|
+ historyChange: function(event)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (event.originalEvent.state === null && // no state object passed
|
|
|
|
|
+ this.scriptLocation() === event.originalEvent.target.location.href && // target location is home page
|
|
|
|
|
+ this.scriptLocation() === window.location.href // and we are not already on the home page
|
|
|
|
|
+ ) {
|
|
|
|
|
+ // redirect to home page
|
|
|
|
|
+ window.location.href = this.scriptLocation();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* check if a URL shortener was defined and create HTML containing a link to it
|
|
* check if a URL shortener was defined and create HTML containing a link to it
|
|
|
*
|
|
*
|
|
@@ -1619,6 +1640,8 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
|
|
|
this.passwordModal.on('shown.bs.modal', $.proxy(this.passwordDecrypt.focus, this));
|
|
this.passwordModal.on('shown.bs.modal', $.proxy(this.passwordDecrypt.focus, this));
|
|
|
this.passwordModal.on('hidden.bs.modal', $.proxy(this.decryptPasswordModal, this));
|
|
this.passwordModal.on('hidden.bs.modal', $.proxy(this.decryptPasswordModal, this));
|
|
|
this.passwordForm.submit($.proxy(this.submitPasswordModal, this));
|
|
this.passwordForm.submit($.proxy(this.submitPasswordModal, this));
|
|
|
|
|
+
|
|
|
|
|
+ $(window).on('popstate', $.proxy(this.historyChange, this));
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|