GSOC #116 - Refactor StatisticsAdmin

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@43831 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-10-25 01:03:17 +00:00
parent ca4fb5188d
commit 5e41feeca1

View File

@ -1,4 +1,6 @@
defaultOpts = {
StatisticsAdmin = Class.create();
StatisticsAdmin = {
defaultOpts: {
fillOpacity: 1.0,
axis: {
lineWidth: 1.0,
@ -14,9 +16,9 @@ defaultOpts = {
backgroundColor: '#cccccc',
colorScheme: 'blue'
}
},
showCT = function() {
showCT : function() {
console.log('asdg');
if($('browserchart')) {
var bchart = new Plotr.PieChart('bchart', defaultOpts);
@ -35,10 +37,9 @@ showCT = function() {
tablePaginater.init();
console.log('table rendered');
}
}
},
overview = function() {
overview : function() {
$('browserchart') ? $('browserchart').hide() : null;
$('trendchart') ? $('trendchart').hide() : null;
$('usertable') ? $('usertable').hide() : null;
@ -46,9 +47,9 @@ overview = function() {
$('oschart') ? $('oschart').hide() : null;
$('uacchart') ? $('uacchart').hide() : null;
$('bovs') ? $('bovs').show() : null;
}
},
users = function() {
users : function() {
$('browserchart') ? $('browserchart').hide() : null;
$('trendchart') ? $('trendchart').hide() : null;
$('usertable') ? $('usertable').show() : null;
@ -56,9 +57,9 @@ users = function() {
$('oschart') ? $('oschart').hide() : null;
$('uacchart') ? $('uacchart').show() : null;
$('bovs') ? $('bovs').hide() : null;
}
},
views = function() {
views : function() {
$('browserchart') ? $('browserchart').hide() : null;
$('trendchart') ? $('trendchart').hide() : null;
$('usertable') ? $('usertable').hide() : null;
@ -66,9 +67,9 @@ views = function() {
$('oschart') ? $('oschart').hide() : null;
$('uacchart') ? $('uacchart').hide() : null;
$('bovs') ? $('bovs').hide() : null;
}
},
trends = function() {
trends : function() {
$('browserchart') ? $('browserchart').hide() : null;
$('trendchart') ? $('trendchart').show() : null;
$('usertable') ? $('usertable').hide() : null;
@ -76,9 +77,9 @@ trends = function() {
$('oschart') ? $('oschart').hide() : null;
$('uacchart') ? $('uacchart').hide() : null;
$('bovs') ? $('bovs').hide() : null;
}
},
browsers = function() {
browsers : function() {
$('browserchart') ? $('browserchart').show() : null;
$('trendchart') ? $('trendchart').hide() : null;
$('usertable') ? $('usertable').hide() : null;
@ -86,9 +87,9 @@ browsers = function() {
$('oschart') ? $('oschart').hide() : null;
$('uacchart') ? $('uacchart').hide() : null;
$('bovs') ? $('bovs').hide() : null;
}
},
os = function() {
os : function() {
$('browserchart') ? $('browserchart').hide() : null;
$('trendchart') ? $('trendchart').hide() : null;
$('usertable') ? $('usertable').hide() : null;
@ -97,6 +98,7 @@ os = function() {
$('uacchart') ? $('uacchart').hide() : null;
$('bovs') ? $('bovs').hide() : null;
}
}
SiteTreeNode.prototype.onselect = function() {
@ -104,22 +106,22 @@ SiteTreeNode.prototype.onselect = function() {
case 'statsroot':
break;
case 'stoverview':
overview();
StatisticsAdmin.overview();
break;
case 'stusers':
users();
StatisticsAdmin.users();
break;
case 'stviews':
views();
StatisticsAdmin.views();
break;
case 'sttrends':
trends();
StatisticsAdmin.trends();
break;
case 'stbrowsers':
browsers();
StatisticsAdmin.browsers();
break;
case 'stos':
os();
StatisticsAdmin.os();
break;
default:
console.log('Unrecognized option ' + this.id);