]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Made JavaScript unobtrusive by factoring out prettyPrint() to application.js. Also... 89/head
authorKarthik Viswanathan <karthik.ksv@gmail.com>
Fri, 26 Aug 2011 07:00:05 +0000 (00:00 -0700)
committerKarthik Viswanathan <karthik.ksv@gmail.com>
Fri, 26 Aug 2011 07:00:05 +0000 (00:00 -0700)
docs/assets/js/application.js
docs/index.html
examples/hero.html

index 3319e607dbcf2b06e545638978a23779df04a9a4..ddf6b7b9acc71ab02361454c91816bec783de7c6 100644 (file)
@@ -1,10 +1,22 @@
 $(document).ready(function(){
 
+  // Google code prettify
+  // ================
+
+  // cache $(window), as it is used in scroll spy logic later on
+  var $window = $(window);
+
+  $window.load(function() {
+    // prettyPrint cannot be set as the event handler to load directly; see
+    // http://google-code-prettify.googlecode.com/svn/trunk/README.html
+    prettyPrint();
+  });
+  
+
   // scroll spy logic
   // ================
 
   var activeTarget,
-      $window = $(window),
       position = {},
       nav = $('body > .topbar li a'),
       targets = nav.map(function () {
@@ -127,4 +139,4 @@ $(document).ready(function(){
 
   });
 
-});
\ No newline at end of file
+});
index 58be9e8b5f868bb8dc71bb5f8dc92350d705c728..be77950e735cf4a9389b6b58b81b53a2a5f7a9f4 100644 (file)
@@ -29,7 +29,7 @@
     <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
   </head>
 
-  <body onload="prettyPrint();">
+  <body>
 
     <!-- Topbar
     ================================================== -->
@@ -1383,4 +1383,4 @@ Lorem ipsum dolar sit amet illo error <a href="#" title="below">ipsum</a> verita
     </div>
 
   </body>
-</html>
\ No newline at end of file
+</html>
index faac6ab754fd36f11d4d7e0ad2bd0be1ea637dd8..6841cfd3958d76357aaf71bc3c9efec327ad65cb 100644 (file)
@@ -25,7 +25,7 @@
 
     <div class="topbar">
       <div class="fill">
-        <div class="container fixed">
+        <div class="container">
           <h3><a href="#">Project name</a></h3>
           <ul>
             <li class="active"><a href="#">Home</a></li>
@@ -71,4 +71,4 @@
     </div> <!-- /container -->
 
   </body>
-</html>
\ No newline at end of file
+</html>