diff --git a/CHANGELOG.md b/CHANGELOG.md index f2b9c625466d9d57daa9fb0eac4e58b0f364ab50..5b29af62ec2ad6d936e8c1af395220e9e0f417ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,10 +26,10 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API' ### Internal change * In `piwik.js` we replaced [JSON2](https://github.com/douglascrockford/JSON-js) with [JSON3](https://bestiejs.github.io/json3/) to implement CSP (Content Security Policy) as JSON3 does not use `eval()`. JSON3 will be used if a browser does not provide a native JSON API. We are using `JSON3` in a way that it will not conflict if your website is using `JSON3` as well. - ### New APIs * The JavaScript Tracker `piwik.js` got a new method `logAllContentBlocksOnPage` to log all found content blocks within a page to the console. This is useful to debug / test content tracking. It can be triggered via `_paq.push(['logAllContentBlocksOnPage'])` * The Class `Piwik\Plugins\Login\Controller` is now considered a public API. +* The new method `Piwik\Menu\MenuAbstract::registerMenuIcon()` can be used to define an icon for a menu category to replace the default arrow icon. ### Internal Change * The option `branch` of the console command `development:sync-system-test-processed` was removed as it is no longer needed. diff --git a/config/global.ini.php b/config/global.ini.php index 2b86a1c131325c149abd8bc7b275eee43ae785d1..cb49709b37bf65e774d74d64c343d4c2f6819bf3 100644 --- a/config/global.ini.php +++ b/config/global.ini.php @@ -780,8 +780,6 @@ Plugins[] = MobileMessaging Plugins[] = Overlay Plugins[] = SegmentEditor Plugins[] = Insights -Plugins[] = ZenMode -Plugins[] = LeftMenu Plugins[] = Morpheus Plugins[] = Contents Plugins[] = TestRunner diff --git a/core/Menu/MenuAbstract.php b/core/Menu/MenuAbstract.php index 7651a1199d3a0323acefb332815efc8d43f10451..777d97b523736b34a1eec8d5025e518dae2aec30 100644 --- a/core/Menu/MenuAbstract.php +++ b/core/Menu/MenuAbstract.php @@ -30,6 +30,7 @@ abstract class MenuAbstract extends Singleton protected $edits = array(); protected $renames = array(); protected $orderingApplied = false; + protected $menuIcons = array(); protected static $menus = array(); /** @@ -48,6 +49,17 @@ abstract class MenuAbstract extends Singleton return $this->menu; } + /** + * Let's you register a menu icon for a certain menu category to replace the default arrow icon. + * + * @param string $menuName The translation key of a main menu category, eg 'Dashboard_Dashboard' + * @param string $iconCssClass The css class name of an icon, eg 'icon-user' + */ + public function registerMenuIcon($menuName, $iconCssClass) + { + $this->menuIcons[$menuName] = $iconCssClass; + } + /** * Returns a list of available plugin menu instances. * @@ -164,6 +176,11 @@ abstract class MenuAbstract extends Singleton $this->menu[$menuName]['_order'] = $order; $this->menu[$menuName]['_name'] = $menuName; $this->menu[$menuName]['_tooltip'] = $tooltip; + if (!empty($this->menuIcons[$menuName])) { + $this->menu[$menuName]['_icon'] = $this->menuIcons[$menuName]; + } else { + $this->menu[$menuName]['_icon'] = ''; + } } if (!empty($subMenuName)) { $this->menu[$menuName][$subMenuName]['_url'] = $url; diff --git a/core/Period.php b/core/Period.php index 11ddb9c7c215f724d06879a7069edf7826c623df..80dc9f6f21b145f0de2af82cfd6b4d9d0f096a77 100644 --- a/core/Period.php +++ b/core/Period.php @@ -104,6 +104,7 @@ abstract class Period if (self::isMultiplePeriod($dateString, 'day')) { return; } + Date::factory($dateString); } diff --git a/core/Plugin/Controller.php b/core/Plugin/Controller.php index 3aab8374fbe2f5dbb4498fb10d1eac87d693d419..df56b4a8dab85f77484b674aca7a6bb398c5347e 100644 --- a/core/Plugin/Controller.php +++ b/core/Plugin/Controller.php @@ -15,7 +15,6 @@ use Piwik\API\Request; use Piwik\Common; use Piwik\Config as PiwikConfig; use Piwik\Config; -use Piwik\Container\StaticContainer; use Piwik\DataTable\Filter\CalculateEvolutionFilter; use Piwik\Date; use Piwik\Exception\NoPrivilegesException; diff --git a/core/Updates/2.15.0-b16.php b/core/Updates/2.15.0-b16.php new file mode 100644 index 0000000000000000000000000000000000000000..a37e621129ede6856d45c1d846eec8727fe3f70f --- /dev/null +++ b/core/Updates/2.15.0-b16.php @@ -0,0 +1,45 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ + +namespace Piwik\Updates; + +use Piwik\Plugin\Manager; +use Piwik\Updater; +use Piwik\Updates; + +class Updates_2_15_0_b16 extends Updates +{ + + public function doUpdate(Updater $updater) + { + $this->uninstallPlugin('LeftMenu'); + $this->uninstallPlugin('ZenMode'); + } + + private function uninstallPlugin($plugin) + { + $pluginManager = Manager::getInstance(); + + if ($pluginManager->isPluginInstalled($plugin)) { + if ($pluginManager->isPluginActivated($plugin)) { + $pluginManager->deactivatePlugin($plugin); + } + + $pluginManager->unloadPlugin($plugin); + $pluginManager->uninstallPlugin($plugin); + } else { + $this->makeSurePluginIsRemovedFromFilesystem($plugin); + } + } + + private function makeSurePluginIsRemovedFromFilesystem($plugin) + { + Manager::deletePluginFromFilesystem($plugin); + } +} diff --git a/core/Version.php b/core/Version.php index c9a04c200a82f2a4409d744b1bdbbd337ed2a95e..dd1ae538d26ce5a28118b345aead624fe72913f8 100644 --- a/core/Version.php +++ b/core/Version.php @@ -20,7 +20,7 @@ final class Version * The current Piwik version. * @var string */ - const VERSION = '2.15.0-b15'; + const VERSION = '2.15.0-b16'; public function isStableVersion($version) { diff --git a/lang/en.json b/lang/en.json index 8e954f711fcd9d8727719784ab1a49da6b7a2730..3925c960e766e5874046d8139ad9eff39a522435 100644 --- a/lang/en.json +++ b/lang/en.json @@ -402,7 +402,7 @@ "YearsDays": "%1$s years %2$s days", "Yes": "Yes", "YouAreCurrentlyUsing": "You are currently using Piwik %s.", - "YouAreViewingDemoShortMessage": "You are currently viewing the demo of Piwik", + "YouAreViewingDemoShortMessage": "You are viewing the demo of Piwik", "YouMustBeLoggedIn": "You must be logged in to access this functionality.", "YourChangesHaveBeenSaved": "Your changes have been saved." }, diff --git a/plugins/API/templates/listAllAPI.twig b/plugins/API/templates/listAllAPI.twig index 47a1327c36a0b85a9a985a28a6fcdc5063759f41..d3c551c997e36a058e69c35006c7bfd245a4725f 100644 --- a/plugins/API/templates/listAllAPI.twig +++ b/plugins/API/templates/listAllAPI.twig @@ -2,18 +2,17 @@ {% set title %}{{ 'API_ReportingApiReference'|translate }}{% endset %} +{% block topcontrols %} + {% include "@CoreHome/_siteSelectHeader.twig" %} + {% include "@CoreHome/_periodSelect.twig" %} +{% endblock %} + {% block content %} <div class="api-list"> <h2>{{ title }}</h2> - {% include "@CoreHome/_siteSelectHeader.twig" %} - - <div class="top_controls"> - {% include "@CoreHome/_periodSelect.twig" %} - </div> - <p>{{ 'API_PluginDescription'|translate }}</p> <p> diff --git a/plugins/CoreAdminHome/CoreAdminHome.php b/plugins/CoreAdminHome/CoreAdminHome.php index 75f1230cd68942a0e3635a2d758c77daa947b734..305506038a53234ebe979512c75e695f26bcdf94 100644 --- a/plugins/CoreAdminHome/CoreAdminHome.php +++ b/plugins/CoreAdminHome/CoreAdminHome.php @@ -38,7 +38,6 @@ class CoreAdminHome extends \Piwik\Plugin public function getStylesheetFiles(&$stylesheets) { $stylesheets[] = "libs/jquery/themes/base/jquery-ui.min.css"; - $stylesheets[] = "plugins/CoreAdminHome/stylesheets/menu.less"; $stylesheets[] = "plugins/Morpheus/stylesheets/base.less"; $stylesheets[] = "plugins/Morpheus/stylesheets/main.less"; $stylesheets[] = "plugins/CoreAdminHome/stylesheets/generalSettings.less"; diff --git a/plugins/CoreAdminHome/Menu.php b/plugins/CoreAdminHome/Menu.php index 7994979450ade784fd8851bc0750acc506c8c1de..b4621e2f5e356e4fedc86531c03ade9666e7bd0a 100644 --- a/plugins/CoreAdminHome/Menu.php +++ b/plugins/CoreAdminHome/Menu.php @@ -23,10 +23,10 @@ class Menu extends \Piwik\Plugin\Menu $hasAdminAccess = Piwik::isUserHasSomeAdminAccess(); if ($hasAdminAccess) { - $menu->addManageItem(null, "", $order = 1); - $menu->addSettingsItem(null, "", $order = 5); - $menu->addDiagnosticItem(null, "", $order = 10); - $menu->addDevelopmentItem(null, "", $order = 15); + $menu->addManageItem(null, array(), $order = 1); + $menu->addSettingsItem(null, array(), $order = 5); + $menu->addDiagnosticItem(null, array(), $order = 10); + $menu->addDevelopmentItem(null, array(), $order = 15); if (Piwik::hasUserSuperUserAccess()) { $menu->addSettingsItem('General_General', @@ -51,7 +51,8 @@ class Menu extends \Piwik\Plugin\Menu $url = $this->urlForAction('generalSettings'); } - $menu->addItem('CoreAdminHome_Administration', null, $url, 10); + $menu->registerMenuIcon('CoreAdminHome_Administration', 'icon-configure'); + $menu->addItem('CoreAdminHome_Administration', null, $url, 980, Piwik::translate('CoreAdminHome_Administration')); } } diff --git a/plugins/CoreAdminHome/stylesheets/generalSettings.less b/plugins/CoreAdminHome/stylesheets/generalSettings.less index eac16b6c4c01bd7a1a8ddec95b4a7003167661e3..9d232f789b65bf2229115a06f3a0478328674229 100644 --- a/plugins/CoreAdminHome/stylesheets/generalSettings.less +++ b/plugins/CoreAdminHome/stylesheets/generalSettings.less @@ -13,9 +13,6 @@ } #content.admin { - margin: 0 0 0 260px; - padding: 0 0 40px; - display: table; font-size: 13px; // Fix the <pre> blocks because of the display: table @@ -25,8 +22,8 @@ } .admin #header_message { - margin-top: 10px; - margin-right: 10px; + margin-top: 8px; + margin-right: 8px; } table.admin { @@ -92,9 +89,9 @@ table.admin tbody td:hover, table.admin tbody th:hover { width: 100%; &:first-of-type:not(.secondary) { - margin-top: 17px; + margin-top: 7px; margin-bottom: 16px; - border-bottom: 1px solid #DADADA; + border-bottom: 1px solid @theme-color-background-tinyContrast; } } @@ -162,11 +159,6 @@ table.admin tbody td:hover, table.admin tbody th:hover { margin-left: 0px; } -/* to override .admin a */ -.admin .sites_autocomplete a { - color: #255792; -} - /* trusted host styles */ #trustedHostSettings input { width: 238px; diff --git a/plugins/CoreAdminHome/stylesheets/menu.less b/plugins/CoreAdminHome/stylesheets/menu.less deleted file mode 100644 index af76bc82816fc42f784978fcd9f59b87521edd73..0000000000000000000000000000000000000000 --- a/plugins/CoreAdminHome/stylesheets/menu.less +++ /dev/null @@ -1,71 +0,0 @@ -#container { - clear: left; -} - -.Menu--admin { - padding: 0; - float: left; - width: 240px; -} - -.Menu--admin > .Menu-tabList { - -moz-background-size: 5px 100%; - background-size: 5px 100%; - background-position: 0 0, 100% 0; - background-repeat: no-repeat; -} - -.Menu--admin > .Menu-tabList { - padding-left: 5px; - margin-bottom: 0; - margin-top: 0.1em; - border: 1px solid @theme-color-background-lowContrast; - border-radius: 5px; - border-left: 0px; -} - -.Menu--admin > .Menu-tabList li { - list-style: none; - margin: 0; -} - -.Menu--admin > .Menu-tabList > li { - padding-bottom: 5px; -} - -.Menu--admin > .Menu-tabList > li > a, -.Menu--admin > .Menu-tabList > li > span { - text-decoration: none; - border-bottom: 1px dotted #778; - display: block; - padding: 5px 10px; - font-size: 18px; - color: #7E7363; -} - -.Menu--admin > .Menu-tabList li li a { - text-decoration: none; - padding: 0.6em 0.9em; - font-size: 14px; - display: block; -} - -.Menu--admin > .Menu-tabList li li a:link, -.Menu--admin > .Menu-tabList li li a:visited { - color: #000; -} - -.Menu--admin > .Menu-tabList li li a:hover, -.Menu--admin > .Menu-tabList li li a.active { - color: @theme-color-menu-contrast-textActive !important; - background: @theme-color-menu-contrast-background; - border-color: #000; -} - -.Menu--admin > .Menu-tabList li li a:hover { - text-decoration: underline; -} - -.Menu--admin > .Menu-tabList li li a.current { - background: #defdbb; -} diff --git a/plugins/CoreAdminHome/templates/_menu.twig b/plugins/CoreAdminHome/templates/_menu.twig deleted file mode 100644 index 080f36e93c1ee47da52ccaba31992889b78adecf..0000000000000000000000000000000000000000 --- a/plugins/CoreAdminHome/templates/_menu.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% import '@CoreHome/macros.twig' as corehome %} - -{{ corehome.sidebarMenu(adminMenu, currentModule, currentAction) }} \ No newline at end of file diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php index 23da8326aad66027a02ef34298694ebc8282552d..5b023b9cb387d2383d0ceb4836a8a0cb3f5c62c8 100644 --- a/plugins/CoreHome/CoreHome.php +++ b/plugins/CoreHome/CoreHome.php @@ -61,7 +61,6 @@ class CoreHome extends \Piwik\Plugin $stylesheets[] = "plugins/Morpheus/stylesheets/base.less"; $stylesheets[] = "plugins/Morpheus/stylesheets/main.less"; $stylesheets[] = "plugins/CoreHome/stylesheets/coreHome.less"; - $stylesheets[] = "plugins/CoreHome/stylesheets/menu.less"; $stylesheets[] = "plugins/CoreHome/stylesheets/dataTable.less"; $stylesheets[] = "plugins/CoreHome/stylesheets/cloud.less"; $stylesheets[] = "plugins/CoreHome/stylesheets/jquery.ui.autocomplete.css"; @@ -72,9 +71,12 @@ class CoreHome extends \Piwik\Plugin $stylesheets[] = "plugins/CoreHome/stylesheets/sparklineColors.less"; $stylesheets[] = "plugins/CoreHome/stylesheets/notification.less"; $stylesheets[] = "plugins/CoreHome/stylesheets/zen-mode.less"; + $stylesheets[] = "plugins/CoreHome/stylesheets/layout.less"; $stylesheets[] = "plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.directive.less"; $stylesheets[] = "plugins/CoreHome/angularjs/dialogtoggler/ngdialog.less"; $stylesheets[] = "plugins/CoreHome/angularjs/notification/notification.directive.less"; + $stylesheets[] = "plugins/CoreHome/angularjs/quick-access/quick-access.directive.less"; + $stylesheets[] = "plugins/CoreHome/angularjs/selector/selector.directive.less"; } public function getJsFiles(&$jsFiles) @@ -163,6 +165,11 @@ class CoreHome extends \Piwik\Plugin $jsFiles[] = "plugins/CoreHome/angularjs/ajax-form/ajax-form.controller.js"; $jsFiles[] = "plugins/CoreHome/angularjs/ajax-form/ajax-form.directive.js"; + + $jsFiles[] = "plugins/CoreHome/angularjs/quick-access/quick-access.controller.js"; + $jsFiles[] = "plugins/CoreHome/angularjs/quick-access/quick-access.directive.js"; + + $jsFiles[] = "plugins/CoreHome/angularjs/selector/selector.directive.js"; } public function getClientSideTranslationKeys(&$translationKeys) @@ -171,8 +178,11 @@ class CoreHome extends \Piwik\Plugin $translationKeys[] = 'General_Loading'; $translationKeys[] = 'General_Show'; $translationKeys[] = 'General_Hide'; + $translationKeys[] = 'General_Website'; + $translationKeys[] = 'General_ChooseWebsite'; $translationKeys[] = 'Intl_Year_Short'; $translationKeys[] = 'General_MultiSitesSummary'; + $translationKeys[] = 'General_SearchNoResults'; $translationKeys[] = 'CoreHome_YouAreUsingTheLatestVersion'; $translationKeys[] = 'CoreHome_IncludeRowsWithLowPopulation'; $translationKeys[] = 'CoreHome_ExcludeRowsWithLowPopulation'; @@ -184,6 +194,7 @@ class CoreHome extends \Piwik\Plugin $translationKeys[] = 'CoreHome_UnFlattenDataTable'; $translationKeys[] = 'CoreHome_ExternalHelp'; $translationKeys[] = 'CoreHome_ClickToEditX'; + $translationKeys[] = 'CoreHome_Menu'; $translationKeys[] = 'SitesManager_NotFound'; $translationKeys[] = 'Annotations_ViewAndAddAnnotations'; $translationKeys[] = 'General_RowEvolutionRowActionTooltipTitle'; @@ -255,8 +266,10 @@ class CoreHome extends \Piwik\Plugin $translationKeys[] = 'General_LoadingData'; $translationKeys[] = 'General_ErrorRequest'; $translationKeys[] = 'General_YourChangesHaveBeenSaved'; + $translationKeys[] = 'General_LearnMore'; $translationKeys[] = 'CoreHome_UndoPivotBySubtable'; $translationKeys[] = 'CoreHome_PivotBySubtable'; - $translationKeys[] = 'General_LearnMore'; + $translationKeys[] = 'CoreHome_QuickAccessTitle'; + $translationKeys[] = 'CoreHome_Segments'; } } diff --git a/plugins/CoreHome/Menu.php b/plugins/CoreHome/Menu.php index 83e5d053d66c38f87da1522f01fd18ba3d0580e3..20d9ac8eb8ba9d10801eb54db2f44ea38593b851 100644 --- a/plugins/CoreHome/Menu.php +++ b/plugins/CoreHome/Menu.php @@ -27,24 +27,29 @@ class Menu extends \Piwik\Plugin\Menu } if (Plugin\Manager::getInstance()->isPluginActivated('Feedback')) { - $menu->addItem('General_Help', null, array('module' => 'Feedback', 'action' => 'index')); + $menu->registerMenuIcon('General_Help', 'icon-help'); + $menu->addItem('General_Help', null, array('module' => 'Feedback', 'action' => 'index'), $order = 990, Piwik::translate('General_Help')); } + $menu->registerMenuIcon($login, 'icon-user'); + if (Piwik::isUserIsAnonymous()) { - if (Plugin\Manager::getInstance()->isPluginActivated('Feedback')) { - $menu->addItem($login, null, array('module' => 'Feedback', 'action' => 'index'), 998); + if (Plugin\Manager::getInstance()->isPluginActivated('ScheduledReports')) { + $menu->addItem($login, null, array('module' => 'ScheduledReports', 'action' => 'index'), 970, $login); } else { - $menu->addItem($login, null, array('module' => 'API', 'action' => 'listAllAPI'), 998); + $menu->addItem($login, null, array('module' => 'API', 'action' => 'listAllAPI'), 970, $login); } } else { - $menu->addItem($login, null, array('module' => 'UsersManager', 'action' => 'userSettings'), 998); + $menu->addItem($login, null, array('module' => 'UsersManager', 'action' => 'userSettings'), 970, $login); } $module = $this->getLoginModule(); if (Piwik::isUserIsAnonymous()) { - $menu->addItem('Login_LogIn', null, array('module' => $module, 'action' => false), 999); + $menu->registerMenuIcon('Login_LogIn', 'icon-sign-in'); + $menu->addItem('Login_LogIn', null, array('module' => $module, 'action' => false), 1000, Piwik::translate('Login_LogIn')); } else { - $menu->addItem('General_Logout', null, array('module' => $module, 'action' => 'logout', 'idSite' => null), 999); + $menu->registerMenuIcon('General_Logout', 'icon-sign-out'); + $menu->addItem('General_Logout', null, array('module' => $module, 'action' => 'logout', 'idSite' => null), 1000, Piwik::translate('General_Logout')); } } diff --git a/plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.directive.less b/plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.directive.less index 054c0bdba0024f8e90dd9888d8addbf886876639..4ffb8326f0ea06517a65731e6649307bdeb98684 100644 --- a/plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.directive.less +++ b/plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.directive.less @@ -2,6 +2,16 @@ display: none; } +[piwik-enriched-headline] { + visibility: hidden; + height: 47px; +} + +[piwik-enriched-headline].ng-isolate-scope { + visibility: visible; + height: auto; +} + .enrichedHeadline { min-height: 22px; diff --git a/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.html b/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.html index d1964d1ac4718521ea0e10ec39d4a17767e71138..5da730a2e2a90f009a08e82d9a75f8f118342065 100644 --- a/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.html +++ b/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.html @@ -5,7 +5,7 @@ title="{{ tooltip }}" ng-bind-html="menuTitle"/> - <div class="items" ng-show="view.showItems"> + <div class="items borderedControl" ng-show="view.showItems"> <div class="search" ng-if="showSearch && view.showItems"> <input type="text" piwik-focus-if="view.showItems" diff --git a/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.less b/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.less index da8b79a1fc00a46f28767a33e39d5259bfbc864c..a36d00c0f5b5772291f4053d48cd6b8e6198da39 100644 --- a/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.less +++ b/plugins/CoreHome/angularjs/menudropdown/menudropdown.directive.less @@ -25,9 +25,9 @@ } .items { - z-index: 21; + z-index: 200; position: absolute; - border: 1px solid @color-silver-l80 !important; + border: 1px solid @color-silver-l80; background: @theme-color-background-base; max-height: 400px; overflow-y: auto; @@ -41,7 +41,7 @@ .search_ico { position: absolute; right: 25px; - top: 22px; + top: 27px; margin: 0px; left: initial; } @@ -74,11 +74,11 @@ text-align: left; &:hover { - background: @color-silver-l80; + background: @theme-color-background-tinyContrast; } &.active { - background-color: @color-silver-l80; + background-color: @theme-color-background-tinyContrast; } &.category { diff --git a/plugins/CoreHome/angularjs/quick-access/quick-access.controller.js b/plugins/CoreHome/angularjs/quick-access/quick-access.controller.js new file mode 100644 index 0000000000000000000000000000000000000000..9e1fefba82c4960b7c532597922e67efb78446ab --- /dev/null +++ b/plugins/CoreHome/angularjs/quick-access/quick-access.controller.js @@ -0,0 +1,78 @@ +/*! + * 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('QuickAccessController', QuickAccessController); + + QuickAccessController.$inject = ['$scope', '$filter', 'siteSelectorModel']; + + function QuickAccessController($scope, $filter, siteSelectorModel){ + + this.menuItems = []; + this.numMenuItems = 0; + this.sitesModel = siteSelectorModel; + + this.onKeypress = function (event) { + if (38 == event.which) { + $scope.highlightPreviousItem(); + event.preventDefault(); + } else if (40 == event.which) { + $scope.highlightNextItem(); + event.preventDefault(); + } else if (13 == event.which) { + $scope.clickQuickAccessMenuItem(); + } + }; + + this.searchMenu = function (searchTerm) { + searchTerm = searchTerm.toLowerCase(); + + var index = -1; + var menuItemsIndex = {}; + var menuItems = []; + + var moveToCategory = function (i, submenuItem) { + submenuItem = angular.copy(submenuItem); // force rerender of element to prevent weird side effects + submenuItem.menuIndex = ++index; // needed for proper highlighting with arrow keys + + var category = submenuItem.category; + if (!(category in menuItemsIndex)) { + menuItems.push({title: category, items: []}); + menuItemsIndex[category] = menuItems.length - 1; + } + + var indexOfCategory = menuItemsIndex[category]; + menuItems[indexOfCategory].items.push(submenuItem); + }; + + $scope.resetSearchIndex(); + + if ($scope.hasSitesSelector) { + this.sitesModel.searchSite(searchTerm); + } + + var topMenuItems = $filter('filter')($scope.getTopMenuItems(), searchTerm); + var leftMenuItems = $filter('filter')($scope.getLeftMenuItems(), searchTerm); + var segmentItems = $filter('filter')($scope.getSegmentItems(), searchTerm); + + $.each(topMenuItems, moveToCategory); + $.each(leftMenuItems, moveToCategory); + $.each(segmentItems, moveToCategory); + + this.numMenuItems = topMenuItems.length + leftMenuItems.length + segmentItems.length; + this.menuItems = menuItems; + }; + + this.selectSite = function (idsite) { + this.sitesModel.loadSite(idsite); + }; + + this.selectMenuItem = function (index) { + $scope.selectMenuItem(index); + }; + + } +})(); diff --git a/plugins/CoreHome/angularjs/quick-access/quick-access.directive.html b/plugins/CoreHome/angularjs/quick-access/quick-access.directive.html new file mode 100644 index 0000000000000000000000000000000000000000..ccf97c14dc22ab4050d6666942d4a44a7e217f75 --- /dev/null +++ b/plugins/CoreHome/angularjs/quick-access/quick-access.directive.html @@ -0,0 +1,36 @@ +<div class="quick-access" title="{{ 'CoreHome_QuickAccessTitle' | translate }}" + ng-class="{active: view.searchActive, expanded: view.searchActive}" + piwik-focus-anywhere-but-here="view.searchActive = false;"> + <span class="icon-search" ng-hide="search.term || view.searchActive" + ng-mouseenter="view.searchActive=true"></span> + <input ng-keydown="quickAccess.onKeypress($event)" + ng-change="view.searchActive=true;quickAccess.searchMenu(search.term)" + ng-focus="view.searchActive=true" + ng-model="search.term" piwik-focus-if="view.searchActive" + type="text"/> + <ul ng-hide="!search.term || !view.searchActive || (quickAccess.numMenuItems > 0) || (quickAccess.sitesModel.sites | length)"> + <li class="no-result">{{ 'General_SearchNoResults' | translate }}</li> + </ul> + <ul ng-show="search.term && view.searchActive" ng-repeat="subcategory in quickAccess.menuItems"> + <li class="quick-access-category" + ng-click="search.term = subcategory.title;quickAccess.searchMenu(search.term)">{{ subcategory.title }}</li> + <li class="result" + ng-class="{selected: submenuEntry.menuIndex == search.index}" + ng-mouseenter="search.index=submenuEntry.menuIndex" + ng-click="quickAccess.selectMenuItem(submenuEntry.index)" + ng-repeat="submenuEntry in subcategory.items"><a>{{ submenuEntry.name | trim }}</a></li> + </ul> + <ul ng-show="search.term && view.searchActive"> + <li class="quick-access-category websiteCategory" + ng-show="hasSitesSelector && ((quickAccess.sitesModel.sites | length) || quickAccess.sitesModel.isLoading)" + >{{ 'SitesManager_Sites' | translate }}</li> + <li class="no-result" + ng-show="hasSitesSelector && quickAccess.sitesModel.isLoading">{{ 'MultiSites_LoadingWebsites' | translate }}</li> + <li class="result" + ng-show="hasSitesSelector && !quickAccess.sitesModel.isLoading" + ng-mouseenter="search.index=(quickAccess.numMenuItems + $index)" + ng-class="{selected: (quickAccess.numMenuItems + $index) == search.index}" + ng-click="quickAccess.selectSite(site.idsite)" + ng-repeat="site in quickAccess.sitesModel.sites"><a ng-bind-html="site.name"></a></li> + </ul> +</div> \ No newline at end of file diff --git a/plugins/CoreHome/angularjs/quick-access/quick-access.directive.js b/plugins/CoreHome/angularjs/quick-access/quick-access.directive.js new file mode 100644 index 0000000000000000000000000000000000000000..226b325ee0ebaeda03e57ab9f1bb7273251009a7 --- /dev/null +++ b/plugins/CoreHome/angularjs/quick-access/quick-access.directive.js @@ -0,0 +1,258 @@ +/*! + * 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-dialog="showDialog">...</div> + * Will show dialog once showDialog evaluates to true. + * + * Will execute the "executeMyFunction" function in the current scope once the yes button is pressed. + */ +(function () { + angular.module('piwikApp').directive('piwikQuickAccess', QuickAccessDirective); + + QuickAccessDirective.$inject = ['$rootElement', '$timeout', 'piwik']; + + function QuickAccessDirective ($rootElement, $timeout, piwik) { + + return { + restrict: 'A', + replace: true, + scope: {}, + templateUrl: 'plugins/CoreHome/angularjs/quick-access/quick-access.directive.html?cb=' + piwik.cacheBuster, + controller: 'QuickAccessController', + controllerAs: 'quickAccess', + link: function (scope, element, attrs) { + + var menuIndex = -1; // the menu index is used to identify which element to click + var topMenuItems = []; // cache for top menu items + var leftMenuItems = []; // cache for left menu items + var segmentItems = []; // cache for segment items + var hasSegmentSelector = angular.element('.segmentEditorPanel').length; + scope.hasSitesSelector = angular.element('[piwik-siteselector]').length; + + function trim(str) { + return str.replace(/^\s+|\s+$/g,''); + } + + scope.getTopMenuItems = function() + { + if (topMenuItems && topMenuItems.length) { + return topMenuItems; + } + + var category = _pk_translate('CoreHome_Menu'); + + $rootElement.find('#topRightBar .navbar-right li > a').each(function (index, element) { + var $element = $(element); + + if ($element.is('#topmenu-usersmanager')) { + // ignore languages manager + return; + } + + var text = trim($element.text()); + + if (!text) { + text = trim($element.attr('title')); // possibly a icon, use title instead + } + + if (text) { + topMenuItems.push({name: text, index: ++menuIndex, category: category}); + $element.attr('quick_access', menuIndex); + } + }); + + return topMenuItems; + }; + + scope.getLeftMenuItems = function () + { + if (leftMenuItems && leftMenuItems.length) { + return leftMenuItems; + } + + $rootElement.find('#secondNavBar .menuTab').each(function (index, element) { + var $element = angular.element(element); + var category = trim($element.find('> .item').text()); + + if (category && -1 !== category.lastIndexOf("\n")) { + // remove "\n\nMenu" + category = trim(category.substr(0, category.lastIndexOf("\n"))); + } + + $element.find('li .item').each(function (i, element) { + var $element = angular.element(element); + var text = trim($element.text()); + + if (text) { + leftMenuItems.push({name: text, category: category, index: ++menuIndex}); + $element.attr('quick_access', menuIndex); + } + }) + + }); + + return leftMenuItems; + }; + + scope.getSegmentItems = function() + { + if (!hasSegmentSelector) { + return []; + } + + if (segmentItems && segmentItems.length) { + return segmentItems; + } + + var category = _pk_translate('CoreHome_Segments'); + + $rootElement.find('.segmentList [data-idsegment]').each(function (index, element) { + var $element = angular.element(element); + var text = trim($element.find('.segname').text()); + + if (text) { + segmentItems.push({name: text, category: category, index: ++menuIndex}); + $element.attr('quick_access', menuIndex); + } + }); + + return segmentItems; + }; + + scope.activateSearch = function() + { + scope.$eval('view.searchActive = true'); + $timeout(function () { + scope.$apply(); + }, 0); + }; + + scope.deactivateSearch = function() + { + scope.$eval('search.term = ""'); + scope.$eval('view.searchActive = false'); + element.find('input').blur(); + $timeout(function () { + scope.$apply(); + }, 0); + }; + + function isElementInViewport(element) { + + var rect = element.getBoundingClientRect(); + + return ( + rect.top >= 0 && + rect.left >= 0 && + rect.bottom <= $(window).height() && + rect.right <= $(window).width() + ); + } + + function getCurrentlySelectedElement(index) + { + var results = element.find('li.result'); + if (results && results.length && results[scope.search.index]) { + return $(results[scope.search.index]); + } + } + + function makeSureSelectedItemIsInViewport() { + var element = getCurrentlySelectedElement(); + + if (element && element[0] && !isElementInViewport(element[0])) { + scrollFirstElementIntoView(element); + } + } + + function scrollFirstElementIntoView(element) + { + if (element && element[0] && element[0].scrollIntoView) { + // make sure search is visible + element[0].scrollIntoView(); + } + } + + scope.highlightPreviousItem = function() + { + if (0 >= (scope.search.index - 1)) { + scope.search.index = 0; + } else { + scope.search.index--; + } + makeSureSelectedItemIsInViewport(); + }; + + scope.resetSearchIndex = function () { + scope.search.index = 0; + makeSureSelectedItemIsInViewport(); + }; + + scope.highlightNextItem = function() + { + var numTotal = element.find('li.result').length; + + if (numTotal <= (scope.search.index + 1)) { + scope.search.index = numTotal - 1; + } else { + scope.search.index++; + } + + makeSureSelectedItemIsInViewport(); + }; + + scope.clickQuickAccessMenuItem = function() + { + var selectedMenuElement = getCurrentlySelectedElement(); + if (selectedMenuElement) { + $timeout(function () { + selectedMenuElement.click(); + }, 20); + } + }; + + scope.selectMenuItem = function(index) + { + var target = $rootElement.find('[quick_access=' + index + ']'); + + if (target && target.length && target[0]) { + scope.deactivateSearch(); + + var actualTarget = target[0]; + + var href = $(actualTarget).attr('href'); + + if (href && href.length > 10 && actualTarget && actualTarget.click) { + try { + actualTarget.click(); + } catch (e) { + $(actualTarget).click(); + } + } else { + $(actualTarget).click(); + } + } + }; + + Mousetrap.bind('f', function(event) { + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; // IE + } + + scrollFirstElementIntoView(element); + + scope.activateSearch(); + }); + + } + }; + } +})(); \ No newline at end of file diff --git a/plugins/CoreHome/angularjs/quick-access/quick-access.directive.less b/plugins/CoreHome/angularjs/quick-access/quick-access.directive.less new file mode 100644 index 0000000000000000000000000000000000000000..1c46c7533d19fa43332b1a3f0d7c383df29d0f4f --- /dev/null +++ b/plugins/CoreHome/angularjs/quick-access/quick-access.directive.less @@ -0,0 +1,55 @@ +.quick-access { + position: relative; + + li { + font-size: 11px; + } + + li a { + padding: 10px 19px; + display: inline-block; + text-decoration: none; + word-break: break-all; + } + + .icon-search { + position: absolute; + font-size: 14px; + top: 10px; + left: 10px; + + } + input { + width:100%; + height: 100%; + border: 0 !important; + box-shadow: 0 0 !important; + border-radius: 0 !important; + font-size: 11px; + &:focus { + outline: none; + } + } + .selected { + background-color: @theme-color-background-tinyContrast !important; + } + .quick-access-category { + text-align: left !important; + font-size: 11px; + padding: 5px 5px 5px 10px; + cursor: pointer; + } + .result { + cursor: pointer; + } + .quick-access-category:hover { + background: none !important; + } + .no-result { + padding: 10px 19px; + cursor: default; + } + .websiteCategory { + cursor: default; + } +} \ No newline at end of file diff --git a/plugins/CoreHome/angularjs/selector/selector.directive.js b/plugins/CoreHome/angularjs/selector/selector.directive.js new file mode 100644 index 0000000000000000000000000000000000000000..eec9dda6d134540c27b660edfc3920880d6f4c59 --- /dev/null +++ b/plugins/CoreHome/angularjs/selector/selector.directive.js @@ -0,0 +1,86 @@ +/*! + * 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').directive('piwikExpandOnClick', piwikExpandOnClick); + + piwikExpandOnClick.$inject = ['$document']; + + function piwikExpandOnClick($document){ + + return { + restrict: 'A', + link: function(scope, element, attr) { + element.find('.title').on('click', function () { + element.toggleClass('expanded'); + }); + + function onClickOutsideElement (event) { + if (element.has(event.target).length === 0) { + element.removeClass('expanded'); + } + } + + function onEscapeHandler (event) { + if (event.which === 27) { + element.removeClass('expanded'); + } + } + + $document.on('keyup', onEscapeHandler); + $document.on('mouseup', onClickOutsideElement); + scope.$on('$destroy', function() { + $document.off('mouseup', onClickOutsideElement); + $document.off('keyup', onEscapeHandler); + }); + } + }; + } + + angular.module('piwikApp').directive('piwikExpandOnHover', piwikExpandOnHover); + + piwikExpandOnHover.$inject = ['$document']; + + function piwikExpandOnHover($document){ + + return { + restrict: 'A', + link: function(scope, element, attr) { + + element.on('mouseenter', '.title', function () { + element.addClass('expanded'); + }); + + element.on('mouseleave', function () { + element.removeClass('expanded'); + }); + + function onClickOutsideElement (event) { + if (element.has(event.target).length === 0) { + element.removeClass('expanded'); + } + } + + function onEscapeHandler (event) { + if (event.which === 27) { + element.removeClass('expanded'); + } + } + + $document.on('keyup', onEscapeHandler); + $document.on('mouseup', onClickOutsideElement); + scope.$on('$destroy', function() { + $document.off('mouseup', onClickOutsideElement); + $document.off('keyup', onEscapeHandler); + }); + } + }; + } +})(); diff --git a/plugins/CoreHome/angularjs/selector/selector.directive.less b/plugins/CoreHome/angularjs/selector/selector.directive.less new file mode 100644 index 0000000000000000000000000000000000000000..9c0e207d4d0dec2d22d1b77a84ed636a41f296eb --- /dev/null +++ b/plugins/CoreHome/angularjs/selector/selector.directive.less @@ -0,0 +1,59 @@ +.piwikSelector { + display: inline-block; + line-height: 0; + + span.title, + a.title { + .font-default(11px, 12px); + display: inline-block; + width: 100%; + padding: 11px 19px 10px; + white-space: nowrap; + cursor: pointer; + text-transform: uppercase; + text-decoration: none; + color: @theme-color-text; + + &.activityIndicator { + background: url(plugins/Morpheus/images/loading-blue.gif) no-repeat right 9px; + + .icon { + visibility: hidden; + } + } + + .icon { + padding-left: 6px; + display: inline-block; + vertical-align: top; + + &.iconHidden { + visibility: hidden; + } + } + + .icon:not(.icon-fixed) { + float: right; + &:after { + clear:right; + content: ' '; + } + } + + &:hover, &:focus { + text-decoration: none; + } + } + + .dropdown { + .font-default(11px, 15px); + display: none; + padding: 5px 19px 11px 19px; + } + + &.expanded { + .dropdown { + display: block; + } + } +} diff --git a/plugins/CoreHome/angularjs/siteselector/siteselector.directive.html b/plugins/CoreHome/angularjs/siteselector/siteselector.directive.html index 5f6a3cac8ad029ca3c96fbed82095c33e6e2cc74..3a4cbec8f29f9849858964e8ba0866d08d8cdd83 100644 --- a/plugins/CoreHome/angularjs/siteselector/siteselector.directive.html +++ b/plugins/CoreHome/angularjs/siteselector/siteselector.directive.html @@ -1,5 +1,6 @@ -<div piwik-focus-anywhere-but-here="view.showSitesList=false" class="custom_select" - ng-class="{'sites_autocomplete--dropdown': (model.hasMultipleWebsites || showAllSitesItem || !model.sites.length)}"> +<div piwik-focus-anywhere-but-here="view.showSitesList=false" + class="siteSelector piwikSelector borderedControl" + ng-class="{'expanded': view.showSitesList}"> <script type="text/ng-template" id="siteselector_allsiteslink.html"> <div ng-click="switchSite({idsite: 'all', name: allSitesText});view.showSitesList=false;" @@ -13,13 +14,19 @@ <input ng-if="inputName" type="hidden" name="{{ inputName }}" ng-value="selectedSite.id"/> <a ng-click="view.showSitesList=!view.showSitesList; view.showSitesList && model.loadInitialSites();" + piwik-onenter="view.showSitesList=!view.showSitesList; view.showSitesList && model.loadInitialSites();" href="javascript:void(0)" - class="custom_select_main_link" - ng-class="{'loading': model.isLoading}"> - <span ng-bind-html="selectedSite.name || model.firstSiteName">?</span> + title="{{ 'General_ChooseWebsite'|translate }}" + ng-class="{'loading': model.isLoading}" + class="title"> + <span class="icon icon-arrow-bottom" + ng-class="{'iconHidden': model.isLoading, 'collapsed': !view.showSitesList}"></span> + <span>{{ 'General_Website'| translate }}: + <span ng-bind-html="selectedSite.name || model.firstSiteName">?</span> + </span> </a> - <div ng-show="view.showSitesList" class="custom_select_block"> + <div ng-show="view.showSitesList" class="dropdown"> <div ng-if="allSitesLocation=='top' && showAllSitesItem" ng-include="'siteselector_allsiteslink.html'"></div> @@ -49,10 +56,8 @@ ng-click="view.searchTerm=''" ng-model="view.searchTerm" ng-change="model.searchSite(view.searchTerm)" + placeholder="{{ 'General_Search' | translate }}" class="websiteSearch inp"/> - <input type="submit" - ng-click="model.searchSite(view.searchTerm)" - value="{{ 'General_Search' | translate }}" class="but"/> <img title="Clear" ng-show="view.searchTerm" ng-click="view.searchTerm=''; model.loadInitialSites()" diff --git a/plugins/CoreHome/angularjs/siteselector/siteselector.directive.js b/plugins/CoreHome/angularjs/siteselector/siteselector.directive.js index 450813f2e14a631705144688f91162769a172af6..ba5c492cb84f57d045807b317e69044a7b817ece 100644 --- a/plugins/CoreHome/angularjs/siteselector/siteselector.directive.js +++ b/plugins/CoreHome/angularjs/siteselector/siteselector.directive.js @@ -26,9 +26,9 @@ (function () { angular.module('piwikApp').directive('piwikSiteselector', piwikSiteselector); - piwikSiteselector.$inject = ['$document', 'piwik', '$filter']; + piwikSiteselector.$inject = ['$document', 'piwik', '$filter', '$timeout']; - function piwikSiteselector($document, piwik, $filter){ + function piwikSiteselector($document, piwik, $filter, $timeout){ var defaults = { name: '', siteid: piwik.idSite, @@ -85,6 +85,10 @@ scope.$watch('view.showSitesList', function (newValue) { element.toggleClass('expanded', !! newValue); }); + + $timeout(function () { + initTopControls(); + }); }; } }; diff --git a/plugins/CoreHome/angularjs/siteselector/siteselector.directive.less b/plugins/CoreHome/angularjs/siteselector/siteselector.directive.less index 8b38e556df88e8d52a3009be7edfac1a0369b11c..b0818ac472c98d0b6c94d090c7c0bbad55b1efad 100644 --- a/plugins/CoreHome/angularjs/siteselector/siteselector.directive.less +++ b/plugins/CoreHome/angularjs/siteselector/siteselector.directive.less @@ -1,155 +1,137 @@ - -/*sites_autocomplete*/ -.sites_autocomplete { - position: absolute; - font-size: 12px; - display: inline-block; - height: 30px; /* Hack to not push the dashboard widget below */ -} - -table.dataTable tr td .sites_autocomplete a { - width: auto; -} - -.sites_selector_in_dashboard { - margin-top:10px; -} -.top_bar_sites_selector { - float: right -} - -.top_bar_sites_selector > label { - display: inline-block; - padding: 7px 0 6px 0; - float: left; - font-size: 12px; -} - -.top_bar_sites_selector > .sites_autocomplete { - position: static; - margin-left: 12px; -} - .autocompleteMatched { color: #5256BE; font-weight: bold; } - -.sites_autocomplete .custom_select { - float: left; - position: relative; - z-index: 19; - background: @theme-color-background-base url(plugins/Morpheus/images/sites_selection.png) repeat-x 0 0; - border: 1px solid @color-silver-l85; - color: #255792; - border-radius: 4px; - cursor: pointer; - width: 205px; -} - -.sites_autocomplete .custom_select_main_link { - display: block; - text-decoration: none; - background: none; - cursor: default; - padding: 9px 5px 7px 5px; -} - -#content.admin .adminTable .sites_autocomplete a { - text-decoration: none; -} - -.sites_autocomplete .custom_select_ul_list li a, -.sites_autocomplete .custom_select_all a, -.sites_autocomplete .custom_select_main_link > span { +.siteSelector { + a.title { + .icon.collapsed.iconHidden { + visibility: visible; + } + } + .dropdown { + max-width: 210px; + } +} + +#content { + .sites_autocomplete { + position: static !important; + height: 36px; + z-index: 99; + vertical-align: middle; + + > .siteSelector { + position: absolute; + z-index: 9999; + } + + a.title { + text-decoration: none; + } + } +} + +.siteSelector.expanded { + .loading { + background: url(plugins/Morpheus/images/loading-blue.gif) no-repeat right 9px; + } +} + +.siteSelector a.title, +.siteSelector .custom_select_ul_list li a, +.siteSelector .custom_select_all a, +.siteSelector .custom_select_main_link > span { display: inline-block; - max-width: 170px; + max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - padding: 0 10px 0 4px; -} - -.sites_autocomplete--dropdown .custom_select_main_link:not(.loading):before { - content: " \25BC"; - position: absolute; - right: 0; - font-size: 0.8em; - margin-top: 0.2em; - color: @theme-color-text-light; - margin-top: 9px; + padding: 0; + color: @theme-color-text; + text-transform: uppercase; + width: 100%; } -.sites_autocomplete--dropdown .custom_select_main_link { - cursor: pointer; - position: relative; -} +.siteSelector a.title { + > span { + max-width: 161px; + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; + } -.sites_autocomplete .custom_select_main_link.loading { - background: url(plugins/Morpheus/images/loading-blue.gif) no-repeat right 9px; + span { + vertical-align: top; + } } -.sites_autocomplete .custom_select_ul_list, -.sites_autocomplete ul.ui-autocomplete { +.siteSelector .custom_select_ul_list, +.siteSelector ul.ui-autocomplete { position: relative; list-style: none; line-height: 18px; padding: 0 0 15px 0; + box-shadow: none !important; } -.sites_autocomplete .custom_select_ul_list li a, -.sites_autocomplete .custom_select_all a { +.siteSelector .custom_select_ul_list { + padding: 0 0 5px 0; +} + +.siteSelector .dropdown { + padding-top: 0; +} + +.siteSelector .custom_select_ul_list li a, +.siteSelector .custom_select_all a { line-height: 18px; height: auto; display: block; text-decoration: none; + padding-left: 5px; + margin-left: -5px; } -.sites_autocomplete .custom_select_ul_list li a:hover, -.sites_autocomplete .custom_select_all a:hover { +.siteSelector .custom_select_ul_list li a:hover, +.siteSelector .custom_select_all a:hover { background: #ebeae6; } -.sites_autocomplete .custom_select_all a { +.siteSelector .custom_select_all a { text-decoration: none; - margin: 0 0 5px 0; + margin: 0 0 5px -5px; } -.sites_autocomplete .custom_select_search { - margin: 0 0 0 4px; - height: 26px; +.siteSelector .custom_select_search { + margin: 0; + height: 33px; display: block; white-space: nowrap; - background: url(plugins/Morpheus/images/search_bg.png) no-repeat 0 0; -} - -.sites_autocomplete .custom_select_search .inp { - vertical-align: top; - width: 165px; - padding: 2px 6px !important; - border: 0 !important; - background: transparent !important; - font-size: 10px !important; - color: #454545 !important; - -} -.sites_autocomplete { - width: 205px; -} - -.sites_autocomplete .custom_select_search .but { - vertical-align: top; - font-size: 10px; - border: 0; - background: transparent; - width: 21px; - height: 17px; - overflow: hidden; - opacity: 0; - cursor: pointer; + position: relative; + padding-top: 4px; + + .inp { + vertical-align: top; + width: 100%; + padding: 4px 6px !important; + border: 1px solid #d0d0d0 !important; + background: transparent !important; + font-size: 11px !important; + color: #454545 !important; + } + .reset { + position: absolute; + top: 4px; + right: 4px; + cursor: pointer; + } +} + +.siteSelector { + width: auto; } -.sites_selector_container>.sites_autocomplete { +.sites_selector_container>.siteSelector { padding-left: 12px; } @@ -158,17 +140,6 @@ table.dataTable tr td .sites_autocomplete a { float:none;position:static } -.custom_select_search .reset { - position: relative; top: 3px; left: -50px; cursor: pointer; -} - -.custom_select_block { - overflow: hidden; - max-width: inherit; - visibility: visible; - padding: 0 5px 7px 5px; -} - .custom_select_block_show { height: auto; overflow: visible; diff --git a/plugins/CoreHome/javascripts/calendar.js b/plugins/CoreHome/javascripts/calendar.js index ceb11e4ec4e8d9f94825daac036445c7c0448798..d4119de31b41065d1cd0ba698cfcac9711d6ac86 100644 --- a/plugins/CoreHome/javascripts/calendar.js +++ b/plugins/CoreHome/javascripts/calendar.js @@ -473,21 +473,6 @@ toggleMonthDropdown(selectedPeriod == 'year'); }); - // reset date/period when opening calendar - $("#periodString").on('click', "#date,.calendar-icon", function () { - var periodMore = $("#periodMore").toggle(); - if (periodMore.is(":visible")) { - periodMore.find(".ui-state-highlight").removeClass('ui-state-highlight'); - } - }); - - $('body').on('click', function(e) { - var target = $(e.target); - if (target.closest('html').length && !target.closest('#periodString').length && !target.is('option') && $("#periodMore").is(":visible")) { - $("#periodMore").hide(); - } - }); - function onDateRangeSelect(dateText, inst) { var toOrFrom = inst.id == 'calendarFrom' ? 'From' : 'To'; $('#inputCalendar' + toOrFrom).val(dateText); diff --git a/plugins/CoreHome/javascripts/corehome.js b/plugins/CoreHome/javascripts/corehome.js index 5bddc23f9e5a2a105513e131b84ec3ffd49bad5f..4580ddca8c557df27fb51185db8d2f61f3853974 100755 --- a/plugins/CoreHome/javascripts/corehome.js +++ b/plugins/CoreHome/javascripts/corehome.js @@ -16,9 +16,13 @@ var headerMessageParent = $('#header_message').parent(); // when 'check for updates...' link is clicked, force a check & display the result - headerMessageParent.on('click', '#updateCheckLinkContainer', function (e) { + headerMessageParent.on('click', '.title', function (e) { e.preventDefault(); + if (!$(this).find('#updateCheckLinkContainer').length) { + return; + } + var headerMessage = $(this).closest('#header_message'); var ajaxRequest = new ajaxHelper(); @@ -27,16 +31,23 @@ module: 'CoreHome', action: 'checkForUpdates' }, 'get'); + + var $titleElement = $(this); + $titleElement.addClass('activityIndicator'); ajaxRequest.setCallback(function (response) { headerMessage.fadeOut('slow', function () { response = $(response); + $titleElement.removeClass('activityIndicator'); + var newVersionAvailable = response.hasClass('header_alert'); if (newVersionAvailable) { headerMessage.replaceWith(response); + headerMessage.show(); } else { - headerMessage.html(_pk_translate('CoreHome_YouAreUsingTheLatestVersion')).show(); + headerMessage.find('.title').html(_pk_translate('CoreHome_YouAreUsingTheLatestVersion')); + headerMessage.show(); setTimeout(function () { headerMessage.fadeOut('slow', function () { headerMessage.replaceWith(response); @@ -54,7 +65,7 @@ // when clicking the header message, show the long message w/o needing to hover headerMessageParent.on('click', '#header_message', function (e) { if (e.target.tagName.toLowerCase() != 'a') { - $(this).toggleClass('active'); + $(this).toggleClass('expanded'); } }); diff --git a/plugins/CoreHome/javascripts/menu.js b/plugins/CoreHome/javascripts/menu.js index 2f5e16c827fb57e147ee4e5915c80b0658a2b665..2f3a78a045b9fcf27794f47d4b1090b133620bed 100644 --- a/plugins/CoreHome/javascripts/menu.js +++ b/plugins/CoreHome/javascripts/menu.js @@ -16,46 +16,76 @@ menu.prototype = { resetTimer: null, - adaptSubMenuHeight: function() { - var subNavHeight = $('.sfHover > ul').outerHeight(); - $('.nav_sep').height(subNavHeight); - }, - - overMainLI: function () { - var $this = $(this); - $this.siblings().removeClass('sfHover'); - $this.addClass('sfHover'); - menu.prototype.adaptSubMenuHeight(); - clearTimeout(menu.prototype.resetTimer); - }, - - outMainLI: function () { - clearTimeout(menu.prototype.resetTimer); - menu.prototype.resetTimer = setTimeout(function() { - $('.Menu-tabList > .sfHover', this.menuNode).removeClass('sfHover'); - $('.Menu-tabList > .sfActive', this.menuNode).addClass('sfHover'); - menu.prototype.adaptSubMenuHeight(); - }, 2000); - }, - onItemClick: function (e) { if (e.which === 2) { return; } - $('.Menu--dashboard').trigger('piwikSwitchPage', this); - broadcast.propagateAjax( $(this).attr('href').substr(1) ); - return false; + + $('#secondNavBar').trigger('piwikSwitchPage', this); + $('#secondNavBar').removeClass('open fadeInLeft'); + + if (!$('#content.admin').size()) { + broadcast.propagateAjax( $(this).attr('href').substr(1) ); + + return false; + } + + var href = $(this).attr('href'); + return !!href; + }, + + isAdmin: function () { + return !!$('#content.admin').size(); }, init: function () { - this.menuNode = $('.Menu--dashboard'); + this.menuNode = $('#secondNavBar'); - this.menuNode.find("li:has(ul),li#Searchmenu").hover(this.overMainLI, this.outMainLI); - this.menuNode.find("li:has(ul),li#Searchmenu").focusin(this.overMainLI); + // add id to all li menu to support menu identification. + // for all sub menu we want to have a unique id based on their module and action + // for main menu we want to add just the module as its id. + this.menuNode.find('li').each(function () { + var $this = $(this); + var link = $this.find('a'); - this.menuNode.find('a.menuItem').click(this.onItemClick); + var main_menu = $this.parent().hasClass('navbar') ? true : false; - menu.prototype.adaptSubMenuHeight(); + if (!link) { + return; + } + + var href = link.attr('href'); + if (!href) { + if (main_menu && !$this.find('li').length) { + $this.hide(); // no link and no child menu items -> hide it + } + return; + } + var url = href.substr(1); + + var module = broadcast.getValueFromUrl('module', url); + var action = broadcast.getValueFromUrl('action', url); + + var moduleId = broadcast.getValueFromUrl("idGoal", url) || broadcast.getValueFromUrl("idDashboard", url); + + if (main_menu) { + $this.attr({id: module}); + } + // if there's a idGoal or idDashboard, use this in the ID + else if (moduleId != '') { + $(this).attr({id: module + '_' + action + '_' + moduleId}); + } + else { + $(this).attr({id: module + '_' + action}); + } + }); + + this.menuNode.find('a.item').click(this.onItemClick); + + var self = this; + $('#header .toggle-second-menu').click(function () { + self.menuNode.toggleClass('open fadeInLeft'); + }); }, activateMenu: function (module, action, params) { @@ -63,13 +93,17 @@ menu.prototype = params.module = module; params.action = action; - this.menuNode.find('li').removeClass('sfHover').removeClass('sfActive'); + this.menuNode.find('li').removeClass('sfActive'); + + var isAdmin = this.isAdmin(); + var $activeLink = this.menuNode.find('a').filter(function () { var url = $(this).attr('href'); if (!url) { return false; } + var found = false; for (var key in params) { if (!params.hasOwnProperty(key) || !params[key] @@ -77,17 +111,27 @@ menu.prototype = continue; } - var actual = broadcast.getValueFromHash(key, url); + var actual; + + if (isAdmin) { + actual = broadcast.getValueFromUrl(key, url); + } else { + actual = broadcast.getValueFromHash(key, url); + } + if (actual != params[key]) { return false; } + + found = true; + // at least one param must match. Otherwise all menu items might be highlighted if params[key] = null; } - return true; + return found; }); - $activeLink.closest('li').addClass('sfHover'); - $activeLink.closest('li.menuTab').addClass('sfActive').addClass('sfHover'); + $activeLink.closest('li').addClass('sfActive'); + $activeLink.closest('li.menuTab').addClass('sfActive'); }, // getting the right li is a little tricky since goals uses idGoal, and overview is index. @@ -108,7 +152,7 @@ menu.prototype = loadFirstSection: function () { if (broadcast.isHashExists() == false) { - $('li:first a:first', this.menuNode).click().addClass('sfHover').addClass('sfActive'); + $('li:first a:first', this.menuNode).click().addClass('sfActive'); } } -}; +}; \ No newline at end of file diff --git a/plugins/CoreHome/javascripts/menu_init.js b/plugins/CoreHome/javascripts/menu_init.js index 490c8591853c17528e058e1651328f0cc4303a1f..88a3fc21ad20cae4cd31483842010508adb54d53 100644 --- a/plugins/CoreHome/javascripts/menu_init.js +++ b/plugins/CoreHome/javascripts/menu_init.js @@ -1,14 +1,23 @@ $(function () { - var isPageHasMenu = $('.Menu--dashboard').size(); + var isPageHasMenu = $('#secondNavBar').size(); var isPageIsAdmin = $('#content.admin').size(); + if (isPageHasMenu) { piwikMenu = new menu(); piwikMenu.init(); - piwikMenu.loadFirstSection(); + if (isPageIsAdmin) { + piwikMenu.activateMenu(broadcast.getValueFromUrl('module'), broadcast.getValueFromUrl('action'), ''); + } else { + piwikMenu.loadFirstSection(); + } + } else if (!isPageIsAdmin) { + // eg multisites + initTopControls(); } if(isPageIsAdmin) { - // don't use broadcast in admin pages + // don't use broadcast in admin page + initTopControls(); return; } if(isPageHasMenu) { diff --git a/plugins/CoreHome/javascripts/top_controls.js b/plugins/CoreHome/javascripts/top_controls.js index 62ce3ceccadf998982ef29a175b59952ac4b1a79..21947ca8133a1636fc34a2b9cc85155ebbec9d7f 100644 --- a/plugins/CoreHome/javascripts/top_controls.js +++ b/plugins/CoreHome/javascripts/top_controls.js @@ -5,6 +5,24 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ function initTopControls() { + function getOverlap(element1, element2) + { + if (!element1 || !element1.getBoundingClientRect || !element2 || !element2.getBoundingClientRect) { + return 0; + } + + var rect1 = element1.getBoundingClientRect(); + var rect2 = element2.getBoundingClientRect(); + + var doOverlap = !(rect1.right < rect2.left || rect1.left > rect2.right); + + if (doOverlap) { + return rect1.left - rect2.right; + } + + return 0; + } + var $topControlsContainer = $('.top_controls'), left = 0; @@ -17,11 +35,19 @@ function initTopControls() { $control.css('left', left); - if (!$.contains($topControlsContainer[0], this)) { - $control.detach().appendTo($topControlsContainer); - } - left += $control.outerWidth(true); }); + + var header = $('#header_message.isPiwikDemo'); + if (header.length) { + // make sure isPiwikDemo message is always fully visible, move it to the right if needed + var lastSelector = $('.top_controls .piwikTopControl:last'); + + var overlap = getOverlap(header[0], lastSelector[0]); + if (header[0] !== lastSelector[0] && overlap !== 0) { + header.css('right', (Math.abs(overlap) + 18) * -1); + } + } + } } \ No newline at end of file diff --git a/plugins/CoreHome/lang/en.json b/plugins/CoreHome/lang/en.json index a6bab4a544faf43a962091b4cd9d4bbe887d6785..300c6fe15b46cd4e553774ec72ddc9d2cf6e8f36 100644 --- a/plugins/CoreHome/lang/en.json +++ b/plugins/CoreHome/lang/en.json @@ -48,6 +48,8 @@ "YouAreUsingTheLatestVersion": "You are using the latest version of Piwik!", "ClickRowToExpandOrContract": "Click this row to expand or contract the subtable.", "UndoPivotBySubtable": "This report has been pivoted %s Undo pivot", - "PivotBySubtable": "This report is not pivoted %s Pivot by %s" + "PivotBySubtable": "This report is not pivoted %s Pivot by %s", + "QuickAccessTitle": "Search for menu entries, segments and websites. Shortcut: Press 'f' to search.", + "Segments": "Segments" } } diff --git a/plugins/CoreHome/stylesheets/coreHome.less b/plugins/CoreHome/stylesheets/coreHome.less index f9659cb85b0f2db38c5dd45c625256eccbc5a1de..2e0277acf9dc7c429d450d8e0af20728c29e147b 100644 --- a/plugins/CoreHome/stylesheets/coreHome.less +++ b/plugins/CoreHome/stylesheets/coreHome.less @@ -1,8 +1,7 @@ .home { h2 { font-size: 18px; - padding: 12px 0 7px 0; - clear: both; + padding: 16px 0 16px 0; border: none; margin: 0; } @@ -18,21 +17,19 @@ } } -.nav_sep { - height: 39px; - border-radius: 0 4px 0 0; - border: 1px solid #DDD; -} - -.pageWrap { - margin-top: 15px; - font-size: 13px; -} - /* Content */ #content.home { - padding-top: 5px; font-size: 14px; + display: inline-block; + width: 100%; + + > h2:first-child { + padding-top: 7px; + } +} + +#content.admin { + display: inline-block; } /* 2 columns reports */ @@ -203,10 +200,6 @@ a.Piwik_Popover_Error_Back { margin: 10px auto 5px !important; } -.header_short #updateCheckLinkContainer .icon { - display: none; -} - .header_full #updateCheckLinkContainer { margin-top: -2px; } @@ -222,39 +215,6 @@ a.Piwik_Popover_Error_Back { width: 160px; } -#updateCheckLinkContainer { - opacity: 0.7; -} - -#updateCheckLinkContainer:hover { - opacity: 1; -} - -#updateCheckLinkContainer { - float: right; - cursor: pointer; -} - -#updateCheckLinkContainer>* { - vertical-align: middle; -} - -#header_message #checkForUpdates { - font-size: 10px; - line-height: 16px; - display: inline-block; - vertical-align: middle; - text-transform: uppercase; -} - -#header_message #checkForUpdates { - text-decoration: none; -} - -#header_message #checkForUpdates:hover { - text-decoration: underline; -} - /* Used to link within content text, without adding visual clutter */ .linkContent { color:#333; text-decoration:none} .linkContent:hover { text-decoration:underline;} diff --git a/plugins/CoreHome/stylesheets/dataTable/_dataTable.less b/plugins/CoreHome/stylesheets/dataTable/_dataTable.less index 3544f177239c751c9a704ca67ada08eca79bbecd..4b5f8321b2e6e73feedb93b7cb7e57f00e68a00a 100644 --- a/plugins/CoreHome/stylesheets/dataTable/_dataTable.less +++ b/plugins/CoreHome/stylesheets/dataTable/_dataTable.less @@ -168,7 +168,7 @@ div.dataTable, div.dataTable > .dataTableWrapper { color: #888; text-align: left; margin: 10px; - margin-left: 12px; + margin-left: 1px; } .dataTablePages { @@ -593,7 +593,7 @@ tr td.label img.plusMinus { .pk-emptyDataTable { padding-top: 20px; padding-bottom: 10px; - padding-left: 11px; + padding-left: 1px; } .widget .pk-emptyDataTable { diff --git a/plugins/CoreHome/stylesheets/jquery.ui.autocomplete.css b/plugins/CoreHome/stylesheets/jquery.ui.autocomplete.css index c3077b7b5fff731a34915d3c5b83e9a94e04d30a..8bac824f1c3f03b610b6749499d186d6d71c1de6 100644 --- a/plugins/CoreHome/stylesheets/jquery.ui.autocomplete.css +++ b/plugins/CoreHome/stylesheets/jquery.ui.autocomplete.css @@ -59,7 +59,7 @@ } .ui-corner-all { - border-radius: 4px; + border-radius: 0; } .ui-menu .ui-menu-item a.ui-state-focus { diff --git a/plugins/CoreHome/stylesheets/layout.less b/plugins/CoreHome/stylesheets/layout.less new file mode 100644 index 0000000000000000000000000000000000000000..649c2ece472840eb5e2c298b437a44f6c367e3b4 --- /dev/null +++ b/plugins/CoreHome/stylesheets/layout.less @@ -0,0 +1,387 @@ + #header { + padding: 0 15px; + background-color: @theme-color-background-base; + height: 50px; + + /* Clear fix */ + &:after { + display: table; + clear: both; + content: ""; + } + + .icon-menu-hamburger { + display: none; + } + + #logo { + } + + #topRightBar { + li { + display: inline-block; + } + + .topBarElem { + color: @theme-color-text; + text-decoration: none; + padding: 14px 12px; + display: inline-block; + height: 100%; + transition: background-color 150ms linear; + + &:hover { + background-color: @theme-color-menu-contrast-background; + } + + &.active { + color: @theme-color-brand; + } + + .menuDropdown { + color: @theme-color-text; + .title:after { + color: @theme-color-text; + border-top-color: @theme-color-text; + } + } + } + + .navbar-right { + height: 48px; + position: absolute; + right: 10px; + font-size: 13px; + } + } +} + + .navbar { + a { + text-decoration: none; + &:hover, &:focus, &:active { + text-decoration: none; + } + } + } + + // start #secondNavBar fadeInLeft animation + @-webkit-keyframes fadeInLeft { + 0% { + opacity: 0; + -webkit-transform: translateX(-20px); + } + 100% { + opacity: 1; + -webkit-transform: translateX(0); + } + } + @keyframes fadeInLeft { + 0% { + opacity: 0; + transform: translateX(-20px); + } + 100% { + opacity: 1; + transform: translateX(0); + } + } + // end #secondNavBar fadeInLeft animation + +#root { + + .pageWrap { + padding-left: 18px; + padding-right: 15px; + } + + #secondNavBar + .pageWrap { + margin-left: 224px; + } + + #root>.top_controls { + margin-left:15px; + margin-right:15px; + } + + @media all and (max-width: 749px) { + .pageWrap { + margin-left: 0 !important; + } + + #header { + min-height: 50px; + height: auto; + } + + #topRightBar { + .navbar-right { + text-align: left; + margin-left: 2px; + display: inline-block; + position: relative; + height: auto; + min-height: 48px; + } + } + + #navbar-collapse1 { + margin-left: 45px; + } + + #secondNavBar { + z-index: 9999; + position: absolute; + border-right: 1px solid @theme-color-background-tinyContrast; + border-top: 1px solid @theme-color-background-tinyContrast; + -webkit-box-shadow: 4px 4px 18px 1px rgba(0,0,0,0.75); + -moz-box-shadow: 4px 4px 18px 1px rgba(0,0,0,0.75); + box-shadow: 4px 4px 18px 1px rgba(0,0,0,0.75); + -webkit-animation-duration: 0.3s; + animation-duration: 0.3s; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-timing-function: linear; + animation-timing-function: linear; + + display: none; + &.open { + display: block; + -webkit-animation-name: fadeInLeft; + animation-name: fadeInLeft; + } + + #search { + display: none; + } + } + + + .top_controls { + height: auto; + } + + .top_controls .piwikTopControl { + position: static !important; + margin: 0 0 10px; + float: none; + } + + .icon-menu-hamburger { + padding: 10px 10px 10px; + display: inline-block; + float: left; + cursor: pointer; + font-size: 23px; + } + + #logo { + display: none; + } + + } + + #ajaxLoadingDiv { + margin-top: 10px; + } + + #secondNavBar { + width: 224px; + float:left; + + #search { + padding: 8px 0 13px 8px; + height: 61px; + + .quick-access { + z-index: 1000; + position: absolute; + width: 216px; + input { + height: 33px; + font-size: 11px; + padding: 10px 12px 10px 10px; + } + } + } + + .navbar { + background-color: @theme-color-menu-contrast-background; + border-bottom: 1px solid @theme-color-menu-contrast-background; + + .menu-icon { + padding-right: 13px; + } + + > li { + display: inline-block; + width: 100%; + .border-radius(0px); + border: 0; + background: none; + + .item { + display: inline-block; + width: 100%; + font-family: Verdana, sans-serif; + .font-default(13px, 21px); + padding: 12px 21px 12px 19px; + color: @theme-color-menu-contrast-text; + decoration: none !important; + word-break: break-word; + + &:hover, &:focus { + decoration: none !important; + } + } + + > .item { + cursor: default; + font-weight: bold; + &:hover { + text-decoration: none; + } + } + + > ul { + + li { + .item { + .font-default(13px, 16px); + padding: 11px 22px 11px 45px; + decoration: none; + transition: background-color 200ms linear; + &:hover { + text-decoration: none; + color: @theme-color-menu-contrast-textActive; + } + } + + &.sfActive { + .item { + background-color: @theme-color-background-base; + decoration: none; + } + } + } + } + } + + + .menuDropdown { + + .items { + width: 224px; + box-shadow: 0 1px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12); + + .search { + margin: 15px 16px 10px 17px; + } + + .item { + padding: 10px 16px 10px !important; + min-height: 25px; + height: auto; + } + } + + .title { + color: @theme-color-menu-contrast-text; + display: block; + padding: 15px 22px 11px 45px; + font-size: 13px; + font-weight: normal; + + &:hover { + color: @theme-color-menu-contrast-textActive; + } + + &:after { + color: @theme-color-menu-contrast-text; + border-top: 5px solid @theme-color-menu-contrast-text; + top: 20px; + right: 3px; + } + } + } + } + + &.Menu--dashboard .navbar > li { + > ul { + display: none; + + @media all and (max-width: 749px) { + display: block; + } + } + + > .item { + cursor: pointer; + &:hover { + color: @theme-color-menu-contrast-textActive; + } + } + + &.sfActive { + ul { + display: block; + } + + .icon-arrow-right:before { + content: "\e63b"; + } + } + } + + &.Menu--admin .navbar > li { + > .item { + padding: 14px 21px 6px 19px; + } + .item .icon-arrow-right:before { + content: "\e63b"; + } + } + } +} + +#root { + .top_controls { + .piwikTopControl { + margin-top: 8px; + margin-bottom: 8px; + } + } +} + +#root, #standalone { + .top_controls { + min-height: 51px; + position: relative; + background-color: @theme-color-background-base; + height: auto; + margin-bottom: 10px; + + .piwikTopControl { + display: inline-block; + float: none; + position: absolute; + margin-right: 18px; + vertical-align: top; + font-size: 11px; + } + } + + .borderedControl { + background-color: @theme-color-background-base; + border: 1px solid @theme-color-background-tinyContrast; + transition: box-shadow 150ms linear; + &.expanded, + &:hover { + box-shadow: 0 1px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12); + } + } +} + +.widgetize { + width: auto; +} diff --git a/plugins/CoreHome/stylesheets/menu.less b/plugins/CoreHome/stylesheets/menu.less deleted file mode 100644 index 76c8b9023808fa5a7673f78f672d547e4b918121..0000000000000000000000000000000000000000 --- a/plugins/CoreHome/stylesheets/menu.less +++ /dev/null @@ -1,177 +0,0 @@ -.Menu--dashboard { - position: relative; - - .menuDropdown { - - .items { - width: 250px; - - .search { - margin: 15px 16px 10px 17px; - } - - .item { - padding: 10px 16px 4px !important; - min-height: 25px; - height: auto; - } - } - - .title { - color: @theme-color-menu-contrast-text; - display: block; - padding: 15px 22px 11px; - font-size: 15px; - font-weight: normal; - - &:hover { - color: @theme-color-menu-contrast-textActive; - } - - &:after { - color: @theme-color-menu-contrast-text; - border-top: 5px solid @theme-color-menu-contrast-text; - top: 20px; - right: 3px; - } - } - } -} - -.Menu--dashboard > .Menu-tabList { - line-height: 1; - display: table; // The nav has the height og his children - margin-bottom: -1px; // Allow tabs to merge with the submenu -} - -.Menu--dashboard > .Menu-tabList ul { - background: @theme-color-background-base; /*IE6 needs this*/ - float: left; - position: relative; -} - -/* LEVEL1 NORMAL */ -.Menu--dashboard > .Menu-tabList > li { - background: #f1f1f1; - float: left; - list-style: none; - z-index: 49; - margin-right: -1px; - border: 1px solid #ddd; - border-bottom: 0; - border-radius: 4px 4px 0 0; -} - -.Menu--dashboard > .Menu-tabList a { - color: @theme-color-text-light; - font-size: 18px; - display: block; - float: left; - padding: 8px 27px 0; - height: 50px; - text-decoration: none; - font-weight: normal; -} - -/* LEVEL1 HOVER */ -.Menu--dashboard > .Menu-tabList > li:hover, -.Menu--dashboard > .Menu-tabList > li.sfHover { - background: @theme-color-background-base; -} - -.Menu--dashboard > .Menu-tabList > li:hover > a, -.Menu--dashboard > .Menu-tabList > li.sfHover > a, -.Menu--dashboard > .Menu-tabList > li.sfActive > a, -.Menu--dashboard > .Menu-tabList a:hover { - color: @theme-color-link; -} - -.Menu--dashboard > .Menu-tabList > li:hover > a { - text-decoration: underline; -} - -.Menu--dashboard > .Menu-tabList > li.sfHover > a { - border-bottom: 1px solid #fff; -} - -/* LEVEL2 NORMAL */ -.Menu--dashboard > .Menu-tabList > li ul { - padding: 9px 0 5px 0; - left: 0; - top: -999em; - position: absolute; - min-height: 25px; - width: 100%; - background: none; -} - -.Menu--dashboard > .Menu-tabList > li li { - float: left; - background: none; - border: 0; - text-align: center; -} - -.Menu--dashboard > .Menu-tabList > li li > a { - padding: 5px 15px; - font-size: 14px; - border: 0; - float: none; - display: inline-block; - height: auto; - background: none; - color: @theme-color-text-light; - text-decoration: none; -} - -/* LEVEL2 HOVER */ -.Menu--dashboard > .Menu-tabList > li.sfHover ul, -.Menu--dashboard > .Menu-tabList > li:hover ul { - z-index: 130; - top: 100%; - opacity: 1; - -webkit-transition: opacity 300ms ease-out 10ms; /* property duration timing-function delay */ - -moz-transition: opacity 300ms ease-out 10ms; - -o-transition: opacity 300ms ease-out 10ms; - transition: opacity 300ms ease-out 10ms; -} - -/* for screen readers */ -.Menu--dashboard a span.hidden { - height: 1px; - width: 1px; - position: absolute; - overflow: hidden; - top: 0; -} - - -.Menu--dashboard > .Menu-tabList > li li:hover > a, -.Menu--dashboard > .Menu-tabList > li li.sfHover > a { - color: @theme-color-link; -} - -.Menu--dashboard > .Menu-tabList > li li.sfHover > a { - font-weight: bold; - text-decoration: none !important; -} - -@media all and (max-width: 949px) { - .nav { - clear: right; - } -} - -@media all and (max-width: 749px) { - .Menu--dashboard > .Menu-tabList a { - padding-left: 8px; - padding-right: 8px; - } -} - -@media all and (max-width: 549px) { - .Menu--dashboard > ul.Menu-tabList > li.sfHover > a, - .Menu--dashboard > ul.Menu-tabList > li.sfActive.sfHover > a { - border-bottom: 0; - } -} \ No newline at end of file diff --git a/plugins/CoreHome/stylesheets/notification.less b/plugins/CoreHome/stylesheets/notification.less index 36f7085f6f8263d1d8c8950a547446d05ebdd4ec..cab47a40a5f3f8bbb05ae292e5189eef86040d48 100644 --- a/plugins/CoreHome/stylesheets/notification.less +++ b/plugins/CoreHome/stylesheets/notification.less @@ -1,8 +1,5 @@ #content.admin #notificationContainer { - width: 750px; - display: table-header-group; /* no overlap with About Piwik box */ - .notification { - margin: 10px; + margin: 0 0 10px 0; } } \ No newline at end of file diff --git a/plugins/CoreHome/stylesheets/zen-mode.less b/plugins/CoreHome/stylesheets/zen-mode.less index 124c3395ff7c5bc2b2da15c9de90e31867d09077..0b9f619ea78f6c1d0288c81f1623c1638c808231 100644 --- a/plugins/CoreHome/stylesheets/zen-mode.less +++ b/plugins/CoreHome/stylesheets/zen-mode.less @@ -81,14 +81,20 @@ margin-top: 40px; } + h2 { + padding-left: 0; + font-size: 21px; + padding: 16px 0 12px 0; + } +} + +#root #dashboard .widget { h2 { padding-left: 10px; - font-size: 24px; } } .widget { - h2:nth-of-type(n+2) { padding-top: 40px!important; margin-top: 0!important; diff --git a/plugins/CoreHome/templates/ReportsByDimension/_reportsByDimension.twig b/plugins/CoreHome/templates/ReportsByDimension/_reportsByDimension.twig index 57ec8279d50894c200f98d561bd54a2ae0ddeb96..6ce760af1dd73405a349cd6cd872af8b76515eb4 100644 --- a/plugins/CoreHome/templates/ReportsByDimension/_reportsByDimension.twig +++ b/plugins/CoreHome/templates/ReportsByDimension/_reportsByDimension.twig @@ -17,7 +17,7 @@ {% endfor %} </div> - <div style="float:left;max-width:900px;"> + <div style="float:left;max-width:730px;"> <div class="loadingPiwik" style="display:none;"> <img src="plugins/Morpheus/images/loading-blue.gif" alt=""/>{{ 'General_LoadingData'|translate }} </div> diff --git a/plugins/CoreHome/templates/_headerMessage.twig b/plugins/CoreHome/templates/_headerMessage.twig index c1d81b5cb0f0dc9e2a4234719728462b9ab4240f..bb4f8e760768b3a7700f87b98b4b796e823e6152 100644 --- a/plugins/CoreHome/templates/_headerMessage.twig +++ b/plugins/CoreHome/templates/_headerMessage.twig @@ -1,47 +1,59 @@ {# testing, remove test_ from var names #} {% set test_latest_version_available="4.0.0" %} {% set test_piwikUrl='http://demo.piwik.org/' %} -{% set isPiwikDemo %}{{ piwikUrl == 'http://demo.piwik.org/' or piwikUrl == 'https://demo.piwik.org/'}}{% endset %} +{% set isPiwikDemo %}{{ piwikUrl == 'http://demo.piwik.org/' or piwikUrl == 'https://demo.piwik.org/' }}{% endset %} {% set updateCheck %} -<div id="updateCheckLinkContainer"> - <span class='loadingPiwik' style="display:none;"><img src='plugins/Morpheus/images/loading-blue.gif'/></span> - <span class="icon icon-reload"></span> - <a href="#" id="checkForUpdates"><em>{{ 'CoreHome_CheckForUpdates'|translate }}</em></a> -</div> + <span id="updateCheckLinkContainer"> + {{ 'CoreHome_CheckForUpdates'|translate }} + <span class="icon icon-fixed icon-reload"></span> + </span> {% endset %} {% if isPiwikDemo or (latest_version_available and hasSomeViewAccess and not isUserIsAnonymous) or (isSuperUser and adminMenu is defined and adminMenu) %} -<span id="header_message" class="{% if isPiwikDemo or not latest_version_available %}header_info{% else %}header_alert{% endif %}"> - <span class="header_short"> +<div piwik-expand-on-hover + id="header_message" + class="piwikSelector borderedControl {% if isPiwikDemo or not latest_version_available %}header_info{% else %}{% endif %} {% if isPiwikDemo %}isPiwikDemo{% else %}piwikTopControl{% endif %} {% if latest_version_available %}update_available{% endif %}" + > + + <a class="title" href="#"> {% if isPiwikDemo %} {{ 'General_YouAreViewingDemoShortMessage'|translate }} {% elseif latest_version_available %} {{ 'General_NewUpdatePiwikX'|translate(latest_version_available) }} + <span class="icon-warning"></span> {% elseif isSuperUser and adminMenu is defined and adminMenu %} {{ updateCheck|raw }} {% endif %} - </span> + </a> - <span class="header_full"> + <div class="dropdown"> {% if isPiwikDemo %} - {{ 'General_YouAreViewingDemoShortMessage'|translate }} - <br /> {{ 'General_DownloadFullVersion'|translate("<a href='http://piwik.org/'>","</a>","<a href='http://piwik.org'>piwik.org</a>")|raw }} <br/> + {% if isSuperUser and adminMenu is defined and adminMenu %} + <br/> + {% endif %} {% endif %} {% if latest_version_available and isSuperUser %} {{ 'General_PiwikXIsAvailablePleaseUpdateNow'|translate(latest_version_available,"<br /><a href='index.php?module=CoreUpdater&action=newVersionAvailable'>","</a>","<a href='?module=Proxy&action=redirect&url=http://piwik.org/changelog/' target='_blank'>","</a>")|raw }} + <br /> {% elseif latest_version_available and not isPiwikDemo and hasSomeViewAccess and not isUserIsAnonymous %} {% set updateSubject = 'General_NewUpdatePiwikX'|translate(latest_version_available)|e('url') %} {{ 'General_PiwikXIsAvailablePleaseNotifyPiwikAdmin'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/' target='_blank'>Piwik</a> <a href='?module=Proxy&action=redirect&url=http://piwik.org/changelog/' target='_blank'>" ~ latest_version_available ~ "</a>", "<a href='mailto:" ~ superUserEmails ~ "?subject=" ~ updateSubject ~ "'>", "</a>")|raw }} - {% endif %} - {% if isSuperUser and adminMenu is defined and adminMenu %} <br /> + {% endif %} + + {% if isPiwikDemo and isSuperUser and adminMenu is defined and adminMenu %} + <br/> {{ updateCheck|raw }} + <br/> + <br/> {% endif %} - <br /> + {{ 'General_YouAreCurrentlyUsing'|translate(piwik_version) }} - </span> -</span> + </div> +</div> + +<div style="clear:right"></div> {% endif %} diff --git a/plugins/CoreHome/templates/_indexContent.twig b/plugins/CoreHome/templates/_indexContent.twig deleted file mode 100644 index 46d2f135796b3fdc96ead5940d3bd986e4108fd0..0000000000000000000000000000000000000000 --- a/plugins/CoreHome/templates/_indexContent.twig +++ /dev/null @@ -1,19 +0,0 @@ -{% import 'ajaxMacros.twig' as ajax %} -<div class="pageWrap container-fluid"> -<a name="main"></a> - {% include "@CoreHome/_notifications.twig" %} - <div class="top_controls"> - {% include "@CoreHome/_periodSelect.twig" %} - {{ postEvent("Template.nextToCalendar") }} - {% render dashboardSettingsControl %} - {% include "@CoreHome/_headerMessage.twig" %} - {{ ajax.requestErrorDiv(emailSuperUser|default('')) }} - </div> - - {{ ajax.loadingDiv() }} - - <div id="content" class="home"> - {% if content %}{{ content }}{% endif %} - </div> - <div class="clear"></div> -</div> diff --git a/plugins/CoreHome/templates/_menu.twig b/plugins/CoreHome/templates/_menu.twig index f4bfd7d902f2c14d8d79454a0550a589dfa997d4..81cb0f9a9f08b3ee8c7a03e5f25cf1b9d4cf79cd 100644 --- a/plugins/CoreHome/templates/_menu.twig +++ b/plugins/CoreHome/templates/_menu.twig @@ -1,19 +1,19 @@ -{% macro submenuItem(name, url) %} +{% macro submenuItem(name, url, anchorlink) %} {% if name|slice(0,1) != '_' %} <li> - <a class="menuItem" href='#{{ url|urlRewriteWithParameters|slice(1) }}'> + <a class="item" href="{% if anchorlink %}#{% else %}index.php?{% endif %}{{ url|urlRewriteWithParameters|slice(1) }}"> {{ name|translate }} </a> </li> {% endif %} {% endmacro %} -{% macro groupedItem(name, group) %} +{% macro groupedItem(name, group, anchorlink) %} <li> <div piwik-menudropdown show-search="true" menu-title="{{ name|translate|e('html_attr') }}"> {% for item in group.getItems %} <a class="item menuItem" - href='#?{{ item.url|urlRewriteWithParameters|slice(1) }}' + href='{% if anchorlink %}#?{% else %}index.php?{% endif %}{{ item.url|urlRewriteWithParameters|slice(1) }}' {% if item.tooltip %}title="{{ item.tooltip|e('html_attr') }}"{% endif %}> {{ item.name|translate }} </a> @@ -34,33 +34,32 @@ {%- endif %} {%- endmacro %} -<div class="Menu--dashboard"> - - <ul class="Menu-tabList"> - {% for level1,level2 in menu %} - <li id="{% if level2._url is defined %}{{ _self.getId(level2._url) }}{% endif %}" class="menuTab"> - <a class="menuItem" {% if level2._url is defined %}href="#{{ _self.getFirstUrl(level2._url) }}"{% endif %}> - {{ level1|translate }} - <span class="hidden"> - {{ 'CoreHome_Menu'|translate }} - </span> - </a> - <ul> - {% for name,urlParameters in level2 %} - {% if urlParameters._url is defined and urlParameters._url is not iterable %} - {{ _self.groupedItem(name,urlParameters._url) }} - {% elseif name|slice(0,1) != '_' %} - {{ _self.submenuItem(name,urlParameters._url) }} - {% endif %} - {% endfor %} - - </ul> - </li> - {% endfor %} - <li id="Searchmenu"> - <span piwik-quick-access></span> - </li> - </ul> +{% macro menu(menu, anchorlink, cssClass) %} + <div id="secondNavBar" class="{{ cssClass }}"> + <div id="search"> + <div piwik-quick-access class="borderedControl"></div> + </div> + <ul class="navbar"> + {% for level1,level2 in menu %} + <li id="{% if level2._url is defined and level2._url is not empty %}{{ _self.getId(level2._url) }}{% endif %}" class="menuTab"> -</div> -<div class="nav_sep"></div> + <a class="item" {% if level2._url is defined and level2._url is not empty %}href="{% if anchorlink %}#{% else %}index.php?{% endif %}{{ _self.getFirstUrl(level2._url) }}"{% endif %}> + <span class="menu-icon {{ level2._icon|default('icon-arrow-right') }}"></span>{{ level1|translate }} + <span class="hidden"> + {{ 'CoreHome_Menu'|translate }} + </span> + </a> + <ul> + {% for name,urlParameters in level2 %} + {% if urlParameters._url is defined and urlParameters._url is not iterable %} + {{ _self.groupedItem(name,urlParameters._url, anchorlink) }} + {% elseif name|slice(0,1) != '_' %} + {{ _self.submenuItem(name,urlParameters._url, anchorlink) }} + {% endif %} + {% endfor %} + </ul> + </li> + {% endfor %} + </ul> + </div> +{% endmacro %} diff --git a/plugins/CoreHome/templates/_periodSelect.twig b/plugins/CoreHome/templates/_periodSelect.twig index c99f463ecacd99b106ad54aba91be0f83e4854ed..67b30183d3484b431661403a005554dd269f9ba9 100644 --- a/plugins/CoreHome/templates/_periodSelect.twig +++ b/plugins/CoreHome/templates/_periodSelect.twig @@ -1,7 +1,9 @@ -<div id="periodString" class="piwikTopControl periodSelector"> - <div id="date">{{ 'General_DateRange'|translate }} <strong>{{ prettyDate }}</strong></div> - <div class="calendar-icon"></div> - <div id="periodMore"> +<div id="periodString" piwik-expand-on-click class="piwikTopControl piwikSelector borderedControl periodSelector"> + <a id="date" class="title" title="{{ 'General_ChooseDate'|translate|e('html_attr') }}"> + <span class="icon icon-calendar"></span> + {{ prettyDate }} + </a> + <div id="periodMore" class="dropdown"> <div class="period-date"> <div id="datepicker"></div> </div> diff --git a/plugins/CoreHome/templates/_siteSelectHeader.twig b/plugins/CoreHome/templates/_siteSelectHeader.twig index 547f2e41297b5afc74e9e680866e586d6aa16afe..7353e2e07a794f2c2138a403d56fcd4c11265865 100644 --- a/plugins/CoreHome/templates/_siteSelectHeader.twig +++ b/plugins/CoreHome/templates/_siteSelectHeader.twig @@ -1,5 +1,3 @@ -<div class="top_bar_sites_selector {% if currentModule == 'CoreHome' %}sites_selector_in_dashboard{% endif %}"> - <label>{{ 'General_Website'|translate }}</label> +<div class="top_bar_sites_selector piwikTopControl"> <div piwik-siteselector class="sites_autocomplete"></div> - </div> \ No newline at end of file diff --git a/plugins/CoreHome/templates/_topBar.twig b/plugins/CoreHome/templates/_topBar.twig index 41bd5da7a11af039e3b4ad268810419b614cebdb..e69e9c1978b840c8b8fb669d1a3ba601693f1350 100644 --- a/plugins/CoreHome/templates/_topBar.twig +++ b/plugins/CoreHome/templates/_topBar.twig @@ -1,4 +1,34 @@ {{ postEvent("Template.beforeTopBar", userAlias, userLogin, topMenu, userMenu) }} -<div id="topBars"> - {% include "@CoreHome/_topBarTopMenu.twig" %} -</div> +<ul class="navbar-right"> + + {% macro menuItemLabel(label, icon) %} + {% if icon is defined and icon and icon starts with 'icon-' %} + <span class="{{ icon|striptags }}"></span> + {% else %} + {{ label|translate }} + {% endif %} + {% endmacro %} + + {% macro topMenuItem(label, menu, currentModule, currentAction) %} + {% if menu._html is defined %} + {{ menu._html|raw }} + {% else %} + <a {% if menu._tooltip is defined %}title="{{ menu._tooltip }}"{% endif %} + class="topBarElem {% if (menu._url.module == currentModule and (menu._url.action is empty or menu._url.action == currentAction)) %}active{% endif %}" + id="topmenu-{{ menu._url.module|lower }}" + href="index.php{{ menu._url|urlRewriteWithParameters }}">{{ _self.menuItemLabel(label, menu._icon) }}</a> + {% endif %} + {% endmacro %} + + {% if topMenuModule is not defined %} + {% set topMenuModule = currentModule %} + {% set topMenuAction = currentAction %} + {% endif %} + + {% spaceless %} + {% for label,menu in topMenu %} + <li>{{ _self.topMenuItem(label, menu, topMenuModule, topMenuAction) }}</li> + {% endfor %} + {% endspaceless %} + +</ul> \ No newline at end of file diff --git a/plugins/CoreHome/templates/_topBarTopMenu.twig b/plugins/CoreHome/templates/_topBarTopMenu.twig deleted file mode 100644 index 459ccb611e268f2c116adb1f6f8bf0faa42ca774..0000000000000000000000000000000000000000 --- a/plugins/CoreHome/templates/_topBarTopMenu.twig +++ /dev/null @@ -1,37 +0,0 @@ -<div id="topRightBar"> - - {% macro topMenuItem(label, menu, currentModule, currentAction) %} - {% if menu._html is defined %} - {{ menu._html|raw }} - {% elseif (menu._url.module == currentModule and (menu._url.action is empty or menu._url.action == currentAction)) %} - <span class="topBarElem topBarElemActive"><strong>{{ label|translate }}</strong></span> - {% else %} - <span class="topBarElem" {% if menu._tooltip is defined %}title="{{ menu._tooltip }}"{% endif %}> - <a id="topmenu-{{ menu._url.module|lower }}" href="index.php{{ menu._url|urlRewriteWithParameters }}">{{ label|translate }}</a> - </span> - {% endif %} - {% endmacro %} - - {% macro userMenuItem(label, menu, currentModule, currentAction) %} - - <a class="item {% if (menu._url.module == currentModule and (menu._url.action is empty or menu._url.action == currentAction)) %}active{% endif %}" - href="index.php{{ menu._url|urlRewriteWithParameters }}" - id="usermenu-{{ menu._url.module|lower }}-{{ menu._url.action|default('index')|lower }}" - {% if menu._tooltip is defined %}title="{{ menu._tooltip }}"{% endif %} - >{{ label|translate }}</a> - - {% endmacro %} - - {% if topMenuModule is not defined %} - {% set topMenuModule = currentModule %} - {% set topMenuAction = currentAction %} - {% endif %} - - {% for label,menu in topMenu %} - {% if not loop.first %} - | - {% endif %} - {{ _self.topMenuItem(label, menu, topMenuModule, topMenuAction) }} - {% endfor %} - -</div> diff --git a/plugins/CoreHome/templates/_topScreen.twig b/plugins/CoreHome/templates/_topScreen.twig index 2aebf1254e1fbe9733a0fdcfa7bfbe1ab0813989..805619814c4fce55ee26a0650399410c2f4e9d4d 100644 --- a/plugins/CoreHome/templates/_topScreen.twig +++ b/plugins/CoreHome/templates/_topScreen.twig @@ -1,5 +1,15 @@ -<div id="header"> - <a href='#main' tabindex="0" class="accessibility-skip-to-content">{{'CoreHome_SkipToContent'|translate}}</a> - {% include "@CoreHome/_logo.twig" %} - {% include "@CoreHome/_topBar.twig" %} -</div> +<div id="header" class="container-fluid"> + <a href="#main" tabindex="0" class="accessibility-skip-to-content">{{'CoreHome_SkipToContent'|translate}}</a> + <div id="topRightBar" class="navbar row"> + <div class="navbar-header col-md-3"> + <span class="toggle-second-menu icon-menu-hamburger"></span> + {% include "@CoreHome/_logo.twig" %} + + <!-- we need to put button to toggle nav for responsiveness here --> + + </div> + <div class="collapse navbar-collapse col-md-9" id="navbar-collapse1"> + {% include "@CoreHome/_topBar.twig" %} + </div> + </div> +</div> \ No newline at end of file diff --git a/plugins/CoreHome/templates/_uiControl.twig b/plugins/CoreHome/templates/_uiControl.twig index 856f1afac0441632a87ffa25d1f8b625d863a682..3be1e17be58c95baeb76f23ea6caf66c434c0822 100644 --- a/plugins/CoreHome/templates/_uiControl.twig +++ b/plugins/CoreHome/templates/_uiControl.twig @@ -1,4 +1,5 @@ <div class="{{ cssIdentifier }} {{ cssClass }}" + piwik-expand-on-click data-props="{{ clientSideProperties|json_encode }}" data-params="{{ clientSideParameters|json_encode }}"> {% render implView with implOverride %} diff --git a/plugins/CoreHome/templates/_userMenu.twig b/plugins/CoreHome/templates/_userMenu.twig deleted file mode 100644 index 67076af75599094b5cda985a3397371cf0a54db4..0000000000000000000000000000000000000000 --- a/plugins/CoreHome/templates/_userMenu.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% import '@CoreHome/macros.twig' as corehome %} - -{{ corehome.sidebarMenu(userMenu, currentModule, currentAction) }} \ No newline at end of file diff --git a/plugins/CoreHome/templates/getDefaultIndexView.twig b/plugins/CoreHome/templates/getDefaultIndexView.twig index 7b46ca3f7604affba1ea662649a4f882b513ea4d..a09030ff3daba69dd98f53bddf87c649387ef8a5 100644 --- a/plugins/CoreHome/templates/getDefaultIndexView.twig +++ b/plugins/CoreHome/templates/getDefaultIndexView.twig @@ -1,14 +1,20 @@ {% extends "dashboard.twig" %} -{% block notification %}{% endblock %} -{% block content %} - -{% include "@CoreHome/_siteSelectHeader.twig" %} +{% import 'ajaxMacros.twig' as ajax %} -{% if (menu is defined and menu) %} - {% include "@CoreHome/_menu.twig" %} -{% endif %} +{% block topcontrols %} + {% include "@CoreHome/_siteSelectHeader.twig" %} + {% include "@CoreHome/_periodSelect.twig" %} + {{ postEvent("Template.nextToCalendar") }} + {% render dashboardSettingsControl %} + {% include "@CoreHome/_headerMessage.twig" %} +{% endblock %} -{% include "@CoreHome/_indexContent.twig" %} +{% block content %} + {{ ajax.requestErrorDiv(emailSuperUser|default('')) }} + {{ ajax.loadingDiv() }} + <div id="content" class="home"> + {% if content %}{{ content }}{% endif %} + </div> {% endblock %} diff --git a/plugins/CoreHome/templates/macros.twig b/plugins/CoreHome/templates/macros.twig deleted file mode 100644 index 05638568568572281498bf47be68120f9d1dbe19..0000000000000000000000000000000000000000 --- a/plugins/CoreHome/templates/macros.twig +++ /dev/null @@ -1,26 +0,0 @@ -{% macro sidebarMenu(sidebarMenu, currentModule, currentAction) %} - {% if sidebarMenu|length > 1 %} - <div class="Menu Menu--admin"> - <ul class="Menu-tabList"> - {% for name,submenu in sidebarMenu %} - {% if submenu._hasSubmenu %} - <li> - <span>{{ name|translate }}</span> - <ul> - {% for sname,url in submenu %} - {% if sname|slice(0,1) != '_' %} - <li> - <a href='index.php{{ url._url|urlRewriteWithParameters }}' - target="_self" - {% if url._url.module == currentModule and (url._url.action is empty or url._url.action == currentAction) %}class='active'{% endif %}>{{ sname|translate }}</a> - </li> - {% endif %} - {% endfor %} - </ul> - </li> - {% endif %} - {% endfor %} - </ul> - </div> - {% endif %} -{% endmacro %} diff --git a/plugins/CorePluginsAdmin/Menu.php b/plugins/CorePluginsAdmin/Menu.php index 97ec818a59b6703eaa3eb1f4588615b14569ced3..415ace73a6ceee39dafbef5ef30dc538c5e46c0c 100644 --- a/plugins/CorePluginsAdmin/Menu.php +++ b/plugins/CorePluginsAdmin/Menu.php @@ -49,7 +49,7 @@ class Menu extends \Piwik\Plugin\Menu if (Piwik::hasUserSuperUserAccess() && CorePluginsAdmin::isMarketplaceEnabled()) { $menu->addManageItem('CorePluginsAdmin_Marketplace', - $this->urlForAction('browsePlugins', array('activated' => '')), + $this->urlForAction('marketplace', array('activated' => '', 'mode' => 'admin')), $order = 12); } } @@ -66,7 +66,7 @@ class Menu extends \Piwik\Plugin\Menu { if ($this->isAllowedToSeeMarketPlace()) { $menu->addPlatformItem('CorePluginsAdmin_Marketplace', - $this->urlForAction('userBrowsePlugins', array('activated' => '')), + $this->urlForAction('marketplace', array('activated' => '', 'mode' => 'user')), $order = 5); } } diff --git a/plugins/CoreVisualizations/javascripts/jqplot.js b/plugins/CoreVisualizations/javascripts/jqplot.js index 5392dc986cbb6895bb4adab424302b5020e366b1..f6914c57be0d8c0b451b6a87f94e111081d69c4d 100644 --- a/plugins/CoreVisualizations/javascripts/jqplot.js +++ b/plugins/CoreVisualizations/javascripts/jqplot.js @@ -384,7 +384,7 @@ // TODO: this code destroys plots when a page is switched. there must be a better way of managing memory. if (typeof $.jqplot.visiblePlots == 'undefined') { $.jqplot.visiblePlots = []; - $('.nav').on('piwikSwitchPage', function () { + $('#secondNavBar').on('piwikSwitchPage', function () { for (var i = 0; i < $.jqplot.visiblePlots.length; i++) { if ($.jqplot.visiblePlots[i] == null) { continue; diff --git a/plugins/Dashboard/Dashboard.php b/plugins/Dashboard/Dashboard.php index 9ccbb822e4196fb8446c0e22917204c0b721d4d9..35b94743a380f7505a42a10ea6ffe041b5f6da6a 100644 --- a/plugins/Dashboard/Dashboard.php +++ b/plugins/Dashboard/Dashboard.php @@ -240,6 +240,7 @@ class Dashboard extends \Piwik\Plugin $translationKeys[] = 'Dashboard_LoadingWidget'; $translationKeys[] = 'Dashboard_WidgetNotFound'; $translationKeys[] = 'Dashboard_DashboardCopied'; + $translationKeys[] = 'Dashboard_Dashboard'; $translationKeys[] = 'General_Close'; $translationKeys[] = 'General_Refresh'; } diff --git a/plugins/Dashboard/DashboardManagerControl.php b/plugins/Dashboard/DashboardManagerControl.php index fb119e008367e75359d0ae2ca0deab30a2e59770..df573903b34014b891d4c6523406c01f40b1d830 100644 --- a/plugins/Dashboard/DashboardManagerControl.php +++ b/plugins/Dashboard/DashboardManagerControl.php @@ -20,7 +20,7 @@ class DashboardManagerControl extends DashboardSettingsControlBase parent::__construct(); $this->jsClass = "DashboardManagerControl"; - $this->cssIdentifier = "dashboard-manager"; + $this->cssIdentifier = "dashboard-manager piwikSelector"; $this->addDashboardActions(); $this->addGeneralActions(); diff --git a/plugins/Dashboard/DashboardSettingsControlBase.php b/plugins/Dashboard/DashboardSettingsControlBase.php index 72752240829b6c83eaf31efe221662420dca0882..dadd780f18706b2f3f198aad81afa3685a942b43 100644 --- a/plugins/Dashboard/DashboardSettingsControlBase.php +++ b/plugins/Dashboard/DashboardSettingsControlBase.php @@ -23,7 +23,7 @@ abstract class DashboardSettingsControlBase extends UIControl { parent::__construct(); - $this->cssClass = "piwikTopControl dashboardSettings"; + $this->cssClass = "borderedControl piwikTopControl dashboardSettings"; $this->dashboardActions = array(); $this->generalActions = array(); } diff --git a/plugins/Dashboard/Menu.php b/plugins/Dashboard/Menu.php index f90c117e109b447c499dfde7a9d1625e6cc1cffb..250807eca5d1dfdb44650d8b7870ee81cd4332a8 100644 --- a/plugins/Dashboard/Menu.php +++ b/plugins/Dashboard/Menu.php @@ -23,20 +23,31 @@ class Menu extends \Piwik\Plugin\Menu { $menu->addItem('Dashboard_Dashboard', '', $this->urlForAction('embeddedIndex', array('idDashboard' => 1)), 5); - if (!Piwik::isUserIsAnonymous()) { + if (Piwik::isUserIsAnonymous()) { + $this->addDefaultDashboard($menu); + } else { $login = Piwik::getCurrentUserLogin(); $dashboard = new Dashboard(); $dashboards = $dashboard->getAllDashboards($login); - $pos = 0; - foreach ($dashboards as $dashboard) { - $menu->addItem('Dashboard_Dashboard', $dashboard['name'], $this->urlForAction('embeddedIndex', array('idDashboard' => $dashboard['iddashboard'])), $pos); - $pos++; + if (empty($dashboards)) { + $this->addDefaultDashboard($menu); + } else { + $pos = 0; + foreach ($dashboards as $dashboard) { + $menu->addItem('Dashboard_Dashboard', $dashboard['name'], $this->urlForAction('embeddedIndex', array('idDashboard' => $dashboard['iddashboard'])), $pos); + $pos++; + } } } } + private function addDefaultDashboard(MenuReporting $menu) + { + $menu->addItem('Dashboard_Dashboard', 'Dashboard_Dashboard', $this->urlForAction('embeddedIndex', array('idDashboard' => 1))); + } + public function configureTopMenu(MenuTop $menu) { $userPreferences = new UserPreferences(); diff --git a/plugins/Dashboard/javascripts/dashboard.js b/plugins/Dashboard/javascripts/dashboard.js index 238aca519789a1d3a4db5454438a981cfe3074c8..4253069723d36d7e9eeefae76629daa757fd6f18 100644 --- a/plugins/Dashboard/javascripts/dashboard.js +++ b/plugins/Dashboard/javascripts/dashboard.js @@ -11,9 +11,9 @@ function initDashboard(dashboardId, dashboardLayout) { initTopControls(); // Embed dashboard - if (!$('#topBars').length) { + if (!$('#header .navbar-right').length) { $('.dashboardSettings').after($('#Dashboard')); - $('#Dashboard_embeddedIndex_' + dashboardId).addClass('sfHover'); + $('#Dashboard_embeddedIndex_' + dashboardId).addClass('sfActive'); } widgetsHelper.getAvailableWidgets(); @@ -168,7 +168,7 @@ function copyDashboardToUser() { // on menu item click, trigger action event on this var self = this; this.$element.on('click', 'ul.submenu li[data-action]', function (e) { - self.$element.toggleClass('visible'); + self.$element.toggleClass('expanded'); $(self).trigger($(this).attr('data-action')); }); @@ -176,7 +176,7 @@ function copyDashboardToUser() { // open manager on open this.$element.on('click', function (e) { if ($(e.target).is('.dashboardSettings,.dashboardSettings>span')) { - self.$element.toggleClass('visible'); + self.$element.toggleClass('expanded'); // fix position self.$element @@ -193,7 +193,7 @@ function copyDashboardToUser() { && !$(e.target).is('.dashboardSettings') ) { self.$element.widgetPreview('reset'); - self.$element.removeClass('visible'); + self.$element.removeClass('expanded'); } }; @@ -206,7 +206,7 @@ function copyDashboardToUser() { }, onSelect: function (widgetUniqueId) { var widget = widgetsHelper.getWidgetObjectFromUniqueId(widgetUniqueId); - self.$element.removeClass('visible'); + self.$element.removeClass('expanded'); self.widgetSelected(widget); }, @@ -287,7 +287,7 @@ function copyDashboardToUser() { }, hide: function () { - this.$element.removeClass('visible'); + this.$element.removeClass('expanded'); }, isWidgetAvailable: function (widgetUniqueId) { diff --git a/plugins/Dashboard/javascripts/dashboardObject.js b/plugins/Dashboard/javascripts/dashboardObject.js index 7808d22c117421f1524a84642fb393c512f4c492..4c45d5a888fc8e3047b8878726056c2eb1975bcf 100644 --- a/plugins/Dashboard/javascripts/dashboardObject.js +++ b/plugins/Dashboard/javascripts/dashboardObject.js @@ -477,24 +477,26 @@ return $(this).attr('id').indexOf('Dashboard_embeddedIndex') == 0; }).remove(); + if (dashboards.length === 0) { + dashboards = [{iddashboard: 1, name: _pk_translate('Dashboard_Dashboard')}]; + } + if (dashboards.length > 1 || dashboardMenuListItems.length >= 1 ) { var items = []; for (var i = 0; i < dashboards.length; i++) { - var $link = $('<a/>').attr('data-idDashboard', dashboards[i].iddashboard).text(dashboards[i].name); + var $link = $('<a/>').attr('data-idDashboard', dashboards[i].iddashboard).text(dashboards[i].name).addClass('item title'); var $li = $('<li/>').attr('id', 'Dashboard_embeddedIndex_' + dashboards[i].iddashboard) .addClass('dashboardMenuItem').append($link); items.push($li); if (dashboards[i].iddashboard == dashboardId) { dashboardName = dashboards[i].name; - $li.addClass('sfHover'); + $li.addClass('sfActive'); } } dashboardMenuList.prepend(items); - } else { - dashboardMenuList.hide(); } dashboardMenuList.find('a[data-idDashboard]').click(function (e) { @@ -505,13 +507,13 @@ if (typeof piwikMenu != 'undefined') { piwikMenu.activateMenu('Dashboard', 'embeddedIndex'); } - $('#Dashboard ul li').removeClass('sfHover'); + $('#Dashboard ul li').removeClass('sfActive'); if ($(dashboardElement).length) { $(dashboardElement).dashboard('loadDashboard', idDashboard); } else { broadcast.propagateAjax('module=Dashboard&action=embeddedIndex&idDashboard=' + idDashboard); } - $(this).closest('li').addClass('sfHover'); + $(this).closest('li').addClass('sfActive'); }); }; diff --git a/plugins/Dashboard/javascripts/widgetMenu.js b/plugins/Dashboard/javascripts/widgetMenu.js index 6d58415cb9a0a1d060aa8d88058a913a6b14532c..66e033cf8e14a26c079f6d0756dce04deac61ce1 100644 --- a/plugins/Dashboard/javascripts/widgetMenu.js +++ b/plugins/Dashboard/javascripts/widgetMenu.js @@ -227,7 +227,12 @@ widgetsHelper.loadWidgetAjax = function (widgetUniqueId, widgetParameters, onWid if ($('.' + settings.categorylistClass + ' .' + settings.choosenClass, widgetPreview).length) { var position = $('.' + settings.categorylistClass + ' .' + settings.choosenClass, widgetPreview).position().top - - $('.' + settings.categorylistClass, widgetPreview).position().top; + $('.' + settings.categorylistClass, widgetPreview).position().top + + $('.dashboard-manager .addWidget').outerHeight(); + + if (!$('#content.admin').length) { + position += 10; // + padding defined in dashboard view + } $('.' + settings.widgetlistClass, widgetPreview).css('top', position); $('.' + settings.widgetlistClass, widgetPreview).css('marginBottom', position); @@ -281,6 +286,7 @@ widgetsHelper.loadWidgetAjax = function (widgetUniqueId, widgetParameters, onWid $('li:not(.' + settings.unavailableClass + ')', widgetList).on('click', function () { if (!$('.widgetLoading', widgetPreview).length) { settings.onSelect($(this).attr('uniqueid')); + $(widgetPreview).closest('.dashboard-manager').removeClass('expanded'); if (settings.resetOnSelect) { resetWidgetPreview(widgetPreview); } @@ -341,6 +347,7 @@ widgetsHelper.loadWidgetAjax = function (widgetUniqueId, widgetParameters, onWid settings.onPreviewLoaded(widgetUniqueId, widgetElement); $('.' + settings.widgetpreviewClass + ' .widgetTop', widgetPreview).on('click', function () { settings.onSelect(widgetUniqueId); + $(widgetPreview).closest('.dashboard-manager').removeClass('expanded'); if (settings.resetOnSelect) { resetWidgetPreview(widgetPreview); } diff --git a/plugins/Dashboard/stylesheets/dashboard.less b/plugins/Dashboard/stylesheets/dashboard.less index fad10183e7d19adaa407caee790d583792a152e8..39ad2e3ed77c4afcc935e46ecfa252c3ceb62390 100644 --- a/plugins/Dashboard/stylesheets/dashboard.less +++ b/plugins/Dashboard/stylesheets/dashboard.less @@ -1,40 +1,21 @@ #dashboard { - margin: 0 -7px; + margin: 0 -6px; } -#root>.top_controls { - margin-left:15px; - margin-right:15px; +#standalone #dashboard { + margin: -10px -6px 0; } -.top_controls { - position: relative; - height: 32px; - clear: left; -} - -@media all and (max-width: 749px) { - .top_controls { - height: auto; - } - .top_controls #periodString, - .top_controls .dashboardSettings, - .top_controls .segmentEditorPanel { - position: static !important; - margin: 0 0 10px; - float: none; - } -} #dashboard { .col { min-height: 100px; // Customize Bootstrap gutter between columns - padding-right: 7px; - padding-left: 7px; + padding-right: 6px; + padding-left: 6px; >.sortable { - padding: 5px 0 10px 0; + padding: 5px 0 8px 0; } } } @@ -152,10 +133,8 @@ z-index: 120; background: #f7f7f7; border: 1px solid #e4e5e4; - padding: 5px 10px 6px 10px; border-radius: 4px; color: @theme-color-text-light; - font-size: 14px; cursor: pointer; overflow: hidden; } @@ -165,9 +144,9 @@ border-color: #a9a399; } -.dashboardSettings.visible { +.dashboardSettings.expanded { z-index: 1020; /* More than .jqplot-seriespicker-popover (1010) */ - min-width: 700px; + min-width: 800px; } .dashboardSettings > span { @@ -182,10 +161,9 @@ float: left; } -.dashboardSettings.visible ul.submenu { +.dashboardSettings.expanded ul.submenu { display: block; list-style: square outside none; - margin-left: 15px; } .dashboardSettings > ul.submenu > li { @@ -328,7 +306,6 @@ div.widgetpreview-preview { min-height: 0; height: auto; margin-right: 10px; - min-width: 180px; } .dashboardSettings .submenu { @@ -372,8 +349,8 @@ div.widgetpreview-preview { display: none; } -.dashboardSettings.visible .widgetpreview-widgetlist, -.dashboardSettings.visible .widgetpreview-preview { +.dashboardSettings.expanded .widgetpreview-widgetlist, +.dashboardSettings.expanded .widgetpreview-preview { display: block; } @@ -416,7 +393,7 @@ div.widgetpreview-preview { } #dashboardWidgetsArea { - margin-top: 5px; + margin-top: -5px; } @media all and (max-width: 749px) { diff --git a/plugins/Dashboard/stylesheets/standalone.css b/plugins/Dashboard/stylesheets/standalone.css index 5a2b0d90d9f436516d31da145ed5d15c9002b7b2..292d3e63c0d2cca73b7320acabaceb52544c7688 100644 --- a/plugins/Dashboard/stylesheets/standalone.css +++ b/plugins/Dashboard/stylesheets/standalone.css @@ -45,17 +45,10 @@ body { } #Dashboard > ul > li:hover, -#Dashboard > ul > li:hover a, -#Dashboard > ul > li.sfHover, -#Dashboard > ul > li.sfHover a { +#Dashboard > ul > li:hover a { color: #e87500; } -#Dashboard > ul > li.sfHover, -#Dashboard > ul > li.sfHover a { - font-weight: bold; -} - .top_controls > #Dashboard, .top_controls > #periodString, .top_controls > .dashboardSettings { diff --git a/plugins/Dashboard/stylesheets/widget.less b/plugins/Dashboard/stylesheets/widget.less index a06564f033aedd13b9e4e8021ad4542162e77ee9..558da41ab9d32b8e48c3edd2a509ec06b91ffa95 100644 --- a/plugins/Dashboard/stylesheets/widget.less +++ b/plugins/Dashboard/stylesheets/widget.less @@ -16,7 +16,7 @@ font-weight: normal; font-size: 15px; margin: 0; - color: #0D0D0D; + color: @theme-color-text; text-shadow: none; padding: 15px 15px 10px 12px; } diff --git a/plugins/Dashboard/templates/_dashboardSettings.twig b/plugins/Dashboard/templates/_dashboardSettings.twig index dc05a6dae1ca366fa3a104b1c6bd17bebd4f3ea6..b82e9137430d09556673948d19f012f314ef5df6 100644 --- a/plugins/Dashboard/templates/_dashboardSettings.twig +++ b/plugins/Dashboard/templates/_dashboardSettings.twig @@ -1,12 +1,12 @@ -<span>{{ 'Dashboard_Dashboard'|translate }}</span> -<ul class="submenu"> +<a class="title" title="{{ 'Dashboard_ManageDashboard'|translate|e('html_attr') }}"><span class="icon icon-arrow-bottom"></span>{{ 'Dashboard_Dashboard'|translate }} </a> +<ul class="dropdown submenu"> <li> - <div class="addWidget">{{ 'Dashboard_AddAWidget'|translate }} ↓</div> + <div class="addWidget">{{ 'Dashboard_AddAWidget'|translate }}</div> <ul class="widgetpreview-categorylist"></ul> </li> {% if dashboardActions|length > 0 %} <li> - <div class="manageDashboard">{{ 'Dashboard_ManageDashboard'|translate }} ↓</div> + <div class="manageDashboard">{{ 'Dashboard_ManageDashboard'|translate }}</div> <ul> {% for action, title in dashboardActions %} <li data-action="{{ action }}">{{ title|translate }}</li> diff --git a/plugins/Dashboard/templates/index.twig b/plugins/Dashboard/templates/index.twig index 0a8831fe3fcfdbbe5c567e580c238eaba1a8fe31..ddaac2428cb2c5f3a13056665025cb06433043b6 100644 --- a/plugins/Dashboard/templates/index.twig +++ b/plugins/Dashboard/templates/index.twig @@ -3,11 +3,12 @@ {% include "@CoreHome/_periodSelect.twig" %} {{ postEvent("Template.nextToCalendar") }} {% render dashboardSettingsControl %} - <div id="Dashboard" class="piwikTopControl"> + <div id="Dashboard" class="piwikTopControl borderedControl piwikSelector"> <ul> {% for dashboard in dashboards %} <li class="dashboardMenuItem" id="Dashboard_embeddedIndex_{{ dashboard.iddashboard }}"> - <a href="javascript:$('#dashboardWidgetsArea').dashboard('loadDashboard', {{ dashboard.iddashboard }});">{{ dashboard.name|escape }}</a> + <a href="javascript:$('#dashboardWidgetsArea').dashboard('loadDashboard', {{ dashboard.iddashboard }});" + class="title">{{ dashboard.name|escape }}</a> </li> {% endfor %} </ul> diff --git a/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePage.png b/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePage.png index abda1cb32078cbac45acd55b29b52bfa65ccef68..34830ea4e9a5a02076559fb5a549a018ebcbb29a 100644 Binary files a/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePage.png and b/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePage.png differ diff --git a/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePagePartial.png b/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePagePartial.png index 3543e6596a5fe86860832f070e81d5922ad7e2ca..e64af9b12ddd18f480ce35e4cb51a5c2067a4f67 100644 Binary files a/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePagePartial.png and b/plugins/ExamplePlugin/tests/UI/expected-ui-screenshots/SimpleUITest_simplePagePartial.png differ diff --git a/plugins/Goals/templates/manageGoals.twig b/plugins/Goals/templates/manageGoals.twig index 4e3a4ce855ee0ea031b00dcecf29def5beecec28..72124faf72d3c1e6ab4407dd6e25da7aed1e7e32 100644 --- a/plugins/Goals/templates/manageGoals.twig +++ b/plugins/Goals/templates/manageGoals.twig @@ -2,6 +2,10 @@ {% set title %}{{ 'Goals_ManageGoals'|translate }}{% endset %} +{% block topcontrols %} + {% include "@CoreHome/_siteSelectHeader.twig" %} +{% endblock %} + {% block content %} <h2 piwik-enriched-headline> @@ -20,8 +24,6 @@ {{ title }} </h2> - {% include "@CoreHome/_siteSelectHeader.twig" %} - {% include "@Goals/_addEditGoal.twig" %} <style type="text/css"> diff --git a/plugins/ImageGraph/templates/testAllSizes.twig b/plugins/ImageGraph/templates/testAllSizes.twig index c00c023d09db0290e697ee0890482c21d67f7bd1..c4df9672ecb29c119605befb30c17ba9849c908d 100644 --- a/plugins/ImageGraph/templates/testAllSizes.twig +++ b/plugins/ImageGraph/templates/testAllSizes.twig @@ -1,15 +1,15 @@ {% extends 'dashboard.twig' %} +{% block topcontrols %} + {% include '@CoreHome/_periodSelect.twig' %} +{% endblock %} + {% block content %} {% set showSitesSelection=true %} <div> <h2>{{ 'ImageGraph_ImageGraph'|translate }} ::: {{ siteName }}</h2> - <div class="top_controls"> - {% include '@CoreHome/_periodSelect.twig' %} - </div> - <div class="entityContainer" style="width:100%;"> <div class="entityAddContainer"> <table class="dataTable entityTable"> diff --git a/plugins/Installation/stylesheets/installation.css b/plugins/Installation/stylesheets/installation.css index 5621ae98df5bd4ea980cb0579e7252709642b282..feb21be950e1ba46a48b7fbd5f9b8402914e6ed3 100644 --- a/plugins/Installation/stylesheets/installation.css +++ b/plugins/Installation/stylesheets/installation.css @@ -4,7 +4,7 @@ body { /* Header */ .header { - padding: 50px 0 12px; + padding: 50px 0 22px; margin-bottom: 40px; border-bottom: solid 1px #ccc; } @@ -20,7 +20,7 @@ body { } .language-selector { float: left; - margin-left: 15px; + margin-left: 20px; margin-top: 10px; } .installation-progress { diff --git a/plugins/LeftMenu/API.php b/plugins/LeftMenu/API.php deleted file mode 100644 index 3d0d38b6468708a0fa2c6e8712fdcd118f1c9763..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/API.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * Piwik - free/libre analytics platform - * - * @link http://piwik.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - * - */ -namespace Piwik\Plugins\LeftMenu; - -/** - * API for plugin LeftMenu - * - * @method static \Piwik\Plugins\LeftMenu\API getInstance() - */ -class API extends \Piwik\Plugin\API -{ - /** - * Returns true if the left menu is enabled for the current user. - * - * @return bool - */ - public function isEnabled() - { - $settings = new Settings('LeftMenu'); - $default = $settings->globalEnabled->getValue(); - - if (!$settings->userEnabled->isReadableByCurrentUser()) { - return $default; - } - - $user = $settings->userEnabled->getValue(); - - if (empty($user) || $user === 'system') { - return $default; - } - - if ($user === 'no') { - return false; - } - - return true; - } -} diff --git a/plugins/LeftMenu/LeftMenu.php b/plugins/LeftMenu/LeftMenu.php deleted file mode 100755 index 522965e6b8a81bd799c89cf51eb8920ac38a090a..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/LeftMenu.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * Piwik - free/libre analytics platform - * - * @link http://piwik.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - * - */ - -namespace Piwik\Plugins\LeftMenu; - -class LeftMenu extends \Piwik\Plugin -{ - public function registerEvents() - { - return array( - 'AssetManager.getStylesheetFiles' => array('function' => 'getStylesheetFiles', 'after' => true), - 'Template.bodyClass' => 'addClassToBody' - ); - } - - public function addClassToBody(&$str, $layout) - { - if (API::getInstance()->isEnabled() && 'dashboard' === $layout) { - $str .= ' leftMenuPlugin'; - } - } - - public function getStylesheetFiles(&$stylesheets) - { - $stylesheets[] = "plugins/LeftMenu/stylesheets/theme.less"; - } - -} - diff --git a/plugins/LeftMenu/Settings.php b/plugins/LeftMenu/Settings.php deleted file mode 100644 index b22c1bc40a967f686bae41adb255602a43d25810..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/Settings.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * Piwik - free/libre analytics platform - * - * @link http://piwik.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - * - */ -namespace Piwik\Plugins\LeftMenu; - -use Piwik\Piwik; -use Piwik\Settings\SystemSetting; -use Piwik\Settings\UserSetting; - -/** - * Defines Settings for LeftMenu. - */ -class Settings extends \Piwik\Plugin\Settings -{ - /** @var SystemSetting */ - public $globalEnabled; - - /** @var UserSetting */ - public $userEnabled; - - protected function init() - { - $this->setIntroduction($this->t('SettingsIntroduction')); - - $this->createGlobalEnabledSetting(); - - $this->createUserEnabledSetting(); - } - - private function createGlobalEnabledSetting() - { - $this->globalEnabled = new SystemSetting('globalEnabled', $this->t('GlobalSettingTitle')); - $this->globalEnabled->type = static::TYPE_BOOL; - $this->globalEnabled->inlineHelp = $this->t('GlobalSettingDescription') . ' ' . $this->t('GlobalSettingInlineHelp'); - $this->globalEnabled->defaultValue = false; - $this->globalEnabled->readableByCurrentUser = true; - - $this->addSetting($this->globalEnabled); - } - - private function createUserEnabledSetting() - { - $this->userEnabled = new UserSetting('userEnabled', $this->t('UserSettingTitle')); - $this->userEnabled->type = static::TYPE_STRING; - $this->userEnabled->uiControlType = static::CONTROL_RADIO; - $this->userEnabled->defaultValue = 'system'; - $this->userEnabled->inlineHelp = $this->t('UserSettingInlineHelp'); - $this->userEnabled->availableValues = array( - 'system' => Piwik::translate('General_Default'), - 'yes' => Piwik::translate('General_Yes'), - 'no' => Piwik::translate('General_No') - ); - - $this->addSetting($this->userEnabled); - } - - private function t($key) - { - return Piwik::translate('LeftMenu_' . $key); - } - -} diff --git a/plugins/LeftMenu/lang/bg.json b/plugins/LeftMenu/lang/bg.json deleted file mode 100644 index 4c5cc8fc3670e22f1fbf2c84fe80e0b76199bc2a..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/bg.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "LeftMenu": { - "UserSettingTitle": "Ðктивиране на лÑвото меню за отчет" - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/cs.json b/plugins/LeftMenu/lang/cs.json deleted file mode 100644 index e15938a574086816b06043197734a813c6330151..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/cs.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "LeftMenu": { - "PluginDescription": "UmÃstit menu nástÄ›nky nalevo.", - "SettingsIntroduction": "Zásuvný modul levé menu pÅ™esune menu hlášenà na levou stranu (je-li povolen). To je pÅ™edevÅ¡Ãm užiteÄné na velkých displejÃch.", - "GlobalSettingTitle": "Levé menu je ve výchozÃm stavu povoleno", - "GlobalSettingDescription": "Definuje systémovou výchozà hodnotu pro vÅ¡echny uživatele.", - "GlobalSettingInlineHelp": "Uživatelé si mohou zakázat\/povolit levé menu nezávisle na systémové výchozà hodnotÄ›.", - "UserSettingTitle": "Povolit levé menu hlášenÃ", - "UserSettingInlineHelp": "Toto povolà nebo zakáže levé menu jen pro vás bez ohledu na jiné uživatele. Super uživatel může nastavit výchozà systémovou hodnotu." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/da.json b/plugins/LeftMenu/lang/da.json deleted file mode 100644 index 27da2b16515a247bd0886dd361eb9fea1951f92b..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/da.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "LeftMenu": { - "SettingsIntroduction": "Venstre menu udvidelsen vil flytte rapportmenuen fra toppen til venstre, hvis aktiveret. Dette er især nyttigt for store skærme.", - "GlobalSettingTitle": "Venstre menu aktiveret som standard", - "GlobalSettingDescription": "Definerer systemets standard indstillinger for alle brugerne.", - "GlobalSettingInlineHelp": "Brugerne er i stand til at aktivere\/deaktivere venstremenuen uafhængigt af systemets standard indstillinger.", - "UserSettingTitle": "Aktiver rapportmenu til venstre", - "UserSettingInlineHelp": "Dette vil kun aktivere eller deaktivere venstre menuen for dig og pÃ¥virker ikke andre brugere. En superbruger kan ændre standardindstillingen for alle brugere." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/de.json b/plugins/LeftMenu/lang/de.json deleted file mode 100644 index 997daaca2847f1a0cc70b9741dfc49ee74c6e8af..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/de.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "LeftMenu": { - "PluginDescription": "Platziert das Dashboardmenü auf die linke Seite", - "SettingsIntroduction": "Das LeftMenu Plug-In verschiebt die Menüs für die Reporte auf die linke Seite. Dies ist für umfangreiche Reporte hilfreich.", - "GlobalSettingTitle": "LeftMenu aktiviert als Voreinstellung", - "GlobalSettingDescription": "Legt die Standardeinstellung für alle Benutzer fest.", - "GlobalSettingInlineHelp": "Die Benutzer können es unabhängig von der Vorgabe aktivieren\/deaktivieren.", - "UserSettingTitle": "LeftMenu aktiviert", - "UserSettingInlineHelp": "Legt die Einstellung für den aktuellen Benutzer fest, ob LeftMenu aktiviert oder deaktiviert sein soll. Ein Administrator kann die Standardeinstellung für alle Benutzer festlegen." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/el.json b/plugins/LeftMenu/lang/el.json deleted file mode 100644 index e8ef94446e17835c9c33d004f18b153c8d45df1a..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/el.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "LeftMenu": { - "PluginDescription": "ΤοποθÎτηση του Î¼ÎµÎ½Î¿Ï Ï„Î¿Ï… πίνακα ελÎγχου στα αÏιστεÏά.", - "SettingsIntroduction": "Το Ï€Ïόσθετο για το αÏιστεÏÏŒ Î¼ÎµÎ½Î¿Ï Î¸Î± μετακινήσει το Î¼ÎµÎ½Î¿Ï Î±Î½Î±Ï†Î¿Ïών από την κοÏυφή Ï€Ïος τα αÏιστεÏά αν ενεÏγοποιηθεί. Αυτό είναι ιδιαίτεÏα χÏήσιμο για μεγάλες οθόνες.", - "GlobalSettingTitle": "Το αÏιστεÏÏŒ Î¼ÎµÎ½Î¿Ï ÎµÎ¯Î½Î±Î¹ εξ' οÏÎ¹ÏƒÎ¼Î¿Ï ÎµÎ½ÎµÏγοποιημÎνο.", - "GlobalSettingDescription": "ΟÏίζει την Ï€Ïοεπιλογή για όλους τους χÏήστες.", - "GlobalSettingInlineHelp": "Οι χÏήστες μποÏοÏν να απενεÏγοποιοÏν\/ενεÏγοποιοÏν το αÏιστεÏÏŒ Î¼ÎµÎ½Î¿Ï Î±Î½ÎµÎ¾Î¬Ïτητα από την Ï€ÏοεπιλεγμÎνη ÏÏθμιση του συστήματος.", - "UserSettingTitle": "ΕνεÏγοποίηση του αÏιστεÏÎ¿Ï Î¼ÎµÎ½Î¿Ï Î±Î½Î±Ï†Î¿Ïών", - "UserSettingInlineHelp": "Αυτό θα ενεÏγοποιήσει ή απενεÏγοποιήσει το αÏιστεÏÏŒ Î¼ÎµÎ½Î¿Ï Î¼ÏŒÎ½Î¿ για εσάς και δε θα επηÏεάσει άλλους χÏήστες. Ένας ΥπεÏχÏήστης μποÏεί να αλλάξει την Ï€ÏοκαθοÏισμÎνη ÏÏθμιση για όλους τους χÏήστες." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/en.json b/plugins/LeftMenu/lang/en.json deleted file mode 100644 index 2869b864792d3aa79f4590702d50aaff89fb1352..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/en.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "LeftMenu": { - "PluginDescription": "Position the dashboard menu to the left.", - "SettingsIntroduction": "The left menu plugin will move the reporting menu from the top to the left if enabled. This is especially useful for large displays.", - "GlobalSettingTitle": "Left menu enabled by default", - "GlobalSettingDescription": "Defines the system default for all of your users.", - "GlobalSettingInlineHelp": "Users are able to disable/enable the left menu independent of the system default.", - "UserSettingTitle": "Enable left reporting menu", - "UserSettingInlineHelp": "This will enable or disable the left menu only for you and not affect any other users. A Super User can change the default for all users." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/es.json b/plugins/LeftMenu/lang/es.json deleted file mode 100644 index 66a3ed43f7ed1157feb6cbafb33e003b8fb1d347..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/es.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "LeftMenu": { - "PluginDescription": "Ubicar el menú del tablero a la izquierda.", - "SettingsIntroduction": "El menú izquierdo del complemento moverá el menú de información desde la parte superior a la izquierda si es habilitado. Especialmente útil para pantallas grandes.", - "GlobalSettingTitle": "Menú izquierdo activado por defecto", - "GlobalSettingDescription": "Define el sistema predeterminado para todos sus usuarios.", - "GlobalSettingInlineHelp": "Los usuarios están habilitados a habilitar\/deshabilitar el menú izquierdo independientemente del sistema predeterminado.", - "UserSettingTitle": "Habilitar menú izquierdo de información", - "UserSettingInlineHelp": "Esto habilitará o deshabilitará el menú izquierdo solo para usted y no afectará a ningún otro usuario. Un Super Usuario puede cambiar el modo predeterminado para todos los demás usuarios." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/fi.json b/plugins/LeftMenu/lang/fi.json deleted file mode 100644 index d2007c8cf4bb0f69b17336dc7d5bbf110283a9e0..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/fi.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "LeftMenu": { - "GlobalSettingTitle": "Vasen valikko oletuksena käytössä", - "GlobalSettingDescription": "Määrittää järjestelmän oletusasetuksen kaikille käyttäjille.", - "GlobalSettingInlineHelp": "Käyttäjät voivat poistaa käytöstä\/ottaa käyttöön vasemman valikon riippumatta järjestelmän oletusasetuksesta.", - "UserSettingTitle": "Ota vasen raportointivalikko käyttöön" - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/fr.json b/plugins/LeftMenu/lang/fr.json deleted file mode 100644 index 52b8c6b0b8953f6f803b960ab345b852d1f46001..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/fr.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "LeftMenu": { - "PluginDescription": "Positionne le menu du tableau de bord sur la gauche.", - "SettingsIntroduction": "Le composant de menu à gauche va déplacer le menu de rapport d'en haut vers la gauche s'il est activé. C'est particulièrement utile pour les affichages larges.", - "GlobalSettingTitle": "Menu de gauche activé par défaut", - "GlobalSettingDescription": "Définit les valeurs système par défaut pour tous les utilisateurs.", - "GlobalSettingInlineHelp": "Les utilisateurs peuvent activer\/désactiver le menu de gauche indépendant des valeurs par défaut du système.", - "UserSettingTitle": "Activer le menu de rapport de gauche", - "UserSettingInlineHelp": "Cela va activer ou désactiver le menu de gauche pour vous uniquement et ne pas affecter les autres utilisateurs. Un super utilisateur peut modifier le paramètre par défaut pour tous les utilisateurs." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/hi.json b/plugins/LeftMenu/lang/hi.json deleted file mode 100644 index b45521c7e659a65a8ebb75277981307353f95567..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/hi.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "LeftMenu": { - "PluginDescription": "बाईं ओर डैशबोरà¥à¤¡ मेनू सà¥à¤¥à¤¿à¤¤à¤¿à¥¤", - "SettingsIntroduction": "अगर सकà¥à¤°à¤¿à¤¯ बाà¤à¤ मेनू पà¥à¤²à¤—इन बाईं ओर ऊपर से रिपोरà¥à¤Ÿà¤¿à¤‚ग मेनू कदम होगा। इस बड़े डिसà¥à¤ªà¥à¤²à¥‡ के लिठविशेष रूप से उपयोगी है।", - "GlobalSettingTitle": "डिफ़ॉलà¥à¤Ÿ रूप से सकà¥à¤·à¤® बाà¤à¤ मेनू", - "GlobalSettingDescription": "आपके सà¤à¥€ उपयोगकरà¥à¤¤à¤¾à¤“ं के लिठसिसà¥à¤Ÿà¤® मूलà¤à¥‚त को परिà¤à¤¾à¤·à¤¿à¤¤ करता है।", - "GlobalSettingInlineHelp": "उपयोगकरà¥à¤¤à¤¾ निषà¥à¤•à¥à¤°à¤¿à¤¯ \/ सिसà¥à¤Ÿà¤® डिफ़ॉलà¥à¤Ÿ के बाईं ओर मेनू सà¥à¤µà¤¤à¤‚तà¥à¤° सकà¥à¤·à¤® करने में सकà¥à¤·à¤® हैं।", - "UserSettingTitle": "छोड़ दिया रिपोरà¥à¤Ÿà¤¿à¤‚ग मेनू सकà¥à¤·à¤® करें", - "UserSettingInlineHelp": "इस सकà¥à¤·à¤® है या केवल आप के लिठछोड़ दिया मेनू को अकà¥à¤·à¤® और किसी à¤à¥€ अनà¥à¤¯ उपयोगकरà¥à¤¤à¤¾à¤“ं को पà¥à¤°à¤à¤¾à¤µà¤¿à¤¤ नहीं करेगा । à¤à¤• सà¥à¤ªà¤° उपयोगकरà¥à¤¤à¤¾ सà¤à¥€ उपयोगकरà¥à¤¤à¤¾à¤“ं के लिठडिफ़ॉलà¥à¤Ÿ बदल सकते हैं।" - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/it.json b/plugins/LeftMenu/lang/it.json deleted file mode 100644 index 844623abbc92a421674bb85a8f1a3f3dc2090e89..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/it.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "LeftMenu": { - "PluginDescription": "Posiziona il menù dashboard sulla sinistra.", - "SettingsIntroduction": "Il plugin menù di sinistra sposta il menu di segnalazione dalla parte superiore a sinistra, se abilitato. Ciò è particolarmente utile per i display di grandi dimensioni.", - "GlobalSettingTitle": "Il menù di sinistra è abilitato di default", - "GlobalSettingDescription": "Definisce le impostazioni predefinite di sistema per tutti gli utenti.", - "GlobalSettingInlineHelp": "Gli utenti possono disabilitare o abilitare il menù di sinistra indipendentemente dalle impostazioni predefinite del sistema.", - "UserSettingTitle": "Abilita il menù di segnalazione di sinistra", - "UserSettingInlineHelp": "Questo abilita o disabilita il menù di sinistra solo per te e non ha effetto per gli altri utenti. Un Super User può cambiare per tutti gli utenti le impostazioni predefinite." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/ja.json b/plugins/LeftMenu/lang/ja.json deleted file mode 100644 index 6d4e82e5ec44515c8b46aa296b31a5e092067525..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/ja.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "LeftMenu": { - "SettingsIntroduction": "左メニューã®ãƒ—ラグインã¯ã€æœ‰åŠ¹åŒ–ã•れã¦ã„ã‚‹å ´åˆã€ãƒ¬ãƒãƒ¼ãƒˆãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’トップã‹ã‚‰å·¦ã«ç§»å‹•ã—ã¾ã™ã€‚ã“ã®ç§»å‹•ã¯ã€ç‰¹ã«å¤§ããªãƒ‡ã‚£ã‚¹ãƒ—レイをãŠä½¿ã„ã®å ´åˆã€ä¾¿åˆ©ã§ã™ã€‚", - "GlobalSettingTitle": "デフォルトã«ã‚ˆã‚Šæœ‰åŠ¹åŒ–ã•れãŸå·¦ãƒ¡ãƒ‹ãƒ¥ãƒ¼", - "GlobalSettingDescription": "全サイトユーザーã®ãŸã‚ã®ã‚·ã‚¹ãƒ†ãƒ デフォルトを定義", - "GlobalSettingInlineHelp": "ユーザーã¯ã€ã‚·ã‚¹ãƒ†ãƒ デフォルトã®å·¦ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã®ç‹¬ç«‹ã‚’無効 \/ 有効ã«ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚", - "UserSettingTitle": "å·¦ã®ãƒ¬ãƒãƒ¼ãƒˆãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’有効ã«ã™ã‚‹", - "UserSettingInlineHelp": "ã“れã¯ã€å·¦ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’ã‚ãªãŸã®ãŸã‚ã ã‘ã«æœ‰åйã¾ãŸã¯ç„¡åйã«ã—ã€ä»–ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ã«ã¯å½±éŸ¿ã—ã¾ã›ã‚“。スーパーユーザーã¯ã€å…¨ã¦ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ã«å¯¾ã™ã‚‹ãƒ‡ãƒ•ォルトè¨å®šã‚’変更ã§ãã¾ã™ã€‚" - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/nl.json b/plugins/LeftMenu/lang/nl.json deleted file mode 100644 index f3dcf078a814ce92d6e32674d892a872d10003f7..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/nl.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "LeftMenu": { - "PluginDescription": "Plaats het dashboard menu aan de linkerzijde", - "SettingsIntroduction": "De linkermenu plugin verplaatst indien ingeschakeld het menu van bovenaan de pagina naar links. Deze optie is vooral handig bij het gebruik van een groot scherm.", - "GlobalSettingTitle": "Linker menu standaard ingeschakeld", - "GlobalSettingDescription": "Definieert het systeem standaard voor al uw gebruikers.", - "GlobalSettingInlineHelp": "De gebruikers hebben de mogelijkheid om het linkermenu in of uit te schakelen los van de algemene instellingen.", - "UserSettingTitle": "Schakel het linker menu in.", - "UserSettingInlineHelp": "Dit zal het linkermenu alleen voor u en niet voor andere gebruikers inschakelen. Een Super User kan de standaard instelling voor alle gebruikers aanpassen." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/pl.json b/plugins/LeftMenu/lang/pl.json deleted file mode 100644 index c75b2ea5d800936fa50ad410f05d655c63d67f74..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/pl.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "LeftMenu": { - "GlobalSettingTitle": "Menu po lewej stronie domyÅ›lnie włączone", - "GlobalSettingDescription": "Definiuje domyÅ›lne systemu dla wszystkich użytkowników." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/pt-br.json b/plugins/LeftMenu/lang/pt-br.json deleted file mode 100644 index 69c7444974d6cc909fc5f91c5ab65375637e6249..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/pt-br.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "LeftMenu": { - "PluginDescription": "Posiciona o menu do painel de controle à esquerda.", - "SettingsIntroduction": "O plugin de menu lateral irá mover o menu de relatórios do topo para a esquerda, se habilitado. Isto é útil especialmente para telas de grandes proporções.", - "GlobalSettingTitle": "Menu lateral habilitado por padrão", - "GlobalSettingDescription": "Define o padrão do sistema para todos os usuários.", - "GlobalSettingInlineHelp": "Usuários podem habilitar ou desabilitar o menu lateral independentemente do padrão do sistema.", - "UserSettingTitle": "Habilitar o menu lateral de relatórios", - "UserSettingInlineHelp": "Isto irá habilitar ou desabilitar o menu lateral apenas para você, sem afetar nenhum outro usuário. Um superusuário poderá alterar o padrão para todos os usuários." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/pt.json b/plugins/LeftMenu/lang/pt.json deleted file mode 100644 index 787044a2ec73b2edaaa0a0e09485d78262a3c698..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/pt.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "LeftMenu": { - "PluginDescription": "Posiçionar o painel do menu na esquerda.", - "SettingsIntroduction": "O plugin menu à esquerda irá mover o menu dos relatórios do topo à esquerda se estiver ativado. Isto é especialmente útil para grandes ecrãs.", - "GlobalSettingTitle": "Menu esquerdo ativo por padrão.", - "GlobalSettingDescription": "Definição do sistema padrão para todos os usuários.", - "GlobalSettingInlineHelp": "Os utilizadores são capazes de ativar ou desativar o menu na esquerda independentemente da preferência padrão do sistema.", - "UserSettingTitle": "Ative o menu relatório na esquerda.", - "UserSettingInlineHelp": "Isso irá ativar ou desativar o menu à esquerda apenas para ti e não afecta quaisquer outros utilizadores. Um super user pode alterar o padrão para todos os utilizadores." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/ro.json b/plugins/LeftMenu/lang/ro.json deleted file mode 100644 index fa63c4cac6924772cbcee86f5cea59e6ea480ca0..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/ro.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "LeftMenu": { - "SettingsIntroduction": "Modulul meniului din stânga va muta meniul de raportare din partea de sus în partea stângă dacă este activat. Acesta este folositor în special în cazul ecranelor mari.", - "GlobalSettingTitle": "Meniul din stânnga este activat implicit", - "GlobalSettingDescription": "DefineÈ™te valoarea implicită pentru toÈ›i utilizatorii.", - "GlobalSettingInlineHelp": "Utilizatorii pot dezactiva\/activa meniul din stânga independet de valoare implicită.", - "UserSettingTitle": "Activează meniul de raportare din stânga", - "UserSettingInlineHelp": "Acesta va activa sau dezactiva meniul din stânga doar pentru dumneavoastra È™i nu va afecta alÈ›i utilizatori. Un Super Utilizator va putea schimba modul implicit pentru toÈ›i utilizatorii." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/ru.json b/plugins/LeftMenu/lang/ru.json deleted file mode 100644 index e0d825348b4165d89048efe2a07f1ac67b18f3c1..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/ru.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "LeftMenu": { - "SettingsIntroduction": "ЕÑли включить плагин LeftMenu, он перемеÑтит главное меню Ñверху налево. Ðто будет удобно Ð´Ð»Ñ Ð±Ð¾Ð»ÑŒÑˆÐ¸Ñ… Ñкранов.", - "GlobalSettingTitle": "Левое меню включено поумолчанию", - "GlobalSettingDescription": "ОпределÑет значение по умолчанию Ð´Ð»Ñ Ð²Ñех пользователей.", - "GlobalSettingInlineHelp": "Пользователи имеют возможноÑть отключить\/включить левое меню незавиÑимо от Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¿Ð¾ умолчанию.", - "UserSettingInlineHelp": "Ðто включает или отключает левое меню только Ð´Ð»Ñ Ð²Ð°Ñ Ð¸ не влиÑет на других пользователей. Суперпользователь может изменить наÑтройки по умолчанию Ð´Ð»Ñ Ð²Ñех пользователей." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/sr.json b/plugins/LeftMenu/lang/sr.json deleted file mode 100644 index e2aaa6bbc15094efafab9f1d5324c1c621b9f2ac..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/sr.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "LeftMenu": { - "PluginDescription": "Postavi meni za konzolu na levu stranu.", - "SettingsIntroduction": "Dodatak za levi meni će pomeriti meni za izveÅ¡taje sa vrha na levu stranu. Ovo je praktiÄno od velikih monitora.", - "GlobalSettingTitle": "Levi meni je podrazumevano ukljuÄen", - "GlobalSettingDescription": "Postavljanje podrazumevanih vrednosti za sve korisnike.", - "GlobalSettingInlineHelp": "Korisnici mogu da ukljuÄuju i iskljuÄuju levi meni nezavisno od podrazumevanih sistemskih podeÅ¡avanja.", - "UserSettingTitle": "Omogući meni sa leve strane", - "UserSettingInlineHelp": "Ova opcija će ukljuÄiti ili iskljuÄiti meni sa leve strane samo za vas a ne i za ostale korisnike. Superkorisnik može da promeni podrazumevane vrednosti za sve korisnike." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/sv.json b/plugins/LeftMenu/lang/sv.json deleted file mode 100644 index aeaa07d522745808c8846454b1dfc699c5006212..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/sv.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "LeftMenu": { - "PluginDescription": "Placera menyn till vänster.", - "SettingsIntroduction": "Tillägget för vänstermeny kommer, ifall det är aktiverat, flytta rapportmenyn till den vänstra sidan. Detta är speciellt användbart för större skärmar.", - "GlobalSettingTitle": "Vänster meny aktiverad som standard", - "GlobalSettingDescription": "Definierar systemets standardinställning för alla dina användare.", - "GlobalSettingInlineHelp": "Användare har möjlighet att aktivera\/deaktivera vänstermenyn oavhängigt systeminställningarna.", - "UserSettingTitle": "Aktivera vänster rapporteringsmeny", - "UserSettingInlineHelp": "Detta kommer aktivera\/deaktivera för dig utan att pÃ¥verka andra användare. En Super User kan ändra inställningen för samtliga användare." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/tl.json b/plugins/LeftMenu/lang/tl.json deleted file mode 100644 index 2a6a0045b6e1bf8aa9d0cf975ca52e998b56d870..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/tl.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "LeftMenu": { - "SettingsIntroduction": "Ang kaliwang menu na may plugin ay pwedeng ilipat ang menu kung saan makikita ang ulat mula sa taas papunta sa kaliwa kung ito ay gumagana. Ito ay lalong mapapakinabangan sa malalaking display.", - "GlobalSettingTitle": "Ang kaliwa menu ay gumagana bilang default", - "GlobalSettingDescription": "Tinutukoy ang default system para sa lahat ng iyong mga user.", - "GlobalSettingInlineHelp": "Ang user ay maari makapag pagana o hindi makapag pagana ng menu sa kaliwa na independent sa system default.", - "UserSettingTitle": "Pagahanin ang kaliwang menu na pang ulat", - "UserSettingInlineHelp": "Ang menu sa kaliwa ay pwede mong paganahin o wag paganahin at hindi maapektuhan ang ibang mga user. Ang Super User ay pwedeng baguhin ang lahat pangunahing pagpipilian sa lahat ng users." - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/tr.json b/plugins/LeftMenu/lang/tr.json deleted file mode 100644 index ab8dbb51d8aaeae02348223b37b180dc62bbe28c..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/tr.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "LeftMenu": { - "UserSettingTitle": "Sol raporlama menüsünü etkinleÅŸtir" - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/lang/zh-cn.json b/plugins/LeftMenu/lang/zh-cn.json deleted file mode 100644 index fef3e18afd1c7c8a887f95bc3433ec6a480c66e2..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/lang/zh-cn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "LeftMenu": { - "GlobalSettingTitle": "å·¦èœå•默认打开", - "UserSettingTitle": "å¼€å¯å·¦è¾¹çš„æŠ¥è¡¨èœå•" - } -} \ No newline at end of file diff --git a/plugins/LeftMenu/stylesheets/theme.less b/plugins/LeftMenu/stylesheets/theme.less deleted file mode 100644 index 6c15ee301e197ca1c29274eb4f6d7c51a03c80e4..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/stylesheets/theme.less +++ /dev/null @@ -1,150 +0,0 @@ -.leftMenuPlugin { - - #container { - clear: left; - } - - #root .Menu--dashboard { - border: 0px; - - > .Menu-tabList { - margin-left: 5px; - margin-bottom: 0; - margin-top: 0.1em; - border: 1px solid @theme-color-background-lowContrast; - } - - > li { - border-bottom: 1px solid @theme-color-background-lowContrast; - } - } - - #content.home { - padding-top: 15px; - display:inline-block; - width:100%; - } - - .Menu--dashboard { - padding: 0; - float: left; - width: 240px; - padding-top: 24px; - clear: left; - - > .Menu-tabList { - -moz-background-size: 5px 100%; - background-size: 5px 100%; - background-position: 0 0, 100% 0; - background-repeat: no-repeat; - - > li { - > ul { - min-height: 0; - max-height: 0; - padding: 0; - overflow: hidden; - position: static; - float: none; - } - - > span, - > a { - display: block; - padding: 5px 10px; - font-size: 18px; - line-height: 24px; - text-decoration: none; - float: none; - } - } - - > .sfActive > ul { - padding-bottom: 5px; - max-height: 500px; /* That's a hack for CSS transitions */ - } - - li { - list-style: none; - margin: 0; - float: none; - border: 0; - border-radius: 0; - background: transparent; - - a:hover { - text-decoration: underline; - } - - li { - float: none; - text-align: left; - - a { - text-decoration: none; - padding: 0.6em 0.9em; - font: 14px Arial, Helvetica, sans-serif; - display: block; - - &.current { - background: #defdbb; - } - - &:link, - &:visited { - text-decoration: none; - } - } - - } - } - - a { - height: auto; - } - - > .sfActive > a, - > li > a:hover { - background: #f1f1f1; - } - - > .sfActive .sfHover > a { - font-weight: bold; - } - } - } - - .top_controls { - clear: none; - left: 34px; - } - - .nav_sep { - display: none; - } - - .top_bar_sites_selector { - float: left; - } - - .pageWrap { - margin-left: 240px; - margin-top: 0; - max-height: none; - } - - .widget:first-child { - margin-top: 0; - } - - .sites_selector_in_dashboard { - margin-top: 0px; - margin-left: 5px; - } - - .sites_autocomplete .custom_select_main_link { - padding-top: 7px; - padding-bottom: 7px; - } - -} diff --git a/plugins/LeftMenu/tests/Integration/APITest.php b/plugins/LeftMenu/tests/Integration/APITest.php deleted file mode 100644 index c53616590592d62073ee27973dbaede60761a25e..0000000000000000000000000000000000000000 --- a/plugins/LeftMenu/tests/Integration/APITest.php +++ /dev/null @@ -1,149 +0,0 @@ -<?php -/** - * Piwik - free/libre analytics platform - * - * @link http://piwik.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -namespace Piwik\Plugins\LeftMenu\tests\Integration; - -use Piwik\Plugins\LeftMenu\API; -use Piwik\Plugins\LeftMenu\Settings; -use Piwik\Tests\Framework\Mock\FakeAccess; -use Piwik\Tests\Framework\TestCase\IntegrationTestCase; - -/** - * @group LeftMenu - * @group APITest - * @group Plugins - */ -class APITest extends IntegrationTestCase -{ - /** - * @var API - */ - private $api; - - /** - * @var Settings - */ - private $settings; - - public function setUp() - { - parent::setUp(); - - $this->api = API::getInstance(); - $this->createSettings(); - } - - public function test_isEnabled_shouldReturnFalse_ByDefault() - { - $this->assertLeftMenuIsDisabled(); - - $this->setUser(); - $this->assertLeftMenuIsDisabled(); - - $this->setSuperUser(); - $this->assertLeftMenuIsDisabled(); - } - - public function test_isEnabled_shouldReturnTrue_IfEnabledSystemWideAndNoUserPreference() - { - $this->enableLeftMenuForAll(); - - $this->assertLeftMenuIsEnabled(); - - $this->setUser(); - $this->assertLeftMenuIsEnabled(); - - $this->setAnonymous(); - $this->assertLeftMenuIsEnabled(); - } - - public function test_isEnabled_AUserPreferenceShouldOverwriteASystemPreference_DefaultDisabled() - { - $this->assertLeftMenuIsDisabled(); - - $this->setUser(); - $this->setUserSettingValue('yes'); - - $this->assertLeftMenuIsEnabled(); - - $this->setAnonymous(); - $this->assertLeftMenuIsDisabled(); - } - - public function test_isEnabled_AUserPreferenceShouldOverwriteASystemPreference_DefaultEnabled() - { - $this->enableLeftMenuForAll(); - - $this->assertLeftMenuIsEnabled(); - - $this->setUser(); - $this->setUserSettingValue('no'); - - $this->assertLeftMenuIsDisabled(); - - $this->setAnonymous(); - $this->assertLeftMenuIsEnabled(); - } - - private function assertLeftMenuIsEnabled() - { - $this->assertTrue($this->api->isEnabled()); - } - - private function assertLeftMenuIsDisabled() - { - $this->assertFalse($this->api->isEnabled()); - } - - private function setSuperUser() - { - FakeAccess::$superUser = true; - FakeAccess::$superUserLogin = 'superUserLogin'; - - $this->createSettings(); - } - - private function setAnonymous() - { - FakeAccess::clearAccess(); - $this->createSettings(); - } - - private function setUser() - { - FakeAccess::$idSitesView = array(1); - FakeAccess::$identity = 'userLogin'; - - $this->createSettings(); - } - - private function enableLeftMenuForAll() - { - $this->setSuperUser(); - $this->settings->globalEnabled->setValue(true); - $this->settings->save(); - } - - private function createSettings() - { - $this->settings = new Settings('LeftMenu'); - } - - private function setUserSettingValue($value) - { - $this->settings->userEnabled->setValue($value); - $this->settings->save(); - } - - public function provideContainerConfig() - { - return array( - 'Piwik\Access' => new FakeAccess() - ); - } -} diff --git a/plugins/Morpheus/Menu.php b/plugins/Morpheus/Menu.php index 740263e3818629977f8e8a8294974e1f5e33a3f2..2ba349a302aeef64fd7b18d97e04024bf48a004c 100644 --- a/plugins/Morpheus/Menu.php +++ b/plugins/Morpheus/Menu.php @@ -10,6 +10,7 @@ namespace Piwik\Plugins\Morpheus; use Piwik\Development; use Piwik\Menu\MenuAdmin; +use Piwik\Menu\MenuReporting; use Piwik\Menu\MenuUser; use Piwik\Piwik; @@ -17,14 +18,35 @@ class Menu extends \Piwik\Plugin\Menu { public function configureAdminMenu(MenuAdmin $menu) { + $menu->registerMenuIcon('CoreAdminHome_MenuDevelopment', 'icon-admin-development'); + $menu->registerMenuIcon('CoreAdminHome_MenuDiagnostic', 'icon-admin-diagnostic'); + $menu->registerMenuIcon('CorePluginsAdmin_MenuPlatform', 'icon-admin-platform'); + $menu->registerMenuIcon('General_Settings', 'icon-admin-settings'); + $menu->registerMenuIcon('CoreAdminHome_Administration', 'icon-admin-administration'); + if (Development::isEnabled() && Piwik::isUserHasSomeAdminAccess()) { $menu->addDevelopmentItem('UI Demo', $this->urlForAction('demo')); } } + public function configureUserMenu(MenuUser $menu) { + $menu->registerMenuIcon('UsersManager_MenuPersonal', 'icon-user-personal'); + $menu->registerMenuIcon('CoreAdminHome_MenuManage', 'icon-user-manage'); + $menu->registerMenuIcon('CorePluginsAdmin_MenuPlatform', 'icon-user-platform'); + if (Development::isEnabled() && Piwik::isUserHasSomeAdminAccess()) { $menu->addPlatformItem('UI Demo', $this->urlForAction('demo'), $order = 15); } } + + public function configureReportingMenu(MenuReporting $menu) + { + $menu->registerMenuIcon('General_Visitors', 'icon-reporting-visitors'); + $menu->registerMenuIcon('General_Actions', 'icon-reporting-actions'); + $menu->registerMenuIcon('Referrers_Referrers', 'icon-reporting-referer'); + $menu->registerMenuIcon('Goals_Goals', 'icon-reporting-goal'); + $menu->registerMenuIcon('Goals_Ecommerce', 'icon-reporting-ecommerce'); + $menu->registerMenuIcon('Dashboard_Dashboard', 'icon-reporting-dashboard'); + } } diff --git a/plugins/Morpheus/fonts/piwik.eot b/plugins/Morpheus/fonts/piwik.eot old mode 100644 new mode 100755 index bd41afad9edb7d1ea2aa18ac9b0b38e047a5082a..3bda40841acba8c6ab0a9fa6808758a9135b4e7f Binary files a/plugins/Morpheus/fonts/piwik.eot and b/plugins/Morpheus/fonts/piwik.eot differ diff --git a/plugins/Morpheus/fonts/piwik.ttf b/plugins/Morpheus/fonts/piwik.ttf old mode 100644 new mode 100755 index c81d69e10c28ed59c451ad46f2579a98e269dbb9..7887145303ba8702d9a7b59d1bfc9467cc7990bf Binary files a/plugins/Morpheus/fonts/piwik.ttf and b/plugins/Morpheus/fonts/piwik.ttf differ diff --git a/plugins/Morpheus/images/logo.svg b/plugins/Morpheus/images/logo.svg index d288e2072ec8f068fde88771531a55324440990e..8c0be81ce932426e9169e37e655e6fbce869d646 100644 --- a/plugins/Morpheus/images/logo.svg +++ b/plugins/Morpheus/images/logo.svg @@ -3,22 +3,22 @@ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="170.666px" height="45.704px" viewBox="0 0 170.666 45.704" enable-background="new 0 0 170.666 45.704" xml:space="preserve"> -<path fill="#D42A1F" d="M106.995,1.016c-2.57-0.739-5.251,0.751-5.987,3.329l-5.532,19.351L89.943,4.345 +<path fill="#d4291f" d="M106.995,1.016c-2.57-0.739-5.251,0.751-5.987,3.329l-5.532,19.351L89.943,4.345 c-0.592-2.071-2.441-3.417-4.477-3.492c-0.103-0.009-0.203-0.004-0.306-0.007c-0.102,0.003-0.203-0.003-0.306,0.007 c-2.036,0.075-3.885,1.421-4.477,3.492l-5.509,19.27l-5.509-19.27c-0.737-2.578-3.418-4.068-5.987-3.329 c-2.57,0.739-4.056,3.428-3.319,6.005l10.075,35.24c0.583,2.038,2.384,3.376,4.382,3.49c0.121,0.011,0.239,0.006,0.359,0.008 c0.12-0.002,0.238,0.004,0.359-0.008c1.998-0.114,3.799-1.451,4.382-3.49l5.551-19.416l5.551,19.416 c0.588,2.056,2.416,3.398,4.434,3.491c0.111,0.01,0.219,0.005,0.33,0.007c0.11-0.003,0.219,0.003,0.33-0.007 c2.019-0.093,3.846-1.435,4.434-3.491l10.075-35.24C111.05,4.444,109.564,1.756,106.995,1.016z"/> -<path fill="#D42A1F" d="M116.502,40.44c0,2.972,2.35,5.322,5.322,5.322c2.972,0,5.322-2.35,5.322-5.322V6.147 +<path fill="#d4291f" d="M116.502,40.44c0,2.972,2.35,5.322,5.322,5.322c2.972,0,5.322-2.35,5.322-5.322V6.147 c0-2.972-2.35-5.322-5.322-5.322c-2.972,0-5.322,2.35-5.322,5.322V40.44z"/> -<path fill="#D42A1F" d="M43.334,40.457c0,2.972,2.35,5.322,5.322,5.322c2.972,0,5.322-2.35,5.322-5.322V6.164 +<path fill="#d4291f" d="M43.334,40.457c0,2.972,2.35,5.322,5.322,5.322c2.972,0,5.322-2.35,5.322-5.322V6.164 c0-2.972-2.35-5.322-5.322-5.322c-2.972,0-5.322,2.35-5.322,5.322V40.457z"/> -<path fill="#D42A1F" d="M155.406,23.156l13.779-13.779c1.974-1.974,1.974-5.097,0-7.071c-1.974-1.974-5.097-1.974-7.071,0 +<path fill="#d4291f" d="M155.406,23.156l13.779-13.779c1.974-1.974,1.974-5.097,0-7.071c-1.974-1.974-5.097-1.974-7.071,0 l-16.448,16.448V6.147c0-2.972-2.35-5.322-5.322-5.322c-2.972,0-5.322,2.35-5.322,5.322V40.44c0,2.972,2.35,5.322,5.322,5.322 c2.972,0,5.322-2.35,5.322-5.322v-7.544l2.669-2.669l13.618,13.857c1.957,1.992,5.079,2.019,7.071,0.062 c1.992-1.957,2.019-5.079,0.062-7.071L155.406,23.156z"/> -<path fill="#D42A1F" d="M37.292,16.816c0-8.58-6.787-15.557-15.283-15.9l0.007-0.033H5.322C2.35,0.883,0,3.233,0,6.205v34.177 +<path fill="#d4291f" d="M37.292,16.816c0-8.58-6.787-15.557-15.283-15.9l0.007-0.033H5.322C2.35,0.883,0,3.233,0,6.205v34.177 c0,2.972,2.35,5.322,5.322,5.322c2.972,0,5.322-2.35,5.322-5.322v-7.63h11.371l-0.007-0.036 C30.505,32.372,37.292,25.396,37.292,16.816z M20.296,23.284l0-0.002h-9.651V10.491h9.464c3.535,0,6.401,2.866,6.401,6.401 C26.51,20.364,23.744,23.184,20.296,23.284z"/> diff --git a/plugins/Morpheus/images/signout.png b/plugins/Morpheus/images/signout.png new file mode 100644 index 0000000000000000000000000000000000000000..2d377ddf984d5b85c735cccb8c4a022da40df07e Binary files /dev/null and b/plugins/Morpheus/images/signout.png differ diff --git a/plugins/Morpheus/javascripts/piwikHelper.js b/plugins/Morpheus/javascripts/piwikHelper.js index 163ea901607cfec7307d8b2a933415c9481c7925..f833b9e15fd28f410af47a467737feb3274b0d60 100644 --- a/plugins/Morpheus/javascripts/piwikHelper.js +++ b/plugins/Morpheus/javascripts/piwikHelper.js @@ -125,12 +125,28 @@ var piwikHelper = { compileAngularComponents: function (selector) { var $element = $(selector); + if (!$element.length) { + return; + } + angular.element(document).injector().invoke(function($compile) { var scope = angular.element($element).scope(); $compile($element)(scope); }); }, + /** + * Detection works currently only for directives defining an isolated scope. Functionality might need to be + * extended if needed. Under circumstances you might call this method before calling compileAngularComponents() + * to avoid compiling the same element twice. + * @param selector + */ + isAlreadyCompiledAngularComponent: function (selector) { + var $element = $(selector); + + return ($element.length && $element.hasClass('ng-isolate-scope')); + }, + /** * Displays a Modal dialog. Text will be taken from the DOM node domSelector. * Given callback handles will be mapped to the buttons having a role attriute diff --git a/plugins/Morpheus/stylesheets/base/colors.less b/plugins/Morpheus/stylesheets/base/colors.less index 21ac03438df44f2f265188b80f7bea3e5474aee7..89ec7ff92dbbaa430c9be4c766e9220d6016202f 100644 --- a/plugins/Morpheus/stylesheets/base/colors.less +++ b/plugins/Morpheus/stylesheets/base/colors.less @@ -42,4 +42,3 @@ Qualitative data color series inspired from colorbrewer2.org/ next ones could be: #cab2d6 #ffff99 # #b2df8a */ - diff --git a/plugins/Morpheus/stylesheets/base/icons.css b/plugins/Morpheus/stylesheets/base/icons.css index 3424d8a65501d146980c2117e812250c0ccc2380..d11c5592e3ab19e9e61b7382aa4236f1db5e6824 100644 --- a/plugins/Morpheus/stylesheets/base/icons.css +++ b/plugins/Morpheus/stylesheets/base/icons.css @@ -26,27 +26,15 @@ .icon-alien:before { content: "\e600"; } -.icon-add:before { - content: "\e630"; -} .icon-annotation:before { content: "\e601"; } -.icon-arrow-bottom:before { - content: "\e63b"; -} -.icon-arrow-collapsed:before { - content: "\e60b"; -} .icon-arrow-left:before { content: "\e602"; } .icon-arrow-right:before { content: "\e603"; } -.icon-arrow-top:before { - content: "\e63a"; -} .icon-business:before { content: "\e604"; } @@ -56,24 +44,30 @@ .icon-chart-bar:before { content: "\e606"; } -.icon-chart-line:before { - content: "\e608"; -} .icon-chart-line-details:before { content: "\e607"; } +.icon-chart-line:before { + content: "\e608"; +} .icon-chart-pie:before { content: "\e609"; } .icon-close:before { content: "\e60a"; } -.icon-code:before { - content: "\e620"; +.icon-arrow-collapsed:before { + content: "\e60b"; } .icon-configure:before { content: "\e60c"; } +.icon-datepicker-arr-l:before { + content: "\e60d"; +} +.icon-datepicker-arr-r:before { + content: "\e60e"; +} .icon-delete:before { content: "\e60f"; } @@ -92,9 +86,6 @@ .icon-ecommerce-order:before { content: "\e614"; } -.icon-edit:before { - content: "\e622"; -} .icon-email:before { content: "\e615"; } @@ -110,26 +101,32 @@ .icon-finance:before { content: "\e619"; } -.icon-folder:before { - content: "\e61b"; -} .icon-folder-charts:before { content: "\e61a"; } +.icon-folder:before { + content: "\e61b"; +} .icon-fullscreen:before { content: "\e61c"; } .icon-goal:before { content: "\e61d"; } +.icon-help-alt:before { + content: "\e61e"; +} .icon-help:before { content: "\e61f"; } -.icon-help-alt:before { - content: "\e61e"; +.icon-code:before { + content: "\e620"; } -.icon-hide:before { - content: "\e638"; +.icon-warning:before { + content: "\e621"; +} +.icon-edit:before { + content: "\e622"; } .icon-image:before { content: "\e623"; @@ -140,13 +137,13 @@ .icon-insights:before { content: "\e625"; } -.icon-locked:before { - content: "\e627"; -} .icon-locked-2:before { content: "\e626"; } .icon-locked-3:before { + content: "\e627"; +} +.icon-locked:before { content: "\e628"; } .icon-locked-4:before { @@ -170,12 +167,12 @@ .icon-open-source:before { content: "\e62f"; } -.icon-play:before { - content: "\e643"; -} .icon-plus:before { content: "\e630"; } +.icon-add:before { + content: "\e630"; +} .icon-puzzle:before { content: "\e631"; } @@ -191,48 +188,115 @@ .icon-segment:before { content: "\e635"; } -.icon-server:before { - content: "\e637"; +.icon-users:before { + content: "\e635"; } .icon-server-alt:before { content: "\e636"; } +.icon-server:before { + content: "\e637"; +} +.icon-hide:before { + content: "\e638"; +} .icon-show:before { content: "\e639"; } +.icon-arrow-top:before { + content: "\e63a"; +} +.icon-arrow-bottom:before { + content: "\e63b"; +} .icon-star:before { content: "\e63c"; } .icon-success:before { content: "\e63d"; } -.icon-table:before { - content: "\e63f"; -} .icon-table-more:before { content: "\e63e"; } +.icon-table:before { + content: "\e63f"; +} .icon-tag-cloud:before { content: "\e640"; } -.icon-user:before { - content: "\e642"; -} .icon-user-add:before { content: "\e641"; } -.icon-users:before { - content: "\e635"; +.icon-user:before { + content: "\e642"; +} +.icon-play:before { + content: "\e643"; } .icon-visitor-profile:before { content: "\e644"; } -.icon-warning:before { - content: "\e621"; -} .icon-zoom-in:before { content: "\e645"; } .icon-zoom-out:before { content: "\e646"; } +.icon-sign-out:before { + content: "\e647"; +} +.icon-sign-in:before { + content: "\e648"; +} +.icon-menu-hamburger:before { + content: "\e649"; +} +.icon-more-horiz:before { + content: "\e64a"; +} +.icon-more-verti:before { + content: "\e64b"; +} +.icon-admin-administration:before { + content: "\e64c"; +} +.icon-admin-development:before { + content: "\e64d"; +} +.icon-admin-diagnostic:before { + content: "\e64e"; +} +.icon-admin-platform:before { + content: "\e64f"; +} +.icon-admin-settings:before { + content: "\e650"; +} +.icon-reporting-actions:before { + content: "\e651"; +} +.icon-reporting-dashboard:before { + content: "\e652"; +} +.icon-reporting-ecommerce:before { + content: "\e653"; +} +.icon-reporting-goal:before { + content: "\e654"; +} +.icon-reporting-referer:before { + content: "\e655"; +} +.icon-reporting-visitors:before { + content: "\e656"; +} +.icon-user-manage:before { + content: "\e657"; +} +.icon-user-personal:before { + content: "\e658"; +} +.icon-user-platform:before { + content: "\e659"; +} + diff --git a/plugins/Morpheus/stylesheets/base/mixins.less b/plugins/Morpheus/stylesheets/base/mixins.less index 88ac7d0c4ddeb42bb8d9edc6a2a829608e87f7d7..f772e6f2aa0c832108918498c2e4c080dfc05c39 100644 --- a/plugins/Morpheus/stylesheets/base/mixins.less +++ b/plugins/Morpheus/stylesheets/base/mixins.less @@ -3,7 +3,7 @@ &:after { content: ""; display: table; - clear: both; + clear: right; } &:before { content: ""; diff --git a/plugins/Morpheus/stylesheets/general/_admin.less b/plugins/Morpheus/stylesheets/general/_admin.less index 1f81d7797f5437fedd5503f3614612ec3e0cd9a0..c0f34c5e2d2b9a87161c0c112e2e07e4c86cc0ea 100644 --- a/plugins/Morpheus/stylesheets/general/_admin.less +++ b/plugins/Morpheus/stylesheets/general/_admin.less @@ -1,39 +1,3 @@ -.Menu--admin { - .Menu-tabList { - .border-radius(0px); - border-color: @theme-color-background-lowContrast; - background-image: none; - padding-left: 0; - border-top: 0; - > li:first-child span { - border-bottom: 3px solid @theme-color-brand; - } - > li { - padding-bottom: 0px; - > span { - color: @theme-color-text; - .font-default(18px, 26px); - border-top: 1px solid @theme-color-background-lowContrast; - border-bottom: 1px solid @theme-color-background-lowContrast; - padding: 12px 15px; - } - ul { - background-color: @theme-color-menu-contrast-background; - - li { - a { - color: @theme-color-text-lighter !important; - padding: 0.8em 1.1em; - &:hover { - color: @theme-color-text; - text-decoration: none; - } - } - } - } - } - } -} .ui-state-highlight { border-color: @color-silver-l80 !important; @@ -52,26 +16,12 @@ cursor: pointer; min-height: 30px; } - - .sites_autocomplete { - position: static !important; - } } .sites_autocomplete { vertical-align: middle; } -#loadingError { - color: @theme-color-brand; - font-weight: normal; -} - -.sites_autocomplete .custom_select .custom_select_block .custom_select_container .custom_select_ul_list { - margin-top: 5px; - padding-bottom: 0; -} - .adminTable a { color: @theme-color-link; } diff --git a/plugins/Morpheus/stylesheets/general/_forms.less b/plugins/Morpheus/stylesheets/general/_forms.less index 49c5358f1d02d687089f155f4e170a585b555377..dcbe261807d02cc97f53a48ef642b580af602199 100644 --- a/plugins/Morpheus/stylesheets/general/_forms.less +++ b/plugins/Morpheus/stylesheets/general/_forms.less @@ -139,6 +139,7 @@ select { } .top_bar_sites_selector { + z-index: 143; .sites_autocomplete .custom_select { z-index: 139; } @@ -148,30 +149,6 @@ select { input { min-height: 0; } - .custom_select { - border-color: @theme-color-background-lowContrast; - .border-radius(0px); - background: @theme-color-background-base; - padding: 0; - color: @theme-color-text; - text-transform: uppercase; - .font-default(10px, 12px); - min-height: 30px; - .box-sizing(border-box); - a { - color: @theme-color-text; - &:hover { - text-decoration: none; - } - } - .custom_select_block { - .custom_select_container { - .custom_select_ul_list { - margin-top: 20px; - } - } - } - } } .ajaxError { @@ -184,19 +161,6 @@ select { font-weight: normal; } -.sites_autocomplete--dropdown { - .custom_select_main_link:not(.loading):before { - color: @theme-color-brand; - font-size: 0.7em; - top: 4px; - right: 10px; - content: ''; - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 5px solid @theme-color-brand; - } -} - .limitSelection { > ul { position: relative; diff --git a/plugins/Morpheus/stylesheets/ieonly.css b/plugins/Morpheus/stylesheets/ieonly.css index 234631ce716159555cd1297156bdd61d2fcbed93..45523c856afddb7c47b2b68b82fc4b58889cde75 100644 --- a/plugins/Morpheus/stylesheets/ieonly.css +++ b/plugins/Morpheus/stylesheets/ieonly.css @@ -11,14 +11,10 @@ overflow: hidden; } -#topBars { +#topLeftBar { z-index: 300!important; } -.sites_autocomplete, .sites_autocomplete .custom_select { - z-index: 200!important; -} - .submit { height: 30px; } diff --git a/plugins/Morpheus/stylesheets/main.less b/plugins/Morpheus/stylesheets/main.less index 699fb1d159c25a48638a6ce17df8f15b136642dc..d1ffac5d52d5f7c9adabd6cbd53c42b2e5ef9056 100644 --- a/plugins/Morpheus/stylesheets/main.less +++ b/plugins/Morpheus/stylesheets/main.less @@ -72,110 +72,6 @@ table.entityTable tr td a:hover { #root { margin: 0 0 100px 0; padding: 0; - - #header { - margin: 0 15px; - #topBars { - a { - color: @theme-color-link; - text-decoration: none; - } - } - - .topBarElem { - padding: 0 3px; - color: @theme-color-text-lighter; - strong { - font-weight: normal; - color: @theme-color-text; - } - } - } - - .top_bar_sites_selector { - margin-right: 10px; - label { - padding-top: 9px; - .font-default(13px, 15px); - } - } - - .Menu--dashboard { - border-top: 1px solid @theme-color-background-lowContrast; - border-bottom: 0px; - > .Menu-tabList { - margin: 0; - a { - .font-default(18px, 22px); - padding: 14px 28px 11px; - } - > li { - .border-radius(0px); - border: 0; - background: none; - border-right: 1px solid @theme-color-background-lowContrast; - margin-bottom: -1px; - border-bottom: 0px; - - > ul { - li { - a { - color: @theme-color-menu-contrast-text; - .font-default(15px, 18px); - padding: 14px 22px 11px; - } - - &:hover, - &.sfHover { - a { - color: @theme-color-menu-contrast-textActive; - font-weight: normal; - } - - } - } - } - - &.sfActive { - > a { - color: @theme-color-text; - text-decoration: none; - position: relative; - &:after { - content: ''; - position: absolute; - bottom: -3px; - left: 0; - width: 100%; - height: 4px; - background: @theme-color-brand; - } - } - - } - - &.sfHover { - > a { - border: 0; - text-decoration: none; - color: @theme-color-text; - } - } - } - } - } - - .nav_sep { - background: @theme-color-menu-contrast-background; - min-height: 57px; - .border-radius(0px); - border-color: @theme-color-background-lowContrast !important; - border-top: 0px !important; - border-right: 0px !important; - border-left: 0px !important; - box-shadow: inset 0 2px 4px #d8d8d8; - } - .widgetize { width: auto; } @@ -186,9 +82,7 @@ table.entityTable tr td a:hover { border: 1px solid @theme-color-background-lowContrast; background: @theme-color-background-base; z-index: 10; - padding: 8px 10px 8px 10px; .border-radius(0px); - .font-default(10px, 12px); > span { position: relative; background: none; @@ -197,15 +91,16 @@ table.entityTable tr td a:hover { content: ''; border-left: 4px solid transparent; border-right: 4px solid transparent; - border-top: 5px solid @theme-color-brand; + border-top: 5px solid @color-silver-l20; position: absolute; top: 3px; - right: 0; + right: 7px; } } ul.submenu { margin-left: 0; + padding-right: 0; li { list-style-type: none; > div { @@ -236,24 +131,15 @@ table.entityTable tr td a:hover { .segmentEditorPanel { border: 1px solid @theme-color-background-lowContrast; background: @theme-color-background-base; - padding: 8px 10px 8px 10px; .border-radius(0px); - .segmentationTitle { - background: url(plugins/Morpheus/images/segment-users.png) no-repeat right 0; - text-transform: uppercase; - .font-default(10px, 12px); - position: relative; - } .dropdown-body { background:@theme-color-background-base; - padding:0 10px; + padding: 8px 19px 0; .border-radius(0px); - border: 1px solid @color-silver-l80; border-top-width: 0px; } &:hover .dropdown-body { background:@theme-color-background-base; - border-color: @color-silver-l80; } .segmentationContainer { > span > strong { @@ -299,32 +185,37 @@ table.entityTable tr td a:hover { /* Iframed Embed dashboard style */ #standalone { - #Dashboard:hover ul { - background: #f1f0eb; - border-color: #a9a399; - } - #Dashboard { - ul { + position: relative; - background: @theme-color-background-base; - border: 1px solid @color-silver-l80; - padding: 8px 10px 8px 10px; + &:hover ul { + background-color: @theme-color-background-base; + } + ul { + padding: 0 19px; color: @theme-color-text-light; - height: 30px; + min-height: 33px; line-height:0.5em; .border-radius(0px); + border: 0; + background-color: @theme-color-background-base; + } + > ul > li { + white-space: nowrap; + margin-right: 0px; + a { + padding-left: 0; + } + &.sfActive { + a { + color: @theme-color-menu-contrast-textActive; + } + } } > ul > li:hover, - > ul > li:hover a, - > ul > li.sfHover, - > ul > li.sfHover a { + > ul > li:hover a { color: @theme-color-brand; } - > ul > li.sfHover, - > ul > li.sfHover a { - font-weight: normal; - } } } @@ -865,7 +756,7 @@ div.sparkline { #piwik-promo-share { border: 0px; - background: #f2f2f2; + background: @theme-color-background-tinyContrast; .font-default(10px, 16px); } @@ -877,15 +768,11 @@ tr:hover #token_auth { background: #FFFFF7; } -// previous style overrides -#header_message a { +#header_message .dropdown a, +#header_message #updateCheckLinkContainer:hover { text-decoration: underline; } -#header_message a:hover { - text-decoration: none; -} - #multisites table.dataTable { tfoot tr:hover td { background: @theme-color-background-base; diff --git a/plugins/Morpheus/stylesheets/theme.less b/plugins/Morpheus/stylesheets/theme.less index 371b50183078a9cbe3446acfdb93b45e95793b9e..97eb216d2fa05fcf3f37ea64854ff8237ed106bf 100644 --- a/plugins/Morpheus/stylesheets/theme.less +++ b/plugins/Morpheus/stylesheets/theme.less @@ -12,8 +12,8 @@ @theme-color-link: @color-blue-piwik; @theme-color-base-series: #ee3024; -@theme-color-menu-contrast-text: @theme-color-text-lighter; -@theme-color-menu-contrast-textActive: @theme-color-text; +@theme-color-menu-contrast-text: @theme-color-text; +@theme-color-menu-contrast-textActive: @theme-color-brand; @theme-color-menu-contrast-background: @theme-color-background-tinyContrast; @theme-color-widget-title-text: @theme-color-text; diff --git a/plugins/Morpheus/stylesheets/ui/_components.less b/plugins/Morpheus/stylesheets/ui/_components.less index e9e9b8bc46bb623c29d185b58236030c4f94908e..630fda6fa6ab0c81cec0b93d8a1ec3bc50bb33dd 100644 --- a/plugins/Morpheus/stylesheets/ui/_components.less +++ b/plugins/Morpheus/stylesheets/ui/_components.less @@ -45,20 +45,15 @@ .segment-element { background: @color-white; border-color: @color-silver-l80; + line-height: 1.33; .segment-add-row { .border-radius(5px); } - .segment-nav { - h4.visits { - background: url('plugins/Morpheus/images/segment-users.png') no-repeat 3px 0px; - } - } - .custom_select_search { input { - margin-top: -10px; + margin-top: 1px; } } @@ -96,13 +91,13 @@ li { padding: 3px 0; &:hover { - background: #f2f2f2; + background: @theme-color-background-tinyContrast; border: 0; padding: 4px 0 3px; a { border: 0; - background-color: #f2f2f2; + background-color: @theme-color-background-tinyContrast; padding-right: 15px; } @@ -129,11 +124,13 @@ } a.dropdown { + display: inline; color: @theme-color-text; background: url('plugins/Morpheus/images/sort_subtable_desc.png') 100% -2px no-repeat; &.ui-autocomplete-input { background-position: 100% -2px; } + .font-default(10px, 12px); } } .segment-footer { @@ -155,25 +152,12 @@ } #periodString { - border: 1px solid @theme-color-background-lowContrast; - .border-radius(0px); - background: @theme-color-background-base; - &:hover { - background: @theme-color-background-base; - border-color: @color-silver-l80; - } - select { min-height: 0; background-position: 140%; padding-left: 5px; } - .calendar-icon { - width: 17px; - height: 17px; - } - label.selected-period-label { text-decoration: none !important; } @@ -191,34 +175,17 @@ } } } - - #date { - .border-radius(0px); - padding: 8px 10px; - color: @theme-color-text-lighter; - text-transform: uppercase; - .font-default(10px, 12px); - - strong { - color: @theme-color-text; - - } - } } #header_message { - border: 1px solid @theme-color-background-lowContrast; - padding: 8px 10px 8px 10px; height: auto; - background: @theme-color-background-base; .border-radius(0px); - .header_short { - .font-default(10px, 12px); - text-transform: uppercase; - } - .header_full { - .font-default(12px, 18px); + &.isPiwikDemo { + text-align: right; + position: absolute; + right: 0; + top: 8px; } } @@ -235,7 +202,7 @@ .loadingPiwikBelow, .loadingPiwik { - .font-default(10px, 12px); + .font-default(13px, 13px); color: @color-silver-l60; font-weight: normal; } @@ -256,7 +223,7 @@ .border-radius(6px); h2 { - background: #f2f2f2; + background: @theme-color-background-tinyContrast; border-bottom: 1px solid @color-gray; padding: 11px 15px 10px; } diff --git a/plugins/Morpheus/stylesheets/uibase/_header.less b/plugins/Morpheus/stylesheets/uibase/_header.less index b96b1b467ab94bf2d6667389a39f28b41b0e6cb7..25ba8be9ffd9dc00bc6debc8973ae2774ea5654d 100644 --- a/plugins/Morpheus/stylesheets/uibase/_header.less +++ b/plugins/Morpheus/stylesheets/uibase/_header.less @@ -1,24 +1,14 @@ -#header { - min-height: 60px; -} - -/* Clear fix */ -#header:after { - display: table; - clear: both; - content: ""; -} #root { #logo { - padding: 5px 0 0; + padding: 9px 0 0 4px; float: left; } #logo { img.default-piwik-logo { width: 82px; - margin-top: 14px; + margin-top: 8px; } img { @@ -53,23 +43,3 @@ padding: 15px; clear: both; } - -#topBars { - right: 0px; - position: absolute; - padding-left: 110px; - color: #acacac; - margin: 4px 10px 8px; - font-size: 13px; - z-index: 140; -} - -#topRightBar { - margin-bottom: 4px; - float: right; -} - -.topBarElem { - padding: 0 5px; - display: inline-block; -} diff --git a/plugins/Morpheus/stylesheets/uibase/_headerMessage.less b/plugins/Morpheus/stylesheets/uibase/_headerMessage.less index 41cdc726b99a93fecbec2dbabce44e3b342d058f..1922c721a8f81934879b9af060e22309416a64f7 100644 --- a/plugins/Morpheus/stylesheets/uibase/_headerMessage.less +++ b/plugins/Morpheus/stylesheets/uibase/_headerMessage.less @@ -2,15 +2,21 @@ #header_message { z-index: 0; cursor: default; - position: absolute; - right: 0px; + float: right; overflow: hidden; display: block; height: 20px; - line-height: 20px; - padding: 5px 8px 5px 38px; font-size: 14px; border-radius: 4px; + + &.update_available .title { + color: #CA8100; + font-weight: bold; + } + + .icon-warning { + padding-left: 2px; + } } #header_message:hover, @@ -44,24 +50,6 @@ line-height: 1.7em; } -/* Orange alerts box */ -.header_alert { - background: #FFFDF7 url(plugins/Morpheus/images/ico_alert.png) no-repeat 7px 4px; - border: 1px solid #FF7F00; - font-weight: bold; -} - -.header_alert, -.header_alert a { - color: #FF7F00; -} - -/* Blue info box */ -.header_info { - background: #FAFAFA url(plugins/Morpheus/images/ico_info.png) no-repeat 7px 4px; - border: 1px solid #CBD9EB; -} - .header_info, .header_info a { color: @theme-color-text-light; } diff --git a/plugins/Morpheus/stylesheets/uibase/_languageSelect.less b/plugins/Morpheus/stylesheets/uibase/_languageSelect.less index 032516350e2d98a26cd3d148db132f7a2c95324c..d0a0add9ce537a339036aafb1b7f50b986aa0b2e 100644 --- a/plugins/Morpheus/stylesheets/uibase/_languageSelect.less +++ b/plugins/Morpheus/stylesheets/uibase/_languageSelect.less @@ -4,4 +4,17 @@ .items { margin-left: -50px; } +} + +#topRightBar .navbar-right .languageSelection { + // make padding of language selection clickable + margin: -14px -12px; + + .title { + padding: 14px 12px; + &:after { + top: 19px; + right: -3px; + } + } } \ No newline at end of file diff --git a/plugins/Morpheus/stylesheets/uibase/_loading.less b/plugins/Morpheus/stylesheets/uibase/_loading.less index e68d0f0a696b24b9a3249bf415f4e4566dde9466..e57e3d0a6d6c98e8b0059656ffba48fb9741c23d 100644 --- a/plugins/Morpheus/stylesheets/uibase/_loading.less +++ b/plugins/Morpheus/stylesheets/uibase/_loading.less @@ -9,17 +9,16 @@ } .loadingSegment { - color: grey; - font-size: 10pt; + color: @color-silver-l60; + font-size: 13px; margin-left: 28px; display:none; } #loadingError { - font-weight: bold; - font-size: 1.1em; - color: #F88D22; - padding: 0.5em; + font-size: 15px; + padding: 8px 0; display: none; - padding-top: 40px; + color: @theme-color-brand; + font-weight: normal; } \ No newline at end of file diff --git a/plugins/Morpheus/stylesheets/uibase/_periodSelect.less b/plugins/Morpheus/stylesheets/uibase/_periodSelect.less index 767a2a70a1011e916ac9321880ed77e3de65a385..83c21f79993ea8ca2806e687fe3530cc07de1c2e 100644 --- a/plugins/Morpheus/stylesheets/uibase/_periodSelect.less +++ b/plugins/Morpheus/stylesheets/uibase/_periodSelect.less @@ -3,8 +3,6 @@ color: @theme-color-text-light; font-size: 14px; border: 1px solid #e4e5e4; - padding: 5px 30px 6px 10px; - border-radius: 4px; float: left; margin-right: 10px; position: absolute; @@ -22,23 +20,12 @@ height: 15px; display:inline-block; position:absolute; - right:9px; - top:7px; + right: 19px; + top: 9px; background: url("plugins/Morpheus/images/icon-calendar.gif") no-repeat scroll; cursor:pointer; } -#periodString #date{ - cursor:pointer; - padding:5px 10px 6px 10px; - margin:-5px -10px -6px -10px; -} - -#periodString #date img { - vertical-align: middle; - margin: 0 0 0 6px; -} - #periodString strong { color: #255792; } @@ -49,8 +36,6 @@ } #periodMore { - padding: 6px 0 0 0; - display: none; overflow: hidden; } @@ -62,7 +47,7 @@ #periodString .period-type { float: left; - padding: 0 20px 0 0; + padding: 0; } #periodString .period-type label { diff --git a/plugins/Morpheus/templates/admin.twig b/plugins/Morpheus/templates/admin.twig index c51e3d378cdcb51c43e778b559625cbc891d8712..7ebadaad094ea147776ab006df9bc2390d03ced9 100644 --- a/plugins/Morpheus/templates/admin.twig +++ b/plugins/Morpheus/templates/admin.twig @@ -22,27 +22,37 @@ {{ ajax.requestErrorDiv(emailSuperUser|default('')) }} {{ postEvent("Template.beforeContent", "admin", currentModule) }} - <div id="container"> + <div class="page"> {% if showMenu is not defined or showMenu %} - {% include "@CoreAdminHome/_menu.twig" %} + {% import '@CoreHome/_menu.twig' as menu %} + {{ menu.menu(adminMenu, false, 'Menu--admin') }} {% endif %} - <div id="content" class="admin"> + <div class="pageWrap"> - {% include "@CoreHome/_headerMessage.twig" %} - {% include "@CoreHome/_notifications.twig" %} + <div class="top_controls"> + {% block topcontrols %} + {% endblock %} - <div class="ui-confirm" id="alert"> - <h2></h2> - <input role="no" type="button" value="{{ 'General_Ok'|translate }}"/> + {% include "@CoreHome/_headerMessage.twig" %} </div> - {% include "@CoreHome/_warningInvalidHost.twig" %} + <div class="admin" id="content"> + {% include "@CoreHome/_notifications.twig" %} + {% include "@CoreHome/_warningInvalidHost.twig" %} - {% block content %} - {% endblock %} + <div class="ui-confirm" id="alert"> + <h2></h2> + <input role="no" type="button" value="{{ 'General_Ok'|translate }}"/> + </div> + {% block content %} + {% endblock %} + + </div> </div> </div> + + {% endblock %} diff --git a/plugins/Morpheus/templates/dashboard.twig b/plugins/Morpheus/templates/dashboard.twig index 08230e0e9be6e44709a09376983ef283f6722c6b..afccc7bd4c15caabff1b5fc631fd067e8f0834cc 100644 --- a/plugins/Morpheus/templates/dashboard.twig +++ b/plugins/Morpheus/templates/dashboard.twig @@ -23,10 +23,6 @@ {% include "@CoreHome/_warningInvalidHost.twig" %} {% include "@CoreHome/_topScreen.twig" %} - {% block notification %} - {% include "@CoreHome/_notifications.twig" %} - {% endblock %} - <div class="ui-confirm" id="alert"> <h2></h2> <input role="yes" type="button" value="{{ 'General_Ok'|translate }}"/> @@ -34,6 +30,31 @@ {{ postEvent("Template.beforeContent", "dashboard", currentModule) }} - {% block content %} - {% endblock %} + <div class="page"> + + {% if (menu is defined and menu) %} + {% import '@CoreHome/_menu.twig' as menuMacro %} + {{ menuMacro.menu(menu, true, 'Menu--dashboard') }} + {% endif %} + + <div class="pageWrap"> + + <a name="main"></a> + + <div class="top_controls"> + {% block topcontrols %} + {% endblock %} + </div> + + {% block notification %} + {% include "@CoreHome/_notifications.twig" %} + {% endblock %} + + {% block content %} + {% endblock %} + + <div class="clear"></div> + </div> + + </div> {% endblock %} diff --git a/plugins/Morpheus/templates/demo.twig b/plugins/Morpheus/templates/demo.twig index 0995add8c3d765db840333d9008e08c05958571c..51cdc9e86f09b099c70af1426ff066184b4d7c01 100644 --- a/plugins/Morpheus/templates/demo.twig +++ b/plugins/Morpheus/templates/demo.twig @@ -497,6 +497,9 @@ 'show', 'hide', 'search', + 'menu-hamburger', + 'more-horiz', + 'more-verti' ], 'Window-Widget': [ 'minimise', @@ -570,6 +573,8 @@ 'server-alt', 'tag-cloud', 'play', + 'sign-in', + 'sign-out' ], }; diff --git a/plugins/Morpheus/templates/user.twig b/plugins/Morpheus/templates/user.twig index 416f12e11678d5b58dc4b7f3d3e830f3598c1921..d69823db39af331f34378321e0ea1f267fee2417 100644 --- a/plugins/Morpheus/templates/user.twig +++ b/plugins/Morpheus/templates/user.twig @@ -6,7 +6,7 @@ {% block body %} {% if userIsAnonymous %} - {% set topMenuModule = 'Feedback' %} + {% set topMenuModule = 'ScheduledReports' %} {% set topMenuAction = 'index' %} {% else %} {% if currentModule != 'Feedback' %} @@ -24,24 +24,33 @@ {{ ajax.requestErrorDiv(emailSuperUser|default('')) }} {{ postEvent("Template.beforeContent", "user", currentModule) }} - <div id="container"> + <div class="page"> {% if showMenu is not defined or showMenu %} - {% include "@CoreHome/_userMenu.twig" %} + {% import '@CoreHome/_menu.twig' as menu %} + {{ menu.menu(userMenu, false, 'Menu--admin') }} {% endif %} - <div id="content" class="admin user"> + <div class="pageWrap"> - {% include "@CoreHome/_notifications.twig" %} - - <div class="ui-confirm" id="alert"> - <h2></h2> - <input role="no" type="button" value="{{ 'General_Ok'|translate }}"/> + <div class="top_controls"> + {% block topcontrols %} + {% endblock %} </div> - {% block content %} - {% endblock %} + <div id="content" class="admin user"> + + {% include "@CoreHome/_notifications.twig" %} + + <div class="ui-confirm" id="alert"> + <h2></h2> + <input role="no" type="button" value="{{ 'General_Ok'|translate }}"/> + </div> + {% block content %} + {% endblock %} + + </div> </div> </div> {% endblock %} diff --git a/plugins/MultiSites/angularjs/dashboard/dashboard.directive.less b/plugins/MultiSites/angularjs/dashboard/dashboard.directive.less index 99683c088f0f940cb753653e93151fc040f2e7ae..a200b3d626a9c28abf12d4d13ee6386c10dcb531 100644 --- a/plugins/MultiSites/angularjs/dashboard/dashboard.directive.less +++ b/plugins/MultiSites/angularjs/dashboard/dashboard.directive.less @@ -3,6 +3,12 @@ font-size: 15px; } +.widget { + #multisites { + padding: 15px; + } +} + #multisites { border: 0; padding: 0 15px; @@ -10,6 +16,7 @@ h2 { border-bottom: 0px; + font-size: 24px; } .notification-error { @@ -79,10 +86,6 @@ } } - .top_controls { - height: 10px; - } - th:first-child { text-align:left; } diff --git a/plugins/MultiSites/templates/getSitesInfo.twig b/plugins/MultiSites/templates/getSitesInfo.twig index d1bdb81df054e4ac8b433be40c7405d5c0a1c4fd..cca348dfec1bfc57ddae1940784d3b33289d82a8 100644 --- a/plugins/MultiSites/templates/getSitesInfo.twig +++ b/plugins/MultiSites/templates/getSitesInfo.twig @@ -1,14 +1,17 @@ {% extends isWidgetized ? 'empty.twig' : 'dashboard.twig' %} +{% block topcontrols %} + {% if not isWidgetized %} + <div class="top_controls"> + {% include "@CoreHome/_periodSelect.twig" %} + {% include "@CoreHome/_headerMessage.twig" %} + </div> + {% endif %} +{% endblock %} + {% block content %} -{% if not isWidgetized %} - <div class="top_controls"> - {% include "@CoreHome/_periodSelect.twig" %} - {% include "@CoreHome/_headerMessage.twig" %} - </div> -{% endif %} +<div class="container" id="multisites"> -<div class="pageWrap container" id="multisites"> <div id="main"> <div piwik-multisites-dashboard display-revenue-column="{% if displayRevenueColumn %}true{% else %}false{%endif%}" diff --git a/plugins/Overlay/stylesheets/overlay.css b/plugins/Overlay/stylesheets/overlay.css index d3db1a5126361043561c009c030627f5a0f04acd..4e30660775036addd2274c0ebe53360a7eb96364 100644 --- a/plugins/Overlay/stylesheets/overlay.css +++ b/plugins/Overlay/stylesheets/overlay.css @@ -23,7 +23,7 @@ a#overlayTitle { font-size: 12px; text-decoration: none; color: #4d4d4d; - margin-left: 15px; + margin-left: 10px; } a#overlayTitle .icon-help { margin-left: 4px; @@ -146,10 +146,16 @@ body .ui-tooltip.overlayTooltip { font-weight: bold; } -#topBars { +.navbar .navbar-right { + display: none; +} + +.top_controls { display: none; } .overlay-sidebar-container { width: 220px; + margin-left: -16px; + margin-top: 10px; } diff --git a/plugins/ScheduledReports/templates/index.twig b/plugins/ScheduledReports/templates/index.twig index 65ba2ba53aca73f26526562acf2968c78f79297a..542fab8e70b06072d30dc4bfaf04bf7089617cc3 100644 --- a/plugins/ScheduledReports/templates/index.twig +++ b/plugins/ScheduledReports/templates/index.twig @@ -1,19 +1,17 @@ {% extends 'user.twig' %} - {% set title %}{{ 'ScheduledReports_PersonalEmailReports'|translate }}{% endset %} +{% block topcontrols %} + {% include "@CoreHome/_siteSelectHeader.twig" %} + {% include "@CoreHome/_periodSelect.twig" %} +{% endblock %} + {% block content %} <div class="emailReports"> <h2 piwik-enriched-headline help-url="http://piwik.org/docs/email-reports/">{{ title }}</h2> - {% include "@CoreHome/_siteSelectHeader.twig" %} - - <div class="top_controls"> - {% include "@CoreHome/_periodSelect.twig" %} - </div> - <span id="reportSentSuccess"></span> <span id="reportUpdatedSuccess"></span> diff --git a/plugins/SegmentEditor/SegmentSelectorControl.php b/plugins/SegmentEditor/SegmentSelectorControl.php index 4e88d2191f12803d74d538374c1e1fd84a88473b..e37354e1cd8a0ac81f82d9012c98cc91357ebaa7 100644 --- a/plugins/SegmentEditor/SegmentSelectorControl.php +++ b/plugins/SegmentEditor/SegmentSelectorControl.php @@ -31,7 +31,7 @@ class SegmentSelectorControl extends UIControl $this->jsClass = "SegmentSelectorControl"; $this->cssIdentifier = "segmentEditorPanel"; - $this->cssClass = "piwikTopControl"; + $this->cssClass = "piwikTopControl borderedControl piwikSelector"; $this->idSite = $idSite ?: Common::getRequestVar('idSite', false, 'int'); diff --git a/plugins/SegmentEditor/javascripts/Segmentation.js b/plugins/SegmentEditor/javascripts/Segmentation.js index f8def3655c5d1009a6e30c2a15d2679e4bd1e874..ee1c4b532adcc7d6a95eeec48dbaf160e8843bf5 100644 --- a/plugins/SegmentEditor/javascripts/Segmentation.js +++ b/plugins/SegmentEditor/javascripts/Segmentation.js @@ -210,7 +210,7 @@ Segmentation = (function($) { if(!$.browser.mozilla) { checkSelected = encodeURIComponent(checkSelected); } - + if( checkSelected == self.currentSegmentStr){ injClass = 'class="segmentSelected"'; } @@ -258,7 +258,7 @@ Segmentation = (function($) { var closeAllOpenLists = function() { $(".segmentationContainer", self.target).each(function() { - if($(this).closest('.segmentEditorPanel').hasClass("visible")) + if($(this).closest('.segmentEditorPanel').hasClass("expanded")) $(this).trigger("click"); }); }; @@ -370,7 +370,7 @@ Segmentation = (function($) { var bindEvents = function () { self.target.on('click', '.segmentationContainer', function (e) { // hide all other modals connected with this widget - if (self.content.closest('.segmentEditorPanel').hasClass("visible")) { + if (self.content.closest('.segmentEditorPanel').hasClass("expanded")) { if ($(e.target).hasClass("jspDrag") === true || $(e.target).hasClass("segmentFilterContainer") === true || $(e.target).parents().hasClass("segmentFilterContainer") === true @@ -378,12 +378,12 @@ Segmentation = (function($) { e.stopPropagation(); } else { self.jscroll.destroy(); - self.target.closest('.segmentEditorPanel').removeClass('visible'); + self.target.closest('.segmentEditorPanel').removeClass('expanded'); } } else { // for each visible segmentationContainer -> trigger click event to close and kill scrollpane - very important ! closeAllOpenLists(); - self.target.closest('.segmentEditorPanel').addClass('visible'); + self.target.closest('.segmentEditorPanel').addClass('expanded'); self.target.find('.segmentFilter').val(self.translations['General_Search']).trigger('keyup'); self.jscroll = self.target.find(".segmentList").jScrollPane({ autoReinitialise: true, @@ -1250,7 +1250,7 @@ $(document).ready(function() { } if ($(e.target).closest('.segmentListContainer').length === 0 - && self.$element.hasClass("visible") + && self.$element.hasClass("expanded") ) { $(".segmentationContainer", self.$element).trigger("click"); } @@ -1258,8 +1258,6 @@ $(document).ready(function() { $('body').on('mouseup', this.onMouseUp); - // re-initialize top controls since the size of the control is not the same after it's - // initialized. initTopControls(); }; diff --git a/plugins/SegmentEditor/stylesheets/segmentation.less b/plugins/SegmentEditor/stylesheets/segmentation.less index 0109d1183670fc7ceb69ba01d741b4fc42cf03cc..125a0c9f5639a22819afcd412ddd28de719adf2f 100644 --- a/plugins/SegmentEditor/stylesheets/segmentation.less +++ b/plugins/SegmentEditor/stylesheets/segmentation.less @@ -131,11 +131,6 @@ div.scrollable { padding: 0 0 8px 0; } -.segment-element .segment-nav h4.visits { - padding-left: 28px; - background: url(plugins/SegmentEditor/images/icon-users.png) 0 0 no-repeat; -} - .segment-element .segment-nav h4 a { color: #255792; text-decoration: none; @@ -403,7 +398,7 @@ div.scrollable { .segment-element .segment-footer { background: #eae8e3; - border-top: 1px solid #a9a399; + border-top: 1px solid @theme-color-background-tinyContrast; text-align: right; padding: 7px 10px; margin: 0 -4px -6px -4px; @@ -430,11 +425,14 @@ div.scrollable { z-index: 121; /* Should be bigger than 'Dashboard widget selector' (z-index: 120) */ background: #f7f7f7; border: 1px solid #e4e5e4; - padding: 5px 10px 6px 10px; margin-right: 10px; border-radius: 4px; color: @theme-color-text-light; font-size: 14px; + + .segmentListContainer { + line-height: 14px; + } } .top_controls .segmentEditorPanel { @@ -486,7 +484,6 @@ div.scrollable { .segmentationContainer ul.submenu { padding-top: 5px; display: none; - float: left; margin-bottom: 5px; } @@ -501,54 +498,53 @@ div.scrollable { height: 16px; } -.segmentEditorPanel.visible .segmentationContainer { - width: 200px; +.segmentEditorPanel.expanded .segmentationContainer { + width: 240px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } -.segmentEditorPanel.visible ul.submenu { - display: block; +.segmentEditorPanel.expanded ul.submenu { + display: inline-block; list-style: none; } .segmentFilterContainer { - margin-left: -10px; - margin-right: -10px; margin-bottom: 10px; + display: inline-block; } -.segmentEditorPanel.visible .segmentFilterContainer > input[type="text"] { - font-size: 13px; - width: 100%; +.segmentEditorPanel.expanded .segmentFilterContainer > input[type="text"] { + font-size: 11px; + width: 200px; padding: 0; - border: 1px solid #ccc; - border-width: 1px 0; + border: 1px solid #d0d0d0; + border-width: 1px; color: #999; - padding: 11px 32px 11px 12px; + padding: 7px 10px 7px 10px; } -.segmentEditorPanel.visible .segmentFilterContainer > span { +.segmentEditorPanel.expanded .segmentFilterContainer > span { position: absolute; width: 13px; height: 13px; - right: 12px; - top: 16px; + right: 23px; + top: 48px; cursor: pointer; } -.segmentEditorPanel.visible .segmentFilterContainer:hover > span { +.segmentEditorPanel.expanded .segmentFilterContainer:hover > span { background: url(plugins/SegmentEditor/images/reset_search.png); } -.segmentEditorPanel.visible .filterNoResults { +.segmentEditorPanel.expanded .filterNoResults { font-style: italic; } -.segmentEditorPanel.visible .add_new_segment { +.segmentEditorPanel.expanded .add_new_segment { clear: both; float: right; - margin: 12px 0 10px; + margin: 12px 9px 10px 0; } .segmentationContainer > ul.submenu > li { @@ -557,14 +553,6 @@ div.scrollable { cursor: pointer; } -span.segmentationTitle { - background: url(plugins/Morpheus/images/sort_subtable_desc.png) no-repeat right 0; - padding-right: 20px; - min-width: 180px; - display: block; - cursor: pointer; -} - .segmentList { max-height: 300px; margin-top: 5px; @@ -668,28 +656,26 @@ a.metric_category { z-index: 1000 !important; } +.ui-autocomplete.ui-menu.ui-widget { + box-shadow: 0 1px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.2), 0 1px 5px 0 rgba(0,0,0,0.12); +} + @media all and (max-width: 749px) { span.segmentationTitle, - .segmentEditorPanel.visible .segmentationContainer { + .segmentEditorPanel.expanded .segmentationContainer { width: auto; } } .dropdown-body { - position: absolute; - top: 100%; - left: -1px; background-color: #f7f7f7; - padding: 0px 10px; - border: 1px solid #e4e5e4; border-top-width: 0px; display: none; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; } -.segmentEditorPanel.visible .dropdown-body { - display: block; +.segmentEditorPanel.expanded .dropdown-body { border-top-left-radius: 0; border-top-right-radius: 0; } @@ -699,7 +685,7 @@ a.metric_category { background: #f1f0eb } -.segmentEditorPanel.visible { +.segmentEditorPanel.expanded { border-bottom-left-radius: 0; border-bottom-right-radius: 0; } @@ -711,7 +697,8 @@ a.metric_category { .available_segments { display: inline-block; - width: 160px; + width: 150px; + padding-left: 5px; } .segmentationTitle, @@ -722,7 +709,6 @@ a.metric_category { white-space: nowrap; } -.segmentationTitle, .segment-element .segment-nav a.dropdown { max-width: 180px; } @@ -731,8 +717,18 @@ a.metric_category { max-width: 145px; } -.segmentEditorPanel.visible .segmentationTitle { - max-width: 200px; +.segmentEditorPanel .segmentationTitle { + text-overflow: ellipsis; + display: inline-block; + max-width: 170px; +} + +.segmentEditorPanel a.title { + padding-bottom: 8px; +} + +.segmentEditorPanel.expanded .segmentationTitle { + max-width: 180px; overflow: visible; /* restore default */ white-space: normal; /* restore default */ } diff --git a/plugins/SegmentEditor/templates/_segmentSelector.twig b/plugins/SegmentEditor/templates/_segmentSelector.twig index d9d9f3fb9d8bb73126b46fae1836f9dbd5db6ddf..7a8019d37e8bf8d978ec949c978057cec5642517 100644 --- a/plugins/SegmentEditor/templates/_segmentSelector.twig +++ b/plugins/SegmentEditor/templates/_segmentSelector.twig @@ -1,7 +1,7 @@ <div class="SegmentEditor" style="display:none;"> - <div class="segmentationContainer listHtml"> - <span class="segmentationTitle"></span> - <div class="dropdown-body"> + <div class="segmentationContainer listHtml" title="{{ 'SegmentEditor_ChooseASegment'|translate|e('html_attr') }}"> + <a class="title"><span class="icon icon-segment"></span><span class="segmentationTitle"></span></a> + <div class="dropdown dropdown-body"> <div class="segmentFilterContainer"> <input class="segmentFilter" type="text" value="{{ 'General_Search'|translate }}"/> <span/> @@ -86,9 +86,10 @@ <a href="#">+ {{ 'SegmentEditor_AddANDorORCondition'|translate(andCondition)|raw }}</a> </div> </div> - <div class="segment-element"> + <div class="segment-element borderedControl expanded"> <div class="segment-nav"> - <h4 class="visits"><span class="available_segments"><strong> + <h4 class="visits"> + <span class="icon-segment"></span><span class="available_segments"><strong> <select class="available_segments_select"></select> </strong></span></h4> <div class="scrollable"> diff --git a/plugins/SitesManager/stylesheets/SitesManager.less b/plugins/SitesManager/stylesheets/SitesManager.less index 41d1035bb1147906e3604f255950b2ee2850620c..cd3a43f7c818d766fc599ea7d97dd7672829eeeb 100644 --- a/plugins/SitesManager/stylesheets/SitesManager.less +++ b/plugins/SitesManager/stylesheets/SitesManager.less @@ -104,9 +104,8 @@ td.editable-site-field:hover { } .site-without-data { - padding: 15px; h2 { - border-bottom: 1px solid #ccc; + border-bottom: 1px solid @theme-color-background-tinyContrast; margin: 25px 0; padding: 0 0 5px 0; font-size: 24px; diff --git a/plugins/SitesManager/templates/siteWithoutData.twig b/plugins/SitesManager/templates/siteWithoutData.twig index 20b63266449075d844749b398e5e5c3db1066d5c..eafb7a287f2bf345bc5b74b22ad1b809396976f4 100644 --- a/plugins/SitesManager/templates/siteWithoutData.twig +++ b/plugins/SitesManager/templates/siteWithoutData.twig @@ -2,9 +2,11 @@ {% block notification %}{% endblock %} -{% block content %} - +{% block topcontrols %} {% include "@CoreHome/_siteSelectHeader.twig" %} +{% endblock %} + +{% block content %} <div class="site-without-data"> diff --git a/plugins/UserCountryMap/javascripts/realtime-map.js b/plugins/UserCountryMap/javascripts/realtime-map.js index 6096ce3786ddb13b1b3a556092dfeba3208ae820..f73259c5e7623323e8a66a9293472e05461451e5 100644 --- a/plugins/UserCountryMap/javascripts/realtime-map.js +++ b/plugins/UserCountryMap/javascripts/realtime-map.js @@ -57,11 +57,14 @@ }, _initStandaloneMap: function () { - $('.top_controls').hide(); - $('.Menu--dashboard').on('piwikSwitchPage', function (event, item) { - var clickedMenuIsNotMap = ($(item).attr('href').indexOf('module=UserCountryMap&action=realtimeWorldMap') == -1); + $('#periodString').hide(); + initTopControls(); + $('#secondNavBar').on('piwikSwitchPage', function (event, item) { + var href = $(item).attr('href'); + var clickedMenuIsNotMap = (href.indexOf('module=UserCountryMap&action=realtimeWorldMap') == -1); if (clickedMenuIsNotMap) { - $('.top_controls').show(); + $('#periodString').show(); + initTopControls(); } }); $('.realTimeMap_overlay').css('top', '0px'); diff --git a/plugins/UserCountryMap/stylesheets/realtime-map.less b/plugins/UserCountryMap/stylesheets/realtime-map.less index c6c98ffda5bcf22a2b5027c870367de92e3ce148..b6dbd8a65bf0333b150a3bbb3ff55366c0cf8b9b 100644 --- a/plugins/UserCountryMap/stylesheets/realtime-map.less +++ b/plugins/UserCountryMap/stylesheets/realtime-map.less @@ -13,6 +13,10 @@ filter: alpha(opacity=3); } +.RealTimeMap:focus { + outline: none; +} + .RealTimeMap-black { position: absolute; right: 0; diff --git a/plugins/UsersManager/templates/index.twig b/plugins/UsersManager/templates/index.twig index 8c48ad2f33f8ae14555cfa0bd10fac8efb48b4ee..e2fb24dc9aca5c9f2cee433cce2ace6bb2f24ca2 100644 --- a/plugins/UsersManager/templates/index.twig +++ b/plugins/UsersManager/templates/index.twig @@ -10,8 +10,6 @@ <section class="sites_selector_container"> <p>{{ 'UsersManager_MainDescription'|translate }}</p> - <div class="sites_selector_title">{{ 'SitesManager_Sites'|translate }}:</div> - {% set applyAllSitesText %} <strong>{{ 'UsersManager_ApplyToAllWebsites'|translate }}</strong> {% endset %} diff --git a/plugins/UsersManager/templates/userSettings.twig b/plugins/UsersManager/templates/userSettings.twig index b202407a07358e4241d6c6c525d411f99c56acce..57e04dff8593326a71724dca908fe18247eea570 100644 --- a/plugins/UsersManager/templates/userSettings.twig +++ b/plugins/UsersManager/templates/userSettings.twig @@ -64,7 +64,7 @@ show-all-sites-item="false" showselectedsite="true" id="defaultReportSiteSelector" - style="position: relative"></div> + ></div> </div> <div class="form-group"> diff --git a/plugins/Widgetize/Menu.php b/plugins/Widgetize/Menu.php index f796faf57e1bc1b8d264b573849b64b346ef2225..850df3e2daca63e4778fd1b277501269a7a6df13 100644 --- a/plugins/Widgetize/Menu.php +++ b/plugins/Widgetize/Menu.php @@ -18,7 +18,6 @@ class Menu extends \Piwik\Plugin\Menu $tooltip = Piwik::translate('Widgetize_TopLinkTooltip'); $urlParams = $this->urlForAction('index', array('segment' => false)); - $menu->addPlatformItem(null, $urlParams, 50, $tooltip); $menu->addPlatformItem('General_Widgets', $urlParams, 5, $tooltip); } diff --git a/plugins/Widgetize/templates/index.twig b/plugins/Widgetize/templates/index.twig index 49a2b5f6c1a9375a57d981cd1f74213550a0c828..800c5cafd7f658693e78aeb62539a0cda6128a8a 100644 --- a/plugins/Widgetize/templates/index.twig +++ b/plugins/Widgetize/templates/index.twig @@ -2,6 +2,11 @@ {% set title %}{{ 'General_Widgets'|translate }}{% endset %} +{% block topcontrols %} + {% include "@CoreHome/_siteSelectHeader.twig" %} + {% include "@CoreHome/_periodSelect.twig" %} +{% endblock %} + {% block content %} <div> @@ -30,8 +35,6 @@ <h2 piwik-enriched-headline>{{ title }}</h2> -{% include "@CoreHome/_siteSelectHeader.twig" %} - <div class="widgetize"> <p>With Piwik, you can export your Web Analytics reports on your blog, website, or intranet dashboard... in one click. @@ -59,10 +62,6 @@ <h2>Widgetize reports</h2> <p>Select a report, and copy paste in your page the embed code below the widget: - <div class="top_controls"> - {% include "@CoreHome/_periodSelect.twig" %} - </div> - <div id="widgetPreview"></div> <div id='iframeDivToExport' style='display:none;'></div> diff --git a/plugins/ZenMode/ZenMode.php b/plugins/ZenMode/ZenMode.php deleted file mode 100644 index bbacb157c386381a66d33af8ad4ec49849da93b1..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/ZenMode.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * Piwik - free/libre analytics platform - * - * @link http://piwik.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - * - */ -namespace Piwik\Plugins\ZenMode; - -/** - */ -class ZenMode extends \Piwik\Plugin -{ - /** - * @see Piwik\Plugin::registerEvents - */ - public function registerEvents() - { - return array( - 'AssetManager.getJavaScriptFiles' => 'getJsFiles', - 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', - 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys' - ); - } - - public function getClientSideTranslationKeys(&$translations) - { - $translations[] = 'SitesManager_Sites'; - $translations[] = 'General_Reports'; - $translations[] = 'MultiSites_LoadingWebsites'; - $translations[] = 'ZenMode_SearchForAnything'; - $translations[] = 'ZenMode_QuickAccessTitle'; - $translations[] = 'ZenMode_HowToSearch'; - $translations[] = 'ZenMode_HowToToggleZenMode'; - $translations[] = 'ZenMode_Activated'; - } - - public function getJsFiles(&$jsFiles) - { - $jsFiles[] = "plugins/ZenMode/javascripts/zen-mode.js"; - $jsFiles[] = "plugins/ZenMode/angularjs/quick-access/quick-access.directive.js"; - $jsFiles[] = "plugins/ZenMode/angularjs/zen-mode/zen-mode-switcher.directive.js"; - } - - public function getStylesheetFiles(&$stylesheets) - { - $stylesheets[] = "plugins/ZenMode/angularjs/quick-access/quick-access.directive.less"; - $stylesheets[] = "plugins/ZenMode/angularjs/zen-mode/zen-mode.less"; - } -} diff --git a/plugins/ZenMode/angularjs/quick-access/quick-access.directive.html b/plugins/ZenMode/angularjs/quick-access/quick-access.directive.html deleted file mode 100644 index efc284d9dac4b369fa5fc2336251a0897cd21d89..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/angularjs/quick-access/quick-access.directive.html +++ /dev/null @@ -1,41 +0,0 @@ -<div class="quick-access" title="{{ 'ZenMode_QuickAccessTitle' | translate }}"> - <input ng-keydown="onKeypress($event)" - ng-change="search(search.term)" - ng-model="search.term" - type="text" - placeholder="{{ 'ZenMode_SearchForAnything' | translate }}"/> - <ul ng-show="search.term"> - <li class="quick-access-category" - ng-click="search('menuCategory')">Menu</li> - <li class="no-result" - ng-hide="menuItems | length">---</li> - <li class="result" - ng-class="{selected: $index == search.index}" - ng-click="selectMenuItem(entry.index)" - ng-mouseenter="search.index=$index" - ng-repeat="entry in menuItems"><a>{{ entry.name | trim }}</a></li> - - <li class="quick-access-category" - ng-click="search('reportCategory')">{{ 'General_Reports' | translate }}</li> - <li class="no-result" - ng-hide="reportEntries | length">---</li> - <li class="result" - ng-class="{selected: ((menuItems | length) + $index) == search.index}" - ng-mouseenter="search.index=((menuItems | length) + $index)" - ng-click="selectMenuItem(report.index)" - ng-repeat="report in reportEntries"><a>{{ report.name | trim }}</a></li> - - <li class="quick-access-category" - ng-click="search('%')">{{ 'SitesManager_Sites' | translate }}</li> - <li class="no-result" - ng-hide="(sitesModel.sites | length) || sitesModel.isLoading">---</li> - <li class="no-result" - ng-show="sitesModel.isLoading">{{ 'MultiSites_LoadingWebsites' | translate }}</li> - <li class="result" - ng-show="!sitesModel.isLoading" - ng-mouseenter="search.index=((menuItems | length) + $index + (reportEntries | length))" - ng-class="{selected: ((menuItems | length) + $index + (reportEntries | length)) == search.index}" - ng-click="selectSite(site.idsite)" - ng-repeat="site in sitesModel.sites"><a>{{ site.name | trim }}</a></li> - </ul> -</div> \ No newline at end of file diff --git a/plugins/ZenMode/angularjs/quick-access/quick-access.directive.js b/plugins/ZenMode/angularjs/quick-access/quick-access.directive.js deleted file mode 100644 index c05fb5fbbce5448b770941037d83c225a50a54f6..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/angularjs/quick-access/quick-access.directive.js +++ /dev/null @@ -1,140 +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-dialog="showDialog">...</div> - * Will show dialog once showDialog evaluates to true. - * - * Will execute the "executeMyFunction" function in the current scope once the yes button is pressed. - */ -(function () { - angular.module('piwikApp').directive('piwikQuickAccess', QuickAccessDirective); - - QuickAccessDirective.$inject = ['$rootElement', '$timeout', '$filter', 'siteSelectorModel', 'piwik']; - - function QuickAccessDirective ($rootElement, $timeout, $filter, siteSelectorModel, piwik) { - - return { - restrict: 'A', - replace: true, - scope: {}, - templateUrl: 'plugins/ZenMode/angularjs/quick-access/quick-access.directive.html?cb=' + piwik.cacheBuster, - link: function (scope, element, attrs) { - - var menuIndex = -1; - var menuItems = []; - var reportEntries = []; - - scope.reportEntries = []; - scope.menuItems = []; - scope.sitesModel = siteSelectorModel; - - function getMenuItems() - { - if (menuItems && menuItems.length) { - return menuItems; - } - - $rootElement.find('#topRightBar .topBarElem a').each(function (index, element) { - menuItems.push({name: $(element).text(), index: ++menuIndex, category: 'menuCategory'}); - $(element).attr('quick_access', menuIndex); - }); - - return menuItems; - } - - function getReportEntries() - { - if (reportEntries && reportEntries.length) { - return reportEntries; - } - - $rootElement.find('.Menu-tabList a').each(function (index, element) { - reportEntries.push({name: $(element).text(), category: 'reportCategory', index: ++menuIndex}); - $(element).attr('quick_access', menuIndex); - }); - - return reportEntries; - } - - function highlightPreviousItem() - { - if (0 >= (scope.search.index - 1)) { - scope.search.index = 0; - } else { - scope.search.index--; - } - } - - function highlightNextItem() - { - var numTotal = element.find('li.result').length; - - if (numTotal <= (scope.search.index + 1)) { - scope.search.index = numTotal - 1; - } else { - scope.search.index++; - } - } - - function executeMenuItem() - { - var results = element.find('li.result'); - if (results && results.length && results[scope.search.index]) { - var selectedMenuElement = $(results[scope.search.index]); - $timeout(function () { - selectedMenuElement.click(); - }, 20); - } - } - - scope.onKeypress = function (event) { - - if (38 == event.which) { - highlightPreviousItem(); - event.preventDefault(); - } else if (40 == event.which) { - highlightNextItem(); - event.preventDefault(); - } else if (13 == event.which) { - executeMenuItem(); - } - }; - - scope.search = function (searchTerm) { - this.search.index = 0; - - this.menuItems = $filter('filter')(getMenuItems(), searchTerm); - this.reportEntries = $filter('filter')(getReportEntries(), searchTerm); - this.sitesModel.searchSite(searchTerm); - }; - - scope.selectSite = function (idsite) { - this.sitesModel.loadSite(idsite); - }; - - scope.selectMenuItem = function (index) { - var target = $rootElement.find('[quick_access=' + index + ']'); - - if (target && target.length && target[0]) { - var actualTarget = target[0]; - - var href = $(actualTarget).attr('href'); - - if (href && href.length > 10) { - actualTarget.click(); - } else { - $(actualTarget).click(); - } - } - }; - - } - }; - } -})(); \ No newline at end of file diff --git a/plugins/ZenMode/angularjs/quick-access/quick-access.directive.less b/plugins/ZenMode/angularjs/quick-access/quick-access.directive.less deleted file mode 100644 index 52d29dafa99ca1f31610e2a52f09583da296ba94..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/angularjs/quick-access/quick-access.directive.less +++ /dev/null @@ -1,20 +0,0 @@ -.quick-access { - .selected { - background-color: #f2f2f2 !important; - } - .quick-access-category { - text-align: left !important; - font-size: 14px; - padding: 5px; - cursor: pointer; - } - .result { - cursor: pointer; - } - .quick-access-category:hover { - background: none !important; - } - .no-result { - padding-left: 27px; - } -} \ No newline at end of file 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 36ac43a39a596df73366e6082377bd28d3a7e5e8..0000000000000000000000000000000000000000 --- 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 diff --git a/plugins/ZenMode/angularjs/zen-mode/zen-mode.less b/plugins/ZenMode/angularjs/zen-mode/zen-mode.less deleted file mode 100644 index d637f202418ba8cffa60bd0d61633edc256ba3f1..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/angularjs/zen-mode/zen-mode.less +++ /dev/null @@ -1,93 +0,0 @@ -.deactivateZenMode { - float:right; - margin-right: 13px; - margin-top: 4px; - display: none; - img { - width: 16px; - height: 16px; - } -} - -.activateZenMode { - img { - margin-top: -3px; - margin-bottom: -3px; - width: 16px; - height: 16px; - } -} - -.Menu--dashboard #Searchmenu { - display: none; -} - -.zenMode { - - #header { - display: none; - } - - .Menu--dashboard { - border-bottom: 1px solid @theme-color-background-lowContrast !important; - - #Searchmenu { - display: block; - } - } - - .quick-access { - display: inline-block; - color: #999; - padding: 8px 20px 7px 20px; - input { - border:0px; - border-bottom: 1px solid #CCC; - font-size: 11px !important; - } - } - - .deactivateZenMode { - display: block; - } - - .activateZenMode { - display: none; - } - - .nav_sep { - display: none; - } - - /* MENU LEVEL2 HOVER */ - .Menu--dashboard > .Menu-tabList > li li { - float: none; - text-align: left; - } - - .Menu--dashboard > .Menu-tabList > li li:hover { - background-color: #f2f2f2; - } - - .Menu--dashboard > .Menu-tabList > li ul { - display: none; - } - - .Menu--dashboard > .Menu-tabList > li.sfHover ul, - .Menu--dashboard > .Menu-tabList > li:hover ul { - display: none; - z-index: 150; - background-color: @theme-color-background-base; - width: auto; - border: 1px solid #D9D9D9; - padding-top: 0px; - border-top: 4px solid #D3291F; - } - - #root .sites_selector_in_dashboard { - margin-top:0px; - margin-right: 0px; - display: none; - } - -} diff --git a/plugins/ZenMode/javascripts/zen-mode.js b/plugins/ZenMode/javascripts/zen-mode.js deleted file mode 100644 index bc2a7939429cd15284e33778322937a7f73bc22c..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/javascripts/zen-mode.js +++ /dev/null @@ -1,138 +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 - */ - -$(document).ready(function () { - - if (!isDashboard()) { - return; - } - - var addedElement = $('#topRightBar').append( - ' | <span class="topBarElem activateZenMode" piwik-zen-mode-switcher>' - + '<img src="plugins/CoreHome/images/navigation_expand.png">' - + ' </span>' - ); - - piwikHelper.compileAngularComponents(addedElement); - - addedElement = $('.Menu--dashboard').prepend( - '<span piwik-zen-mode-switcher class="deactivateZenMode">' - + '<img src="plugins/CoreHome/images/navigation_collapse.png" >' - + '</span>'); - - piwikHelper.compileAngularComponents(addedElement); - - angular.element(document).injector().invoke(handleZenMode); - - function handleZenMode ($rootElement, $cookies) { - - var zenMode = !!parseInt($cookies.zenMode, 10); - - $rootElement.on('zen-mode-toggle', toggleZenMode); - - function toggleZenMode() - { - zenMode = !zenMode; - - updateZenMode(); - } - - function updateZenMode() - { - $cookies.zenMode = zenMode ? '1' : '0'; - - if (zenMode) { - $rootElement.addClass('zenMode'); - initMenu(); - } else { - $rootElement.removeClass('zenMode'); - uninitMenu(); - } - - resetSubmenu(); - } - - if (zenMode) { - updateZenMode(); - } - - Mousetrap.bind('alt+z', function() { - toggleZenMode(); - }); - - Mousetrap.bind('alt+f', function(event) { - if (event.preventDefault) { - event.preventDefault(); - } else { - event.returnValue = false; // IE - } - - $('.quick-access input').focus(); - }); - } - - function isDashboard() - { - return !!$('.Menu--dashboard').length; - } - - function initMenu () { - var menuNode = $('.Menu--dashboard'); - menuNode.on('piwikSwitchPage', resetSubmenu); - menuNode.on('mouseenter', 'li:has(ul)', overMainLI); - menuNode.on('mouseleave', 'li:has(ul)', outMainLI); - - $('#Searchmenu').on('keydown focus', '.quick-access input', showQuickAccessMenu); - $('#Searchmenu').on('blur', '.quick-access input', hideQuickAccessMenu); - } - - function uninitMenu () { - var menuNode = $('.Menu--dashboard'); - menuNode.off('piwikSwitchPage', resetSubmenu); - menuNode.off('mouseenter', 'li:has(ul)', overMainLI); - menuNode.off('mouseleave', 'li:has(ul)', outMainLI); - - $('#Searchmenu').off('keydown focus', '.quick-access input', showQuickAccessMenu); - $('#Searchmenu').off('blur', '.quick-access input', hideQuickAccessMenu); - menu.prototype.adaptSubMenuHeight(); - } - - function overMainLI () { - var $this = $(this); - var position = $this.position(); - var width = $this.width(); - var height = $this.height(); - - $this.find('ul').css({ - left: position.left + 'px', - display: 'block', - minWidth: width + 'px', - position: 'absolute', - top: (position.top + height) + 'px', - maxHeight: 'none' - }); - } - - function outMainLI () { - $(this).find('ul').css({left: '', display: '', minWidth: '', position: '', top: '', maxHeight: ''}); - } - - function resetSubmenu() - { - $('.Menu--dashboard').find('li:has(ul)').mouseleave(); - } - - function showQuickAccessMenu() { - resetSubmenu(); - $('#Searchmenu').mouseenter(); - } - - function hideQuickAccessMenu() { - $('#Searchmenu').mouseleave(); - } -}); - diff --git a/plugins/ZenMode/lang/cs.json b/plugins/ZenMode/lang/cs.json deleted file mode 100644 index 9ff86d36151f9a5b2edb42294c3e668baf38f0c8..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/cs.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ZenMode": { - "PluginDescription": "NebuÄte ruÅ¡eni. Zen režim vÄ›ci zjednoduÅ¡Ã. Je dostupný pÅ™es ikonu v pravém hornÃm rohu obrazovky.", - "SearchForAnything": "Hledat cokoliv", - "QuickAccessTitle": "Hledat hlášenÃ, webové stránky nebo položky menu", - "HowToSearch": "Pokud chcete najÃt hlášenà nebo položky menu, použijte vyhledávacà pole v pravé hornà Äásti, nebo stisknÄ›te 'alt+f'.", - "HowToToggleZenMode": "Pokud chcete pÅ™epnout zen režim, použijte Å¡ipku v pravé hornà oblasti, nebo stisknÄ›te 'alt+z'.", - "Activated": "Zen režim aktivován" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/da.json b/plugins/ZenMode/lang/da.json deleted file mode 100644 index 8275461eaf0e73e22e111d363929fedc383fe961..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/da.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ZenMode": { - "SearchForAnything": "Søg efter alt", - "QuickAccessTitle": "Søg efter menupunkter, rapporter og hjemmesider", - "HowToSearch": "For at søge efter menupunkter, rapporter eller hjemmesider bruge søgefeltet øverst til højre, eller tryk pÃ¥ 'alt+f'.", - "HowToToggleZenMode": "Forlad eller kom i Zen-tilstand ved at klikke pÃ¥ pilen øverst til højre, eller tryk pÃ¥ 'alt+z'.", - "Activated": "Zen-tilstand aktiveret" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/de.json b/plugins/ZenMode/lang/de.json deleted file mode 100644 index 24ffa53ade495303b38e090680c14aa5f233f0d2..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/de.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ZenMode": { - "PluginDescription": "Bleiben Sie \"Zen\" mit Piwik. Der \"Zen-Modus\" hält die Dinge einfach. Er ist verfügbar über das Icon am rechten, oberen Ende des Bildschirms.", - "SearchForAnything": "Nach etwas suchen", - "QuickAccessTitle": "Nach Menüeinträgen, Berichten oder Websites suchen", - "HowToSearch": "Um nach Menüeinträgen, Berichten oder Websites zu suchen, das Suchfeld oben benutzen oder Alt+f drücken.", - "HowToToggleZenMode": "Auf den oberen rechten Pfeil klicken um den Zen Modus zu verlassen oder Alt+t drücken.", - "Activated": "Zen Modus aktiviert" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/el.json b/plugins/ZenMode/lang/el.json deleted file mode 100644 index 5a29f9805a33e6958a0195632bcc7b2f5f8ca6d4..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/el.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ZenMode": { - "PluginDescription": "Μείνετε στο Zen με το Piwik. Η κατάσταση Zen τηÏεί τα Ï€Ïάματα σε απλή κατάσταση. Είναι διαθÎσιμη ως εικονίδιο πάνω δεξιά στην οθόνη.", - "SearchForAnything": "Αναζήτηση για όλα", - "QuickAccessTitle": "Αναζήτηση για καταχωÏήσεις μενοÏ, αναφοÏÎÏ‚ και ιστοτόπους", - "HowToSearch": "Για να αναζητήσετε σε καταχωÏήσεις μενοÏ, αναφοÏÎÏ‚ ή ιστοτόπους χÏησιμοποιείστε το πλαίσιο αναζήτηση πάνω δεξιά ή πατήστε 'Alt+F'.", - "HowToToggleZenMode": "Για να βγείτε ή μεταβείτε σε κατάσταση Zen, πατήστε στο βÎλος πάνω δεξιά ή πατήστε 'Alt+Z'.", - "Activated": "Η κατάσταση Zen ενεÏγοποιήθηκε" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/en.json b/plugins/ZenMode/lang/en.json deleted file mode 100755 index 4a3aa78ee8a5960d40660dcd2d9529f18bd2e5af..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/en.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ZenMode": { - "PluginDescription": "Stay Zen with Piwik. Zen mode keeps things simple. It is available via the icon in the top right of the screen.", - "SearchForAnything": "Search for anything", - "QuickAccessTitle": "Search for menu entries, reports and websites", - "HowToSearch": "To search for menu items, reports or websites use the search box on the top right or press 'alt+f'.", - "HowToToggleZenMode": "To leave or enter the zen mode click the arrow on the top right or press 'alt+z'.", - "Activated": "Zen mode activated" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/es.json b/plugins/ZenMode/lang/es.json deleted file mode 100644 index 27fcf38a62a1408e8ac639a54c90b095e1ff5821..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/es.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ZenMode": { - "PluginDescription": "Permanecer Zen con Piwik. El modo Zen mantiene las cosas simples. Está disponible vÃa el icono en el extremo superior derecho de la pantalla.", - "SearchForAnything": "Buscar lo que quiera", - "QuickAccessTitle": "Buscar entradas de menú, reportes y sitios de internet", - "HowToSearch": "Para buscar entradas de menú, reportes o sitios de internet utilice la caja de búsqueda en la parte superior derecha o presione 'alt+f'.", - "HowToToggleZenMode": "Para salir o ingresar al modo Zen haga clic en la flecha en la parte superior derecha o presione 'alt+z'.", - "Activated": "Modo Zen activado" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/fa.json b/plugins/ZenMode/lang/fa.json deleted file mode 100644 index d221d07b5604ea6eaa497e8a89d18d176b423296..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/fa.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "ZenMode": { - "SearchForAnything": "جستجوی همه" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/fr.json b/plugins/ZenMode/lang/fr.json deleted file mode 100644 index bd8c99350c8508ce60e4817042d33c9034d10ace..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/fr.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ZenMode": { - "PluginDescription": "Restez zen avec Piwik. Le mode zen conserve les choses simples. Il est disponible via l'icône en haut à droite de l'écran.", - "SearchForAnything": "Rechercher tout", - "QuickAccessTitle": "Rechercher des éléments du menu, rapports et sites web", - "HowToSearch": "Pour rechercher des éléments du menu, rapports ou sites web utilisez la barre de recherche en haut à droite ou pressez 'alt+f'.", - "HowToToggleZenMode": "Pour quitter ou entrer en mode zen cliquez sur la flèche dans le coin supérieur droit ou pressez 'alt+z'.", - "Activated": "Mode zen activé" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/hi.json b/plugins/ZenMode/lang/hi.json deleted file mode 100644 index 44ac4ac168fc8a20b151d8d162941efb0610b4cc..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/hi.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "ZenMode": { - "PluginDescription": "Piwik साथ जेन रहें। ज़ेन मोड सरल बातें करती रहती है। यह सà¥à¤•à¥à¤°à¥€à¤¨ के ऊपर सही में आइकन के माधà¥à¤¯à¤® से उपलबà¥à¤§ है।", - "SearchForAnything": "कà¥à¤› के लिठखोज", - "QuickAccessTitle": "मेनू पà¥à¤°à¤µà¤¿à¤·à¥à¤Ÿà¤¿à¤¯à¥‹à¤‚, रिपोरà¥à¤Ÿà¥‹à¤‚ और वेबसाइटों के लिठखोज", - "Activated": "ज़ेन मोड सकà¥à¤°à¤¿à¤¯" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/it.json b/plugins/ZenMode/lang/it.json deleted file mode 100644 index cb5bcb529565f0ae269c83577fde2beb344254b5..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/it.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ZenMode": { - "PluginDescription": "Sii Zen con Piwik. La modalità Zen rende le cose facili. È disponibile tramite l'icona che si trova nell'angolo in alto a destra dello schermo.", - "SearchForAnything": "Cerca tutto", - "QuickAccessTitle": "Ricerca elementi di menù, report e siti web", - "HowToSearch": "Per ricercare elementi di menù, report o siti web utilizza la casella di ricerca in alto a destra o premi 'alt+f'.", - "HowToToggleZenMode": "Per lasciare la modalità Zen o entrarvi, clicca sulla freccia in alto a destra o premi 'alt+z'.", - "Activated": "Modalità Zen attivata" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/ja.json b/plugins/ZenMode/lang/ja.json deleted file mode 100644 index 3bc49cdb1e19a3fd3e14848b0ea9483e4504ce3e..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/ja.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ZenMode": { - "SearchForAnything": "ãªã‚“ã§ã‚‚検索", - "QuickAccessTitle": "メニューエントリーã€ãƒ¬ãƒãƒ¼ãƒˆã€ã‚¦ã‚§ãƒ–サイトを検索", - "HowToSearch": "ãƒ¡ãƒ‹ãƒ¥ãƒ¼é …ç›®ã‚„ãƒ¬ãƒãƒ¼ãƒˆã€ã‚¦ã‚§ãƒ–ã‚µã‚¤ãƒˆã‚’ãŠæŽ¢ã—ã®å ´åˆã€å³ä¸Šã®æ¤œç´¢ãƒœãƒƒã‚¯ã‚¹ã‚’ã”利用ã«ãªã‚‹ã‹ã€ã‚ーボード㮠'alt+f' を押ã—ã¦ãã ã•ã„。", - "HowToToggleZenMode": "禅モードを切り替ãˆã‚‹ã«ã¯ã€å³ä¸Šã®çŸ¢å°ã‚’クリックã™ã‚‹ã‹ã€ã‚ーボード㮠'alt+z' を押ã—ã¦ãã ã•ã„。", - "Activated": "禅モードを有効化" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/nb.json b/plugins/ZenMode/lang/nb.json deleted file mode 100644 index 0b5c865c5ebd0376f5124156bc61a82dc5b1a338..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/nb.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ZenMode": { - "SearchForAnything": "Søk etter noe", - "Activated": "Zen-modus aktivert" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/nl.json b/plugins/ZenMode/lang/nl.json deleted file mode 100644 index 930411c0edd3eb90feb151c67fd61d25427f27d9..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/nl.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ZenMode": { - "PluginDescription": "Blijf zen met Piwik. Zen mode houdt de dingen eenvoudig. Het is beschikbaar via het icoon in de rechterbovenhoek van het scherm.", - "SearchForAnything": "Zoeken op alles", - "QuickAccessTitle": "Zoeken op menu-items, rapporten en websites", - "HowToSearch": "Om te zoeken op menu-items, rapporten of websites gebruik het zoekvak rechtsboven of druk op 'alt+f'.", - "HowToToggleZenMode": "Om de zen-modus te betreden of verlaten klik op pijl rechtsboven of druk 'alt+z'.", - "Activated": "Zen-modus geactiveerd" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/pl.json b/plugins/ZenMode/lang/pl.json deleted file mode 100644 index d638e2b0046f77fecd3ee2e49aeece2c027fce2c..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/pl.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "ZenMode": { - "SearchForAnything": "Szukaj czegokolwiek", - "QuickAccessTitle": "Szukaj wpisów w menu, raportów i stron.", - "HowToToggleZenMode": "Aby wyjść albo wejść do trybu Zen należy kliknąć strzaÅ‚kÄ™ w górnym prawym rogu albo wcisnąć 'alt+z'.", - "Activated": "Tryb Zen zostaÅ‚ aktywowany" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/pt-br.json b/plugins/ZenMode/lang/pt-br.json deleted file mode 100644 index 640da2c93bfca8d77ed736eb450f6fbcbc938b97..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/pt-br.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ZenMode": { - "PluginDescription": "Fique Zen com Piwik. O modo Zen mantém as coisas simples. Está disponÃvel através do Ãcone no canto superior direito da tela.", - "SearchForAnything": "Buscar por qualquer coisa", - "QuickAccessTitle": "Pesquisar por entradas do menu, relatórios e websites", - "HowToSearch": "Para procurar itens do menu, relatórios ou sites utilize a caixa de pesquisa no canto superior direito ou pressione 'alt+f'.", - "HowToToggleZenMode": "Para sair ou entrar no modo zen clique na seta no canto superior direito ou pressione 'alt+z'.", - "Activated": "Modo Zen ativado" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/ro.json b/plugins/ZenMode/lang/ro.json deleted file mode 100644 index 495fd70b9e7f85a629626c248cefcd87972d3fe0..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/ro.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ZenMode": { - "SearchForAnything": "Caută orice", - "QuickAccessTitle": "Caută elemente de meniu, rapoarte ÅŸi site-uri", - "HowToSearch": "Pentru a căuta elemente de meniu, rapoarte sau site-uri, foloseÅŸte cutia de căutare din dreapta sus sau apasă 'alt+f'.", - "HowToToggleZenMode": "Pentru a intra sau a părăsi modul zen, dă click pe săgeata din dreapta sus sau apasă 'alt+z'.", - "Activated": "Modul Zen a fost activat" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/ru.json b/plugins/ZenMode/lang/ru.json deleted file mode 100644 index 68799e808ccdd3d234e9240eca3e255f95923b5d..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/ru.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ZenMode": { - "SearchForAnything": "ПоиÑк везде", - "QuickAccessTitle": "ПоиÑк по пунктам меню, отчетам и Ñайтам", - "HowToSearch": "Ð”Ð»Ñ Ð¿Ð¾Ð¸Ñка Ñлементов меню, отчетов и веб-Ñайтов иÑпользуйте окно поиÑка в правом верхнем углу или нажмите \"alt+f\"", - "HowToToggleZenMode": "Чтобы выйти или войти в Дзен режим нажмите на Ñтрелку в правом верхнем углу или нажмите \"alt+z\".", - "Activated": "Ðктивирован Дзен режим" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/sr.json b/plugins/ZenMode/lang/sr.json deleted file mode 100644 index 4f73c1cf1ab9fd730b5701cf718290414216c566..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/sr.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ZenMode": { - "PluginDescription": "Budite u Zenu sa Pivikom. Zen mod Äini stvari jednostavnim. Možete ga omogućiti preko sliÄice u gornjem desnom uglu ekrana.", - "SearchForAnything": "Pretraži sve", - "QuickAccessTitle": "Pretraživanje stavki menija, izveÅ¡taja i sajtova", - "HowToSearch": "Ukoliko želite da pretražujete stavke menija, izveÅ¡taje ili sajtove, upotrebite polje za pretraživanje u gornjem desnom uglu ili pritisnite Alt + f.", - "HowToToggleZenMode": "Ukoliko želite da napustite ili ponovo aktivirate zen mod, kliknite na strelicu u gornjem desnom uglu ili pritisnite Alt + z.", - "Activated": "Zen mod aktiviran" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/sv.json b/plugins/ZenMode/lang/sv.json deleted file mode 100644 index d42ff6428e8d5f67117248ff8d2ada808eb169e9..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/sv.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ZenMode": { - "SearchForAnything": "Sök efter vad som helst", - "QuickAccessTitle": "Sök efter meny-poster, rapporter och webbplatser", - "HowToSearch": "För att söka efter meny-poster, rapporter eller webbplatser - använd sökfältet uppe till höger eller tryck 'alt+f'.", - "HowToToggleZenMode": "För att gÃ¥ i\/ur zen mode, klicka pÃ¥ pilen uppe till höger eller tryck 'alt+z'.", - "Activated": "Zen mode aktiverat" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/ta.json b/plugins/ZenMode/lang/ta.json deleted file mode 100644 index c9c6a76d75ae885b23e61d4b3909751400ae1393..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/ta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ZenMode": { - "SearchForAnything": "எதைபறà¯à®±à®¿à®¯à¯à®®à¯ தேடà¯", - "Activated": "ஜென௠நிலை செயறà¯à®ªà®¾à®Ÿà¯à®Ÿà®¿à®²à¯ உளà¯à®³à®¤à¯" - } -} \ No newline at end of file diff --git a/plugins/ZenMode/lang/tl.json b/plugins/ZenMode/lang/tl.json deleted file mode 100644 index 7f738608d18851765db0cc8c755715912ace91c4..0000000000000000000000000000000000000000 --- a/plugins/ZenMode/lang/tl.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ZenMode": { - "SearchForAnything": "Paghahanap sa kahit ano", - "QuickAccessTitle": "Maghanap ng mga entry ng menu mga ulat at mga website.", - "HowToSearch": "Para maghanap ng items sa menu ulat o websites gamitin ang search box sa kanang tuktok o pindutin ang 'alt+f'.", - "HowToToggleZenMode": "Upang umalis o ipasok ang Zen mode i-click ang arrow sa kanang tuktok o pindutin ang 'alt + z'.", - "Activated": "Ang Zen mode ay na activate" - } -} \ No newline at end of file diff --git a/tests/UI/specs/DashboardManager_spec.js b/tests/UI/specs/DashboardManager_spec.js index 9ada832b832eeba3913a374061efbf039cdfe3af..3dcd33f5ab780b7705fc5cfc3d06819b77e5c78b 100644 --- a/tests/UI/specs/DashboardManager_spec.js +++ b/tests/UI/specs/DashboardManager_spec.js @@ -22,7 +22,7 @@ describe("DashboardManager", function () { it("should expand when clicked", function (done) { expect.screenshot("expanded").to.be.captureSelector(selectorToCapture, function (page) { - page.click('.dashboard-manager'); + page.click('.dashboard-manager .title'); }, done); }); diff --git a/tests/UI/specs/Dashboard_spec.js b/tests/UI/specs/Dashboard_spec.js index e6918417d45b49a47871f18c58abd0f688b1ad2f..f17e9f4258853c57cbba73a777428521065b25b2 100644 --- a/tests/UI/specs/Dashboard_spec.js +++ b/tests/UI/specs/Dashboard_spec.js @@ -84,7 +84,7 @@ describe("Dashboard", function () { }); it("should refresh widget when widget refresh icon clicked", function (done) { - expect.screenshot("widget_move").to.be.capture("widget_refresh", function (page) { + expect.screenshot("widget_move_refresh").to.be.capture(function (page) { page.mouseMove('.widgetTop'); page.click('.button#refresh'); page.mouseMove('.dashboard-manager'); // let widget top hide again @@ -99,7 +99,7 @@ describe("Dashboard", function () { }); it("should unminimise widget when widget maximise icon is clicked after being minimised", function (done) { - expect.screenshot("widget_move").to.be.capture("widget_unminimised", function (page) { + expect.screenshot("widget_move_unminimised").to.be.capture(function (page) { page.mouseMove('.widgetTop'); page.click('.button#maximise'); page.mouseMove('.dashboard-manager'); // let widget top hide again @@ -114,7 +114,7 @@ describe("Dashboard", function () { }); it("should close maximise dialog when minimise icon is clicked", function (done) { - expect.screenshot("widget_move").to.be.capture("widget_unmaximise", function (page) { + expect.screenshot("widget_move_unmaximise").to.be.capture(function (page) { page.mouseMove('.widgetTop'); page.click('.button#minimise'); page.mouseMove('.dashboard-manager'); // let widget top hide again @@ -123,7 +123,7 @@ describe("Dashboard", function () { it("should add a widget when a widget is selected in the dashboard manager", function (done) { expect.screenshot("widget_add_widget").to.be.capture(function (page) { - page.click('.dashboard-manager'); + page.click('.dashboard-manager .title'); page.mouseMove('.widgetpreview-categorylist>li:contains(Live!)'); // have to mouse move twice... otherwise Live! will just be highlighted page.mouseMove('.widgetpreview-categorylist>li:contains(Visits Summary)'); @@ -135,7 +135,7 @@ describe("Dashboard", function () { }); it("should remove widget when remove widget icon is clicked", function (done) { - expect.screenshot("widget_move").to.be.capture("widget_removed", function (page) { + expect.screenshot("widget_move_removed").to.be.capture(function (page) { page.mouseMove('#widgetVisitTimegetVisitInformationPerLocalTime .widgetTop'); page.click('#widgetVisitTimegetVisitInformationPerLocalTime .button#close'); page.click('.ui-dialog button>span:contains(Yes)'); @@ -145,7 +145,7 @@ describe("Dashboard", function () { it("should change dashboard layout when new layout is selected", function (done) { expect.screenshot("change_layout").to.be.capture(function (page) { - page.click('.dashboard-manager'); + page.click('.dashboard-manager .title'); page.click('li[data-action=showChangeDashboardLayoutDialog]'); page.click('div[layout=50-50]'); page.click('.ui-dialog button>span:contains(Save)', 3000); @@ -154,7 +154,7 @@ describe("Dashboard", function () { it("should rename dashboard when dashboard rename process completed", function (done) { expect.screenshot("rename").to.be.capture(function (page) { - page.click('.dashboard-manager'); + page.click('.dashboard-manager .title'); page.click('li[data-action=renameDashboard]'); page.evaluate(function () { $('#newDashboardName:visible').val('newname'); // don't use sendKeys or click, since in this test it appears to trigger a seg fault on travis @@ -165,7 +165,7 @@ describe("Dashboard", function () { it("should copy dashboard successfully when copy dashboard process completed", function (done) { expect.screenshot("copied").to.be.capture(function (page) { - page.click('.dashboard-manager'); + page.click('.dashboard-manager .title'); page.click('li[data-action=copyDashboardToUser]'); page.evaluate(function () { $('#copyDashboardName').val(''); @@ -182,7 +182,7 @@ describe("Dashboard", function () { it("should reset dashboard when reset dashboard process completed", function (done) { expect.screenshot("reset").to.be.capture(function (page) { - page.click('.dashboard-manager'); + page.click('.dashboard-manager .title'); page.click('li[data-action=resetDashboard]'); page.click('.ui-dialog button>span:contains(Yes)', 10000); page.mouseMove('.dashboard-manager'); @@ -191,7 +191,7 @@ describe("Dashboard", function () { it("should remove dashboard when remove dashboard process completed", function (done) { expect.screenshot("removed").to.be.capture(function (page) { - page.click('.dashboard-manager'); + page.click('.dashboard-manager .title'); page.click('li[data-action=removeDashboard]'); page.click('.ui-dialog[aria-describedby=removeDashboardConfirm] button>span:contains(Yes)'); page.mouseMove('.dashboard-manager'); @@ -204,7 +204,7 @@ describe("Dashboard", function () { it("should not fail when default widget selection changed", function (done) { expect.screenshot("default_widget_selection_changed").to.be.capture(function (page) { page.load(url); - page.click('.dashboard-manager'); + page.click('.dashboard-manager .title'); page.click('li[data-action=setAsDefaultWidgets]'); page.click('.ui-dialog button>span:contains(Yes)'); }, done); @@ -212,7 +212,7 @@ describe("Dashboard", function () { it("should create new dashboard with new default widget selection when create dashboard process completed", function (done) { expect.screenshot("create_new").to.be.capture(function (page) { - page.click('.dashboard-manager'); + page.click('.dashboard-manager .title'); page.click('li[data-action=createDashboard]'); page.sendKeys('#createDashboardName', 'newdash2'); page.click('.ui-dialog[aria-describedby=createDashboardConfirm] button>span:contains(Yes)'); diff --git a/tests/UI/specs/EmptySite_spec.js b/tests/UI/specs/EmptySite_spec.js index 704bda87210ae028e15df89b75ada90b81bc9857..31b8524d6f6032702616d1f116327ffaae64b238 100644 --- a/tests/UI/specs/EmptySite_spec.js +++ b/tests/UI/specs/EmptySite_spec.js @@ -15,7 +15,7 @@ describe("EmptySite", function () { it('should show the tracking code if the website has no recorded data', function (done) { var urlToTest = "?" + generalParams + "&module=CoreHome&action=index"; - expect.screenshot('emptySiteDashboard').to.be.captureSelector('.site-without-data', function (page) { + expect.screenshot('emptySiteDashboard').to.be.captureSelector('.page', function (page) { page.load(urlToTest); }, done); }); diff --git a/tests/UI/specs/Login_spec.js b/tests/UI/specs/Login_spec.js index c58dd5fc53a765ad1901b14c2171965f7b409215..ed4ad31ba3da49821ff54e73f1f67b12e95eca2e 100644 --- a/tests/UI/specs/Login_spec.js +++ b/tests/UI/specs/Login_spec.js @@ -49,7 +49,7 @@ describe("Login", function () { it("should redirect to login when logout link clicked", function (done) { expect.screenshot("login_form").to.be.capture("logout_form", function (page) { - page.click("#topBars a:contains(Sign out)"); + page.click("#topRightBar .icon-sign-out"); }, done); }); @@ -89,7 +89,7 @@ describe("Login", function () { it("should login successfully when formless login used", function (done) { expect.page("").contains('#dashboard', 'formless_login', function (page) { - page.click("#topBars a:contains(Sign out)"); + page.click("#topRightBar .icon-sign-out"); page.load(formlessLoginUrl); }, done); }); diff --git a/tests/UI/specs/MeasurableManager_spec.js b/tests/UI/specs/MeasurableManager_spec.js index 539576a7c10b2f98e282b54c7293516749640f25..691af5c436e671f45693af0536ca05086d7978fd 100644 --- a/tests/UI/specs/MeasurableManager_spec.js +++ b/tests/UI/specs/MeasurableManager_spec.js @@ -31,7 +31,7 @@ describe("MeasurableManager", function () { }); it("should use measurable wording in menu", function (done) { - var selector = '.Menu-tabList *:contains(Administration):first'; + var selector = '#secondNavBar li:contains(Administration):first'; expect.screenshot('measurable_menu_item').to.be.captureSelector(selector, function (page) { }, done); diff --git a/tests/UI/specs/Menus_spec.js b/tests/UI/specs/Menus_spec.js index d3fe6720c0ff95643b4612a3e4c5c96cb4e4df67..3124766e799ca7036a4bc82b2a7453729157ff74 100644 --- a/tests/UI/specs/Menus_spec.js +++ b/tests/UI/specs/Menus_spec.js @@ -14,48 +14,55 @@ describe("Menus", function () { urlBase = 'module=CoreHome&action=index&' + generalParams ; + function openMenuItem(page, menuItem) + { + page.click('#secondNavBar .navbar a:contains('+ menuItem + ')'); + } + // main menu tests it('should load the main reporting menu correctly', function (done) { - expect.screenshot('mainmenu_loaded').to.be.captureSelector('.Menu--dashboard,.nav_sep', function (page) { + expect.screenshot('mainmenu_loaded').to.be.captureSelector('#secondNavBar', function (page) { page.load("?" + urlBase + "#" + generalParams + "&module=Actions&action=menuGetPageUrls"); }, done); }); it('should change the menu when a upper menu item is clicked in the main menu', function (done) { - expect.screenshot('mainmenu_upper_clicked').to.be.captureSelector('.Menu--dashboard,.nav_sep', function (page) { - page.click('.Menu-tabList > li:eq(1) > a'); + expect.screenshot('mainmenu_upper_clicked').to.be.captureSelector('#secondNavBar', function (page) { + page.click('#secondNavBar .navbar > li:eq(1) > a'); }, done); }); it('should change the menu when a lower menu item is clicked in the main menu', function (done) { - expect.screenshot('mainmenu_lower_clicked').to.be.captureSelector('.Menu--dashboard,.nav_sep', function (page) { - page.click('.Menu-tabList > li:eq(1) > ul > li:eq(1) > a'); + expect.screenshot('mainmenu_lower_clicked').to.be.captureSelector('#secondNavBar', function (page) { + page.click('#secondNavBar .navbar > li:eq(1) > ul > li:eq(1) > a'); }, done); }); // user menu tests it('should load the user reporting menu correctly', function (done) { - expect.screenshot('user_loaded').to.be.captureSelector('.Menu--admin', function (page) { + expect.screenshot('user_loaded').to.be.captureSelector('#secondNavBar', function (page) { page.load("?" + generalParams + "&module=UsersManager&action=userSettings"); }, done); }); it('should change the user page correctly when a user menu item is clicked', function (done) { - expect.screenshot('user_changed').to.be.captureSelector('.Menu--admin', function (page) { - page.click('.Menu--admin a:contains(API)'); + expect.screenshot('user_changed').to.be.captureSelector('#secondNavBar', function (page) { + openMenuItem(page, 'Platform'); + openMenuItem(page, 'API'); }, done); }); // admin menu tests it('should load the admin reporting menu correctly', function (done) { - expect.screenshot('admin_loaded').to.be.captureSelector('.Menu--admin', function (page) { + expect.screenshot('admin_loaded').to.be.captureSelector('#secondNavBar', function (page) { page.load("?" + generalParams + "&module=CoreAdminHome&action=generalSettings"); }, done); }); it('should change the admin page correctly when an admin menu item is clicked', function (done) { - expect.screenshot('admin_changed').to.be.captureSelector('.Menu--admin', function (page) { - page.click('.Menu--admin a:contains(Websites)'); + expect.screenshot('admin_changed').to.be.captureSelector('#secondNavBar', function (page) { + openMenuItem(page, 'Administration'); + openMenuItem(page, 'Websites'); }, done); }); }); \ No newline at end of file diff --git a/tests/UI/specs/MultiSites_spec.js b/tests/UI/specs/MultiSites_spec.js index bab72a1d7710307208731a4852a181770a22de33..6037a196ef8c99bcd61386f7ea52bc731469cab0 100644 --- a/tests/UI/specs/MultiSites_spec.js +++ b/tests/UI/specs/MultiSites_spec.js @@ -11,7 +11,7 @@ describe("MultiSitesTest", function () { this.timeout(0); var generalParams = 'idSite=1&period=year&date=2012-08-09'; - var selector = '.pageWrap,.expandDataTableFooterDrawer'; + var selector = '#multisites,.expandDataTableFooterDrawer'; var createdSiteId = null; diff --git a/tests/UI/specs/QuickAccess_spec.js b/tests/UI/specs/QuickAccess_spec.js new file mode 100644 index 0000000000000000000000000000000000000000..75879d2729672a5f391e9f695a7f46066813f0f5 --- /dev/null +++ b/tests/UI/specs/QuickAccess_spec.js @@ -0,0 +1,75 @@ +/*! + * Piwik - free/libre analytics platform + * + * ActionsDataTable screenshot tests. + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +describe("QuickAccess", function () { + var selectorToCapture = "#search,.quick-access"; + + this.timeout(0); + + var url = "?module=CoreHome&action=index&idSite=1&period=year&date=2012-08-09"; + + function enterSearchTerm(page, searchTermToAdd) + { + page.sendKeys("#search input", searchTermToAdd); + } + + function captureSelector(screenshotName, done, selector, callback) + { + expect.screenshot(screenshotName).to.be.captureSelector(selector, callback, done); + } + + function capture(screenshotName, done, callback) + { + captureSelector(screenshotName, done, selectorToCapture, callback); + } + + it("should be displayed", function (done) { + capture('initially', done, function (page) { + page.load(url); + }); + }); + + it("should search for something and update view", function (done) { + capture('search_1', done, function (page) { + enterSearchTerm(page, 'b'); + }); + }); + + it("should search again when typing another letter", function (done) { + capture('search_2', done, function (page) { + enterSearchTerm(page, 'a'); + }); + }); + + it("should show message if no results", function (done) { + capture('search_no_result', done, function (page) { + enterSearchTerm(page, 'x'); + }); + }); + + it("should be possible to activate via shortcut", function (done) { + capture('shortcut', done, function (page) { + page.load(url); + page.sendKeys("body", 'f'); + }); + }); + + it("should search for websites", function (done) { + capture('search_sites', done, function (page) { + enterSearchTerm(page, 'si'); + }); + }); + + it("clicking on a category should show all items that belong to that category", function (done) { + capture('search_category', done, function (page) { + page.click('.quick-access-category:first'); + }); + }); + +}); diff --git a/tests/UI/specs/SegmentSelectorEditor_spec.js b/tests/UI/specs/SegmentSelectorEditor_spec.js index 01066c3bbfa4ca2f872da1fc4d6aa0673453f1e7..f9361628416cbf12455bc0332ce4e4108a925f86 100644 --- a/tests/UI/specs/SegmentSelectorEditor_spec.js +++ b/tests/UI/specs/SegmentSelectorEditor_spec.js @@ -22,13 +22,13 @@ describe("SegmentSelectorEditorTest", function () { it("should open selector when control clicked", function (done) { expect.screenshot("1_selector_open").to.be.captureSelector(selectorsToCapture, function (page) { - page.click('.segmentationContainer'); + page.click('.segmentationContainer .title'); }, done); }); it("should open segment editor when edit link clicked for existing segment", function (done) { expect.screenshot("2_segment_editor_update").to.be.captureSelector(selectorsToCapture, function (page) { - page.click('.segmentList .editSegment'); + page.click('.segmentList .editSegment:first'); }, done); }); @@ -65,7 +65,7 @@ describe("SegmentSelectorEditorTest", function () { it("should open blank segment editor when create new segment link is clicked", function (done) { expect.screenshot("8_segment_editor_create").to.be.captureSelector(selectorsToCapture, function (page) { - page.click('.segmentationContainer'); + page.click('.segmentationContainer .title'); page.click('.add_new_segment'); }, done); }); @@ -120,7 +120,7 @@ describe("SegmentSelectorEditorTest", function () { it("should show the new segment after page reload", function (done) { expect.screenshot("saved").to.be.captureSelector("saved_reload", selectorsToCapture, function (page) { page.reload(); - page.click('.segmentationContainer'); + page.click('.segmentationContainer .title'); }, done); }); @@ -158,7 +158,7 @@ describe("SegmentSelectorEditorTest", function () { it("should show the updated segment after page reload", function (done) { expect.screenshot("updated").to.be.captureSelector("updated_reload", selectorsToCapture, function (page) { page.reload(); - page.click('.segmentationContainer'); + page.click('.segmentationContainer .title'); }, done); }); @@ -178,14 +178,14 @@ describe("SegmentSelectorEditorTest", function () { expect.screenshot('deleted').to.be.captureSelector(selectorsToCapture + ',.ui-dialog', function (page) { page.click('.ui-dialog button>span:contains(Yes):visible'); - page.click('.segmentationContainer'); + page.click('.segmentationContainer .title'); }, done); }); it("should not show the deleted segment after page reload", function (done) { expect.screenshot('deleted').to.be.captureSelector('deleted_reload', selectorsToCapture, function (page) { page.reload(); - page.click('.segmentationContainer'); + page.click('.segmentationContainer .title'); }, done); }); }); \ No newline at end of file diff --git a/tests/UI/specs/SiteSelector_spec.js b/tests/UI/specs/SiteSelector_spec.js index 71ae7995588a2124fd3f5a445a76af12352beb5e..08bd950a7784553c77e817d5e2d5ccf1aa66222f 100644 --- a/tests/UI/specs/SiteSelector_spec.js +++ b/tests/UI/specs/SiteSelector_spec.js @@ -22,7 +22,7 @@ describe("SiteSelector", function () { it("should display expanded when clicked", function (done) { expect.screenshot("expanded").to.be.captureSelector(selectorToCapture, function (page) { - page.click('.sites_autocomplete'); + page.click('.sites_autocomplete .title'); }, done); }); diff --git a/tests/UI/specs/UIIntegration_spec.js b/tests/UI/specs/UIIntegration_spec.js index 76b521567fb44a939c9e0efdbb75e6f07be14e28..ab5a5ec6aa596044a6a4f8396712d4db33324076 100644 --- a/tests/UI/specs/UIIntegration_spec.js +++ b/tests/UI/specs/UIIntegration_spec.js @@ -237,13 +237,13 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? // goals pages it('should load the goals > ecommerce page correctly', function (done) { - expect.screenshot('goals_ecommerce').to.be.captureSelector('.pageWrap,.expandDataTableFooterDrawer', function (page) { + expect.screenshot('goals_ecommerce').to.be.captureSelector('.pageWrap,.expandDataTableFooterDrawer,.dataTable', function (page) { page.load("?" + urlBase + "#" + generalParams + "&module=Ecommerce&action=ecommerceReport&idGoal=ecommerceOrder"); }, done); }); it('should load the goals > overview page correctly', function (done) { - expect.screenshot('goals_overview').to.be.captureSelector('.pageWrap,.expandDataTableFooterDrawer', function (page) { + expect.screenshot('goals_overview').to.be.captureSelector('.pageWrap,.expandDataTableFooterDrawer,.dataTable', function (page) { page.load( "?" + urlBase + "#" + generalParams + "&module=Goals&action=index"); }, done); }); @@ -256,7 +256,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? }); it('should load the goals > single goal page correctly', function (done) { - expect.screenshot('goals_individual_goal').to.be.captureSelector('.pageWrap,.expandDataTableFooterDrawer', function (page) { + expect.screenshot('goals_individual_goal').to.be.captureSelector('.pageWrap,.expandDataTableFooterDrawer,.dataTable', function (page) { page.load("?" + urlBase + "#" + generalParams + "&module=Goals&action=goalReport&idGoal=1"); }, done); }); @@ -349,7 +349,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? // Ecommerce it('should load the ecommerce overview page', function (done) { - expect.screenshot('ecommerce_overview').to.be.captureSelector('.pageWrap,.expandDataTableFooterDrawer', function (page) { + expect.screenshot('ecommerce_overview').to.be.captureSelector('.pageWrap,.expandDataTableFooterDrawer,.dataTable', function (page) { page.load("?" + urlBase + "#" + generalParams + "&module=Ecommerce&action=ecommerceReport&idGoal=ecommerceOrder"); }, done); }); @@ -361,20 +361,20 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? }); it('should load the ecommerce products page', function (done) { - expect.screenshot('ecommerce_products').to.be.captureSelector('.pageWrap,.expandDataTableFooterDrawer', function (page) { + expect.screenshot('ecommerce_products').to.be.captureSelector('.pageWrap,.expandDataTableFooterDrawer,.dataTable', function (page) { page.load("?" + urlBase + "#" + generalParams + "&module=Ecommerce&action=products&idGoal=ecommerceOrder"); }, done); }); it('should load the ecommerce sales page', function (done) { - expect.screenshot('ecommerce_sales').to.be.captureSelector('.pageWrap,.expandDataTableFooterDrawer', function (page) { + expect.screenshot('ecommerce_sales').to.be.captureSelector('.pageWrap,.expandDataTableFooterDrawer,.dataTable', function (page) { page.load("?" + urlBase + "#" + generalParams + "&module=Ecommerce&action=sales&idGoal=ecommerceOrder"); }, done); }); // Admin user settings (plugins not displayed) it('should load the Manage > Websites admin page correctly', function (done) { - expect.screenshot('admin_manage_websites').to.be.captureSelector('#content', function (page) { + expect.screenshot('admin_manage_websites').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=SitesManager&action=index"); page.evaluate(function () { $('.form-help:contains(UTC time is)').hide(); @@ -383,7 +383,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? }); it('should load the Manage > Users admin page correctly', function (done) { - expect.screenshot('admin_manage_users').to.be.captureSelector('#content', function (page) { + expect.screenshot('admin_manage_users').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=UsersManager&action=index"); // remove token auth which can be random @@ -399,25 +399,25 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? }); it('should load the user settings admin page correctly', function (done) { - expect.screenshot('admin_user_settings').to.be.captureSelector('#content', function (page) { + expect.screenshot('admin_user_settings').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=UsersManager&action=userSettings"); }, done); }); it('should load the Manage > Tracking Code admin page correctly', function (done) { - expect.screenshot('admin_manage_tracking_code').to.be.captureSelector('#content', function (page) { + expect.screenshot('admin_manage_tracking_code').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=CoreAdminHome&action=trackingCodeGenerator"); }, done); }); it('should load the Settings > General Settings admin page correctly', function (done) { - expect.screenshot('admin_settings_general').to.be.captureSelector('#content', function (page) { + expect.screenshot('admin_settings_general').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=CoreAdminHome&action=generalSettings"); }, done); }); it('should load the Settings > Privacy admin page correctly', function (done) { - expect.screenshot('admin_privacy_settings').to.be.captureSelector('#content,.ui-inline-help', function (page) { + expect.screenshot('admin_privacy_settings').to.be.captureSelector('.pageWrap,.ui-inline-help', function (page) { page.load("?" + generalParams + "&module=PrivacyManager&action=privacySettings"); }, done); }); @@ -429,43 +429,43 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? }); it('should load the Settings > Mobile Messaging admin page correctly', function (done) { - expect.screenshot('admin_settings_mobilemessaging').to.be.captureSelector('#content', function (page) { + expect.screenshot('admin_settings_mobilemessaging').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=MobileMessaging&action=index"); }, done); }); it('should load the Settings > Mobile Messaging user page correctly', function (done) { - expect.screenshot('user_settings_mobilemessaging').to.be.captureSelector('#content', function (page) { + expect.screenshot('user_settings_mobilemessaging').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=MobileMessaging&action=userSettings"); }, done); }); it('should load the themes admin page correctly', function (done) { - expect.screenshot('admin_themes').to.be.captureSelector('#content', function (page) { + expect.screenshot('admin_themes').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=CorePluginsAdmin&action=themes"); }, done); }); it('should load the plugins admin page correctly', function (done) { - expect.screenshot('admin_plugins').to.be.captureSelector('#content', function (page) { + expect.screenshot('admin_plugins').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=CorePluginsAdmin&action=plugins"); }, done); }); it('should load the plugin settings admin page correctly', function (done) { - expect.screenshot('admin_plugin_settings').to.be.captureSelector('#content', function (page) { + expect.screenshot('admin_plugin_settings').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=CoreAdminHome&action=adminPluginSettings"); }, done); }); it('should load the plugin settings user page correctly', function (done) { - expect.screenshot('user_plugin_settings').to.be.captureSelector('#content', function (page) { + expect.screenshot('user_plugin_settings').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=CoreAdminHome&action=userPluginSettings"); }, done); }); it('should load the Settings > Visitor Generator admin page correctly', function (done) { - expect.screenshot('admin_visitor_generator').to.be.captureSelector('#content', function (page) { + expect.screenshot('admin_visitor_generator').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=VisitorGenerator&action=index"); page.evaluate(function () { @@ -477,7 +477,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? // Notifications it('should load the notifications page correctly', function (done) { - expect.screenshot('notifications').to.be.captureSelector('#content', function (page) { + expect.screenshot('notifications').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=ExampleUI&action=notifications&idSite=1&period=day&date=yesterday"); page.evaluate(function () { $('#header').hide(); @@ -517,20 +517,20 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? // CustomAlerts plugin TODO: move to CustomAlerts plugin it('should load the custom alerts list correctly', function (done) { - expect.screenshot('customalerts_list').to.be.captureSelector('#content', function (page) { + expect.screenshot('customalerts_list').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=CustomAlerts&action=index&idSite=1&period=day&date=yesterday&tests_hide_piwik_version=1"); }, done); }); it('should load the triggered custom alerts list correctly', function (done) { - expect.screenshot('customalerts_list_triggered').to.be.captureSelector('#content', function (page) { + expect.screenshot('customalerts_list_triggered').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=CustomAlerts&action=historyTriggeredAlerts&idSite=1&period=day&date=yesterday&tests_hide_piwik_version=1"); }, done); }); // top bar pages it('should load the widgets listing page correctly', function (done) { - expect.screenshot('widgets_listing').to.be.captureSelector('#content', function (page) { + expect.screenshot('widgets_listing').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=Widgetize&action=index"); page.mouseMove('.widgetpreview-categorylist>li:contains(Visits Summary)'); page.mouseMove('li[uniqueid=widgetVisitsSummarygetEvolutionGraphcolumnsArray]'); @@ -538,7 +538,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? }); it('should load the API listing page correctly', function (done) { - expect.screenshot('api_listing').to.be.captureSelector('#content', function (page) { + expect.screenshot('api_listing').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=API&action=listAllAPI"); page.evaluate(function () { // remove token_auth since it can change on each test run $('span#token_auth>strong').text('dummytokenauth'); @@ -547,7 +547,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? }); it('should load the email reports page correctly', function (done) { - expect.screenshot('email_reports').to.be.captureSelector('#content', function (page) { + expect.screenshot('email_reports').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=ScheduledReports&action=index"); page.evaluate(function () { $('#header').hide(); @@ -556,7 +556,7 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? }); it('should load the feedback form when the feedback form link is clicked', function (done) { - expect.screenshot('feedback_form').to.be.captureSelector('#content', function (page) { + expect.screenshot('feedback_form').to.be.captureSelector('.pageWrap', function (page) { page.load("?" + generalParams + "&module=Feedback&action=index"); @@ -577,11 +577,8 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik? it('should reload to the correct date when a date range is selected in the period selector', function (done) { expect.screenshot('period_select_date_range_click').to.be.capture(function (page) { page.load("?" + urlBase + "#" + generalParams + "&module=VisitTime&action=index"); - page.evaluate(function () { - $(document).ready(function () { - $('#date').click(); - }); - }); + page.wait(1000); + page.click('#date.title'); // we need to make sure there to wait for a bit till date is opened and period selected page.click('#period_id_range'); page.evaluate(function () { diff --git a/tests/lib/screenshot-testing/support/page-renderer.js b/tests/lib/screenshot-testing/support/page-renderer.js index 3a0ef301d0866fcd9bd04a93e8328848fa3b625a..c3486ddae5a93a40797a2ab4bffb27b2c9d1acb5 100644 --- a/tests/lib/screenshot-testing/support/page-renderer.js +++ b/tests/lib/screenshot-testing/support/page-renderer.js @@ -137,6 +137,8 @@ PageRenderer.prototype._sendMouseEvent = function (type, pos, callback) { PageRenderer.prototype._click = function (selector, modifiers, callback) { var position = this._getPosition(selector); + this._makeSurePositionIsInViewPort(position.x, position.y); + if (modifiers.length) { var self = this; modifiers = modifiers.reduce(function (previous, mStr) { @@ -152,6 +154,46 @@ PageRenderer.prototype._click = function (selector, modifiers, callback) { callback(); }; +PageRenderer.prototype._makeSurePositionIsInViewPort = function (width, height) { + + var currentWidth = this._getViewportWidth(); + var currentHeight = this._getViewportHeight(); + + var update = false; + + if (width && width > 0 && width >= currentWidth) { + currentWidth = width + 50; + update = true; + } + + if (height && height > 0 && height >= currentHeight) { + currentHeight = height + 50; + update = true; + } + + if (update) { + this._setCorrectViewportSize({width: currentWidth, height: currentHeight}); + } +}; + +PageRenderer.prototype._getViewportWidth = function () { + var width = 1350; + if (this._viewportSizeOverride && this._viewportSizeOverride.width) { + width = this._viewportSizeOverride.width; + } + + return width; +}; + +PageRenderer.prototype._getViewportHeight = function () { + var height = 768; + if (this._viewportSizeOverride && this._viewportSizeOverride.height) { + height = this._viewportSizeOverride.height; + } + + return height; +}; + PageRenderer.prototype._keypress = function (keys, callback) { this.webpage.sendEvent('keypress', keys); @@ -574,8 +616,10 @@ PageRenderer.prototype._waitForNextEvent = function (events, callback, i, waitTi }, waitTime); }; -PageRenderer.prototype._setCorrectViewportSize = function () { - var viewportSize = this._viewportSizeOverride || {width:1350, height:768}; +PageRenderer.prototype._setCorrectViewportSize = function (viewportSize) { + if (!viewportSize) { + viewportSize = {width: this._getViewportWidth(), height: this._getViewportHeight()}; + } this.webpage.viewportSize = viewportSize; var height = Math.max(viewportSize.height, this.webpage.evaluate(function() { diff --git a/tests/resources/screenshot-override/override.css b/tests/resources/screenshot-override/override.css index 9616c5acb86c32b59590c56b0cde73c26e0993cd..f74ae3545f8f135ab9319e0f32df841f8d578a04 100644 --- a/tests/resources/screenshot-override/override.css +++ b/tests/resources/screenshot-override/override.css @@ -1,5 +1,5 @@ -#header_message>.header_short { - display:none; +#header_message>.title { + visibility: hidden; } .visitor-profile-widget-link>strong {