You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/02/05 19:43:42 UTC

[royale-asjs] branch develop updated: jump to details (via hash as well)

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 7cc167b  jump to details (via hash as well)
7cc167b is described below

commit 7cc167bdd86b993ecd9dbb84f95f91bc23d910b1
Author: Alex Harui <ah...@apache.org>
AuthorDate: Mon Feb 5 11:43:26 2018 -0800

    jump to details (via hash as well)
---
 .../ASDoc/src/main/royale/ASDocMainView.mxml       | 36 ++++++++++++++++++++++
 .../ASDoc/src/main/royale/EventDetailRenderer.mxml |  7 ++++-
 .../src/main/royale/EventSummaryRenderer.mxml      | 17 +++++++++-
 .../src/main/royale/MethodDetailRenderer.mxml      |  7 ++++-
 .../src/main/royale/MethodSummaryRenderer.mxml     | 12 +++++++-
 .../src/main/royale/PropertyDetailRenderer.mxml    |  7 ++++-
 .../ASDoc/src/main/royale/SummaryRenderer.mxml     | 14 +++++++--
 .../ASDoc/src/main/royale/models/ASDocModel.as     |  1 +
 .../src/main/royale/valueObjects/ValueObject.as    |  1 +
 9 files changed, 95 insertions(+), 7 deletions(-)

diff --git a/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml b/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml
index e45ec0c..7fd291a 100644
--- a/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml
+++ b/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml
@@ -69,6 +69,8 @@ limitations under the License.
                 dispatchEvent(new DetailEvent(viewBeads.selected ? "addTag" : "removeTag", false, false, "viewbead"));
             }
             
+            private var findMember:String ;
+            
             private function updateView():void
             {
             	var hash:String = router.hash;
@@ -87,6 +89,23 @@ limitations under the License.
 						packageList.selectedItem = pkg;
 						packageChangedHandler();
             			var cls:String = hash.substr(c + 1);
+            			c = cls.indexOf("/")
+            			if (c != -1)
+            			{
+            				findMember = cls.substr(c + 1);
+            				cls = cls.substr(0, c);
+            				COMPILE::JS
+            				{
+            					if (document.getElementById(findMember) &&
+            					    classList.selectedItem == cls)
+            					{
+            						// we are already on the right page so just scroll to member
+            					    scrollMemberIntoView();
+            					    return;
+            					}
+            				}
+            				applicationModel.addEventListener("currentDataChanged", findMemberDetail);
+            			}
             			classList.selectedItem = cls; 
             			classChangedHandler();
             		}
@@ -97,6 +116,20 @@ limitations under the License.
             		}
             	}
             }
+            
+            private function findMemberDetail(event:Event):void
+            {
+            	applicationModel.removeEventListener("currentDataChanged", findMemberDetail);
+            	clb.callLater(scrollMemberIntoView);
+            }
+            
+            private function scrollMemberIntoView():void
+            {
+            	COMPILE::JS
+            	{
+            		document.getElementById(findMember).scrollIntoView();
+            	}
+            }
 		]]>
     </fx:Script>
 	<fx:Style>
@@ -182,6 +215,7 @@ limitations under the License.
             font-weight: bold;
             margin-left: 10px;
             margin-top: 3px;
+            text-decoration: none;
         }
         .summaryType {
         }
@@ -244,6 +278,7 @@ limitations under the License.
         }
         
         .eventSummaryQName {
+            text-decoration: none;
             font-weight: bold;
             width: 120px;
             margin-left: 10px;
@@ -265,6 +300,7 @@ limitations under the License.
         <js:ViewDataBinding />
         <js:OneFlexibleChildVerticalLayoutForOverflow flexibleChild="topContainer" />
         <js:HashChangeNotifierBead id="router" hashChange="updateView()" />                
+        <js:CallLaterBead id="clb" />
     </js:beads>
     <rs:DocTopBar />
     <rs:DocTagline />
diff --git a/examples/royale/ASDoc/src/main/royale/EventDetailRenderer.mxml b/examples/royale/ASDoc/src/main/royale/EventDetailRenderer.mxml
index c5aa3a1..647e210 100644
--- a/examples/royale/ASDoc/src/main/royale/EventDetailRenderer.mxml
+++ b/examples/royale/ASDoc/src/main/royale/EventDetailRenderer.mxml
@@ -33,6 +33,11 @@ limitations under the License.
 					eventTypeGroup.removeElement(label);
 				else
 					eventTypeGroup.removeElement(link);
+				COMPILE::JS
+				{
+				// set up anchor link target
+				target.element.id = obj.qname;
+				}
 			}
 			
             [Bindable("dataChange")]
@@ -52,7 +57,7 @@ limitations under the License.
       <js:beads>
         <js:HorizontalLayout />
       </js:beads>
-      <js:Label className="propertyQNameTitle" text="{obj.qname}"/>
+      <js:Label id="target" className="propertyQNameTitle" text="{obj.qname}"/>
       <js:Label text="event"/>
     </js:Group>
     <js:Group id="eventTypeGroup" className="eventTypeGroup">
diff --git a/examples/royale/ASDoc/src/main/royale/EventSummaryRenderer.mxml b/examples/royale/ASDoc/src/main/royale/EventSummaryRenderer.mxml
index 2a3b8aa..71b56a2 100644
--- a/examples/royale/ASDoc/src/main/royale/EventSummaryRenderer.mxml
+++ b/examples/royale/ASDoc/src/main/royale/EventSummaryRenderer.mxml
@@ -48,6 +48,21 @@ limitations under the License.
 				_color1 = value;
 			}
 			
+			override public function set data(value:Object):void
+			{
+				super.data = value;
+				qname.href = "#!" + obj.ownerhref + "/" + obj.qname;
+			}
+			
+            [Bindable("dataChange")]
+            /**
+              @royaleignorecoercion ValueObject
+            */
+            public function get obj():ValueObject
+            {
+                return data as ValueObject;
+            }
+            		
 			private var oddIndex:Boolean;
 
 			override public function addedToParent():void
@@ -87,7 +102,7 @@ limitations under the License.
       <js:beads>
         <js:HorizontalLayout />
       </js:beads>
-      <js:Label className="eventSummaryQName" text="{ValueObject(data).qname}" />
+      <html:A id="qname" className="eventSummaryQName" text="{ValueObject(data).qname}" />
       <js:Label id="label" className="eventDescription" text="{ValueObject(data).shortDescription}" />
     </js:Group>
 </js:MXMLItemRenderer>
diff --git a/examples/royale/ASDoc/src/main/royale/MethodDetailRenderer.mxml b/examples/royale/ASDoc/src/main/royale/MethodDetailRenderer.mxml
index e269966..ead25dd 100644
--- a/examples/royale/ASDoc/src/main/royale/MethodDetailRenderer.mxml
+++ b/examples/royale/ASDoc/src/main/royale/MethodDetailRenderer.mxml
@@ -33,6 +33,11 @@ limitations under the License.
 					propertyTypeGroup.removeElement(label);
 				else
 					propertyTypeGroup.removeElement(link);
+				COMPILE::JS
+				{
+				// set up anchor link target
+				target.element.id = obj.qname;
+				}
 			}
 			
             [Bindable("dataChange")]
@@ -52,7 +57,7 @@ limitations under the License.
       <js:beads>
         <js:HorizontalLayout />
       </js:beads>
-      <js:Label className="propertyQNameTitle" text="{obj.qname}"/>
+      <js:Label id="target" className="propertyQNameTitle" text="{obj.qname}"/>
       <js:Label text="method"/>
     </js:Group>
     <js:Group id="propertyTypeGroup" className="propertyTypeGroup">
diff --git a/examples/royale/ASDoc/src/main/royale/MethodSummaryRenderer.mxml b/examples/royale/ASDoc/src/main/royale/MethodSummaryRenderer.mxml
index 00c3688..cdad7b3 100644
--- a/examples/royale/ASDoc/src/main/royale/MethodSummaryRenderer.mxml
+++ b/examples/royale/ASDoc/src/main/royale/MethodSummaryRenderer.mxml
@@ -57,7 +57,17 @@ limitations under the License.
 					typeGroup.removeElement(label);
 				else
 					typeGroup.removeElement(link);
+				qname.href = "#!" + obj.ownerhref + "/" + obj.qname;
 			}
+			
+            [Bindable("dataChange")]
+            /**
+              @royaleignorecoercion ValueObject
+            */
+            public function get obj():ValueObject
+            {
+                return data as ValueObject;
+            }
 		
 			override public function addedToParent():void
 			{
@@ -96,7 +106,7 @@ limitations under the License.
       <js:beads>
         <js:HorizontalLayout />
       </js:beads>
-      <js:Label className="summaryQName" text="{ValueObject(data).qname}" />
+      <html:A id="qname" className="summaryQName" text="{ValueObject(data).qname}" />
       <js:Label text="(" />
   	  <js:DataContainer id="params" dataProvider="{ValueObject(data).params}" style="border-style:none"
 	     itemRenderer="ParameterRenderer">
diff --git a/examples/royale/ASDoc/src/main/royale/PropertyDetailRenderer.mxml b/examples/royale/ASDoc/src/main/royale/PropertyDetailRenderer.mxml
index 5cfe8bd..a6ed1d6 100644
--- a/examples/royale/ASDoc/src/main/royale/PropertyDetailRenderer.mxml
+++ b/examples/royale/ASDoc/src/main/royale/PropertyDetailRenderer.mxml
@@ -33,6 +33,11 @@ limitations under the License.
 					propertyTypeGroup.removeElement(label);
 				else
 					propertyTypeGroup.removeElement(link);
+				COMPILE::JS
+				{
+				// set up anchor link target
+				target.element.id = obj.qname;
+				}
 			}
 			
             [Bindable("dataChange")]
@@ -52,7 +57,7 @@ limitations under the License.
       <js:beads>
         <js:HorizontalLayout />
       </js:beads>
-      <js:Label className="propertyQNameTitle" text="{obj.qname}"/>
+      <js:Label id="target" className="propertyQNameTitle" text="{obj.qname}"/>
       <js:Label text="property"/>
     </js:Group>
     <js:Group id="propertyTypeGroup" className="propertyTypeGroup">
diff --git a/examples/royale/ASDoc/src/main/royale/SummaryRenderer.mxml b/examples/royale/ASDoc/src/main/royale/SummaryRenderer.mxml
index 849e154..33bfd62 100644
--- a/examples/royale/ASDoc/src/main/royale/SummaryRenderer.mxml
+++ b/examples/royale/ASDoc/src/main/royale/SummaryRenderer.mxml
@@ -57,8 +57,18 @@ limitations under the License.
 					typeGroup.removeElement(label);
 				else
 					typeGroup.removeElement(link);
+				qname.href = "#!" + obj.ownerhref + "/" + obj.qname;
 			}
-		
+			
+            [Bindable("dataChange")]
+            /**
+              @royaleignorecoercion ValueObject
+            */
+            public function get obj():ValueObject
+            {
+                return data as ValueObject;
+            }
+            		
 			override public function addedToParent():void
 			{
 				super.addedToParent();
@@ -96,7 +106,7 @@ limitations under the License.
       <js:beads>
         <js:HorizontalLayout />
       </js:beads>
-      <js:Label className="summaryQName" text="{ValueObject(data).qname}" />
+      <html:A id="qname" className="summaryQName" text="{ValueObject(data).qname}" />
       <js:Label text=":" />
       <js:Label id="label" className="summaryType" text="{ValueObject(data).return}" />
       <html:A id="link" className="summaryTypeLink" text="{ValueObject(data).return}" href="{ValueObject(data).returnhref}" />
diff --git a/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as b/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
index 86e1d5b..0e1381b 100644
--- a/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
+++ b/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
@@ -315,6 +315,7 @@ package models
         	{
         		processParams(data);
         	}
+        	data.ownerhref = currentPackage + "/" + currentClass;
         	arr.push(data);
         }
 
diff --git a/examples/royale/ASDoc/src/main/royale/valueObjects/ValueObject.as b/examples/royale/ASDoc/src/main/royale/valueObjects/ValueObject.as
index 81d2772..efd9243 100644
--- a/examples/royale/ASDoc/src/main/royale/valueObjects/ValueObject.as
+++ b/examples/royale/ASDoc/src/main/royale/valueObjects/ValueObject.as
@@ -30,5 +30,6 @@ package valueObjects
 		public var params:Array;
 		public var type:String;
 		public var typehref:String;
+		public var ownerhref:String;
 	}
 }

-- 
To stop receiving notification emails like this one, please contact
aharui@apache.org.