|
From: <j-...@us...> - 2012-02-21 20:45:41
|
Revision: 712
http://openautomation.svn.sourceforge.net/openautomation/?rev=712&view=rev
Author: j-n-k
Date: 2012-02-21 20:45:34 +0000 (Tue, 21 Feb 2012)
Log Message:
-----------
Complete rework of colspan/rowspan-code, again
removed ".innerrowspanX", replaced with global ".innerrowspan"
removed ".widget_container .widget_container" (not needed anymore)
removed calculation of "colspanX", instead dynamic style-attributes
are added to all widgets
colspan/rowspan should now work correctly within groups
default-colspan is now given by a ".colspandefault" in basic.css,
the "width: X px;" makes a default widget-witdh of X/12th of screen-width
PLEASE: Test extensively, WFM in FF 10, Chrome 17, Safari 5.1.2 and on iOS 5.1
Modified Paths:
--------------
CometVisu/trunk/visu/designs/alaska/basic.css
CometVisu/trunk/visu/designs/alaska_slim/basic.css
CometVisu/trunk/visu/designs/designglobals.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/pitchblack/basic.css
CometVisu/trunk/visu/designs/pure/basic.css
CometVisu/trunk/visu/designs/structure_pure.js
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/designs/alaska/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/alaska/basic.css 2012-02-20 21:43:31 UTC (rev 711)
+++ CometVisu/trunk/visu/designs/alaska/basic.css 2012-02-21 20:45:34 UTC (rev 712)
@@ -87,18 +87,14 @@
text-decoration: none;
}
-.colspan0 { /* multiple of 8.33333% ! */
- width: 49.9998%;
+.colspandefault { /* in units of 1/12 screen width */
+ width: 6px;
}
.widget_container {
float: left;
}
-.widget_container .widget_container {
- width: 100%;
-}
-
.widget
{
margin: 0.2em;
Modified: CometVisu/trunk/visu/designs/alaska_slim/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/alaska_slim/basic.css 2012-02-20 21:43:31 UTC (rev 711)
+++ CometVisu/trunk/visu/designs/alaska_slim/basic.css 2012-02-21 20:45:34 UTC (rev 712)
@@ -82,18 +82,14 @@
text-decoration: none;
}
-.colspan0 { /* multiple of 8.33333% ! */
- width: 33.33332%;
+.colspandefault { /* in units of 1/12 screen width */
+ width: 4px;
}
.widget_container {
float: left;
}
-.widget_container .widget_container {
- width: 100%;
-}
-
.widget
{
margin: 0.2em;
Modified: CometVisu/trunk/visu/designs/designglobals.css
===================================================================
--- CometVisu/trunk/visu/designs/designglobals.css 2012-02-20 21:43:31 UTC (rev 711)
+++ CometVisu/trunk/visu/designs/designglobals.css 2012-02-21 20:45:34 UTC (rev 712)
@@ -7,54 +7,14 @@
* class, this class is the default widget size
*/
-.colspan1 {
- width: 8.33333%;
+.innerrowspan {
+ position:absolute;
+ top:0;
+ bottom:0;
+ left:0;
+ right:0;
}
-.colspan2 {
- width: 16.66666%;
-}
-
-.colspan3 {
- width: 24.99999%;
-}
-
-.colspan4 {
- width: 33.33332%;
-}
-
-.colspan5 {
- width: 41.66665%;
-}
-
-.colspan6 {
- width: 49.99998%;
-}
-
-.colspan7 {
- width: 58.33331%;
-}
-
-.colspan8 {
- width: 66.66664%;
-}
-
-.colspan9 {
- width: 74.99997%;
-}
-
-.colspan10 {
- width: 83.33330%;
-}
-
-.colspan11 {
- width: 91.66663%;
-}
-
-.colspan12 {
- width: 99.99996%;
-}
-
/*
* global color declarations for stylings in all designs
* may be overloaded by designs
Modified: CometVisu/trunk/visu/designs/discreet/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/discreet/basic.css 2012-02-20 21:43:31 UTC (rev 711)
+++ CometVisu/trunk/visu/designs/discreet/basic.css 2012-02-21 20:45:34 UTC (rev 712)
@@ -81,18 +81,14 @@
vertical-align: middle;
}
-.colspan0 { /* multiple of 8.33333% ! */
- width: 49.9998%;
+.colspandefault { /* in units of 1/12 screen width */
+ width: 6px;
}
.widget_container {
float: left;
}
-.widget_container .widget_container {
- width: 100%;
-}
-
.widget
{
margin: .2em;
Modified: CometVisu/trunk/visu/designs/discreet_sand/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/discreet_sand/basic.css 2012-02-20 21:43:31 UTC (rev 711)
+++ CometVisu/trunk/visu/designs/discreet_sand/basic.css 2012-02-21 20:45:34 UTC (rev 712)
@@ -74,18 +74,14 @@
vertical-align: middle;
}
-.colspan0 { /* multiple of 8.33333% ! */
- width: 49.9998%;
+.colspandefault { /* in units of 1/12 screen width */
+ width: 6px;
}
.widget_container {
float: left;
}
-.widget_container .widget_container {
- width: 100%;
-}
-
.widget
{
margin: .2em;
Modified: CometVisu/trunk/visu/designs/discreet_slim/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/discreet_slim/basic.css 2012-02-20 21:43:31 UTC (rev 711)
+++ CometVisu/trunk/visu/designs/discreet_slim/basic.css 2012-02-21 20:45:34 UTC (rev 712)
@@ -74,18 +74,14 @@
vertical-align: middle;
}
-.colspan0 { /* multiple of 8.33333% ! */
- width: 33.33332%;
+.colspandefault { /* in units of 1/12 screen width */
+ width: 4px;
}
.widget_container {
float: left;
}
-.widget_container .widget_container {
- width: 100%;
-}
-
.widget
{
margin: .1em;
Modified: CometVisu/trunk/visu/designs/pitchblack/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/pitchblack/basic.css 2012-02-20 21:43:31 UTC (rev 711)
+++ CometVisu/trunk/visu/designs/pitchblack/basic.css 2012-02-21 20:45:34 UTC (rev 712)
@@ -39,7 +39,7 @@
div#top , .widget, .popup_background {
border-color: /* border */ #202020;
border-style: solid;
- border-width: 0 0.05em 0.05em 0.05em;
+ border-width: 0 1px 1px 1px;
}
#pages hr, body hr {
@@ -64,10 +64,17 @@
margin: 0;
}
-div#top, .widget {
+div#top, .widget, .widget.group {
margin: .2em .1em 0 .1em;
}
+.widget.group .widget {
+ background: #0D0D0D;
+ border: none;
+ margin: 0;
+ padding:0;
+}
+
.nav_path , .widget .actor, .diagram_inline {
margin-left: .2em;
}
@@ -107,10 +114,18 @@
padding: 0.3em;
}
+.widget.group {
+ padding: 0.3em 0 0.3em 0;
+}
+
.text >div, .rsslog .label, .popup >div.head {
padding-left: 0.3em;
}
+.group .text>div, .group .rsslog .label {
+ padding-left: 0.6em;
+}
+
#diagramTooltip {
padding: 2px;
}
@@ -133,8 +148,8 @@
font-size:80%;
}
-.lighton > div, .lightoff > div, .jalup > div, .jaldown > div, /* image-buttons */
- .jalstop > div, .singlewindowopen > div, .singlewindowclosed > div, .doublewindowleftopen > div,
+.lighton > div, .lightoff > div, .jalup, .jaldown, /* image-buttons */
+ .jalstop, .singlewindowopen > div, .singlewindowclosed > div, .doublewindowleftopen > div,
.doublewindowrightopen >div, .doublewindowbothclosed >div, .doublewindowbothopen >div {
font-size:0%;
}
@@ -241,15 +256,15 @@
vertical-align: middle;
}
-.colspan0 { /* multiple of 8.33333% ! */
- width: 8.33333%;
+.widget_container {
}
-.widget_container {
+.colspan0 {
+ width: 8.33333%;
}
-.widget_container .widget_container, .link > div, .link a , .switchPressed,
- .switchUnpressed, * html>body .clearfix, .info > div, .actor .value , .text>div{
+.link > div, .link a , .switchPressed, .switchUnpressed, * html>body .clearfix,
+ .info > div, .actor .value , .text>div {
width: 100%;
}
@@ -291,21 +306,20 @@
position: relative;
}
- .ui-slider { position: relative; text-align: left; }
+.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: .4em; height: 1.2em; cursor: default; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
- .ui-slider-horizontal { height: .8em; }
+.ui-slider-horizontal { height: .8em; }
.ui-slider-horizontal .ui-slider-handle { top: -.40em; margin-left: -0.4em;}
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
- .ui-widget-content { border: 1px solid #707070; background: #000000 ; color: #000000; }
- .ui-widget-content a { color: #333333; }
- .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #000 ; font-weight: bold; color: #1c94c4; }
- .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
-
+.ui-widget-content { border: 1px solid #707070; background: #000000 ; color: #000000; }
+.ui-widget-content a { color: #333333; }
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #000 ; font-weight: bold; color: #1c94c4; }
+.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
.widget .ui-slider
{
@@ -408,3 +422,6 @@
background-color: #1d1d1d;
}
+.colspandefault {
+ width: 1px;
+}
Modified: CometVisu/trunk/visu/designs/pure/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/pure/basic.css 2012-02-20 21:43:31 UTC (rev 711)
+++ CometVisu/trunk/visu/designs/pure/basic.css 2012-02-21 20:45:34 UTC (rev 712)
@@ -67,12 +67,8 @@
float: left;
}
-/*.widget_container .widget_container {
- width: 100%;
-}*/
-
-.colspan0 { /* multiple of 8.33333% ! */
- width: 49.9998%;
+.colspandefault { /* in units of 1/12 screen width */
+ width: 6px;
}
.widget
Modified: CometVisu/trunk/visu/designs/structure_pure.js
===================================================================
--- CometVisu/trunk/visu/designs/structure_pure.js 2012-02-20 21:43:31 UTC (rev 711)
+++ CometVisu/trunk/visu/designs/structure_pure.js 2012-02-21 20:45:34 UTC (rev 712)
@@ -55,10 +55,10 @@
*/
$.fn.setWidgetLayout = function(page) {
- this.data('colspanClass', 'colspan'+(page.attr('colspan') || '0'));
+ this.data('colspan', page.attr('colspan') || $('head').data('colspanDefault'));
if (page.attr('rowspan')) {
this.data('rowspanClass', rowspanClass(page.attr('rowspan') || 1));
- this.addClass(innerRowspanClass(page.attr('rowspan') || 1));
+ this.addClass('innerrowspan');
}
return this;
}
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-02-20 21:43:31 UTC (rev 711)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-02-21 20:45:34 UTC (rev 712)
@@ -133,10 +133,11 @@
}
$( window ).bind( 'resize', handleResize );
+
function rowspanClass(rowspan) {
var className = 'rowspan'+ rowspan;
- if ( !$('head').data(className) ) {
+ if ( !$('#'+className+'Style').get(0) ) {
var dummyDiv = $('<div class="clearfix" id="calcrowspan"><div id="containerDiv" class="widget_container"><div class="widget clearfix text" id="innerDiv" /></div></div>')
.appendTo(document.body).show();
@@ -146,36 +147,12 @@
// append css style
- $('head').append('<style>.rowspan' + rowspan + ' { height: ' + rowspan*Math.round(singleHeight) + 'px; overflow:hidden;} </style>').data(className, 1);
+ $('head').append('<style id="'+className+'Style">.rowspan' + rowspan + ' { height: ' + rowspan*Math.round(singleHeight) + 'px; overflow:hidden; position:relative;} </style>').data(className, 1);
}
return className;
}
-function innerRowspanClass(rowspan) {
- var className = 'innerrowspan'+ rowspan;
-
- if ( !$('head').data(className)) {
- var dummyDiv = $('<div class="clearfix" id="calcinnerrowspan"><div id="containerDiv" class="widget_container"><div class="widget clearfix text" id="innerDiv" /></div></div>')
- .appendTo(document.body).show();
- $('#containerDiv').addClass(rowspanClass(rowspan));
-
- var outerHeight = parseFloat($('#containerDiv').css('height'));
- var innerDiv=$('#innerDiv');
- var margin=Math.round(parseFloat(innerDiv.css('marginTop')))+Math.round(parseFloat(innerDiv.css('marginBottom')));
- var padding=Math.round(parseFloat(innerDiv.css('paddingTop')))+Math.round(parseFloat(innerDiv.css('paddingBottom')));
- var border=Math.round(parseFloat(innerDiv.css('borderTopWidth')))+Math.round(parseFloat(innerDiv.css('borderBottomWidth')));
- var innerHeight=outerHeight-margin-padding-border;
- $('#calcinnerrowspan').remove();
-
- // append css style
- $('head').append('<style>.innerrowspan' + rowspan + ' { height: ' + innerHeight + 'px;} </style>').data(className, 1);
-
- }
-
- return className;
-}
-
function parseXML(xml) {
// erst mal den Cache für AJAX-Requests wieder aktivieren
$.ajaxSetup({cache: true});
@@ -313,8 +290,32 @@
// and now setup the pages
var page = $( 'pages > page', xml )[0]; // only one page element allowed...
+ $('head').append(($('<div class="colspandefault" id="colspandefault">')));
+ setTimeout(function() {
+ $('head').data('colspanDefault', parseInt($('#colspandefault').css('width')));
+ $('#colspandefault').remove();
+
create_pages(page, '0');
+ // all containers
+ if (!/(android|blackberry|iphone|ipod|series60|symbian|windows ce|palm)/i.test(navigator.userAgent.toLowerCase())) {
+ var allContainer = $('.widget_container');
+ allContainer.each(function(i, e) {
+ var ourColspan = $(e).children('*:first-child').data('colspan');
+ var ourWidth = ourColspan/12*100;
+ $(e).css('width', ourWidth+'%');
+ });
+
+ // and elements inside groups
+ var adjustableElements = $('.group .widget_container');
+ adjustableElements.each(function(i, e) {
+ var groupColspan = $(e).parentsUntil('.widget_container', '.group').data('colspan');
+ var ourColspan = $(e).children('.widget').data('colspan');
+ var ourWidth = ourColspan/groupColspan*100; // in percent
+ $(e).css('width', ourWidth+'%');
+ });
+ };
+
// setup the scrollable
main_scroll = $('#main').scrollable({keyboard: false, touch: false}).data('scrollable');
main_scroll.onSeek( updateTopNavigation );
@@ -342,6 +343,7 @@
visu.subscribe( ga_list );
$("#pages").triggerHandler("done");
+ }, 1);
}
function create_pages( page, path, flavour ) {
@@ -384,7 +386,6 @@
if (jQuery(retval).is(".widget") || (jQuery(retval).is(".group")) ) {
retval = jQuery("<div class='widget_container " +
- (retval.data("colspanClass") ? retval.data("colspanClass") : '') + " " +
(retval.data("rowspanClass") ? retval.data("rowspanClass") : '')+"' />")
.append(retval);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|