update Piwik to version 2.16 (fixes #91)

This commit is contained in:
oliver 2016-04-10 18:55:57 +02:00
commit d885a4baa9
5833 changed files with 418860 additions and 226988 deletions

View file

@ -0,0 +1,31 @@
<div piwik-focus-anywhere-but-here="view.showItems=false" class="menuDropdown">
<span class="title"
ng-click="view.showItems=!view.showItems"
title="{{ tooltip }}"
ng-bind-html="menuTitle"/>
<div class="items borderedControl" ng-show="view.showItems">
<div class="search" ng-if="showSearch && view.showItems">
<input type="text"
piwik-focus-if="view.showItems"
ng-model="view.searchTerm"
placeholder="{{ 'General_Search'|translate }}"
ng-change="searchItems(view.searchTerm)">
<img title="{{ 'General_Search'|translate }}"
ng-show="!view.searchTerm"
class="search_ico"
src="plugins/Morpheus/images/search_ico.png"/>
<img title="{{ 'General_Clear'|translate }}"
ng-show="view.searchTerm"
ng-click="view.searchTerm='';searchItems('')"
class="reset"
src="plugins/CoreHome/images/reset_search.png"/>
</div>
<div ng-transclude>
</div>
</div>
</div>

View file

@ -0,0 +1,73 @@
/*!
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
/**
* Usage:
* <div piwik-menudropdown menu-title="MyMenuItem" tooltip="My Tooltip" show-search="false">
* <a class="item" href="/url">An Item</a>
* <a class="item disabled">Disabled</a>
* <a class="item active">Active item</a>
* <hr class="item separator"/>
* <a class="item disabled category">Category</a>
* <a class="item" href="/url"></a>
* </div>
*/
(function () {
angular.module('piwikApp').directive('piwikMenudropdown', piwikMenudropdown);
function piwikMenudropdown(){
return {
transclude: true,
replace: true,
restrict: 'A',
scope: {
menuTitle: '@',
tooltip: '@',
showSearch: '=',
menuTitleChangeOnClick: '='
},
templateUrl: 'plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.html?cb=' + piwik.cacheBuster,
link: function(scope, element, attrs) {
element.find('.item').on('click', function () {
var $self = angular.element(this);
if ($self.hasClass('disabled') || $self.hasClass('separator')) {
return;
}
if (scope.menuTitleChangeOnClick !== false) {
scope.menuTitle = $self.text().replace(/[\u0000-\u2666]/g, function(c) {
return '&#'+c.charCodeAt(0)+';';
});
}
scope.$eval('view.showItems = false');
scope.$apply();
element.find('.item').removeClass('active');
$self.addClass('active');
});
scope.searchItems = function (searchTerm)
{
searchTerm = searchTerm.toLowerCase();
element.find('.item').each(function (index, node) {
var $node = angular.element(node);
if (-1 === $node.text().toLowerCase().indexOf(searchTerm)) {
$node.hide();
} else {
$node.show();
}
});
};
}
};
}
})();

View file

@ -0,0 +1,105 @@
.menuDropdown {
display: inline-block;
padding-right: 14px;
color: @theme-color-link;
.title {
position: relative;
cursor: pointer;
&:after {
content: '';
position: absolute;
top: 5px;
right: -15px;
color: @theme-color-link;
display: inline;
font-size: 1px;
height: 0px;
width: 0px;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 5px solid @theme-color-link;
}
}
.items {
z-index: 200;
position: absolute;
border: 1px solid @color-silver-l80;
background: @theme-color-background-base;
max-height: 400px;
overflow-y: auto;
overflow-x: hidden;
padding: 0 !important;
.search {
margin: 15px 6px 10px 6px;
display: block;
.search_ico {
position: absolute;
right: 25px;
top: 27px;
margin: 0px;
left: initial;
}
.reset {
position: absolute;
top: 25px;
cursor: pointer;
margin: 0px;
right: 25px;
left: initial;
}
input {
margin: 0px;
width: 100%;
&::-ms-clear {
display: none;
}
}
}
.item {
display: block;
color: @theme-color-text !important;
text-decoration: none !important;
padding: 6px 25px 6px 6px !important;
font-size: 11px;
float: none;
text-align: left;
&:hover {
background: @theme-color-background-tinyContrast;
}
&.active {
background-color: @theme-color-background-tinyContrast;
}
&.category {
color: @theme-color-text-light !important
}
&.separator {
padding: 0px !important;
border-bottom: 0px;
margin: 0px;
}
&.separator,
&.disabled {
opacity: 0.5;
cursor: default;
&:hover {
background: @theme-color-background-base;
}
}
}
}
}