"items": [
{
"listeners": {
- "key_release_event": "function (self, event) {\n print(JSON.stringify(event,null,4)); //.keyval);\n return true;\n}"
+ "key_release_event": "function (self, event) {\n if (event.key.keyval == Gdk.KEY_Return) {;\n // same code as button press..\n var active_id = this.get('/project-select').el.get_active();\n \n var project_id = this.get('/project-select').raw_data[active_id].id;\n \n var str = this.get('/search-entry').el.get_text();\n \n print(str);\n \n var _t = this;\n \n imports.Tasks.Tasks.query({\n project_id : project_id,\n 'query[filter]' : 'me',\n 'query[search]' : str\n }, function(res) { \n // print(JSON.stringify(res,null,4));\n _t.get('/ticket-store').loadData(res);\n });\n }\n return true;\n}"
},
"id": "search-entry",
"pack": "pack_start,true,true,3",
"|xns": "Gtk",
"items": [
{
+ "listeners": {
+ "cursor_changed": "function (self) {\n \n var ret = {};\n this.selection.get_selected(ret);\n\n // var val = \"\";\n var value = ''+ret.model.get_value(ret.iter, 0).value.get_string();\n \n print(value);\n var rec = false;\n this.get('/ticket-store').data.forEach( function(e) {\n if (e.id == value) {\n rec = e;\n return false;\n }\n });\n // update the text box with the ticket data..\n this.get('/view').show(rec);\n //print(rec);\n\n}"
+ },
"id": "ticket-view",
"pack": "add",
"xtype": "TreeView",
"xtype": "ListStore",
"|columns": " [\n GObject.TYPE_STRING, // title \n GObject.TYPE_STRING, // tip\n GObject.TYPE_STRING // source..\n] ",
"|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\n\n \n // var t = this;\n //imports.Projects.Projects.fetch( function(res) { \n // t.loadData(res);\n // });\n \n \n}\n",
- "|loadData": "function (data) {\n print(\"loading data\");\n \n var el = this.el;\n this.el.clear();\n data.forEach(function(p) {\n var ret = {};\n el.append(ret);\n //print(\"ADD \" + p.name);\n \n var line = '[' + p.status_name + '] <b>' + p.summary + \"</b><br.>\" +\n '<span color=\"#666\">' + \n GLib.markup_escape_text(p.description.split(\"\\n\").slice(0,3).join(\" \")) +\n '</span>';\n print(line);\n \n el.set_value(ret.iter, 0, p.id);\n el.set_value(ret.iter, 1, '<b>#' + p.id + '</b>' + line );\n \n });\n \n \n}\n",
+ "|loadData": "function (data) {\n print(\"loading data\");\n \n \n this.data = data;\n \n var el = this.el;\n this.el.clear();\n data.forEach(function(p) {\n var ret = {};\n el.append(ret);\n //print(\"ADD \" + p.name);\n \n var line = '[' + p.status_name + '] <b>' + \n GLib.markup_escape_text(p.summary, p.summary.length) + \"</b>\\n\" +\n '<span color=\"#666\">' + \n GLib.markup_escape_text(p.description,p.description.length).split(\"\\n\").slice(0,3).join(\"\\n\") +\n '</span>';\n print(line);\n \n el.set_value(ret.iter, 0, p.id);\n el.set_value(ret.iter, 1, '<b>#' + p.id + '</b>' + line );\n \n });\n \n \n}\n",
"|reload": "function() {\n \n var active_id = this.get('/project-select').el.get_active();\n \n var project_id = this.get('/project-select').raw_data[active_id].id;\n \n var _t = this;\n \n imports.Tasks.Tasks.query({\n project_id : project_id,\n 'query[filter]' : 'me'\n }, function(res) { \n print(JSON.stringify(res,null,4));\n _t.loadData(res);\n });\n \n \n}\n",
"|xns": "Gtk"
},
"id": "RightEditor",
"items": [
{
- "|editable": "false",
"id": "view",
"indent_width": 4,
"pack": "add",
"xtype": "TextView",
"|auto_indent": true,
+ "|editable": "false",
"|init": "function() {\n XObject.prototype.init.call(this);\n var description = Pango.font_description_from_string(\"monospace\");\n\n description.set_size(8000);\n this.el.modify_font(description);\n\n}\n",
"|load": "function(str) {\n\n// show the help page for the active node..\n \n\n\n \n this.el.get_buffer().set_text(str, str.length);\n \n \n var buf = this.el.get_buffer();\n \n \n \n}",
+ "|show": "function(p) {\n var line = [\n 'Status : ' + p.status_name,\n 'ID : ' + p.id,\n '',\n 'Summary : ' + p.summary,\n '' + \n p.description,\n ].join(\"\\n\") ;\n print(line);\n \n \n // can not do rich text due to so many missing features..\n this.el.get_buffer().set_text(line, line.length);\n \n}\n",
"|show_line_numbers": true,
"|xns": "Gtk",
"items": [