summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-03-31 19:04:26 -0700
committerSamy Pessé <samypesse@gmail.com>2014-03-31 19:04:26 -0700
commit5ff6896ee55e6bc735214e0df33d6e004372a03e (patch)
treee13f401848c6ecc7b5f548823d806da20aa2ded8 /templates
parent68e35758c33168e9b3fe1c678e07d52b42879720 (diff)
downloadgitbook-5ff6896ee55e6bc735214e0df33d6e004372a03e.zip
gitbook-5ff6896ee55e6bc735214e0df33d6e004372a03e.tar.gz
gitbook-5ff6896ee55e6bc735214e0df33d6e004372a03e.tar.bz2
Move all javascript to the bundle
Diffstat (limited to 'templates')
-rw-r--r--templates/includes/book/header.html20
-rw-r--r--templates/layout.html3
-rw-r--r--templates/page.html26
3 files changed, 2 insertions, 47 deletions
diff --git a/templates/includes/book/header.html b/templates/includes/book/header.html
index c1b6518..bb8c2da 100644
--- a/templates/includes/book/header.html
+++ b/templates/includes/book/header.html
@@ -10,22 +10,4 @@
<!-- Title -->
<h1><a href="{{ basePath }}/README.html" >{{ title }}</a></h1>
-</div>
-<script>
-$(document).ready(function() {
- var $book = $(".book");
-
- // Toggle summary
- $book.find(".book-header .toggle-summary").click(function(e) {
- e.preventDefault();
- $book.toggleClass("with-summary");
- });
-
- // Star and watch count
- $.getJSON("https://api.github.com/repos/{{ githubId }}")
- .done(function(repo) {
- $book.find(".count-star span").text(repo.stargazers_count);
- $book.find(".count-watch span").text(repo.subscribers_count);
- });
-});
-</script> \ No newline at end of file
+</div> \ No newline at end of file
diff --git a/templates/layout.html b/templates/layout.html
index 4c1302c..b1c8fa6 100644
--- a/templates/layout.html
+++ b/templates/layout.html
@@ -13,8 +13,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
-
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/mode-javascript.js"></script>
{% endblock %}
diff --git a/templates/page.html b/templates/page.html
index ea52576..db15113 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -39,30 +39,4 @@
</div>
</div>
</div>
-
-<script>
-$(document).ready(function() {
- $("section.exercise").each(function() {
- var $exercise = $(this);
-
- var codeSolution = $exercise.find(".code-solution").html();
- var codeValidation = $exercise.find(".code-validation").html();
-
- var editor = ace.edit($exercise.find(".editor").get(0));
- editor.setTheme("ace/theme/tomorrow");
- editor.getSession().setMode("ace/mode/javascript");
-
- $exercise.find(".action-submit").click(function(e) {
- e.preventDefault();
-
- alert("submit");
- });
- $exercise.find(".action-solution").click(function(e) {
- e.preventDefault();
-
- editor.setValue(codeSolution);
- });
- })
-});
-</script>
{% endblock %} \ No newline at end of file