Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Live/templates')
-rw-r--r--plugins/Live/templates/images/download.pngbin0 -> 734 bytes
-rw-r--r--plugins/Live/templates/images/file0.pngbin0 -> 535 bytes
-rw-r--r--plugins/Live/templates/images/file1.pngbin0 -> 683 bytes
-rw-r--r--plugins/Live/templates/images/file2.pngbin0 -> 632 bytes
-rw-r--r--plugins/Live/templates/images/file3.pngbin0 -> 661 bytes
-rw-r--r--plugins/Live/templates/images/file4.pngbin0 -> 596 bytes
-rw-r--r--plugins/Live/templates/images/file5.pngbin0 -> 653 bytes
-rw-r--r--plugins/Live/templates/images/file6.pngbin0 -> 654 bytes
-rw-r--r--plugins/Live/templates/images/file7.pngbin0 -> 637 bytes
-rw-r--r--plugins/Live/templates/images/file8.pngbin0 -> 574 bytes
-rw-r--r--plugins/Live/templates/images/file9.pngbin0 -> 566 bytes
-rw-r--r--plugins/Live/templates/images/goal.pngbin0 -> 672 bytes
-rw-r--r--plugins/Live/templates/images/outboundlink.pngbin0 -> 799 bytes
-rw-r--r--plugins/Live/templates/index.tpl180
-rw-r--r--plugins/Live/templates/lastVisits.tpl40
-rw-r--r--plugins/Live/templates/scripts/spy.js39
-rw-r--r--plugins/Live/templates/structure.tpl5
-rw-r--r--plugins/Live/templates/totalVisits.tpl26
18 files changed, 222 insertions, 68 deletions
diff --git a/plugins/Live/templates/images/download.png b/plugins/Live/templates/images/download.png
new file mode 100644
index 0000000000..1920b1bb22
--- /dev/null
+++ b/plugins/Live/templates/images/download.png
Binary files differ
diff --git a/plugins/Live/templates/images/file0.png b/plugins/Live/templates/images/file0.png
new file mode 100644
index 0000000000..2c6ce30fe3
--- /dev/null
+++ b/plugins/Live/templates/images/file0.png
Binary files differ
diff --git a/plugins/Live/templates/images/file1.png b/plugins/Live/templates/images/file1.png
new file mode 100644
index 0000000000..074e577058
--- /dev/null
+++ b/plugins/Live/templates/images/file1.png
Binary files differ
diff --git a/plugins/Live/templates/images/file2.png b/plugins/Live/templates/images/file2.png
new file mode 100644
index 0000000000..48aeb390f2
--- /dev/null
+++ b/plugins/Live/templates/images/file2.png
Binary files differ
diff --git a/plugins/Live/templates/images/file3.png b/plugins/Live/templates/images/file3.png
new file mode 100644
index 0000000000..0827cabe17
--- /dev/null
+++ b/plugins/Live/templates/images/file3.png
Binary files differ
diff --git a/plugins/Live/templates/images/file4.png b/plugins/Live/templates/images/file4.png
new file mode 100644
index 0000000000..a4c277981e
--- /dev/null
+++ b/plugins/Live/templates/images/file4.png
Binary files differ
diff --git a/plugins/Live/templates/images/file5.png b/plugins/Live/templates/images/file5.png
new file mode 100644
index 0000000000..5701f2b274
--- /dev/null
+++ b/plugins/Live/templates/images/file5.png
Binary files differ
diff --git a/plugins/Live/templates/images/file6.png b/plugins/Live/templates/images/file6.png
new file mode 100644
index 0000000000..5099a0222d
--- /dev/null
+++ b/plugins/Live/templates/images/file6.png
Binary files differ
diff --git a/plugins/Live/templates/images/file7.png b/plugins/Live/templates/images/file7.png
new file mode 100644
index 0000000000..8559758b56
--- /dev/null
+++ b/plugins/Live/templates/images/file7.png
Binary files differ
diff --git a/plugins/Live/templates/images/file8.png b/plugins/Live/templates/images/file8.png
new file mode 100644
index 0000000000..515bd791d7
--- /dev/null
+++ b/plugins/Live/templates/images/file8.png
Binary files differ
diff --git a/plugins/Live/templates/images/file9.png b/plugins/Live/templates/images/file9.png
new file mode 100644
index 0000000000..c06ec15bdb
--- /dev/null
+++ b/plugins/Live/templates/images/file9.png
Binary files differ
diff --git a/plugins/Live/templates/images/goal.png b/plugins/Live/templates/images/goal.png
new file mode 100644
index 0000000000..e4bc611f87
--- /dev/null
+++ b/plugins/Live/templates/images/goal.png
Binary files differ
diff --git a/plugins/Live/templates/images/outboundlink.png b/plugins/Live/templates/images/outboundlink.png
new file mode 100644
index 0000000000..0010931e2c
--- /dev/null
+++ b/plugins/Live/templates/images/outboundlink.png
Binary files differ
diff --git a/plugins/Live/templates/index.tpl b/plugins/Live/templates/index.tpl
index 5c012ea5cc..617dc91660 100644
--- a/plugins/Live/templates/index.tpl
+++ b/plugins/Live/templates/index.tpl
@@ -1,28 +1,49 @@
-<h2>Live! (alpha)</h2>
{literal}
<script type="text/javascript" src="plugins/Live/templates/scripts/spy.js"></script>
<script type="text/javascript" charset="utf-8">
- $(document).ready(function() {
- $('#visits').spy({
- limit: 10,
- ajax: 'index.php?module=Live&idSite=1&action=getLastVisits',
- timeout: 500,
- customParameterName: 'minIdVisit',
- customParameterValueCallback: lastIdVisit,
- fadeInSpeed: 1400 }
- );
+
+ $(document).ready(function() {
+ if($('#_spyTmp').size() == 0) {
+ $('#visitsLive > div:gt(2)').fadeEachDown(); // initial fade
+ $('#visitsLive').spy({
+ limit: 10,
+ ajax: 'index.php?module=Live&idSite={/literal}{$idSite}{literal}&action=getLastVisitsStart',
+ fadeLast: 2,
+ isDupe: check_for_dupe,
+ timeout: 8000,
+ customParameterName: 'minIdVisit',
+ customParameterValueCallback: lastIdVisit,
+ fadeInSpeed: 600
+ });
+ }
});
-
+
+ // first I'm ensuring that 'last' has been initialised (with last.constructor == Object),
+ // then prev.html() == last.html() will return true if the HTML is the same, or false,
+ // if I have a different entry.
+ function check_for_dupe(prev, last)
+ {
+ if (last.constructor == Object) {
+ return (prev.html() == last.html());
+ }
+ else {
+ return 0;
+ }
+ }
+
function lastIdVisit()
{
- return $('#visits > div:lt(2) .idvisit').html();
+ updateTotalVisits();
+ updateVisitBox();
+ return $('#visitsLive > div:lt(2) .idvisit').html();
}
+
var pauseImage = "plugins/Live/templates/images/pause.gif";
var pauseDisabledImage = "plugins/Live/templates/images/pause_disabled.gif";
var playImage = "plugins/Live/templates/images/play.gif";
var playDisabledImage = "plugins/Live/templates/images/play_disabled.gif";
-
+
function onClickPause()
{
$('#pauseImage').attr('src', pauseImage);
@@ -36,50 +57,127 @@
return playSpy();
}
+ // updates the numbers of total visits in startbox
+ function updateTotalVisits()
+ {
+ $("#visitsTotal").load("index.php?module=Live&idSite={/literal}{$idSite}{literal}&action=ajaxTotalVisitors");
+ }
+
+ // updates the visit table, to refresh the already presented visotors pages
+ function updateVisitBox()
+ {
+ $("#visitsLive").load("index.php?module=Live&idSite={/literal}{$idSite}{literal}&action=getLastVisitsStart");
+ }
+
+ /* TOOLTIP */
+ $('#visitsLive label').tooltip({
+ track: true,
+ delay: 0,
+ showURL: false,
+ showBody: " - ",
+ fade: 250
+ });
+
</script>
<style>
-#visits {
+#visitsLive {
text-align:left;
+ font-size:90%;
}
-#visits .datetime, #visits .country, #visits .referer, #visits .settings, #visits .returning {
- float:left;
- margin-right:10px;
- overflow:hidden;
- padding-left:1px;
- max-width:700px;
+#visitsLive .datetime, #visitsLive .country, #visitsLive .referer, #visitsLive .settings, #visitsLive .returning , #visitsLive .countActions{
+ border-bottom:1px solid #C1DAD7;
+ border-right:1px solid #C1DAD7;
+ padding:5px 5px 5px 12px;
+}
+
+#visitsLive .datetime {
+ background:#D4E3ED url(plugins/CoreHome/templates/images/bg_header.jpg) repeat-x scroll 0 0;
+ border-top:1px solid #C1DAD7;
+ color:#6D929B;
+ margin:0;
+ text-align:left;
}
-#visits .datetime {
- width:110px;
+
+#visitsLive .country {
+ color:#4F6B72;
+ background:#FFFFFF url(plugins/CoreHome/templates/images/bullet1.gif) no-repeat scroll 0 0;
}
-#visits .country {
- width:30px;
+
+#visitsLive .referer {
+ background:#F9FAFA none repeat scroll 0 0;
+ color:#797268;
}
-#visits .referer {
- width:200px;
+
+#visitsLive .pagesTitle {
+ display:block;
+ float:left;
+ padding-top: 3px;
}
-#visits .settings {
- width:100px;
+
+#visitsLive .countActions {
+ background:#FFFFFF none repeat scroll 0 0;
+ color:#4F6B72;
}
-#visits .returning {
- width:30px;
+
+#visitsLive .settings {
+ background:#FFFFFF none repeat scroll 0 0;
+ color:#4F6B72;
}
-#visits .visit {
- border-bottom:1px solid #C1DAD7;
- background-color:#F9FAFA;
- padding:10px;
- line-height:24px;
- height:40px;
+
+#visitsLive .returning {
+ background:#F9FAFA none repeat scroll 0 0;
+ color:#797268;
+}
+
+#visitsLive .visit {
+}
+
+#visitsLive .alt {
}
-#visits .alt {
- background-color:#FFFFFF;
+
+#visitsLive .actions {
+ background:#F9FAFA none repeat scroll 0 0;
+ color:#797268;
+ padding:0px 5px 0px 12px;
}
+
</style>
{/literal}
+<div id="visitsTotal">
+ <table class="dataTable" cellspacing="0">
+ <thead>
+ <tr>
+ <th id="label" class="sortable label" style="cursor: auto;">
+ <div id="thDIV">Period<div></th>
+ <th id="label" class="sortable label" style="cursor: auto;">
+ <div id="thDIV">Visits<div></th>
+ <th id="label" class="sortable label" style="cursor: auto;">
+ <div id="thDIV">PageViews<div></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <tr class="">
+ <td class="columnodd">Today</td>
+ <td class="columnodd">{$visitorsCountToday}</td>
+ <td class="columnodd">{$pisToday}</td>
+ </tr>
+ <tr class="">
+ <td class="columnodd">Last 30 minutes</td>
+ <td class="columnodd">{$visitorsCountHalfHour}</td>
+ <td class="columnodd">{$pisHalfhour}</td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+<div id='visitsLive'>
{$visitors}
+</div>
<div>
- <a href="#?" onclick="onClickPause();"><img id="pauseImage" border="0" src="plugins/Live/templates/images/pause_disabled.gif"></a>
- <a href="#?" onclick="onClickPlay();"><img id="playImage" border="0" src="plugins/Live/templates/images/play.gif"></a>
-</div> \ No newline at end of file
+ <a href="javascript:void(0);" onclick="onClickPause();"><img id="pauseImage" border="0" src="plugins/Live/templates/images/pause_disabled.gif" /></a>
+ <a href="javascript:void(0);" onclick="onClickPlay();"><img id="playImage" border="0" src="plugins/Live/templates/images/play.gif" /></a>
+</div>
diff --git a/plugins/Live/templates/lastVisits.tpl b/plugins/Live/templates/lastVisits.tpl
index ac515f2d63..e67ab5ec71 100644
--- a/plugins/Live/templates/lastVisits.tpl
+++ b/plugins/Live/templates/lastVisits.tpl
@@ -1,15 +1,35 @@
-<div id="visits">
{foreach from=$visitors item=visitor}
- <div class="visit{if $visitor.idVisit % 2} alt{/if}">
+ <div id="{$visitor.idVisit}" class="visit{if $visitor.idVisit % 2} alt{/if}">
<div style="display:none" class="idvisit">{$visitor.idVisit}</div>
- <div class="datetime">{$visitor.serverDatePretty}<br/>{$visitor.serverTimePretty}</div>
- <div class="country"><img src="{$visitor.countryFlag}" title="{$visitor.country}, Provider {$visitor.provider}"></div>
- <div class="referer">{if $visitor.refererType != 'directEntry'}from <a href="{$visitor.refererUrl}">{$visitor.refererName}</a> {if !empty($visitor.keywords)}"{$visitor.keywords}"{/if}{/if}</div>
- <div class="settings">
- <img src="{$visitor.browserIcon}" title="{$visitor.browser} with plugins {$visitor.plugins} enabled">
- <img src="{$visitor.operatingSystemIcon}" title="{$visitor.operatingSystem}, {$visitor.resolution}">
+ <div class="datetime">
+ {$visitor.serverDatePretty} - {$visitor.serverTimePretty}
+ &nbsp;<img src="{$visitor.countryFlag}" title="{$visitor.country}, Provider {$visitor.provider}" />
+ &nbsp;<img src="{$visitor.browserIcon}" title="{$visitor.browser} with plugins {$visitor.plugins} enabled" />
+ &nbsp;<img src="{$visitor.operatingSystemIcon}" title="{$visitor.operatingSystem}, {$visitor.resolution}" />
+ &nbsp;{if $visitor.isVisitorGoalConverted}<img src="{$visitor.goalIcon}" title="{$visitor.goalType}" />{/if}
+ {if $visitor.isVisitorReturning}&nbsp;<img src="plugins/Live/templates/images/returningVisitor.gif" title="Returning Visitor" />{/if}
+ &nbsp;<label id="" title="IP: {$visitor.ip} - Duration: {$visitor.visitLengthPretty}">more...</label>
+ </div>
+ <!--<div class="settings"></div>-->
+ <div class="referer">
+ {if $visitor.refererType != 'directEntry'}from <a href="{$visitor.refererUrl}" target="_blank">{if !empty($visitor.searchEngineIcon)}<img src="{$visitor.searchEngineIcon}" /> {/if}{$visitor.refererName}</a>
+ {if !empty($visitor.keywords)}"{$visitor.keywords}"{/if}
+ {/if}
+ {if $visitor.refererType == 'directEntry'}Direct entry{/if}
+ </div>
+ <div id="{$visitor.idVisit}_actions" class="settings">
+ <span class="pagesTitle">Pages:</span>&nbsp;
+ {php} $col = 0; {/php}
+ {foreach from=$visitor.actionDetails item=action}
+ {php}
+ $col++;
+ if ($col>=9)
+ {
+ $col=0;
+ }
+ {/php}
+ <a href="{$action.pageUrl}" target="_blank"><img align="middle" src="plugins/Live/templates/images/file{php} echo $col; {/php}.png" title="{$action.pageUrl}" /></a>
+ {/foreach}
</div>
- <div class="returning">{if $visitor.isVisitorReturning}<img src="plugins/Live/templates/images/returningVisitor.gif" title="Returning Visitor">{/if}</div>
</div>
{/foreach}
-</div>
diff --git a/plugins/Live/templates/scripts/spy.js b/plugins/Live/templates/scripts/spy.js
index c2fb38863c..27454fe029 100644
--- a/plugins/Live/templates/scripts/spy.js
+++ b/plugins/Live/templates/scripts/spy.js
@@ -12,12 +12,12 @@ $.fn.spy = function(settings) {
spy.parsing = 0;
spy.waitTimer = 0;
spy.json = null;
-
+
if (!settings.ajax) {
alert("An AJAX/AJAH URL must be set for the spy to work.");
return;
}
-
+
spy.attachHolder = function() {
// not mad on this, but the only way to parse HTML collections
if (o.method == 'html')
@@ -37,7 +37,7 @@ $.fn.spy = function(settings) {
else
return 0;
}
-
+
spy.parse = function(e, r) {
spy.parsing = 1; // flag to stop pull via ajax
if (o.method == 'html') {
@@ -45,7 +45,7 @@ $.fn.spy = function(settings) {
} else if (o.method == 'json') {
eval('spy.json = ' + r); // convert text to json
}
-
+
if ((o.method == 'json' && spy.json.constructor == Array) || o.method == 'html') {
if (spy.parseItem(e)) {
spy.waitTimer = window.setInterval(function() {
@@ -65,7 +65,7 @@ $.fn.spy = function(settings) {
spy.parsing = 0;
}
}
-
+
// returns true if there's more to parse
spy.parseItem = function(e) {
if (o.method == 'html') {
@@ -74,7 +74,7 @@ $.fn.spy = function(settings) {
if (i.size() > 0) {
i.hide();
spy.addItem(e, i);
- }
+ }
return ($('div#_spyTmp').find('div').size() != 0);
} else {
if (spy.json.length) {
@@ -85,20 +85,21 @@ $.fn.spy = function(settings) {
return (spy.json.length != 0);
}
}
-
+
spy.addItem = function(e, i) {
if (! o.isDupe.call(this, i, spy.last)) {
spy.last = i; // note i is a pointer - so when it gets modified, so does spy.last
- $('#' + e.id + ' > div:gt(' + (o.limit - 1) + ')').remove();
+ $('#' + e.id + ' > div:gt(' + (o.limit - 2) + ')').remove();
+ $('#' + e.id + ' > div:gt(' + (o.limit - o.fadeLast - 2) + ')').fadeEachDown();
o.push.call(e, i);
$('#' + e.id + ' > div:first').fadeIn(o.fadeInSpeed);
}
}
-
+
spy.push = function(r) {
$('#' + this.id).prepend(r);
}
-
+
var o = {
limit: (settings.limit || 10),
ajax: settings.ajax,
@@ -109,7 +110,7 @@ $.fn.spy = function(settings) {
fadeInSpeed: (settings.fadeInSpeed || 'slow'), // 1400 = crawl
customParameterName: settings.customParameterName,
customParameterValueCallback: settings.customParameterValueCallback,
- isDupe: (settings.isDupe || spy.isDupe),
+ isDupe: (settings.isDupe || spy.isDupe)
};
spy.attachHolder();
@@ -125,11 +126,22 @@ $.fn.spy = function(settings) {
$.get(o.ajax, parameters, function(r) {
spy.parse(e, r);
});
- }
+ }
}, o.timeout);
});
};
+$.fn.fadeEachDown = function() {
+ var s = this.size()+5;
+ return this.each(function(i) {
+ var o = 1 - (s == 1 ? 0.5 : 0.85/s*(i+1));
+ var e = this.style;
+ if (window.ActiveXObject)
+ e.filter = "alpha(opacity=" + o*100 + ")";
+ e.opacity = o;
+ });
+};
+
function pauseSpy() {
spyRunning = 0; return false;
}
@@ -137,3 +149,6 @@ function pauseSpy() {
function playSpy() {
spyRunning = 1; return false;
}
+
+
+
diff --git a/plugins/Live/templates/structure.tpl b/plugins/Live/templates/structure.tpl
deleted file mode 100644
index a3bbc0f4f6..0000000000
--- a/plugins/Live/templates/structure.tpl
+++ /dev/null
@@ -1,5 +0,0 @@
-{assign var=showSitesSelection value=true}
-{assign var=showPeriodSelection value=false}
-{include file="CoreAdminHome/templates/header.tpl"}
-{include file="Live/templates/index.tpl"}
-
diff --git a/plugins/Live/templates/totalVisits.tpl b/plugins/Live/templates/totalVisits.tpl
new file mode 100644
index 0000000000..a7294d7853
--- /dev/null
+++ b/plugins/Live/templates/totalVisits.tpl
@@ -0,0 +1,26 @@
+<div id="visitsTotal">
+ <table class="dataTable" cellspacing="0">
+ <thead>
+ <tr>
+ <th id="label" class="sortable label" style="cursor: auto;">
+ <div id="thDIV">{'Live_Date'|translate}</div></th>
+ <th id="label" class="sortable label" style="cursor: auto;">
+ <div id="thDIV">{'General_ColumnNbVisits'|translate}</div></th>
+ <th id="label" class="sortable label" style="cursor: auto;">
+ <div id="thDIV">{'General_ColumnPageviews'|translate}</div></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr class="">
+ <td class="columnodd">{'General_Today'|translate}</td>
+ <td class="columnodd">{$visitorsCountToday}</td>
+ <td class="columnodd">{$pisToday}</td>
+ </tr>
+ <tr class="">
+ <td class="columnodd">{'Live_Last30Minutes'|translate}</td>
+ <td class="columnodd">{$visitorsCountHalfHour}</td>
+ <td class="columnodd">{$pisHalfhour}</td>
+ </tr>
+ </tbody>
+ </table>
+</div>