MWF.xApplication.process = MWF.xApplication.process || {}; MWF.xApplication.process.DictionaryDesigner = MWF.xApplication.process.DictionaryDesigner || {}; MWF.xDesktop.requireApp("process.DictionaryDesigner", "Main", null, false); MWF.xApplication.portal.DictionaryDesigner.options = { "multitask": true, "executable": false }; //MWF.xDesktop.requireApp("process.ProcessManager", "Actions.RestActions", null, false); MWF.xDesktop.requireApp("portal.DictionaryDesigner", "Dictionary", null, false); MWF.xApplication.portal.DictionaryDesigner.Main = new Class({ Extends: MWF.xApplication.process.DictionaryDesigner.Main, Implements: [Options, Events], options: { "style": "default", "name": "portal.DictionaryDesigner", "icon": "icon.png", "title": MWF.APPDD.LP.title, "appTitle": MWF.APPDD.LP.title, "id": "", "width": "1200", "height": "600", "actions": null, "category": null, "portalData": null }, onQueryLoad: function(){ this.shortcut = true; if (this.status){ this.options.application = this.status.applicationId; this.application = this.status.application || this.status.applicationId; this.options.id = this.status.id; this.setOptions(this.status.options); } if( !this.application && this.options.application ){ this.application = this.options.application; } if (!this.options.id){ this.options.desktopReload = false; this.options.title = this.options.title + "-"+MWF.APPDD.LP.newDictionary; } if (!this.actions){ this.actions = MWF.Actions.get("x_portal_assemble_designer"); this.actions.application = this.application; } this.lp = MWF.xApplication.portal.DictionaryDesigner.LP; this.addEvent("queryClose", function(e){ if (this.explorer && this.explorer.reload){ this.explorer.reload(); } }.bind(this)); }, pasteModule: function(){ if (this.shortcut) { if (MWF.clipboard.data) { if (MWF.clipboard.data.type == "dictionary") { if (this.tab.showPage) { var dictionary = this.tab.showPage.dictionary; if (dictionary) { if (dictionary.currentSelectedItem) { var item = dictionary.currentSelectedItem; var key = MWF.clipboard.data.data.key; var value = (typeOf(MWF.clipboard.data.data.value)=="object") ? Object.clone(MWF.clipboard.data.data.value) : MWF.clipboard.data.data.value; var level = item.level; var parent = item; var nextSibling = null; if (!item.parent){//top level level = 1; }else{ if (item.type!="array" && item.type!="object"){ parent = item.parent; nextSibling = item; }else{ if (item.exp){ level = item.level+1; }else{ parent = item.parent; nextSibling = item; } } } var idx = parent.children.length; if (item.type=="array"){ if (nextSibling){ key = nextSibling.key; parent.value.splice(nextSibling.key, 0, value); for (var i=nextSibling.key; i