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.

49 lines
1.2 KiB

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