Scarab commit: svn commit: r10787 - trunk/src: java/org/tigris/scarab/om webapp/WEB-INF/templates/macros webapp/scripts webapp/skins

Hussayn Dabbous <[email protected]>
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: dabbous
Date: 2009-07-12 03:42:53-0700
New Revision: 10787

Modified:
   trunk/src/java/org/tigris/scarab/om/AbstractScarabModule.java
   trunk/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm
   trunk/src/webapp/scripts/sstree.js
   trunk/src/webapp/skins/custom.css

Log:
SCB2979: 
Added a popup-open icon for the treeview.
fix: ie6 does not recognize max-height -> : popup now has a fixed height.

Modified: trunk/src/java/org/tigris/scarab/om/AbstractScarabModule.java
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/java/org/tigris/scarab/om/AbstractScarabModule.java?view=diff&pathrev=10787&r1=10786&r2=10787
==============================================================================
--- trunk/src/java/org/tigris/scarab/om/AbstractScarabModule.java	(original)
+++ trunk/src/java/org/tigris/scarab/om/AbstractScarabModule.java	2009-07-12 03:42:53-0700
@@ -1538,8 +1538,22 @@
         return moduleOptions;
     }
 
-    public String getOptionsTreeAsJSON(RunData data, String fromValue, Attribute attribute, Issue issue, boolean activeOnly) throws TorqueException {    
-    	System.out.println(attribute.getName());
+    /**
+     * Gets a list of RModuleOptions as a Json tree structure.
+     * Needed for javascript portion of Treeview display for attributes.
+     * Note[HD]: This method should be refactored to another class.
+     * Probably we should make a new DisplayType for treeview here...
+     *
+     * @param attribute an <code>Attribute</code> value
+     * @param activeOnly a <code>boolean</code> value
+     * @return a <code>List</code> value
+     * @exception TorqueException if an error occurs
+     */
+
+    public String getOptionsTreeAsJSON(RunData data, String fromValue, Attribute attribute, Issue issue, boolean activeOnly) throws TorqueException 
+    {    
+
+        getLog().debug("Build options tree for Attribute [" + attribute.getName() + "]");
     	
     	List<RModuleOption> moduleOptions = (List<RModuleOption>) getRModuleOptions(attribute, issue.getIssueType(), activeOnly);
     		if (moduleOptions == null) {

Modified: trunk/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm?view=diff&pathrev=10787&r1=10786&r2=10787
==============================================================================
--- trunk/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm	(original)
+++ trunk/src/webapp/WEB-INF/templates/macros/GlobalMacros.vm	2009-07-12 03:42:53-0700
@@ -94,7 +94,8 @@
   #else
 
   <input id="$attrInput.get($optionFieldName).Key" value="$newValues" name="$attrInput.get($optionFieldName).Key" type="hidden"/>  
-  <input id="$attrInput.get($optionFieldName).Key:Display" type="text" size="20" readonly="" name="$attrInput.get($optionFieldName).Key:Display"/><a id="$attrInput.get($optionFieldName).Key:Anchor" href="javascript:toggleTreePopup('$attrInput.get($optionFieldName).Key')">show</a>
+  <input id="$attrInput.get($optionFieldName).Key:Display" type="text" size="20" readonly="" name="$attrInput.get($optionFieldName).Key:Display"/>
+  <a class="treeview_button" id="$attrInput.get($optionFieldName).Key:Anchor" href="javascript:toggleTreePopup('$attrInput.get($optionFieldName).Key')">&nbsp;&nbsp;&nbsp;&nbsp;</a>
   
   #set ($attributeTreePopup = [])
   #set ($dummy = $attributeTreePopup.add($attrInput.get($optionFieldName).Key) )

Modified: trunk/src/webapp/scripts/sstree.js
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/scripts/sstree.js?view=diff&pathrev=10787&r1=10786&r2=10787
==============================================================================
--- trunk/src/webapp/scripts/sstree.js	(original)
+++ trunk/src/webapp/scripts/sstree.js	2009-07-12 03:42:53-0700
@@ -80,6 +80,7 @@
 	document.writeln('</ol></div>');	
 }
 
+
 function renderJSONTree(attributeId, key, value, root, imgpath) {
 	if (root.optionId == value) {
 		document.getElementById(key + ':Display').value = root.displayValue;	
@@ -102,6 +103,7 @@
 	document.writeln('</li>');
 }
 
+
 function toggleTreePopup(key, caller) {
 	if (document.getElementById(key + ':Popup').style.display !== 'inline-block') {
 		var elem = document.getElementById(key + ':Popup');

Modified: trunk/src/webapp/skins/custom.css
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/skins/custom.css?view=diff&pathrev=10787&r1=10786&r2=10787
==============================================================================
--- trunk/src/webapp/skins/custom.css	(original)
+++ trunk/src/webapp/skins/custom.css	2009-07-12 03:42:53-0700
@@ -60,11 +60,21 @@
 }
   
 
+.treeview_button {
+ background-image: url(images/popup_open.gif);
+ width:17px;
+ height:17px;
+ padding-left:0px;
+ position:relative;
+ left:-7px;
+ text-decoration:none;
+ background-repeat: no-repeat;
+}
 
 div.tree_popup {
 	background-color: #ffffe8;
 	display: none;	
-	max-height: 200px;
+    height: 200px;
 	overflow-x: hidden;
 	overflow-y: auto;
 	position: absolute;
@@ -74,9 +84,13 @@
 	border-color:#92b9d8;
 }
 
+div.tree_popup {
+	max-height: 200px;
+}
+
 div.tree_popup ol.treeview {
 	list-style: none;
-	padding: 0px;
+	padding: 5px;
 	margin: 0px;
 }
 
@@ -84,7 +98,7 @@
 	padding-left:0px;
 }
 
-div.tree_popup ol.treeview li {
+div.tree_popup ol.treeview li.leaf {
 	font-size: x-small;
 	margin-bottom: 1px;
 	margin-top: 3px;
@@ -97,6 +111,14 @@
 	text-decoration:none;
 }
 
+div.tree_popup ol.treeview li ol.treeview li.leaf a {
+	font-size: x-small;
+	margin-bottom: 1px;
+	margin-top: 3px;
+	padding-left: 20px;
+	color:#025dae;
+}
+
 .asterisk {
 	color:red;
 }
\ No newline at end of file

------------------------------------------------------
http://scarab.tigris.org/ds/viewMessage.do?dsForumId=3577&dsMessageId=2370746
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.