mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-09-16 09:06:39 +02:00
6 lines
248 KiB
JavaScript
6 lines
248 KiB
JavaScript
|
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"),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","horizontal-rule",{name:"ima
|
||
|
/*
|
||
|
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={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","č":"č","ĉ":"ĉ","ċ":"ċ","ď":"ď","ḋ":"ḋ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ĺ":"ĺ","ľ":"ľ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ď":"Ď","Ḋ":"Ḋ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ĺ":"Ĺ","Ľ":"Ľ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"
|