|
@@ -3517,6 +3517,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
$emailLink,
|
|
$emailLink,
|
|
|
$sendButton,
|
|
$sendButton,
|
|
|
$retryButton,
|
|
$retryButton,
|
|
|
|
|
+ $rememberButton,
|
|
|
pasteExpiration = null,
|
|
pasteExpiration = null,
|
|
|
retryButtonCallback;
|
|
retryButtonCallback;
|
|
|
|
|
|
|
@@ -3881,6 +3882,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
$cloneButton.removeClass('hidden');
|
|
$cloneButton.removeClass('hidden');
|
|
|
$rawTextButton.removeClass('hidden');
|
|
$rawTextButton.removeClass('hidden');
|
|
|
$qrCodeLink.removeClass('hidden');
|
|
$qrCodeLink.removeClass('hidden');
|
|
|
|
|
+ $rememberButton.removeClass('hidden');
|
|
|
|
|
|
|
|
viewButtonsDisplayed = true;
|
|
viewButtonsDisplayed = true;
|
|
|
};
|
|
};
|
|
@@ -3901,6 +3903,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
$newButton.addClass('hidden');
|
|
$newButton.addClass('hidden');
|
|
|
$rawTextButton.addClass('hidden');
|
|
$rawTextButton.addClass('hidden');
|
|
|
$qrCodeLink.addClass('hidden');
|
|
$qrCodeLink.addClass('hidden');
|
|
|
|
|
+ $rememberButton.addClass('hidden');
|
|
|
me.hideEmailButton();
|
|
me.hideEmailButton();
|
|
|
|
|
|
|
|
viewButtonsDisplayed = false;
|
|
viewButtonsDisplayed = false;
|
|
@@ -3966,17 +3969,6 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
createButtonsDisplayed = false;
|
|
createButtonsDisplayed = false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * only shows the "new paste" button
|
|
|
|
|
- *
|
|
|
|
|
- * @name TopNav.showNewPasteButton
|
|
|
|
|
- * @function
|
|
|
|
|
- */
|
|
|
|
|
- me.showNewPasteButton = function()
|
|
|
|
|
- {
|
|
|
|
|
- $newButton.removeClass('hidden');
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* only shows the "retry" button
|
|
* only shows the "retry" button
|
|
|
*
|
|
*
|
|
@@ -4039,17 +4031,6 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
$emailLink.off('click.sendEmail');
|
|
$emailLink.off('click.sendEmail');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * only hides the clone button
|
|
|
|
|
- *
|
|
|
|
|
- * @name TopNav.hideCloneButton
|
|
|
|
|
- * @function
|
|
|
|
|
- */
|
|
|
|
|
- me.hideCloneButton = function()
|
|
|
|
|
- {
|
|
|
|
|
- $cloneButton.addClass('hidden');
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* only hides the raw text button
|
|
* only hides the raw text button
|
|
|
*
|
|
*
|
|
@@ -4061,17 +4042,6 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
$rawTextButton.addClass('hidden');
|
|
$rawTextButton.addClass('hidden');
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * only hides the qr code button
|
|
|
|
|
- *
|
|
|
|
|
- * @name TopNav.hideQrCodeButton
|
|
|
|
|
- * @function
|
|
|
|
|
- */
|
|
|
|
|
- me.hideQrCodeButton = function()
|
|
|
|
|
- {
|
|
|
|
|
- $qrCodeLink.addClass('hidden');
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* hide all irrelevant buttons when viewing burn after reading paste
|
|
* hide all irrelevant buttons when viewing burn after reading paste
|
|
|
*
|
|
*
|
|
@@ -4080,8 +4050,8 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
*/
|
|
*/
|
|
|
me.hideBurnAfterReadingButtons = function()
|
|
me.hideBurnAfterReadingButtons = function()
|
|
|
{
|
|
{
|
|
|
- me.hideCloneButton();
|
|
|
|
|
- me.hideQrCodeButton();
|
|
|
|
|
|
|
+ $cloneButton.addClass('hidden');
|
|
|
|
|
+ $qrCodeLink.addClass('hidden');
|
|
|
me.hideEmailButton();
|
|
me.hideEmailButton();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -4321,6 +4291,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
$sendButton = $('#sendbutton');
|
|
$sendButton = $('#sendbutton');
|
|
|
$qrCodeLink = $('#qrcodelink');
|
|
$qrCodeLink = $('#qrcodelink');
|
|
|
$emailLink = $('#emaillink');
|
|
$emailLink = $('#emaillink');
|
|
|
|
|
+ $rememberButton = $('#rememberbutton');
|
|
|
|
|
|
|
|
// bootstrap template drop down
|
|
// bootstrap template drop down
|
|
|
$('#language ul.dropdown-menu li a').click(setLanguage);
|
|
$('#language ul.dropdown-menu li a').click(setLanguage);
|
|
@@ -4383,6 +4354,8 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
if (cursor) {
|
|
if (cursor) {
|
|
|
urls.push(cursor.value.url);
|
|
urls.push(cursor.value.url);
|
|
|
cursor.continue();
|
|
cursor.continue();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ me.refreshList();
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
@@ -4397,13 +4370,12 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
*/
|
|
*/
|
|
|
me.add = function(pasteUrl)
|
|
me.add = function(pasteUrl)
|
|
|
{
|
|
{
|
|
|
- urls.push(pasteUrl);
|
|
|
|
|
if (!window.indexedDB || !db) {
|
|
if (!window.indexedDB || !db) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
const url = new URL(pasteUrl);
|
|
const url = new URL(pasteUrl);
|
|
|
const memory = db.transaction('pastes', 'readwrite').objectStore('pastes');
|
|
const memory = db.transaction('pastes', 'readwrite').objectStore('pastes');
|
|
|
- memory.add({
|
|
|
|
|
|
|
+ const request = memory.add({
|
|
|
'https': url.protocol == 'https:',
|
|
'https': url.protocol == 'https:',
|
|
|
'service': url.hostname + url.pathname,
|
|
'service': url.hostname + url.pathname,
|
|
|
'pasteid': url.search.replace(/^\?+/, ''),
|
|
'pasteid': url.search.replace(/^\?+/, ''),
|
|
@@ -4412,6 +4384,10 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
// required to open the paste, like port, username and password
|
|
// required to open the paste, like port, username and password
|
|
|
'url': pasteUrl
|
|
'url': pasteUrl
|
|
|
});
|
|
});
|
|
|
|
|
+ request.onsuccess = function(e) {
|
|
|
|
|
+ urls.push(pasteUrl);
|
|
|
|
|
+ me.refreshList();
|
|
|
|
|
+ };
|
|
|
return true;
|
|
return true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -4468,16 +4444,20 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|
|
request.onsuccess = function(e) {
|
|
request.onsuccess = function(e) {
|
|
|
db = request.result;
|
|
db = request.result;
|
|
|
db.onerror = function(e) {
|
|
db.onerror = function(e) {
|
|
|
- Alert.showError(e);
|
|
|
|
|
|
|
+ Alert.showError(e.target.error.message);
|
|
|
}
|
|
}
|
|
|
updateCacheFromDb();
|
|
updateCacheFromDb();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
$('#menu-toggle').on('click', function(e) {
|
|
$('#menu-toggle').on('click', function(e) {
|
|
|
- e.preventDefault();
|
|
|
|
|
$('main').toggleClass('toggled');
|
|
$('main').toggleClass('toggled');
|
|
|
$('#menu-toggle .glyphicon').toggleClass('glyphicon glyphicon-menu-down glyphicon glyphicon-menu-up')
|
|
$('#menu-toggle .glyphicon').toggleClass('glyphicon glyphicon-menu-down glyphicon glyphicon-menu-up')
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+ $('#rememberbutton').on('click', function(e) {
|
|
|
|
|
+ me.add(window.location.href);
|
|
|
|
|
+ $('#menu-toggle').click();
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
return me;
|
|
return me;
|