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.3 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. });
  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. $('[data-toggle="tooltip"]').tooltip();
  36. });