Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 2617 → Rev 2649

/trunk/src/org/tela_botanica/client/cel2.java
2,10 → 2,13
 
import org.tela_botanica.client.i18n.Msg;
import org.tela_botanica.client.modeles.objets.Configuration;
import org.tela_botanica.client.util.Util;
 
import com.google.gwt.ajaxloader.client.AjaxLoader;
import com.google.gwt.ajaxloader.client.AjaxLoader.AjaxLoaderOptions;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window.Location;
import com.gwtext.client.core.Ext;
36,6 → 39,7
}
});
*/
// TODO: config devrait être un singleton
Configuration config = new Configuration();
// Si la langue est précisée dans l'url on la prend, sinon on prend celle par défaut
42,14 → 46,17
// @TODO: avertissement si la langue indiquée dans l'url n'est pas la bonne
String langueURL = Location.getParameter("lang");
if (! Msg.init()) {
cel2.LogVersFirebug("La langue par défaut \"" + Msg.getLangueDefaut() + "\" n'a pas pu être chargée");
Util.LogVersFirebug("La langue par défaut \"" + Msg.getLangueDefaut() + "\" n'a pas pu être chargée");
}
if (langueURL != null && ! langueURL.equals("")) {
cel2.LogVersFirebug("Langue passée dans l'URL: " + langueURL);
Util.LogVersFirebug("Langue passée dans l'URL: " + langueURL);
if (! Msg.setLangue(langueURL)) {
cel2.LogVersFirebug("La langue demandée \"" + langueURL + "\" n'a pas pu être chargée");
Util.LogVersFirebug("La langue demandée \"" + langueURL + "\" n'a pas pu être chargée");
}
}
Element elem = DOM.getElementById("texte_chargement");
elem.setInnerText(Msg.get("chargement"));
 
// Chargement de l'api google maps v3 avant l'initialisation pour
// éviter des "complications"
74,41 → 81,10
Timer t = new Timer() {
@Override
public void run() {
Ext.get("loading").hide();
Ext.get("loading").hide();
}
};
t.schedule(3000);
t.schedule(1500);
}
/*private String buildStackTrace(Throwable t, String log) {
if (t != null) {
log += t.getClass().toString();
log += t.getMessage();
//
StackTraceElement[] stackTrace = t.getStackTrace();
if (stackTrace != null) {
StringBuffer trace = new StringBuffer();
for (int i = 0; i < stackTrace.length; i++) {
trace.append(stackTrace[i].getClassName() + "." + stackTrace[i].getMethodName() + "("
+ stackTrace[i].getFileName() + ":" + stackTrace[i].getLineNumber());
}
log += trace.toString();
}
//
Throwable cause = t.getCause();
if (cause != null && cause != t) {
log += buildStackTrace(cause, "CausedBy:\n");
}
}
return log;
}*/
 
public static native void LogVersFirebug(Object o) /*-{
if (!!($wnd.console && $wnd.console.log)) {
console.log(o);
}
}-*/;
}