summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/socm.js32
-rw-r--r--js/socm.js~22
2 files changed, 28 insertions, 26 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);
}
});
});
diff --git a/js/socm.js~ b/js/socm.js~
deleted file mode 100644
index f10101a..0000000
--- a/js/socm.js~
+++ /dev/null
@@ -1,22 +0,0 @@
-(function($) {
- $(document).ready(function() {
-
- var basePath = Drupal.settings.basePath;
- var modPath1 = basePath + "scilab-on-cloud-management/display-books/";
- $Selected = $(".selected");
- $Selected.click(function(e) {
- $(".sync-msg").remove();
- $(this).after("<span class='sync-msg'>Saving...</span>");
- $.ajax({
- url: modPath1 + "ajax/selected/" + $(this).attr("data-bid"),
- success: function(data) {
- $(".sync-msg").remove();
- console.log("success");
- console.log(data);
- }
- });
- });
-
-
- });
-})(jQuery);