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
|
|
|
$.rails.refreshCSRFTokens(); |
19
|
|
|
}) |
20
|
|
|
|
21
|
|
|
document.addEventListener("turbolinks:before-cache", function() { |
22
|
|
|
$(".alert").remove() |
23
|
|
|
}) |
24
|
|
|
|
25
|
|
|
// Gets the localized string |
26
|
|
|
function getLocalizedString(key) { |
27
|
|
|
var keyArr = key.split(".") |
28
|
|
|
var translated = I18n |
|
|
|
|
29
|
|
|
|
30
|
|
|
// Search current language for the key |
31
|
|
|
keyArr.forEach(function(k) { |
32
|
|
|
translated = translated[k] |
33
|
|
|
}) |
34
|
|
|
|
35
|
|
|
// If key is not found, search the fallback language for the key |
36
|
|
|
if (translated == undefined) { |
|
|
|
|
37
|
|
|
translated = I18nFallback |
|
|
|
|
38
|
|
|
|
39
|
|
|
keyArr.forEach(function(k) { |
40
|
|
|
translated = translated[k] |
41
|
|
|
}) |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
return translated |
45
|
|
|
} |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.