summaryrefslogtreecommitdiff
path: root/static/website/js
diff options
context:
space:
mode:
authorJayaram R Pai2014-09-08 20:59:46 +0530
committerJayaram R Pai2014-09-08 20:59:46 +0530
commitaf7aba032a7ec5fa5da9cc06760d2e67d3c928be (patch)
treea0df6cb86823a42cf7a90d1322abcd2ba43ee78c /static/website/js
parentd349c35d31b4ccf1bcc7c26a408cada3be38169e (diff)
downloadscilab-on-cloud-af7aba032a7ec5fa5da9cc06760d2e67d3c928be.tar.gz
scilab-on-cloud-af7aba032a7ec5fa5da9cc06760d2e67d3c928be.tar.bz2
scilab-on-cloud-af7aba032a7ec5fa5da9cc06760d2e67d3c928be.zip
added download links for book, chapter, example
Diffstat (limited to 'static/website/js')
-rw-r--r--static/website/js/cloud.js31
1 files changed, 28 insertions, 3 deletions
diff --git a/static/website/js/cloud.js b/static/website/js/cloud.js
index 7bd501c..764a8ae 100644
--- a/static/website/js/cloud.js
+++ b/static/website/js/cloud.js
@@ -1,5 +1,4 @@
$(document).ready(function() {
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
lineWrapping: true,
@@ -34,14 +33,16 @@ $(document).ready(function() {
$fullscreen_code.click(function(e) {
editor.setOption("fullScreen", !editor.getOption("fullScreen"));
editor.focus();
+ e.preventDefault();
});
- $toggle_code.click(function() {
+ $toggle_code.click(function(e) {
if(editor.getOption("theme") == "monokai") {
editor.setOption("theme", "default");
} else{
editor.setOption("theme", "monokai");
}
+ e.preventDefault();
});
$fullscreen_result = $("#fullscreen-result");
@@ -50,14 +51,16 @@ $(document).ready(function() {
$fullscreen_result.click(function(e) {
result.setOption("fullScreen", !result.getOption("fullScreen"));
result.focus();
+ e.preventDefault();
});
- $toggle_result.click(function() {
+ $toggle_result.click(function(e) {
if(result.getOption("theme") == "monokai") {
result.setOption("theme", "default");
} else{
result.setOption("theme", "monokai");
}
+ e.preventDefault();
});
/*
@@ -113,4 +116,26 @@ $(document).ready(function() {
example_id: $("#examples").val() || 0
});
});
+
+ /* Download book, chapter, example */
+ $(document).on("click", "#download-book", function(e) {
+ window.location = "http://scilab.in/download/book/" + $("#books").val();
+ e.preventDefault();
+ });
+
+ $(document).on("click", "#download-chapter", function(e) {
+ window.location = "http://scilab.in/download/chapter/" + $("#chapters").val();
+ e.preventDefault();
+ });
+
+ $(document).on("click", "#download-example", function(e) {
+ window.location = "http://scilab.in/download/example/" + $("#examples").val();
+ e.preventDefault();
+ });
+
+ /* Ajax loader */
+ function ajax_loader(ele) {
+
+ }
+ ajax_loader("#categories");
});