vuetify 1.3.9

This commit is contained in:
Andy Bunce 2018-11-21 11:48:58 +00:00
parent d30eacc8fe
commit 18114ae8e4
65 changed files with 1488 additions and 2238 deletions

View file

@ -283,6 +283,7 @@
console.log("AFTER: ",this.$auth);
//this.$forceUpdate()
})
EditTabs.restore();
},
beforeDestroy(){

View file

@ -0,0 +1,84 @@
//Manage array of text sources used for:edit tabs
// item{
// name:
// contentType:
// text:
// id:
// url:
//
const EditTabs=new Vue({
data(){
return {
items:[],
nextId: 1,
currentId: null
}
},
methods: {
addItem(tab){
console.log("new: ",tab);
var def={name: "AA"+this.nextId,
contentType: "text/xml",
mode: "xml",
text: "<foo>" +this.nextId +"</foo>",
url: null
};
var etab = Object.assign(def,tab);
etab.id= ""+this.nextId
this.items.push (etab);
this.nextId++;
return etab;
},
closeItem(item){
var index=this.items.indexOf(item);
if (index > -1) {
alert("index: "+index)
this.items.splice(index, 1);
index=(index==0)?0:index-1;
this.currentId=(this.items.length)?"T"+this.items[index].id : null;
}
},
// fetch content from server and create tab
loadItem(url){
HTTP.get("get",{params: {url:url}})
.then(r=>{
console.log(r)
var tab={
text: ""+ r.data.data,
url: url,
name: url.split(/.*[\/|\\]/)[1]
};
this.addItem(tab);
})
.catch(error=> {
console.log(error);
alert("Get query error:\n"+url)
});
},
save(){
Settings.setItem('edit/items',this.items);
},
restore(){
that=this
Settings.getItem('edit/items')
.then(function (v){
console.log("items ",v)
v.forEach(v =>that.addItem(v))
})
.catch(error=> {
console.log(error);
alert("load error")
});
},
sorted(){
return this.items.slice(0).sort((a,b) => a.name.localeCompare(b.name))
}
}
});

View file

@ -3,12 +3,15 @@ const Notification={
messages:[],
nextId: 0,
unseen:0,
add(msg){
var data={
text: msg,
add(opts){
var data=Object.assign({
html: 'no html',
index: ++this.nextId,
created: new Date()
};
created: new Date(),
elapsed: null
},
opts);
console.log("opt",opts);
this.messages.unshift(data);
this.messages.length = Math.min(this.messages.length, 30);
++this.unseen;

View file

@ -0,0 +1,34 @@
<!DOCTYPE html>
<!--
bread crumb wrapper. crumbs = json array "[{},{}]"
supports: text,
to,
icon,
menu
-->
<template id="qd-breadcrumbs">
<v-breadcrumbs :items="crumbs" >
<template slot="item" slot-scope="props">
<v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true">
<v-icon v-if="props.item.icon">props.item.icon</v-icon>
{{ props.item.text }}
<v-btn icon v-if="props.item.menu" @click="$emit(props.item.menu)"
:class="props.item.menu">
<v-avatar>
<v-icon>arrow_drop_down</v-icon>
</v-avatar>
</v-btn>
</v-breadcrumbs-item>
</template>
</v-breadcrumbs>
</template>
<script>{
props: ['crumbs'],
created:function(){
console.log("qd-crumbs");
}
}
</script>

View file

@ -18,16 +18,15 @@
<v-list-tile-avatar>
<v-icon color="red">swap_horiz</v-icon>
</v-list-tile-avatar>
<v-list-tile-content>
<v-tooltip>
<v-list-tile-title slot="activator">{{ msg.created | fromNow("from") }}</v-list-tile-title>
<span v-text="msg.created"></span>
</v-tooltip>
<v-list-tile-sub-title v-html="msg.text"></v-list-tile-sub-title>
<v-list-tile-title>{{ msg.created | fromNow("from") }}</v-list-tile-title>
<v-list-tile-sub-title v-html="msg.html">msg</v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
<v-list-tile-action-text v-if="msg.elapsed">{{ msg.elapsed }} ms </v-list-tile-action-text>
<v-list-tile-action-text>#{{ msg.index }}</v-list-tile-action-text>
</v-list-tile-action>
</v-list-tile>
</template>
</v-list>

View file

@ -1,7 +1,7 @@
<!DOCTYPE html>
<!--
manage parameters for query
including funtion to submit form
including submit form function
-->
<template id="vp-paramform">
<v-form ref="form" lazy-validation>

View file

@ -28,6 +28,7 @@ HTTP.interceptors.request.use((config) => {
config.qdStartTime=performance.now();
return config;
});
HTTP.interceptors.response.use((response) => {
// Do something with response data
if(response.config && response.config.qdStartTime){
@ -35,12 +36,13 @@ HTTP.interceptors.response.use((response) => {
var c=response.config;
var url=response.config.url + "?" + c.paramsSerializer(c.params);
//console.log("interceptors time:",s, response.config);
var b=`<a href="${url}" target="vp-notification" >${url}</a> Time: ${s}`
Notification.add(b);
var b=`<a href="${url}" target="vp-notification" >${url}</a>`
Notification.add({html: b, elapsed: s});
}
return response;
});
// errors hidden
const HTTPNE = axios.create(AXIOS_CONFIG);
const axios_json={ headers: {accept: 'application/json'}};
@ -51,7 +53,7 @@ localforage.config({
name: 'vuepoc'
});
// https://vuejs.org/v2/guide/state-management.html
var settings = {
var Settings = {
debug: false,
defaults:{
@ -122,6 +124,17 @@ return $a `},
console.log('set failed');
});
},
removeItem (key) {
if (this.debug) console.log('deleteItem',key);
return localforage.removeItem(key)
.then(value => {
console.log('deleted ',key);
}).catch(err => {
console.log('delete failed');
});
},
keys(){
return localforage.keys() // returns array of keys

Binary file not shown.

View file

@ -122,5 +122,8 @@
<description>EXpath packaging
</description>
</namespace>
<namespace uri="http://basex.org/modules/perm" prefix="perm">
<description>Web permissions
</description>
</namespace>
</namespaces>

View file

@ -6,24 +6,7 @@
<v-container fill-height>
<v-layout align-center>
<v-flex>
<h3 class="display-3">Vue-poc<v-spacer></v-spacer>
<v-speed-dial v-model="fab" hover right direction="bottom"
transition="slide-y-reverse-transition">
<v-btn slot="activator" class="blue darken-2" dark fab hover v-model="fab">
<v-icon>account_circle</v-icon>
<v-icon>close</v-icon>
</v-btn>
<v-btn fab dark small class="green" >
<v-icon>edit</v-icon>
</v-btn>
<v-btn fab dark small class="indigo" >
<v-icon>add</v-icon>
</v-btn>
<v-btn fab dark small class="red" >
<v-icon>delete</v-icon>
</v-btn>
</v-speed-dial>
</h3>
<h3 class="display-3">Vue-poc</h3>
<span class="subheading">A development environment for managing XML sources and processes.</span>
<v-divider class="my-3"></v-divider>
@ -44,6 +27,9 @@
<li><a href="https://developers.google.com/web/tools/workbox/"
target="new">workbox</a></li>
<li><a href="https://material.io/tools/icons/?style=baseline"
target="new">icons (material)</a></li>
</ul>
</v-flex>
<v-flex xs6>

View file

@ -7,13 +7,15 @@
<v-toolbar dense >
<v-toolbar-title>
<v-breadcrumbs >
<v-breadcrumbs :items="crumbs">
<span slot="divider" style="padding:0;"></span>
<v-breadcrumbs-item v-for="item in crumbs" :key="item.path"
:to="{ query: { url: item.path }}" :exact="true">
<v-icon v-if="item.icon">{{ icon }}</v-icon>
{{ item.name }}
<template slot="item" slot-scope="props">
<v-breadcrumbs-item
:to="{ query: { url: props.item.path }}" :exact="true">
<v-icon v-if="props.item.icon">{{ props.item.icon }}</v-icon>
{{ props.item.name }}
</v-breadcrumbs-item>
</template>
</v-breadcrumbs>
</v-toolbar-title>
<v-btn icon @click="load()">

View file

@ -290,7 +290,7 @@ v-on:annotation="annotation"></vue-ace>
if(url) this.fetch(url)
},
beforeRouteEnter (to, from, next) {
settings.getItem('settings/ace')
Settings.getItem('settings/ace')
.then( v =>{
next(vm => {vm.aceSettings = v;})
})

View file

@ -29,7 +29,7 @@
</v-list-tile>
</v-list>
</v-menu>
<v-btn>*{{ nextId }}</v-btn>
<v-btn @click="EditTabs.addItem({txt:'hello'})">*{{ EditTabs.nextId }}</v-btn>
<v-spacer></v-spacer>
@ -110,13 +110,13 @@
<v-menu left bottom :close-on-content-click="false" >
<a class="tabs__item" slot="activator">
{{ items.length }}
{{ EditTabs.items.length }}
<v-icon>arrow_drop_down</v-icon>
</a>
<v-card>
<v-card-title>Select Tab</v-card-title>
<v-card-actions>
<v-autocomplete :items="sorted" v-model="a1"
<v-autocomplete :items="EditTabs.sorted()" v-model="a1"
label="File" class="input-group--focused"
item-text="name" item-value="id"
@change="setItem"
@ -128,7 +128,7 @@
<v-tabs v-model="currentId" slot="extension">
<v-tab
v-for="item in items"
v-for="item in EditTabs.items"
:key="item.id"
:href="'#T' + item.id" ripple
style="text-transform: none;text-align:left"
@ -149,7 +149,7 @@
<v-tabs-items slot="body" v-model="currentId">
<v-tab-item
v-for="item in items"
v-for="item in EditTabs.items"
:key="item.id"
:id="'T' + item.id"
>
@ -196,7 +196,6 @@
return {
showadd: false, // showing add form
showInfo: false, // showing info
nextId:4,
a1:"",
currentId: null, //href of current
active: null,
@ -205,21 +204,17 @@
aceSettings: {},
events: new Vue({}),
annotations: null,
folded:false
folded:false,
EditTabs: EditTabs
}
},
methods:{
tabClose(item){
if(item.dirty){
alert("save first")
if (!confirm("Not saved continue? "))return;
}else{
var index=this.items.indexOf(item);
if (index > -1) {
this.items.splice(index, 1);
index=(index==0)?0:index-1;
this.currentId=(this.items.length)?"T"+this.items[index].id : null;
}
this.EditTabs.closeItem(item)
}
},
@ -268,35 +263,10 @@
},
addItem(tab){
console.log("new: ",tab);
var def={name: "AA"+this.nextId,
id: ""+this.nextId,
contentType: "text/xml",
mode: "xml",
text: "New text" +this.nextId
};
var etab = Object.assign(def,tab);
this.items.push (etab);
this.currentId="T" + this.nextId
this.nextId++;
var tab=EditTabs.addItem({text:"aaa hello"})
this.currentId="T" + tab.id
},
loadItem(url){
HTTP.get("get",{params: {url:url}})
.then(r=>{
console.log(r)
var tab={
text: ""+ r.data.data,
location: url,
name: url.split(/.*[\/|\\]/)[1]
};
this.addItem(tab);
})
.catch(error=> {
console.log(error);
alert("Get query error:\n"+url)
});
},
changeContent(val){
var item=this.active;
@ -321,31 +291,25 @@
watch:{
currentId (val) {
this.active = this.items.find(e=> val=="T"+e.id);
this.active = EditTabs.items.find(e=> val=="T"+e.id);
this.$router.push({ query: { id: val }});
console.log("current",val)
}
},
computed:{
sorted(){
return this.items.slice(0).sort((a,b) => a.name.localeCompare(b.name)) ;
},
dirty(){
return this.active && this.active.dirty
}
},
beforeRouteEnter (to, from, next) {
Promise.all([settings.getItem('settings/ace'),
settings.getItem('edit/items')
Promise.all([Settings.getItem('settings/ace')
])
.then(function(values) {
next(vm => {
vm.aceSettings = values[0];
vm.items = values[1];
vm.currentId = vm.items.length+1;
console.log("nextid: ",vm.currentId);
})
})
},
@ -354,14 +318,14 @@
// called when the route that renders this component is about to
// be navigated away from.
// has access to `this` component instance.
settings.setItem('edit/items',this.items);
Settings.setItem('edit/items',EditTabs.items);
next(true);
},
created:function(){
var url=this.$route.query.url;
if(url){
this.loadItem(url);
EditTabs.loadItem(url);
}else{
var id=this.$route.query.id;
this.currentId=id?id:null;

View file

@ -232,7 +232,7 @@
computed: {
},
beforeRouteEnter (to, from, next) {
settings.getItem('settings/ace')
Settings.getItem('settings/ace')
.then( v =>{
next(vm => {

View file

@ -249,7 +249,7 @@
var t1 = performance.now();
var elapsed= 0.001 *(t1 - t0);
var round = Vue.filter('round');
this.$notification.add("Found " + this.total + " in : "+ round(elapsed,1) +" secs");
this.$notification.add({html:"Found " + this.total, elapsed: round(elapsed,1)});
})
},
slideShow(){

View file

@ -4,12 +4,10 @@
<v-flex xs12 sm6 offset-sm3>
<v-card >
<v-card-title class="amber ">
<v-card-title class="red">
<span class="white--text">The current credentials do the give access this page, please login again</span>
</v-card-title>
<v-alert color="error" v-bind:value="showMessage">
{{message}}
</v-alert>
<v-card-actions>
<v-text-field
name="input-name"
@ -33,6 +31,10 @@
></v-text-field>
</v-card-actions>
<v-alert color="error" v-bind:value="showMessage">
{{message}}
</v-alert>
<v-card-actions>
<v-switch
label="Remember me" v-model="remember">

View file

@ -11,14 +11,26 @@ declare variable $vue-login:SESSION-KEY := "id";
(:~ Current session. :)
declare variable $vue-login:SESSION-VALUE := session:get($vue-login:SESSION-KEY);
(:~
: Permission check: Area for logged-in users.
: Checks if a session id exists for the current user; if not, redirects to the login page.
:)
declare
(: %perm:check('/vue-poc') :)
function vue-login:check-app() {
let $user := session:get('id')
where empty($user)
return web:redirect('/vue-poc/login')
};
(:~
: get status
:)
declare
%rest:GET %rest:path("/vue-poc/api/status")
%rest:cookie-param("remember", "{ $remember }")
%rest:produces("application/json")
%output:method("json")
function vue-login:status( )
function vue-login:status($remember as xs:string? )
{
let $user:=session:get("id","")
let $role:=if($user and user:exists($user)) then user:list-details($user)/@permission/string() else ""
@ -27,6 +39,7 @@ return <json type="object" >
<permission>{$role}</permission>
<session>{session:id()}</session>
<created>{session:created()}</created>
<login>{ $remember }</login>
</json>
};
@ -85,9 +98,8 @@ declare %private function vue-login:accept(
$pass as xs:string,
$path as xs:string?
) {
let $expires:=current-dateTime() + xs:dayTimeDuration('P7D')
let $pic:="[FNn,3-3],[D01] [MNn,3-3] [Y4] [H01]:[m01]:[s01] [z]"
let $val:=``[remember=`{ random:uuid() }`; path=/; expires=`{ format-dateTime($expires,$pic) }`;]``
let $val:=vue-login:cookie("remember", random:uuid(),map{'expires': xs:dayTimeDuration('P7D')})
return (
session:set($vue-login:SESSION-KEY, $name),
admin:write-log('VUEPOC user was logged in: ' || $name),
@ -115,10 +127,28 @@ declare %private function vue-login:reject(
$name as xs:string,
$message as xs:string,
$path as xs:string?)
as element(json) {
admin:write-log('VUE login was denied: ' || $name),
{
let $cookie:=vue-login:cookie("remember", "", map{})
return ( admin:write-log('VUE login was denied: ' || $name),
<rest:response>
<http:response>
<http:header name="Set-Cookie" value="{ $cookie }"/>
</http:response>
</rest:response>,
<json type="object">
<status type="boolean">false</status>
<message>{$message}</message>
</json>
)
};
(:~ return cookie string
:)
declare function vue-login:cookie($name as xs:string,$val,$opts as map(*)?)
as xs:string
{
let $pic:="[FNn,3-3],[D01] [MNn,3-3] [Y4] [H01]:[m01]:[s01] [z]"
let $expires:=if(map:contains($opts,"expires")) then current-dateTime() + $opts?expires else ()
return``[`{ $name }`=`{ $val }`; path=/; expires=`{ format-dateTime($expires,$pic) }`;]``
};

View file

@ -3,19 +3,23 @@
<v-card>
<v-toolbar >
<v-toolbar-title>
<v-breadcrumbs >
<v-breadcrumbs-item to="/entity" :exact="true">
Entities
<v-breadcrumbs :items="[{text:'Entities',to:'/entity'}]" >
<template slot="item" slot-scope="props">
<v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true">
{{ props.item.text }}
</v-breadcrumbs-item>
</template>
</v-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-text-field prepend-icon="filter_list" label="Filter..." v-model="q" type="search"
hide-details single-line @keyup.enter="setfilter"
:append-icon="this.q?'clear':''" @click:append="e=>this.q=''"></v-text-field>
<v-btn @click="getItems"
<v-spacer></v-spacer>
<v-btn @click="getItems" icon
:loading="loading"
:disabled="loading"
>Refresh</v-btn>
><v-icon>refresh</v-icon></v-btn>
<vp-entitylink entity="entity"></vp-entitylink>
</v-toolbar>
@ -41,14 +45,14 @@
md4
lg3
>
<v-card :hover="true" active-class="default-class qd-active" >
<v-card :hover="true" active-class="default-class qd-active" max-height="200px">
<v-toolbar color="amber">
<v-toolbar color="blue lighten-3" dense>
<v-card-title >
<router-link :to="{path:'entity/'+ props.item.name}">
<h3>
<v-icon>{{ props.item.iconclass }}</v-icon> {{ props.item.name }}
</h3>
</router-link>
</v-card-title>
</v-toolbar>

View file

@ -3,47 +3,42 @@
<v-card >
<v-toolbar>
<v-toolbar-title>
<v-breadcrumbs >
<v-breadcrumbs-item to="/entity" :exact="true">
Entities
</v-breadcrumbs-item>
<v-breadcrumbs-item >
<v-chip>
<v-avatar>
<v-icon>{{ item.iconclass }}</v-icon>
</v-avatar>
{{ entity }}
</v-chip>
</v-breadcrumbs-item>
</v-breadcrumbs>
<qd-breadcrumbs @todo="showmenu= ! showmenu"
:crumbs="[{to: '/entity', text:'Entities'}, {text: entity, disabled: false, menu: 'todo'}]"
>crumbs</qd-breadcrumbs>
</v-toolbar-title>
<v-menu offset-y v-model="showmenu" activator=".todo">
<v-list dense>
<v-subheader >Actions</v-subheader>
<v-list-tile @click="getxml" >
<v-list-tile-title >View XML</v-list-tile-title>
</v-list-tile>
<v-list-tile >
<v-list-tile-title ><a :href="dataurl" target="data">Json</a></v-list-tile-title>
</v-list-tile>
</v-list>
</v-menu>
<v-spacer></v-spacer>
<v-btn icon @click="getItem"
:loading="loading"
:disabled="loading"
><v-icon>refresh</v-icon></v-btn>
<v-btn @click="getxml"
:loading="loading"
:disabled="loading"
>XML</v-btn>
<a :href="dataurl" target="data">Data</a>
</v-toolbar>
<v-container fluid grid-list-md>
<div v-if="item">
<div>{{item.description}}</div>
</div>
<v-expansion-panel v-model="panel" expand >
<v-expansion-panel-content>
<div slot="header" class="title">Description: </div>
{{item.description}}
<pre v-if="xml"><code>{{ xml }}</code></pre>
</v-expansion-panel-content>
<v-expansion-panel-content>
<div slot="header" class="title">Type: <code>{{ item.type }}</code></div>
<prism language="xquery">{{ item.modules }}</prism>
<prism language="xquery">{{ item.namespaces }}</prism>
<prism language="xquery">{{ item.code }}</prism>
<prism language="xquery">{{ code(item) }}</prism>
</v-expansion-panel-content>
<v-expansion-panel-content>
@ -72,7 +67,7 @@
item: {description:null,
code: null
},
showmenu: false,
loading: false,
xml: null,
selected: [],
@ -83,7 +78,7 @@
{text: "description", value: "description"},
{text: "xpath", value: "xpath"}
],
panel: [false, true]
panel: [true, false, true]
}
},
methods:{
@ -95,17 +90,25 @@
this.item=Object.assign({}, this.item, r.data)
})
},
code(item){
return item.modules + " " + item.namespaces + " " +item.code
},
getxml(){
HTTP.get("data/entity/"+this.entity,{ headers: {Accept: "text/xml"}})
.then(r=>{
console.log(r.data)
this.xml=r.data;
})
},
todo(){
alert("TODO");
}
},
computed: {
dataurl(){
return '/vue-poc/api/data/' + this.entity;
},
xquery(){
return '/vue-poc/api/data/' + this.entity;
}
},
created:function(){

View file

@ -4,10 +4,12 @@
<v-card>
<v-toolbar >
<v-toolbar-title>
<v-breadcrumbs >
<v-breadcrumbs-item to="/namespace" :exact="true">
Namespaces
<v-breadcrumbs :items="crumbs" >
<template slot="item" slot-scope="props">
<v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true">
{{ props.item.text }}
</v-breadcrumbs-item>
</template>
</v-breadcrumbs>
</v-toolbar-title>
@ -72,7 +74,8 @@
{ text: 'Description', value: 'description' },
{ text: 'Prefix', value: 'prefix' }
]
],
crumbs:[{to:"/namespace", text:"namespaces"}]
}
},
methods: {

View file

@ -1,40 +1,22 @@
<!DOCTYPE html>
<template id="repo">
<v-container fluid>
<v-card >
<v-toolbar >
<v-text-field
append-icon="search"
label="Filter repo"
single-line
hide-details
v-model="search"
></v-text-field>
<v-spacer></v-spacer>
</v-toolbar>
<v-data-table
:headers="headers"
:items="items"
:search="search"
v-model="selected"
select-all
class="elevation-1"
no-data-text="No repo found @todo"
>
<qd-table :headers="headers" data-uri="data/repo" entity="repo" no-data-msg="Nothing found">
<template slot="items" slot-scope="props">
<td class="vtop">
<td >
<v-checkbox
primary
hide-details
v-model="props.selected"
></v-checkbox>
</td>
<td class="vtop">{{ props.item.name }}</td>
<td class="vtop "><div>{{ props.item.permission }}</div>
<td >{{ props.item.name}}</td>
<td >{{ props.item.type }}</td>
<td >{{ props.item.version }}</td>
</template>
</v-data-table>
</v-card>
</qd-table>
</v-container>
</template>
<script>{
@ -45,28 +27,15 @@
search: null,
selected: [],
headers: [
{
text: 'Name',
left: true,
value: 'id'
},
{ text: 'Permission', value: 'state' }
{ text: 'Name', value: 'name'},
{ text: 'Type', value: 'type' },
{ text: 'Version', value: 'version' }
]
}
},
methods:{
getUsers(){
this.loading=true;
HTTP.get("repo")
.then(r=>{
this.loading=false
this.items=r.data
})
}
},
created:function(){
console.log("notfound",this.$route.query.q)
console.log("repo")
}
}
</script>

View file

@ -4,15 +4,36 @@
<v-card>
<v-toolbar class="green darken-1">
<v-card-title >
<span class="white--text">Selection</span>
<span class="white--text">Selection2</span>
</v-card-title>
<v-spacer></v-spacer>
<v-btn flat icon @click="showInfo = !showInfo"><v-icon>info</v-icon></v-btn>
</v-toolbar>
<qd-panel :show="showInfo">
<v-layout slot="body">
<v-layout slot="body" row wrap>
<v-flex xs12 >
<v-treeview
v-model="tree"
:open="open"
:items="items"
activatable
item-key="name"
open-on-click
>
<template slot="prepend" slot-scope="{ item, open, leaf }">
<v-icon v-if="!item.file">
{{ open ? 'mdi-folder-open' : 'mdi-folder' }}
</v-icon>
<v-icon v-else>
{{ files[item.file] }}
</v-icon>
</template>
</v-treeview>
</v-flex>
<v-flex xs6>
<p>some text</p>
@ -51,15 +72,18 @@
>v-select</v-select>
<pre>{{$data.value2 }}</pre>
</v-flex>
</v-layout>
<v-card slot="aside" flat>
<v-card-actions >
<v-toolbar-title >test</v-toolbar-title>
<v-toolbar-title >test aside</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn flat icon @click="showInfo = false"><v-icon>highlight_off</v-icon></v-btn>
</v-card-actions>
<v-card-text> blah blah protocol: </v-card-text>
<v-card-text>
todo
</v-card-text>
</v-card>
</qd-panel>
@ -75,8 +99,73 @@
value2: null,
options: [],
isLoading: false,
showInfo:true
showInfo:true,
open: ['public'],
files: {
html: 'mdi-language-html5',
js: 'mdi-nodejs',
json: 'mdi-json',
md: 'mdi-markdown',
pdf: 'mdi-file-pdf',
png: 'mdi-file-image',
txt: 'mdi-file-document-outline',
xls: 'mdi-file-excel'
},
tree: [],
items: [
{
name: '.git'
},
{
name: 'node_modules'
},
{
name: 'public',
children: [
{
name: 'static',
children: [{
name: 'logo.png',
file: 'png'
}]
},
{
name: 'favicon.ico',
file: 'png'
},
{
name: 'index.html',
file: 'html'
}
]
},
{
name: '.gitignore',
file: 'txt'
},
{
name: 'babel.config.js',
file: 'js'
},
{
name: 'package.json',
file: 'json'
},
{
name: 'README.md',
file: 'md'
},
{
name: 'vue.config.js',
file: 'js'
},
{
name: 'yarn.lock',
file: 'txt'
}
]
}
},
created:function(){
this.asyncFind("")

View file

@ -106,7 +106,7 @@
getValues: new perfStat(),
postValues: new perfStat(),
repeat: {get:false,post:false},
counter:null
counter: "(unread)"
}
},
methods:{

View file

@ -6,7 +6,9 @@
<v-flex xs12 sm8 offset-sm2>
<v-card>
<v-toolbar class="orange">
<v-card-title >Common Ace editor settings</v-card-title>
<v-card-title > <qd-breadcrumbs
:crumbs="[{to: '/settings', text:'Settings'}, {text: 'Common Ace editor settings', disabled: true }]"
>crumbs</qd-breadcrumbs></v-card-title>
</v-toolbar>
<v-card-text>
<v-container fluid>
@ -117,7 +119,7 @@
}
},
beforeRouteLeave (to, from, next) {
settings.setItem('settings/ace',this.ace)
Settings.setItem('settings/ace',this.ace)
.then(v=>{
next()
})
@ -125,7 +127,7 @@
mounted: function () {
// console.log("$$$",this.ace)
settings.getItem('settings/ace')
Settings.getItem('settings/ace')
.then( v =>{
//alert("db\n"+JSON.stringify(v))
this.ace = Object.assign({}, this.ace, v)

View file

@ -1,16 +1,22 @@
<!DOCTYPE html>
<template id="keys">
<v-container fluid>
<p>Settings are currently only stored locally in the browser, using <code>localstorage</code></p>
<v-card>
<v-toolbar dense>
<v-toolbar-title >keys</v-toolbar-title>
<v-toolbar-title>
<qd-breadcrumbs
:crumbs="[{to: '/settings', text:'Settings'}, {text: 'Keys', disabled: true }]"
>crumbs</qd-breadcrumbs>
</v-toolbar-title>
<v-btn @click="showKey" :disabled="openIndex === null">Show: {{ keys[openIndex] }} </v-btn>
<v-btn @click="deleteKey" :disabled="openIndex === null">Delete</v-btn>
<v-spacer></v-spacer>
<v-btn @click="wipe" color="error">Delete ALL</v-btn>
</v-toolbar>
<v-card-text>
<v-expansion-panel>
<v-expansion-panel v-model="openIndex">
<v-expansion-panel-content popout
v-for="key in keys"
:key="key"
@ -25,27 +31,39 @@
</v-expansion-panel>
</v-card-text>
</v-card>
<v-snackbar v-model="true" >Settings are currently only stored locally in the browser, using <code>localstorage</code></v-snackbar>
</v-container>
</template>
<script>{
data(){return {
keys: ["?"],
showDev: false,
dark:false
openIndex: null
}
},
methods:{
wipe(){
if(confirm("wipe localstorage? "+this.keys.length)) settings.clear();
if(confirm("wipe localstorage? ")) Settings.clear();
},
theme(){
this.$root.$emit("theme",this.dark)
showKey(){
var key=this.keys[this.openIndex]
console.log("index: ",key)
Settings.getItem(key).then(v=>{console.log("ffff",v)})
alert("show")
},
deleteKey(){
var key=this.keys[this.openIndex]
console.log("index: ",key)
Settings.removeItem(key).then(v=>{console.log("ffff",v)})
alert("show")
}
},
created(){
console.log("settings")
settings.keys()
Settings.keys()
.then( v =>{
this.keys=v
})

View file

@ -1,5 +1,5 @@
<!DOCTYPE html>
<template id="settings">
<template id="showsettings">
<v-container fluid>
<p>Settings are currently only stored locally in the browser, using <code>localstorage</code></p>
<v-switch label="Dark theme" v-model="dark" @change="theme"></v-switch>
@ -32,14 +32,14 @@
},
methods:{
theme(){
settings.setItem('settings/dark',this.dark)
Settings.setItem('settings/dark',this.dark)
.then(v=>{
this.$root.$emit("theme",this.dark)
})
},
worker(){
settings.setItem('features/serviceworker',this.serviceworker)
Settings.setItem('features/serviceworker',this.serviceworker)
.then(v=>{
console.log("worker",this.serviceworker)
})
@ -48,7 +48,7 @@
created(){
console.log("settings")
settings.keys()
Settings.keys()
.then( v =>{
this.keys=v
})
@ -56,8 +56,8 @@
beforeRouteEnter (to, from, next) {
Promise.all([
settings.getItem('features/serviceworker'),
settings.getItem('settings/dark')
Settings.getItem('features/serviceworker'),
Settings.getItem('settings/dark')
])
.then( v =>{
next(vm => {

View file

@ -4,15 +4,14 @@
<v-card >
<v-toolbar>
<v-toolbar-title>
<v-breadcrumbs >
<v-breadcrumbs-item to="/tasks" :exact="true">
Tasks
</v-breadcrumbs-item>
<v-breadcrumbs-item >
{{ task }}
<v-breadcrumbs :items="crumbs">
<template slot="item" slot-scope="props">
<v-breadcrumbs-item :to="props.item.to" :disabled="props.item.disabled" :exact="true">
{{ props.item.text }}
</v-breadcrumbs-item>
</template>
</v-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>
<router-link :to="{name:'taskhistory', query:{task: task}}"><v-icon>history</v-icon></router-link>
@ -55,7 +54,8 @@
loading: false,
snackbar: {show:false,msg:"",context:"success"},
valid: false,
id: null
id: null,
crumbs: [{to:"/tasks", text:"Tasks"},{text: this.task, disabled: true}]
}
},

View file

@ -25,6 +25,11 @@
<description>XQdoc...</description>
</task>
<task name="xqdoc-rest2" url="xqdoc/tx-xqrest2.xq">
<title>XQdoc rest2</title>
<description>XQdoc.2..</description>
</task>
<task name="vuecompile">
<title>vue compile</title>
<description>compile</description>

View file

@ -5,10 +5,12 @@
<v-card>
<v-toolbar>
<v-toolbar-title>
<v-breadcrumbs >
<v-breadcrumbs :items="crumbs">
<template slot="item" slot-scope="props">
<v-breadcrumbs-item to="/tasks" :exact="true">
Tasks
</v-breadcrumbs-item>
</template>
</v-breadcrumbs>
</v-toolbar-title>
<v-spacer></v-spacer>
@ -49,6 +51,8 @@
<script>{
data(){
return {
crumbs: [{to: "/tasks", text: "Tasks"}],
items: [],
loading: false,
q: null,

View file

@ -61,7 +61,7 @@
this.waiting=false
this.snackbar={show:true,msg:r.data.msg,context:"success"}
console.log(r.data)
settings.setItem('tasks/vuecompile',this.params)
Settings.setItem('tasks/vuecompile',this.params)
})
.catch(error=>{
this.waiting=false
@ -71,7 +71,7 @@
}
},
created: function () {
settings.getItem('tasks/vuecompile')
Settings.getItem('tasks/vuecompile')
.then((v)=>{
if(v)this.params=v
})

View file

@ -0,0 +1,7 @@
import module namespace xqd = 'quodatum:build.xqdoc' at "../../../lib/xqdoc/xqdoc-proj.xqm";
declare namespace c="http://www.w3.org/ns/xproc-step";
for $f in //c:file
let $ip:= $f/@name/resolve-uri(.,base-uri(.))
let $xq:= fetch:text($ip)
return xqd:parse($xq)

View file

@ -0,0 +1,6 @@
import module namespace xqd = 'quodatum:build.xqdoc' at "../../../lib/xqdoc/xqdoc-proj.xqm";
declare namespace c="http://www.w3.org/ns/xproc-step";
for $f in //c:file
let $ip:= $f/@name/resolve-uri(.,base-uri(.))
return xqd:xqdoc($ip,map{})

View file

@ -9,12 +9,14 @@ declare namespace c="http://www.w3.org/ns/xproc-step";
(:~ URL of the root folder to document
: @default C:/Users/andy/git/vue-poc/src/vue-poc
:)
declare variable $efolder as xs:anyURI external :="C:/Users/andy/git/vue-poc/src/vue-poc";
declare variable $efolder as xs:anyURI external
:=xs:anyURI("C:/Users/andy/git/vue-poc/src/vue-poc");
(:~ URL of the schema to use
: @default C:/tmp/xqdoc/
:)
declare variable $target as xs:anyURI external :="C:/tmp/xqdoc/";
declare variable $target as xs:anyURI external
:=xs:anyURI("C:/tmp/xqdoc/");
declare variable $state as element(state):=db:open("vue-poc","/state.xml")/state;

View file

@ -23,8 +23,9 @@ let $project:=tokenize($efolder,"[/\\]")[last()]=>trace("xqdoc: ")
let $files:= fw:directory-list($efolder,map{"include-filter":".*\.xqm"})
let $id:=$state/last-id
let $opts:=map{
"src-folder": $efolder,
"project": $project,
"id": $id/string()
"ext-id": $id/string()
}
let $op:=xqd:save-xq($files,$target,$opts)
let $result:=<json type="object">

View file

@ -13,12 +13,16 @@ declare namespace xqdoc="http://www.xqdoc.org/1.0";
: @default file:///C:/tmp/xqdoc/
:)
declare variable $target as xs:anyURI external :=
"file:///C:/tmp/xqdoc/" cast as xs:anyURI;
"file:///C:/tmp/xqdoca/" cast as xs:anyURI;
declare variable $nsRESTXQ:= 'http://exquery.org/ns/restxq';
(:~ map for each restxq:path :)
declare function local:import($path,$id as item(),$folder)
(:~ map for each restxq:path
: @param
:)
declare function local:import($path,
$id as item(),
$folder)
as map(*)*
{
let $uri:=``[F`{ string($id) }`/]``
@ -35,8 +39,13 @@ as map(*)*
};
(:~
: html for page.
:)
declare function local:page($reps as map(*)*)
{
let $tree:=trace($reps?uri)
let $tree:=tree:build($tree)=>trace("TRRES")
let $op:= <div>
<nav id="toc">
<div>
@ -46,7 +55,7 @@ let $op:= <div>
</div>
<h2>
<a id="contents"></a>
<span class="namespace">
<span >
RestXQ
</span>
</h2>
@ -57,14 +66,34 @@ let $op:= <div>
<span class="content">Introduction</span>
</a>
</li>
<li href="#main">
<a >
<span class="secno">2 </span>
<span class="content">Paths</span>
</a>
</li>
<li>
</li>
</ol>
</nav>
<a href="index.html">index: </a>
<ol> { local:tree-list($tree) } </ol>
<ul>{$reps!local:path-to-html(.)}</ul>
</div>
return xqd:page($op,map{"resources": "resources/"})
};
(:~ tree to list :)
declare function local:tree-list($tree){
typeswitch ($tree )
case element(directory)
return <li>{$tree/@name/string()}/<ul>{$tree/*!local:tree-list(.)}</ul></li>
default
return <li>{$tree/@name/string()}</li>
};
(:~ html for a path :)
declare function local:path-to-html($rep as map(*))
as element(li){
<li id="{ $rep?uri }">
@ -74,10 +103,11 @@ as element(li){
for $method in map:keys($methods)
let $d:=$methods?($method)
let $id:=head($d?function)
return <li><a href="{$d?uri}index.html#{$id }">{ $method }</a>
<div>{$d?description}</div></li>
}
</ul>
return <li>
<a href="{$d?uri}index.html#{$id }">{ $method }</a>
<div>{$d?description}</div>
</li>
}</ul>
</li>
};
@ -102,8 +132,16 @@ let $data:=map:merge(for $report in $reports
let $uris:=sort(map:keys($data))
return local:page( $data?($uris))
let $result:=<json type="object">
<extra>hello</extra>
<msg> {$target}, {count($data)} uris processed.</msg>
<id>xqrest2 ID??</id>
</json>
return
(
local:page( $data?($uris))
=>xqd:store2("restxq.html",$xqd:HTML5)
=>store:store($target)
=>store:store($target),
update:output($result)
)

View file

@ -0,0 +1,9 @@
<pipeline name='XQDoc generator' xmlns='http://quodatum.com/ns/pipeline'>>
<xquery href="tx-xqdoc2.xq">
<with-param name="efolder">C:/Users/andy/git/vue-poc/src/vue-poc</with-param>
<with-param name="target">C:/tmp/xqdoc/pipe/</with-param>
</xquery>
<xquery href="tx-xqrest2.xq">
<with-param name="target">file:///C:/tmp/xqdoc/pipe/</with-param>
</xquery>
</pipeline>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="../schema/pipeline.rnc" type="application/relax-ng-compact-syntax"?>
<pipeline name='XQDoc generator' xmlns='http://quodatum.com/ns/pipeline'>
<directory-list href="C:\Users\andy\git\vue-poc\src\vue-poc\"
include-filter=".*\.xqm" />
<store base="C:/tmp/pipes/" fileExpression="'files.xml'" dated="true" />
<pipeline>
<xslt href="C:\Users\andy\git\vue-poc\src\vue-poc\lib\xqdoc\html-index.xsl">
<param/>
</xslt>
<store base="C:/tmp/pipes/" fileExpression="'index.html'" dated="true" output="html5"/>
</pipeline>
<pipeline>
<xquery href="getxqdoc.xq"/>
<store base="C:/tmp/pipes/" fileExpression="'F' || $position || '/xqdoc.xml'" dated="true"/>
<identity/>
<!--
<xslt href="C:\Users\andy\git\vue-poc\src\vue-poc\lib\xqdoc\html-module.xsl"/>
-->
<store base="C:/tmp/pipes/" fileExpression="'F' || $position || '/index.html'" dated="true" output="html5"/>
</pipeline>
<pipeline>
<xquery href="getxparse.xq"/>
<store base="C:/tmp/pipes/" fileExpression="'F' || $position || '/xparse.xml'" dated="true"/>
</pipeline>
</pipeline>

View file

@ -69,7 +69,7 @@
this.id= r.data.id;
this.alert={msg:r.data.msg,success:true,error:false}
console.log(r.data)
settings.setItem('tasks/xqdoc',this.params)
Settings.setItem('tasks/xqdoc',this.params)
})
.catch(error=>{
this.waiting=false
@ -80,7 +80,7 @@
}
},
created: function () {
settings.getItem('tasks/xqdoc')
Settings.getItem('tasks/xqdoc')
.then((v)=>{
if(v)this.params=v
})

View file

@ -92,7 +92,7 @@
}
},
beforeRouteEnter (to, from, next) {
Promise.all([settings.getItem('images/thumbtask')
Promise.all([Settings.getItem('images/thumbtask')
])
.then(function(values) {
next(vm => {
@ -105,7 +105,7 @@
// called when the route that renders this component is about to
// be navigated away from.
// has access to `this` component instance.
settings.setItem('images/thumbtask',this.taskxml);
Settings.setItem('images/thumbtask',this.taskxml);
next(true);
},

View file

@ -0,0 +1,17 @@
(: clean tiddly images
:)
declare variable $SRC:="Z:\home\tiddly\quodatum\tiddlers\";
declare function local:decode($a){
let $b:= analyze-string(trace($a),"%[\d][\d]")
transform with {
for $m in fn:match
return replace value of node $m with
bin:decode-string(bin:hex( substring($m,2)))
}
return $b/string()
};
for $f in file:list($SRC,false())=>filter(function($f){contains($f,"%")})
let $d:=local:decode($f)
return file:move($SRC || $f,$SRC || $d)

View file

@ -105,7 +105,7 @@
},
},
beforeRouteEnter (to, from, next) {
settings.getItem('settings/ace')
Settings.getItem('settings/ace')
.then( v =>{
next(vm => {

112
src/vue-poc/lib/aync.xqm Normal file
View file

@ -0,0 +1,112 @@
xquery version "3.1";
(:~
: async ..
: scheduled, queued, running, cached
:)
module namespace qipe='http://quodatum.com/ns/pipeline';
(:~ submit a pipeline :)
declare
%updating
function qipe:submit($item as element(qipe:pipeline))
{
let $dbid:=qipe:id()
let $id:=$dbid + 0
let $pipe:=<qipe:run id="{$id}" state="queued" step="1"
base-uri="{base-uri($item)}">{
$item
}</qipe:run>
return (
db:replace("!ASYNC",``[run/`{ $id }`.xml]``,$pipe),
replace value of node $dbid with ($dbid +1)
)
};
(:~ next id :)
declare
function qipe:id()
as node(){
db:open("!ASYNC","/state.xml")/state/id
};
declare
function qipe:get($id as xs:string)
as element(qipe:run)?
{
collection("!ASYNC/run")/qipe:run[@id=$id]
};
declare
%updating
function qipe:run-step($id as xs:string)
{
let $run:=qipe:get($id)
let $step:= if($run/@state="queued") then
$run/@step/number()
else error()
let $base-uri:= $run/@base-uri/string()
let $task:= $run/qipe:pipeline/*[position()=$step]
let $xq:=resolve-uri($task/@href,$base-uri)
let $opts:=map{
"id": ``[pipe.`{ $run/@id }`.`{ $step }`]``,
"cache": true()
}
let $bindings:=map:merge( $task/qipe:with-param!map:entry(@name,string()) )
let $job:= jobs:invoke($xq,$bindings,$opts)
return replace value of node $run/@state with "running"
};
(:~ names of pipeline jobs with results :)
declare
function qipe:done-jobs()
as xs:string*
{
jobs:list()[starts-with(.,"pipe.")]!.[jobs:list-details(.)/@state="cached"]
};
declare
function qipe:queued()
as xs:string*
{
collection("!ASYNC/run")/qipe:run[@state="queued"]/@id/string()
};
(: update run using results of job
:)
declare
%updating
function qipe:update($jobid){
let $p:=tokenize($jobid,"\.")
let $run:=qipe:get($p[2])
let $step:=$p[3]
return try{
let $result:=jobs:result($jobid)
let $step:=$step+1 (: TODO all done :)
return (replace value of node $run/@step with ($step +1),
replace value of node $run/@state with "queued")
}catch * {
(insert node <error code="{ $err:code }">
<description>{ $err:description }</description>
</error>
into $run,
replace value of node $run/@state with "error")
}
};
declare
function qipe:list-details()
{
collection("!ASYNC/run")/qipe:run!<run id="{ @id }" state="{ @state }"/>
};
(: periodic task to update :)
declare
%updating
function qipe:tick()
{
(qipe:queued()!qipe:run-step(.),
qipe:done-jobs()!qipe:update(.) )
};

View file

@ -6,8 +6,13 @@
:)
module namespace qipe='http://quodatum.com/ns/pipeline';
import module namespace schematron = "http://github.com/Schematron/schematron-basex";
import module namespace fw="quodatum:file.walker";
declare namespace c="http://www.w3.org/ns/xproc-step";
declare variable $qipe:outputs:=map{
"html5": map{"method": "html","version":"5.0"},
"xml": map{"indent": "no"}
};
(:~ run a pipeline
: @param $pipe the pipeline document
: @param $initial starting data as sequence
@ -26,6 +31,12 @@ as item()*
)
};
declare function qipe:run($pipe as node() )
as item()*
{
qipe:run($pipe,())
};
(:~ check pipeline is valid against schema :)
declare function qipe:validate-pipeline($pipe as document-node() )
as document-node()
@ -45,9 +56,27 @@ declare function qipe:step($acc,$this as element(*),$opts as map(*))
case element(qipe:xslt) return qipe:xslt($acc,$this,$opts)
case element(qipe:load) return qipe:load($acc,$this,$opts)
case element(qipe:store) return qipe:store($acc,$this,$opts)
case element(qipe:directory-list) return qipe:dir($acc,$this,$opts)
case element(qipe:pipeline) return qipe:pipeline($acc,$this,$opts)
case element(qipe:identity) return qipe:identity($acc,$this,$opts)
default return error(xs:QName('qipe'), 'unknown step:' || name($this))
};
(:~ subpipe
:)
declare function qipe:pipeline($acc,$this as element(qipe:pipeline),$opts as map(*))
{
let $a:=qipe:run($this,$acc)
return $acc
};
(:~ identity
:)
declare function qipe:identity($acc,$this as element(qipe:pipeline),$opts as map(*))
{
$acc=>trace("IDENT")
};
(:~ run validate step based on @type
:)
declare function qipe:validate($acc,$this as element(qipe:validate),$opts as map(*))
@ -76,13 +105,25 @@ declare function qipe:validate($acc,$this as element(qipe:validate),$opts as map
$doc
};
(:~
: append directory-list to accumulator
:)
declare function qipe:dir($acc,$this as element(qipe:directory-list),$opts as map(*))
{
let $inc:=$this/@include-filter/string()
let $href:=$this/@href/string()
let $result:=fw:directory-list($href,map{"include-filter": $inc})
let $result:= document { $result } transform with { delete node //c:directory[not(.//c:file)]}
return ($acc,$result)
};
(:~
: run xquery referenced by @href and append result sequence to accumulator
:)
declare function qipe:xquery($acc,$this as element(qipe:xquery),$opts as map(*))
{
let $href:=$this/@href/string()
let $result:=xquery:invoke($href)
let $href:=resolve-uri($this/@href,base-uri($this))=>trace("AT")
let $result:=xquery:invoke($href,map{'': $acc})
return ($acc,$result)
};
@ -91,9 +132,10 @@ declare function qipe:xquery($acc,$this as element(qipe:xquery),$opts as map(*)
:)
declare function qipe:xslt($acc,$this as element(qipe:xslt),$opts as map(*))
{
let $href:=qipe:resolve($this/@href)
let $href:=qipe:resolve($this/@href)=>trace("XSLT")
for $d at $i in $acc
let $_:=qipe:log("xslt: " || $i,$opts)
let $_:=trace($d,"ddd")
return xslt:transform($d, $href)
};
@ -105,20 +147,23 @@ declare function qipe:store($acc,$this as element(qipe:store),$opts as map(*))
let $href:=qipe:resolve($this/@base)
let $dated:=boolean($this/@dated)
let $name:=$this/@fileExpression/string()
let $output:=($this/@output/string(),"xml")[1]
let $eval:="declare variable $position external :=0; " || $name
let $href:=$href || (if( $dated) then
format-date(current-date(),"/[Y0001][M01][D01]")
else
())
return (
if(file:exists($href)) then () else file:create-dir($href),
for $item at $pos in $acc
let $name:=xquery:eval($eval,
map{"":$item,
"position": $pos}) (:eval against doc:)
let $dest:=$href || "/" || $name
return ($dest,file:write($dest,$item))
let $dir:=file:parent($dest)
return (
$item
,if(file:is-dir($dir)) then () else file:create-dir($dir)
,file:write($dest,$item,$qipe:outputs?($output))
)
};

View file

@ -1,6 +1,84 @@
xquery version "3.1";
(:~
: convert sequence of paths to sequence of xml trees
:)
module namespace tree = 'quodatum.data.tree';
declare variable $tree:TEST1:=(
"/",
"/api/environment/",
"/api/execute/",
"/api/library/",
"/api/library/",
"/api/library/{$id}/",
"/api/library/{$id}/",
"/api/state/",
"/api/~testbed/",
"/api/state/",
"/api/state/",
"/api/suite/",
"/api/suite/{$suite}/",
"/api/execute/zz"
);
declare variable $tree:TEST2:=(
"/vue-poc",
"/vue-poc/api",
"/vue-poc/api/collection",
"/vue-poc/api/components/tree",
"/vue-poc/api/data/users",
"/vue-poc/api/data/{$entity}",
"/vue-poc/api/edit",
"/vue-poc/api/eval/execute",
"/vue-poc/api/eval/imports",
"/vue-poc/api/eval/invoke",
"/vue-poc/api/eval/plan",
"/vue-poc/api/eval/result/{$id}",
"/vue-poc/api/eval/submit",
"/vue-poc/api/form/schema",
"/vue-poc/api/get",
"/vue-poc/api/get2",
"/vue-poc/api/history",
"/vue-poc/api/images/datetaken",
"/vue-poc/api/images/keywords2",
"/vue-poc/api/images/list",
"/vue-poc/api/images/list/{ $id }/image",
"/vue-poc/api/images/list/{ $id }/meta",
"/vue-poc/api/images/list/{ $id }/thumb",
"/vue-poc/api/images/list/{$id}",
"/vue-poc/api/images/report",
"/vue-poc/api/job",
"/vue-poc/api/job/{$job}",
"/vue-poc/api/log",
"/vue-poc/api/log/add",
"/vue-poc/api/login-check",
"/vue-poc/api/logout",
"/vue-poc/api/ping",
"/vue-poc/api/repo",
"/vue-poc/api/search",
"/vue-poc/api/start",
"/vue-poc/api/status",
"/vue-poc/api/tasks",
"/vue-poc/api/tasks/model",
"/vue-poc/api/tasks/task",
"/vue-poc/api/tasks/vue-compile",
"/vue-poc/api/tasks/xqdoc",
"/vue-poc/api/tasks/{$task}",
"/vue-poc/api/test-select",
"/vue-poc/api/thumbnail",
"/vue-poc/api/thumbnail/images",
"/vue-poc/api/thumbnail/validate",
"/vue-poc/api/user",
"/vue-poc/api/validate",
"/vue-poc/api/xqdoc",
"/vue-poc/api/xslt",
"/vue-poc/ui",
"/vue-poc/ui/{$file=.+}",
"vue-poc/api/data/entity",
"vue-poc/api/data/entity/{$entity}",
"vue-poc/api/data/entity/{$entity}/field"
);
(:~
: convert path(s) to tree
@ -9,26 +87,28 @@ declare function tree:build($a as xs:string*)
{
fn:fold-right($a,
(),
function($a,$b){tree:merge(tree:tree($a),$b)}
function($this,$acc){ tree:merge($acc,tree:nest($this)) }
)
};
declare function tree:w($this,$seen)
declare function tree:nest($path as xs:string)
as element(*)
{
<directory name="{$this}">{$seen}</directory>
};
declare function tree:tree($path as xs:string)
as element(*)
{
let $parts:=fn:tokenize($path,"/")
let $path:=if(starts-with($path,"/")) then $path else "/" || $path
let $parts:=fn:tokenize(($path),"/")
return fn:fold-right(subsequence($parts,1,count($parts)-1),
<file name="{$parts[last()]}"/>,
tree:w#2
tree:wrap#2
)
};
declare function tree:wrap($this as xs:string,$acc)
as element(*)
{
<directory name="{$this}">{$acc}</directory>
};
declare function tree:merge($a1 as element(*)?,$a2 as element(*)?)
as element(*)*
{
@ -46,7 +126,7 @@ as element(*)*
for $x in fn:distinct-values($n2/@name[fn:not(.=$n1/@name)]) (:only $a2 :)
return $a2/*[@name=$x]
)
return tree:w($a1/@name,for $x in $t order by $x/@name return $x)
return tree:wrap($a1/@name,for $x in $t order by $x/@name return $x)
else
($a1,$a2)
};
@ -59,20 +139,13 @@ declare %unit:test
: smoke test
:)
function tree:test(){
let $a:=("/",
"/api/environment/",
"/api/execute/",
"/api/library/",
"/api/library/",
"/api/library/{$id}/",
"/api/library/{$id}/",
"/api/state/",
"/api/~testbed/",
"/api/state/",
"/api/state/",
"/api/suite/",
"/api/suite/{$suite}/",
"/api/execute/zz")
let $t:=tree:build($a)
let $t:=tree:build($tree:TEST1)
return unit:assert(fn:true(),$t)
};
declare %unit:test
function tree:test2(){
let $t:=tree:build($tree:TEST1)
return unit:assert(fn:false(),$t)
};

View file

@ -6,10 +6,14 @@
xmlns:doc="http://www.xqdoc.org/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
xmlns:qd="http://www.quodatum.com/ns/xsl" exclude-result-prefixes="xs doc fn"
xmlns:c="http://www.w3.org/ns/xproc-step" version="2.0">
xmlns:c="http://www.w3.org/ns/xproc-step" version="3.0">
<xsl:import href="xqdoc.xsl"/>
<!-- build project index" -->
<xsl:param name="project" as="xs:string" />
<xsl:param name="id" as="xs:string" />
<xsl:param name="project" as="xs:string" >?</xsl:param>
<xsl:param name="ext-id" as="xs:string" >?</xsl:param>
<xsl:param name="src-folder" as="xs:string" >c:/</xsl:param>
<!-- relative path to resource files -->
<xsl:param name="resources" as="xs:string" select="'resources/'" />
<xsl:variable name="css" select="concat($resources,'base.css')" />
@ -22,28 +26,26 @@
content="xqdoc-r - https://github.com/quodatum/xqdoc-r" />
<title>
<xsl:value-of select="'Index'" /> <xsl:value-of select="$id" />
- xqDoc
<xsl:value-of select="'Index'" /> <xsl:value-of select="$ext-id" />
* xqDoc
</title>
<link rel="shortcut icon" type="image/x-icon" href="{$resources}xqdoc.png" />
<link rel="stylesheet" type="text/css" href="{$resources}page.css" />
<link rel="stylesheet" type="text/css" href="{$resources}query.css" />
<link rel="stylesheet" type="text/css" href="{$resources}base.css" />
<link rel="stylesheet" type="text/css" href="{$resources}prettify.css" />
<script src="{$resources}prettify.js" type="text/javascript">&#160;</script>
<script src="{$resources}lang-xq.js" type="text/javascript">&#160;</script>
<xsl:call-template name="resources">
<xsl:with-param name="path" select="$resources"/>
</xsl:call-template>
</head>
<body class="home" id="top">
<div id="main">
<h1>
XQDoc for
<xsl:value-of select="$project" /> ,id: <xsl:value-of select="$id" />
<span class="tag tag-success">
<xsl:value-of select="$project" />
</span>
XQDoc ,id: <xsl:value-of select="$ext-id" />
</h1>
<xsl:call-template name="toc" />
<a href="restxq.html">RestXQ</a>
<div>src: <xsl:value-of select="$src-folder" /></div>
<div id="file">
<h1>Files</h1>
<ul>
@ -54,7 +56,14 @@
<div id="ns">
<h1>Namespace</h1>
<ul>
<xsl:apply-templates select=".//c:file" />
<xsl:for-each select=".//c:file">
<xsl:variable name="path" select="resolve-uri(@name,$src-folder)"/>
<xsl:variable name="doc" select="doc($path)"/>
<li>
<xsl:value-of select="position()"/>
<xsl:value-of select="$path"/>
</li>
</xsl:for-each>
</ul>
</div>
@ -72,12 +81,14 @@
</xsl:template>
<xsl:template match="c:file">
<xsl:variable name="path" select="string-join(ancestor-or-self::*/@name,'/')"/>
<li>
<a href="F{position()}/index.html">
<xsl:value-of select="qd:path(@name)" />
</a>
<xsl:value-of select="position()" />
<xsl:value-of select="$path" />
</li>
</xsl:template>
@ -85,7 +96,7 @@
<nav id="toc">
<h2>
<a id="contents"></a>
<span class="namespace">
<span class="tag tag-success">
<xsl:value-of select="$project" />
</span>
</h2>
@ -112,9 +123,5 @@
</nav>
</xsl:template>
<!-- path -->
<xsl:function name="qd:path" as="xs:string">
<xsl:param name="file" />
<xsl:sequence select="concat('*',$file)" />
</xsl:function>
</xsl:stylesheet>

View file

@ -3,12 +3,13 @@
xmlns:doc="http://www.xqdoc.org/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
xmlns:qd="http://www.quodatum.com/ns/xsl" exclude-result-prefixes="xs doc fn"
version="2.0">
version="3.0">
<xsl:import href="xqdoc.xsl"/>
<!-- Standalone xqdoc:xqdoc transform mode"restxq" -->
<xsl:param name="project" as="xs:string" />
<xsl:param name="source" as="xs:string" />
<xsl:param name="filename" as="xs:string" />
<xsl:param name="id" as="xs:string" />
<xsl:param name="project" as="xs:string" select="'unknown'"/>
<xsl:param name="source" as="xs:string" >No code provided</xsl:param>
<xsl:param name="filename" as="xs:string" select="'?file'" />
<xsl:param name="ext-id" as="xs:string"></xsl:param>
<xsl:param name="show-private" as="xs:boolean" select="false()" />
<xsl:param name="resources" as="xs:string" select="'../resources/'" />
@ -28,22 +29,16 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Generator"
content="xqdoc-r - https://github.com/quodatum/xqdoc-r" />
content="xqdoc-r - https://github.com/quodatum/xqdoc-r 2018-11-02" />
<title>
<xsl:value-of select="$docuri" />
- xqDoc
<xsl:value-of select="$id" />
<xsl:value-of select="$ext-id" />
</title>
<link rel="shortcut icon" type="image/x-icon" href="{$resources}xqdoc.png" />
<link rel="stylesheet" type="text/css" href="{$resources}page.css" />
<link rel="stylesheet" type="text/css" href="{$resources}query.css" />
<link rel="stylesheet" type="text/css" href="{$resources}base.css" />
<link rel="stylesheet" type="text/css" href="{$resources}prettify.css" />
<link rel="stylesheet" type="text/css" href="{$resources}prism.css" />
<script src="{$resources}prettify.js" type="text/javascript">&#160;</script>
<script src="{$resources}prism.js" type="text/javascript">&#160;</script>
<xsl:call-template name="resources">
<xsl:with-param name="path" select="$resources"/>
</xsl:call-template>
</head>
<body class="home" id="top">
<div id="main">
@ -82,20 +77,18 @@
</div>
</div>
<script type="application/javascript">
window.onload = function(){ prettyPrint(); }
</script>
</body>
</html>
</xsl:template>
<xsl:template match="doc:module">
<h1>
<xsl:value-of select="@type" />
module: &#160;
<span class="namespace">
<span class="tag tag-success">
<xsl:value-of select="doc:uri" />
</span>
<small>&#160;
<xsl:value-of select="@type" /> module
</small>
</h1>
<dl>
@ -430,12 +423,12 @@
<div>
<a href="{$index}">
&#8624;
<xsl:value-of select="$project" /> :id= <xsl:value-of select="$id" />
<xsl:value-of select="$project" /> :id= <xsl:value-of select="$ext-id" />
</a>
</div>
<h2>
<a id="contents"></a>
<span class="namespace">
<span class="">
<xsl:value-of select="$docuri" />
</span>
</h2>

Binary file not shown.

File diff suppressed because one or more lines are too long

View file

@ -1,48 +0,0 @@
/* Pretty printing styles. Used with prettify.js. */
.str { color: #080; }
.kwd { color: #008; }
.com { color: #800; }
.typ { color: #606; }
.lit { color: #066; }
.pun { color: #660; }
.pln { color: #000; }
.tag { color: #008; }
.atn { color: #606; }
.atv { color: #080; }
.dec { color: #606; }
/* pw */
.fun { color: red; }
.var { color: #606; }
/* pw end */
pre.prettyprint { padding: 2px; border: 1px solid #888 }
/* Specify class=linenums on a pre to get line numbering */
ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L5,
li.L6,
li.L7,
li.L8 { list-style-type: none }
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 { background: #eee }
@media print {
.str { color: #060; }
.kwd { color: #006; font-weight: bold; }
.com { color: #600; font-style: italic; }
.typ { color: #404; font-weight: bold; }
.lit { color: #044; }
.pun { color: #440; }
.pln { color: #000; }
.tag { color: #006; font-weight: bold; }
.atn { color: #404; }
.atv { color: #060; }
}

File diff suppressed because it is too large Load diff

View file

@ -16,6 +16,8 @@ declare variable $xqd:XML:=map{"indent": "no"};
declare variable $xqd:mod-xslt external :="html-module.xsl";
declare variable $xqd:index-xslt external :="html-index.xsl";
declare variable $xqd:cache external :=false();
(:~ @see https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods :)
declare variable $xqd:methods:=("GET","HEAD","POST","PUT","DELETE","PATCH");
@ -61,7 +63,7 @@ declare function xqd:gendoc(
let $params:=map:merge((map{
"source": $xq,
"filename": $f/@name/string(),
"cache":true(),
"cache": $xqd:cache,
"show-private": true(),
"resources": "../resources/"},
$params))
@ -92,7 +94,7 @@ as map(*)* {
let $params:=map:merge((map{
"source": $xq,
"filename": $f/@name/string(),
"cache":true(),
"cache": $xqd:cache,
"show-private": true(),
"resources": "../resources/"},
$params))

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- shared module for xqdoc -->
<xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://www.xqdoc.org/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:qd="http://www.quodatum.com/ns/xsl" exclude-result-prefixes="xs doc">
<xsl:template name="resources">
<xsl:param name="path" />
<link rel="shortcut icon" type="image/x-icon" href="{$path}xqdoc.png"/>
<link rel="stylesheet" type="text/css" href="{$path}prism.css"/>
<link rel="stylesheet" type="text/css" href="{$path}page.css"/>
<link rel="stylesheet" type="text/css" href="{$path}query.css"/>
<link rel="stylesheet" type="text/css" href="{$path}base.css"/>
<style>
.tag {font-size: 100%;}
</style>
<script src="{$path}prism.js" type="text/javascript">&#160;</script>
</xsl:template>
<!-- path -->
<xsl:function name="qd:path" as="xs:string">
<xsl:param name="file" />
<xsl:sequence select="concat('*',$file)" />
</xsl:function>
</xsl:stylesheet>

View file

@ -1,5 +1,5 @@
(: entity access maps
: auto generated from xml files in entities folder at: 2018-08-14T21:11:56.357+01:00
: auto generated from xml files in entities folder at: 2018-10-26T22:55:28.159+01:00
:)
module namespace entity = 'quodatum.models.generated';
@ -346,6 +346,39 @@ declare variable $entity:list:=map {
"views": map{
'filter': 'name description'
}
},
"repo": map{
"name": "repo",
"description": "An entry in the basex repository",
"access": map{
"name": function($_ as element()) as xs:string {$_/@name },
"type": function($_ as element()) as xs:string {$_/@type },
"version": function($_ as element()) as xs:string {$_/@version } },
"filter": function($item,$q) as xs:boolean{
some $e in ( ) satisfies
fn:contains($e,$q, 'http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive')
},
"json": map{
"name": function($_ as element()) as element(name)? {
(: xs:string :)
fn:data($_/@name)!element name { .}
},
"type": function($_ as element()) as element(type)? {
(: xs:string :)
fn:data($_/@type)!element type { .}
},
"version": function($_ as element()) as element(version)? {
(: xs:string :)
fn:data($_/@version)!element version { .}
} },
"data": function() as element(package)*
{ repo:list() },
"views": map{
}
},
"search-result": map{
@ -384,6 +417,87 @@ declare variable $entity:list:=map {
"views": map{
}
},
"task": map{
"name": "task",
"description": "predefined queries with parameters ",
"access": map{
"description": function($_ as element()) as xs:string {$_/fn:serialize(description/node()) },
"title": function($_ as element()) as xs:string {$_/title },
"to": function($_ as element()) as xs:string {$_/@name },
"url": function($_ as element()) as xs:string {$_/@url } },
"filter": function($item,$q) as xs:boolean{
some $e in ( ) satisfies
fn:contains($e,$q, 'http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive')
},
"json": map{
"description": function($_ as element()) as element(description)? {
(: xs:string :)
fn:data($_/fn:serialize(description/node()))!element description { .}
},
"title": function($_ as element()) as element(title)? {
(: xs:string :)
fn:data($_/title)!element title { .}
},
"to": function($_ as element()) as element(to)? {
(: xs:string :)
fn:data($_/@name)!element to { .}
},
"url": function($_ as element()) as element(url)? {
(: xs:string :)
fn:data($_/@url)!element url { .}
} },
"data": function() as element(task)*
{ doc("tasks/taskdef.xml")/tasks/task },
"views": map{
}
},
"taskhistory": map{
"name": "taskhistory",
"description": "vue-poc task view events ",
"access": map{
"created": function($_ as element()) as xs:string {$_/@when },
"id": function($_ as element()) as xs:string {$_/@id },
"protocol": function($_ as element()) as xs:string {$_/h:file/@mode },
"url": function($_ as element()) as xs:string {$_/h:file/@url },
"user": function($_ as element()) as xs:string {$_/@user } },
"filter": function($item,$q) as xs:boolean{
some $e in ( ) satisfies
fn:contains($e,$q, 'http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive')
},
"json": map{
"created": function($_ as element()) as element(created)? {
(: xs:string :)
fn:data($_/@when)!element created { .}
},
"id": function($_ as element()) as element(id)? {
(: xs:string :)
fn:data($_/@id)!element id { .}
},
"protocol": function($_ as element()) as element(protocol)? {
(: xs:string :)
fn:data($_/h:file/@mode)!element protocol { .}
},
"url": function($_ as element()) as element(url)? {
(: xs:string :)
fn:data($_/h:file/@url)!element url { .}
},
"user": function($_ as element()) as element(user)? {
(: xs:string :)
fn:data($_/@user)!element user { .}
} },
"data": function() as element(h:event)*
{ doc("vue-poc/history.xml")/h:history/h:event[task] },
"views": map{
}
},
"thumbnail": map{

View file

@ -27,7 +27,7 @@
<xpath>.</xpath>
</field>
</fields>
<views iconclass="fa fa-calendar"/>
<views iconclass="calendar_today"/>
<data type="element(entry)">hof:top-k-by(admin:logs(), hof:id#1, 2)/string()!reverse(admin:logs(.,true()))</data>
</entity>

View file

@ -24,6 +24,6 @@
<xpath>h:file/@url</xpath>
</field>
</fields>
<views iconclass="fa fa-calendar"/>
<views iconclass="calendar_today"/>
<data type="element(h:event)">doc("vue-poc/history.xml")/h:history/h:event[h:file]</data>
</entity>

View file

@ -28,7 +28,7 @@
<xpath>string-length(result)</xpath>
</field>
</fields>
<views iconclass="fa fa-file-code-o">
<views iconclass="code">
<view name="filter">name description</view>
</views>
<data type="element(jobrun)">collection("vue-poc/jobrun")/jobrun

View file

@ -24,7 +24,7 @@
<xpath>string-length(result)</xpath>
</field>
</fields>
<views iconclass="fa fa-file-code-o">
<views iconclass="input">
<view name="filter">name description</view>
</views>
<data type="element(query)">collection("replx/queries")/query

View file

@ -15,6 +15,6 @@
<xpath>@type</xpath>
</field>
</fields>
<views iconclass="setting_applications"/>
<views iconclass="settings_applications"/>
<data type="element(package)">repo:list()</data>
</entity>

View file

@ -18,6 +18,6 @@
<xpath>"app.item.index({'name':'benchx'})"</xpath>
</field>
</fields>
<views iconclass="fa fa-question-circle" />
<views iconclass="search" />
<data type="element(search)"></data>
</entity>

View file

@ -15,7 +15,7 @@
</field>
<field name="description" type="xs:string">
<description>task description</description>
<xpath>fn:serialize(description/node()</xpath>
<xpath>fn:serialize(description/node())</xpath>
</field>
</fields>
<views iconclass="update"/>

View file

@ -24,6 +24,6 @@
<xpath>h:file/@url</xpath>
</field>
</fields>
<views iconclass="fa fa-calendar"/>
<views iconclass="calendar_today"/>
<data type="element(h:event)">doc("vue-poc/history.xml")/h:history/h:event[task]</data>
</entity>

View file

@ -48,7 +48,7 @@ const router = new VueRouter({
,children: [
{
path: '',
component: Settings, meta:{title:"Settings", requiresAuth:true}
component: Showsettings, meta:{title:"Settings", requiresAuth:true}
},
{
path: 'keys',

File diff suppressed because it is too large Load diff

View file

@ -7,22 +7,21 @@
<meta name="description" content="Vue poc" />
<meta name="author" content="andy bunce." />
<title>Vue Router Test</title>
<link rel="shortcut icon" href="/vue-poc/ui/icon.png"/>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"/>
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons"/>
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link rel="stylesheet" href="//unpkg.com/vuetify@1.2.10/dist/vuetify.min.css" type="text/css"/>
<link rel="stylesheet" href="//unpkg.com/@riophae/vue-treeselect@0.0.29/dist/vue-treeselect.min.css">
<link rel="stylesheet" href="/vue-poc/ui/prism/prism.css" rel="stylesheet" type="text/css"/>>
<link rel="stylesheet" href="//unpkg.com/vuetify@1.3.9/dist/vuetify.min.css" type="text/css"/>
<link rel="stylesheet" href="//unpkg.com/@riophae/vue-treeselect@0.0.29/dist/vue-treeselect.min.css"/>
<link rel="stylesheet" href="/vue-poc/ui/prism/prism.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="//unpkg.com/leaflet@1.0.3/dist/leaflet.css"/>
<link href="/vue-poc/ui/app.css" rel="stylesheet" type="text/css"/>
<link href="/vue-poc/ui/svg/d3-svg.css" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="/vue-poc/ui/icon.png"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/vis/4.20.1/vis-timeline-graph2d.min.css" />
</head>
<body>
<div id="app">
<h3><code>vue-poc</code> <small>(v0.3.10)</small> </h3>
<h3><code>vue-poc</code> <small>(v0.3.135)</small> </h3>
<div class="spinner">
<div class="rect1"></div>
@ -38,7 +37,7 @@
<script src="//cdnjs.cloudflare.com/ajax/libs/vue-router/3.0.1/vue-router.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/qs/6.4.0/qs.js" crossorigin="anonymous" ></script>
<script src="//unpkg.com/vuetify@1.2.10/dist/vuetify.min.js" crossorigin="anonymous"></script>
<script src="//unpkg.com/vuetify@1.3.9/dist/vuetify.min.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.1/ace.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.1/ext-language_tools.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.1/ext-linking.js" type="text/javascript" charset="utf-8"></script>

View file

@ -1,2 +1,2 @@
declare variable $MAX:=100000;
declare variable $MAX external:= 100000;
for $i in (2 to $MAX) return if (every $j in (2 to $i - 1) satisfies $i mod $j ne 0) then $i else ()