{ "name" : "Pman.Tab.MTrackMerger", "parent" : "Pman.Tab.MTrack", "title" : "Pman.Tab.MTrackMerger", "path" : "/home/alan/gitlive/Pman.MTrack/Pman.Tab.MTrackMerger.bjs", "permname" : "", "modOrder" : "400", "strings" : { "cd23e6cc0233eef073cbed0cfebcd6a1" : "Create Commit Using Patch", "f29ddbfb905eb2593fdcdfb243f9af85" : "Added", "66717bf2b8235cc94a52d5b815d57a54" : "Review Changes", "06f5aa315f44a2147bab17980d1f6570" : "Merge Commits", "c671c787b49f50a3ace9fdc5bd597825" : "core_enum", "93f07b720ebf7d1246512569761a5804" : "Removed", "4d1c8263ba1036754f8db14a98f9f006" : "Reload", "21bcad367951f7c2e761f744423161b6" : "Create Commit Using Merge", "e63695c4dea40eefb2ef481c7b242192" : "All Changes", "0b27918290ff5323bea1e3b78a9cf04e" : "File" }, "items" : [ { "listeners" : { "activate" : "function (_self)\n{\n try {\n var t = _this.tree.tree;\n t.loader.load(t.root);\n } catch(e) {}\n}" }, "background" : true, "region" : "center", "title" : "Merge Commits", "xtype" : "NestedLayoutPanel", "$ xns" : "Roo", "items" : [ { "xtype" : "BorderLayout", "$ xns" : "Roo", "* prop" : "layout", "items" : [ { "xtype" : "LayoutRegion", "width" : 200, "$ xns" : "Roo", "split" : true, "* prop" : "west" }, { "xtype" : "LayoutRegion", "$ xns" : "Roo", "* prop" : "center" }, { "xtype" : "LayoutRegion", "$ xns" : "Roo", "split" : true, "* prop" : "south", "height" : 200, "titlebar" : true }, { "listeners" : { "render" : "function (_self)\n{\n _this.tree = _self;\n}" }, "autoScroll" : true, "region" : "west", "fitToFrame" : true, "xtype" : "TreePanel", "$ xns" : "Roo", "items" : [ { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "listeners" : { "click" : "function (_self, e)\n{\n var t = _this.tree.tree;\n t.loader.load(t.root);\n}" }, "text" : "Reload", "xtype" : "Button", "$ xns" : "Roo.Toolbar" } ] }, { "listeners" : { "click" : "function (node, e)\n{\n\n _this.grid.ds.load.defer(100, _this.grid.ds, [ {} ]);\n}" }, "xtype" : "TreePanel", "$ xns" : "Roo.tree", "* prop" : "tree", "items" : [ { "listeners" : { "loadexception" : "function (This, node, response)\n{\n _this.tree.el.unmask();\n}", "beforeload" : "function (This, node, callback)\n{\n _this.tree.el.mask(\"Loading\");\n}", "load" : "function (This, node, response)\n{\n _this.tree.el.unmask();\n _this.tree.tree.root.expand(false,true);\n}" }, "$ baseParams" : "{ _tree : 1 }", "root" : "data", "xtype" : "TreeLoader", "requestMethod" : "GET", "$ xns" : "Roo.tree", "* prop" : "loader", "$ dataUrl" : "baseURL + '/MTrack/Merger'" }, { "text" : "All Changes", "xtype" : "TreeNode", "$ xns" : "Roo.tree", "* prop" : "root" } ] } ] }, { "listeners" : { "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n //_this.grid.footer.onClick('first');\n }\n}" }, "background" : true, "region" : "center", "fitToframe" : true, "title" : "core_enum", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "core_enum", "items" : [ { "listeners" : { "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) { return; }\n _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n _this.grid.footer.onClick('first');\n }); \n}\n", "|render" : "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n //this.footer.onClick('first');\n }\n}" }, "autoExpandColumn" : "etype", "xtype" : "Grid", "loadMask" : true, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "listeners" : { "beforeload" : "function (_self, options)\n{\n if (!_this.tree.tree.selModel.getSelectedNode()) {\n return false;\n }\n \n options.params = { \n _changedFiles : _this.tree.tree.selModel.getSelectedNode().attributes.rev\n };\n}", "load" : "function (_self, records, options)\n{\n // clear selections??\n _this.preview.load({\n method : 'POST',\n url : baseURL + '/MTrack/Merger',\n params : {\n _preview : _this.tree.tree.selModel.getSelectedNode().attributes.rev\n }\n });\n \n\n}" }, "xtype" : "Store", "remoteSort" : false, "$ sortInfo" : "{ field: 'filename', dir : 'ASC' }", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/MTrack/Merger.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'filename',\n 'type': 'string'\n },\n {\n 'name': 'added',\n 'type': 'int'\n },\n {\n 'name': 'removed',\n 'type': 'int'\n }\n\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] }, { "listeners" : { "afterselectionchange" : "function (_self)\n{\n var ar = this.getSelections();\n if (!ar.length) {\n // show whole change.\n _this.preview.load({\n method : 'POST',\n url : baseURL + '/MTrack/Merger',\n params : {\n _preview : _this.tree.tree.selModel.getSelectedNode().attributes.rev\n }\n });\n return;\n }\n var files = [];\n Roo.each(ar, function(s) {\n files.push(s.data.filename);\n \n });\n _this.preview.load({\n method : 'POST',\n url : baseURL + '/MTrack/Merger',\n params : {\n _preview : _this.tree.tree.selModel.getSelectedNode().attributes.rev,\n files: Roo.encode(files)\n }\n }); \n \n \n}" }, "xtype" : "RowSelectionModel", "singleSelect" : false, "$ xns" : "Roo.grid", "* prop" : "sm" }, { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "listeners" : { "|click" : "function()\n{\n // if we are just copying a simple commit accross with a valid message\n // then this could contain the original commit message..\n if (! _this.tree.tree.selModel.getSelectedNode()) {\n Roo.MessageBox.alert(\"Error\", \"select a revision\");\n return ;\n }\n var ar = _this.grid.sm.getSelections();\n var files = [];\n Roo.each(ar, function(s) {\n files.push(s.data.filename);\n \n });\n \n if (!files.length) {\n Roo.MessageBox.alert(\"Error\", \"select some files\");\n return ;\n }\n \n\n Roo.MessageBox.show({\n title: \"Create a Commit\",\n msg: \"Enter commit message\",\n width:300,\n buttons: Roo.MessageBox.OKCANCEL,\n multiline: true,\n fn: function(btn, msg) {\n\n if (btn != 'ok') {\n return;\n }\n new Pman.Request({\n method : 'POST',\n url : baseURL + '/MTrack/Merger',\n params : { \n message : msg,\n _merge : _this.tree.tree.selModel.getSelectedNode().attributes.rev,\n files : Roo.encode(files)\n },\n success : function () {\n // reload the grid..\n _this.grid.ds.load({});\n }\n });\n },\n animEl: this.el\n });\n}\n" }, "text" : "Create Commit Using Patch", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "|click" : "function()\n{\n // if we are just copying a simple commit accross with a valid message\n // then this could contain the original commit message..\n if (! _this.tree.tree.selModel.getSelectedNode()) {\n Roo.MessageBox.alert(\"Error\", \"select a revision\");\n return ;\n }\n \n \n\n Roo.MessageBox.show({\n title: \"Create a Commit\",\n msg: \"Enter commit message\",\n width:300,\n buttons: Roo.MessageBox.OKCANCEL,\n multiline: true,\n fn: function(btn, msg) {\n\n if (btn != 'ok') {\n return;\n }\n new Pman.Request({\n method : 'POST',\n url : baseURL + '/MTrack/Merger',\n params : { \n message : msg,\n _merge : _this.tree.tree.selModel.getSelectedNode().attributes.rev,\n files : '_all_' \n },\n success : function () {\n // reload the grid..\n var t = _this.tree.tree;\n t.loader.load(t.root);\n }\n });\n },\n animEl: this.el\n });\n}\n" }, "text" : "Create Commit Using Merge", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'", "$ xns" : "Roo.Toolbar" } ] }, { "xtype" : "ColumnModel", "header" : "File", "width" : 200, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "filename" }, { "xtype" : "ColumnModel", "header" : "Added", "width" : 50, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "added" }, { "xtype" : "ColumnModel", "header" : "Removed", "width" : 50, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "removed" } ] } ] }, { "listeners" : { "render" : "function (_self)\n{\n _this.preview = _self;\n}" }, "autoScroll" : true, "region" : "south", "fitToFrame" : true, "title" : "Review Changes", "xtype" : "ContentPanel", "$ xns" : "Roo" } ] } ] } ] }