Skip to content

Commit

Permalink
make it consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-24 committed Aug 3, 2015
1 parent 832994b commit bb1f130
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 92 deletions.
40 changes: 16 additions & 24 deletions administrator/templates/hathor/index.php
Expand Up @@ -39,41 +39,33 @@

$doc->addStyleSheetVersion($this->baseurl . '/templates/' . $this->template . '/css/colour_' . $colour . '.css');

// Load custom.css
$file = 'templates/' . $this->template . '/css/custom.css';

if (file_exists($file) && filesize($file) > 0)
{
$doc->addStyleSheetVersion($file);
}

// Load specific language related CSS
$file = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css';

if (is_file($file))
{
$doc->addStyleSheetVersion($file);
}

// Load additional CSS styles for rtl sites
if ($this->direction == 'rtl')
{
$doc->addStyleSheetVersion($this->baseurl . '/templates/' . $this->template . '/css/template_rtl.css');
$doc->addStyleSheetVersion($this->baseurl . '/templates/' . $this->template . '/css/colour_' . $colour . '_rtl.css');
}

// Load additional CSS styles for bold Text
if ($this->params->get('boldText'))
{
$doc->addStyleSheetVersion($this->baseurl . '/templates/' . $this->template . '/css/boldtext.css');
}

// Load specific language related CSS
$file = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css';
$languageCss = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css';

if (is_file($file))
if (file_exists($languageCss) && filesize($languageCss) > 0)
{
$doc->addStyleSheetVersion($file);
$doc->addStyleSheetVersion($languageCss);
}

// Load additional CSS styles for bold Text
if ($this->params->get('boldText'))
// Load custom.css
$customCss = 'templates/' . $this->template . '/css/custom.css';

if (file_exists($customCss) && filesize($customCss) > 0)
{
$doc->addStyleSheetVersion($this->baseurl . '/templates/' . $this->template . '/css/boldtext.css');
$doc->addStyleSheetVersion($customCss);
}

// Load template javascript
Expand Down Expand Up @@ -170,7 +162,7 @@
<p class="copyright">
<?php
// Fix wrong display of Joomla!® in RTL language
if (JFactory::getLanguage()->isRtl())
if (JFactory::getLanguage()->isRTL())
{
$joomla = '<a href="http://www.joomla.org" target="_blank">Joomla!</a><sup>&#174;&#x200E;</sup>';
}
Expand All @@ -195,4 +187,4 @@
})(jQuery);
</script>
</body>
</html>
</html>
107 changes: 41 additions & 66 deletions administrator/templates/isis/index.php
Expand Up @@ -19,25 +19,26 @@

// Add JavaScript Frameworks
JHtml::_('bootstrap.framework');

$doc->addScriptVersion($this->baseurl . '/templates/' . $this->template . '/js/template.js');

// Add Stylesheets
$doc->addStyleSheetVersion($this->baseurl . '/templates/' . $this->template . '/css/template' . ($this->direction == 'rtl' ? '-rtl' : '') . '.css');

// Load custom.css
$file = 'templates/' . $this->template . '/css/custom.css';
// Load specific language related CSS
$languageCss = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css';

if (file_exists($file) && filesize($file) > 0)
if (file_exists($languageCss) && filesize($languageCss) > 0)
{
$doc->addStyleSheetVersion($file);
$doc->addStyleSheetVersion($languageCss);
}

// Load specific language related CSS
$file = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css';
// Load custom.css
$customCss = 'templates/' . $this->template . '/css/custom.css';

if (is_file($file))
if (file_exists($customCss) && filesize($customCss) > 0)
{
$doc->addStyleSheetVersion($file);
$doc->addStyleSheetVersion($customCss);
}

// Detecting Active Variables
Expand Down Expand Up @@ -71,8 +72,10 @@
$stickyToolbar = $this->params->get('stickyToolbar', '1');

// Header classes
$template_is_light = ($this->params->get('templateColor') && colorIsLight($this->params->get('templateColor')));
$header_is_light = ($displayHeader && $this->params->get('headerColor') && colorIsLight($this->params->get('headerColor')));
$navbar_color = $this->params->get('templateColor') ? $this->params->get('templateColor') : '';
$header_color = ($displayHeader && $this->params->get('headerColor')) ? $this->params->get('headerColor') : '';
$navbar_is_light = ($navbar_color && colorIsLight($navbar_color));
$header_is_light = ($header_color && colorIsLight($header_color));

