summaryrefslogtreecommitdiff
path: root/website/static/website/js/cloud.js
diff options
context:
space:
mode:
authorprashantsinalkar2019-09-12 17:20:14 +0530
committerprashantsinalkar2019-09-12 17:20:14 +0530
commit88cd9bdbc72d208baa7cad42dd6a687055a800b6 (patch)
tree80ec44e2d00eeb6d172791ffe90491e74b54c6a4 /website/static/website/js/cloud.js
parent8d645434fe4cb332fdc95b75df35aab2ee41bfcc (diff)
downloadR_on_Cloud_Web_Interface-88cd9bdbc72d208baa7cad42dd6a687055a800b6.tar.gz
R_on_Cloud_Web_Interface-88cd9bdbc72d208baa7cad42dd6a687055a800b6.tar.bz2
R_on_Cloud_Web_Interface-88cd9bdbc72d208baa7cad42dd6a687055a800b6.zip
fixed code and changed modals
Diffstat (limited to 'website/static/website/js/cloud.js')
-rw-r--r--website/static/website/js/cloud.js43
1 files changed, 22 insertions, 21 deletions
diff --git a/website/static/website/js/cloud.js b/website/static/website/js/cloud.js
index 7d7d5dd..e762429 100644
--- a/website/static/website/js/cloud.js
+++ b/website/static/website/js/cloud.js
@@ -472,6 +472,7 @@ $(document.body).ready(function() {
$("#databox-wrapper").hide();
editor.setValue("");
result.setValue("");
+ console.log(example_id);
ajax_loader('#revisions');
$.ajax({
url: 'get_revisions/',
@@ -489,8 +490,8 @@ $(document.body).ready(function() {
data: {
ex_id: ex_id,
},
- success: function(data) {
- $("#example_views_count").text(data);
+ success: function(data1) {
+ $("#example_views_count").text(data1);
}
});
$("#revisions").html(
@@ -498,30 +499,30 @@ $(document.body).ready(function() {
);
var i = 1;
- data.forEach(
- function(
- item) {
- $('#revisions').append(
- '<option value="' + item.commit_sha + '"> ' +
- i + ' - ' + item.commit_message +
+ $.each(data, function(key, value){
+ $.each(value, function(key, value){
+ $('#revisions').append(
+ '<option value="' + value[1] + '"> ' +
+ i + ' - ' + value[0]+
'</option>'
- );
- i++;
+ );
+ i++;
});
+ });
$("#revisions-diff").html(
' <option value="">Select a revision</option>'
);
var i = 1;
- data.forEach(
- function(
- item) {
- $('#revisions-diff').append(
- '<option value="' + item.commit_sha + '"> ' +
- i + ' - ' + item.commit_message +
+ $.each(data, function(key, value){
+ $.each(value, function(key, value){
+ $('#revisions-diff').append(
+ '<option value="' + value[1] + '"> ' +
+ i + ' - ' + value[0]+
'</option>'
- );
- i++;
+ );
+ i++;
});
+ });
$(
'#revisions option:eq(1)'
).prop(
@@ -704,21 +705,21 @@ $(document.body).ready(function() {
/********************************************/
$(document).on("click", "#download-book", function(e) {
window.location =
- "http://r.fossee.in/download/book/" + $(
+ "http://r.fossee.in/textbook-companion/download/book/" + $(
"#books").val();
e.preventDefault();
});
$(document).on("click", "#download-chapter", function(e) {
window.location =
- "http://r.fossee.in/download/chapter/" +
+ "http://r.fossee.in/textbook-companion/download/chapter/" +
$("#chapters").val();
e.preventDefault();
});
$(document).on("click", "#download-example", function(e) {
window.location =
- "http://r.fossee.in/download/example/" +
+ "http://r.fossee.in/textbook-companion/download/example/" +
$("#examples").val();
e.preventDefault();
});