More updates to stop using dev or alpha or beta versions.
[yaffs-website] / web / modules / contrib / security_review / js / security_review.run_and_review.js
diff --git a/web/modules/contrib/security_review/js/security_review.run_and_review.js b/web/modules/contrib/security_review/js/security_review.run_and_review.js
new file mode 100644 (file)
index 0000000..f249e41
--- /dev/null
@@ -0,0 +1,28 @@
+/**
+ * @file
+ * Implementation of check toggling using AJAX.
+ */
+
+(function ($) {
+  Drupal.behaviors.securityReview = {
+    attach: function (context) {
+      $(context).find('.security-review-toggle-link a').click(function () {
+        var link = $(this);
+        var url = link.attr('href');
+        var td = link.parent();
+        var tr = td.parent();
+        $.getJSON(url + '&js=1', function (data) {
+          if (data.skipped) {
+            tr.addClass('skipped');
+          }
+          else {
+            tr.removeClass('skipped');
+          }
+          link.text(data.toggle_text);
+          link.attr(data.toggle_href);
+        });
+        return false;
+      });
+    }
+  };
+})(jQuery);