|
From: <han...@us...> - 2012-01-06 00:17:50
|
Revision: 636
http://openautomation.svn.sourceforge.net/openautomation/?rev=636&view=rev
Author: hannesloehr
Date: 2012-01-06 00:17:44 +0000 (Fri, 06 Jan 2012)
Log Message:
-----------
Design will be read from the url, then from the config file; otherwise the selection dialog will be shown.
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-01-05 23:16:13 UTC (rev 635)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-01-06 00:17:44 UTC (rev 636)
@@ -41,9 +41,6 @@
}
var clientDesign = "";
-if ($.getUrlVar("design")) {
- clientDesign = $.getUrlVar("design");
-}
if (typeof forceReload == "undefined") {
var forceReload = false;
@@ -77,14 +74,9 @@
$(document).ready(function() {
- // only load the config and stuff if a design was specified
- if (clientDesign != "") {
- // get the data once the page was loaded
- $.ajaxSetup({cache: !forceReload});
- window.setTimeout("$.get( 'visu_config" + configSuffix + ".xml', parseXML );", 200);
- } else {
- selectDesign();
- }
+ // get the data once the page was loaded
+ $.ajaxSetup({cache: !forceReload});
+ window.setTimeout("$.get( 'visu_config" + configSuffix + ".xml', parseXML );", 200);
} );
@@ -155,9 +147,32 @@
// erst mal den Cache für AJAX-Requests wieder aktivieren
$.ajaxSetup({cache: true});
+
+ /* First, we try to get a design by url
+ * Secondly, we try to get a predefined design in the config file
+ * Otherwise we show the design selection dialog
+ */
+
+ // read predefined design in config
+ predefinedDesign = $( 'pages', xml ).attr("design");
+
+ // design by url
+ if ($.getUrlVar("design")) {
+ clientDesign = $.getUrlVar("design");
+ }
+ // design by config file
+ else if (predefinedDesign){
+ clientDesign = predefinedDesign;
+ }
+ // selection dialog
+ else {
+ selectDesign();
+ }
+
+
$( 'head' ).append( '<link rel="stylesheet" type="text/css" href="designs/' + clientDesign + '/basic.css" />' );
$( 'head' ).append( '<link rel="stylesheet" type="text/css" href="designs/' + clientDesign + '/mobile.css" media="only screen and (max-device-width: 480px)" />' );
-
+
// start with the plugins
var pluginsToLoad = 0;
$( 'meta > plugins plugin', xml ).each( function(i){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|