if ($displayHeader)
{
Expand All @@ -96,6 +99,28 @@ function colorIsLight($color)

return $yiq >= 200;
}

// Pass some values to javascript
$offset = 20;

if ($displayHeader || !$statusFixed)
{
$offset = 30;
}

$stickyBar = 0;

if ($stickyToolbar)
{
$stickyBar = 1;
}

$doc->addScriptDeclaration(
"
window.isisStickyToolbar = $stickyBar;
window.isisOffsetTop = $offset;
"
);
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
Expand All @@ -105,18 +130,18 @@ function colorIsLight($color)
<jdoc:include type="head" />

<!-- Template color -->
<?php if ($this->params->get('templateColor')) : ?>
<?php if ($navbar_color) : ?>
<style type="text/css">
.navbar-inner, .navbar-inverse .navbar-inner, .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover, .navbar-inverse .nav li.dropdown.open > .dropdown-toggle, .navbar-inverse .nav li.dropdown.active > .dropdown-toggle, .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle, #status.status-top {
background: <?php echo $this->params->get('templateColor'); ?>;
background: <?php echo $navbar_color; ?>;
}
</style>
<?php endif; ?>
<!-- Template header color -->
<?php if ($displayHeader && $this->params->get('headerColor')) : ?>
<?php if ($header_color) : ?>
<style type="text/css">
.header {
background: <?php echo $this->params->get('headerColor'); ?>;
background: <?php echo $header_color; ?>;
}
</style>
<?php endif; ?>
Expand Down Expand Up @@ -147,7 +172,7 @@ function colorIsLight($color)

<body class="admin <?php echo $option . ' view-' . $view . ' layout-' . $layout . ' task-' . $task . ' itemid-' . $itemid; ?>">
<!-- Top Navigation -->
<nav class="navbar<?php echo $template_is_light ? '' : ' navbar-inverse'; ?> navbar-fixed-top">
<nav class="navbar<?php echo $navbar_is_light ? '' : ' navbar-inverse'; ?> navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<?php if ($this->params->get('admin_menus') != '0') : ?>
Expand Down Expand Up @@ -290,55 +315,5 @@ function colorIsLight($color)
<!-- End Status Module -->
<?php endif; ?>
<jdoc:include type="modules" name="debug" style="none" />
<?php if ($stickyToolbar) : ?>
<script>
jQuery(function($)
{

var navTop;
var isFixed = false;

processScrollInit();
processScroll();

$(window).on('resize', processScrollInit);
$(window).on('scroll', processScroll);

function processScrollInit()
{
if ($('.subhead').length) {
navTop = $('.subhead').length && $('.subhead').offset().top - <?php echo ($displayHeader || !$statusFixed) ? 30 : 20;?>;

// Fix the container top
$(".container-main").css("top", $('.subhead').height() + $('nav.navbar').height());

// Only apply the scrollspy when the toolbar is not collapsed
if (document.body.clientWidth > 480)
{
$('.subhead-collapse').height($('.subhead').height());
$('.subhead').scrollspy({offset: {top: $('.subhead').offset().top - $('nav.navbar').height()}});
}
}
}

function processScroll()
{
if ($('.subhead').length) {
var scrollTop = $(window).scrollTop();
if (scrollTop >= navTop && !isFixed) {
isFixed = true;
$('.subhead').addClass('subhead-fixed');

// Fix the container top
$(".container-main").css("top", $('.subhead').height() + $('nav.navbar').height());
} else if (scrollTop <= navTop && isFixed) {
isFixed = false;
$('.subhead').removeClass('subhead-fixed');
}
}
}
});
</script>
<?php endif; ?>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion templates/beez3/index.php
Expand Up @@ -70,7 +70,7 @@

if (file_exists($userCss) && filesize($userCss) > 0)
{
$doc->addStyleSheet('templates/' . $this->template . '/css/user.css');
$doc->addStyleSheetVersion('templates/' . $this->template . '/css/user.css');
}

?>
Expand Down
2 changes: 1 addition & 1 deletion templates/protostar/index.php
Expand Up @@ -47,7 +47,7 @@

if (file_exists($userCss) && filesize($userCss) > 0)
{
$doc->addStyleSheet('templates/' . $this->template . '/css/user.css');
$doc->addStyleSheetVersion('templates/' . $this->template . '/css/user.css');
}

// Load optional RTL Bootstrap CSS
Expand Down

0 comments on commit bb1f130

Please sign in to comment.