dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #15008
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5249: Alphanumeric characters only for names + Improved code.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 5249 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-11-30 19:10:41 +0100
message:
Alphanumeric characters only for names + Improved code.
modified:
dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js 2011-11-30 17:16:27 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js 2011-11-30 18:09:31 +0000
@@ -86,8 +86,8 @@
DV.init = Ext.JSON.decode(r.responseText);
DV.init.isInit = true;
- DV.init.initialize = function(vp) {
- DV.util.combobox.filter.category(vp);
+ DV.init.initialize = function() {
+ DV.util.combobox.filter.category();
DV.store.column = DV.store.defaultChartStore;
DV.store.column_stacked = DV.store.defaultChartStore;
@@ -121,12 +121,10 @@
},
viewport: {
getSize: function() {
- var c = Ext.getCmp('center');
- return {x: c.getWidth(), y: c.getHeight()};
+ return {x: DV.cmp.region.center.getWidth(), y: DV.cmp.region.center.getHeight()};
},
getXY: function() {
- var c = Ext.getCmp('center');
- return {x: c.x + 15, y: c.y + 43};
+ return {x: DV.cmp.region.center.x + 15, y: DV.cmp.region.center.y + 43};
}
},
multiselect: {
@@ -461,7 +459,7 @@
cb.clearValue();
}
},
- category: function(vp) {
+ category: function() {
var cbs = DV.cmp.settings.series,
cbc = DV.cmp.settings.category,
cbf = DV.cmp.settings.filter,
@@ -479,9 +477,9 @@
return cbc.filterArray[index++];
});
- this.filter(vp);
+ this.filter();
},
- filter: function(vp) {
+ filter: function() {
var cbc = DV.cmp.settings.category,
cbf = DV.cmp.settings.filter,
v = cbc.getValue(),
@@ -526,7 +524,7 @@
},
string: {
getEncodedString: function(text) {
- return text.replace(/\./g,'');
+ return text.replace(/[^a-zA-Z 0-9]+/g,'');
}
}
};
@@ -708,7 +706,7 @@
DV.value = {
values: [],
getValues: function(exe) {
- DV.util.chart.setMask('Please wait..');
+ DV.util.chart.setMask('Loading...');
var params = [],
i = DV.conf.finals.dimension.indicator.value,
@@ -729,6 +727,7 @@
DV.value.values = Ext.JSON.decode(r.responseText).values;
if (!DV.value.values.length) {
+ DV.mask.hide();
alert('No data values');
return;
}
@@ -968,10 +967,8 @@
});
},
reload: function() {
- var c = Ext.getCmp('center'),
- t = null;
- c.removeAll(true);
- c.add(this.chart);
+ DV.cmp.region.center.removeAll(true);
+ DV.cmp.region.center.add(this.chart);
if (!DV.init.isInit) {
DV.mask.hide();
@@ -1957,6 +1954,11 @@
}
]
+ },
+ listeners: {
+ added: function() {
+ DV.cmp.region.center = this;
+ }
}
},
{
@@ -1974,11 +1976,11 @@
}
],
listeners: {
- afterrender: function(vp) {
- DV.init.initialize(vp);
+ afterrender: function() {
+ DV.init.initialize();
},
resize: function(vp) {
- vp.query('panel[region="west"]')[0].setWidth(DV.conf.layout.west_width);
+ DV.cmp.region.west.setWidth(DV.conf.layout.west_width);
if (DV.cmp.datatable) {
DV.cmp.datatable.setHeight(DV.util.viewport.getSize().y - DV.conf.layout.east_tbar_height);