blob: 583eed74fa27d398d496a1abb83e00a08d388d90 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
<div id="RealTimeMap" style="position:relative; overflow:hidden;">
<div id="RealTimeMap_container">
<div id="RealTimeMap_map" style="overflow:hidden"></div>
<div class="realTimeMap_overlay">
<span class="showing_visits_of" style="display:none">{'UserCountryMap_ShowingVisits'|translate} <span class="realTimeMap_timeSpan"
style="font-weight:bold"></span></span>
<span class="no_data" style="display:none">{'CoreHome_ThereIsNoDataForThisReport'|translate}</span>
<span class="loading_data">{'General_LoadingData'|translate}...</span>
<img src="{$piwikUrl}plugins/UserCountryMap/img/realtimemap-loading.gif" style="vertical-align:baseline;position:relative;left:-2px;">
</div>
<div class="realTimeMap_overlay realTimeMap_datetime"></div>
</div>
<div id="RealTimeMap_meta">
<span class="loadingPiwik">
<img src="{$piwikUrl}themes/default/images/loading-blue.gif"> {'General_LoadingData'|translate}...
</span>
</div>
</div>
<!-- configure some piwik vars -->
<script type="text/javascript">
{* If the map is loaded from the menu, do a few tweaks to clean up the display *}
{if $mapIsStandaloneNotWidget}
function initStandaloneMap() {ldelim}
$('.top_controls').hide();
$('ul.nav').on('piwikSwitchPage', function (event, item) {ldelim}
var clickedMenuIsNotMap = ($(item).text() != "{'UserCountryMap_RealTimeMap'|translate|escape:'js'}");
if (clickedMenuIsNotMap) {ldelim}
$('.top_controls').show();
{rdelim
}
{rdelim
});
$('.realTimeMap_overlay').css('top', '0px');
$('.realTimeMap_datetime').css('top', '20px');
{rdelim
}
initStandaloneMap();
{/if}
{literal}
var config = { metrics: {} };
{/literal}
config.svgBasePath = "{$piwikUrl}plugins/UserCountryMap/svg/";
config.liveRefreshAfterMs = {$liveRefreshAfterMs};
config._ = JSON.parse('{$localeJSON|escape:'javascript'}');
config.reqParams = JSON.parse('{$reqParamsJSON|escape:'javascript'}');
config.siteHasGoals = {$hasGoals};
config.maxVisits = {$maxVisits};
var realtimeMap;
{literal}
if ($('#dashboardWidgetsArea').length) {
// dashboard mode
var $widgetContent = $('#RealTimeMap').parents('.widgetContent');
$widgetContent.on('widget:create',function (evt, widget) {
realtimeMap = new UserCountryMap.RealtimeMap(config, widget);
}).on('widget:maximise',function (evt) {
realtimeMap.resize();
}).on('widget:minimise',function (evt) {
realtimeMap.resize();
}).on('widget:destroy', function (evt) {
realtimeMap.destroy();
});
} else {
// stand-alone mode
realtimeMap = new UserCountryMap.RealtimeMap(config);
}
{/literal}
</script>
|