Welcome to mirror list, hosted at ThFree Co, Russian Federation.

broadcast_message.js « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f330d1578cc031494ef11527bab224cb26b3fdfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Generated by CoffeeScript 1.10.0
(function() {
  $(function() {
    var previewPath;
    $('input#broadcast_message_color').on('input', function() {
      var previewColor;
      previewColor = $(this).val();
      return $('div.broadcast-message-preview').css('background-color', previewColor);
    });
    $('input#broadcast_message_font').on('input', function() {
      var previewColor;
      previewColor = $(this).val();
      return $('div.broadcast-message-preview').css('color', previewColor);
    });
    previewPath = $('textarea#broadcast_message_message').data('preview-path');
    return $('textarea#broadcast_message_message').on('input', function() {
      var message;
      message = $(this).val();
      if (message === '') {
        return $('.js-broadcast-message-preview').text("Your message here");
      } else {
        return $.ajax({
          url: previewPath,
          type: "POST",
          data: {
            broadcast_message: {
              message: message
            }
          }
        });
      }
    });
  });

}).call(this);