+ // Initialize the control panel
+ $("body").append($(SWS.Templates.controlPanel));
+ // Fill the theme switcher
+ $("link.sws-theme").each (function (i) {
+ var e = $(this);
+ var opt = "<option value='";
+ opt += e.attr("title");
+ opt += "' ";
+ if (e.attr("rel") == "stylesheet") {
+ opt+= "selected='selected'";
+ };
+ opt += ">" + e.attr("title") + "</option>";
+ $("#sws-theme-select").append($(opt));
+ });
+ // Set the fullscreen icon
+ if (SWS.Fullscreen.status()) {
+ $("a#sws-control-panel-fullscreen")
+ .html(_fullscreen_icon_on);
+ } else {
+ $("a#sws-control-panel-fullscreen")
+ .html(_fullscreen_icon_off);
+ };
+ // Put the navigation range at the correct position
+ var nav = $('#sws-control-panel-navigation-bar');
+ nav.attr("min", SWS.Presentation.firstSlide() + 1);
+ nav.attr("max", SWS.Presentation.lastSlide() + 1);
+ $('#sws-control-panel-total-slides').text('/' + SWS.Presentation.getNumSlides());
+ _update_ui();
+
+ _slide_callbacks = null; /* avoid a leak */
+ var passed_theme = SWS.Utils.getParameterByName("theme");
+ //workaround weird chrome CSS loading bug
+ var f =
+ function () {
+ if (passed_theme == "")
+ self.changeTheme();
+ else
+ self.changeTheme(passed_theme);
+ if (SWS.Utils.getParameterByName("mode") == "print") {
+ self.printMode();
+ }
+ else
+ self.refresh();
+ $(document).keydown(self.inputHandler);
+
+ _initialized = true;
+ };
+ setTimeout(f, 100);