mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-05-02 14:36:08 -04:00
insert Paste class to wrap the data, to be able to extend the paste with getters and format version handling
This commit is contained in:
parent
398fabd664
commit
d73c68ad85
3 changed files with 18 additions and 3 deletions
|
@ -39,6 +39,21 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
*/
|
||||
let z;
|
||||
|
||||
/**
|
||||
* Paste class
|
||||
*
|
||||
* bundles helper fuctions around the paste formats
|
||||
*
|
||||
* @name Paste
|
||||
* @class
|
||||
*/
|
||||
function Paste(data) {
|
||||
// store all keys in the default locations for drop-in replacement
|
||||
for (let key in data) {
|
||||
this[key] = raw[key];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* static Helper methods
|
||||
*
|
||||
|
@ -4518,7 +4533,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
);
|
||||
});
|
||||
ServerInteraction.setSuccess(function (status, data) {
|
||||
PasteDecrypter.run(data);
|
||||
PasteDecrypter.run(new Paste(data));
|
||||
|
||||
// restore position
|
||||
window.scrollTo(0, orgPosition);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue