mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-11-08 06:28:29 +01:00
1 line
652 B
JavaScript
1 line
652 B
JavaScript
(function(){var t;t=class extends this.OS.application.BaseApplication{constructor(t){super("DBDecoder",t)}main(){var t;return t=this.find("decoder"),this.db=new this._api.DB("blogs"),t.onbtclick=t=>this.db.find("1=1").then(t=>{var e,n,r;for(e=0,n=t.length;e<n;e++)(r=t[e]).content=atob(r.content),r.rendered=atob(r.rendered);return this.saveDB(t).then(()=>this.notify("Data base saved")).catch(t=>this.error(t.toString(),t))})}saveDB(t){return new Promise((e,n)=>{var r;return 0===t.length?e():(r=t.shift(),this.db.save(r).then(()=>this.saveDB(t).then(()=>e()).catch(t=>n(__e(t)))).catch(t=>n(__e(t))))})}},this.OS.register("DBDecoder",t)}).call(this); |