From 13809eb6f3c70a9e53511c8e585dec0a0deb5c34 Mon Sep 17 00:00:00 2001 From: edward Date: Tue, 26 Apr 2016 11:09:59 +0800 Subject: [PATCH] Pman.Tab.AdminTranslations.bjs Pman.Tab.AdminTranslations.js --- Pman.Tab.AdminTranslations.bjs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Pman.Tab.AdminTranslations.bjs b/Pman.Tab.AdminTranslations.bjs index db2ed74..f15ee05 100644 --- a/Pman.Tab.AdminTranslations.bjs +++ b/Pman.Tab.AdminTranslations.bjs @@ -25,8 +25,8 @@ "items" : [ { "region" : "center", - "title" : "Translate App", "xtype" : "NestedLayoutPanel", + "title" : "Translate App", "$ xns" : "Roo", "items" : [ { @@ -45,9 +45,9 @@ "listeners" : { "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.getDataSource().reload(); \n }\n}" }, + "background" : true, "region" : "center", "fitToframe" : true, - "background" : true, "title" : "Text in interface", "xtype" : "GridPanel", "fitContainer" : true, @@ -79,8 +79,8 @@ "items" : [ { "$ url" : "baseURL + '/Admin/Translations.php'", - "xtype" : "HttpProxy", "method" : "GET", + "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, @@ -168,8 +168,8 @@ }, { "xtype" : "ColumnModel", - "header" : "Name", "width" : 150, + "header" : "Name", "$ renderer" : "function(v,x,r) { var c = '#666'; if (r.get('updated') < r.get('origupdated')) { c = 'red'; } return '
' +r.get('tableid')+ ':' + v + '
'; }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", @@ -177,8 +177,8 @@ }, { "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 '
' + Ext.util.Format.htmlEncode(v) + '
'; }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", @@ -186,8 +186,8 @@ }, { "xtype" : "ColumnModel", - "width" : 50, "header" : "Reset", + "width" : 50, "$ renderer" : "function(v,x,r) { \n return '';\n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", @@ -195,8 +195,8 @@ }, { "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 '
' + Ext.util.Format.htmlEncode(v) + '
'; }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", @@ -224,9 +224,9 @@ "listeners" : { "|activate" : "function() {\n _this.langpanel = this;\n if (_this.langgrid) {\n _this.langgrid.ds.load({});\n }\n}" }, + "background" : true, "region" : "center", "fitToframe" : true, - "background" : true, "title" : "Languages and Countries", "xtype" : "GridPanel", "fitContainer" : true, @@ -236,8 +236,8 @@ { "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 },\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", @@ -259,8 +259,8 @@ "items" : [ { "$ url" : "baseURL + '/Roo/i18n.php'", - "xtype" : "HttpProxy", "method" : "GET", + "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, @@ -336,8 +336,8 @@ }, { "xtype" : "ColumnModel", - "width" : 50, "header" : "Code", + "width" : 50, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", @@ -345,8 +345,8 @@ }, { "xtype" : "ColumnModel", - "width" : 150, "header" : "English", + "width" : 150, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", @@ -354,8 +354,8 @@ }, { "xtype" : "ColumnModel", - "width" : 200, "header" : "Translation", + "width" : 200, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", @@ -377,8 +377,8 @@ }, { "xtype" : "ColumnModel", - "width" : 150, "header" : "Active?", + "width" : 150, "$ renderer" : "function(v,x,r) { \n\n return '';\n \n \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", -- 2.39.2