antosdk-apps/Blogger/build/debug/main.js

6 lines
249 KiB
JavaScript
Raw Normal View History

2020-05-23 20:19:50 +02:00
var e;(function(){var e,t,r,n,a,i;(t=class extends this.OS.GUI.BaseApplication{constructor(e){super("Blogger",e)}main(){return this.user={},this.cvlist=this.find("cv-list"),this.cvlist.set("ontreeselect",e=>{var t;if(e)return t=e.data.item.get("data"),this.CVSectionByCID(Number(t.id))}),this.inputtags=this.find("input-tags"),this.bloglist=this.find("blog-list"),this.seclist=this.find("cv-sec-list"),this.userdb=new this._api.DB("user"),this.cvcatdb=new this._api.DB("cv_cat"),this.cvsecdb=new this._api.DB("cv_sections"),this.blogdb=new this._api.DB("blogs"),this.tabcontainer=this.find("tabcontainer"),this.tabcontainer.set("ontabselect",e=>this.fetchData(e.data.container.aid())),this.find("bt-user-save").set("onbtclick",e=>this.saveUser()),this.find("cv-cat-add").set("onbtclick",e=>this.fetchCVCat().then(e=>this.openDialog(new n,{title:__("Add category"),tree:e}).then(e=>{var t;return t={name:e.value,pid:e.p.id,publish:1},this.cvcatdb.save(t).then(e=>this.refreshCVCat()).catch(e=>this.error(__("Cannot add new category"),e))}).catch(e=>this.error(e.toString(),e))).catch(e=>this.error(__("Unable to fetch categories"),e))),this.find("cv-cat-edit").set("onbtclick",e=>{var t,r;if((r=this.cvlist.get("selectedItem"))&&(t=r.get("data")))return this.fetchCVCat().then(e=>this.openDialog(new n,{title:__("Edit category"),tree:e,cat:t}).then(e=>{var r;return r={id:t.id,publish:t.publish,pid:e.p.id,name:e.value},this.cvcatdb.save(r).then(e=>this.refreshCVCat()).catch(e=>this.error(__("Cannot Edit category"),e))})).catch(e=>this.error(__("Unable to fetch categories"),e))}),this.find("cv-cat-del").set("onbtclick",e=>{var t,r;if((r=this.cvlist.get("selectedItem"))&&(t=r.get("data")))return this.openDialog("YesNoDialog",{title:__("Delete category"),iconclass:"fa fa-question-circle",text:__("Do you really want to delete: {0}?",t.name)}).then(e=>{if(e)return this.deleteCVCat(t)}).catch(e=>this.error(e.toString(),e))}),this.find("cv-sec-add").set("onbtclick",e=>{var t,n;if(n=this.cvlist.get("selectedItem"))return(t=n.get("data"))&&"0"!==t.id?this.openDialog(new r(this),{title:__("New section entry for {0}",t.name)}).then(e=>(e.cid=Number(t.id),e.start=Number(e.start),e.end=Number(e.end),this.cvsecdb.save(e).then(e=>this.CVSectionByCID(Number(t.id))).catch(e=>this.error(__("Cannot save section: {0}",e.toString()),e)))):this.notify(__("Please select a category"))}),this.find("cv-sec-move").set("onbtclick",e=>{var t,r;return(r=this.find("cv-sec-list").get("selectedItem"))?(t=r.get("data"),this.fetchCVCat().then(e=>this.openDialog(new n,{title:__("Move to"),tree:e,selonly:!0}).then(e=>{var r;return r={id:t.id,cid:e.p.id},this.cvsecdb.save(r).then(e=>(this.CVSectionByCID(t.cid),this.find("cv-sec-list").unselect())).catch(e=>this.error(__("Cannot move section"),e))}))):this.notify(__("Please select a section to move"))}),this.find("cv-sec-edit").set("onbtclick",e=>{var t,n;return(n=this.find("cv-sec-list").get("selectedItem"))?(t=n.get("data"),this.openDialog(new r(this),{title:__("Modify section entry"),section:t}).then(e=>(e.cid=Number(t.cid),e.start=Number(e.start),e.end=Number(e.end),this.cvsecdb.save(e).then(e=>this.CVSectionByCID(Number(t.cid))).catch(e=>this.error(__("Cannot save section: {0}",e.toString()),e))))):this.notify(__("Please select a section to edit"))}),this.seclist.set("onitemclose",e=>{var t;if(e)return t=e.data.item.get("data"),console.log(t),this.openDialog("YesNoDialog",{iconclass:"fa fa-question-circle",text:__("Do you really want to delete: {0}?",t.title)}).then(r=>{if(r)return this.cvsecdb.delete(t.id).then(t=>this.seclist.remove(e.data.item)).catch(e=>this.error(__("Cannot delete the section: {0}",e.toString()),e))}),!1}),this.editor=new SimpleMDE({element:this.find("markarea"),autoDownloadFontAwesome:!1,autofocus:!0,tabSize:4,indentWithTabs:!0,toolbar:[{name:__("New"),className:"fa fa-file",action:e=>(this.bloglist.unselect(),this.clearEditor())},{name:__("Save"),className:"fa fa-save",action:e=>this.saveBlog()},"|","bold","italic","heading","|","quote","code","unordered-list","ordered-list","|","link","image","table","
2020-05-23 20:09:01 +02:00
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,s,l=o(e),u=1;u<arguments.length;u++){for(var c in r=Object(arguments[u]))a.call(r,c)&&(l[c]=r[c]);if(n){s=n(r);for(var h=0;h<s.length;h++)i.call(r,s[h])&&(l[s[h]]=r[s[h]])}}return l}},function(e,t){e.exports={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"}}},function(e,t,r){"use strict";t.a={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","":"ắ","":"ằ","":"ẵ","ǎ":"ǎ","â":"â","":"ấ","":"ầ","":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","":"ḃ","ć":"ć","č":"č","ĉ":"ĉ","ċ":"ċ","ď":"ď","":"ḋ","é":"é","è":"è","ë":"ë","":"ẽ","ē":"ē","":"ḗ","":"ḕ","ĕ":"ĕ","ě":"ě","ê":"ê","ế":"ế","":"ề","":"ễ","ė":"ė","":"ḟ","ǵ":"ǵ","":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","":"ḧ","ȟ":"ȟ","ĥ":"ĥ","":"ḣ","í":"í","ì":"ì","ï":"ï","":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","":"ḱ","ǩ":"ǩ","ĺ":"ĺ","ľ":"ľ","ḿ":"ḿ","":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","":"ṅ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","":"ṍ","":"ṏ","ȭ":"ȭ","ō":"ō","":"ṓ","":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","":"ố","":"ồ","":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","":"ṕ","":"ṗ","ŕ":"ŕ","ř":"ř","":"ṙ","ś":"ś","":"ṥ","š":"š","":"ṧ","ŝ":"ŝ","":"ṡ","":"ẗ","ť":"ť","":"ṫ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","":"ṹ","ū":"ū","":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","":"ṽ","":"ẃ","":"ẁ","":"ẅ","ŵ":"ŵ","":"ẇ","":"ẘ","":"ẍ","":"ẋ","ý":"ý","":"ỳ","ÿ":"ÿ","":"ỹ","ȳ":"ȳ","ŷ":"ŷ","":"ẏ","":"ẙ","ź":"ź","ž":"ž","":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","":"Ắ","":"Ằ","":"Ẵ","Ǎ":"Ǎ","Â":"Â","":"Ấ","":"Ầ","":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","":"Ḃ","Ć":"Ć","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ď":"Ď","":"Ḋ","É":"É","È":"È","Ë":"Ë","":"Ẽ","Ē":"Ē","":"Ḗ","":"Ḕ","Ĕ":"Ĕ","Ě":"Ě","Ê":"Ê","":"Ế","":"Ề","":"Ễ","Ė":"Ė","":"Ḟ","Ǵ":"Ǵ","":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","":"Ḣ","Í":"Í","Ì":"Ì","Ï":"Ï","":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","":"Ḱ","Ǩ":"Ǩ","Ĺ":"Ĺ","Ľ":"Ľ","":"Ḿ","":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","":"Ṅ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","":"Ṍ","":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","":"Ṓ","":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","":"Ố","":"Ồ","":"Ỗ","Ȯ":"