You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.2 KiB

  1. $(function() {
  2. var placeholders = {
  3. email: "[email protected]",
  4. webhook: "http://",
  5. slack: "https://hooks.slack.com/...",
  6. pd: "service key"
  7. }
  8. $("#add-check-kind").change(function() {
  9. $(".channels-add-help p").hide();
  10. var v = $("#add-check-kind").val();
  11. $(".channels-add-help p." + v).show();
  12. $("#add-check-value").attr("placeholder", placeholders[v]);
  13. });
  14. $(".edit-checks").click(function() {
  15. $("#checks-modal").modal("show");
  16. var url = $(this).attr("href");
  17. $.ajax(url).done(function(data) {
  18. $("#checks-modal .modal-content").html(data);
  19. })
  20. return false;
  21. });
  22. var $cm = $("#checks-modal");
  23. $cm.on("click", "#toggle-all", function() {
  24. var value = $(this).prop("checked");
  25. $cm.find(".toggle").prop("checked", value);
  26. console.log("aaa", value);
  27. });
  28. $(".channel-remove").click(function() {
  29. var $this = $(this);
  30. $("#remove-channel-form").attr("action", $this.data("url"));
  31. $(".remove-channel-name").text($this.data("name"));
  32. $('#remove-channel-modal').modal("show");
  33. return false;
  34. });
  35. });