diff options
Diffstat (limited to 'plugins/ZenMode/angularjs/zen-mode/zen-mode-switcher.directive.js')
-rw-r--r-- | plugins/ZenMode/angularjs/zen-mode/zen-mode-switcher.directive.js | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/plugins/ZenMode/angularjs/zen-mode/zen-mode-switcher.directive.js b/plugins/ZenMode/angularjs/zen-mode/zen-mode-switcher.directive.js deleted file mode 100644 index 36ac43a39a..0000000000 --- a/plugins/ZenMode/angularjs/zen-mode/zen-mode-switcher.directive.js +++ /dev/null @@ -1,54 +0,0 @@ -/*! - * 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-zen-mode-switcher>...</div> - * Will toggle the zen mode on click on this element. - */ -(function () { - angular.module('piwikApp').directive('piwikZenModeSwitcher', piwikZenModeSwitcher); - - piwikZenModeSwitcher.$inject = ['$rootElement', '$filter']; - - function piwikZenModeSwitcher($rootElement, $filter) { - - function showZenModeIsActivatedNotification() { - var howToSearch = $filter('translate')('ZenMode_HowToSearch'); - var howToToggle = $filter('translate')('ZenMode_HowToToggleZenMode'); - var activated = $filter('translate')('ZenMode_Activated'); - - var message = '<ul><li>' + howToSearch + '</li><li>' + howToToggle + '</li></ul>'; - - var UI = require('piwik/UI'); - var notification = new UI.Notification(); - notification.show(message, { - title: activated, - context: 'info', - id: 'ZenMode_EnabledInfo' - }); - } - - return { - restrict: 'A', - compile: function (element, attrs) { - - element.on('click', function() { - $rootElement.trigger('zen-mode-toggle', {}); - - if ($rootElement.hasClass('zenMode')) { - showZenModeIsActivatedNotification(); - } - }); - - return function () { - }; - } - }; - - } -})();
\ No newline at end of file |