summaryrefslogtreecommitdiff
path: root/js/socm.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/socm.js')
-rw-r--r--js/socm.js32
1 files changed, 28 insertions, 4 deletions
diff --git a/js/socm.js b/js/socm.js
index f10101a..53b2709 100644
--- a/js/socm.js
+++ b/js/socm.js
@@ -3,16 +3,40 @@
var basePath = Drupal.settings.basePath;
var modPath1 = basePath + "scilab-on-cloud-management/display-books/";
- $Selected = $(".selected");
- $Selected.click(function(e) {
+ $Selected_book = $(".selected-book");
+ $Selected_chapter = $(".selected-chapter");
+ $Selected_example = $(".selected-example");
+
+ $Selected_book.click(function(e) {
+ $(".sync-msg").remove();
+ $(this).after("<span class='sync-msg'>Saving...</span>");
+ $.ajax({
+ url: modPath1 + "ajax/book/" + $(this).attr("data-bid"),
+ success: function(data) {
+ $(".sync-msg").remove();
+ console.log("success");
+ }
+ });
+ });
+ $Selected_chapter.click(function(e) {
+ $(".sync-msg").remove();
+ $(this).after("<span class='sync-msg'>Saving...</span>");
+ $.ajax({
+ url: modPath1 + "ajax/chapter/" + $(this).attr("data-bid"),
+ success: function(data) {
+ $(".sync-msg").remove();
+ console.log("success");
+ }
+ });
+ });
+ $Selected_example.click(function(e) {
$(".sync-msg").remove();
$(this).after("<span class='sync-msg'>Saving...</span>");
$.ajax({
- url: modPath1 + "ajax/selected/" + $(this).attr("data-bid"),
+ url: modPath1 + "ajax/example/" + $(this).attr("data-bid"),
success: function(data) {
$(".sync-msg").remove();
console.log("success");
- console.log(data);
}
});
});