|
From: <ma...@us...> - 2010-12-28 20:10:50
|
Revision: 235
http://openautomation.svn.sourceforge.net/openautomation/?rev=235&view=rev
Author: mayerch
Date: 2010-12-28 20:10:44 +0000 (Tue, 28 Dec 2010)
Log Message:
-----------
New Feature: When the url contains the parameter "forceReload" set to true, it'll make sure that all scripts are reloaded and not cached
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-12-28 12:04:40 UTC (rev 234)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-12-28 20:10:44 UTC (rev 235)
@@ -57,9 +57,14 @@
configSuffix = "_" + $.getUrlVar("config");
}
+var forceReload = false;
+if( $.getUrlVar('forceReload') ) {
+ forceReload = $.getUrlVar('forceReload') != 'false'; // true unless set to false
+}
+
$(document).ready(function() {
// get the data once the page was loaded
- $.ajaxSetup({cache: false});
+ $.ajaxSetup({cache: !forceReload});
window.setTimeout("$.get( 'visu_config" + configSuffix + ".xml', parseXML );", 200);
// disable text selection - it's annoying on a touch screen!
@@ -131,12 +136,14 @@
// start with the plugins
var pluginsToLoad = 0;
$( 'meta > plugins plugin', xml ).each( function(i){
- pluginsToLoad += 1;
- var name = $(this).attr('name');
+ pluginsToLoad += 1;
+ var name = 'plugins/' + $(this).attr('name') + '/structure_plugin.js';
+ if( forceReload )
+ name += '?_=' + (new Date().getTime());
var html_doc = document.getElementsByTagName('body')[0];
js = document.createElement('script');
js.setAttribute('type', 'text/javascript');
- js.setAttribute('src', 'plugins/' + name + '/structure_plugin.js');
+ js.setAttribute('src' , name );
html_doc.appendChild(js);
js.onreadystatechange = function () {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|