Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

2013 update

  • Loading branch information...
commit 04e96509dc4a3cb53087ff29a9afa40855feab2d 1 parent 5a89ff1
@nagaozen authored
Showing with 8,221 additions and 1,880 deletions.
  1. +2 −1  README.md
  2. +60 −26 app/views/inspect.asp
  3. +6 −3 app/writables/cache/__default_defaultAction___.html
  4. +2 −2 iirf.ini
  5. +1 −1  lib/axe/assets/css/asp-xtreme-evolution-syntax.css
  6. +20 −13 lib/axe/assets/css/asp-xtreme-evolution.css
  7. +104 −30 lib/axe/base.asp
  8. +14 −14 lib/axe/classes/Parsers/csv.asp
  9. +115 −32 lib/axe/classes/Parsers/json2.asp
  10. +126 −0 lib/axe/classes/Parsers/jsonpath.asp
  11. +360 −460 lib/axe/classes/Parsers/mustache.asp
  12. +1,618 −1 lib/axe/classes/Parsers/orderly.asp
  13. +1 −1  lib/axe/classes/Utilities/Auth/interface.asp
  14. +20 −0 lib/axe/classes/Utilities/Email/Adapters/cdo.asp
  15. +1 −1  lib/axe/classes/Utilities/Translator/Medias/json.asp
  16. +392 −251 lib/axe/classes/Utilities/acl.asp
  17. +41 −28 lib/axe/classes/Utilities/email.asp
  18. +137 −137 lib/axe/classes/Utilities/logger.asp
  19. +625 −0 lib/axe/classes/Utilities/xstring.asp
  20. +1 −1  lib/axe/docs/CHANGES.md
  21. +35 −0 lib/axe/docs/files/app/controllers/_templateController-asp.html
  22. +4 −4 lib/axe/docs/files/app/controllers/default-asp.html
  23. +35 −0 lib/axe/docs/files/app/controllers/defaultController-asp.html
  24. +35 −0 lib/axe/docs/files/app/controllers/masterpage_example-asp.html
  25. +35 −0 lib/axe/docs/files/app/controllers/sunny-asp.html
  26. +35 −0 lib/axe/docs/files/app/core/application-configure-asp.html
  27. +35 −0 lib/axe/docs/files/app/core/base-asp.html
  28. +35 −0 lib/axe/docs/files/app/core/base-math-asp.html
  29. +35 −0 lib/axe/docs/files/app/core/lib/Feeds/atom-class-asp.html
  30. +35 −0 lib/axe/docs/files/app/core/lib/Feeds/rss-class-asp.html
  31. +35 −0 lib/axe/docs/files/app/core/lib/Parsers/csv-class-asp.html
  32. +35 −0 lib/axe/docs/files/app/core/lib/Parsers/json-class-asp.html
  33. +35 −0 lib/axe/docs/files/app/core/lib/Parsers/markdown-class-asp.html
  34. +35 −0 lib/axe/docs/files/app/core/lib/Parsers/textile-class-asp.html
  35. +35 −0 lib/axe/docs/files/app/core/lib/Security/md5-class-asp.html
  36. +35 −0 lib/axe/docs/files/app/core/lib/Security/rijndael-class-asp.html
  37. +35 −0 lib/axe/docs/files/app/core/lib/Security/sha256-class-asp.html
  38. +35 −0 lib/axe/docs/files/app/core/lib/Services/akismet-class-asp.html
  39. +35 −0 lib/axe/docs/files/app/core/lib/Services/recaptcha-class-asp.html
  40. +35 −0 lib/axe/docs/files/app/core/lib/Utilities/acl-class-asp.html
  41. +35 −0 lib/axe/docs/files/app/core/lib/Utilities/auth-class-asp.html
  42. +35 −0 lib/axe/docs/files/app/core/lib/Utilities/base64-class-asp.html
  43. +35 −0 lib/axe/docs/files/app/core/lib/Utilities/color-class-asp.html
  44. +35 −0 lib/axe/docs/files/app/core/lib/Utilities/image-class-asp.html
  45. +35 −0 lib/axe/docs/files/app/core/lib/Utilities/list-class-asp.html
  46. +35 −0 lib/axe/docs/files/app/core/lib/Utilities/paginator-class-asp.html
  47. +35 −0 lib/axe/docs/files/app/core/lib/Utilities/stringbuilder-class-asp.html
  48. +35 −0 lib/axe/docs/files/app/core/lib/Utilities/template-class-asp.html
  49. +35 −0 lib/axe/docs/files/app/core/lib/Utilities/upload-class-asp.html
  50. +35 −0 lib/axe/docs/files/app/core/lib/Utilities/zip-class-asp.html
  51. +35 −0 lib/axe/docs/files/app/core/lib/customevent-class-asp.html
  52. +35 −0 lib/axe/docs/files/app/core/lib/interface-class-asp.html
  53. +35 −0 lib/axe/docs/files/app/core/lib/kernel-class-asp.html
  54. +35 −0 lib/axe/docs/files/app/core/lib/unittest-class-asp.html
  55. +35 −0 lib/axe/docs/files/app/core/sessions-finalize-asp.html
  56. +35 −0 lib/axe/docs/files/app/core/sessions-initialize-asp.html
  57. +35 −0 lib/axe/docs/files/app/core/shuttle-unload-finalize-asp.html
  58. +35 −0 lib/axe/docs/files/app/core/shuttle-unload-initialize-asp.html
  59. +35 −0 lib/axe/docs/files/app/core/singletons-finalize-asp.html
  60. +35 −0 lib/axe/docs/files/app/core/singletons-initialize-asp.html
  61. +35 −0 lib/axe/docs/files/app/models/_templateModel-asp.html
  62. +4 −4 lib/axe/docs/files/app/models/defaultModel-asp.html
  63. +4 −4 lib/axe/docs/files/app/singletons-finalize-asp.html
  64. +4 −4 lib/axe/docs/files/app/singletons-initialize-asp.html
  65. +35 −0 lib/axe/docs/files/app/views/_templateView-asp.html
  66. +4 −4 lib/axe/docs/files/app/views/anotherView-asp.html
  67. +4 −4 lib/axe/docs/files/app/views/defaultView-asp.html
  68. +35 −0 lib/axe/docs/files/app/views/error-asp.html
  69. +4 −4 lib/axe/docs/files/app/views/genericView-asp.html
  70. +4 −4 lib/axe/docs/files/app/views/global-asa.html
  71. +5 −5 lib/axe/docs/files/app/views/inspect-asp.html
  72. +4 −4 lib/axe/docs/files/default-asp.html
  73. +4 −4 lib/axe/docs/files/global-asa.html
  74. +4 −4 lib/axe/docs/files/lib/axe/application-configure-asp.html
  75. +454 −27 lib/axe/docs/files/lib/axe/base-asp.html
  76. +4 −4 lib/axe/docs/files/lib/axe/base-math-asp.html
  77. +4 −4 lib/axe/docs/files/lib/axe/classes/Feeds/atom-asp.html
  78. +35 −0 lib/axe/docs/files/lib/axe/classes/Feeds/atom-class-asp.html
  79. +4 −4 lib/axe/docs/files/lib/axe/classes/Feeds/rss-asp.html
  80. +35 −0 lib/axe/docs/files/lib/axe/classes/Feeds/rss-class-asp.html
  81. +40 −40 lib/axe/docs/files/lib/axe/classes/Parsers/csv-asp.html
  82. +35 −0 lib/axe/docs/files/lib/axe/classes/Parsers/csv-class-asp.html
  83. +4 −4 lib/axe/docs/files/lib/axe/classes/Parsers/handlebars-asp.html
  84. +35 −0 lib/axe/docs/files/lib/axe/classes/Parsers/json-asp.html
  85. +35 −0 lib/axe/docs/files/lib/axe/classes/Parsers/json-class-asp.html
  86. +58 −4 lib/axe/docs/files/lib/axe/classes/Parsers/json2-asp.html
  87. +4 −4 lib/axe/docs/files/lib/axe/classes/Parsers/jsonschema-asp.html
  88. +4 −4 lib/axe/docs/files/lib/axe/classes/Parsers/markdown-asp.html
  89. +35 −0 lib/axe/docs/files/lib/axe/classes/Parsers/markdown-class-asp.html
  90. +4 −4 lib/axe/docs/files/lib/axe/classes/Parsers/mustache-asp.html
  91. +4 −4 lib/axe/docs/files/lib/axe/classes/Parsers/orderly-asp.html
  92. +4 −4 lib/axe/docs/files/lib/axe/classes/Parsers/textile-asp.html
  93. +35 −0 lib/axe/docs/files/lib/axe/classes/Parsers/textile-class-asp.html
  94. +4 −4 lib/axe/docs/files/lib/axe/classes/Security/md5-asp.html
  95. +35 −0 lib/axe/docs/files/lib/axe/classes/Security/md5-class-asp.html
  96. +4 −4 lib/axe/docs/files/lib/axe/classes/Security/rijndael-asp.html
  97. +35 −0 lib/axe/docs/files/lib/axe/classes/Security/rijndael-class-asp.html
  98. +4 −4 lib/axe/docs/files/lib/axe/classes/Security/sha256-asp.html
  99. +35 −0 lib/axe/docs/files/lib/axe/classes/Security/sha256-class-asp.html
  100. +4 −4 lib/axe/docs/files/lib/axe/classes/Services/akismet-asp.html
  101. +35 −0 lib/axe/docs/files/lib/axe/classes/Services/akismet-class-asp.html
  102. +4 −4 lib/axe/docs/files/lib/axe/classes/Services/recaptcha-asp.html
  103. +35 −0 lib/axe/docs/files/lib/axe/classes/Services/recaptcha-class-asp.html
  104. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/Acl/Medias/json-asp.html
  105. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/Acl/interface-asp.html
  106. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/Auth/Adapters/mssql-asp.html
  107. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/Auth/Adapters/mssql-sql.html
  108. +5 −5 lib/axe/docs/files/lib/axe/classes/Utilities/Auth/interface-asp.html
  109. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/Email/Adapters/cdo-asp.html
  110. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/Email/interface-asp.html
  111. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/Logger/Adapters/firephp-asp.html
  112. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/Logger/Adapters/response-asp.html
  113. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/Logger/Adapters/text-asp.html
  114. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/Logger/interface-asp.html
  115. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/Translator/Medias/json-asp.html
  116. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/Translator/interface-asp.html
  117. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/XSession/Adapters/json-asp.html
  118. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/XSession/Adapters/mssql-asp.html
  119. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/XSession/Adapters/mssql-sql.html
  120. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/XSession/Medias/json-asp.html
  121. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/XSession/Medias/mssql-asp.html
  122. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/XSession/Medias/mssql-sql.html
  123. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/XSession/interface-asp.html
  124. +736 −81 lib/axe/docs/files/lib/axe/classes/Utilities/acl-asp.html
  125. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/acl-class-asp.html
  126. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/auth-asp.html
  127. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/auth-class-asp.html
  128. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/base64-asp.html
  129. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/base64-class-asp.html
  130. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/color-asp.html
  131. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/color-class-asp.html
  132. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/debug-class-asp.html
  133. +159 −99 lib/axe/docs/files/lib/axe/classes/Utilities/email-asp.html
  134. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/image-asp.html
  135. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/image-class-asp.html
  136. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/list-asp.html
  137. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/list-class-asp.html
  138. +391 −410 lib/axe/docs/files/lib/axe/classes/Utilities/logger-asp.html
  139. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/logger-class-asp.html
  140. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/paginator-asp.html
  141. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/paginator-class-asp.html
  142. +4 −4 lib/axe/docs/files/lib/axe/classes/Utilities/stringbuilder-asp.html
  143. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/stringbuilder-class-asp.html
  144. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/template-asp.html
  145. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/template-class-asp.html
  146. +5 −5 lib/axe/docs/files/lib/axe/classes/Utilities/translator-asp.html
  147. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/translator-class-asp.html
  148. +5 −5 lib/axe/docs/files/lib/axe/classes/Utilities/upload-asp.html
  149. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/upload-class-asp.html
  150. +5 −5 lib/axe/docs/files/lib/axe/classes/Utilities/xsession-asp.html
  151. +35 −0 lib/axe/docs/files/lib/axe/classes/Utilities/xsession-class-asp.html
Sorry, we could not display the entire diff because it was too big.
View
3  README.md
@@ -104,6 +104,7 @@ for sure.
- [CSV](/lib/axe/docs/files/lib/axe/classes/Parsers/csv-asp.html)
- [CustomEvent](/lib/axe/docs/files/lib/axe/classes/customevent-asp.html)
- [Email](/lib/axe/docs/files/lib/axe/classes/Utilities/email-asp.html)
+ - [Handlebars](/lib/axe/docs/files/lib/axe/classes/Parsers/handlebars-asp.html)
- [Interface](/lib/axe/docs/files/lib/axe/classes/interface-asp.html)
- [JSON2](/lib/axe/docs/files/lib/axe/classes/Parsers/json2-asp.html)
- [JSONSchema](/lib/axe/docs/files/lib/axe/classes/Parsers/jsonschema-asp.html)
@@ -115,11 +116,11 @@ for sure.
- [Paginator](/lib/axe/docs/files/lib/axe/classes/Utilities/paginator-asp.html)
- [RSS](/lib/axe/docs/files/lib/axe/classes/Feeds/rss-asp.html) _(work in progress)_
- [StringBuilder](/lib/axe/docs/files/lib/axe/classes/Utilities/stringbuilder-asp.html)
- - [Template](/lib/axe/docs/files/lib/axe/classes/Utilities/template-asp.html)
- [Textile](/lib/axe/docs/files/lib/axe/classes/Parsers/textile-asp.html)
- [Translator](/lib/axe/docs/files/lib/axe/classes/Utilities/translator-asp.html)
- [UnitTest](/lib/axe/docs/files/lib/axe/classes/unittest-asp.html)
- [XSession](/lib/axe/docs/files/lib/axe/classes/Utilities/xsession-asp.html)
+ - [XString](/lib/axe/docs/files/lib/axe/classes/Utilities/xstring-asp.html)
* new services
- [Akismet](/lib/axe/docs/files/lib/axe/classes/Services/akismet-asp.html)
- [reCaptcha](/lib/axe/docs/files/lib/axe/classes/Services/recaptcha-asp.html)
View
86 app/views/inspect.asp
@@ -1,32 +1,32 @@
<%
' File: inspect.asp
-'
+'
' This view provide resources for developers to analyse the current data source,
' transformation and output which is being sent to the user.
-'
+'
' License:
-'
+'
' This file is part of ASP Xtreme Evolution.
-' Copyright (C) 2007-2012 Fabio Zendhi Nagao
-'
+' Copyright (C) 2007-2009 Fabio Zendhi Nagao
+'
' ASP Xtreme Evolution is free software: you can redistribute it and/or modify
' it under the terms of the GNU Lesser General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
-'
+'
' ASP Xtreme Evolution is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU Lesser General Public License for more details.
-'
+'
' You should have received a copy of the GNU Lesser General Public License
' along with ASP Xtreme Evolution. If not, see <http://www.gnu.org/licenses/>.
-'
+'
' About:
-'
+'
' - Written by Fabio Zendhi Nagao <http://zend.lojcomm.com.br/> @ December 2007
-'
+'
%>
<!--#include virtual="/lib/axe/singletons.initialize.asp"-->
@@ -48,10 +48,10 @@
<div id="container-hd">
<h1>Inspecting(&#8220;/<% Response.write Session("controller") & "/" & Session("action") & "/" & join(Session("argv"), "/") %>&#8221;)</h1>
<ul class="nav">
- <li class="selected"><a id="inspect-sv-anchor" href="#" onclick="dE(this, 'inspect-sv-');return false;">Server Variables</a></li>
- <li><a id="inspect-xml-anchor" href="#" onclick="dE(this, 'inspect-xml-');return false;">XML</a></li>
- <li><a id="inspect-xslt-anchor" href="#" onclick="dE(this, 'inspect-xslt-');return false;">XSLT</a></li>
- <li><a id="inspect-output-anchor" href="#" onclick="dE(this, 'inspect-output-');return false;">Output</a></li>
+ <li class='<%= iif( Request.Cookies("inspect_last_visible") = "inspect-sv-", "selected", "" ) %>'><a id="inspect-sv-anchor" href="#" onclick="dE(this, 'inspect-sv-');return false;">Server Variables</a></li>
+ <li class='<%= iif( Request.Cookies("inspect_last_visible") = "inspect-xml-", "selected", "" ) %>'><a id="inspect-xml-anchor" href="#" onclick="dE(this, 'inspect-xml-');return false;">XML</a></li>
+ <li class='<%= iif( Request.Cookies("inspect_last_visible") = "inspect-xslt-", "selected", "" ) %>'><a id="inspect-xslt-anchor" href="#" onclick="dE(this, 'inspect-xslt-');return false;">XSLT</a></li>
+ <li class='<%= iif( Request.Cookies("inspect_last_visible") = "inspect-output-", "selected", "" ) %>'><a id="inspect-output-anchor" href="#" onclick="dE(this, 'inspect-output-');return false;">Output</a></li>
</ul>
<hr />
</div>
@@ -103,38 +103,72 @@ next
<script type="text/javascript" src="/lib/axe/assets/js/dp.SyntaxHighlighter/Scripts/shBrushXml.js"></script>
<script type="text/javascript">
// <![CDATA[
-
- var idCurrentVisible = "inspect-sv-";
+
+ var idCurrentVisible = '<%= iif( Request.Cookies("inspect_last_visible") <> "", Request.Cookies("inspect_last_visible"), "inspect-sv-" ) %>';
function dE(e, id) {
if( idCurrentVisible == id + "container" ) { return; }
-
+
removeClass(document.getElementById(idCurrentVisible + "anchor").parentNode, "selected");
addClass(e.parentNode, "selected");
-
+
document.getElementById(idCurrentVisible + "container").style.display = "none";
document.getElementById(id + "container").style.display = "block";
-
+
idCurrentVisible = id;
+ createCookie("inspect_last_visible", id, 1);
}
-
+
+ dp.SyntaxHighlighter.ClipboardSwf = "/lib/axe/assets/js/dp.SyntaxHighlighter/Scripts/clipboard.swf";
+ dp.SyntaxHighlighter.HighlightAll("code");
+
+ document.getElementById(idCurrentVisible + "container").style.display = "block";
+
+
+
+
+
+ // Element classes helpers
function hasClass(e, cls) {
return e.className.match(new RegExp("(^|\\s)" + cls + "(?:\\s|$)"));
}
-
+
function addClass(e, cls) {
if(!this.hasClass(e,cls)) e.className += ' ' + cls;
}
-
+
function removeClass(e, cls) {
if(hasClass(e,cls)) {
var reg = new RegExp("(^|\\s)" + cls + "(?:\\s|$)");
e.className = e.className.replace(reg, ' ');
}
}
-
- dp.SyntaxHighlighter.ClipboardSwf = "/lib/axe/assets/js/dp.SyntaxHighlighter/Scripts/clipboard.swf";
- dp.SyntaxHighlighter.HighlightAll("code");
-
+
+ // Cookies helpers
+ function createCookie(name, value, days) {
+ if(days) {
+ var date = new Date();
+ date.setTime(date.getTime()+(days*24*60*60*1000));
+ var expires = "; expires="+date.toGMTString();
+ }
+ else var expires = "";
+ document.cookie = name+"="+value+expires+"; path=/";
+ }
+
+ function readCookie(name) {
+ var nameEQ = name + "=";
+ var ca = document.cookie.split(';');
+ for(var i=0;i < ca.length;i++) {
+ var c = ca[i];
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
+ }
+ return null;
+ }
+
+ function eraseCookie(name) {
+ createCookie(name,"",-1);
+ }
+
// ]]>
</script>
</body>
View
9 app/writables/cache/__default_defaultAction___.html
@@ -180,6 +180,9 @@ <h3 xmlns="">Added</h3>
<a href="/lib/axe/docs/files/lib/axe/classes/Utilities/email-asp.html">Email</a>
</li>
<li>
+ <a href="/lib/axe/docs/files/lib/axe/classes/Parsers/handlebars-asp.html">Handlebars</a>
+ </li>
+ <li>
<a href="/lib/axe/docs/files/lib/axe/classes/interface-asp.html">Interface</a>
</li>
<li>
@@ -214,9 +217,6 @@ <h3 xmlns="">Added</h3>
<a href="/lib/axe/docs/files/lib/axe/classes/Utilities/stringbuilder-asp.html">StringBuilder</a>
</li>
<li>
- <a href="/lib/axe/docs/files/lib/axe/classes/Utilities/template-asp.html">Template</a>
- </li>
- <li>
<a href="/lib/axe/docs/files/lib/axe/classes/Parsers/textile-asp.html">Textile</a>
</li>
<li>
@@ -228,6 +228,9 @@ <h3 xmlns="">Added</h3>
<li>
<a href="/lib/axe/docs/files/lib/axe/classes/Utilities/xsession-asp.html">XSession</a>
</li>
+ <li>
+ <a href="/lib/axe/docs/files/lib/axe/classes/Utilities/xstring-asp.html">XString</a>
+ </li>
</ul>
</li>
<li>new services
View
4 iirf.ini
@@ -1,7 +1,7 @@
IterationLimit 10
MaxMatchCount 10
-RewriteLog c:\temp\iirfLog.out
-RewriteLogLevel 0
+# RewriteLog c:\temp\iirfLog.out
+# RewriteLogLevel 0
RewriteRule ^(/assets|/lib|/app/cache|/app/singletons|/app/views|/cgi-bin).* $0 [U,I,L]
RewriteRule ^(.*)/?\?(.*)$ $1&$2
View
2  lib/axe/assets/css/asp-xtreme-evolution-syntax.css
@@ -28,7 +28,7 @@
.dp-highlighter {
font-family: "Envy Code R", "Monaco", "Bitstream Vera Sans Mono Roman", "DejaVu Sans Mono", "Courier New", Monospace;
- font-size: 13px;
+ font-size: 15px;
background-color: #2E3436;
width: 100%;
overflow: auto;
View
33 lib/axe/assets/css/asp-xtreme-evolution.css
@@ -117,7 +117,11 @@ body#defaultView img {
}
body#inspect h1 {
- font-size: 256%;
+ font-size: 512%;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+
padding-bottom: 0.5em;
}
@@ -139,14 +143,15 @@ body#inspect div#container-bd table {
body#inspect div#container-bd th,
body#inspect div#container-bd td {
+ font-family: "Envy Code R", "Monaco", "Bitstream Vera Sans Mono Roman", "DejaVu Sans Mono", "Courier New", Monospace;
padding: 5px;
- font-size: 93%;
}
body#inspect div#container-bd tr.even {
background-color: #292F31;
}
+body#inspect div#inspect-sv-container,
body#inspect div#inspect-xml-container,
body#inspect div#inspect-xslt-container,
body#inspect div#inspect-output-container {
@@ -164,8 +169,8 @@ body#inspect div#inspect-output-container {
list-style-type: none;
float: left;
background: #f3f3f3;
- background-image: -moz-linear-gradient(top, #f9f9f9, #e3e3e3);
- background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #f9f9f9),color-stop(1, #e3e3e3));
+ background: -moz-linear-gradient(top, #f9f9f9, #e3e3e3);
+ background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #f9f9f9),color-stop(1, #e3e3e3));
border-top: 1px solid #bbb;
border-bottom: 1px solid #aaa;
border-right: 1px solid #bbb;
@@ -178,7 +183,6 @@ body#inspect div#inspect-output-container {
text-decoration: none;
border-right: 1px solid #fff;
display: block;
-/* padding: 2px 8px;*/
padding: 8px 16px;
text-transform: capitalize;
}
@@ -187,9 +191,11 @@ body#inspect div#inspect-output-container {
.nav li:hover:first-child,
.nav li:hover:last-child {
border-color: #888;
+ background: -moz-linear-gradient(top, #ffffff, #ebebeb);
+ background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #ffffff),color-stop(1, #ebebeb));
}
-.nav .selected:first-child:hover a {
+.nav li.selected:first-child:hover a {
}
.nav li:hover a {
@@ -199,23 +205,24 @@ body#inspect div#inspect-output-container {
}
.nav li:active {
- background-image: -moz-linear-gradient(top, #666, #999);
- background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #666),color-stop(.4, #888),color-stop(.6, #888),color-stop(1, #999));
+ background: -moz-linear-gradient(top, #666, #999);
+ background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #666),color-stop(.4, #888),color-stop(.6, #888),color-stop(1, #999));
}
.nav li:active a {
color: #fff;
}
-.nav .selected {
+.nav li.selected,
+.nav li.selected:hover {
border-left: 1px solid #777;
background: #666;
border-color: #888;
- background-image: -moz-linear-gradient(top, #999, #666);
- background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #999),color-stop(.4, #888),color-stop(.6, #888),color-stop(1, #666));
+ background: -moz-linear-gradient(top, #999, #666);
+ background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #999),color-stop(.4, #888),color-stop(.6, #888),color-stop(1, #666));
}
-.nav .selected a, .nav .selected span {
+.nav li.selected a, .nav li.selected span {
color: #fff !important;
border-right: 0;
padding-right: 17px;
@@ -223,7 +230,7 @@ body#inspect div#inspect-output-container {
.nav li:first-child.selected a,
.nav li:first-child.selected span {
- padding-left: 15px;
+ padding-left: 17px;
}
.nav li:first-child {
View
134 lib/axe/base.asp
@@ -65,7 +65,7 @@ end function
'
' (end code)
'
-function iif(expr, truepart, falsepart)
+function iif(byVal expr, byRef truepart, byRef falsepart)
if(expr) then
iif = truepart
else
@@ -73,6 +73,87 @@ function iif(expr, truepart, falsepart)
end if
end function
+' Function: getDate
+'
+' A location independent date generation function.
+'
+' Parameters:
+'
+' (integer) - year
+' (integer) - month
+' (integer) - day
+' (integer[]) - optional [ hour, minute, second ]
+'
+' Returns:
+'
+' (Date) - date
+'
+' Example:
+'
+' (start code)
+'
+' dim shortDate, generalDate
+' shortDate = getDate(1982, 08, 31, null)
+' generalDate = getDate(1982, 08, 31, array(03, 15, 00))
+'
+' (end code)
+'
+public function getDate(byVal yyyy, byVal mm, byVal dd, byRef time)
+ dim dt, tm, h, n, s
+
+ dt = dateSerial(yyyy, mm, dd)
+ if( not isNull(time) ) then
+ if( isArray(time) ) then
+ h = time(0)
+ n = time(1)
+ s = time(2)
+ tm = timeSerial(h, n, s)
+ end if
+ end if
+
+ if( isEmpty(tm) ) then
+ getDate = dt
+ else
+ getDate = cdate( dt & " " & tm )
+ end if
+end function
+
+' Function: formatDate
+'
+' Outputs the date into a specific format.
+'
+' Parameters:
+'
+' (Date) - date
+' (string) - format
+'
+' Returns:
+'
+' (string) - formated date
+'
+' Example:
+'
+' (start code)
+'
+' dim generalDate
+' generalDate = getDate(1982, 08, 31, array(03, 15, 00))
+' Response.write formatDate(generalDate, "dd/mm/yyyy") ' prints "31/08/1982"
+' Response.write formatDate(generalDate, "mm/dd/yyyy h:n:s") ' prints "08/31/1982 03:15:00"
+'
+' (end code)
+'
+function formatDate(byVal dt, byVal fmt)
+ formatDate = fmt
+
+ formatDate = replace(formatDate, "yyyy", year(dt))
+ formatDate = replace(formatDate, "mm", right("00" & month(dt), 2))
+ formatDate = replace(formatDate, "dd", right("00" & day(dt), 2))
+
+ formatDate = replace(formatDate, "h", right("00" & hour(dt), 2))
+ formatDate = replace(formatDate, "n", right("00" & minute(dt), 2))
+ formatDate = replace(formatDate, "s", right("00" & second(dt), 2))
+end function
+
' Function: strsubstitute
'
' Mimics the string placeholders.
@@ -94,24 +175,17 @@ end function
'
' (end code)
'
-function strsubstitute(template, replacements)
+function strsubstitute(byVal template, byVal replacements)
if( not isArray(replacements) ) then replacements = array(replacements)
- dim Re : set Re = new RegExp
- Re.global = true
- Re.ignoreCase = true
- Re.pattern = "{\d+}"
-
- dim Matches, Match, index : set Matches = Re.execute(template)
- for each Match in Matches
- index = replace(replace(Match, "{", ""), "}", "")
- template = replace(template, Match.value, replacements(clng(index)))
+ dim str, i
+ str = template
+ for i = 0 to ubound(replacements)
+ if( not isNull( replacements(i) ) ) then
+ str = replace(str, "{" & i & "}", replacements(i))
+ end if
next
- set Matches = nothing
-
- set Re = nothing
-
- strsubstitute = template
+ strsubstitute = str
end function
' Function: sanitize
@@ -137,7 +211,7 @@ end function
'
' (end code)
'
-public function sanitize(value, placeholders, replacements)
+public function sanitize(byVal value, byRef placeholders, byRef replacements)
if( ( vartype( placeholders ) < 8192 ) or ( vartype( replacements ) < 8192 ) ) then
sanitize = "2nd and 3rd arguments should be arrays"
exit function
@@ -175,7 +249,7 @@ end function
'
' (end code)
'
-function isOdd(n)
+function isOdd(byVal n)
isOdd = cbool(n mod 2)
end function
@@ -200,7 +274,7 @@ end function
'
' (end code)
'
-function isEven(n)
+function isEven(byVal n)
isEven = (not isOdd(n))
end function
@@ -225,7 +299,7 @@ end function
'
' (end code)
'
-function max(a)
+function max(byRef a)
dim i : i = 1
max = a(0)
while( i <= ubound(a) )
@@ -257,7 +331,7 @@ end function
'
' (end code)
'
-function min(a)
+function min(byRef a)
dim i : i = 1
min = a(0)
while( i <= ubound(a) )
@@ -289,7 +363,7 @@ end function
'
' (end code)
'
-function floor(n)
+function floor(byVal n)
dim r : r = round(n)
if( cdbl(r) > cdbl(n) ) then
r = r - 1
@@ -318,7 +392,7 @@ end function
'
' (end code)
'
-function ceiling(n)
+function ceiling(byVal n)
dim f : f = floor(n)
if( cdbl(f) = cdbl(n) ) then
ceiling = f
@@ -348,7 +422,7 @@ end function
'
' (end code)
'
-function hex2dec(value)
+function hex2dec(byVal value)
hex2dec = 0
dim i, u, d
i = 0 : u = len(value)
@@ -380,7 +454,7 @@ end function
'
' (end code)
'
-function dec2hex(value)
+function dec2hex(byVal value)
dec2hex = hex(value)
end function
@@ -490,7 +564,7 @@ end function
'
' (end code)
'
-function dump(mixed)
+function dump(byRef mixed)
select case lcase(typename(mixed))
case "string":
dump = "(" & typename(mixed) & ") """ & mixed & """"
@@ -515,7 +589,7 @@ function dump(mixed)
end select
end function
-function dump_hdlArray(arr)
+function dump_hdlArray(byRef arr)
dim entry : dump_hdlArray = ""
for each entry in arr
dump_hdlArray = dump_hdlArray & "," & dump(entry)
@@ -523,7 +597,7 @@ function dump_hdlArray(arr)
dump_hdlArray = "(Array) [" & mid(dump_hdlArray, 2) & "]"
end function
-function dump_hdlDictionary(Dic)
+function dump_hdlDictionary(byRef Dic)
dim key : dump_hdlDictionary = ""
for each key in Dic.keys()
dump_hdlDictionary = dump_hdlDictionary & ",""" & key & """: " & dump(Dic(key))
@@ -531,7 +605,7 @@ function dump_hdlDictionary(Dic)
dump_hdlDictionary = "(Dictionary) {" & mid(dump_hdlDictionary, 2) & "}"
end function
-function dump_hdlRecordset(Rs)
+function dump_hdlRecordset(byRef Rs)
dim i, row : dump_hdlRecordset = ""
while( not Rs.eof )
row = ""
@@ -544,7 +618,7 @@ function dump_hdlRecordset(Rs)
dump_hdlRecordset = "(Recorset) [" & mid(dump_hdlRecordset, 2) & "]"
end function
-function dump_hdlStream(St)
+function dump_hdlStream(byRef St)
if(St.type = 1) then
dump_hdlStream = "(Stream) adTypeBinary"
else
View
28 lib/axe/classes/Parsers/csv.asp
@@ -126,9 +126,9 @@ class CSV
' Parser.separator = ";"
'
' set Data = Parser.fromString( join(array( _
- ' "id,firstname", _
- ' "1,Foo", _
- ' "2,Bar" _
+ ' "id;firstname", _
+ ' "1;Foo", _
+ ' "2;Bar" _
' ), vbCrLf), true )
' Response.write( dump(Data) )
' Data.close()
@@ -287,7 +287,7 @@ class CSV
'
private SCHEMA_INI_TEMPLATE
- ' Property: _Conn
+ ' Property: [_Conn]
'
' {private} Because this parser leverages an ADODB.Recordset that requires
' an open ADODB.Connection object, a shared class scoped connection is required
@@ -299,7 +299,7 @@ class CSV
'
private [_Conn]
- ' Property: _DataSourceFolder
+ ' Property: [_DataSourceFolder]
'
' {private} Full physical path to the folder containing the DataSource.csv and the Schema.ini files.
'
@@ -319,7 +319,7 @@ class CSV
end if
end sub
- ' Subroutine: _createSchema
+ ' Subroutine: [_createSchema]
'
' {private} Creates an ANSI encoded Schema.ini file in the same folder as the DataSource.csv file.
'
@@ -336,7 +336,7 @@ class CSV
set Fso = nothing
end sub
- ' Function: _fileExists
+ ' Function: [_fileExists]
'
' {private} Checks if the file exists in the file system.
'
@@ -355,7 +355,7 @@ class CSV
set Fso = nothing
end function
- ' Function: _loadTextFile
+ ' Function: [_loadTextFile]
'
' {private} If the file exists, read it all and return the content.
'
@@ -388,7 +388,7 @@ class CSV
end if
end function
- ' Subroutine: _createFile
+ ' Subroutine: [_createFile]
'
' {private} Create/Overwrite a file in the file system.
'
@@ -413,7 +413,7 @@ class CSV
end select
end sub
- ' Subroutine: _createFileStd
+ ' Subroutine: [_createFileStd]
'
' {private} Create/Overwrite a file in the file system without any special treatment.
'
@@ -441,7 +441,7 @@ class CSV
set Stream = nothing
end sub
- ' Subroutine: _createFileWithoutBOM
+ ' Subroutine: [_createFileWithoutBOM]
'
' {private} Create/Overwrite a file in the file system removing the Byte Order Mark. CSV files doesn't support them.
'
@@ -489,7 +489,7 @@ class CSV
set Stream = nothing
end sub
- ' Subroutine: _deleteFile
+ ' Subroutine: [_deleteFile]
'
' {private} Delete a file in the file system.
'
@@ -505,7 +505,7 @@ class CSV
set Fso = nothing
end sub
- ' Subroutine: _createFolder
+ ' Subroutine: [_createFolder]
'
' {private} Create a folder in the file system.
'
@@ -521,7 +521,7 @@ class CSV
set Fso = nothing
end sub
- ' Subroutine: _deleteFolder
+ ' Subroutine: [_deleteFolder]
'
' {private} Delete a folder in the file system.
'
View
147 lib/axe/classes/Parsers/json2.asp
@@ -226,6 +226,25 @@ set Info = nothing
(end code)
+
+
+
+
+Function: minify
+
+This method can be used as a helper to enable comments in json-like
+configuration files. According to Douglas Crockford, using comments are fine if
+you pipe the code before handing it to your JSON parser. See
+<https://plus.google.com/118095276221607585885/posts/RK8qyGVaGSr>
+
+Parameters:
+
+ (string) - a json-like configuration string
+
+Returns:
+
+ (json) - valid minified json
+
*/
if(!Object.prototype.get) {
@@ -281,7 +300,7 @@ if(!String.prototype.sanitize) {
if(!String.prototype.substitute) {
String.prototype.substitute = function(object, regexp){
return this.replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){
- if (match.charAt(0) == '\\') return match.slice(1);
+ if(match.charAt(0) == '\\') return match.slice(1);
return (object[name] != undefined) ? object[name] : '';
});
}
@@ -415,10 +434,10 @@ if(!String.prototype.substitute) {
myData = JSON.parse(text, function (key, value) {
var a;
- if (typeof value === 'string') {
+ if(typeof value === 'string') {
a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
- if (a) {
+ if(a) {
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+a[5], +a[6]));
}
@@ -428,11 +447,11 @@ if(!String.prototype.substitute) {
myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
var d;
- if (typeof value === 'string' &&
+ if(typeof value === 'string' &&
value.slice(0, 5) === 'Date(' &&
value.slice(-1) === ')') {
d = new Date(value.slice(5, -1));
- if (d) {
+ if(d) {
return d;
}
}
@@ -458,7 +477,7 @@ if(!String.prototype.substitute) {
// methods in a closure to avoid creating global variables.
var JSON;
-if (!JSON) {
+if(!JSON) {
JSON = {};
}
@@ -470,7 +489,7 @@ if (!JSON) {
return n < 10 ? '0' + n : n;
}
- if (typeof Date.prototype.toJSON !== 'function') {
+ if(typeof Date.prototype.toJSON !== 'function') {
Date.prototype.toJSON = function (key) {
@@ -538,7 +557,7 @@ if (!JSON) {
// If the value has a toJSON method, call it to obtain a replacement value.
- if (value && typeof value === 'object' &&
+ if(value && typeof value === 'object' &&
typeof value.toJSON === 'function') {
value = value.toJSON(key);
}
@@ -546,7 +565,7 @@ if (!JSON) {
// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.
- if (typeof rep === 'function') {
+ if(typeof rep === 'function') {
value = rep.call(holder, key, value);
}
@@ -579,7 +598,7 @@ if (!JSON) {
// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.
- if (!value) {
+ if(!value) {
return 'null';
}
@@ -590,7 +609,7 @@ if (!JSON) {
// Is the value an array?
- if (Object.prototype.toString.apply(value) === '[object Array]') {
+ if(Object.prototype.toString.apply(value) === '[object Array]') {
// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.
@@ -614,13 +633,13 @@ if (!JSON) {
// If the replacer is an array, use it to select the members to be stringified.
- if (rep && typeof rep === 'object') {
+ if(rep && typeof rep === 'object') {
length = rep.length;
for (i = 0; i < length; i += 1) {
- if (typeof rep[i] === 'string') {
+ if(typeof rep[i] === 'string') {
k = rep[i];
v = str(k, value);
- if (v) {
+ if(v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
@@ -630,9 +649,9 @@ if (!JSON) {
// Otherwise, iterate through all of the keys in the object.
for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
+ if(Object.prototype.hasOwnProperty.call(value, k)) {
v = str(k, value);
- if (v) {
+ if(v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
@@ -654,7 +673,7 @@ if (!JSON) {
// If the JSON object does not yet have a stringify method, give it one.
- if (typeof JSON.stringify !== 'function') {
+ if(typeof JSON.stringify !== 'function') {
JSON.stringify = function (value, replacer, space) {
// The stringify method takes a value and an optional replacer, and an optional
@@ -670,14 +689,14 @@ if (!JSON) {
// If the space parameter is a number, make an indent string containing that
// many spaces.
- if (typeof space === 'number') {
+ if(typeof space === 'number') {
for (i = 0; i < space; i += 1) {
indent += ' ';
}
// If the space parameter is a string, it will be used as the indent string.
- } else if (typeof space === 'string') {
+ } else if(typeof space === 'string') {
indent = space;
}
@@ -685,7 +704,7 @@ if (!JSON) {
// Otherwise, throw an error.
rep = replacer;
- if (replacer && typeof replacer !== 'function' &&
+ if(replacer && typeof replacer !== 'function' &&
(typeof replacer !== 'object' ||
typeof replacer.length !== 'number')) {
throw new Error('JSON.stringify');
@@ -701,7 +720,7 @@ if (!JSON) {
// If the JSON object does not yet have a parse method, give it one.
- if (typeof JSON.parse !== 'function') {
+ if(typeof JSON.parse !== 'function') {
JSON.parse = function (text, reviver) {
// The parse method takes a text and an optional reviver function, and returns
@@ -715,11 +734,11 @@ if (!JSON) {
// that modifications can be made.
var k, v, value = holder[key];
- if (value && typeof value === 'object') {
+ if(value && typeof value === 'object') {
for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
+ if(Object.prototype.hasOwnProperty.call(value, k)) {
v = walk(value, k);
- if (v !== undefined) {
+ if(v !== undefined) {
value[k] = v;
} else {
delete value[k];
@@ -737,7 +756,7 @@ if (!JSON) {
text = String(text);
cx.lastIndex = 0;
- if (cx.test(text)) {
+ if(cx.test(text)) {
text = text.replace(cx, function (a) {
return '\\u' +
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
@@ -757,7 +776,7 @@ if (!JSON) {
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
- if (/^[\],:{}\s]*$/
+ if(/^[\],:{}\s]*$/
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
@@ -793,6 +812,7 @@ if (!JSON) {
+// Implement toXML
(function(){
function __sanitize(value) {
@@ -806,7 +826,9 @@ if (!JSON) {
var xml = [];
switch( typeof o ) {
case "object":
- if(o.length) {
+ if( null === o ) {
+ xml.push("<{tag}/>".substitute({"tag":t}));// ??? right? wrong?
+ } else if(o.length) {
var a = o;
if(a.length === 0) {
xml.push("<{tag}/>".substitute({"tag":t}));
@@ -829,9 +851,12 @@ if (!JSON) {
} else {
xml.push(">");
for(var i = 0, len = childs.length; i < len; i++) {
- if(p === "#text") { xml.push(__sanitize(o[childs[i]])); }
- else if(p === "#cdata") { xml.push("<![CDATA[{code}]]>".substitute({"code": o[childs[i]].toString()})); }
- else if(p.charAt(0) !== "@") { xml.push(__toXML(o[childs[i]], childs[i])); }
+ if(p === "#text")
+ { xml.push(__sanitize(o[childs[i]])); }
+ else if(p === "#cdata")
+ { xml.push("<![CDATA[{code}]]>".substitute({"code": o[childs[i]].toString()})); }
+ else if(p.charAt(0) !== "@")
+ { xml.push(__toXML(o[childs[i]], childs[i])); }
}
xml.push("</{tag}>".substitute({"tag":t}));
}
@@ -843,13 +868,13 @@ if (!JSON) {
if(s.length === 0) {
xml.push("<{tag}/>".substitute({"tag":t}));
} else {
- xml.push("<{tag}>{value}</{tag}>".substitute({"tag":t, "value":__sanitize(s)}));
+ xml.push("<{tag}>{value}</{tag}>".substitute({"tag":t, "value":s}));
}
}
return xml.join('');
}
- if (typeof JSON.toXML !== 'function') {
+ if(typeof JSON.toXML !== 'function') {
JSON.toXML = function(json, container){
//container = container || "";
var xml = [];
@@ -866,4 +891,62 @@ if (!JSON) {
})();
+
+
+
+
+
+
+
+
+
+// Implement minify ( strip comments from json-like configuration files )
+(function(){
+ if(typeof JSON.minify !== 'function') {
+ JSON.minify = function(json) {
+ var tokenizer = /"|(\/\*)|(\*\/)|(\/\/)|\n|\r/g,
+ in_string = false,
+ in_multiline_comment = false,
+ in_singleline_comment = false,
+ tmp, tmp2, new_str = [], ns = 0, from = 0, lc, rc;
+
+ tokenizer.lastIndex = 0;
+
+ while( tmp = tokenizer.exec(json) ) {
+ lc = RegExp.leftContext;
+ rc = RegExp.rightContext;
+ if(!in_multiline_comment && !in_singleline_comment) {
+ tmp2 = lc.substring(from);
+ if(!in_string) {
+ tmp2 = tmp2.replace(/(\n|\r|\s)*/g,"");
+ }
+ new_str[ns++] = tmp2;
+ }
+ from = tokenizer.lastIndex;
+
+ if(tmp[0] == "\"" && !in_multiline_comment && !in_singleline_comment) {
+ tmp2 = lc.match(/(\\)*$/);
+ if(!in_string || !tmp2 || (tmp2[0].length % 2) == 0) { // start of string with ", or unescaped " character found to end string
+ in_string = !in_string;
+ }
+ from--; // include " character in next catch
+ rc = json.substring(from);
+ } else if(tmp[0] == "/*" && !in_string && !in_multiline_comment && !in_singleline_comment) {
+ in_multiline_comment = true;
+ } else if(tmp[0] == "*/" && !in_string && in_multiline_comment && !in_singleline_comment) {
+ in_multiline_comment = false;
+ } else if(tmp[0] == "//" && !in_string && !in_multiline_comment && !in_singleline_comment) {
+ in_singleline_comment = true;
+ } else if((tmp[0] == "\n" || tmp[0] == "\r") && !in_string && !in_multiline_comment && in_singleline_comment) {
+ in_singleline_comment = false;
+ } else if(!in_multiline_comment && !in_singleline_comment && !(/\n|\r|\s/.test(tmp[0]))) {
+ new_str[ns++] = tmp[0];
+ }
+ }
+ new_str[ns++] = rc;
+ return new_str.join("");
+ }
+ }
+})();
+
</script>
View
126 lib/axe/classes/Parsers/jsonpath.asp
@@ -0,0 +1,126 @@
+<script language="Javascript" runat="server">
+
+var JSONPath = (function(){
+
+ /* JSONPath 0.8.0 - XPath for JSON
+ *
+ * Copyright (c) 2007 Stefan Goessner (goessner.net)
+ * Licensed under the MIT (MIT-LICENSE.txt) licence.
+ */
+ function jsonPath(obj, expr, arg) {
+ var P = {
+
+ resultType: arg && arg.resultType || "VALUE",
+
+ result: [],
+
+ normalize: function (expr) {
+ var subx = [];
+ return expr.replace(/[\['](\??\(.*?\))[\]']/g, function ($0, $1) {
+ return "[#" + (subx.push($1) - 1) + "]";
+ })
+ .replace(/'?\.'?|\['?/g, ";")
+ .replace(/;;;|;;/g, ";..;")
+ .replace(/;$|'?\]|'$/g, "")
+ .replace(/#([0-9]+)/g, function ($0, $1) {
+ return subx[$1];
+ });
+ },
+
+ asPath: function (path) {
+ var x = path.split(";"),
+ p = "$";
+ for (var i = 1, n = x.length; i < n; i++)
+ p += /^[0-9*]+$/.test(x[i]) ? ("[" + x[i] + "]") : ("['" + x[i] + "']");
+ return p;
+ },
+
+ store: function (p, v) {
+ if (p) P.result[P.result.length] = P.resultType == "PATH" ? P.asPath(p) : v;
+ return !!p;
+ },
+
+ trace: function (expr, val, path) {
+ if (expr) {
+ var x = expr.split(";"),
+ loc = x.shift();
+ x = x.join(";");
+ if (val && val.hasOwnProperty(loc)) P.trace(x, val[loc], path + ";" + loc);
+ else if (loc === "*") P.walk(loc, x, val, path, function (m, l, x, v, p) {
+ P.trace(m + ";" + x, v, p);
+ });
+ else if (loc === "..") {
+ P.trace(x, val, path);
+ P.walk(loc, x, val, path, function (m, l, x, v, p) {
+ typeof v[m] === "object" && P.trace("..;" + x, v[m], p + ";" + m);
+ });
+ } else if (/,/.test(loc)) { // [name1,name2,...]
+ for (var s = loc.split(/'?,'?/), i = 0, n = s.length; i < n; i++)
+ P.trace(s[i] + ";" + x, val, path);
+ } else if (/^\(.*?\)$/.test(loc)) // [(expr)]
+ P.trace(P.eval(loc, val, path.substr(path.lastIndexOf(";") + 1)) + ";" + x, val, path);
+ else if (/^\?\(.*?\)$/.test(loc)) // [?(expr)]
+ P.walk(loc, x, val, path, function (m, l, x, v, p) {
+ if (P.eval(l.replace(/^\?\((.*?)\)$/, "$1"), v[m], m)) P.trace(m + ";" + x, v, p);
+ });
+ else if (/^(-?[0-9]*):(-?[0-9]*):?([0-9]*)$/.test(loc)) // [start:end:step] phyton slice syntax
+ P.slice(loc, x, val, path);
+ } else P.store(path, val);
+ },
+
+ walk: function (loc, expr, val, path, f) {
+ if (val instanceof Array) {
+ for (var i = 0, n = val.length; i < n; i++)
+ if (i in val) f(i, loc, expr, val, path);
+ } else if (typeof val === "object") {
+ for (var m in val)
+ if (val.hasOwnProperty(m)) f(m, loc, expr, val, path);
+ }
+ },
+
+ slice: function (loc, expr, val, path) {
+ if (val instanceof Array) {
+ var len = val.length,
+ start = 0,
+ end = len,
+ step = 1;
+ loc.replace(/^(-?[0-9]*):(-?[0-9]*):?(-?[0-9]*)$/g, function ($0, $1, $2, $3) {
+ start = parseInt($1 || start);
+ end = parseInt($2 || end);
+ step = parseInt($3 || step);
+ });
+ start = (start < 0) ? Math.max(0, start + len) : Math.min(len, start);
+ end = (end < 0) ? Math.max(0, end + len) : Math.min(len, end);
+ for (var i = start; i < end; i += step)
+ P.trace(i + ";" + expr, val, path);
+ }
+ },
+
+ eval: function (x, _v, _vname) {
+ try {
+ return $ && _v && eval(x.replace(/@/g, "_v"));
+ } catch (e) {
+ throw new SyntaxError("jsonPath: " + e.message + ": " + x.replace(/@/g, "_v")
+ .replace(/\^/g, "_a"));
+ }
+ }
+
+ };
+
+ var $ = obj;
+ if (expr && obj && (P.resultType == "VALUE" || P.resultType == "PATH")) {
+ P.trace(P.normalize(expr)
+ .replace(/^\$;/, ""), obj, "$");
+ return P.result.length ? P.result : false;
+ }
+ }
+
+ return {
+
+ "evaluate": jsonPath
+
+ };
+
+}());
+
+</script>
View
820 lib/axe/classes/Parsers/mustache.asp
@@ -147,87 +147,41 @@ set DS = nothing
-/*!
- * mustache.js - Logic-less {{mustache}} templates with JavaScript
- * http://github.com/janl/mustache.js
- */
-var Mustache = (typeof module !== "undefined" && module.exports) || {};
-
-(function (exports) {
-
- exports.name = "mustache.js";
- exports.version = "0.5.0-dev";
- exports.tags = ["{{", "}}"];
- exports.parse = parse;
- exports.compile = compile;
- exports.render = render;
- exports.clearCache = clearCache;
-
- // This is here for backwards compatibility with 0.4.x.
- exports.to_html = function (template, view, partials, send) {
- var result = render(template, view, partials);
-
- if (typeof send === "function") {
- send(result);
- } else {
- return result;
- }
- };
+/*
+ mustache.js — Logic-less templates in JavaScript
- var _toString = Object.prototype.toString;
- var _isArray = Array.isArray;
- var _forEach = Array.prototype.forEach;
- var _trim = String.prototype.trim;
+ See http://mustache.github.com/ for more info.
+*/
- var isArray;
- if (_isArray) {
- isArray = _isArray;
- } else {
- isArray = function (obj) {
- return _toString.call(obj) === "[object Array]";
- };
- }
+var Mustache = function () {
+ var _toString = Object.prototype.toString;
- var forEach;
- if (_forEach) {
- forEach = function (obj, callback, scope) {
- return _forEach.call(obj, callback, scope);
- };
- } else {
- forEach = function (obj, callback, scope) {
- for (var i = 0, len = obj.length; i < len; ++i) {
- callback.call(scope, obj[i], i, obj);
- }
- };
+ Array.isArray = Array.isArray || function (obj) {
+ return _toString.call(obj) == "[object Array]";
}
- var spaceRe = /^\s*$/;
-
- function isWhitespace(string) {
- return spaceRe.test(string);
- }
+ var _trim = String.prototype.trim, trim;
- var trim;
if (_trim) {
- trim = function (string) {
- return string == null ? "" : _trim.call(string);
- };
+ trim = function (text) {
+ return text == null ? "" : _trim.call(text);
+ }
} else {
var trimLeft, trimRight;
- if (isWhitespace("\xA0")) {
- trimLeft = /^\s+/;
- trimRight = /\s+$/;
- } else {
- // IE doesn't match non-breaking spaces with \s, thanks jQuery.
+ // IE doesn't match non-breaking spaces with \s.
+ if ((/\S/).test("\xA0")) {
trimLeft = /^[\s\xA0]+/;
trimRight = /[\s\xA0]+$/;
+ } else {
+ trimLeft = /^\s+/;
+ trimRight = /\s+$/;
}
- trim = function (string) {
- return string == null ? "" :
- String(string).replace(trimLeft, "").replace(trimRight, "");
- };
+ trim = function (text) {
+ return text == null ? "" :
+ text.toString().replace(trimLeft, "").replace(trimRight, "");
+ }
}
var escapeMap = {
@@ -239,450 +193,396 @@ var Mustache = (typeof module !== "undefined" && module.exports) || {};
};
function escapeHTML(string) {
- return String(string).replace(/&(?!\w+;)|[<>"']/g, function (s) {
+ return String(string).replace(/&(?!#?\w+;)|[<>"']/g, function (s) {
return escapeMap[s] || s;
});
}
- /**
- * Adds the `template`, `line`, and `file` properties to the given error
- * object and alters the message to provide more useful debugging information.
- */
- function debug(e, template, line, file) {
- file = file || "<template>";
-
- var lines = template.split("\n"),
- start = Math.max(line - 3, 0),
- end = Math.min(lines.length, line + 3),
- context = lines.slice(start, end);
-
- var c;
- for (var i = 0, len = context.length; i < len; ++i) {
- c = i + start + 1;
- context[i] = (c === line ? " >> " : " ") + context[i];
- }
-
- e.template = template;
- e.line = line;
- e.file = file;
- e.message = [file + ":" + line, context.join("\n"), "", e.message].join("\n");
+ var regexCache = {};
+ var Renderer = function () {};
+
+ Renderer.prototype = {
+ otag: "{{",
+ ctag: "}}",
+ pragmas: {},
+ buffer: [],
+ pragmas_implemented: {
+ "IMPLICIT-ITERATOR": true
+ },
+ context: {},
+
+ render: function (template, context, partials, in_recursion) {
+ // reset buffer & set context
+ if (!in_recursion) {
+ this.context = context;
+ this.buffer = []; // TODO: make this non-lazy
+ }
- return e;
- }
+ // fail fast
+ if (!this.includes("", template)) {
+ if (in_recursion) {
+ return template;
+ } else {
+ this.send(template);
+ return;
+ }
+ }
- /**
- * Looks up the value of the given `name` in the given context `stack`.
- */
- function lookup(name, stack, defaultValue) {
- if (name === ".") {
- return stack[stack.length - 1];
- }
+ // get the pragmas together
+ template = this.render_pragmas(template);
- var names = name.split(".");
- var lastIndex = names.length - 1;
- var target = names[lastIndex];
+ // render the template
+ var html = this.render_section(template, context, partials);
- var value, context, i = stack.length, j, localStack;
- while (i) {
- localStack = stack.slice(0);
- context = stack[--i];
+ // render_section did not find any sections, we still need to render the tags
+ if (html === false) {
+ html = this.render_tags(template, context, partials, in_recursion);
+ }
- j = 0;
- while (j < lastIndex) {
- context = context[names[j++]];
+ if (in_recursion) {
+ return html;
+ } else {
+ this.sendLines(html);
+ }
+ },
+
+ /*
+ Sends parsed lines
+ */
+ send: function (line) {
+ if (line !== "") {
+ this.buffer.push(line);
+ }
+ },
- if (context == null) {
- break;
+ sendLines: function (text) {
+ if (text) {
+ var lines = text.split("\n");
+ for (var i = 0; i < lines.length; i++) {
+ this.send(lines[i]);
}
-
- localStack.push(context);
}
+ },
+
+ /*
+ Looks for %PRAGMAS
+ */
+ render_pragmas: function (template) {
+ // no pragmas
+ if (!this.includes("%", template)) {
+ return template;
+ }
+
+ var that = this;
+ var regex = this.getCachedRegex("render_pragmas", function (otag, ctag) {
+ return new RegExp(otag + "%([\\w-]+) ?([\\w]+=[\\w]+)?" + ctag, "g");
+ });
- if (context && typeof context === "object" && target in context) {
- value = context[target];
- break;
+ return template.replace(regex, function (match, pragma, options) {
+ if (!that.pragmas_implemented[pragma]) {
+ throw({message:
+ "This implementation of mustache doesn't understand the '" +
+ pragma + "' pragma"});
+ }
+ that.pragmas[pragma] = {};
+ if (options) {
+ var opts = options.split("=");
+ that.pragmas[pragma][opts[0]] = opts[1];
+ }
+ return "";
+ // ignore unknown pragmas silently
+ });
+ },
+
+ /*
+ Tries to find a partial in the curent scope and render it
+ */
+ render_partial: function (name, context, partials) {
+ name = trim(name);
+ if (!partials || partials[name] === undefined) {
+ throw({message: "unknown_partial '" + name + "'"});
+ }
+ if (!context || typeof context[name] != "object") {
+ return this.render(partials[name], context, partials, true);
+ }
+ return this.render(partials[name], context[name], partials, true);
+ },
+
+ /*
+ Renders inverted (^) and normal (#) sections
+ */
+ render_section: function (template, context, partials) {
+ if (!this.includes("#", template) && !this.includes("^", template)) {
+ // did not render anything, there were no sections
+ return false;
}
- }
- // If the value is a function, call it in the current context.
- if (typeof value === "function") {
- value = value.call(localStack[localStack.length - 1]);
- }
+ var that = this;
- if (value == null) {
- return defaultValue;
- }
+ var regex = this.getCachedRegex("render_section", function (otag, ctag) {
+ // This regex matches _the first_ section ({{#foo}}{{/foo}}), and captures the remainder
+ return new RegExp(
+ "^([\\s\\S]*?)" + // all the crap at the beginning that is not {{*}} ($1)
- return value;
- }
+ otag + // {{
+ "(\\^|\\#)\\s*(.+?)\\s*" +// #foo (# == $2, foo == $3), not greedy
+ ctag + // }}
- function renderSection(name, stack, callback, inverted) {
- var buffer = "";
- var value = lookup(name, stack);
+ "\n*([\\s\\S]*?)" + // between the tag ($2). leading newlines are dropped
- if (inverted) {
- // From the spec: inverted sections may render text once based on the
- // inverse value of the key. That is, they will be rendered if the key
- // doesn't exist, is false, or is an empty list.
- if (value == null || value === false || (isArray(value) && value.length === 0)) {
- buffer += callback();
- }
- } else if (isArray(value)) {
- forEach(value, function (value) {
- stack.push(value);
- buffer += callback();
- stack.pop();
- });
- } else if (typeof value === "object") {
- stack.push(value);
- buffer += callback();
- stack.pop();
- } else if (typeof value === "function") {
- var scope = stack[stack.length - 1];
- var scopedRender = function (template) {
- return render(template, scope);
- };
- buffer += value.call(scope, callback(), scopedRender) || "";
- } else if (value) {
- buffer += callback();
- }
+ otag + // {{
+ "\\/\\s*\\3\\s*" + // /foo (backreference to the opening tag).
+ ctag + // }}
- return buffer;
- }
+ "\\s*([\\s\\S]*)$", // everything else in the string ($4). leading whitespace is dropped.
- /**
- * Parses the given `template` and returns the source of a function that,
- * with the proper arguments, will render the template. Recognized options
- * include the following:
- *
- * - file The name of the file the template comes from (displayed in
- * error messages)
- * - tags An array of open and close tags the `template` uses. Defaults
- * to the value of Mustache.tags
- * - debug Set `true` to log the body of the generated function to the
- * console
- * - space Set `true` to preserve whitespace from lines that otherwise
- * contain only a {{tag}}. Defaults to `false`
- */
- function parse(template, options) {
- options = options || {};
-
- var tags = options.tags || exports.tags,
- openTag = tags[0],
- closeTag = tags[tags.length - 1];
-
- var code = [
- 'var buffer = "";', // output buffer
- "\nvar line = 1;", // keep track of source line number
- "\ntry {",
- '\nbuffer += "'
- ];
-
- var spaces = [], // indices of whitespace in code on the current line
- hasTag = false, // is there a {{tag}} on the current line?
- nonSpace = false; // is there a non-space char on the current line?
-
- // Strips all space characters from the code array for the current line
- // if there was a {{tag}} on it and otherwise only spaces.
- var stripSpace = function () {
- if (hasTag && !nonSpace && !options.space) {
- while (spaces.length) {
- code.splice(spaces.pop(), 1);
- }
- } else {
- spaces = [];
- }
+ "g");
+ });
- hasTag = false;
- nonSpace = false;
- };
-
- var sectionStack = [], updateLine, nextOpenTag, nextCloseTag;
-
- var setTags = function (source) {
- tags = trim(source).split(/\s+/);
- nextOpenTag = tags[0];
- nextCloseTag = tags[tags.length - 1];
- };
-
- var includePartial = function (source) {
- code.push(
- '";',
- updateLine,
- '\nvar partial = partials["' + trim(source) + '"];',
- '\nif (partial) {',
- '\n buffer += render(partial,stack[stack.length - 1],partials);',
- '\n}',
- '\nbuffer += "'
- );
- };
-
- var openSection = function (source, inverted) {
- var name = trim(source);
-
- if (name === "") {
- throw debug(new Error("Section name may not be empty"), template, line, options.file);
- }
- sectionStack.push({name: name, inverted: inverted});
-
- code.push(
- '";',
- updateLine,
- '\nvar name = "' + name + '";',
- '\nvar callback = (function () {',
- '\n return function () {',
- '\n var buffer = "";',
- '\nbuffer += "'
- );
- };
-
- var openInvertedSection = function (source) {
- openSection(source, true);
- };
-
- var closeSection = function (source) {
- var name = trim(source);
- var openName = sectionStack.length != 0 && sectionStack[sectionStack.length - 1].name;
-
- if (!openName || name != openName) {
- throw debug(new Error('Section named "' + name + '" was never opened'), template, line, options.file);
- }
+ // for each {{#foo}}{{/foo}} section do...
+ return template.replace(regex, function (match, before, type, name, content, after) {
+ // before contains only tags, no sections
+ var renderedBefore = before ? that.render_tags(before, context, partials, true) : "",
- var section = sectionStack.pop();
+ // after may contain both sections and tags, so use full rendering function
+ renderedAfter = after ? that.render(after, context, partials, true) : "",
- code.push(
- '";',
- '\n return buffer;',
- '\n };',
- '\n})();'
- );
+ // will be computed below
+ renderedContent,
- if (section.inverted) {
- code.push("\nbuffer += renderSection(name,stack,callback,true);");
- } else {
- code.push("\nbuffer += renderSection(name,stack,callback);");
- }
+ value = that.find(name, context);
- code.push('\nbuffer += "');
- };
-
- var sendPlain = function (source) {
- code.push(
- '";',
- updateLine,
- '\nbuffer += lookup("' + trim(source) + '",stack,"");',
- '\nbuffer += "'
- );
- };
-
- var sendEscaped = function (source) {
- code.push(
- '";',
- updateLine,
- '\nbuffer += escapeHTML(lookup("' + trim(source) + '",stack,""));',
- '\nbuffer += "'
- );
- };
-
- var line = 1, c, callback;
- for (var i = 0, len = template.length; i < len; ++i) {
- if (template.slice(i, i + openTag.length) === openTag) {
- i += openTag.length;
- c = template.substr(i, 1);
- updateLine = '\nline = ' + line + ';';
- nextOpenTag = openTag;
- nextCloseTag = closeTag;
- hasTag = true;
-
- switch (c) {
- case "!": // comment
- i++;
- callback = null;
- break;
- case "=": // change open/close tags, e.g. {{=<% %>=}}
- i++;
- closeTag = "=" + closeTag;
- callback = setTags;
- break;
- case ">": // include partial
- i++;
- callback = includePartial;
- break;
- case "#": // start section
- i++;
- callback = openSection;
- break;
- case "^": // start inverted section
- i++;
- callback = openInvertedSection;
- break;
- case "/": // end section
- i++;
- callback = closeSection;
- break;
- case "{": // plain variable
- closeTag = "}" + closeTag;
- // fall through
- case "&": // plain variable
- i++;
- nonSpace = true;
- callback = sendPlain;
- break;
- default: // escaped variable
- nonSpace = true;
- callback = sendEscaped;
+ if (type === "^") { // inverted section
+ if (!value || Array.isArray(value) && value.length === 0) {
+ // false or empty list, render it
+ renderedContent = that.render(content, context, partials, true);
+ } else {
+ renderedContent = "";
+ }
+ } else if (type === "#") { // normal section
+ if (Array.isArray(value)) { // Enumerable, Let's loop!
+ renderedContent = that.map(value, function (row) {
+ return that.render(content, that.create_context(row), partials, true);
+ }).join("");
+ } else if (that.is_object(value)) { // Object, Use it as subcontext!
+ renderedContent = that.render(content, that.create_context(value),
+ partials, true);
+ } else if (typeof value == "function") {
+ // higher order section
+ renderedContent = value.call(context, content, function (text) {
+ return that.render(text, context, partials, true);
+ });
+ } else if (value) { // boolean section
+ renderedContent = that.render(content, context, partials, true);
+ } else {
+ renderedContent = "";
+ }
}
- var end = template.indexOf(closeTag, i);
+ return renderedBefore + renderedContent + renderedAfter;
+ });
+ },
+
+ /*
+ Replace {{foo}} and friends with values from our view
+ */
+ render_tags: function (template, context, partials, in_recursion) {
+ // tit for tat
+ var that = this;
+
+ var new_regex = function () {
+ return that.getCachedRegex("render_tags", function (otag, ctag) {
+ return new RegExp(otag + "(=|!|>|&|\\{|%)?([^#\\^]+?)\\1?" + ctag + "+", "g");
+ });
+ };
- if (end === -1) {
- throw debug(new Error('Tag "' + openTag + '" was not closed properly'), template, line, options.file);
+ var regex = new_regex();
+ var tag_replace_callback = function (match, operator, name) {