|
From: <pe...@us...> - 2012-08-11 15:49:32
|
Revision: 937
http://openautomation.svn.sourceforge.net/openautomation/?rev=937&view=rev
Author: peuter
Date: 2012-08-11 15:49:24 +0000 (Sat, 11 Aug 2012)
Log Message:
-----------
- some Javascript cleanup
- found a pure css-based solution to round the group corners, Javascript workaround removed, now the borders should work in every setup
- some minor design tweaks, e.g. widget borders, statusbar text color
Modified Paths:
--------------
CometVisu/trunk/visu/designs/metal/basic.css
CometVisu/trunk/visu/designs/metal/design_setup.js
CometVisu/trunk/visu/lib/templateengine.js
Modified: CometVisu/trunk/visu/designs/metal/basic.css
===================================================================
--- CometVisu/trunk/visu/designs/metal/basic.css 2012-08-10 22:48:28 UTC (rev 936)
+++ CometVisu/trunk/visu/designs/metal/basic.css 2012-08-11 15:49:24 UTC (rev 937)
@@ -79,7 +79,7 @@
.footer,
.footer *
{
- color: #000000;
+ color: #555;
font-size: 0.9em;
vertical-align: middle;
}
@@ -95,10 +95,9 @@
{
margin: 0;
padding: 0.3em;
- /* border:yellow 1px solid; */
- border-color: #020202;
+ border-color: #666;
border-style: solid;
- border-width: 0 1px 1px 0;
+ border-width: 1px 1px 0 0;
min-height: 2em;
text-shadow: 0 1px 1px #111;
@@ -164,13 +163,7 @@
/*white-space: pre-wrap;*/
}
.widget.group { padding: 0; }
-.group div.widget_container:first-child, .group div.widget_container:first-child .widget {
- border-top-left-radius: 1em;
-}
-.navbar .group div.widget_container:first-child, .navbar .group div.widget_container:first-child .widget {
- border-top-left-radius: 0;
- border-top-right-radius: 1em;
-}
+
iframe { border: none; }
.navbar .widget { border-width: 0 0 1px 0; }
@@ -282,8 +275,7 @@
margin: 0.2em 0.5em;
border: 2px solid #B3B3B3;
border-radius: 1em;
- /*padding-bottom: 1em;
- background: #eeeeee;*/
+ overflow: hidden;
}
.navbar .group {
margin: 0.2em 0 0.1em 0;
@@ -292,6 +284,16 @@
border-bottom-right-radius: 1em;
border-left: none;
}
+.navbar .group.root {
+ border-top-right-radius: 0;
+ border-bottom-left-radius: 1em;
+ margin-top: 0;
+ border-top: none;
+ border-left: 2px solid #B3B3B3;
+}
+.navbar > .widget_container:first-child .group .widget_container:last-child, .navbar > .widget_container:first-child .group div.widget_container:last-child .widget {
+ border: none;
+}
.group > div > h2 {
font-size: 0.8em;
padding: 0 1em;
@@ -322,9 +324,6 @@
background-image: -o-linear-gradient(#f0f0f0, #ddd); /* Opera 11.10+ */
background-image: linear-gradient(#f0f0f0, #ddd);
}
-.navbar .group .clearfix div.widget_container:last-child, .navbar .group .clearfix div.widget_container:last-child .widget {
- border-bottom-right-radius: 1em;
-}
.pagejump {
background: #333333;
background-image: -webkit-gradient(linear, left top, left bottom, from( #444444 /*{c-bar-background-start}*/), to( #2D2D2D /*{c-bar-background-end}*/)); /* Saf4+, Chrome */
Modified: CometVisu/trunk/visu/designs/metal/design_setup.js
===================================================================
--- CometVisu/trunk/visu/designs/metal/design_setup.js 2012-08-10 22:48:28 UTC (rev 936)
+++ CometVisu/trunk/visu/designs/metal/design_setup.js 2012-08-11 15:49:24 UTC (rev 937)
@@ -23,95 +23,28 @@
//$(".value < img").css("padding", "0");
$('#navbarLeft').data({'columns': 6} );
-var rootPageJumpChanged = false;
-
$(window).resize(function() {
if ($('.navbar').size()>0) {
// hide top navigation
if ($('#top').css('display')!='none') {
$('#top').css("display","none");
$('#top > .nav_path').css("display","none");
- // because the #top bar is missing now we have to repositition the elements in order to fit the new page height
+ // because the #top bar is missing now we have to reposition the elements in order to fit the new page height
handleResize();
}
- if (!rootPageJumpChanged) {
- $('.navbar > .widget_container:first-child .group .pagejump:first-child .actor').each(function(i) {
- var data = $(this).data();
- var target = data.target;
- if (target.match(/^id_[0-9_]+$/)==null) {
- // find Page-ID by name
- $('.page h1').each(function(i) {
- if ($(this).text()==target) {
- target = $(this).closest(".page").attr('id');
- return;
- }
- });
- }
- if (target=="id_0") {
- // pagejump to root-page found
- $(this).closest(".group").css({
- 'border-top-right-radius': 0,
- 'border-bottom-left-radius': '1em',
- 'margin-top': 0,
- 'border-top': 'none',
- 'border-left': '2px solid #B3B3B3'
- });
- $('.navbar > .widget_container:first-child .group .widget_container:last-child, .navbar > .widget_container:first-child .group div.widget_container:last-child .widget').css({
- 'border-bottom-left-radius': '1em',
- 'border': 'none'
- });
- }
- });
- rootPageJumpChanged=true;
- }
+ $('.navbar > .widget_container:first-child .group:not(.root) .pagejump:first-child .actor').each(function(i) {
+ var target = ($(this).data().target.match(/^id_[0-9_]+$/)==null) ? $('.page h1:contains('+$(this).data().target+')').closest(".page").attr("id") : $(this).data().target;
+ if (target=="id_0") {
+ // pagejump to root-page found
+ $(this).closest(".group").addClass("root");
+ }
+ });
}
+ if (/(iphone|ipod)/i.test(navigator.userAgent.toLowerCase())) {
+ $('#top').css('margin-top','1em');
+ }
});
-function getOffsetCorners(elem) {
- return {
- top_left: {top: Math.round(elem.offset().top), left: Math.round(elem.offset().left) },
- bottom_left: {top: Math.round(elem.offset().top+elem.height()), left: Math.round(elem.offset().left) },
- top_right: {top: Math.round(elem.offset().top), left: Math.round(elem.offset().left+elem.width()) },
- bottom_right: {top: Math.round(elem.offset().top+elem.height()), left: Math.round(elem.offset().left+elem.width()) },
- };
-}
-function roundCorners() {
- // find elements in each groups corners
- $('.group:visible').each(function(i){
- var group = $(this);
- // do not use this in navbars
- if (group.parents('.navbar').size()>0) return;
-
- var groupCorners = getOffsetCorners(group);
-
- // if the group has a headline (=name) we must not round the upper corners
- var roundUpperCorners = ($(this).find('.widget_container:first-child').size()>0);
- var threshold=5;
- $(this).find('.widget_container').each(function (i) {
- var elemCorners = getOffsetCorners($(this));
- if (roundUpperCorners) {
- // upper left corner is done by regular css-rule
- // upper right corner
- if (group.css('border-top-right-radius')!="0px" && Math.abs(elemCorners.top_right.top-groupCorners.top_right.top)<threshold && Math.abs(elemCorners.top_right.left-groupCorners.top_right.left)<threshold) {
- $(this).css({'border-top-right-radius': group.css('border-top-right-radius')});
- $(this).children().css({'border-top-right-radius': group.css('border-top-right-radius')});
- }
- }
- if (group.css('border-bottom-right-radius')!="0px" && Math.abs(elemCorners.bottom_right.top-groupCorners.bottom_right.top)<threshold && Math.abs(elemCorners.bottom_right.left-groupCorners.bottom_right.left)<threshold) {
- $(this).css({'border-bottom-right-radius': group.css('border-bottom-right-radius')});
- $(this).children().css({'border-bottom-right-radius': group.css('border-bottom-right-radius')});
- }
- if (group.css('border-bottom-left-radius')!="0px" && Math.abs(elemCorners.bottom_left.top-groupCorners.bottom_left.top)<threshold && Math.abs(elemCorners.bottom_left.left-groupCorners.bottom_left.left)<threshold) {
- $(this).css({'border-bottom-left-radius': group.css('border-bottom-left-radius')});
- $(this).children().css({'border-bottom-left-radius': group.css('border-bottom-left-radius')});
- }
- });
- });
-}
-$(window).bind('scrolltopage',function() {
- roundCorners();
-});
-
icons.insert({
'CometVisu' : { '*' : '128',
'16' : { '*' : 'sodium' ,
Modified: CometVisu/trunk/visu/lib/templateengine.js
===================================================================
--- CometVisu/trunk/visu/lib/templateengine.js 2012-08-10 22:48:28 UTC (rev 936)
+++ CometVisu/trunk/visu/lib/templateengine.js 2012-08-11 15:49:24 UTC (rev 937)
@@ -552,11 +552,7 @@
$('.pagejump.active').removeClass('active');
if (page_id.match(/^id_[0-9_]+$/)==null) {
// find Page-ID by name
- $('.page h1').each(function(i) {
- if ($(this).text()==page_id) {
- page_id = $(this).closest(".page").attr('id');
- }
- });
+ page_id = $('.page h1:contains('+page_id+')').closest(".page").attr("id");
}
$('#'+page_id).addClass('pageActive activePage'); // show new page
$('#'+page_id+'_navbar').addClass('navbarActive');
@@ -588,14 +584,13 @@
}
// set pagejump for this page to active if it exists
$(".pagejump > .actor").each(function (i) {
- var data = $(this).data();
- if (data.target.match(/^id_[0-9_]+$/)==null) {
+ if ($(this).data().target.match(/^id_[0-9_]+$/)==null) {
// get page id by name
- if ($('#'+page_id+' h1').text()==data.target) {
+ if ($('#'+page_id+' h1:contains('+$(this).data().target+')').size()>0) {
$(this).parent().addClass("active");
}
}
- else if (page_id==data.target) {
+ 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.
|