mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-08-06 05:24:17 -04:00
initial memory boilerplate, move sidebar toggle into it's init, test it behaves as it should
This commit is contained in:
parent
283d85c7cf
commit
daae0d0dca
4 changed files with 85 additions and 9 deletions
|
@ -4356,6 +4356,58 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
return me;
|
||||
})(window, document);
|
||||
|
||||
/**
|
||||
* (view) Handles the memory, storing paste URLs in the browser
|
||||
*
|
||||
* @name Memory
|
||||
* @class
|
||||
*/
|
||||
const Memory = (function () {
|
||||
const me = {};
|
||||
|
||||
/**
|
||||
* adds a paste URL to the memory
|
||||
*
|
||||
* @name Memory.add
|
||||
* @function
|
||||
* @param {string} pasteUrl
|
||||
* @return {bool}
|
||||
*/
|
||||
me.add = function(pasteUrl)
|
||||
{
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* refresh the displayed list from memory
|
||||
*
|
||||
* @name Memory.refreshList
|
||||
* @function
|
||||
*/
|
||||
me.refreshList = function()
|
||||
{
|
||||
};
|
||||
|
||||
/**
|
||||
* initiate
|
||||
*
|
||||
* attaches click event to toggle memory sidepanel
|
||||
*
|
||||
* @name Memory.init
|
||||
* @function
|
||||
*/
|
||||
me.init = function()
|
||||
{
|
||||
$("#menu-toggle").on('click', function(e) {
|
||||
e.preventDefault();
|
||||
$("main").toggleClass("toggled");
|
||||
$("#menu-toggle .glyphicon").toggleClass("glyphicon glyphicon-menu-down glyphicon glyphicon-menu-up")
|
||||
});
|
||||
};
|
||||
|
||||
return me;
|
||||
})();
|
||||
|
||||
/**
|
||||
* Responsible for AJAX requests, transparently handles encryption…
|
||||
*
|
||||
|
@ -5361,13 +5413,6 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
});
|
||||
});
|
||||
|
||||
// attach memory sidebar toggle
|
||||
$("#menu-toggle").on('click', function(e) {
|
||||
e.preventDefault();
|
||||
$("#menu-toggle .glyphicon").toggleClass("glyphicon glyphicon-menu-down glyphicon glyphicon-menu-up")
|
||||
$("main").toggleClass("toggled");
|
||||
});
|
||||
|
||||
// initialize other modules/"classes"
|
||||
Alert.init();
|
||||
Model.init();
|
||||
|
@ -5379,6 +5424,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
Prompt.init();
|
||||
TopNav.init();
|
||||
UiHelper.init();
|
||||
Memory.init();
|
||||
|
||||
// check for legacy browsers before going any further
|
||||
if (!Legacy.Check.getInit()) {
|
||||
|
@ -5432,6 +5478,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
AttachmentViewer: AttachmentViewer,
|
||||
DiscussionViewer: DiscussionViewer,
|
||||
TopNav: TopNav,
|
||||
Memory: Memory,
|
||||
ServerInteraction: ServerInteraction,
|
||||
PasteEncrypter: PasteEncrypter,
|
||||
PasteDecrypter: PasteDecrypter,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue