|
From: <j-...@us...> - 2012-01-25 17:16:25
|
Revision: 667
http://openautomation.svn.sourceforge.net/openautomation/?rev=667&view=rev
Author: j-n-k
Date: 2012-01-25 17:16:18 +0000 (Wed, 25 Jan 2012)
Log Message:
-----------
Changed colspan-calculation, CSS-Entries no longer needed,
added colspan-support fot jqclock-Plugin
Modified Paths:
--------------
CometVisu/trunk/visu/designs/alaska/basic.css
CometVisu/trunk/visu/designs/alaska_slim/basic.css
CometVisu/trunk/visu/designs/discreet/basic.css
CometVisu/trunk/visu/designs/discreet_sand/basic.css
CometVisu/trunk/visu/designs/discreet_slim/basic.css
CometVisu/trunk/visu/designs/pure/basic.css
CometVisu/trunk/visu/designs/structure_custom.js
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/designs/alaska/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/alaska/basic.css 2012-01-24 17:18:10 UTC (rev 666)
+++ CometVisu/trunk/visu/designs/alaska/basic.css 2012-01-25 17:16:18 UTC (rev 667)
@@ -92,10 +92,6 @@
float: left;
}
-.colspan2 {
- width:100%;
-}
-
.widget_container .widget_container {
width: 100%;
}
Modified: CometVisu/trunk/visu/designs/alaska_slim/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/alaska_slim/basic.css 2012-01-24 17:18:10 UTC (rev 666)
+++ CometVisu/trunk/visu/designs/alaska_slim/basic.css 2012-01-25 17:16:18 UTC (rev 667)
@@ -87,14 +87,6 @@
float: left;
}
-.colspan2 {
- width:66%;
-}
-
-.colspan3 {
- width:99%;
-}
-
.widget_container .widget_container {
width: 100%;
}
Modified: CometVisu/trunk/visu/designs/discreet/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/discreet/basic.css 2012-01-24 17:18:10 UTC (rev 666)
+++ CometVisu/trunk/visu/designs/discreet/basic.css 2012-01-25 17:16:18 UTC (rev 667)
@@ -86,10 +86,6 @@
float: left;
}
-.colspan2 {
- width:100%;
-}
-
.widget_container .widget_container {
width: 100%;
}
Modified: CometVisu/trunk/visu/designs/discreet_sand/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/discreet_sand/basic.css 2012-01-24 17:18:10 UTC (rev 666)
+++ CometVisu/trunk/visu/designs/discreet_sand/basic.css 2012-01-25 17:16:18 UTC (rev 667)
@@ -79,10 +79,6 @@
float: left;
}
-.colspan2 {
- width:100%;
-}
-
.widget_container .widget_container {
width: 100%;
}
Modified: CometVisu/trunk/visu/designs/discreet_slim/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/discreet_slim/basic.css 2012-01-24 17:18:10 UTC (rev 666)
+++ CometVisu/trunk/visu/designs/discreet_slim/basic.css 2012-01-25 17:16:18 UTC (rev 667)
@@ -79,14 +79,6 @@
float: left;
}
-.colspan2 {
- width:66%;
-}
-
-.colspan3 {
- width:99%;
-}
-
.widget_container .widget_container {
width: 100%;
}
Modified: CometVisu/trunk/visu/designs/pure/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/pure/basic.css 2012-01-24 17:18:10 UTC (rev 666)
+++ CometVisu/trunk/visu/designs/pure/basic.css 2012-01-25 17:16:18 UTC (rev 667)
@@ -67,10 +67,6 @@
float: left;
}
-.colspan2 {
- width:100%;
-}
-
.widget_container .widget_container {
width: 100%;
}
Modified: CometVisu/trunk/visu/designs/structure_custom.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_custom.js 2012-01-24 17:18:10 UTC (rev 666)
+++ CometVisu/trunk/visu/designs/structure_custom.js 2012-01-25 17:16:18 UTC (rev 667)
@@ -61,20 +61,19 @@
var designs = [ 'pure', 'discreet', 'discreet_sand', 'discreet_slim', 'alaska', 'alaska_slim' ];
var oldDesign = $('.value',this).text();
var newDesign = designs[ (designs.indexOf(oldDesign) + 1) % designs.length ];
- $('.value',this).text(newDesign);
- $('link[href*="designs"]').each(function(){
- this.href = this.href.replace( oldDesign, newDesign );
- });
-
- setTimeout(function() {
- $('style').each(function(style) {
- var txt = this.textContent;
- var idx = txt.search('rowspan');
- if (idx>0) {
- rowspanClass(parseInt(txt[idx+7]), this);
- }
- });
- }, 100);
+
+ var URL = window.location.href;
+ var regexp = new RegExp("design="+oldDesign)
+ if (URL.search(regexp) != -1) { // has URL-parameter design
+ window.location.href=URL.replace(regexp, "design="+newDesign);
+ } else {
+ if (URL.indexOf("?") != -1) { // has other parameters, append design
+ window.location.href=URL+"&design="+newDesign;
+ } else { // has now parameters
+ window.location.href=URL+"?design="+newDesign;
+ }
+ }
+
})
);
return ret_val;
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-01-24 17:18:10 UTC (rev 666)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-01-25 17:16:18 UTC (rev 667)
@@ -143,10 +143,10 @@
}
$( window ).bind( 'resize', handleResize );
-function rowspanClass(rowspan, elem) {
+function rowspanClass(rowspan) {
var className = 'rowspan'+ rowspan;
- if (( $('<div class="' + className + '" />').height() == 0 ) || elem ) {
+ if ( $('<div class="' + className + '" />').height() == 0 ) {
var dummyDiv = $('<div id="calcrowspan" ><div class="widget clearfix text" id="innerDiv" /></div>')
.appendTo(document.body).show();
@@ -169,20 +169,48 @@
// append css style
- if (elem) {
- $(elem).remove();
- }
-
$('head').append('<style>.rowspan' + rowspan + ' { height: ' + totalHeight + 'px; overflow:hidden;} </style>');
}
return className;
}
-function colspanClass(colspan, elem) {
- var className = 'colspan'+ colspan; // mostly dummy, has to be defined in design-CSS
+function colspanClass(colspan) {
+ var className = 'colspan'+ colspan;
+
+ if ( $('<div class="' + className + '" />').width() == 0 ) { // only if not defined
+ var singleWidth=0;
+
+ // loop over all stylesheets and classes and find .widget_container
+ $.each(document.styleSheets, function(idx, sheet) {
+ if (sheet.href ? (sheet.href.search(/basic.css/) > 0) : false) {
+ $.each(sheet.cssRules, function(idx, cssclass) {
+ if (cssclass.selectorText=='.widget_container') {
+ singleWidth = parseInt((cssclass.style.width).match(/[0-9]*/)[0]);
+ return;
+ }
+ });
+ }
+ if (singleWidth > 0) { // match already found
+ return;
+ }
+ });
+
+ var totalWidth = singleWidth * colspan;
+
+ if (totalWidth>100) { // check if totalWidth is <=100
+ alert('colspan="'+colspan+'" leads to width:' + totalWidth +
+ '% which is >100% and not allowed. Corrected to 100%');
+ totalWidth=100;
+ }
+
+ $('head').append('<style>.colspan' + colspan + ' { width: ' + totalWidth +
+ '%; overflow:hidden;} </style>');
+ }
+
return className;
}
+
function parseXML(xml) {
// erst mal den Cache für AJAX-Requests wieder aktivieren
$.ajaxSetup({cache: true});
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|