parent
593e48e63e
commit
c9639d201c
|
@ -59,6 +59,13 @@ getValues = () ->
|
|||
console.log values
|
||||
values
|
||||
|
||||
# Gets a query string parametrer
|
||||
# We cannot use URLSearchParam because of IE (#2230)
|
||||
getQueryParam = (name) ->
|
||||
match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search)
|
||||
if match then decodeURIComponent(match[1].replace(/\+/g, ' ')) else null
|
||||
|
||||
|
||||
# Code from http://snipplr.com/view/29434/
|
||||
# ----------------------------------------
|
||||
setSelector = "#appslist"
|
||||
|
@ -315,14 +322,10 @@ $(window).on 'load', () ->
|
|||
# 1 - cookie value
|
||||
# 2 - first navigator.languages item that exists in window.availableLanguages
|
||||
# 3 - first value of window.availableLanguages
|
||||
queryString = window.location.search
|
||||
if queryString
|
||||
console.log 'Parsed queryString:', queryString
|
||||
urlParams = new URLSearchParams queryString
|
||||
if urlParams
|
||||
queryLang = urlParams.get('llnglanguage')
|
||||
if window.location.search
|
||||
queryLang = getQueryParam('llnglanguage')
|
||||
console.log 'Get lang from parameter' if queryLang
|
||||
setCookieLang = urlParams.get('setCookieLang')
|
||||
setCookieLang = getQueryParam('setCookieLang')
|
||||
console.log 'Set lang cookie' if setCookieLang == 1
|
||||
if !lang
|
||||
lang = getCookie 'llnglanguage'
|
||||
|
@ -405,4 +408,4 @@ $(window).on 'load', () ->
|
|||
$("#show-hide-icon-button").removeClass 'fa-eye-slash'
|
||||
$("#show-hide-icon-button").addClass 'fa-eye'
|
||||
|
||||
#$('#formpass').on 'submit', changePwd
|
||||
#$('#formpass').on 'submit', changePwd
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Generated by CoffeeScript 1.12.7
|
||||
// Generated by CoffeeScript 1.12.8
|
||||
|
||||
/*
|
||||
LemonLDAP::NG Portal jQuery scripts
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var datas, delKey, getCookie, getValues, isHiddenFormValueSet, ping, removeOidcConsent, restoreOrder, setCookie, setKey, setOrder, setSelector, translate, translatePage, translationFields,
|
||||
var datas, delKey, getCookie, getQueryParam, getValues, isHiddenFormValueSet, ping, removeOidcConsent, restoreOrder, setCookie, setKey, setOrder, setSelector, translate, translatePage, translationFields,
|
||||
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
|
||||
translationFields = {};
|
||||
|
@ -87,6 +87,16 @@ LemonLDAP::NG Portal jQuery scripts
|
|||
return values;
|
||||
};
|
||||
|
||||
getQueryParam = function(name) {
|
||||
var match;
|
||||
match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
|
||||
if (match) {
|
||||
return decodeURIComponent(match[1].replace(/\+/g, ' '));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
setSelector = "#appslist";
|
||||
|
||||
setOrder = function() {
|
||||
|
@ -223,7 +233,7 @@ LemonLDAP::NG Portal jQuery scripts
|
|||
datas = {};
|
||||
|
||||
$(window).on('load', function() {
|
||||
var action, al, authMenuIndex, authMenuTabs, back_url, hiddenParams, i, l, lang, langdiv, langs, langs2, len, len1, len2, len3, link, m, menuIndex, menuTabs, method, n, nl, nlangs, queryLang, queryString, re, ref, ref1, ref2, setCookieLang, urlParams;
|
||||
var action, al, authMenuIndex, authMenuTabs, back_url, hiddenParams, i, l, lang, langdiv, langs, langs2, len, len1, len2, len3, link, m, menuIndex, menuTabs, method, n, nl, nlangs, queryLang, re, ref, ref1, ref2, setCookieLang;
|
||||
datas = getValues();
|
||||
if ("datas" in window && "choicetab" in window.datas) {
|
||||
datas.choicetab = window.datas.choicetab;
|
||||
|
@ -300,17 +310,12 @@ LemonLDAP::NG Portal jQuery scripts
|
|||
}
|
||||
$("p.removeOther a").attr("href", link);
|
||||
}
|
||||
queryString = window.location.search;
|
||||
if (queryString) {
|
||||
console.log('Parsed queryString:', queryString);
|
||||
urlParams = new URLSearchParams(queryString);
|
||||
}
|
||||
if (urlParams) {
|
||||
queryLang = urlParams.get('llnglanguage');
|
||||
if (window.location.search) {
|
||||
queryLang = getQueryParam('llnglanguage');
|
||||
if (queryLang) {
|
||||
console.log('Get lang from parameter');
|
||||
}
|
||||
setCookieLang = urlParams.get('setCookieLang');
|
||||
setCookieLang = getQueryParam('setCookieLang');
|
||||
if (setCookieLang === 1) {
|
||||
console.log('Set lang cookie');
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user