-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path18-es5.cffe488d4e6f9c389fd2.js
More file actions
1 lines (1 loc) · 4.79 KB
/
18-es5.cffe488d4e6f9c389fd2.js
File metadata and controls
1 lines (1 loc) · 4.79 KB
1
function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{plTs:function(e,t,n){"use strict";n.r(t),n.d(t,"NotepadPageModule",(function(){return p}));var o,r,i,a=n("ofXK"),s=n("3Pt+"),c=n("TEn/"),l=n("tyNb"),u=n("mrSG"),f=n("fXoL"),d=n("e8h1"),b=[{path:"",component:(o=function(){function e(t,n,o,r){_classCallCheck(this,e),this.storage=t,this.alertController=n,this.toastController=o,this.platform=r,this.textvalue=""}return _createClass(e,[{key:"ngOnInit",value:function(){var e=this;this.platform.ready().then((function(){e.getAll()}))}},{key:"getAll",value:function(){var e=this;this.storage.get("notepad").then((function(t){t&&(e.textvalue=t.text,e.timestamp=t.time)}),(function(e){return console.error(e)}))}},{key:"save",value:function(){var e=new Date;this.timestamp=e.toLocaleString("en-US",{weekday:"short",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}),this.storage.set("notepad",{time:this.timestamp,text:this.textvalue}).then((function(){return console.log("Stored item!")}),(function(e){return console.error("Error storing item",e)}))}},{key:"restore",value:function(){this.getAll(),this.presentToast("The last saved text has been restored.")}},{key:"presentConfirm",value:function(){return Object(u.a)(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.alertController.create({header:"Confirm",message:"Replace the old text with the new one?",buttons:[{text:"No",role:"cancel",handler:function(){console.log("Cancel clicked")}},{text:"Yes, Save",handler:function(){console.log("Ok clicked"),n.save(),n.presentToast("Saved successfully!")}}]}),e.next=3,t;case 3:e.sent.present();case 4:case"end":return e.stop()}}),e,this)})))}},{key:"confirmClear",value:function(){return Object(u.a)(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.alertController.create({header:"Confirm",message:"Clear all the text?",buttons:[{text:"No",role:"cancel",handler:function(){}},{text:"Yes",handler:function(){n.textvalue=""}}]}),e.next=3,t;case 3:e.sent.present();case 4:case"end":return e.stop()}}),e,this)})))}},{key:"presentToast",value:function(e){return Object(u.a)(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.toastController.create({message:e,duration:2e3,keyboardClose:!0});case 2:t.sent.present();case 3:case"end":return t.stop()}}),t,this)})))}}]),e}(),o.\u0275fac=function(e){return new(e||o)(f.Jb(d.b),f.Jb(c.a),f.Jb(c.K),f.Jb(c.G))},o.\u0275cmp=f.Db({type:o,selectors:[["app-notepad"]],decls:20,vars:2,consts:[["slot","start","defaultHref","/home"],["slot","end"],[3,"click"],["slot","icon-only","name","backspace"],["slot","icon-only","name","refresh"],["slot","icon-only","name","save",1,"rotate-icon"],[1,"ion-padding"],[2,"height","100%"],["placeholder","Write, O friend...","autofocus","true","width","100%","rows","25",1,"ion-no-padding",3,"ngModel","ngModelChange"],[1,"ion-padding",2,"border-top","1px solid rgb(163, 161, 161)","padding","0 5px 0 5px"]],template:function(e,t){1&e&&(f.Mb(0,"ion-header"),f.Mb(1,"ion-toolbar"),f.Kb(2,"ion-back-button",0),f.Mb(3,"ion-title"),f.fc(4," Notepad "),f.Lb(),f.Mb(5,"ion-buttons",1),f.Mb(6,"ion-button",2),f.Ub("click",(function(){return t.confirmClear()})),f.Kb(7,"ion-icon",3),f.Lb(),f.Mb(8,"ion-button",2),f.Ub("click",(function(){return t.restore()})),f.Kb(9,"ion-icon",4),f.Lb(),f.Mb(10,"ion-button",2),f.Ub("click",(function(){return t.presentConfirm()})),f.Kb(11,"ion-icon",5),f.Lb(),f.Lb(),f.Lb(),f.Lb(),f.Mb(12,"ion-content",6),f.Mb(13,"div",7),f.Mb(14,"ion-textarea",8),f.Ub("ngModelChange",(function(e){return t.textvalue=e})),f.Lb(),f.Lb(),f.Lb(),f.Mb(15,"ion-footer",9),f.Mb(16,"small"),f.fc(17,"Last Saved: "),f.Mb(18,"ion-label"),f.fc(19),f.Lb(),f.Lb(),f.Lb()),2&e&&(f.zb(14),f.Zb("ngModel",t.textvalue),f.zb(5),f.hc(" ",t.timestamp," "))},directives:[c.p,c.D,c.c,c.d,c.C,c.f,c.e,c.q,c.m,c.B,c.J,s.d,s.e,c.n,c.t],styles:[""]}),o)}],h=((i=function e(){_classCallCheck(this,e)}).\u0275mod=f.Hb({type:i}),i.\u0275inj=f.Gb({factory:function(e){return new(e||i)},imports:[[l.i.forChild(b)],l.i]}),i),p=((r=function e(){_classCallCheck(this,e)}).\u0275mod=f.Hb({type:r}),r.\u0275inj=f.Gb({factory:function(e){return new(e||r)},imports:[[a.b,s.a,c.E,h]]}),r)}}]);