diff options
Diffstat (limited to 'js/socm.js')
-rw-r--r-- | js/socm.js | 32 |
1 files changed, 28 insertions, 4 deletions
@@ -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); } }); }); |