GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#518)
by
unknown
03:49
created

$(document).turbolinks:load   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
dl 0
loc 4
rs 10
eloc 3
nc 1
nop 3
1
// BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
2
//
3
// Copyright (c) 2018 BigBlueButton Inc. and by respective authors (see below).
4
//
5
// This program is free software; you can redistribute it and/or modify it under the
6
// terms of the GNU Lesser General Public License as published by the Free Software
7
// Foundation; either version 3.0 of the License, or (at your option) any later
8
// version.
9
//
10
// BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
11
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
// PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
13
//
14
// You should have received a copy of the GNU Lesser General Public License along
15
// with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
16
17
$(document).on('turbolinks:load', function(){
18
  var controller = $("body").data('controller');
19
  var action = $("body").data('action');
20
21
  // Only run on the admins page.
22
  if (controller == "admins" && action == "index") {
23
    // show the modal with the correct form action url
24
    $(".delete-user").click(function(data){
25
      var uid = $(data.target).closest("tr").data("user-uid")
26
      var url = $("body").data("relative-root")
27
      if (!url.endsWith("/")) {
28
        url += "/"
29
      }
30
      url += "u/" + uid
31
      $("#delete-confirm").parent().attr("action", url)
32
    })
33
34
    $('.colorinput').ColorPicker({
35
      onHide: function (colpkr) {
0 ignored issues
show
Unused Code introduced by
The parameter colpkr is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
36
        var colour = $("#user-colour").val();
37
38
        // Update the color in the database and reload the page
39
        $.post($("#coloring-path").val(), {color: colour}).done(function(data) {
0 ignored issues
show
Unused Code introduced by
The parameter data is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
40
          location.reload()
41
        });
42
      },
43
44
      onSubmit: function(hsb, hex, rgb, el) {
0 ignored issues
show
Unused Code introduced by
The parameter rgb is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter el is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
45
        $.post($("#coloring-path").val(), {color: '#' + hex}).done(function(data) {
0 ignored issues
show
Unused Code introduced by
The parameter data is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
46
          location.reload()
47
        });
48
      },
49
      
50
      onBeforeShow: function () {
51
        var colour = $("#user-colour").val();
52
53
        $(this).ColorPickerSetColor(colour);
54
      },
55
56
      onChange: function (hsb, hex, rgb) {
0 ignored issues
show
Unused Code introduced by
The parameter rgb is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
57
        $('.colorinput span').css('backgroundColor', '#' + hex);
58
        $("#user-colour").val('#' + hex);
59
      }
60
    });
61
62
    // Submit search if the user hits enter
63
    $("#search-input").keypress(function(key) {
64
      var keyPressed = key.which
65
      if (keyPressed == 13) {
66
        searchPage()
67
      }
68
    })
69
70
    // Add listeners for sort
71
    $("th[data-order]").click(function(data){
72
      var header_elem = $(data.target)
73
74
      if(header_elem.data('order') === 'asc'){ // asc
75
        header_elem.data('order', 'desc');
76
      }
77
      else if(header_elem.data('order') === 'desc'){ // desc
78
        header_elem.data('order', 'none');
79
      }
80
      else{ // none
81
        header_elem.data('order', 'asc');
82
      }
83
84
      var search = $("#search-input").val()
85
      window.location.replace(window.location.pathname + "?page=1&search=" + search + "&column=" + header_elem.data("header") + "&direction="+ header_elem.data('order'))
86
    })
87
  }
88
89
  // Only run on the admins edit user page.
90
  if (controller == "admins" && action == "edit_user") {
91
    $(".setting-btn").click(function(data){
92
      var url = $("body").data("relative-root")
93
      if (!url.endsWith("/")) {
94
        url += "/"
95
      }
96
97
      url += "admins?setting=" + data.target.id
98
      window.location.href = url
99
    })
100
  }
101
});
102
103
// Change the branding image to the image provided
104
function changeBrandingImage(path) {
105
  var url = $("#branding-url").val()
106
  $.post(path, {url: url})
107
}
108
109
// Searches the user table for the given string
110
function searchPage() {
111
  var search = $("#search-input").val()
112
113
  window.location.replace(window.location.pathname + "?page=1&search=" + search)
114
}
115
116
// Clears the search bar
117
function clearSearch() {
118
  window.location.replace(window.location.pathname + "?page=1")
119
}
120