"items" : [
{
"region" : "center",
- "title" : "Translate App",
"xtype" : "NestedLayoutPanel",
+ "title" : "Translate App",
"$ xns" : "Roo",
"items" : [
{
"listeners" : {
"|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.getDataSource().reload(); \n }\n}"
},
+ "fitToframe" : true,
"background" : true,
"region" : "center",
- "fitToframe" : true,
"title" : "Text in interface",
"xtype" : "GridPanel",
"fitContainer" : true,
"items" : [
{
"$ url" : "baseURL + '/Admin/Translations.php'",
- "xtype" : "HttpProxy",
"method" : "GET",
+ "xtype" : "HttpProxy",
"$ xns" : "Roo.data",
"* prop" : "proxy"
},
},
{
"xtype" : "ColumnModel",
- "header" : "Name",
"width" : 150,
+ "header" : "Name",
"$ renderer" : "function(v,x,r) { \n var c = '#666'; \n if (r.get('updated') < r.get('origupdated')) { \n c = 'red'; \n \n } \n return '<div style=\"color:'+c+'\";>' +r.get('tableid')+ ':' + v + '</div>'; \n }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
},
{
"xtype" : "ColumnModel",
- "header" : "Original",
"width" : 300,
+ "header" : "Original",
"$ renderer" : "function(v,x,r) { var c = '#666'; if (r.get('updated') < r.get('origupdated')) { c = 'red'; } return '<div style=\"color:' + c+ '\">' + Ext.util.Format.htmlEncode(v) + '</div>'; }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
},
{
"xtype" : "ColumnModel",
- "width" : 50,
"header" : "Reset",
+ "width" : 50,
"$ renderer" : "function(v,x,r) { \n return '<img src=\"' + rootURL + '/Pman/templates/images/edit-clear.gif' + '\" width=\"16\" height=\"16\">';\n}",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
},
{
"xtype" : "ColumnModel",
- "width" : 150,
"header" : "Translated (Click to Edit)",
+ "width" : 150,
"$ renderer" : "function(v,x,r) { var c = '#666'; if (r.get('updated') < r.get('origupdated')) { c = 'red'; } return '<div style=\"color:' + c+ '\">' + Ext.util.Format.htmlEncode(v) + '</div>'; }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"listeners" : {
"|activate" : "function() {\n _this.langpanel = this;\n if (_this.langgrid) {\n _this.langgrid.ds.load({});\n }\n}"
},
+ "fitToframe" : true,
"background" : true,
"region" : "center",
- "fitToframe" : true,
"title" : "Languages and Countries",
"xtype" : "GridPanel",
"fitContainer" : true,
{
"listeners" : {
"beforeedit" : "function(e) {\n console.log('beforeedit');\n //if (e.record.get('origtxt').indexOf('<') > -1) {\n // console.log(\"HTML EDITOR!!\");\n \n // return false;\n //}\n if (e.record.get('lval').replace(/\\s+/, '').length) {\n return true;\n }\n \n \n var tl = _this.langgridCombo.getValue();\n \n tl = (tl == 'zh_HK') ? 'zh-TW' : tl; \n tl = tl.replace('_', '-');\n var rec = e.record;\n \n \n \n Pman.gtranslate(e.record.get('lval_en'), 'en', tl, function(result) { \n if (typeof(result) == 'object') { //error\n return; \n }\n \n if (_this.grid.activeEditor) {\n _this.grid.activeEditor.setValue(result);\n } else {\n rec.set('lval',result);\n //_this.saveRec(rec);\n }\n\n //\n \n \n //console.log(result.translation);\n });\n \n \n \n return true;\n } ",
- "cellclick" : "function (_self, rowIndex, columnIndex, e)\n{\n if(_this.langgrid.colModel.getDataIndex(columnIndex) !== 'is_active'){\n return;\n }\n \n var s = _this.langgrid.ds.getAt(rowIndex);\n \n if(!s || s.data.id * 1 < 0){\n return;\n }\n \n s.set('is_active', s.data.is_active ? 0 : 1);\n \n new Pman.Request({\n url : baseURL+'/Roo/I18n',\n method : 'POST',\n params : {\n id : s.data.id,\n is_active : s.data.is_active\n }\n }); \n \n}",
"|render" : "function() \n{\n _this.langgrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.langpanel.active) {\n this.ds.load({});\n }\n}",
+ "cellclick" : "function (_self, rowIndex, columnIndex, e)\n{\n if(_this.langgrid.colModel.getDataIndex(columnIndex) !== 'is_active'){\n return;\n }\n \n var s = _this.langgrid.ds.getAt(rowIndex);\n \n if(!s || s.data.id * 1 < 0){\n return;\n }\n \n s.set('is_active', s.data.is_active ? 0 : 1);\n \n new Pman.Request({\n url : baseURL+'/Roo/I18n',\n method : 'POST',\n params : {\n id : s.data.id,\n is_active : s.data.is_active\n }\n }); \n \n}",
"afteredit" : "function (e)\n{\n var saveRec = function(rec)\n {\n var g = _this.grid;\n\n //g.getView().el.mask('Saving');\n Ext.Ajax.request({\n url : baseURL + '/Roo/I18n.php',\n method: 'POST',\n params : {\n id : rec.get('id'),\n lval : rec.get('lval'),\n ltype : rec.get('ltype')\n },\n success : function()\n {\n //g.getView().el.unmask();\n //g.getDataSource().reload();\n },\n failure : function()\n {\n Ext.Msg.alert(\"Error\", \"There was a problem saving the data - try reloading\");\n // g.getView().el.unmask();\n }\n \n });\n };\n \n saveRec.defer(1000, _this, [ e.record ]);\n}"
},
"autoExpandColumn" : "lval",
"items" : [
{
"$ url" : "baseURL + '/Roo/i18n.php'",
- "xtype" : "HttpProxy",
"method" : "GET",
+ "xtype" : "HttpProxy",
"$ xns" : "Roo.data",
"* prop" : "proxy"
},
"items" : [
{
"$ url" : "baseURL + '/Roo/i18n.php'",
- "method" : "GET",
"xtype" : "HttpProxy",
+ "method" : "GET",
"$ xns" : "Roo.data",
"* prop" : "proxy"
},
"root" : "data",
"xtype" : "JsonReader",
"$ xns" : "Roo.data",
- "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'ltype',\n 'type': 'string'\n },\n {\n 'name': 'lkey',\n 'type': 'string'\n },\n {\n 'name': 'inlang',\n 'type': 'string'\n },\n {\n 'name': 'lval',\n 'type': 'string'\n }\n]",
+ "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'ltype',\n 'type': 'string'\n },\n {\n 'name': 'lkey',\n 'type': 'string'\n },\n {\n 'name': 'inlang',\n 'type': 'string'\n },\n {\n 'name': 'lval',\n 'type': 'string'\n },\n 'title'\n]",
"* prop" : "reader",
"totalProperty" : "total"
}
},
{
"xtype" : "ColumnModel",
- "width" : 50,
"header" : "Code",
+ "width" : 50,
"$ renderer" : "function(v) { return String.format('{0}', v); }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
},
{
"xtype" : "ColumnModel",
- "width" : 150,
"header" : "English",
+ "width" : 150,
"$ renderer" : "function(v) { return String.format('{0}', v); }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
},
{
"xtype" : "ColumnModel",
- "width" : 200,
"header" : "Translation",
+ "width" : 200,
"$ renderer" : "function(v) { return String.format('{0}', v); }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
},
{
"xtype" : "ColumnModel",
- "width" : 150,
"header" : "Active?",
+ "width" : 150,
"$ renderer" : "function(v,x,r) { \n\n return '<img class=\"x-grid-check-icon' + (v*1 ? '-checked' : '') + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n \n}",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",