diff --git a/modules/admin/tpl/_dashboard_counter.html b/modules/admin/tpl/_dashboard_counter.html
index db8112a0b..7234b4f08 100644
--- a/modules/admin/tpl/_dashboard_counter.html
+++ b/modules/admin/tpl/_dashboard_counter.html
@@ -1,3 +1,5 @@
+
+
{$lang->uv}
@@ -75,87 +77,4 @@ xe.lang.thu = '{$lang->thu}';
xe.lang.fri = '{$lang->fri}';
xe.lang.sat = '{$lang->sat}';
xe.lang.sun = '{$lang->sun}';
-
-jQuery(function($)
-{
- // Dashboard portlet UI
- $('.dashboard>div>section>ul>li')
- .bind('mouseenter focusin', function(){
- $(this).addClass('hover').find('>.action').show();
- })
- .bind('mouseleave focusout', function()
- {
- if(!$(this).find(':focus').length)
- {
- $(this).removeClass('hover').find('>.action').hide();
- }
- });
-});
-
-function obj2Array(htObj)
-{
- var aRes = [];
-
- for(var x in htObj)
- {
- if(!htObj.hasOwnProperty(x)) continue;
- aRes.push(htObj[x]);
- }
-
- return aRes;
-}
-
-jQuery(function ($)
-{
- $.exec_json("counter.getWeeklyUniqueVisitor", {}, function(htRes)
- {
- var aLastWeek = obj2Array(htRes.last_week.list);
- var aThisWeek = obj2Array(htRes.this_week.list);
-
- drawChart("visitors", "Weekly Visitors", aLastWeek, aThisWeek);
- });
-
- $.exec_json("counter.getWeeklyPageView", {}, function(htRes)
- {
- var aLastWeek = obj2Array(htRes.last_week.list);
- var aThisWeek = obj2Array(htRes.this_week.list);
-
- drawChart("page_views", "Weekly Page Views", aLastWeek, aThisWeek);
- });
-});
-
-function drawChart(sContainerId, sTitle, aLastWeek, aThisWeek)
-{
- $ = jQuery;
-
- var s1 = aLastWeek;
- var s2 = aThisWeek;
- // Can specify a custom tick Array.
- // Ticks should match up one for each y value (category) in the series.
- var ticks = [xe.lang.sun,xe.lang.mon,xe.lang.tue,xe.lang.wed,xe.lang.thu,xe.lang.fri,xe.lang.sat];
-
- var plot1 = $.jqplot(sContainerId, [s1, s2], {
- seriesDefaults:{
- renderer:$.jqplot.BarRenderer,
- rendererOptions: {fillToZero: true}
- },
- series:[
- {label: xe.lang.last_week},
- {label: xe.lang.this_week}
- ],
- legend:
- {
- show: true,
- placement: 'outsideGrid'
- },
- axes: {
- xaxis: {
- renderer: $.jqplot.CategoryAxisRenderer, ticks: ticks
- },
- yaxis: {
- min: 0, ticks: 1, pad: 1.05
- }
- }
- });
-};
-
+
\ No newline at end of file
diff --git a/modules/admin/tpl/js/dashboard_counter.js b/modules/admin/tpl/js/dashboard_counter.js
new file mode 100644
index 000000000..60eab1aa0
--- /dev/null
+++ b/modules/admin/tpl/js/dashboard_counter.js
@@ -0,0 +1,80 @@
+jQuery(function($)
+{
+ // Dashboard portlet UI
+ $('.dashboard>div>section>ul>li')
+ .bind('mouseenter focusin', function(){
+ $(this).addClass('hover').find('>.action').show();
+ })
+ .bind('mouseleave focusout', function()
+ {
+ if(!$(this).find(':focus').length)
+ {
+ $(this).removeClass('hover').find('>.action').hide();
+ }
+ });
+});
+
+function obj2Array(htObj)
+{
+ var aRes = [];
+
+ for(var x in htObj)
+ {
+ if(!htObj.hasOwnProperty(x)) continue;
+ aRes.push(htObj[x]);
+ }
+
+ return aRes;
+}
+
+jQuery(function ($)
+{
+ $.exec_json("counter.getWeeklyUniqueVisitor", {}, function(htRes)
+ {
+ var aLastWeek = obj2Array(htRes.last_week.list);
+ var aThisWeek = obj2Array(htRes.this_week.list);
+
+ drawChart("visitors", "Weekly Visitors", aLastWeek, aThisWeek);
+ });
+
+ $.exec_json("counter.getWeeklyPageView", {}, function(htRes)
+ {
+ var aLastWeek = obj2Array(htRes.last_week.list);
+ var aThisWeek = obj2Array(htRes.this_week.list);
+
+ drawChart("page_views", "Weekly Page Views", aLastWeek, aThisWeek);
+ });
+});
+
+function drawChart(sContainerId, sTitle, aLastWeek, aThisWeek)
+{
+ $ = jQuery;
+
+ var s1 = aLastWeek;
+ var s2 = aThisWeek;
+ var ticks = [xe.lang.sun,xe.lang.mon,xe.lang.tue,xe.lang.wed,xe.lang.thu,xe.lang.fri,xe.lang.sat];
+
+ var plot1 = $.jqplot(sContainerId, [s1, s2], {
+ seriesDefaults:{
+ renderer:$.jqplot.BarRenderer,
+ rendererOptions: {fillToZero: true}
+ },
+ series:[
+ {label: xe.lang.last_week},
+ {label: xe.lang.this_week}
+ ],
+ legend:
+ {
+ show: true,
+ placement: 'outsideGrid'
+ },
+ axes: {
+ xaxis: {
+ renderer: $.jqplot.CategoryAxisRenderer, ticks: ticks
+ },
+ yaxis: {
+ min: 0, ticks: 1, pad: 1.05
+ }
+ }
+ });
+};
\ No newline at end of file