=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js' --- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js 2014-01-03 17:40:45 +0000 +++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js 2014-01-03 18:02:38 +0000 @@ -4803,12 +4803,12 @@ text += '\n\n'; text += '\n'; text += '\n'; - text += '\n\n'; - text += '\n\n\n\n'; - text += '
\n'; + text += '\n'; + text += '\n\n\n'; + text += '
\n\n'; + text += '\n\n'; text += '\n'; textArea = Ext.create('Ext.form.field.TextArea', { === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js 2014-01-02 19:49:41 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js 2014-01-03 18:01:48 +0000 @@ -4476,11 +4476,22 @@ handler: function() { var textArea, window, - text = 'DHIS.getChart(' + JSON.stringify(ns.core.service.layout.layout2plugin(ns.app.layout)) + ');'; + text = ''; + + text += '\n\n'; + text += '\n'; + text += '\n'; + text += '\n'; + text += '\n\n\n'; + text += '
\n\n'; + text += '\n\n'; + text += '\n'; textArea = Ext.create('Ext.form.field.TextArea', { - width: 400, - height: 200, + width: 700, + height: 400, readOnly: true, cls: 'ns-textarea monospaced', value: text @@ -4496,12 +4507,6 @@ bbar: [ '->', { - text: 'Format', - handler: function() { - textArea.setValue('DHIS.getChart(' + JSON.stringify(ns.core.service.layout.layout2plugin(ns.app.layout), null, 2) + ');'); - } - }, - { text: 'Select', handler: function() { textArea.selectText(); @@ -5033,79 +5038,86 @@ success: function(r) { var i18nArray = Ext.decode(r.responseText); - // i18n - requests.push({ - url: init.contextPath + '/api/i18n?package=org.hisp.dhis.visualizer', - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'Accepts': 'application/json' - }, - params: Ext.encode(i18nArray), - success: function(r) { - NS.i18n = Ext.decode(r.responseText); - fn(); - } - }); - - // root nodes - requests.push({ - url: init.contextPath + '/api/organisationUnits.json?level=1&paging=false&links=false&viewClass=detailed', - success: function(r) { - init.rootNodes = Ext.decode(r.responseText).organisationUnits || []; - fn(); - } - }); - - // organisation unit levels - requests.push({ - url: init.contextPath + '/api/organisationUnitLevels.json?paging=false&links=false', - success: function(r) { - init.organisationUnitLevels = Ext.decode(r.responseText).organisationUnitLevels || []; - fn(); - } - }); - - // user orgunits and children - requests.push({ - url: init.contextPath + '/api/organisationUnits.json?userOnly=true&viewClass=detailed&links=false', - success: function(r) { - var organisationUnits = Ext.decode(r.responseText).organisationUnits || []; - - if (organisationUnits.length) { - var ou = organisationUnits[0]; - - init.user = { - ou: ou.id, - ouc: Ext.Array.pluck(ou.children, 'id') - }; - - fn(); + Ext.Ajax.request({ + url: init.contextPath + '/api/system/context.json', + success: function(r) { + init.contextPath = Ext.decode(r.responseText).contextPath || init.contextPath; + + // i18n + requests.push({ + url: init.contextPath + '/api/i18n?package=org.hisp.dhis.visualizer', + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'Accepts': 'application/json' + }, + params: Ext.encode(i18nArray), + success: function(r) { + NS.i18n = Ext.decode(r.responseText); + fn(); + } + }); + + // root nodes + requests.push({ + url: init.contextPath + '/api/organisationUnits.json?level=1&paging=false&links=false&viewClass=detailed', + success: function(r) { + init.rootNodes = Ext.decode(r.responseText).organisationUnits || []; + fn(); + } + }); + + // organisation unit levels + requests.push({ + url: init.contextPath + '/api/organisationUnitLevels.json?paging=false&links=false', + success: function(r) { + init.organisationUnitLevels = Ext.decode(r.responseText).organisationUnitLevels || []; + fn(); + } + }); + + // user orgunits and children + requests.push({ + url: init.contextPath + '/api/organisationUnits.json?userOnly=true&viewClass=detailed&links=false', + success: function(r) { + var organisationUnits = Ext.decode(r.responseText).organisationUnits || []; + + if (organisationUnits.length) { + var ou = organisationUnits[0]; + + init.user = { + ou: ou.id, + ouc: Ext.Array.pluck(ou.children, 'id') + }; + + fn(); + } + } + }); + + // legend sets + requests.push({ + url: init.contextPath + '/api/mapLegendSets.json?viewClass=detailed&links=false&paging=false', + success: function(r) { + init.legendSets = Ext.decode(r.responseText).mapLegendSets || []; + fn(); + } + }); + + // dimensions + requests.push({ + url: init.contextPath + '/api/dimensions.json?links=false&paging=false', + success: function(r) { + init.dimensions = Ext.decode(r.responseText).dimensions || []; + fn(); + } + }); + + for (var i = 0; i < requests.length; i++) { + Ext.Ajax.request(requests[i]); } } }); - - // legend sets - requests.push({ - url: init.contextPath + '/api/mapLegendSets.json?viewClass=detailed&links=false&paging=false', - success: function(r) { - init.legendSets = Ext.decode(r.responseText).mapLegendSets || []; - fn(); - } - }); - - // dimensions - requests.push({ - url: init.contextPath + '/api/dimensions.json?links=false&paging=false', - success: function(r) { - init.dimensions = Ext.decode(r.responseText).dimensions || []; - fn(); - } - }); - - for (var i = 0; i < requests.length; i++) { - Ext.Ajax.request(requests[i]); - } } }); } === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/core.js' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/core.js 2014-01-02 19:49:41 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/core.js 2014-01-03 18:01:48 +0000 @@ -1217,6 +1217,7 @@ delete item.code; delete item.created; delete item.lastUpdated; + delete item.value; } }