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/Annotations/templates')
-rwxr-xr-xplugins/Annotations/templates/annotationManager.tpl2
-rwxr-xr-xplugins/Annotations/templates/annotations.js26
-rwxr-xr-xplugins/Annotations/templates/evolutionAnnotations.tpl4
3 files changed, 28 insertions, 4 deletions
diff --git a/plugins/Annotations/templates/annotationManager.tpl b/plugins/Annotations/templates/annotationManager.tpl
index 7ba893a972..852c09bbc4 100755
--- a/plugins/Annotations/templates/annotationManager.tpl
+++ b/plugins/Annotations/templates/annotationManager.tpl
@@ -18,7 +18,7 @@
<div class="annotation-controls">
{if $canUserAddNotes}
- <a href="#" class="add-annotation">{'Annotations_CreateNewAnnotation'|translate}</a>
+ <a href="#" class="add-annotation" title="{'Annotations_CreateNewAnnotation'|translate}">{'Annotations_CreateNewAnnotation'|translate}</a>
{elseif $userLogin eq 'anonymous'}
<a href="index.php?module=Login">{'Annotations_LoginToAnnotate'|translate}</a>
{/if}
diff --git a/plugins/Annotations/templates/annotations.js b/plugins/Annotations/templates/annotations.js
index 925c652567..447df6a2e5 100755
--- a/plugins/Annotations/templates/annotations.js
+++ b/plugins/Annotations/templates/annotations.js
@@ -589,9 +589,33 @@ var showAnnotationViewer = function(domElem, idSite, date, period, lastN, callba
}
};
-// make showAnnotationViewer & annotationsApi globally accessible
+/**
+ * Determines the x-coordinates of a set of evolution annotation icons.
+ *
+ * @param {Element} annotations The '.evolution-annotations' element.
+ * @param {Element} graphElem The evolution graph's datatable element.
+ */
+var placeEvolutionIcons = function (annotations, graphElem)
+{
+ var canvases = $('.piwik-graph .jqplot-xaxis canvas', graphElem),
+ noteSize = 16;
+
+ // set position of each individual icon
+ $('span', annotations).each(function(i) {
+ var canvas = $(canvases[i]),
+ canvasCenterX = canvas.position().left + (canvas.width() / 2);
+ $(this).css({
+ left: canvasCenterX - noteSize / 2,
+ // show if there are annotations for this x-axis tick
+ opacity: +$(this).attr('data-count') > 0 ? 1 : 0
+ });
+ });
+};
+
+// make showAnnotationViewer, placeEvolutionIcons & annotationsApi globally accessible
piwik.annotations = {
showAnnotationViewer: showAnnotationViewer,
+ placeEvolutionIcons: placeEvolutionIcons,
api: annotationsApi
};
diff --git a/plugins/Annotations/templates/evolutionAnnotations.tpl b/plugins/Annotations/templates/evolutionAnnotations.tpl
index 5248bddbf2..50a7479797 100755
--- a/plugins/Annotations/templates/evolutionAnnotations.tpl
+++ b/plugins/Annotations/templates/evolutionAnnotations.tpl
@@ -3,8 +3,8 @@
{assign var=date value=$dateCountPair[0]}
{assign var=counts value=$dateCountPair[1]}
<span data-date="{$date}" data-count="{$counts.count}" data-starred="{$counts.starred}"
- {if $counts.count eq 0}title="{'CoreHome_Annotations_AddAnnotationsFor_js'|translate:$date}"
- {else}title="{'CoreHome_Annotations_ViewAndAddAnnotations_js'|translate:$date}"
+ {if $counts.count eq 0}title="{'Annotations_AddAnnotationsFor_js'|translate:$date}"
+ {else}title="{'Annotations_ViewAndAddAnnotations_js'|translate:$date}"
{/if}>
<img src="themes/default/images/{if $counts.starred > 0}yellow_marker.png{else}grey_marker.png{/if}" width="16" height="16"/>
</span>