]> git.donarmstrong.com Git - neurodebian.git/commitdiff
Auto-detect youtube links and turn them into buttons...
authorMichael Hanke <michael.hanke@gmail.com>
Wed, 26 Sep 2012 11:16:52 +0000 (13:16 +0200)
committerMichael Hanke <michael.hanke@gmail.com>
Wed, 26 Sep 2012 11:16:52 +0000 (13:16 +0200)
... that open a fancy JS player.

sphinx/_static/demo_button.png [new file with mode: 0644]
sphinx/_static/neurodebian.css
sphinx/_static/video_button.png [new file with mode: 0644]
sphinx/_templates/layout.html
sphinx/vm.rst

diff --git a/sphinx/_static/demo_button.png b/sphinx/_static/demo_button.png
new file mode 100644 (file)
index 0000000..c7cfa11
Binary files /dev/null and b/sphinx/_static/demo_button.png differ
index e9e796c0d09b74c431c89a73c7d2d80bd340724e..b0d643bb01640085bd7943f035f97a99cd16bb51 100644 (file)
@@ -886,3 +886,19 @@ div#sitemap ul {
     content: "]"
 }
 
+
+.highlighted {
+    background-color: yellow;
+}
+
+#searchbox p {
+    display: inline;
+}
+
+.inlineimage {
+    vertical-align: baseline;
+}
+
+a img.inlineimage:hover {
+    background-color: #820430;
+}
diff --git a/sphinx/_static/video_button.png b/sphinx/_static/video_button.png
new file mode 100644 (file)
index 0000000..dff08a1
Binary files /dev/null and b/sphinx/_static/video_button.png differ
index 2d9b411ba104b9fdfd833c53ef2c71a0d33bd91e..c262f01d41452b9857bad4e88abda68f4b1f23ed 100644 (file)
@@ -2,6 +2,14 @@
 
 {% block extrahead %}
   <meta name="keywords" content="debian, neuroscience">
+  <script language="javascript" type="text/javascript"
+  src="/javascript/jquery-mousewheel/jquery.mousewheel.min.js"></script>
+  <script language="javascript" type="text/javascript"
+  src="/javascript/jquery-easing/jquery.easing.min.js"></script>
+  <script language="javascript" type="text/javascript"
+  src="/javascript/jquery-fancybox/jquery.fancybox.min.js"></script>
+  <link rel="stylesheet" href="/javascript/jquery-fancybox/jquery.fancybox.css"
+  type="text/css" media="screen" />
 {% endblock %}
 
 {% block header %}
@@ -62,5 +70,27 @@ git.debian.org</a>.
   $('.expandinstructions').show();
   $('.nojavascriptinstructions').hide();
 </script>
+<!-- turn all [youtube] links into buttons and open them in fancy player-->
+<script type="text/javascript">
+$(document).ready(function(){
+  $('a[href^="http://www.youtube.com/watch"]').click(function() {
+     $.fancybox({
+        'title': this.title,
+        'href': this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
+        'type': 'swf',
+        'swf': {'wmode': 'transparent', 'allowfullscreen': 'true'}
+      });
+    return false;
+    });
+  $('a[href^="http://www.youtube.com/watch"]').each(function() {
+      var content = $(this).html();
+      if (content.charAt(0) == '[' && content.charAt(content.length-1) == ']') {
+          $(this).html('<img class="inlineimage" src="/_static/video_button.png" alt="video link button" title="' + content + '" />');
+      } else {
+          return content;
+      };
+    });
+});
+</script>
 {% endblock %}
 
index a2eac7c7d9aff21f35854f214193fa97ee23f95c..da8065ddc06dbe870b1840b6fe936fb62cf54ed4 100644 (file)
@@ -46,17 +46,8 @@ Installation
 The following video shows how to get the NeuroDebian virtual machine running
 on your machine. The installation is shown for Mac OS X. It should, however, be
 very similar on a Windows box. If you cannot watch the video, please take a
-look at the written instructions below.
-
-.. raw:: html
-
-  <iframe title="YouTube video player"
-          class="youtube-player"
-          type="text/html"
-          width="640"
-          height="375"
-          src="http://www.youtube.com/embed/eqfjKV5XaTE?hd=1"
-          frameborder="0"></iframe>
+look at the written instructions below. You can also watch a `[Virtual machine
+setup video tutorial] <http://www.youtube.com/watch?v=eqfjKV5XaTE>`_.
 
 First download and install a recent version of VirtualBox_. VirtualBox is a
 virtualization software that is freely available for Windows, MacOS X, Solaris,
@@ -135,17 +126,8 @@ Working with the virtual machine
 The next video is a demonstration of some basic desktop integration features.
 It shows how to use the virtual machine in full-screen and seamless mode, shared
 folder access, software installation, as well as suspending and resuming the
-virtual machine.
-
-.. raw:: html
-
-  <iframe title="YouTube video player"
-          class="youtube-player"
-          type="text/html"
-          width="640"
-          height="375"
-          src="http://www.youtube.com/embed/OV7fYSEoOeQ?hd=1"
-          frameborder="0"></iframe>
+virtual machine `[Virtual machine handling video tutorial]
+<http://www.youtube.com/watch?v=OV7fYSEoOeQ>`_
 
 
 .. _chap_vm_troubleshooting: