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,36 @@
/*!
* 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 class="languageSelection">
* </div>
*/
(function () {
angular.module('piwikApp').directive('languageSelection', languageSelection);
function languageSelection() {
return {
restrict: 'C',
link: function(scope, element, attr, ctrl) {
function postLanguageChange () {
var value = $(this).attr('value');
if (value) {
element.find('#language').val(value).parents('form').submit();
}
}
element.on('click', 'a[value]', postLanguageChange);
scope.$on('$destroy', function() {
element.off('click', 'a[value]', postLanguageChange);
});
}
};
}
})();

View file

@ -0,0 +1,31 @@
/*!
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
(function () {
angular.module('piwikApp').controller('TranslationSearchController', TranslationSearchController);
TranslationSearchController.$inject = ['piwikApi'];
function TranslationSearchController(piwikApi) {
var vm = this;
vm.existingTranslations = [];
fetchTranslations();
function fetchTranslations() {
piwikApi.fetch({
method: 'LanguagesManager.getTranslationsForLanguage',
filter_limit: -1,
languageCode: 'en'
}).then(function (response) {
if (response) {
vm.existingTranslations = response;
}
});
}
}
})();

View file

@ -0,0 +1,29 @@
<div>
<p class="adminTable">
This page helps you to find existing translations that you can reuse in your Plugin.
If you want to know more about translations have a look at our <a href="http://developer.piwik.org/guides/internationalization" rel="noreferrer" target="_blank">Internationalization guide</a>.
Enter a search term to find translations and their corresponding keys:
</p>
<input type="text" placeholder="Search for English translation" title="Search for English translation. Max 1000 results will be shown." ng-model="translationSearch.searchTerm" style="width:271px">
<br />
<br />
<table ng-show="translationSearch.searchTerm" class="entityTable dataTable" style="width: 800px;word-break: break-all;">
<thead>
<tr>
<th style="width:250px;">Key</th>
<th>English translation</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="translation in translationSearch.existingTranslations | filter:translationSearch.searchTerm | limitTo: 1000">
<td>{{ translation.label }}</td>
<td>{{ translation.value }}</td>
</tr>
</tbody>
</table>
</div>

View file

@ -0,0 +1,31 @@
/*!
* 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-translation-search></div>
*
* Will show a text box which allows the user to search for translation keys and actual translations. Currently,
* only english is supported.
*/
(function () {
angular.module('piwikApp').directive('piwikTranslationSearch', piwikTranslationSearch);
piwikTranslationSearch.$inject = ['piwik'];
function piwikTranslationSearch(piwik){
return {
restrict: 'A',
scope: {},
templateUrl: 'plugins/LanguagesManager/angularjs/translationsearch/translationsearch.directive.html?cb=' + piwik.cacheBuster,
controller: 'TranslationSearchController',
controllerAs: 'translationSearch'
};
}
})();