]> Shamusworld >> Repos - ardour-manual/blobdiff - source/_layouts/bootstrap.html
add unspeakably ugly hack to user agent checker, so that the linux and mac bindings...
[ardour-manual] / source / _layouts / bootstrap.html
index 5cf2a164098179843a4b200dc4c966cbd0204877..db2c3c90ef150853e5e4173f5507fc59e1b0ec79 100644 (file)
@@ -3,11 +3,11 @@ bootstrap_path: /bootstrap-2.2.2
 page_title: The Ardour Manual
 ---
 
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+      
     <head>
-        <meta charset="utf-8" />
-
         <title>{{page.page_title}}</title>
 
         <meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -50,8 +50,7 @@ page_title: The Ardour Manual
                 </div>
             </div>
             <div class="span12" id="content">
-                <div id="search">
-                    <gcse:search></gcse:search>
+                <div id="search" class="gcse-search">
                 </div>
                 <div id="content-main">
                     <h1 class="title">{{ page.title }}</h1>
@@ -63,9 +62,13 @@ page_title: The Ardour Manual
 
     <script type="text/javascript">
 
-        if (navigator.userAgent.match(/Mac/)) {
+        // I'll go to hell for this
+        var isA = function(regex) { return navigator.userAgent.match(regex) };
+        var isAbout = function(regex) { return document.getElementsByTagName('h1')[1].textContent.match(regex) };
+
+        if ( (isA(/Mac/) || isAbout(/OS X/)) && (!isAbout(/Linux/)) ) {
             var e = document.getElementsByTagName('body')[0];
-            e.className += ' mac';
+            e.className += ' mac';  // class magic for Cmd vs. Ctrl keys.
         }
 
         var tree = document.getElementById('tree'),
@@ -73,20 +76,20 @@ page_title: The Ardour Manual
             name = '/' + document.location.pathname.split('/')[1] + '/',
             offset;
 
-        for (var i = 0; i < anchors.length; i++) { 
+        for (var i = 0; i &lt; anchors.length; i++) { 
             if (anchors[i].getAttribute('name') === name) { 
                 offset = anchors[i].offsetTop;
                 break;
             } 
         }
 
-        if (tree && offset) {
+        if (tree &amp;&amp; offset) {
             tree.scrollTop = offset - 10;
         }
 
     </script>
 
-    <script>
+    <script type="text/javascript">
         (function() {
           var cx = '011950134405426689607:2lg2y9xgf3a';
           var gcse = document.createElement('script'); gcse.type = 'text/javascript';