{$function-name/node()}
-
{ $function/xqdoc:signature/node() }
+
{ $function/xqdoc:signature/node() }
{ $parsed }
@@ -286,7 +266,7 @@ declare %private function app:print-function($function as element(xqdoc:function
if ($details and exists($extDocs)) then
Detailed Description
- { app:parse-markdown($extDocs) }
+ { app:include-markdown($extDocs) }
else
()
@@ -295,15 +275,12 @@ declare %private function app:print-function($function as element(xqdoc:function
};
-declare %private function app:parse-markdown($path as xs:string) {
- if ($app:MD_HAS_MODULE) then
- let $expr :=
- 'import module namespace markdown="http://exist-db.org/xquery/markdown";' ||
- 'markdown:parse(util:binary-to-string(util:binary-doc($path)), ($markdown:HTML-CONFIG, $app:MD_CONFIG))'
- return
- util:eval($expr)
- else
-
Install markdown parser module via dashboard to display extended documentation.
+declare %private
+function app:include-markdown ($path as xs:string) as element(div) {
+ element div {
+ attribute class { "markdown" },
+ $path => util:binary-doc() => util:binary-to-string()
+ }
};
declare %private function app:print-parameters($params as element(xqdoc:param)*) {
@@ -354,27 +331,6 @@ declare %private function app:get-extended-module-doc($module as element(xqdoc:x
()
};
-(: ~
- : If eXide is installed, we can load ace locally. If not, download ace
- : from cloudfront.
- :)
-declare function app:import-ace($node as node(), $model as map(*)) {
- let $eXideInstalled := doc-available("/db/eXide/repo.xml")
- let $path :=
- if ($eXideInstalled) then
- "../eXide/resources/scripts/ace/"
- else
- "//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/"
- for $script in $node/script
- return
-
-};
-
declare
%templates:default("w3c", "false")
%templates:default("extensions", "false")
diff --git a/src/main/xar-resources/modules/config.xqm b/src/main/xar-resources/modules/config.xqm
index 897bae2..8a10733 100644
--- a/src/main/xar-resources/modules/config.xqm
+++ b/src/main/xar-resources/modules/config.xqm
@@ -1,4 +1,4 @@
-xquery version "3.0";
+xquery version "3.1";
(:~
: A set of helper functions to access the application context from
diff --git a/src/main/xar-resources/modules/dbutil.xqm b/src/main/xar-resources/modules/dbutil.xqm
new file mode 100644
index 0000000..eb5bc72
--- /dev/null
+++ b/src/main/xar-resources/modules/dbutil.xqm
@@ -0,0 +1,66 @@
+xquery version "3.1";
+
+(:~
+ : this version of the dbutil module was copied
+ : from shared resources v0.9.1
+ :)
+module namespace dbutil="http://exist-db.org/xquery/dbutil";
+
+import module namespace sm="http://exist-db.org/xquery/securitymanager";
+import module namespace xmldb="http://exist-db.org/xquery/xmldb";
+
+(:~ Scan a collection tree recursively starting at $root. Call $func once for each collection found :)
+declare function dbutil:scan-collections($root as xs:anyURI, $func as function(xs:anyURI) as item()*) {
+ $func($root),
+ if (sm:has-access($root, "rx")) then
+ for $child in xmldb:get-child-collections($root)
+ return
+ dbutil:scan-collections(xs:anyURI($root || "/" || $child), $func)
+ else
+ ()
+};
+
+(:~
+ : List all resources contained in a collection and call the supplied function once for each
+ : resource with the complete path to the resource as parameter.
+ :)
+declare function dbutil:scan-resources($collection as xs:anyURI, $func as function(xs:anyURI) as item()*) {
+ if (sm:has-access($collection, "rx")) then
+ for $child in xmldb:get-child-resources($collection)
+ return
+ $func(xs:anyURI($collection || "/" || $child))
+ else
+ ()
+};
+
+(:~
+ : Scan a collection tree recursively starting at $root. Call the supplied function once for each
+ : resource encountered. The first parameter to $func is the collection URI, the second the resource
+ : path (including the collection part).
+ :)
+declare function dbutil:scan($root as xs:anyURI, $func as function(xs:anyURI, xs:anyURI?) as item()*) {
+ dbutil:scan-collections($root, function($collection as xs:anyURI) {
+ $func($collection, ()),
+ (: scan-resources expects a function with one parameter, so we use a partial application
+ to fill in the collection parameter :)
+ dbutil:scan-resources($collection, $func($collection, ?))
+ })
+};
+
+declare function dbutil:find-by-mimetype($collection as xs:anyURI, $mimeType as xs:string+) {
+ dbutil:scan($collection, function($collection, $resource) {
+ if (exists($resource) and xmldb:get-mime-type($resource) = $mimeType) then
+ $resource
+ else
+ ()
+ })
+};
+
+declare function dbutil:find-by-mimetype($collection as xs:anyURI, $mimeType as xs:string+, $func as function(xs:anyURI) as item()*) {
+ dbutil:scan($collection, function($collection, $resource) {
+ if (exists($resource) and xmldb:get-mime-type($resource) = $mimeType) then
+ $func($resource)
+ else
+ ()
+ })
+};
\ No newline at end of file
diff --git a/src/main/xar-resources/modules/reindex.xql b/src/main/xar-resources/modules/reindex.xql
index ba42938..996bcdb 100644
--- a/src/main/xar-resources/modules/reindex.xql
+++ b/src/main/xar-resources/modules/reindex.xql
@@ -1,4 +1,4 @@
-xquery version "3.0";
+xquery version "3.1";
import module namespace docs="http://exist-db.org/xquery/docs" at "scan.xql";
import module namespace config="http://exist-db.org/xquery/apps/config" at "config.xqm";
diff --git a/src/main/xar-resources/modules/scan.xql b/src/main/xar-resources/modules/scan.xql
index 18ff31e..1d45ec3 100644
--- a/src/main/xar-resources/modules/scan.xql
+++ b/src/main/xar-resources/modules/scan.xql
@@ -1,15 +1,15 @@
-xquery version "3.0";
+xquery version "3.1";
module namespace docs="http://exist-db.org/xquery/docs";
-import module namespace xdb="http://exist-db.org/xquery/xmldb";
-import module namespace dbutil="http://exist-db.org/xquery/dbutil";
+import module namespace xmldb="http://exist-db.org/xquery/xmldb";
+import module namespace dbutil="http://exist-db.org/xquery/dbutil" at "dbutil.xqm";
import module namespace inspect="http://exist-db.org/xquery/inspection" at "java:org.exist.xquery.functions.inspect.InspectionModule";
declare namespace xqdoc="http://www.xqdoc.org/1.0";
declare %private function docs:create-collection($parent as xs:string, $child as xs:string) as empty-sequence() {
- let $null := xdb:create-collection($parent, $child)
+ let $null := xmldb:create-collection($parent, $child)
return ()
};
@@ -64,12 +64,12 @@ declare %private function docs:load-internal-modules($store as function(xs:strin
};
declare function docs:load-fundocs($target as xs:string) {
- let $dataColl := xdb:create-collection($target, "data")
+ let $dataColl := xmldb:create-collection($target, "data")
let $store := function($moduleURI as xs:string, $data as element()) {
let $name := util:hash($moduleURI, "md5") || ".xml"
return
(
- xdb:store($dataColl, $name, $data),
+ xmldb:store($dataColl, $name, $data),
sm:chmod(xs:anyURI($dataColl || "/" || $name), "rw-rw-r--")
)[2]
}
diff --git a/src/main/xar-resources/modules/view.xql b/src/main/xar-resources/modules/view.xql
index d001b54..b8012e2 100644
--- a/src/main/xar-resources/modules/view.xql
+++ b/src/main/xar-resources/modules/view.xql
@@ -1,9 +1,8 @@
-xquery version "3.0";
+xquery version "3.1";
import module namespace app="http://exist-db.org/xquery/app" at "app.xql";
import module namespace config="http://exist-db.org/xquery/apps/config" at "config.xqm";
-import module namespace site="http://exist-db.org/apps/site-utils";
import module namespace templates="http://exist-db.org/xquery/html-templating";
import module namespace lib="http://exist-db.org/xquery/html-templating/lib";
diff --git a/src/main/xar-resources/resources/css/exist.css b/src/main/xar-resources/resources/css/exist.css
new file mode 100644
index 0000000..947e6fb
--- /dev/null
+++ b/src/main/xar-resources/resources/css/exist.css
@@ -0,0 +1,448 @@
+/* ---------------------------------------- FONTS ---------------------------------------- */
+@font-face {
+ font-family: "QuicksandBook";
+ src: url("../fonts/Quicksand_Book-webfont.eot");
+ src: url("../fonts/Quicksand_Book-webfont.eot?#iefix") format("embedded-opentype"),
+ url("../fonts/Quicksand_Book-webfont.woff") format("woff"),
+ url("../fonts/Quicksand_Book-webfont.ttf") format("truetype"),
+ url("../fonts/Quicksand_Book-webfont.svg#QuicksandBook") format("svg");
+ font-weight: normal;
+ font-style: normal;
+}
+/* ---------------------------------------- VARIABLES ---------------------------------------- */
+/* ------------------------------------ Documentation styles ---------------------------------- */
+.content {
+ font: 16px/24px Georgia, "Times New Roman", Times, serif;
+ color: #555;
+}
+.content section {
+ clear: both;
+}
+.content h1 {
+ font-family: "QuicksandBook", "Arial", Helvetica, sans-serif;
+ font-size: 1.75em;
+ font-weight: bold;
+ margin: 0.8em 0 0 0;
+}
+.content h2 {
+ color: #0083cb;
+ font-family: "QuicksandBook", "Arial", Helvetica, sans-serif;
+ font-size: 1.33em;
+ font-weight: bold;
+ margin: 0.3em 0 0;
+ padding: 10px 0 5px;
+}
+.content h3 {
+ font-size: 1em;
+ font-weight: bold;
+}
+.content table {
+ margin: 0.5em 1em;
+}
+.content td,
+.entry th {
+ padding: 6px 4px;
+}
+.content .strong {
+ font-weight: bold;
+}
+.content em {
+ font-style: italic;
+}
+.content code {
+ font-size: 0.92em;
+ background-color: transparent;
+ border: 0;
+ color: inherit;
+}
+.content .option {
+ font-weight: bold;
+ font-style: italic;
+}
+.content blockquote {
+ font-style: italic;
+ text-align: justify;
+ padding: 10px 15px 0 15px;
+ border: 1px solid #abe1ff;
+ background: #fff;
+ margin: 5px 0 10px;
+}
+.content blockquote h3 {
+ padding: 0;
+ border: 0;
+ margin: 0;
+ font-size: 12px;
+ color: #0083cb;
+}
+.content blockquote p {
+ padding: 0 0 10px;
+}
+.content ul,
+.content ol {
+ margin: 0 1.5em;
+}
+.content ul li {
+ list-style: disc;
+ margin-bottom: 0.4em;
+}
+.content ol li {
+ list-style: decimal;
+ margin-bottom: 0.4em;
+}
+.content dl.wide dt {
+ width: 260px;
+ word-wrap: break-word;
+}
+.content dl.wide dd {
+ margin-left: 270px;
+}
+#content .content dt {
+ font-weight: bold;
+ word-wrap: break-word;
+}
+.content img {
+ margin: 8px auto;
+ max-width: 100%;
+}
+.content td img {
+ max-width: inherit;
+}
+.content figure {
+ margin: 0 1em 1em 1em;
+}
+.content figure.float-left {
+ float: left;
+ margin-right: 1em;
+ width: 50%;
+ display: inline-block;
+}
+.content figure.float-right {
+ float: right;
+ margin-left: 1em;
+ width: 50%;
+ display: inline-block;
+}
+.content .img-float-left {
+ float: left;
+ margin-right: 10px;
+}
+.content .img-float-right {
+ float: right;
+ width: inherit;
+ margin-left: 10px;
+}
+.content pre.prettyprint {
+ padding: 10px 16px;
+ margin-bottom: 0.85em;
+}
+.content .guimenuitem {
+ background: #fef8c4;
+}
+.content .example {
+ margin: 0.25em 0 0.25em 1em;
+ padding: 10px 10px;
+ border: 1px solid #707070;
+}
+.content .dl-horizontal dd {
+ margin-left: 150px;
+}
+.content .dl-horizontal dt {
+ text-align: left;
+ width: 140px;
+ word-wrap: break-word;
+}
+/* ---------------------------------------- LAYOUT ---------------------------------------- */
+body {
+ color: #222;
+ background: url(../images/body.gif) repeat 50% 100%;
+}
+.grey-bot {
+ /* background: url(../images/body-base.gif) repeat-x 50% 100%;*/
+ padding-bottom: 2em;
+}
+#container {
+ margin: 0 auto 30px auto;
+}
+@media (min-width: 767px) {
+ #grey-top {
+ background: #f3f3f3 url(../images/horizontal.gif) repeat-x 50% 0;
+ height: 100%;
+ position: relative;
+ }
+ #header {
+ width: 100%;
+ }
+ #header a#logo {
+ background: url(../images/existdb-web.svg) center left no-repeat;
+ display: block;
+ width: 220px;
+ height: 100px;
+ text-indent: -999em;
+ outline: 0;
+ margin: 10px 0;
+ }
+}
+@media (max-width: 767px) {
+ #grey-top {
+ background: #f3f3f3;
+ height: 100%;
+ }
+ #header {
+ display: none;
+ }
+}
+.navbar .container {
+ padding-left: 0;
+ padding-right: 0;
+}
+#content {
+ min-height: 600px;
+}
+#footer {
+ clear: both;
+ margin: 0 auto;
+ height: 50px;
+ color: #222;
+ background: url(../images/body.gif) repeat 50% 100%;
+}
+#footer .container {
+ padding-left: 0;
+ padding-right: 0;
+}
+#footer ul {
+ float: left;
+ margin: 0 0 0 -4px;
+ padding: 1em 1em 1em 0;
+}
+#footer ul li {
+ display: inline;
+}
+#footer ul li a {
+ padding: 2px 4px;
+ color: #ffcb05;
+}
+#footer ul li a:hover {
+ background: #333;
+}
+#copyright {
+ float: right;
+ width: 220px;
+ text-align: right;
+ padding-top: 1em;
+}
+#copyright p {
+ padding: 0;
+ color: #f3f3f3;
+}
+#poweredby {
+ float: right;
+ width: 120px;
+ height: 56px;
+ margin-bottom: 10px;
+ display: inline-block;
+ background: url(../images/powered-by.svg) no-repeat 50%;
+ background-size: 100% 100%;
+}
+/* ---------------------------------------- NAVBAR ---------------------------------------- */
+.navbar-default {
+ height: 60px;
+ background: transparent;
+ border: 0;
+ box-shadow: none;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+}
+.navbar .nav > li > a {
+ color: #fff;
+ text-align: center;
+ font: 1.2em/1em "QuicksandBook", "Arial", Helvetica, sans-serif;
+ padding: 18px 0;
+ text-shadow: none;
+}
+.navbar .nav > li > a:hover {
+ color: #ffcb05;
+}
+.navbar .nav > li > .dropdown-menu:before,
+.navbar .nav > li > .dropdown-menu:after {
+ display: none;
+}
+@media (max-width: 767px) {
+ .navbar-default {
+ height: auto;
+ margin-bottom: 20px;
+ background: url(../images/existdb-web.svg) center left no-repeat;
+ border-bottom: 10px solid #2e2e2e;
+ }
+ .navbar-collapse.in {
+ z-index: 1000;
+ position: absolute;
+ left: 10px;
+ right: 10px;
+ background-color: #fafafa;
+ background-image: linear-gradient(to bottom, #ffffff, #f2f2f2);
+ background-repeat: repeat-x;
+ border: 1px solid #d4d4d4;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ border-radius: 4px;
+ -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
+ -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
+ }
+ .navbar .nav > li > a {
+ padding: 9px 15px;
+ color: #777;
+ }
+ #sidebar {
+ display: none;
+ }
+ #about {
+ display: none;
+ }
+}
+@media (min-width: 767px) {
+ .navbar .nav li.dropdown.open > .dropdown-toggle {
+ background-color: transparent;
+ color: #ffcb05;
+ }
+ .navbar-nav > li > .dropdown-menu {
+ border-top-right-radius: 10px;
+ border-top-left-radius: 10px;
+ }
+ .nav > li {
+ height: 52px;
+ min-width: 150px;
+ vertical-align: middle;
+ background: url(../images/bgmenu.gif) no-repeat top center;
+ }
+ .nav .open {
+ background: url(../images/bgmenuhi.gif) no-repeat top center;
+ }
+ .dropdown-menu {
+ background: #0083cb;
+ -webkit-border-radius: 10px;
+ -moz-border-radius: 10px;
+ border-radius: 10px;
+ color: #fff;
+ margin: 0;
+ border: 0;
+ }
+ .dropdown-menu > li > a {
+ color: #fff;
+ font-size: 0.92em;
+ text-align: center;
+ }
+ .dropdown-menu > li > a:hover {
+ background: #222;
+ color: #ffcb05;
+ }
+}
+.navbar li#about {
+ display: none;
+}
+@media (min-width: 992px) {
+ .navbar li#about {
+ display: inline-block;
+ }
+}
+.navbar-search input {
+ margin-top: 4px;
+}
+.navbar-right,
+.navbar-right .search-query {
+ float: right;
+}
+#navigation .actions {
+ float: right;
+ margin: 8px 0 8px 0;
+}
+/* ---------------------------------------- GENERAL STYLES ---------------------------------------- */
+h1 {
+ font-size: 1.75em;
+ font-weight: bold;
+ margin: 0.8em 0 0 0;
+ padding: 0px 0 5px;
+ margin: 0;
+ font-family: "QuicksandBook", "Arial", Helvetica, sans-serif;
+ color: #0083cb;
+}
+h2 {
+ font-size: 1.2em;
+ padding: 10px 0;
+ font-weight: bold;
+ font-family: "QuicksandBook", "Arial", Helvetica, sans-serif;
+ letter-spacing: 1px;
+}
+h3 {
+ font-size: 1.2em;
+ padding: 10px 0 5px;
+ margin: 0 0 5px;
+ font-weight: bold;
+}
+h4 {
+ font-size: 1em;
+ padding: 10px 0;
+ font-style: italic;
+ font-weight: normal;
+}
+h5 {
+ font-size: 1em;
+ padding: 10px 0;
+ font-weight: normal;
+}
+a {
+ color: #0083cb;
+ text-decoration: none;
+}
+a:hover {
+ color: #ffcb05;
+}
+.clear {
+ clear: both;
+}
+.imgborder {
+ border: 1px solid #ccc;
+ padding: 3px;
+ margin: 3px;
+}
+figure img {
+ display: block;
+}
+figcaption {
+ font-size: 0.85em;
+ text-align: center;
+}
+form {
+ margin: 20px 0;
+}
+input:required:invalid,
+fieldset input:focus:invalid {
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAwBQTFRFvy8atzQfvzEWvDEXuzEZujIbuzEdvzAZvTAbvjAcvDAdvTIdrzcnszQisTQltTIitzQgtjUhsTssuDEguTIgujQgvD0nqkAutkM2tko5u0c4ul5Qwi8Zwy8awC8bxS4ZxiwcwTEZwDEawTAbwDAcwDEdwzIexjAaxTIZyDAbyjAcyTMdzzEazjEbzzAe0TIb0zMd0zQb1DIc1TQb1TQc1jYc1jYd1zgc2jQb2DUd2TQe2zYc3DUc3jgbxzYh1j4m4DYZ5jcZ5zYb5jYc5Dga5Dgd6TYf7Dcd7zce6zgZ6Dga7Dse7j0e8jcd8zYe8DYf8Tkb8zgd8joc8Toe8Dwf9jkb9Doc4zki5j4n6T0h7jghxkIsx0MuzUUt00Ep2kIt1kg13VE97EEm6Ugu4E064FQ98UIn8kMo80Mp90Ep9UMq3VpD3F1KxmdZw2haw2hbxGhaxGhbwW1hwHdpxndp2H1u4FlH4mVT63Jb9mZO92ZP9WhN+GVN+2RQ4HVlvIB13odx4oNv5IZy54h29o55+4p6+4t7+Y14/Yl6yI+Ew5aPxpuTxqCXyaWe3baq5JSI65CB7pKC9JKK66WX6rGb57ut6rOo7res5b6767yz+62i+q6j/qug/a2i87Cl9rGh9rOq8b+19L+z+L2x48G48MO68sa/8ci96tDK8sbB/crE/crF/srG+87K/svJ/M3I99bR99fS+9bV+93Z8ebe+OHd+eXd/OTd8ebh9e3m9u3r+ufl/eXj/ubg/ufh/efi/ufj/uXk+ujj++nl+uvl+urm/ejh++7q+u/r+vDu+vLt/PDv/fPv/vTy+/j3/Pj0//j2//n3/vv0/vr1/vv2/fr3+/39+/79/vr4/vv6/v37/f77/v38/v39/f78/f79AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOe7jtQAAABl0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuODc7gF0AAAEbSURBVChTARAB7/4A1rmNdG5xb3BwcG5tc4y43QC6isjT0NDR1djY1NLTzIu4AImVvL/Gxsa+vr7BwL29qX8AGp6rqrPDsqyurbu8r6ujFwALg5ybotjLoJqw37GfnZEOAAlsiIaEp9qmk8/FkoWHdw8AIj98eX14tc601ZB7eXpfEQAjNGJoaWd+z9uWY2pmZjYQACEzQlJUVWvK149MVlNKORUAIzFDSFBYodnJx3ZRTkEzAQAkLUBHS4HYmXXVpVhPPS8NAAInNUVkwsRlWZfVgEQ6KA8AFh0uN5TNgk1aYba3YCwHDAByAyArW11XRklGXlw+HwAbAKgSBRwpMDo8OzgyKh4EFaQA3pgZEwYIJCYmJQgKFBiO3JMVcr8Z+l4TAAAAAElFTkSuQmCC");
+ background-position: right;
+ background-repeat: no-repeat;
+ -moz-box-shadow: none;
+}
+input:required:valid {
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAwBQTFRFU6E8UqA9U6A+U6A/VaA+VqA/V6I+WKM7WKA/WaI8WqI9WaQ+XaQ6XKQ8Zac9Z6w2Y6k6Z6w6aKo8bK45bq46d7M5fbU6fLY6frY8f7k5U59AU59BVJ9AU6BAUaBBVaBAVKFBVKBCX6JNXqZOYalRZqhSa6pfbapcb6pdbKpfcalbc6pbdKpccqdieKxofK9vf69xgLc5gLY9hrw3gLg4gLg5g7o4g7o5hLs4hLo5hLo6hbs8iL46jb1Ti7d+kMM0k8UwksU0lsQ2nskwnsgynsgzpswvqc8voMc8oMkyocozo8wzpMowpcs7rM8wrtEwrtA1ss8+sNIvtNMtttUuttYtt9Yvu9cuutgrvdkqvdksvNgtvdkvv9svsNM1ttI2utY0vdkxvtowvtsyv9ozvtg1vdwzv9k4vtg6lMRTrs5HtNNMps53rNN+wdhJwtlNw9hWyNxVx9tszd9iyuJPxeBRxuJQyuFTyuJQyuNRyuBW0eNz1OR91eR/1ut31+p41+p62Ot22Op42Op6lb6InsKRnsSUocKVrseir82mr82nrc6kr82oscWltMeusMiisM2msMyoss6r2+mNw+KgyueiyeSy1eq34/Gd4/Ce4/Cf4vKe4+2l5e6j4Oys5u+44/Cg5fCr5vGt6PC16fO26vO87ve/7fi87vi97vi/0uHO2+jW2unX6/TD7vfA7/jH8PbB8vbH8PbK9/rT9vrY9vrc9/vd+/3c+P7c+f7d+P7e6PDk6fTm6/Xo7/fr9ffh+vvl+P3g+f3h+fzi/f7m+/zq/f7s8vrx+f3x+v7w/f7x/v7y/v/z/v/0/v73/v75/v38/f7+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnz0KZQAAABl0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuODc7gF0AAAEbSURBVChTARAB7/4A0aqNkImJioyMjImLkY6r0QCsj8nLzMzMzMzMzczLyIi7AD6Xwbe5urq6urq4wsHAlocAIpWwp6apqa6urqiyw6+ULgAhbZibmpqZmqCgorakmWwmAARpf4B/f4OBg5O0oYJ+PScACjt2eXR4eHhzsaN6d3UyKgALOF5mYl1jZ5yzb2JkUDUsAAs3RmBxZVx7xnxhWVZMMSsABhdKcsSdcLWyaFpYUkQVKAAgFEJrn8q/zn1aW1RHPxEpAB8MNklRns/FbldVT0U0BykAJQISPEVqraVfU05DMw4AMACFGwUPOkBITUtEQRkQHBqSAL0tHQEMFBg5NxYTDQEeL8cA0LyEIx4DCAoJHxwdJIa+0S+PbKi6PdJ5AAAAAElFTkSuQmCC");
+ background-position: right;
+ background-repeat: no-repeat;
+ -moz-box-shadow: none;
+}
+.error {
+ font-family: "Ubuntu Mono", Menlo, Consolas, "Courier New", Courier, monospace;
+ font-size: 112%;
+ white-space: pre-wrap;
+ width: 100%;
+ overflow: auto;
+}
+.warning {
+ border: 1px dotted red;
+ padding: 0 10px;
+ margin: 10px 0;
+}
+.hi {
+ background: #ffed3d;
+}
+.hidden {
+ display: none;
+}
diff --git a/src/main/xar-resources/resources/css/fundocs.css b/src/main/xar-resources/resources/css/fundocs.css
index 8979ac6..581e065 100644
--- a/src/main/xar-resources/resources/css/fundocs.css
+++ b/src/main/xar-resources/resources/css/fundocs.css
@@ -1,5 +1,3 @@
-@import url('$shared/resources/css/exist-2.2.css');
-
#fun-query-form {
font-size: 14px;
margin: 10px 15px 30px 15px;
@@ -113,15 +111,10 @@ select[name='module'] {
}
}
-.function .signature {
- font-family: "Ubuntu Mono", "Menlo", "Consolas", monospace;
- font-size: 1.125em;
- margin: 8px 16px;
- padding: 8px 8px;
- background-color: #ffffff;
- white-space: pre-line;
- word-wrap: break-word;
-}
+/*
+ * function signatures and other code blocks are handled in
+ * prism-theme (./prism-fundocs.css)
+ */
.function .function-detail {
margin-left: 16px;
diff --git a/src/main/xar-resources/resources/css/prism-fundocs.css b/src/main/xar-resources/resources/css/prism-fundocs.css
new file mode 100644
index 0000000..6a26f66
--- /dev/null
+++ b/src/main/xar-resources/resources/css/prism-fundocs.css
@@ -0,0 +1,199 @@
+/**
+ * function documenation prism theme
+ * Modified version of
+ * VS theme by Andrew Lock (https://andrewlock.net)
+ * Inspired by Visual Studio syntax coloring
+ */
+
+code[class*="language-"],
+pre[class*="language-"] {
+ color: #393a34;
+ font-family: "Ubuntu Mono", "Menlo", "Consolas", "Bitstream Vera Sans Mono",
+ "Courier New", Courier, monospace;
+ direction: ltr;
+ text-align: left;
+
+ white-space: pre;
+ word-spacing: normal;
+
+ word-break: normal;
+ font-size: 0.9em;
+ line-height: 1.2em;
+
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+
+ -webkit-hyphens: none;
+ -moz-hyphens: none;
+ -ms-hyphens: none;
+ hyphens: none;
+}
+
+.signature code[class*="language-"],
+pre[class*="language-"].signature {
+ white-space: pre-line;
+ word-wrap: break-word;
+}
+
+pre > code[class*="language-"] {
+ font-size: 1.25em;
+ line-height: 1.5em;
+}
+
+pre[class*="language-"]::-moz-selection,
+pre[class*="language-"] ::-moz-selection,
+code[class*="language-"]::-moz-selection,
+code[class*="language-"] ::-moz-selection {
+ background: #c1def1;
+}
+
+pre[class*="language-"]::selection,
+pre[class*="language-"] ::selection,
+code[class*="language-"]::selection,
+code[class*="language-"] ::selection {
+ background: #c1def1;
+}
+
+/* Code blocks */
+pre[class*="language-"] {
+ padding: 1em;
+ margin: 0.5em 0;
+ overflow: auto;
+ border: 1px solid #dddddd;
+ background-color: white;
+}
+
+/* Inline code */
+:not(pre) > code[class*="language-"] {
+ padding: 0.2em;
+ padding-top: 1px;
+ padding-bottom: 1px;
+ background: #f8f8f8;
+ border: 1px solid #dddddd;
+}
+
+.token.comment,
+.token.prolog,
+.token.doctype,
+.token.cdata {
+ color: #008000;
+ font-style: italic;
+}
+
+.token.namespace {
+ opacity: 0.7;
+}
+
+.token.string {
+ color: #4193b9;
+}
+
+.token.builtin {
+ color: #9a050f;
+ }
+
+.token.keyword,
+.token.punctuation {
+ color: #AF956F; /* no highlight */
+}
+
+.token.operator {
+ color: #a16515;
+}
+
+.token.url,
+.token.symbol,
+.token.number,
+.token.boolean,
+.token.variable,
+.token.constant,
+.token.inserted {
+ color: #2a4242;
+}
+
+.token.atrule,
+.token.attr-value,
+.language-autohotkey .token.selector,
+.language-json .token.boolean,
+.language-json .token.number,
+code[class*="language-css"] {
+ color: #0000ff;
+}
+
+.token.function {
+ color: #C52727;
+}
+
+.token.deleted,
+.language-autohotkey .token.tag {
+ color: #9a050f;
+}
+
+.token.selector,
+.language-autohotkey .token.keyword {
+ color: #00009f;
+}
+
+.token.important {
+ color: #e90;
+}
+
+.token.important,
+.token.bold {
+ font-weight: bold;
+}
+
+.token.italic {
+ font-style: italic;
+}
+
+.token.class-name,
+.language-json .token.property {
+ color: #2b91af;
+}
+
+.token.tag,
+.token.selector {
+ color: #800000;
+}
+
+.token.attr-name,
+.token.property,
+.token.regex,
+.token.entity {
+ color: #ff0000;
+}
+
+.token.directive.tag .tag {
+ background: #ffff00;
+ color: #393a34;
+}
+
+/* overrides color-values for the Line Numbers plugin
+ * http://prismjs.com/plugins/line-numbers/
+ */
+.line-numbers .line-numbers-rows {
+ border-right-color: #a5a5a5;
+}
+
+.line-numbers-rows > span:before {
+ color: #2b91af;
+}
+
+/* overrides color-values for the Line Highlight plugin
+ * http://prismjs.com/plugins/line-highlight/
+ */
+.line-highlight {
+ background: rgba(193, 222, 241, 0.2);
+ background: -webkit-linear-gradient(
+ left,
+ rgba(193, 222, 241, 0.2) 70%,
+ rgba(221, 222, 241, 0)
+ );
+ background: linear-gradient(
+ to right,
+ rgba(193, 222, 241, 0.2) 70%,
+ rgba(221, 222, 241, 0)
+ );
+}
diff --git a/src/main/xar-resources/resources/fonts/Quicksand_Book-webfont.eot b/src/main/xar-resources/resources/fonts/Quicksand_Book-webfont.eot
new file mode 100644
index 0000000..ffe8e41
Binary files /dev/null and b/src/main/xar-resources/resources/fonts/Quicksand_Book-webfont.eot differ
diff --git a/src/main/xar-resources/resources/fonts/Quicksand_Book-webfont.svg b/src/main/xar-resources/resources/fonts/Quicksand_Book-webfont.svg
new file mode 100644
index 0000000..370af64
--- /dev/null
+++ b/src/main/xar-resources/resources/fonts/Quicksand_Book-webfont.svg
@@ -0,0 +1,149 @@
+
+
\ No newline at end of file
diff --git a/src/main/xar-resources/resources/fonts/Quicksand_Book-webfont.ttf b/src/main/xar-resources/resources/fonts/Quicksand_Book-webfont.ttf
new file mode 100644
index 0000000..39338fc
Binary files /dev/null and b/src/main/xar-resources/resources/fonts/Quicksand_Book-webfont.ttf differ
diff --git a/src/main/xar-resources/resources/fonts/Quicksand_Book-webfont.woff b/src/main/xar-resources/resources/fonts/Quicksand_Book-webfont.woff
new file mode 100644
index 0000000..6e7317c
Binary files /dev/null and b/src/main/xar-resources/resources/fonts/Quicksand_Book-webfont.woff differ
diff --git a/src/main/xar-resources/resources/images/bgmenu.gif b/src/main/xar-resources/resources/images/bgmenu.gif
new file mode 100644
index 0000000..653aa34
Binary files /dev/null and b/src/main/xar-resources/resources/images/bgmenu.gif differ
diff --git a/src/main/xar-resources/resources/images/bgmenuhi.gif b/src/main/xar-resources/resources/images/bgmenuhi.gif
new file mode 100644
index 0000000..0fabe0a
Binary files /dev/null and b/src/main/xar-resources/resources/images/bgmenuhi.gif differ
diff --git a/src/main/xar-resources/resources/images/body-base.gif b/src/main/xar-resources/resources/images/body-base.gif
new file mode 100644
index 0000000..4f297e0
Binary files /dev/null and b/src/main/xar-resources/resources/images/body-base.gif differ
diff --git a/src/main/xar-resources/resources/images/body.gif b/src/main/xar-resources/resources/images/body.gif
new file mode 100644
index 0000000..91c9a3d
Binary files /dev/null and b/src/main/xar-resources/resources/images/body.gif differ
diff --git a/src/main/xar-resources/resources/images/exist_icon_16x16.ico b/src/main/xar-resources/resources/images/exist_icon_16x16.ico
new file mode 100644
index 0000000..369b350
Binary files /dev/null and b/src/main/xar-resources/resources/images/exist_icon_16x16.ico differ
diff --git a/src/main/xar-resources/resources/images/existdb-web.svg b/src/main/xar-resources/resources/images/existdb-web.svg
new file mode 100644
index 0000000..d3639ea
--- /dev/null
+++ b/src/main/xar-resources/resources/images/existdb-web.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/main/xar-resources/resources/images/horizontal.gif b/src/main/xar-resources/resources/images/horizontal.gif
new file mode 100644
index 0000000..970d0e5
Binary files /dev/null and b/src/main/xar-resources/resources/images/horizontal.gif differ
diff --git a/src/main/xar-resources/resources/images/noise.png b/src/main/xar-resources/resources/images/noise.png
new file mode 100644
index 0000000..210e5e3
Binary files /dev/null and b/src/main/xar-resources/resources/images/noise.png differ
diff --git a/src/main/xar-resources/resources/images/powered-by.svg b/src/main/xar-resources/resources/images/powered-by.svg
new file mode 100644
index 0000000..292332e
--- /dev/null
+++ b/src/main/xar-resources/resources/images/powered-by.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/main/xar-resources/resources/scripts/query.js b/src/main/xar-resources/resources/scripts/query.js
index e133818..10ab8b5 100644
--- a/src/main/xar-resources/resources/scripts/query.js
+++ b/src/main/xar-resources/resources/scripts/query.js
@@ -1,62 +1,64 @@
+$(document).on("ready", function() {
+ const markedOptions = { "gfm": true }
+ const loginDialog = $("#loginDialog");
+ let timeout = 0;
-function search() {
- var data = $("#fun-query-form").serialize();
- $.ajax({
- type: "POST",
- url: "ajax.html",
- data: data + "&action=search",
- success: function (data) {
- $("#results").fadeOut(100, function() {
- $(this).html(data);
- $(this).fadeIn(100, function() {
- $(".signature").highlight({theme: "clouds"});
- });
- timeout = null;
- });
- }
+ loginDialog.modal({
+ show: false
});
-}
-function checkLogin() {
- $.ajax({
- url: "login",
- dataType: "json",
- success: function(data) {
- reindex();
- },
- error: function (xhr, textStatus) {
- $("#loginDialog").modal("show");
- }
- });
-}
+ function search() {
+ const data = $("#fun-query-form").serialize();
+ $.ajax({
+ type: "POST",
+ url: "ajax.html",
+ data: data + "&action=search",
+ success: function (data) {
+ $("#results").fadeOut(100, function() {
+ $(this).html(data);
+ $(this).fadeIn(100, function() {
+ Prism.highlightAll()
+ });
+ timeout = null;
+ });
+ }
+ });
+ }
+
+ function reindexIfLoggedIn(ev) {
+ ev.preventDefault();
-function reindex() {
- $("#messages").empty();
- $("#f-load-indicator").show();
- $.ajax({
- type: "POST",
- dataType: "json",
- url: "modules/reindex.xql",
- success: function (data) {
- $("#f-load-indicator").hide();
- if (data.status == "failed") {
- $("#messages").text(data.message);
- } else {
- window.location.href = ".";
+ $.ajax({
+ url: "login",
+ dataType: "json",
+ success: reindex,
+ error: function () {
+ $("#loginDialog").modal("show");
}
- }
- });
-}
+ });
+ }
-var timeout = null;
+ function reindex() {
+ $("#messages").empty();
+ $("#f-load-indicator").show();
+ $.ajax({
+ type: "POST",
+ dataType: "json",
+ url: "modules/reindex.xql",
+ success: function (data) {
+ $("#f-load-indicator").hide();
+ if (data.status == "failed") {
+ // FIXME the server should respond with an error status code
+ $("#messages").text(data.message);
+ } else {
+ window.location.reload();
+ }
+ }
+ });
+ }
-$(document).ready(function() {
- var loginDialog = $("#loginDialog");
- loginDialog.modal({
- show: false
- });
- $("form", loginDialog).submit(function(ev) {
- var params = $(this).serialize();
+ $("form", loginDialog).on("submit", function(ev) {
+ const params = $(this).serialize();
$.ajax({
url: "login",
data: params,
@@ -72,8 +74,10 @@ $(document).ready(function() {
return false;
});
$("#f-load-indicator").hide();
- $("#query-field").keyup(function() {
- var val = $(this).val();
+ $("#query-field").on("keyup", function() {
+ const val = $(this).val();
+ // fixme search request is delayed by 300ms
+ // replace with proper debounce
if (val.length > 3) {
if (timeout)
clearTimeout(timeout);
@@ -81,12 +85,31 @@ $(document).ready(function() {
}
});
- $("#f-btn-reindex").click(function(ev) {
- ev.preventDefault();
- checkLogin();
- });
-
- $(".signature").highlight({theme: "clouds"});
-
+ $("#f-btn-reindex").on("click", reindexIfLoggedIn);
+ $("#f-btn-reindex-regen").on("click", reindexIfLoggedIn);
+
$("#fun-query-form *[data-toggle='tooltip']").tooltip();
+
+ // replace markdown element content with rendered HTML
+ const mdContentElement = document.querySelector(".markdown")
+
+ if (mdContentElement) {
+ const renderer = {
+ table(header, body) {
+ if (body) body = `
${body}`
+ return `
+
+ ${header}
+
+ ${body}
+
+ `;
+ }
+ };
+
+ marked.use({ renderer });
+
+ const markdown = marked(mdContentElement.textContent, markedOptions)
+ mdContentElement.innerHTML = markdown
+ }
});
\ No newline at end of file
diff --git a/src/main/xar-resources/templates/page.html b/src/main/xar-resources/templates/page.html
index b45043d..14644ff 100644
--- a/src/main/xar-resources/templates/page.html
+++ b/src/main/xar-resources/templates/page.html
@@ -3,7 +3,11 @@
App Title
-
+
+
+
+
+
@@ -206,18 +210,12 @@
Login