Skip to content

Commit

Permalink
Merge pull request #88 from tzi/pleineLune__less-installation
Browse files Browse the repository at this point in the history
CSS, templates improvements. Enable Assetmanager on login page, separate css for installer/upgrader, progress in theming, Less installation. Super boulot Thomas !
  • Loading branch information
Matthieu Aubry committed Jul 13, 2013
2 parents 93bafe4 + d78d735 commit ea69cc4
Show file tree
Hide file tree
Showing 97 changed files with 3,332 additions and 2,164 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"require": {
"php": ">=5.3.0",
"twig/twig": "1.*"
"twig/twig": "1.*",
"leafo/lessphp": "0.3.*"
}
}
43 changes: 42 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/global.ini.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@
Plugins[] = ExampleRssWidget
Plugins[] = Provider
Plugins[] = Feedback
Plugins[] = PleineLune

Plugins[] = Login
Plugins[] = UsersManager
Expand Down
15 changes: 6 additions & 9 deletions core/AssetManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
* @package Piwik
*/

/**
* @see libs/cssmin/cssmin.php
*/
require_once PIWIK_INCLUDE_PATH . '/libs/cssmin/cssmin.php';

/**
* @see libs/jsmin/jsmin.php
*/
Expand Down Expand Up @@ -60,7 +55,7 @@ public static function getCssAssets()
if (self::getDisableMergedAssets()) {
// Individual includes mode
self::removeMergedAsset(self::MERGED_CSS_FILE);
return self::getIndividualCssIncludes();
self::generateMergedCssFile();
}
return sprintf(self::CSS_IMPORT_DIRECTIVE, self::GET_CSS_MODULE_ACTION);
}
Expand Down Expand Up @@ -96,13 +91,16 @@ private static function generateMergedCssFile()
}
$rootDirectoryLen = strlen($rootDirectory);

$less = new lessc;

// Loop through each css file
$files = self::getCssFiles();
foreach ($files as $file) {

self::validateCssFile($file);

$fileLocation = self::getAbsoluteLocation($file);
$less->addImportDir(dirname($fileLocation));
$content = file_get_contents($fileLocation);

// Rewrite css url directives
Expand All @@ -120,8 +118,7 @@ private static function generateMergedCssFile()
$mergedContent = $mergedContent . $content;
}

$mergedContent = cssmin::minify($mergedContent);
$mergedContent = str_replace("\n", "\r\n", $mergedContent);
$mergedContent = $less->compile($mergedContent);

Piwik_PostEvent('AssetManager.filterMergedCss', array(&$mergedContent));

