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
|
|
|
// Handle changing of settings tabs. |
18
|
|
|
$(document).on('turbolinks:load', function(){ |
19
|
|
|
var controller = $("body").data('controller'); |
20
|
|
|
var action = $("body").data('action'); |
21
|
|
|
|
22
|
|
|
// Only run on the settings page. |
23
|
|
|
if ((controller == "users" && action == "edit") || (controller == "users" && action == "update")){ |
24
|
|
|
var settingsButtons = $('.setting-btn'); |
25
|
|
|
var settingsViews = $('.setting-view'); |
26
|
|
|
|
27
|
|
|
settingsButtons.each(function(i, btn) { |
28
|
|
|
if(!$(btn).hasClass("active")){ $(settingsViews[i]).hide(); } |
29
|
|
|
$(btn).click(function(){ |
30
|
|
|
$(btn).addClass("active"); |
31
|
|
|
settingsViews.each(function(i, view){ |
32
|
|
|
if($(view).attr("id") == $(btn).attr("id")){ |
33
|
|
|
$(view).show(); |
34
|
|
|
} else { |
35
|
|
|
$(settingsButtons[i]).removeClass("active"); |
36
|
|
|
$(view).hide(); |
37
|
|
|
} |
38
|
|
|
}); |
39
|
|
|
}); |
40
|
|
|
}); |
41
|
|
|
} |
42
|
|
|
}); |
43
|
|
|
|