<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">\r
<head>\r
<title>IT Mill Toolkit 5 Demo: Reservr</title>\r
- <script type="text/javascript">\r
- var itmill = {\r
- appUri:'Reservr', pathInfo: '/'\r
- };\r
- </script>\r
<!-- \r
Google Maps needs an API key if you're not running this demo on "localhost". \r
\r
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA4q5gw_y_N1Anvvn1KqbLwRTHuC2ERVOT66iQW8-FqpCQQUlHqBTZ0rGKdlKh9fxQOKN87TCwVNlIXQ" type="text/javascript"></script> \r
-->\r
<script src="http://maps.google.com/maps?file=api&v=2" type="text/javascript"></script>\r
- <script language='javascript' src='ITMILL/widgetsets/com.itmill.toolkit.demo.reservation.gwt.ReservationWidgetSet/com.itmill.toolkit.demo.reservation.gwt.ReservationWidgetSet.nocache.js'></script>\r
- <link REL="stylesheet" TYPE="text/css" HREF="ITMILL/themes/reservr/styles.css">\r
</head>\r
<body>\r
<iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>\r
<span id="logo"> Reservr Inc</span>\r
<span id="arrow"> </span>\r
<span id="slogan">Representational cars on-the-road</span>\r
- </div>\r
+ </div>
+ <script type="text/javascript">
+ //<![CDATA[
+ if(!itmill || !itmill.toolkitConfigurations) {
+ if(!itmill) { var itmill = {}}
+ itmill.toolkitConfigurations = {};
+ itmill.themesLoaded = {};
+ document.write('<iframe id="__gwt_historyFrame" style="width:0;height:0;border:0;overflow:hidden" src="javascript:false"></iframe>');
+ document.write("<script language='javascript' src='/ITMILL/widgetsets/com.itmill.toolkit.demo.reservation.gwt.ReservationWidgetSet/com.itmill.toolkit.demo.reservation.gwt.ReservationWidgetSet.nocache.js'><\/script>");
+ }
+ itmill.toolkitConfigurations["itmill-ajax-window"] = {appUri:'/Reservr', pathInfo: '/', themeUri:'/ITMILL/themes/reservr'};
+ //]]>
+ </script>\r
<div id="itmill-ajax-window"></div> \r
</body>\r
</html>\r
this.widgetSet = widgetSet;
configuration = cnf;
+ if (cnf.getThemeUri() != null) {
+ injectCss(cnf.getThemeUri() + "/styles.css");
+ }
+
if (isDebugMode()) {
console = new DebugConsole(this);
} else {
applicationRunning = true;
}
+ /**
+ * Injects CSS to head element
+ *
+ * TODO since gwt 1.5 this can be made non-native
+ *
+ * @param css
+ */
+ private native static void injectCss(String cssUri)
+ /*-{
+
+ if(!$wnd.itmill.themesLoaded[cssUri]) {
+ var stylesheet = $doc.createElement('link');
+ stylesheet.setAttribute('rel', 'stylesheet');
+ stylesheet.setAttribute('type', 'text/css');
+ stylesheet.setAttribute('href', cssUri);
+ var h = $doc.getElementsByTagName("head")[0];
+ h.appendChild(stylesheet);
+ $wnd.itmill.themesLoaded[cssUri] = true;
+ }
+ }-*/;
+
/**
* Method to check if application is in testing mode. Can be used after
* application init.
}
page.write("};\n//]]>\n</script>\n");
- if (themeName != null) {
- // Custom theme's stylesheet, load only once, in different script
- // tag to be dominate styles injected by widget
- // set
- page.write("<script type=\"text/javascript\">\n");
- page.write("//<![CDATA[\n");
- page.write("if(!itmill.themesLoaded['" + themeName + "']) {\n");
- page.write("var stylesheet = document.createElement('link');\n");
- page.write("stylesheet.setAttribute('rel', 'stylesheet');\n");
- page.write("stylesheet.setAttribute('type', 'text/css');\n");
- page.write("stylesheet.setAttribute('href', '" + themeUri
- + "/styles.css');\n");
- page.write("document.body.appendChild(stylesheet);\n");
- page.write("itmill.themesLoaded['" + themeName + "'] = true;\n}\n");
- page.write("//]]>\n</script>\n");
- }
-
page.write("<div id=\"" + appId + "\" class=\"i-app\"></div>\n");
if (!fragment) {