Expand Down Expand Up @@ -189,7 +186,7 @@ private static function sortCssFiles($cssFiles)
{
$priorityCssOrdered = array(
'libs/',
'plugins/Zeitgeist/stylesheets/common.css',
'plugins/Zeitgeist/stylesheets/base.less',
'plugins/Zeitgeist/stylesheets/',
'plugins/',
);
Expand Down
4 changes: 0 additions & 4 deletions core/Twig.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,9 @@ protected function addFunction_includeAssets()
$assetType = strtolower($params['type']);
switch ($assetType) {
case 'css':

return Piwik_AssetManager::getCssAssets();

case 'js':

return Piwik_AssetManager::getJsAssets();

default:
throw new Exception("The twig function includeAssets 'type' parameter needs to be either 'css' or 'js'.");
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/API/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected function addTopMenuMobileApp()

public function getCssFiles(&$cssFiles)
{
$cssFiles[] = "plugins/API/stylesheets/listAllAPI.css";
$cssFiles[] = "plugins/API/stylesheets/listAllAPI.less";
}
}

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion plugins/Annotations/Annotations.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function getListHooksRegistered()
*/
public function getCssFiles(&$cssFiles)
{
$cssFiles[] = "plugins/Annotations/stylesheets/annotations.css";
$cssFiles[] = "plugins/Annotations/stylesheets/annotations.less";
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@
border: 1px solid #e4e5e4;
padding: 5px 5px 6px 3px;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}

.annotation-period-edit:hover {
Expand All @@ -193,6 +191,4 @@
background: white;
border: 1px solid #e4e5e4;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
7 changes: 3 additions & 4 deletions plugins/CoreAdminHome/CoreAdminHome.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ public function getScheduledTasks(&$tasks)
public function getCssFiles(&$cssFiles)
{
$cssFiles[] = "libs/jquery/themes/base/jquery-ui.css";
$cssFiles[] = "plugins/CoreAdminHome/stylesheets/menu.css";
$cssFiles[] = "plugins/Zeitgeist/stylesheets/common.css";
$cssFiles[] = "plugins/CoreAdminHome/stylesheets/generalSettings.css";
$cssFiles[] = "plugins/CoreHome/stylesheets/donate.css";
$cssFiles[] = "plugins/CoreAdminHome/stylesheets/menu.less";
$cssFiles[] = "plugins/Zeitgeist/stylesheets/base.less";
$cssFiles[] = "plugins/CoreAdminHome/stylesheets/generalSettings.less";
}

public function getJsFiles(&$jsFiles)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
#tablist li a {
text-decoration: none;
padding: 0.6em 0.9em;
background: white;
font: 14px Arial, Helvetica, sans-serif;
display: block;
}
Expand Down
13 changes: 6 additions & 7 deletions plugins/CoreHome/CoreHome.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,14 @@ public function addWidgets()
public function getCssFiles(&$cssFiles)
{
$cssFiles[] = "libs/jquery/themes/base/jquery-ui.css";
$cssFiles[] = "plugins/Zeitgeist/stylesheets/common.css";
$cssFiles[] = "plugins/CoreHome/stylesheets/corehome.css";
$cssFiles[] = "plugins/CoreHome/stylesheets/menu.css";
$cssFiles[] = "plugins/CoreHome/stylesheets/datatable.css";
$cssFiles[] = "plugins/CoreHome/stylesheets/cloud.css";
$cssFiles[] = "plugins/Zeitgeist/stylesheets/base.less";
$cssFiles[] = "plugins/CoreHome/stylesheets/coreHome.less";
$cssFiles[] = "plugins/CoreHome/stylesheets/menu.less";
$cssFiles[] = "plugins/CoreHome/stylesheets/dataTable.less";
$cssFiles[] = "plugins/CoreHome/stylesheets/cloud.less";
$cssFiles[] = "plugins/CoreHome/stylesheets/jquery.ui.autocomplete.css";
$cssFiles[] = "plugins/CoreHome/stylesheets/jqplot.css";
$cssFiles[] = "plugins/CoreHome/stylesheets/donate.css";
$cssFiles[] = "plugins/CoreHome/stylesheets/promo.css";
$cssFiles[] = "plugins/CoreHome/stylesheets/promo.less";
}

public function getJsFiles(&$jsFiles)
Expand Down
5 changes: 3 additions & 2 deletions plugins/CoreHome/javascripts/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ function switchSite(id, name, showAjaxLoading, idCanBeAll) {
}
else {
$('.sites_autocomplete input').val(id);
$('.custom_select_main_link').text(name);
$('.custom_select_main_link').addClass('custom_select_loading');
$('.custom_select_main_link')
.text(name)
.addClass('custom_select_loading');
broadcast.propagateNewPage('segment=&idSite=' + id, showAjaxLoading);
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion plugins/CoreHome/javascripts/datatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ dataTable.prototype =
// if this url is also the url of a menu item, better to click that menu item instead of
// doing AJAX request
var menuItem = null;
$("#root").find(">ul.nav a").each(function () {
$("#root").find(">.nav a").each(function () {
if ($(this).attr('href') == url) {
menuItem = this;
return false
Expand Down
2 changes: 1 addition & 1 deletion plugins/CoreHome/javascripts/jqplot.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ JQPlot.prototype = {

if (typeof $.jqplot.visiblePlots == 'undefined') {
$.jqplot.visiblePlots = [];
$('ul.nav').on('piwikSwitchPage', function () {
$('.nav').on('piwikSwitchPage', function () {
for (var i = 0; i < $.jqplot.visiblePlots.length; i++) {
if ($.jqplot.visiblePlots[i] == null) {
continue;
Expand Down
15 changes: 12 additions & 3 deletions plugins/CoreHome/javascripts/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@ menu.prototype =
{
resetTimer: null,

adaptSubMenuHeight: function() {
var subNavHeight = $('.sfHover > ul').outerHeight();
$('.nav_sep').height(subNavHeight);
},

overMainLI: function () {
$(this).siblings().removeClass('sfHover');
$(this).addClass('sfHover');
var $this = $(this);
$this.siblings().removeClass('sfHover');
$this.addClass('sfHover');
menu.prototype.adaptSubMenuHeight();
clearTimeout(menu.prototype.resetTimer);
},

Expand All @@ -28,7 +35,7 @@ menu.prototype =
},

onItemClick: function (item) {
$('ul.nav').trigger('piwikSwitchPage', item);
$('.nav').trigger('piwikSwitchPage', item);
broadcast.propagateAjax( $(item).attr('href').substr(1) );
return false;
},
Expand Down Expand Up @@ -61,6 +68,8 @@ menu.prototype =
$(this).attr({id: module + '_' + action});
}
});

menu.prototype.adaptSubMenuHeight();
},

activateMenu: function (module, action, id) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
.piwik-donate-call {
padding: 1em 1em 1em 1em;
padding: 1em;
border: 1px solid #CCC;

border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;

max-width: 432px;
position: relative;
}
Expand All @@ -32,8 +28,6 @@
background-color: #f7f7f7;

border-radius: 6px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;

height: 14px;
width: 270px;
Expand All @@ -46,8 +40,6 @@
background-color: #CCC;

border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;

height: 18px;
width: 10px;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,20 @@ h3 {
margin-left: 1em;
}

.page {
background: url(../../Zeitgeist/images/page_border_grad.png) no-repeat 0 20px;
min-height: 10px;

}

.pageWrap {
padding: 15px 15px 0 15px;
min-height: 10px;
position: relative;
background: url(../../Zeitgeist/images/page_border_grad.png) no-repeat right 20px;

}

.nav_sep {
height: 39px;
margin: -15px -15px 18px -15px;
border-radius: 0 4px 0 0;
-moz-border-radius: 0 4px 0 0;
-webkit-border-radius: 0 4px 0 0;
border: 1px solid #dddddd;
border: 1px solid #DDD;
}

.pageWrap {
border-left: 1px solid #DDDDDD;
border-right: 1px solid #DDDDDD;
max-height: 681px;
min-height: 10px;
overflow: visible;
padding: 15px 15px 0;
position: relative;
}

/* Content */
Expand Down

0 comments on commit ea69cc4

Please sign in to comment.