[Rt-commit] r3406 - in rt/branches/3.5-TESTING: . html/Elements html/NoAuth/css html/NoAuth/images/css html/NoAuth/js html/Widgets

trs at bestpractical.com trs at bestpractical.com
Wed Jul 6 18:44:23 EDT 2005


Author: trs
Date: Wed Jul  6 18:44:22 2005
New Revision: 3406

Added:
   rt/branches/3.5-TESTING/html/NoAuth/images/css/rolldown-arrow.gif   (contents, props changed)
   rt/branches/3.5-TESTING/html/NoAuth/images/css/rolldown-arrow.png   (contents, props changed)
   rt/branches/3.5-TESTING/html/NoAuth/images/css/rollup-arrow.gif   (contents, props changed)
Removed:
   rt/branches/3.5-TESTING/html/NoAuth/images/css/rollup-arrow.png
Modified:
   rt/branches/3.5-TESTING/   (props changed)
   rt/branches/3.5-TESTING/html/Elements/Header
   rt/branches/3.5-TESTING/html/NoAuth/css/body.css
   rt/branches/3.5-TESTING/html/NoAuth/css/misc.css
   rt/branches/3.5-TESTING/html/NoAuth/js/util.js
   rt/branches/3.5-TESTING/html/Widgets/TitleBoxStart
Log:
 r4833 at wintermute:  tom | 2005-07-06 18:41:54 -0400
 JS improvements and better TitleBox rollup/down


Modified: rt/branches/3.5-TESTING/html/Elements/Header
==============================================================================
--- rt/branches/3.5-TESTING/html/Elements/Header	(original)
+++ rt/branches/3.5-TESTING/html/Elements/Header	Wed Jul  6 18:44:22 2005
@@ -61,14 +61,7 @@
     <script type="text/javascript" src="<%$RT::WebPath%>/NoAuth/js/util.js"></script>
 <& /Elements/Callback, _CallbackName => 'Head', %ARGS &>
   </head>
-  <body
-% if ($Focus) {
-onload="
-    var tmp = (document.getElementsByName('<% $Focus %>'));
-    if (tmp.length > 0) tmp[tmp.length-1].focus();
-"
-% }
->
+  <body onload="<% $onload |n %><% $Focus && qq[ setFocus('$Focus');] |n %>">
 
 % if ($ShowBar) {
 <div id="quickbar">
@@ -108,4 +101,5 @@
 #$LoggedIn => 1
 $URL => undef
 $RSSAutoDiscovery => undef
+$onload => undef
 </%ARGS>

Modified: rt/branches/3.5-TESTING/html/NoAuth/css/body.css
==============================================================================
--- rt/branches/3.5-TESTING/html/NoAuth/css/body.css	(original)
+++ rt/branches/3.5-TESTING/html/NoAuth/css/body.css	Wed Jul  6 18:44:22 2005
@@ -51,7 +51,7 @@
 }
 
 .titlebox .content {
-    margin: 0 2em 0 2em;
+    margin: 1em 2em 0 2em;
 }
 
 .titlebox .title {
@@ -67,25 +67,36 @@
     letter-spacing: -9999em;
     height: 1em;
     width: 20px;
-    background: url(<%$RT::WebImagesURL%>/css/rollup-arrow.png) no-repeat bottom center;
+    background: url(<%$RT::WebImagesURL%>/css/rollup-arrow.gif) no-repeat bottom center;
     position: relative;
     left: -2em;
     float: left;
 }
 
-.titlebox .title :link,
-.titlebox .title :visited
+.titlebox .title span a.rolled-up {
+    background-image: url(<%$RT::WebImagesURL%>/css/rolldown-arrow.gif);
+}
+
+#body .titlebox .title :link,
+#body .titlebox .title :visited
 {
     color: #930;
     text-decoration: none;
 }
 
-.titlebox .title :link:hover,
-.titlebox .title :visited:hover
+#body .titlebox .title :link:hover,
+#body .titlebox .title :visited:hover
 {
     text-decoration: underline;
 }
 
+.evenline { background-color: white; }
+.oddline { background-color: #ddd; }
+
+td {
+    padding: 0.1em 0.5em 0.1em 0.5em;
+}
+
 <%init>
     $r->content_type('text/css');
 </%init>

Modified: rt/branches/3.5-TESTING/html/NoAuth/css/misc.css
==============================================================================
--- rt/branches/3.5-TESTING/html/NoAuth/css/misc.css	(original)
+++ rt/branches/3.5-TESTING/html/NoAuth/css/misc.css	Wed Jul  6 18:44:22 2005
@@ -112,7 +112,7 @@
     padding: 3px;
 }
 
