private native static boolean isDebugMode()
/*-{
- var uri = $wnd.location;
- var re = /debug[^\/]*$/;
- return re.test(uri);
+ if($wnd.itmill.debug) {
+ var uri = $wnd.location;
+ var re = /debug[^\/]*$/;
+ return re.test(uri);
+ } else {
+ return false;
+ }
}-*/;
private native static boolean isQuietDebugMode()
}
if (html.length() != 0) {
- INotification n = new INotification(1000 * 60 * 45); //45min
+ INotification n = new INotification(1000 * 60 * 45); // 45min
n.addEventListener(new NotificationRedirect(url));
n.show(html, INotification.CENTERED_TOP,
INotification.STYLE_SYSTEM);
private String resourcePath = null;
- private String debugMode = "";
+ private boolean debugMode = false;
// Is this servlet application runner
boolean isApplicationRunnerServlet = false;
.getInitParameter(name));
}
- // Gets the debug window parameter
- final String debug = getApplicationOrSystemProperty(PARAMETER_DEBUG, "")
- .toLowerCase();
-
- // Enables application specific debug
- if (!"".equals(debug) && !"true".equals(debug)
- && !"false".equals(debug)) {
- throw new ServletException(
- "If debug parameter is given for an application, it must be 'true' or 'false'");
+ // check if application is in debug mode
+ if (getApplicationOrSystemProperty(PARAMETER_DEBUG, "false").equals(
+ "true")) {
+ debugMode = true;
}
- debugMode = debug;
// Gets Testing Tools parameters if feature is activated
if (getApplicationOrSystemProperty("testingToolsActive", "false")
+ "itmill.toolkitConfigurations = {};\n"
+ "itmill.themesLoaded = {}};\n");
+ if (isDebugMode()) {
+ page.write("itmill.debug = true;\n");
+ }
+
page.write("itmill.toolkitConfigurations[\"" + appId + "\"] = {");
page.write("appUri:'" + appUrl + "', ");
page.write("pathInfo: '" + pathInfo + "', ");
+ "if(!itmill) { var itmill = {}} \n"
+ "itmill.toolkitConfigurations = {};\n"
+ "itmill.themesLoaded = {};\n");
+ if (isDebugMode()) {
+ page.write("itmill.debug = true;\n");
+ }
page
.write("document.write('<iframe tabIndex=\"-1\" id=\"__gwt_historyFrame\" "
+ "style=\"width:0;height:0;border:0;overflow:"
return resourcePath + theme + "/" + resource.getResourceId();
}
- /**
- * Checks if web adapter is in debug mode. Extra output is generated to log
- * when debug mode is enabled.
- *
- * @param parameters
- * @return <code>true</code> if the web adapter is in debug mode. otherwise
- * <code>false</code>.
- */
- public boolean isDebugMode(Map parameters) {
- if (parameters != null) {
- final Object[] debug = (Object[]) parameters.get("debug");
- if (debug != null && !"false".equals(debug[0].toString())
- && !"false".equals(debugMode)) {
- return true;
- }
- }
- return "true".equals(debugMode);
- }
-
/**
* Implementation of ParameterHandler.ErrorEvent interface.
*/
}
+ /**
+ *
+ * @return true if debug mode parameter is defined as "true" in web.xml
+ */
+ public boolean isDebugMode() {
+ return debugMode;
+ }
+
}
\ No newline at end of file