Merge branch 'riadvice-2x-client-theme' into bbb-2x-mconf
This commit is contained in:
commit
902d57df22
2
bigbluebutton-client/src/org/bigbluebutton/core/Options.as
Normal file → Executable file
2
bigbluebutton-client/src/org/bigbluebutton/core/Options.as
Normal file → Executable file
@ -71,7 +71,7 @@ package org.bigbluebutton.core {
|
||||
logData.option = name;
|
||||
logData.tags = ["options", "config", "xml"];
|
||||
logData.message = "Parsing XML options";
|
||||
LOGGER.info(JSON.stringify(logData));
|
||||
//LOGGER.info(JSON.stringify(logData));
|
||||
for each (var att:XML in vxml.@*) {
|
||||
var property:String = att.name().localName;
|
||||
if (property != "name" && this.hasOwnProperty(property)) {
|
||||
|
@ -84,11 +84,11 @@ package org.bigbluebutton.core.managers {
|
||||
|
||||
if (xml.returncode == "FAILED") {
|
||||
|
||||
trace("Getting configXML failed [{0}]", [xml]);
|
||||
// trace("Getting configXML failed [{0}]", [xml]);
|
||||
|
||||
dispatcher.dispatchEvent(new MeetingNotFoundEvent(xml.response.logoutURL));
|
||||
} else {
|
||||
trace("Getting configXML passed [{0}]", [xml]);
|
||||
// trace("Getting configXML passed [{0}]", [xml]);
|
||||
_config = new Config(new XML(e.target.data));
|
||||
|
||||
trace("Initializing logging.");
|
||||
@ -110,4 +110,4 @@ package org.bigbluebutton.core.managers {
|
||||
return _config.getModuleFor(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
bigbluebutton-client/src/org/bigbluebutton/util/QueryStringParameters.as
Normal file → Executable file
2
bigbluebutton-client/src/org/bigbluebutton/util/QueryStringParameters.as
Normal file → Executable file
@ -49,7 +49,7 @@ package org.bigbluebutton.util
|
||||
|
||||
for (var i:int = 0; i < params.length; i++) {
|
||||
var tempA:Array = params[i].split("=");
|
||||
LOGGER.debug("{0} {1}", [String(tempA[0]).toUpperCase(), String(tempA[1]).toUpperCase()]);
|
||||
//LOGGER.debug("{0} {1}", [String(tempA[0]).toUpperCase(), String(tempA[1]).toUpperCase()]);
|
||||
|
||||
if (String(tempA[0]).toUpperCase() == key.toUpperCase()) {
|
||||
value = String(tempA[1])
|
||||
|
@ -57,7 +57,7 @@ package org.bigbluebutton.util.i18n
|
||||
|
||||
[Bindable] public var locales:Array = new Array();
|
||||
|
||||
private var eventDispatcher:IEventDispatcher;
|
||||
//private var eventDispatcher:IEventDispatcher;
|
||||
private var resourceManager:IResourceManager;
|
||||
private var preferredLocale:String
|
||||
private var masterLocaleLoaded:Boolean = false;
|
||||
@ -99,6 +99,7 @@ package org.bigbluebutton.util.i18n
|
||||
|
||||
preferredLocale = getDefaultLocale();
|
||||
if (preferredLocale != MASTER_LOCALE) {
|
||||
trace("Preferred locale=" + preferredLocale + " is not the same as master locale=" + MASTER_LOCALE);
|
||||
loadMasterLocale(MASTER_LOCALE);
|
||||
}
|
||||
setPreferredLocale(preferredLocale);
|
||||
@ -178,7 +179,8 @@ package org.bigbluebutton.util.i18n
|
||||
locales.sort(localesCompareFunction);
|
||||
}
|
||||
|
||||
private function loadMasterLocale(locale:String):void {
|
||||
private function loadMasterLocale(locale:String):void {
|
||||
trace("Loading master locale=" + locale);
|
||||
/**
|
||||
* http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/resources/IResourceManager.html#localeChain
|
||||
* Always load the default language, so if the chosen language
|
||||
@ -189,10 +191,10 @@ package org.bigbluebutton.util.i18n
|
||||
}
|
||||
|
||||
private function onMasterLocaleLoaded(event:ResourceEvent):void {
|
||||
LOGGER.debug("Master locale is loaded");
|
||||
trace("Master locale is loaded");
|
||||
masterLocaleLoaded = true;
|
||||
if (masterLocaleLoadedCallback != null) {
|
||||
LOGGER.debug("Calling callback to load a second language");
|
||||
trace("Calling callback to load a second language");
|
||||
masterLocaleLoadedCallback();
|
||||
}
|
||||
}
|
||||
@ -202,6 +204,7 @@ package org.bigbluebutton.util.i18n
|
||||
|
||||
var date:Date = new Date();
|
||||
var localeURI:String = buildRequestURL() + 'client/locale/' + language + '_resources.swf?a=' + date.time;
|
||||
trace("Loading locale " + localeURI);
|
||||
return resourceManager.loadResourceModule( localeURI, false);
|
||||
}
|
||||
|
||||
@ -213,17 +216,17 @@ package org.bigbluebutton.util.i18n
|
||||
}
|
||||
|
||||
private function changeLocaleHelper(locale:String):void {
|
||||
eventDispatcher = loadResource(locale);
|
||||
var eventDispatcher:IEventDispatcher = loadResource(locale);
|
||||
eventDispatcher.addEventListener(ResourceEvent.COMPLETE, localeChangeComplete);
|
||||
eventDispatcher.addEventListener(ResourceEvent.ERROR, handleResourceNotLoaded);
|
||||
}
|
||||
|
||||
public function changeLocale(locale:String):void {
|
||||
if (masterLocaleLoaded || locale == MASTER_LOCALE) {
|
||||
LOGGER.debug("Loading immediately " + locale);
|
||||
trace("Loading immediately " + locale);
|
||||
changeLocaleHelper(locale);
|
||||
} else {
|
||||
LOGGER.debug("Registering callback to load " + locale + " later");
|
||||
trace("Registering callback to load " + locale + " later");
|
||||
masterLocaleLoadedCallback = function():void {
|
||||
changeLocaleHelper(locale);
|
||||
}
|
||||
@ -239,17 +242,18 @@ package org.bigbluebutton.util.i18n
|
||||
var logData:Object = UsersUtil.initLogData();
|
||||
logData.tags = ["locale"];
|
||||
logData.message = "Failed to load locale = " + preferredLocale;
|
||||
LOGGER.info(JSON.stringify(logData));
|
||||
trace(JSON.stringify(logData));
|
||||
}
|
||||
masterLocaleLoaded = true;
|
||||
resourceManager.localeChain = [MASTER_LOCALE];
|
||||
preferredLocale = MASTER_LOCALE;
|
||||
}
|
||||
sendAppAndLocaleVersions();
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
private function sendAppAndLocaleVersions():void {
|
||||
trace("Sending locale version");
|
||||
var dispatcher:Dispatcher = new Dispatcher();
|
||||
var versionEvent:AppVersionEvent = new AppVersionEvent();
|
||||
versionEvent.configLocaleVersion = false;
|
||||
@ -261,15 +265,15 @@ package org.bigbluebutton.util.i18n
|
||||
* @param event
|
||||
*/
|
||||
private function handleResourceNotLoaded(event:ResourceEvent):void{
|
||||
LOGGER.debug("Resource locale [" + preferredLocale + "] could not be loaded.");
|
||||
resourceManager.localeChain = [MASTER_LOCALE];
|
||||
preferredLocale = MASTER_LOCALE;
|
||||
update();
|
||||
trace("Resource locale [" + preferredLocale + "] could not be loaded.");
|
||||
resourceManager.localeChain = [MASTER_LOCALE];
|
||||
preferredLocale = MASTER_LOCALE;
|
||||
update();
|
||||
}
|
||||
|
||||
public function update():void{
|
||||
reloadLocaleNames();
|
||||
|
||||
sendAppAndLocaleVersions();
|
||||
var dispatcher:Dispatcher = new Dispatcher;
|
||||
dispatcher.dispatchEvent(new LocaleChangeEvent(LocaleChangeEvent.LOCALE_CHANGED));
|
||||
dispatchEvent(new Event(Event.CHANGE));
|
||||
|
Loading…
Reference in New Issue
Block a user