-.hide, .hidden { display: none; }
+.hide, .hidden { display: none !important; }
 
 <%init>
     $r->content_type('text/css');

Added: rt/branches/3.5-TESTING/html/NoAuth/images/css/rolldown-arrow.gif
==============================================================================
Binary file. No diff available.

Added: rt/branches/3.5-TESTING/html/NoAuth/images/css/rolldown-arrow.png
==============================================================================
Binary file. No diff available.

Added: rt/branches/3.5-TESTING/html/NoAuth/images/css/rollup-arrow.gif
==============================================================================
Binary file. No diff available.

Modified: rt/branches/3.5-TESTING/html/NoAuth/js/util.js
==============================================================================
--- rt/branches/3.5-TESTING/html/NoAuth/js/util.js	(original)
+++ rt/branches/3.5-TESTING/html/NoAuth/js/util.js	Wed Jul  6 18:44:22 2005
@@ -1,18 +1,59 @@
 % $r->content_type('application/x-javascript');
 
-function hideshow(id) {
-    e = document.getElementById(id);
+function rollup(link, id) {
+    var e = document.getElementById(id);
     
-    if (e.className.match(/\bhidden\b/))
-        e.className = e.className.replace(/\s?\bhidden\b/, '');
+    if (e.className.match(/\bhidden\b/)) {
+        show(e);
+        link.className = link.className.replace(/\s?\brolled-up\b/, '');
+    }
     else {
-        if (e.className)
-            e.className += ' hidden';
+        hide(e);
+        if (link.className)
+            link.className += ' rolled-up';
         else
-            e.className = 'hidden';
+            link.className = 'rolled-up';
     }
+    link.focus(0);
+    return false;
+}
+
+function hideshow(id) {
+    var e = document.getElementById(id);
+    
+    if (e.className.match(/\bhidden\b/))
+        show(e);
+    else
+        hide(e);
+
+    return false;
+}
+
+function show(e) {
+    e.className = e.className.replace(/\s?\bhidden\b/, '');
+}
+
+function hide(e) {    
+    if (e.className)
+        e.className += ' hidden';
+    else
+        e.className = 'hidden';
+}
+
+function switchVisibility(id1, id2) {
+    // Show both and then hide the one we want
+    show(document.getElementById(id1));
+    show(document.getElementById(id2));
+    
+    hide(document.getElementById(id2));
+    
     return false;
-}   
+}
+
+function setFocus(id) {
+    var tmp = (document.getElementsByName(id));
+    if (tmp.length > 0) tmp[tmp.length-1].focus();
+}
 
 function openCalWindow(field) {
     var objWindow = window.open('<%$RT::WebPath%>/CalPopup.html?field='+field, 'Pick', 'height=400,width=400,scrollbars=1');

Modified: rt/branches/3.5-TESTING/html/Widgets/TitleBoxStart
==============================================================================
--- rt/branches/3.5-TESTING/html/Widgets/TitleBoxStart	(original)
+++ rt/branches/3.5-TESTING/html/Widgets/TitleBoxStart	Wed Jul  6 18:44:22 2005
@@ -43,12 +43,12 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<div class="titlebox">
-  <div class="title">
-    <span><a href="#" onclick="return hideshow('element-<%$id%>');">^</a></span>
-    <% $title_href && qq[<a $title_class href="$title_href">] | n %><% $title |n %><% $title_href && "</a>" |n%>
+<div class="titlebox<% $class && " $class" %>"<% $id && qq[ id="$id"] |n %>>
+  <div class="title<% $title_class && " $title_class" %>">
+    <span><a href="#" onclick="return rollup(this, 'element-<%$rid%>');">^</a></span>
+    <% $title_href && qq[<a href="$title_href">] | n %><% $title |n %><% $title_href && "</a>" |n%>
   </div>
-  <div class="content" id="element-<%$id%>">
+  <div class="content<% $bodyclass && " $bodyclass" %>" id="element-<%$rid%>">
 
 <%ARGS>
 $width => undef
@@ -61,9 +61,9 @@
 $titleright => undef
 $contentbg => "#dddddd"
 $color => "#336699"
+$id => undef
 </%ARGS>
 
 <%init>
-my $id = rand(2000);
-$title_class = qq[class="$title_class"] if $title_class;
+my $rid = rand(2000);
 </%init>


More information about the Rt-commit mailing list