mirror of
https://github.com/placeholder-soft/prodigyapi.git
synced 2026-05-16 16:10:32 +08:00
42 lines
1.3 KiB
JavaScript
42 lines
1.3 KiB
JavaScript
/*
|
|
Copyright 2008-2012 Concur Technologies, Inc.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
not use this file except in compliance with the License. You may obtain
|
|
a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
License for the specific language governing permissions and limitations
|
|
under the License.
|
|
*/
|
|
languages = []
|
|
function activateLanguage(language) {
|
|
$("#lang-selector a").removeClass('active');
|
|
$("#lang-selector a[data-language-name='" + language + "']").addClass('active');
|
|
for (var i=0; i < languages.length; i++) {
|
|
$(".highlight." + languages[i]).hide();
|
|
}
|
|
$(".highlight." + language).show();
|
|
}
|
|
|
|
function setupLanguages(l) {
|
|
languages = l;
|
|
currentLanguage = languages[0];
|
|
|
|
if (location.search.substr(1) != "") {
|
|
activateLanguage(location.search.substr(1));
|
|
} else {
|
|
activateLanguage(languages[0]);
|
|
}
|
|
|
|
$("#lang-selector a").bind("click", function() {
|
|
window.location.replace("?" + $(this).data("language-name") + window.location.hash);
|
|
return false;
|
|
});
|
|
|
|
}
|