FixBug.bjs
[gitlive] / FixBug.bjs
1 {
2     "id": "file-gtk-18",
3     "name": "FixBug",
4     "parent": "",
5     "title": false,
6     "path": "/home/alan/gitlive/gitlive/FixBug.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "destroy_event": "function (self, event) {\n     this.el.hide();\n                return false;\n}",
11                 "response": "function (self, id) {\n  // hide\n if (id < 1) {\n        this.el.hide();\n        return;\n    }\n    if (!this.get('bug').getValue().length) {\n        print(\"ERROR\");\n            return;\n        }\n \n        this.el.hide();\n        \n        var val = this.get('bug').getValue();\n        Seed.print(val);\n}"
12             },
13             "border_width": 3,
14             "default_height": 150,
15             "default_width": 600,
16             "title": "Project Properties",
17             "xtype": "Dialog",
18             "|deletable": true,
19             "|modal": true,
20             "|show": "function(c) {\n       c = c || { name : '' , xtype : '' };\n    this.project  = c;\n    if (!this.el) {\n        this.init();\n    }\n    var _this = this;\n    [ 'xtype'  ].forEach(function(k) {\n        _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);\n    });\n\t// shouild set path..\n    \n    this.el.show_all();\n    this.success = c.success;\n}\n",
21             "|xns": "Gtk",
22             "items": [
23                 {
24                     "|xns": "Gtk",
25                     "xtype": "VBox",
26                     "|pack": " function(p,e) {\n            p.el.get_content_area().add(e.el)\n        }\n",
27                     "items": [
28                         {
29                             "|xns": "Gtk",
30                             "xtype": "HBox",
31                             "pack": "pack_start,false,true,3",
32                             "items": [
33                                 {
34                                     "label": "Select Active Bug:",
35                                     "pack": "pack_start,false,true,3",
36                                     "xtype": "Label",
37                                     "|xns": "Gtk"
38                                 },
39                                 {
40                                     "id": "bug",
41                                     "pack": "pack_end,true,true,3",
42                                     "xtype": "ComboBox",
43                                     "|getValue": "function() {\n     var ix = this.el.get_active();\n            if (ix < 0 ) {\n                return '';\n            }\n            return this.get('model').data[ix].xtype;\n}\n",
44                                     "|init": "function() {\n    XObject.prototype.init.call(this);\n  this.el.add_attribute(this.items[0].el , 'markup', 1 );  \n}\n",
45                                     "|setValue": "function(v)\n                {\n                    var el = this.el;\n                    el.set_active(-1);\n                    this.get('model').data.forEach(function(n, ix) {\n                        if (v == n.xtype) {\n                            el.set_active(ix);\n                            return false;\n                        }\n                    });\n                }",
46                                     "|xns": "Gtk",
47                                     "items": [
48                                         {
49                                             "|xns": "Gtk",
50                                             "xtype": "CellRendererText",
51                                             "pack": "pack_start"
52                                         },
53                                         {
54                                             "id": "model",
55                                             "pack": "set_model",
56                                             "xtype": "ListStore",
57                                             "|init": "function() {\n    XObject.prototype.init.call(this);\n\n        this.el.set_column_types ( 2, [\n            GObject.TYPE_STRING,  // real key\n            GObject.TYPE_STRING // real type\n            \n            \n        ] );\n        var Ticket = imports.test.tickets.Ticket;\n        \n        var data = Tickets.fetchBugs(\"http://www.roojs.com/mtrack/index.php/Gitlive/web.hex\");\n/*        this.data = [\n            { xtype: 'Roo', desc : \"Roo Project\" },\n            { xtype: 'Gtk', desc : \"Gtk Project\" },    \n            //{ xtype: 'JS', desc : \"Javascript Class\" }\n        ]\n  */      \n        this.loadData(this.data);\n                                \n}\n",
58                                             "|loadData": "function (data) {\n                                            \n            var iter = new Gtk.TreeIter();\n            var el = this.el;\n            data.forEach(function(p) {\n                \n                el.append(iter);\n                \n                 \n                el.set_value(iter, 0, p.id);\n                el.set_value(iter, 1, '#' + p.id + p.name );\n                \n            });\n              \n                                     \n}\n",
59                                             "|xns": "Gtk"
60                                         }
61                                     ]
62                                 }
63                             ]
64                         }
65                     ]
66                 },
67                 {
68                     "|xns": "Gtk",
69                     "xtype": "Button",
70                     "pack": "add_action_widget,1",
71                     "label": "OK"
72                 },
73                 {
74                     "|xns": "Gtk",
75                     "xtype": "Button",
76                     "pack": "add_action_widget,0",
77                     "label": "Cancel"
78                 }
79             ]
80         }
81     ],
82     "permname": "",
83     "modOrder": "0"
84 }