Commit 137a3c78 authored by Mattia Migliorini's avatar Mattia Migliorini

Update Core styles to revision 142

parent b107fa77
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -23,21 +23,21 @@
*/
if(!core){ var core = {}; }
YUI().use('node', 'anim', function(Y) {
YUI().use('node', 'anim','event-resize', function(Y) {
core.setEqualHeight = function($className) {
var maxHeight = 0;
var heightArray = Array();
var collection = Y.all('.'+$className);
collection.each(function(node) {
node.all(' > div, > ul li').each(function(node) {
if(node.get('clientHeight') > maxHeight){
maxHeight = node.get('clientHeight');
}
});
node.all('> div, > ul li').setStyle('height', maxHeight);
maxHeight = 0;
});
}
var maxHeight = 0;
var heightArray = Array();
var collection = Y.all('.'+$className);
collection.each(function(node) {
node.all(' > div, > ul li').each(function(node) {
if(node.get('clientHeight') > maxHeight){
maxHeight = node.get('clientHeight');
}
});
node.all('> div, > ul li').setStyle('height', maxHeight);
maxHeight = 0;
});
};
core.hashBang = function() {
Y.all('#main-content a').each(function (node) {
......@@ -68,16 +68,15 @@ YUI().use('node', 'anim', function(Y) {
}
});
core.checkForSession();
}
};
core.qualifyURL = function($url) {
var img = document.createElement('img');
img.src = $url;
$url = img.src;
//img.src = null;
img = null;
return $url;
}
var img = document.createElement('img');
img.src = $url;
$url = img.src;
img = null;
return $url;
};
core.checkForSession = function() {
var session = window.name;
......@@ -86,30 +85,29 @@ YUI().use('node', 'anim', function(Y) {
core.jumpToAnchor(session.substring(1));
}
}
}
};
core.slideToAnchor = function($name) {
var target;
var destination = 0;
if($name != ''){
if($name !== ''){
destination = Y.one('#'+$name).getXY()[1] - 20;
}
var webkitAnim = new Y.Anim({
node: Y.one('html'),
to: { scroll: [0, destination]},
easing: 'easeOut',
duration: 1,
node: Y.one('html'),
to: { scroll: [0, destination]},
easing: 'easeOut',
duration: 1,
});
var ffAnim = new Y.Anim({
node: Y.one('body'),
to: { scroll: [0, destination]},
easing: 'easeOut',
duration: 1,
node: Y.one('body'),
to: { scroll: [0, destination]},
easing: 'easeOut',
duration: 1,
});
webkitAnim.run(1000);
ffAnim.run(1000);
}
};
core.jumpToAnchor = function($name) {
if(document.getElementById($name)){
......@@ -117,17 +115,17 @@ YUI().use('node', 'anim', function(Y) {
}else{
window.name = null;
}
}
};
core.getPullQuotes = function() {
Y.all('span.pullquote').each(function (node) {
var item = Y.Node.create('<div class="pull-quote js">&ldquo;'+node.getContent()+'&rdquo;</div>');
node.get('parentNode').get('parentNode').get('parentNode').append(item);
});
}
Y.all('span.pullquote').each(function (node) {
var item = Y.Node.create('<div class="pull-quote js">&ldquo;'+node.getContent()+'&rdquo;</div>');
node.get('parentNode').get('parentNode').get('parentNode').append(item);
});
};
core.setupTooltips = function() {
if(Y.one('.tooltip') != null) {
if(Y.one('.tooltip') !== null) {
Y.all('.tooltip').each(function (node) {
node.get('parentNode').prepend('<p class="tooltip-label">'+node.get('title')+'</p>');
var title = this.get('title');
......@@ -141,11 +139,13 @@ YUI().use('node', 'anim', function(Y) {
});
});
}
}
};
core.sectionTabs = function() {
if(Y.one('.tabbed-content')) {
Y.one('.tabbed-menu').append('<img src="//assets.ubuntu.com/sites/ubuntu/latest/u/img/patterns/tabbed-nav-arrow.png" class="arrow" height="6" width="12" alt="">');
var p = Y.one('.tabbed-menu a.active');
var s = p.get('href').split('#')[1];
var a = Y.one('.arrow');
......@@ -170,8 +170,14 @@ YUI().use('node', 'anim', function(Y) {
new Y.Anim({ node: a, to: { left: x+'px' } }).run();
});
}
}
core.tabbedContent = function() {
Y.all('.tabbed-content .accordion-button').on('click', function(e){
e.preventDefault();
e.target.get('parentNode').toggleClass('open');
});
};
core.svgFallback = function() {
if(Modernizr){
......@@ -183,10 +189,90 @@ YUI().use('node', 'anim', function(Y) {
}
};
core.resourceHubBoxes = function() {
Y.all(".resource").on('click',function(e) {
e.preventDefault();
e.stopPropagation();
if(e.currentTarget.one('a') !== null) {
window.location = e.currentTarget.one('a').get("href");
}
});
};
core.mobileNav = function() {
if(Y.one('.header-search')) {
Y.one('.nav-primary').insert('<a class="search-toggle"></a><a id="menu" class="nav-toggle">menu</a>','before');
} else {
Y.one('.nav-primary').insert('</a><a id="menu" class="nav-toggle">menu</a>','before');
}
Y.all('.nav-toggle').on('click', function(e) {
e.preventDefault();
if(Y.one('.header-search')) {
Y.one('.header-search').removeClass('active');
}
Y.all('.nav-toggle').toggleClass('active');
Y.all('header nav ul').toggleClass('active');
Y.all('.nav-primary').toggleClass('active');
});
if(Y.one('.header-search')) {
Y.one('.search-toggle').on('click', function(e) {
e.preventDefault();
Y.all('.nav-toggle').removeClass('active');
Y.all('header nav ul').removeClass('active');
Y.all('.nav-primary').removeClass('active');
Y.one('.header-search').toggleClass('active');
Y.one('.header-search .form-text').focus();
});
}
if(Y.one('.breadcrumb li a')) {
Y.one('.breadcrumb > li a').insert('<span class="after"></span>');
Y.one('.breadcrumb li a .after').on('click', function(e) {
e.preventDefault();
Y.one('.nav-secondary').toggleClass('open');
core.setLocalStorage('onboard');
});
}
};
core.navOnboarding = function() {
var key = 'ubuntu';
var nav_secondary = Y.one('.nav-secondary');
if(nav_secondary && !nav_secondary.test(':empty')) {
if(Y.one('html').hasClass('localstorage')) {
if(localStorage.getItem(key) === null) {
nav_secondary.addClass('open');
}else{
ls = JSON.parse(localStorage.getItem( key ));
if(ls.navigation !== 'onboard') {
nav_secondary.addClass('open');
}
}
}
}
};
core.setLocalStorage = function($value) {
var key = 'ubuntu';
var value = $value;
var ubuntu = {};
var nav_secondary = Y.one('.nav-secondary');
ubuntu.navigation = value;
localStorage.setItem(key,JSON.stringify(ubuntu));
};
core.sectionTabs();
core.tabbedContent();
core.hashBang();
core.setEqualHeight('equal-height');
core.getPullQuotes();
core.setupTooltips();
core.svgFallback();
core.resourceHubBoxes();
core.mobileNav();
core.navOnboarding();
});
\ No newline at end of file
......@@ -94,49 +94,49 @@ audio:not([controls]) {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 300;
src: url('http://themes.googleusercontent.com/static/fonts/ubuntu/v5/e7URzK__gdJcp1hLJYAEag.woff') format('woff');
src: url('https://themes.googleusercontent.com/static/fonts/ubuntu/v5/e7URzK__gdJcp1hLJYAEag.woff') format('woff');
}
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 400;
src: local('Ubuntu'), url('http://themes.googleusercontent.com/static/fonts/ubuntu/v5/mZSs29ggGoaqrCNB3kDfZQ.woff') format('woff');
src: local('Ubuntu'), url('https://themes.googleusercontent.com/static/fonts/ubuntu/v5/mZSs29ggGoaqrCNB3kDfZQ.woff') format('woff');
}
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 500;
src: local('Ubuntu Medium'), local('Ubuntu-Medium'), url('http://themes.googleusercontent.com/static/fonts/ubuntu/v5/I5PmmDkYShUQg-ah7wh25w.woff') format('woff');
src: local('Ubuntu Medium'), local('Ubuntu-Medium'), url('https://themes.googleusercontent.com/static/fonts/ubuntu/v5/I5PmmDkYShUQg-ah7wh25w.woff') format('woff');
}
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 700;
src: local('Ubuntu Bold'), local('Ubuntu-Bold'), url('http://themes.googleusercontent.com/static/fonts/ubuntu/v5/trnbTfqisuuhRVI3i45C5w.woff') format('woff');
src: local('Ubuntu Bold'), local('Ubuntu-Bold'), url('https://themes.googleusercontent.com/static/fonts/ubuntu/v5/trnbTfqisuuhRVI3i45C5w.woff') format('woff');
}
@font-face {
font-family: 'Ubuntu';
font-style: italic;
font-weight: 300;
src: local('Ubuntu Light Italic'), local('Ubuntu-LightItalic'), url('http://themes.googleusercontent.com/static/fonts/ubuntu/v5/j-TYDdXcC_eQzhhp386SjT8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
src: local('Ubuntu Light Italic'), local('Ubuntu-LightItalic'), url('https://themes.googleusercontent.com/static/fonts/ubuntu/v5/j-TYDdXcC_eQzhhp386SjT8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
}
@font-face {
font-family: 'Ubuntu';
font-style: italic;
font-weight: 400;
src: local('Ubuntu Italic'), local('Ubuntu-Italic'), url('http://themes.googleusercontent.com/static/fonts/ubuntu/v5/GZMdC02DTXXx8AdUvU2etw.woff') format('woff');
src: local('Ubuntu Italic'), local('Ubuntu-Italic'), url('https://themes.googleusercontent.com/static/fonts/ubuntu/v5/GZMdC02DTXXx8AdUvU2etw.woff') format('woff');
}
@font-face {
font-family: 'Ubuntu';
font-style: italic;
font-weight: 500;
src: local('Ubuntu Medium Italic'), local('Ubuntu-MediumItalic'), url('http://themes.googleusercontent.com/static/fonts/ubuntu/v5/NWdMogIO7U6AtEM4dDdf_T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
src: local('Ubuntu Medium Italic'), local('Ubuntu-MediumItalic'), url('https://themes.googleusercontent.com/static/fonts/ubuntu/v5/NWdMogIO7U6AtEM4dDdf_T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
}
@font-face {
font-family: 'Ubuntu';
font-style: italic;
font-weight: 700;
src: local('Ubuntu Bold Italic'), local('Ubuntu-BoldItalic'), url('http://themes.googleusercontent.com/static/fonts/ubuntu/v5/pqisLQoeO9YTDCNnlQ9bfz8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
src: local('Ubuntu Bold Italic'), local('Ubuntu-BoldItalic'), url('https://themes.googleusercontent.com/static/fonts/ubuntu/v5/pqisLQoeO9YTDCNnlQ9bfz8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
}
html {
......
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie10 lt-ie9 lt-ie8 lt-ie7" lang="en" dir="ltr"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie10 lt-ie9 lt-ie8" lang="en" dir="ltr"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie10 lt-ie9" lang="en" dir="ltr"> <![endif]-->
<!--[if IE 9]> <html class="no-js lt-ie10" lang="en" dir="ltr"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" dir="ltr"> <!--<![endif]-->
<head>
<meta charset="UTF-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="Canonical" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<![endif]-->
<title>Ubuntu guidelines template</title>
<link rel="shortcut icon" href="/static/u/img/favicon.ico" type="image/x-icon" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/u/img/apple-touch-icon-144x144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/u/img/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/u/img/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="/static/u/img/apple-touch-icon-precomposed.png">
<link type="text/plain" rel="author" href="/static/u/files/humans.txt" />
<!-- google fonts -->
<link href='//fonts.googleapis.com/css?family=Ubuntu:400,300,300italic,400italic,700,700italic%7CUbuntu+Mono' rel='stylesheet' type='text/css' />
<!-- stylesheets -->
<!--<link rel="stylesheet" type="text/css" media="screen" href="https://assets.ubuntu.com/sites/guidelines/css/responsive/latest/ubuntu-styles.css" /> -->
<link rel="stylesheet" type="text/css" media="screen" href="http://guidelines.ubuntu.local/css/responsive/latest/ubuntu-styles.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/styles.css" />
<link rel="stylesheet" type="text/css" media="print" href="css/print.css" />
<!-- javascript -->
<script src="https://assets.ubuntu.com/sites/ubuntu/latest/u/js/plugins/modernizr.2.7.1.js"></script>
</head>
<body class="">
<header class="banner global" role="banner">
<nav role="navigation" class="nav-primary nav-right">
<span id="main-navigation-link"><a href="#main-navigation">Jump to site nav</a></span>
<div class="logo">
<a class="logo-ubuntu" href="/">
<img width="106" height="25" src="https://assets.ubuntu.com/sites/ubuntu/latest/u/img/logos/logo-ubuntu-orange.svg" alt="" />
</a>
</div>
<ul>
<li class="accessibility-aid"><a accesskey="s" href="#main-content">Jump to content</a></li>
<li><a class="first" href="">First</a></li>
<li><a href="">Services</a></li>
<li><a href="">About</a></li>
<li><a href="">Contact</a></li>
<li><a class="active" href="">Active</a></li>
</ul>
<form action="/search" class="header-search">
<label for="edit-keys" class="accessibility-aid">Search</label>
<input type="search" maxlength="255" name="q" id="edit-keys" class="form-text" placeholder="Search" value="" />
<button type="submit"><img src="https://assets.ubuntu.com/sites/ubuntu/latest/u/img/search-white.svg" alt="Search" height="28" /></button>
</form>
</nav>
</header>
<div class="wrapper">
<div id="main-content" class="inner-wrapper">
</div><!-- /#main-content .inner-wrapper -->
</div><!-- /.wrapper -->
<footer class="global clearfix">
<div class="footer-c">
<p class="top-link">
<a href="#">Back to the top</a>
</p>
</div>
<div class="legal clearfix">
<p class="twelve-col">&copy; 2014 Canonical Ltd. Ubuntu and Canonical are registered trademarks of Canonical Ltd.</p>
<ul class="inline clear">
<li><a href="#">Legal information</a></li>
<li><a href="#">Report a bug</a></li>
</ul>
</div><!-- /.legal -->
</footer>
<!-- Use this only until Modernizr fixes Opera Mini background-size detection -->
<script>
var isOperaMini = (navigator.userAgent.indexOf('Opera Mini') > -1);
if(isOperaMini) {
var root = document.documentElement;
root.className += " opera-mini";
}
</script>
<script src="https://assets.ubuntu.com/sites/ubuntu/latest/u/js/plugins/yui-combined.min.js"></script>
<script>
if(!core){ var core = {}; }
core.globalPrepend = 'body';
</script>
<script src="http://guidelines.ubuntu.local/js/responsive/core.js"></script>
<script src="js/scratch.js"></script>
<script src="https://assets.ubuntu.com/sites/ubuntu/latest/u/js/plugins/respond.min.js"></script>
</body>
</html><!-- the end -->
\ No newline at end of file
......@@ -65,9 +65,8 @@ ul.inline-logos {
display: inline-block;
height: auto;
margin: 20px 0;
border-right: 1px dotted #bbb;
line-height: 60px;
padding: 0 40px;
line-height: 60px;
padding: 0 40px;
img {
float: none;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment