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/03/03 07:07:46 UTC
[royale-asjs] branch develop updated: switch fragment to use $ as
delimiter instead of / in case search crawler gets fooled by slash or was
encoding it and fooled the EscapedFragmentBead
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 ebb4712 switch fragment to use $ as delimiter instead of / in case search crawler gets fooled by slash or was encoding it and fooled the EscapedFragmentBead
ebb4712 is described below
commit ebb47125c014ceed95a56126c83b510574f37fa1
Author: Alex Harui <ah...@apache.org>
AuthorDate: Fri Mar 2 23:07:30 2018 -0800
switch fragment to use $ as delimiter instead of / in case search crawler gets fooled by slash or was encoding it and fooled the EscapedFragmentBead
---
.../royale/ASDoc/src/main/royale/ASDocMainView.mxml | 4 ++--
.../ClassPickerHashAnchorStringItemRenderer.as | 5 +++--
.../ASDoc/src/main/royale/EventSummaryRenderer.mxml | 4 +++-
.../ASDoc/src/main/royale/MethodSummaryRenderer.mxml | 4 +++-
.../ASDoc/src/main/royale/SummaryRenderer.mxml | 6 ++++--
.../ASDoc/src/main/royale/models/ASDocModel.as | 20 +++++++++++---------
6 files changed, 26 insertions(+), 17 deletions(-)
diff --git a/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml b/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml
index 5136378..68b8765 100644
--- a/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml
+++ b/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml
@@ -113,14 +113,14 @@ limitations under the License.
currentState = "packages";
else
{
- var c:int = hash.indexOf("/");
+ var c:int = hash.indexOf(ASDocModel.DELIMITER);
if (c != -1)
{
var pkg:String = hash.substr(0, c);
packageList.selectedItem = pkg;
packageChangedHandler();
var cls:String = hash.substr(c + 1);
- c = cls.indexOf("/")
+ c = cls.indexOf(ASDocModel.DELIMITER)
if (c != -1)
{
findMember = cls.substr(c + 1);
diff --git a/examples/royale/ASDoc/src/main/royale/ClassPickerHashAnchorStringItemRenderer.as b/examples/royale/ASDoc/src/main/royale/ClassPickerHashAnchorStringItemRenderer.as
index 64b4d45..8ac4c6c 100644
--- a/examples/royale/ASDoc/src/main/royale/ClassPickerHashAnchorStringItemRenderer.as
+++ b/examples/royale/ASDoc/src/main/royale/ClassPickerHashAnchorStringItemRenderer.as
@@ -18,6 +18,7 @@
////////////////////////////////////////////////////////////////////////////////
package
{
+import models.ASDocModel;
import org.apache.royale.html.supportClasses.StringItemRenderer;
/**
@@ -63,11 +64,11 @@ import org.apache.royale.html.supportClasses.StringItemRenderer;
{
pkg = href.substr(0, c);
cname = href.substr(c+1);
- href = pkg + "/" + cname;
+ href = pkg + ASDocModel.DELIMITER + cname;
}
else
{
- href = "/" + cname;
+ href = ASDocModel.DELIMITER + cname;
}
this.element.innerHTML = "<a href='#!" + href + "' class='HashAnchorAnchor'>" + value + "</a>";
}
diff --git a/examples/royale/ASDoc/src/main/royale/EventSummaryRenderer.mxml b/examples/royale/ASDoc/src/main/royale/EventSummaryRenderer.mxml
index 9085c06..81fb01b 100644
--- a/examples/royale/ASDoc/src/main/royale/EventSummaryRenderer.mxml
+++ b/examples/royale/ASDoc/src/main/royale/EventSummaryRenderer.mxml
@@ -24,6 +24,8 @@ limitations under the License.
width="100%">
<fx:Script>
<![CDATA[
+ import models.ASDocModel;
+
private var _color0:String = "#fff";
public function get backgroundColor0():String
@@ -49,7 +51,7 @@ limitations under the License.
override public function set data(value:Object):void
{
super.data = value;
- qname.href = "#!" + obj.ownerhref + "/" + obj.qname;
+ qname.href = "#!" + obj.ownerhref + ASDocModel.DELIMITER + obj.qname;
if (obj.platforms.length == 1)
{
if (obj.platforms[0] == "swf")
diff --git a/examples/royale/ASDoc/src/main/royale/MethodSummaryRenderer.mxml b/examples/royale/ASDoc/src/main/royale/MethodSummaryRenderer.mxml
index 2150f40..6c4b500 100644
--- a/examples/royale/ASDoc/src/main/royale/MethodSummaryRenderer.mxml
+++ b/examples/royale/ASDoc/src/main/royale/MethodSummaryRenderer.mxml
@@ -24,6 +24,8 @@ limitations under the License.
width="100%">
<fx:Script>
<![CDATA[
+ import models.ASDocModel;
+
private static var fakeBothPlatforms:Object = {"addEventListener": 1, "removeEventListener" : 1,
"hasEventListener": 1, "dispatchEvent": 1,
"toString": 1};
@@ -59,7 +61,7 @@ limitations under the License.
typeGroup.removeElement(label);
else
typeGroup.removeElement(link);
- qname.href = "#!" + obj.ownerhref + "/" + obj.qname;
+ qname.href = "#!" + obj.ownerhref + ASDocModel.DELIMITER + obj.qname;
if (obj.platforms.length == 1 && !fakeBothPlatforms[obj.qname])
{
if (obj.platforms[0] == "swf")
diff --git a/examples/royale/ASDoc/src/main/royale/SummaryRenderer.mxml b/examples/royale/ASDoc/src/main/royale/SummaryRenderer.mxml
index c99d127..bbb3ca9 100644
--- a/examples/royale/ASDoc/src/main/royale/SummaryRenderer.mxml
+++ b/examples/royale/ASDoc/src/main/royale/SummaryRenderer.mxml
@@ -24,7 +24,9 @@ limitations under the License.
width="100%">
<fx:Script>
<![CDATA[
- private var _color0:String = "#fff";
+ import models.ASDocModel;
+
+ private var _color0:String = "#fff";
public function get backgroundColor0():String
{
@@ -55,7 +57,7 @@ limitations under the License.
typeGroup.removeElement(label);
else
typeGroup.removeElement(link);
- qname.href = "#!" + obj.ownerhref + "/" + obj.qname;
+ qname.href = "#!" + obj.ownerhref + ASDocModel.DELIMITER + obj.qname;
if (obj.platforms.length == 1)
{
if (obj.platforms[0] == "swf")
diff --git a/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as b/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
index 49b0d16..0d8b9a6 100644
--- a/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
+++ b/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
@@ -25,6 +25,8 @@ package models
public class ASDocModel extends EventDispatcher implements IBeadModel
{
+ public static const DELIMITER:String = "$";
+
public function ASDocModel()
{
}
@@ -233,9 +235,9 @@ package models
for (var p:String in packageData)
{
if (filter == null)
- arr.push({ label: p, href: value + "/" + p});
+ arr.push({ label: p, href: value + DELIMITER + p});
else if (filter(packageData[p]))
- arr.push({ label: p, href: value + "/" + p});
+ arr.push({ label: p, href: value + DELIMITER + p});
}
arr.sort();
_classList = arr;
@@ -350,7 +352,7 @@ package models
if (c != -1)
{
m.return = href.substr(c + 1);
- href = href.substr(0, c) + "/" + href.substr(c + 1);
+ href = href.substr(0, c) + DELIMITER + href.substr(c + 1);
}
m.returnhref = "#!" +href;
}
@@ -370,7 +372,7 @@ package models
if (c != -1)
{
e.type = href.substr(c + 1);
- href = href.substr(0, c) + "/" + href.substr(c + 1);
+ href = href.substr(0, c) + DELIMITER + href.substr(c + 1);
}
e.typehref = "#!" +href;
}
@@ -448,7 +450,7 @@ package models
{
processParams(data as ASDocClassMembers);
}
- data.ownerhref = currentPackage + "/" + currentClass;
+ data.ownerhref = currentPackage + DELIMITER + currentClass;
arr.push(data);
}
@@ -518,7 +520,7 @@ package models
if (c != -1)
{
param.type = href.substr(c + 1);
- href = href.substr(0, c) + "/" + href.substr(c + 1);
+ href = href.substr(0, c) + DELIMITER + href.substr(c + 1);
}
param.typehref = "#!" +href;
}
@@ -612,7 +614,7 @@ package models
if (c != -1)
{
e.type = href.substr(c + 1);
- href = href.substr(0, c) + "/" + href.substr(c + 1);
+ href = href.substr(0, c) + DELIMITER + href.substr(c + 1);
}
e.typehref = "#!" +href;
}
@@ -718,11 +720,11 @@ package models
c = p.lastIndexOf(".");
if (c != -1)
{
- p = p.substr(0, c) + "/" + p.substr(c + 1);
+ p = p.substr(0, c) + DELIMITER + p.substr(c + 1);
}
else
{
- p = "/"+ p;
+ p = DELIMITER + p;
}
data.href = p;
}
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.