summaryrefslogtreecommitdiff
path: root/static/website
diff options
context:
space:
mode:
Diffstat (limited to 'static/website')
-rw-r--r--static/website/css/main.css1
-rw-r--r--static/website/images/ajax-loader.gifbin1079 -> 723 bytes
-rw-r--r--static/website/js/cloud.js31
-rw-r--r--static/website/templates/index.html3
4 files changed, 30 insertions, 5 deletions
diff --git a/static/website/css/main.css b/static/website/css/main.css
index fddd0aa..d476b7b 100644
--- a/static/website/css/main.css
+++ b/static/website/css/main.css
@@ -6,6 +6,7 @@ select {
display: inline;
margin-bottom: 15px;
min-width: 220px;
+ max-width: 40%;
width: auto;
}
.CodeMirror {
diff --git a/static/website/images/ajax-loader.gif b/static/website/images/ajax-loader.gif
index 408af5c..6bdc3b5 100644
--- a/static/website/images/ajax-loader.gif
+++ b/static/website/images/ajax-loader.gif
Binary files differ
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");
});
diff --git a/static/website/templates/index.html b/static/website/templates/index.html
index 50dee60..a3a6f8a 100644
--- a/static/website/templates/index.html
+++ b/static/website/templates/index.html
@@ -18,7 +18,6 @@
<span id="title">
Scilab on Cloud
</span>
-
<div id="navlinks">
<ul>
<li><a href="#">About</a></li>
@@ -52,7 +51,7 @@
<option value="4">Thermodynamics</option>
<option value="13">Others</option>
</select>
- <a href="#" class="extra-link" id="contributor">Contributor</a>
+ <a href="#" class="extra-link" id="contributor">+Contributor</a>
</div>
<div id="books-wrapper"></div>
<div id="chapters-wrapper"></div>