From 7ba3812f918983a47cda678c31d12e0cd089677a Mon Sep 17 00:00:00 2001 From: Weitian LI Date: Mon, 28 Apr 2014 13:39:23 +0800 Subject: * moved 'introduction.js' -> 'sidebar.js' * moved 'introduction.css' -> 'sidebar.css' * updated page introduction.html * updated index.html and navbar.html --- page/static/css/introduction.css | 32 -------------------------------- page/static/js/introduction.js | 34 ---------------------------------- page/templates/page/introduction.html | 4 ++-- static/css/index.css | 2 +- static/css/sidebar.css | 32 ++++++++++++++++++++++++++++++++ static/js/sidebar.js | 34 ++++++++++++++++++++++++++++++++++ templates/index.html | 7 +++++++ templates/navbar.html | 2 +- 8 files changed, 77 insertions(+), 70 deletions(-) delete mode 100644 page/static/css/introduction.css delete mode 100644 page/static/js/introduction.js create mode 100644 static/css/sidebar.css create mode 100644 static/js/sidebar.js diff --git a/page/static/css/introduction.css b/page/static/css/introduction.css deleted file mode 100644 index 58a6220..0000000 --- a/page/static/css/introduction.css +++ /dev/null @@ -1,32 +0,0 @@ -/* - * css for introduction template - */ - -.navbar-bright { - background-color: #111155; - color: #fff; -} - -.affix-top, .affix{ - position: static; -} - -@media (min-width: 979px) { - #sidebar.affix-top { - position: static; - margin-top: 30px; - width: 228px; - } - - #sidebar.affix { - position: fixed; - top: 70px; - width: 228px; - } -} - -#sidebar li.active { - border: 0 #eee solid; - border-left-width: 5px; -} - diff --git a/page/static/js/introduction.js b/page/static/js/introduction.js deleted file mode 100644 index b0ff02c..0000000 --- a/page/static/js/introduction.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * js for introduction page - */ - -$(document).ready(function() { - $('#sidebar').affix({ - offset: { - top: 235 - } - }); - - var $body = $(document.body); - var navHeight = $('.navbar').outerHeight(true) + 10; - - $body.scrollspy({ - target: '#sidebar-col', - offset: navHeight - }); - - /* smooth scrolling sections */ - $('a[href*=#]:not([href=#])').click(function() { - if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { - var target = $(this.hash); - target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); - if (target.length) { - $('html,body').animate({ - scrollTop: target.offset().top - 50 - }, 100); - return false; - } - } - }); -}); - diff --git a/page/templates/page/introduction.html b/page/templates/page/introduction.html index fb22398..9a40b29 100644 --- a/page/templates/page/introduction.html +++ b/page/templates/page/introduction.html @@ -10,7 +10,7 @@ {% endblock %} {% block css_extra %} - + {% endblock %} {% block content %} @@ -102,7 +102,7 @@ {% endblock %} {% block js_extra %} - + {% endblock %} diff --git a/static/css/index.css b/static/css/index.css index 344ff07..6a2d573 100644 --- a/static/css/index.css +++ b/static/css/index.css @@ -31,7 +31,7 @@ .masthead-links { list-style: none outside none; margin-top: 10px; - margin-bottom: 20px; + margin-bottom: 10px; padding: 0 15px; text-align: center; } diff --git a/static/css/sidebar.css b/static/css/sidebar.css new file mode 100644 index 0000000..8208983 --- /dev/null +++ b/static/css/sidebar.css @@ -0,0 +1,32 @@ +/* + * css for sidebar + */ + +.navbar-bright { + background-color: #111155; + color: #fff; +} + +.affix-top, .affix{ + position: static; +} + +@media (min-width: 979px) { + #sidebar.affix-top { + position: static; + margin-top: 30px; + width: 228px; + } + + #sidebar.affix { + position: fixed; + top: 70px; + width: 228px; + } +} + +#sidebar li.active { + border: 0 #eee solid; + border-left-width: 5px; +} + diff --git a/static/js/sidebar.js b/static/js/sidebar.js new file mode 100644 index 0000000..4bfc7a7 --- /dev/null +++ b/static/js/sidebar.js @@ -0,0 +1,34 @@ +/* + * js for sidebar + */ + +$(document).ready(function() { + $('#sidebar').affix({ + offset: { + top: 235 + } + }); + + var $body = $(document.body); + var navHeight = $('.navbar').outerHeight(true) + 10; + + $body.scrollspy({ + target: '#sidebar-col', + offset: navHeight + }); + + /* smooth scrolling sections */ + $('a[href*=#]:not([href=#])').click(function() { + if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { + var target = $(this.hash); + target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); + if (target.length) { + $('html,body').animate({ + scrollTop: target.offset().top - 50 + }, 100); + return false; + } + } + }); +}); + diff --git a/templates/index.html b/templates/index.html index ba40227..17559f2 100644 --- a/templates/index.html +++ b/templates/index.html @@ -36,11 +36,18 @@ {% block footer %} {% endblock %} diff --git a/templates/navbar.html b/templates/navbar.html index b607a4b..75a2c71 100644 --- a/templates/navbar.html +++ b/templates/navbar.html @@ -21,7 +21,7 @@
  • 日程
  • 组委会
  • 赞助方
  • -
  • 资料下载
  • +
  • 资料下载