|
From: <ma...@us...> - 2010-12-11 09:26:50
|
Revision: 193
http://openautomation.svn.sourceforge.net/openautomation/?rev=193&view=rev
Author: mayerch
Date: 2010-12-11 09:26:44 +0000 (Sat, 11 Dec 2010)
Log Message:
-----------
Fix bug that caused that only a single plugin could be loaded
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2010-12-10 21:33:36 UTC (rev 192)
+++ CometVisu/trunk/visu/lib/templateengine.js 2010-12-11 09:26:44 UTC (rev 193)
@@ -195,8 +195,6 @@
setup_page(xml);
}
}
- return false;
-
} );
// then the mappings
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <ma...@us...> - 2011-02-27 17:39:56
|
Revision: 308
http://openautomation.svn.sourceforge.net/openautomation/?rev=308&view=rev
Author: mayerch
Date: 2011-02-27 17:39:50 +0000 (Sun, 27 Feb 2011)
Log Message:
-----------
New Feature: The CometVisu can be called with an additional parameter in the URL. If "startpage" is set to a valid page ID, this subpage will immediately show up
Hint: The page ID can easily be figured out when you move the mouse over the page link and look where this link will lead to as it has the form "javascript:scrollToPage('<page ID>')"
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2011-02-27 17:17:00 UTC (rev 307)
+++ CometVisu/trunk/visu/lib/templateengine.js 2011-02-27 17:39:50 UTC (rev 308)
@@ -243,6 +243,10 @@
// setup the scrollable
main_scroll = $('#main').scrollable({keyboard: false, touch: false}).data('scrollable');
main_scroll.onSeek( updateTopNavigation );
+
+ if ($.getUrlVar('startpage')) {
+ scrollToPage( $.getUrlVar('startpage'), 0 );
+ }
$('.fast').bind('click', function(){
main_scroll.seekTo( $(this).text() );
@@ -292,10 +296,10 @@
return retval;
}
-function scrollToPage( page_id )
+function scrollToPage( page_id, speed )
{
$('#'+page_id).css( 'display', '' ); // show new page
- main_scroll.seekTo( $('.page').index( $('#'+page_id)[0] ) ); // scroll to it
+ main_scroll.seekTo( $('.page').index( $('#'+page_id)[0] ), speed ); // scroll to it
}
function updateTopNavigation()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <da...@us...> - 2011-06-08 20:57:14
|
Revision: 359
http://openautomation.svn.sourceforge.net/openautomation/?rev=359&view=rev
Author: daviid5
Date: 2011-06-08 20:57:06 +0000 (Wed, 08 Jun 2011)
Log Message:
-----------
fixed scroll problem with ipad
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2011-06-05 18:55:13 UTC (rev 358)
+++ CometVisu/trunk/visu/lib/templateengine.js 2011-06-08 20:57:06 UTC (rev 359)
@@ -126,8 +126,7 @@
{
var uagent = navigator.userAgent.toLowerCase();
- if (/(android|blackberry|iphone|ipod|series60|symbian|windows ce|palm)/i.test(uagent)) {
- var width = $( window ).width();
+if (/(android|blackberry|iphone|ipod|ipad|series60|symbian|windows ce|palm)/i.test(uagent)) { var width = $( window ).width();
$( '#main' ).css( 'width', width );
$( 'head' ).append( '<style type="text/css">.page{width:' + (width-0) + 'px;}</style>' );
// do nothing
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-08-11 17:36:50
|
Revision: 402
http://openautomation.svn.sourceforge.net/openautomation/?rev=402&view=rev
Author: makki1
Date: 2011-08-11 17:36:44 +0000 (Thu, 11 Aug 2011)
Log Message:
-----------
revert relative path to cgi-bin
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2011-08-10 19:46:59 UTC (rev 401)
+++ CometVisu/trunk/visu/lib/templateengine.js 2011-08-11 17:36:44 UTC (rev 402)
@@ -25,7 +25,7 @@
var main_scroll;
var old_scroll = '';
-visu = new CometVisu('../cgi-bin/');//{};
+visu = new CometVisu('/cgi-bin/');//{};
visu.update = function( json ) // overload the handler
{
for( key in json )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2011-10-26 18:28:47
|
Revision: 476
http://openautomation.svn.sourceforge.net/openautomation/?rev=476&view=rev
Author: j-n-k
Date: 2011-10-26 18:28:41 +0000 (Wed, 26 Oct 2011)
Log Message:
-----------
Fixing bug #3424149
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2011-10-26 17:03:47 UTC (rev 475)
+++ CometVisu/trunk/visu/lib/templateengine.js 2011-10-26 18:28:41 UTC (rev 476)
@@ -106,16 +106,19 @@
function transformEncode( transformation, value )
{
+ var basetrans = transformation.split('.')[0];
return transformation in Transform ?
- Transform[ transformation ].encode( value ) :
- value;
+ Transform[ transformation ].encode( value ) :
+ (basetrans in Transform ? Transform[ basetrans ].encode( value ) : value);
+
}
function transformDecode( transformation, value )
{
+ var basetrans = transformation.split('.')[0];
return transformation in Transform ?
- Transform[ transformation ].decode( value ) :
- value;
+ Transform[ transformation ].decode( value ) :
+ basetrans in Transform ? Transform[ basetrans ].decode( value ) : value);
}
function map( value, element )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2011-10-26 19:24:26
|
Revision: 478
http://openautomation.svn.sourceforge.net/openautomation/?rev=478&view=rev
Author: j-n-k
Date: 2011-10-26 19:24:20 +0000 (Wed, 26 Oct 2011)
Log Message:
-----------
added missing open bracket
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2011-10-26 19:13:48 UTC (rev 477)
+++ CometVisu/trunk/visu/lib/templateengine.js 2011-10-26 19:24:20 UTC (rev 478)
@@ -118,7 +118,7 @@
var basetrans = transformation.split('.')[0];
return transformation in Transform ?
Transform[ transformation ].decode( value ) :
- basetrans in Transform ? Transform[ basetrans ].decode( value ) : value);
+ (basetrans in Transform ? Transform[ basetrans ].decode( value ) : value);
}
function map( value, element )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-31 11:13:29
|
Revision: 483
http://openautomation.svn.sourceforge.net/openautomation/?rev=483&view=rev
Author: mayerch
Date: 2011-10-31 11:13:23 +0000 (Mon, 31 Oct 2011)
Log Message:
-----------
Fix for Bug ID: 3370929 "Missing text in top line"
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2011-10-30 21:22:54 UTC (rev 482)
+++ CometVisu/trunk/visu/lib/templateengine.js 2011-10-31 11:13:23 UTC (rev 483)
@@ -282,6 +282,8 @@
if ($.getUrlVar('startpage')) {
scrollToPage( $.getUrlVar('startpage'), 0 );
+ } else {
+ scrollToPage( '0', 0 ); // simple solution to show page name on top at start
}
$('.fast').bind('click', function(){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2011-10-31 12:37:39
|
Revision: 484
http://openautomation.svn.sourceforge.net/openautomation/?rev=484&view=rev
Author: mayerch
Date: 2011-10-31 12:37:33 +0000 (Mon, 31 Oct 2011)
Log Message:
-----------
"Bug"-Fix for ID: 3204682 "Caching on web server"
This isn't a real fix for the problem as that's part of the web browser, but it helps to avoid the problems on the client, e.g. when the config file has changed but the browser doesn't even ask the server about it...
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2011-10-31 11:13:23 UTC (rev 483)
+++ CometVisu/trunk/visu/lib/templateengine.js 2011-10-31 12:37:33 UTC (rev 484)
@@ -64,6 +64,12 @@
forceReload = $.getUrlVar('forceReload') != 'false'; // true unless set to false
}
+// "Bug"-Fix for ID: 3204682 "Caching on web server"
+// This isn't a real fix for the problem as that's part of the web browser, but
+// it helps to avoid the problems on the client, e.g. when the config file
+// has changed but the browser doesn't even ask the server about it...
+forceReload = true;
+
// Disable features that aren't ready yet
// This can be overwritten in the URL with the parameter "maturity"
var use_maturity;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <han...@us...> - 2012-01-07 18:40:50
|
Revision: 638
http://openautomation.svn.sourceforge.net/openautomation/?rev=638&view=rev
Author: hannesloehr
Date: 2012-01-07 18:40:43 +0000 (Sat, 07 Jan 2012)
Log Message:
-----------
Added handling for browser back button => go one level higher in page hierarchy.
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-01-06 19:01:35 UTC (rev 637)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-01-07 18:40:43 UTC (rev 638)
@@ -292,6 +292,19 @@
main_scroll.seekTo( $(this).text() );
});
+
+ // reaction on browser back button
+ window.onpopstate = function(e) {
+
+ // where do we come frome?
+ lastpage = $.getUrlVar("lastpage");
+ if (lastpage) {
+ // browser back button takes us one level higher
+ scrollToPage(lastpage);
+ }
+ }
+
+
visu.subscribe( ga_list );
$("#pages").triggerHandler("done");
}
@@ -344,6 +357,40 @@
function scrollToPage( page_id, speed )
{
$('#'+page_id).css( 'display', '' ); // show new page
+
+
+ // build url string with new lastpage parameter
+ url_vars = $.getUrlVars();
+ parameters = [];
+
+ // filter old lastpage parameter
+ for (var i = 0; i < url_vars.length; i++) {
+ key = url_vars[i];
+ value = url_vars[key];
+ if (key != "lastpage"){
+ parameters.push(key+"="+value);
+ }
+ }
+
+ // which is the parent of target page_id?
+ // => set this id as lastpage in url for window.onpopstate handling
+ var path = page_id.split( '_' );
+ if (path.length > 1){
+ // above top level
+ // the next to last item of path is the parent id
+ path.pop();
+ parameters.push("lastpage="+path.pop());
+ }
+ else {
+ // top level
+ parameters.push("lastpage="+page_id);
+ }
+
+ // manipulate browser url
+ path = window.location.pathname+"?"+parameters.join("&");
+ window.history.pushState(page_id, page_id, path);
+
+
main_scroll.seekTo( $('.page').index( $('#'+page_id)[0] ), speed ); // scroll to it
var pagedivs=$('div', '#'+page_id);
for( var i = 0; i<pagedivs.length; i++) //check for inline diagrams & refresh
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <han...@us...> - 2012-01-07 22:43:21
|
Revision: 640
http://openautomation.svn.sourceforge.net/openautomation/?rev=640&view=rev
Author: hannesloehr
Date: 2012-01-07 22:43:15 +0000 (Sat, 07 Jan 2012)
Log Message:
-----------
Fixed bug when using deeper hierarchies; lastpage is now stored into body.data instead of url parameter.
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-01-07 22:32:24 UTC (rev 639)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-01-07 22:43:15 UTC (rev 640)
@@ -297,7 +297,7 @@
window.onpopstate = function(e) {
// where do we come frome?
- lastpage = $.getUrlVar("lastpage");
+ lastpage = $('body').data("lastpage")
if (lastpage) {
// browser back button takes us one level higher
scrollToPage(lastpage);
@@ -358,37 +358,23 @@
{
$('#'+page_id).css( 'display', '' ); // show new page
-
- // build url string with new lastpage parameter
- url_vars = $.getUrlVars();
- parameters = [];
-
- // filter old lastpage parameter
- for (var i = 0; i < url_vars.length; i++) {
- key = url_vars[i];
- value = url_vars[key];
- if (key != "lastpage"){
- parameters.push(key+"="+value);
- }
- }
-
// which is the parent of target page_id?
- // => set this id as lastpage in url for window.onpopstate handling
+ // => set this id as lastpage in url for window.onpopstate handling
var path = page_id.split( '_' );
if (path.length > 1){
// above top level
- // the next to last item of path is the parent id
+ // everything besides the last number is the parent id
path.pop();
- parameters.push("lastpage="+path.pop());
+ // store lastpage in body.data
+ $('body').data("lastpage", path.join("_"));
}
else {
// top level
- parameters.push("lastpage="+page_id);
+ $('body').data("lastpage", page_id);
}
- // manipulate browser url
- path = window.location.pathname+"?"+parameters.join("&");
- window.history.pushState(page_id, page_id, path);
+ // push new state to history
+ window.history.pushState(page_id, page_id, window.location.href);
main_scroll.seekTo( $('.page').index( $('#'+page_id)[0] ), speed ); // scroll to it
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-01-31 19:14:31
|
Revision: 674
http://openautomation.svn.sourceforge.net/openautomation/?rev=674&view=rev
Author: j-n-k
Date: 2012-01-31 19:14:25 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
Mssing second file for changeset 673
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-01-31 19:10:49 UTC (rev 673)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-01-31 19:14:25 UTC (rev 674)
@@ -295,8 +295,10 @@
// then the stylings
$( 'meta > stylings styling', xml ).each( function(i){
var name = $(this).attr('name');
+ var classnames = '';
stylings[ name ] = {};
$(this).find('entry').each( function(){
+ classnames += $(this).text() + ' ';
if( $(this).attr('value') )
{
stylings[ name ][ $(this).attr('value') ] = $(this).text();
@@ -304,8 +306,10 @@
if( ! stylings[ name ][ 'range' ] ) stylings[ name ][ 'range' ] = {};
stylings[ name ][ 'range' ][ parseFloat($(this).attr('range_min')) ] =
[ parseFloat( $(this).attr('range_max') ), $(this).text() ];
+
}
});
+ stylings[ name ]['classnames'] = classnames;
});
// then the status bar
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-06-01 21:53:54
|
Revision: 852
http://openautomation.svn.sourceforge.net/openautomation/?rev=852&view=rev
Author: mayerch
Date: 2012-06-01 21:53:48 +0000 (Fri, 01 Jun 2012)
Log Message:
-----------
Layout fix for Firefox
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-06-01 17:14:34 UTC (rev 851)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-06-01 21:53:48 UTC (rev 852)
@@ -136,7 +136,7 @@
var uagent = navigator.userAgent.toLowerCase();
var widthNavbarLeft = $( '#navbarLeft' ).width();
var widthNavbarRight = $( '#navbarRight' ).width();
- var width = $( 'body' ).width() - widthNavbarLeft - widthNavbarRight;
+ var width = $( 'body' ).width() - widthNavbarLeft - widthNavbarRight - 1; // remove an additional pixel for Firefox
if (/(android|blackberry|iphone|ipod|series60|symbian|windows ce|palm)/i.test(uagent)) {
$( '#main' ).css( 'width', width );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2012-06-06 20:29:58
|
Revision: 862
http://openautomation.svn.sourceforge.net/openautomation/?rev=862&view=rev
Author: mayerch
Date: 2012-06-06 20:29:49 +0000 (Wed, 06 Jun 2012)
Log Message:
-----------
Better handling of invalid config files: show error message
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-06-06 11:09:51 UTC (rev 861)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-06-06 20:29:49 UTC (rev 862)
@@ -43,9 +43,9 @@
}
visu.user = 'demo_user'; // example for setting a user
-var configSuffix = "";
+var configSuffix;
if ($.getUrlVar("config")) {
- configSuffix = "_" + $.getUrlVar("config");
+ configSuffix = $.getUrlVar("config");
}
var clientDesign = "";
@@ -83,8 +83,21 @@
$(document).ready(function() {
// get the data once the page was loaded
- $.ajaxSetup({cache: !forceReload});
- $.get( 'visu_config' + configSuffix + '.xml', parseXML );
+ $.ajax({
+ url: 'visu_config' + (configSuffix ? '_' + configSuffix : '' ) + '.xml',
+ cache: !forceReload,
+ success: parseXML,
+ error: function(jqXHR, textStatus, errorThrown){
+ var message = 'Config-File Error! ';
+ switch( textStatus )
+ {
+ case 'parsererror':
+ message += '<br />Invalid config file!<br /><a href="check_config.php?config=' + configSuffix + '">Please check!</a>';
+ }
+ $('#loading').html( message );
+ },
+ dataType: 'xml'
+});
} );
$(window).unload(function() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-07-08 14:53:04
|
Revision: 914
http://openautomation.svn.sourceforge.net/openautomation/?rev=914&view=rev
Author: j-n-k
Date: 2012-07-08 14:52:57 +0000 (Sun, 08 Jul 2012)
Log Message:
-----------
Fixed regression with diagram-labels in diagram_inline widget
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-07-06 16:35:42 UTC (rev 913)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-07-08 14:52:57 UTC (rev 914)
@@ -568,7 +568,7 @@
main_scroll.seekTo( $('#'+page_id), speed ); // scroll to it
var pagedivs=$('div', '#'+page_id);
for( var i = 0; i<pagedivs.length; i++) { //check for inline diagrams & refresh
- if( pagedivs[i].className == 'diagram_inline') {
+ if( /diagram_inline/.test(pagedivs[i].className)) {
refreshDiagram(pagedivs[i]);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2012-08-01 20:28:03
|
Revision: 923
http://openautomation.svn.sourceforge.net/openautomation/?rev=923&view=rev
Author: vlamers
Date: 2012-08-01 20:27:57 +0000 (Wed, 01 Aug 2012)
Log Message:
-----------
changed var text to fit IE9 too
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-07-27 07:40:24 UTC (rev 922)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-08-01 20:27:57 UTC (rev 923)
@@ -313,7 +313,7 @@
var editMode = 'edit_config.html' == sPage;
if( editMode && '!edit' == condition ) return;
if( !editMode && 'edit' == condition ) return;
- var text = this.textContent;
+ var text = $(this).text();
switch( extend )
{
case 'all': // append all parameters
@@ -323,6 +323,11 @@
case 'config': // append config file info
var search = window.location.search.replace( /\$/g, '$$$$' );
search = search.replace( /.*(config=[^&]*).*|.*/, '?$1' );
+
+
+// text = $(text).replaceWith( /(href="[^"]*)(")/g, '$1' + search + '$2' );
+
+
text = text.replace( /(href="[^"]*)(")/g, '$1' + search + '$2' );
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <j-...@us...> - 2012-08-10 17:11:26
|
Revision: 932
http://openautomation.svn.sourceforge.net/openautomation/?rev=932&view=rev
Author: j-n-k
Date: 2012-08-10 17:11:20 +0000 (Fri, 10 Aug 2012)
Log Message:
-----------
Fixed bug 3555836 (invalid id) and 3434083 (wrong top navigation)
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-08-09 19:59:24 UTC (rev 931)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-08-10 17:11:20 UTC (rev 932)
@@ -344,7 +344,7 @@
// and now setup the pages
var page = $( 'pages > page', xml )[0]; // only one page element allowed...
- create_pages(page, '0');
+ create_pages(page, 'id_0');
// all containers
if (!/(android|blackberry|iphone|ipod|series60|symbian|windows ce|palm)/i.test(navigator.userAgent.toLowerCase())) {
@@ -371,9 +371,9 @@
main_scroll.onSeek( updateTopNavigation );
if ($.getUrlVar('startpage')) {
- scrollToPage( $.getUrlVar('startpage'), 0 );
+ scrollToPage( 'id_'+$.getUrlVar('startpage'), 0 );
} else {
- scrollToPage( '0', 0 ); // simple solution to show page name on top at start
+ scrollToPage( 'id_0', 0 ); // simple solution to show page name on top at start
}
$('.fast').bind('click', function(){
@@ -603,13 +603,16 @@
function updateTopNavigation() {
var path = $('#main .page').eq( this.getIndex() ).attr('id').split( '_' );
- var id = ''; //path[0];
+ var id = 'id_'; //path[0];
var nav = '';
- for( var i = 0; i < path.length; i++ ) {
+ for( var i = 1; i < path.length; i++ ) { // element 0 is id_ (JNK)
id += path[i];
- nav += (0==i ? '' : '<span> ► </span>')
+ if ($('#'+id).hasClass("page")) {
+
+ nav += ((1==i) ? '' : '<span> ► </span>')
+ '<a href="javascript:scrollToPage(\'' +id+ '\')">'
- + $('#' + id + ' h1').text() + '</a>';
+ + $('#' + id + ' h1').text() + '</a>';
+ }
id += '_';
}
$('.nav_path').html( nav );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pe...@us...> - 2012-08-10 17:46:40
|
Revision: 933
http://openautomation.svn.sourceforge.net/openautomation/?rev=933&view=rev
Author: peuter
Date: 2012-08-10 17:46:32 +0000 (Fri, 10 Aug 2012)
Log Message:
-----------
fix to make the pagejumps work with the new page IDs (committed in Rev 932)
Revision Links:
--------------
http://openautomation.svn.sourceforge.net/openautomation/?rev=932&view=rev
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-08-10 17:11:20 UTC (rev 932)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-08-10 17:46:32 UTC (rev 933)
@@ -550,7 +550,7 @@
function scrollToPage( page_id, speed ) {
$('.activePage').removeClass('activePage');
$('.pagejump.active').removeClass('active');
- if (page_id.match(/^[0-9_]+$/)==null) {
+ if (page_id.match(/^id_[0-9_]+$/)==null) {
// find Page-ID by name
$('.page h1').each(function(i) {
if ($(this).text()==page_id) {
@@ -589,7 +589,7 @@
// set pagejump for this page to active if it exists
$(".pagejump > .actor").each(function (i) {
var data = $(this).data();
- if (data.target.match(/^[0-9_]+$/)==null) {
+ if (data.target.match(/^id_[0-9_]+$/)==null) {
// get page id by name
if ($('#'+page_id+' h1').text()==data.target) {
$(this).parent().addClass("active");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pe...@us...> - 2012-08-12 16:33:17
|
Revision: 941
http://openautomation.svn.sourceforge.net/openautomation/?rev=941&view=rev
Author: peuter
Date: 2012-08-12 16:33:10 +0000 (Sun, 12 Aug 2012)
Log Message:
-----------
- fixed bug: pagejumps by name didn't work when there are pages with similar names
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-08-12 13:20:28 UTC (rev 940)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-08-12 16:33:10 UTC (rev 941)
@@ -553,7 +553,12 @@
$('.pagejump.active').removeClass('active');
if (page_id.match(/^id_[0-9_]+$/)==null) {
// find Page-ID by name
- page_id = $('.page h1:contains('+page_id+')').closest(".page").attr("id");
+ $('.page h1:contains('+page_id+')').each(function (i) {
+ if ($(this).text()==page_id) {
+ page_id = $(this).closest(".page").attr("id");
+ }
+ });
+
}
updatePageParts($('#'+page_id));
$('#'+page_id).addClass('pageActive activePage'); // show new page
@@ -586,9 +591,13 @@
$(".pagejump > .actor").each(function (i) {
if ($(this).data().target.match(/^id_[0-9_]+$/)==null) {
// get page id by name
- if ($('#'+page_id+' h1:contains('+$(this).data().target+')').size()>0) {
- $(this).parent().addClass("active");
- }
+ var actor = $(this);
+ var target = $(this).data().target;
+ $('#'+page_id+' h1:contains('+target+')').each(function(i) {
+ if ($(this).text()==target) {
+ actor.parent().addClass('active');
+ }
+ });
}
else if (page_id==$(this).data().target) {
$(this).parent().addClass("active");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pe...@us...> - 2012-08-12 19:03:59
|
Revision: 944
http://openautomation.svn.sourceforge.net/openautomation/?rev=944&view=rev
Author: peuter
Date: 2012-08-12 19:03:51 +0000 (Sun, 12 Aug 2012)
Log Message:
-----------
* removed tabs
* fixed code regression: navbars from subpages only visible on subpage
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-08-12 18:10:44 UTC (rev 943)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-08-12 19:03:51 UTC (rev 944)
@@ -552,13 +552,12 @@
$('.activePage').removeClass('activePage');
$('.pagejump.active').removeClass('active');
if (page_id.match(/^id_[0-9_]+$/)==null) {
- // find Page-ID by name
- $('.page h1:contains('+page_id+')').each(function (i) {
- if ($(this).text()==page_id) {
- page_id = $(this).closest(".page").attr("id");
- }
- });
-
+ // find Page-ID by name
+ $('.page h1:contains('+page_id+')').each(function (i) {
+ if ($(this).text()==page_id) {
+ page_id = $(this).closest(".page").attr("id");
+ }
+ });
}
updatePageParts($('#'+page_id));
$('#'+page_id).addClass('pageActive activePage'); // show new page
@@ -568,9 +567,9 @@
// => set this id as lastpage in url for window.onpopstate handling
var path = page_id.split( '_' );
if (path.length > 2) {
- var parentPage=getParentPage($('#'+page_id));
- if (parentPage!=null)
- $('body').data("lastpage", parentPage.attr("id"));
+ var parentPage=getParentPage($('#'+page_id));
+ if (parentPage!=null)
+ $('body').data("lastpage", parentPage.attr("id"));
}
else {
// top level
@@ -589,19 +588,19 @@
}
// set pagejump for this page to active if it exists
$(".pagejump > .actor").each(function (i) {
- if ($(this).data().target.match(/^id_[0-9_]+$/)==null) {
- // get page id by name
- var actor = $(this);
- var target = $(this).data().target;
- $('#'+page_id+' h1:contains('+target+')').each(function(i) {
- if ($(this).text()==target) {
- actor.parent().addClass('active');
- }
- });
- }
- else if (page_id==$(this).data().target) {
- $(this).parent().addClass("active");
- }
+ if ($(this).data().target.match(/^id_[0-9_]+$/)==null) {
+ // get page id by name
+ var actor = $(this);
+ var target = $(this).data().target;
+ $('#'+page_id+' h1:contains('+target+')').each(function(i) {
+ if ($(this).text()==target) {
+ actor.parent().addClass('active');
+ }
+ });
+ }
+ else if (page_id==$(this).data().target) {
+ $(this).parent().addClass("active");
+ }
});
$(window).trigger('scrolltopage',page_id);
}
@@ -755,104 +754,99 @@
* @param page
*/
function updatePageParts(page) {
- // default values
- var showtopnavigation=true;
- var showfooter=true;
- var shownavbar=true;
-
- if (page.data()!=null) {
- if (page.data().showtopnavigation!=undefined) {
- showtopnavigation = page.data().showtopnavigation!="false";
- }
- else {
- // traverse up the page tree
- var parentPage = getParentPage(page);
- while (parentPage!=null) {
- if (parentPage.data().showtopnavigation!=undefined) {
- showtopnavigation = parentPage.data().showtopnavigation!="false";
- break;
- }
- parentPage = getParentPage(parentPage);
- }
- }
- if (page.data().showfooter!=undefined) {
- showfooter = page.data().showfooter!="false";
- }
- else {
- // traverse up the page tree
- var parentPage = getParentPage(page);
- while (parentPage!=null) {
- if (parentPage.data().showfooter!=undefined) {
- showfooter = parentPage.data().showfooter!="false";
- break;
- }
- parentPage = getParentPage(parentPage);
- }
- }
- if (page.data().shownavbar!=undefined) {
- shownavbar = page.data().shownavbar!="false";
- }
- else {
- // traverse up the page tree
- var parentPage = getParentPage(page);
- while (parentPage!=null) {
- if (parentPage.data().shownavbar!=undefined) {
- shownavbar = parentPage.data().shownavbar!="false";
- break;
- }
- parentPage = getParentPage(parentPage);
- }
- }
- }
- if (showtopnavigation) {
- $('#top, #top > *').css("display","block");
- }
- else {
- $('#top, #top > *').css("display","none");
- }
- if (showfooter) {
- $('#bottom, #bottom > *').css("display","block");
- }
- else {
- $('#bottom, #bottom > *').css("display","none");
- }
- if (shownavbar) {
- $.each(['Left','Top','Right','Bottom'], function (index, value) {
- var size = $('#navbar'+value).data('size');
- var cssSize = size + (isFinite( size ) ? 'px' : '');
- $('#navbar'+value).css('width',cssSize);
- });
- // for some reason the handleResize() method has to be called here, without it the Navbar looks strange (has scrollbars even if they wouldn´t be neccessary)
- handleResize();
- $('.navbar').css("display","block");
- }
- else {
- // store the navbar sizes
- $.each(['Left','Top','Right','Bottom'], function (index, value) {
- if ($('#navbar'+value).data('size')==undefined) {
- $('#navbar'+value).data('size',$('#navbar'+value).css('width'));
- }
- $('#navbar'+value).css({
- 'display': 'none',
- 'width': 0
- });
- });
- $('.navbar').css("display","none");
- }
- handleResize();
+ // default values
+ var showtopnavigation=true;
+ var showfooter=true;
+ var shownavbar=true;
+
+ if (page.data()!=null) {
+ if (page.data().showtopnavigation!=undefined) {
+ showtopnavigation = page.data().showtopnavigation!="false";
+ }
+ else {
+ // traverse up the page tree
+ var parentPage = getParentPage(page);
+ while (parentPage!=null) {
+ if (parentPage.data().showtopnavigation!=undefined) {
+ showtopnavigation = parentPage.data().showtopnavigation!="false";
+ break;
+ }
+ parentPage = getParentPage(parentPage);
+ }
+ }
+ if (page.data().showfooter!=undefined) {
+ showfooter = page.data().showfooter!="false";
+ }
+ else {
+ // traverse up the page tree
+ var parentPage = getParentPage(page);
+ while (parentPage!=null) {
+ if (parentPage.data().showfooter!=undefined) {
+ showfooter = parentPage.data().showfooter!="false";
+ break;
+ }
+ parentPage = getParentPage(parentPage);
+ }
+ }
+ if (page.data().shownavbar!=undefined) {
+ shownavbar = page.data().shownavbar!="false";
+ }
+ else {
+ // traverse up the page tree
+ var parentPage = getParentPage(page);
+ while (parentPage!=null) {
+ if (parentPage.data().shownavbar!=undefined) {
+ shownavbar = parentPage.data().shownavbar!="false";
+ break;
+ }
+ parentPage = getParentPage(parentPage);
+ }
+ }
+ }
+ if (showtopnavigation) {
+ $('#top, #top > *').css("display","block");
+ }
+ else {
+ $('#top, #top > *').css("display","none");
+ }
+ if (showfooter) {
+ $('#bottom, #bottom > *').css("display","block");
+ }
+ else {
+ $('#bottom, #bottom > *').css("display","none");
+ }
+ if (shownavbar) {
+ $.each(['Left','Top','Right','Bottom'], function (index, value) {
+ var size = $('#navbar'+value).data('size');
+ var cssSize = size + (isFinite( size ) ? 'px' : '');
+ $('#navbar'+value).css('width',cssSize);
+ });
+ // for some reason the handleResize() method has to be called here, without it the Navbar looks strange (has scrollbars even if they wouldn´t be neccessary)
+ handleResize();
+ }
+ else {
+ // store the navbar sizes
+ $.each(['Left','Top','Right','Bottom'], function (index, value) {
+ if ($('#navbar'+value).data('size')==undefined) {
+ $('#navbar'+value).data('size',$('#navbar'+value).css('width'));
+ }
+ $('#navbar'+value).css('width', 0);
+ });
+ }
+ handleResize();
}
function getParentPage(page) {
- var pathParts = page.attr('id').split('_');
- if (pathParts.length==2) {
- // top-level (id_x)-> no parent pages
- return null;
- }
- while (pathParts.length>1) {
- pathParts.pop();
- var path = pathParts.join('_');
- if ($('.page[id="'+path+'"]').size()==1) {
- return $('.page[id="'+path+'"]');
- }
- }
-}
+ var pathParts = page.attr('id').split('_');
+ if (pathParts.length==2) {
+ // top-level (id_x)-> no parent pages
+ return null;
+ }
+ while (pathParts.length>1) {
+ pathParts.pop();
+ var path = pathParts.join('_');
+ if ($('.page[id="'+path+'"]').size()==1) {
+ return $('.page[id="'+path+'"]');
+ }
+ }
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pe...@us...> - 2012-08-12 19:39:36
|
Revision: 945
http://openautomation.svn.sourceforge.net/openautomation/?rev=945&view=rev
Author: peuter
Date: 2012-08-12 19:39:29 +0000 (Sun, 12 Aug 2012)
Log Message:
-----------
* fix for browser history usage and back button
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-08-12 19:03:51 UTC (rev 944)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-08-12 19:39:29 UTC (rev 945)
@@ -385,10 +385,10 @@
// reaction on browser back button
window.onpopstate = function(e) {
// where do we come frome?
- lastpage = $('body').data("lastpage")
+ lastpage = e.state;
if (lastpage) {
- // browser back button takes us one level higher
- scrollToPage(lastpage);
+ // browser back button takes back to the last page
+ scrollToPage(lastpage,0,true);
}
}
@@ -548,7 +548,7 @@
return retval;
}
-function scrollToPage( page_id, speed ) {
+function scrollToPage( page_id, speed, skipHistory ) {
$('.activePage').removeClass('activePage');
$('.pagejump.active').removeClass('active');
if (page_id.match(/^id_[0-9_]+$/)==null) {
@@ -563,21 +563,9 @@
$('#'+page_id).addClass('pageActive activePage'); // show new page
$('#'+page_id+'_navbar').addClass('navbarActive');
- // which is the parent of target page_id?
- // => set this id as lastpage in url for window.onpopstate handling
- var path = page_id.split( '_' );
- if (path.length > 2) {
- var parentPage=getParentPage($('#'+page_id));
- if (parentPage!=null)
- $('body').data("lastpage", parentPage.attr("id"));
- }
- else {
- // top level
- $('body').data("lastpage", page_id);
- }
-
// push new state to history
- window.history.pushState(page_id, page_id, window.location.href);
+ if (skipHistory==undefined)
+ window.history.pushState(page_id, page_id, window.location.href);
main_scroll.seekTo( $('#'+page_id), speed ); // scroll to it
var pagedivs=$('div', '#'+page_id);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pe...@us...> - 2012-08-15 18:57:58
|
Revision: 965
http://openautomation.svn.sourceforge.net/openautomation/?rev=965&view=rev
Author: peuter
Date: 2012-08-15 18:57:52 +0000 (Wed, 15 Aug 2012)
Log Message:
-----------
* removed debug code
* Fixed bug: sometimes the navbars from inactive subpages were not removed properly
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-08-15 16:01:23 UTC (rev 964)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-08-15 18:57:52 UTC (rev 965)
@@ -149,6 +149,7 @@
var uagent = navigator.userAgent.toLowerCase();
var widthNavbarLeft = $( '#navbarLeft' ).css('display')!='none' ? $( '#navbarLeft' ).width() : 0;
var widthNavbarRight = $( '#navbarRight' ).css('display')!='none' ? $( '#navbarRight' ).width() : 0;
+
var width = $( 'body' ).width() - widthNavbarLeft - widthNavbarRight - 1; // remove an additional pixel for Firefox
if (/(android|blackberry|iphone|ipod|series60|symbian|windows ce|palm)/i.test(uagent)) {
@@ -326,8 +327,8 @@
case 'config': // append config file info
var search = window.location.search.replace( /\$/g, '$$$$' );
search = search.replace( /.*(config=[^&]*).*|.*/, '?$1' );
-
+
// text = $(text).replaceWith( /(href="[^"]*)(")/g, '$1' + search + '$2' );
@@ -910,6 +911,7 @@
if (shownavbar[key]=="true") {
if ($('#navbar'+value).css("display")=="none") {
fadeNavbar(value,"in");
+ removeInactiveNavbars(page.attr('id'));
resize=true;
}
}
@@ -979,7 +981,6 @@
break;
}
navbar.css(initCss);
- console.log(targetCss);
navbar.animate(targetCss,main_scroll.getConf().time,main_scroll.getConf().easing,fn);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pe...@us...> - 2012-08-16 07:44:42
|
Revision: 967
http://openautomation.svn.sourceforge.net/openautomation/?rev=967&view=rev
Author: peuter
Date: 2012-08-16 07:44:36 +0000 (Thu, 16 Aug 2012)
Log Message:
-----------
* Fixed Bug: pageActive class gets removed from all pages that are not in the path from the current page up to the root page
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-08-16 07:35:03 UTC (rev 966)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-08-16 07:44:36 UTC (rev 967)
@@ -565,7 +565,7 @@
}
});
}
-
+
$('#'+page_id).addClass('pageActive activePage');// show new page
// update visibility ob navbars, top-navigation, footer
updatePageParts($('#'+page_id));
@@ -574,7 +574,7 @@
window.history.pushState(page_id, page_id, window.location.href);
main_scroll.seekTo( $('#'+page_id), speed ); // scroll to it
-
+
// show the navbars for this page
$('#'+page_id+'_top_navbar').addClass('navbarActive');
$('#'+page_id+'_right_navbar').addClass('navbarActive');
@@ -650,6 +650,15 @@
id += '_';
}
$('.nav_path').html( nav );
+ var page_id = path.join('_');
+ // remove unnecessary pageActive´s
+ $('.pageActive').each(function(i) {
+ var pagePath = $(this).attr('id');
+ var expr = new RegExp("^"+pagePath+".*","i");
+ if (pagePath!=page_id && !expr.test(page_id)) {
+ $(this).removeClass('pageActive');
+ }
+ });
}
/*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pe...@us...> - 2012-08-16 10:07:55
|
Revision: 968
http://openautomation.svn.sourceforge.net/openautomation/?rev=968&view=rev
Author: peuter
Date: 2012-08-16 10:07:48 +0000 (Thu, 16 Aug 2012)
Log Message:
-----------
* Fixed Bug: jumping to a sibling page on the left side (eg. from id_0_3 to id_0_1) is working now
* some performance tweaks like avoiding jQuery-Object where they are not necessary and usage of context in selectors
Modified Paths:
--------------
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-08-16 07:44:36 UTC (rev 967)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-08-16 10:07:48 UTC (rev 968)
@@ -559,7 +559,7 @@
if (page_id.match(/^id_[0-9_]+$/)==null) {
// find Page-ID by name
- $('.page h1:contains('+page_id+')').each(function (i) {
+ $('.page h1:contains('+page_id+')','#pages').each(function (i) {
if ($(this).text()==page_id) {
page_id = $(this).closest(".page").attr("id");
}
@@ -569,6 +569,14 @@
$('#'+page_id).addClass('pageActive activePage');// show new page
// update visibility ob navbars, top-navigation, footer
updatePageParts($('#'+page_id));
+ // remove unnecessary pageActive´s
+ $('.pageActive','#pages').each(function(i) {
+ var pagePath = this.id;
+ var expr = new RegExp("^"+pagePath+".*","i");
+ if (pagePath!=page_id && !expr.test(page_id)) {
+ $(this).removeClass('pageActive');
+ }
+ });
// push new state to history
if (skipHistory==undefined)
window.history.pushState(page_id, page_id, window.location.href);
@@ -594,7 +602,7 @@
// get page id by name
var actor = $(this);
var target = $(this).data().target;
- $('#'+page_id+' h1:contains('+target+')').each(function(i) {
+ $('h1:contains('+target+')','#'+page_id).each(function(i) {
if ($(this).text()==target) {
activePageJump = actor.parent();
return false;
@@ -617,7 +625,7 @@
// get page id by name
var actor = $(this);
var target = $(this).data().target;
- $('#'+parentPage.attr('id')+' h1:contains('+target+')').each(function(i) {
+ $('h1:contains('+target+')','#'+parentPage.attr('id')).each(function(i) {
if ($(this).text()==target) {
actor.parent().addClass('active_ancestor');
return false;
@@ -650,15 +658,6 @@
id += '_';
}
$('.nav_path').html( nav );
- var page_id = path.join('_');
- // remove unnecessary pageActive´s
- $('.pageActive').each(function(i) {
- var pagePath = $(this).attr('id');
- var expr = new RegExp("^"+pagePath+".*","i");
- if (pagePath!=page_id && !expr.test(page_id)) {
- $(this).removeClass('pageActive');
- }
- });
}
/*
@@ -996,7 +995,7 @@
function removeInactiveNavbars(page_id) {
// remove all navbars that do not belong to this page
$('.navbar.navbarActive').each(function(i) {
- var navBarPath = $(this).attr('id').split('_');
+ var navBarPath = this.id.split('_');
// skip last 2 elements e.g. '_top_navbar'
navBarPath = navBarPath.slice(0,navBarPath.length-2).join('_');
var expr = new RegExp("^"+navBarPath+".*","i");
@@ -1015,8 +1014,8 @@
while (pathParts.length>1) {
pathParts.pop();
var path = pathParts.join('_');
- if ($('.page[id="'+path+'"]').size()==1) {
- return $('.page[id="'+path+'"]');
+ if ($('#'+path).hasClass("page")) {
+ return $('#'+path);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|