diff --git a/src/vue-poc/components/vue-ace.vue b/src/vue-poc/components/vue-ace.vue index 2913eb2..d1dec4f 100644 --- a/src/vue-poc/components/vue-ace.vue +++ b/src/vue-poc/components/vue-ace.vue @@ -72,7 +72,6 @@ ace editor for vue.js }, applySettings(aceSettings){ - console.log("apply: ",aceSettings.theme) this.editor.setTheme(`ace/theme/${aceSettings.theme}`) //this.editor.setKeyboardHandler(`ace/keyboard//${aceSettings.keybinding}`) this.editor.setFontSize(parseInt(aceSettings.fontsize,10)) diff --git a/src/vue-poc/core.js b/src/vue-poc/core.js index e549e87..4099fa3 100644 --- a/src/vue-poc/core.js +++ b/src/vue-poc/core.js @@ -52,7 +52,7 @@ var settings = { if (this.debug) console.log('getItem',key); return localforage.getItem(key) .then(value => { - console.log('GET setting', key,value); + //console.log('GET setting', key,value); return value; }).catch(err => { @@ -64,7 +64,7 @@ var settings = { if (this.debug) console.log('setItem',key,value); return localforage.setItem(key, value) .then(value => { - console.log('SET ',key, value); + //console.log('SET ',key, value); return value }).catch(err => { diff --git a/src/vue-poc/features/images/images.vue b/src/vue-poc/features/images/images.vue index 2db0db2..abe3c9e 100644 --- a/src/vue-poc/features/images/images.vue +++ b/src/vue-poc/features/images/images.vue @@ -40,16 +40,17 @@ - - + + check_circle - # - + + #{{image.keywords}} + place diff --git a/src/vue-poc/features/images/images.xqm b/src/vue-poc/features/images/images.xqm index 95d9595..8d13cf4 100644 --- a/src/vue-poc/features/images/images.xqm +++ b/src/vue-poc/features/images/images.xqm @@ -142,11 +142,15 @@ as element(*)* let $id:=$vue-api:entity?access?id($image) let $path:=$vue-api:entity?access?path($image) let $name:=$vue-api:entity?access?name($image) +let $geo:=$vue-api:entity?access?geo($image) +let $keywords:=$vue-api:entity?access?keywords($image) let $thumb:= $cfg:THUMBDIR || $path let $thumb:=if(file:exists($thumb)) then $thumb else $cfg:THUMBDIR || "missing.jpg" return ( {$id} ,{$name} ,{$path} + ,{$geo} + ,{$keywords} ,{fetch:binary($thumb)} ,{fetch:content-type($thumb)}) }; diff --git a/src/vue-poc/features/ping/ping.vue b/src/vue-poc/features/ping/ping.vue index db07c71..9d46dab 100644 --- a/src/vue-poc/features/ping/ping.vue +++ b/src/vue-poc/features/ping/ping.vue @@ -31,7 +31,7 @@ Get - cached + radio_button_checked @@ -65,7 +65,7 @@ Update - cached + radio_button_checked diff --git a/src/vue-poc/features/settings/acesettings.vue b/src/vue-poc/features/settings/acesettings.vue index b6bfa2a..e3b8a1d 100644 --- a/src/vue-poc/features/settings/acesettings.vue +++ b/src/vue-poc/features/settings/acesettings.vue @@ -105,7 +105,7 @@ fontsize: "14" }, keybindings:[ 'ace', 'vim', 'emacs', 'textarea', 'sublime' ], - themes: [ "github", "chaos","tomorrow"] + themes: [ "github","chrome" ,"tomorrow","-dark-","chaos","twilight"] } }, methods:{ diff --git a/src/vue-poc/features/tabs.vue b/src/vue-poc/features/tabs.vue index b4d45d3..f4bb95c 100644 --- a/src/vue-poc/features/tabs.vue +++ b/src/vue-poc/features/tabs.vue @@ -23,10 +23,10 @@ :key="i" :href="'#mobile-tabs-6-' + i" > - - + + favorite - + Item {{ i }} more diff --git a/src/vue-poc/features/validate/rq-validate.xqm b/src/vue-poc/features/validate/rq-validate.xqm index da23bce..1a7a966 100644 --- a/src/vue-poc/features/validate/rq-validate.xqm +++ b/src/vue-poc/features/validate/rq-validate.xqm @@ -5,35 +5,32 @@ :) module namespace tx = 'quodatum:vue.api.transform'; +import module namespace qv = 'quodatum.validate' at "validate.xqm"; -(:~ - : xslt - :) +declare namespace cnt="http://cambridge.org/core/content"; +(:~ location of schema to use :) +declare variable $tx:nvdl:=resolve-uri("../static/consignment/nvdl/consignment.nvdl",static-base-uri()); + +(:~ location of schema to use :) +declare variable $tx:schematron:=resolve-uri("../static/consignment/nvdl/core-consignment.sch",static-base-uri()); + +declare variable $tx:validators:=(qv:schematron(?,$tx:schematron) + ,qv:nvdl(?,$tx:nvdl) + ); + +(:~ run validation doc in db :) declare -%rest:POST %rest:path("/vue-poc/api/xslt") -%rest:query-param("xml", "{$xml}") -%rest:query-param("xslt", "{$xslt}") -%output:method("json") -%updating -function tx:xslt($xml,$xslt) { +%rest:GET %rest:path("/vue-poc/api/validate") +%rest:query-param("doc", "{$doc}") +%rest:query-param("schema", "{$schema}") +%rest:produces("text/xml") +%output:method("xml") +function tx:validate-path($doc,$schema){ + tx:validate(doc($doc)) +}; - let $result:=try{ - let $x:=fn:parse-xml($xml) - let $s:=fn:parse-xml($xslt) - let $t:=fn:trace($xml,"xml") - let $t:=fn:trace($xslt,"xml") - let $r:=xslt:transform($x,$s) - return - - 0 - {fn:serialize($r)} - - } - catch *{ - - 1 - {$err:description} - - } - return db:output($result) -}; \ No newline at end of file +(:~ run validations add custom details - content-type:) +declare function tx:validate($doc){ + let $type:=$doc//cnt:*=>head()=>local-name()=>substring-after("content-") + return qv:validation($doc,$tx:validators,attribute type {$type}) +}; diff --git a/src/vue-poc/features/validate/validate.vue b/src/vue-poc/features/validate/validate.vue index b99246b..80dc5d6 100644 --- a/src/vue-poc/features/validate/validate.vue +++ b/src/vue-poc/features/validate/validate.vue @@ -1,16 +1,71 @@ - + - + @@ -55,6 +56,7 @@ integrity="sha512-lInM/apFSqyy1o6s89K4iQUKg6ppXEgsVxT35HbzUupEVRh2Eu9Wdl4tHj7dZO0s1uvplcYGmt3498TtHq+log==" crossorigin=""> + diff --git a/src/vue-poc/static/svg-pan-zoom.css b/src/vue-poc/static/svg-pan-zoom.css new file mode 100644 index 0000000..612011b --- /dev/null +++ b/src/vue-poc/static/svg-pan-zoom.css @@ -0,0 +1,36 @@ +html, body { + font-family: Arial, sans-serif; +} + +.title { + font-size: 12px; +} +.canvas { + overflow: hidden; + fill: #808040; +} +.canvas .wrapper.outer > .background { + fill: #000000; +} +.canvas .wrapper.inner > .background { + fill: #CCCCCC; + cursor: move; +} +.canvas .background { + fill: #F6F6F6; + stroke: #333333; + cursor: move; +} +.canvas .panCanvas { + cursor: move; +} + +.canvas .minimap .frame .background { + stroke: #111111; + stroke-width: 4px; + fill-opacity: 0.4; + fill: #000000; + fill: url(#minimapGradient_qwpyza); + xfilter: url(#minimapDropShadow_qwpyza); + cursor: move; +} \ No newline at end of file diff --git a/src/vue-poc/static/svg-pan-zoom.js b/src/vue-poc/static/svg-pan-zoom.js new file mode 100644 index 0000000..20c2e8c --- /dev/null +++ b/src/vue-poc/static/svg-pan-zoom.js @@ -0,0 +1,436 @@ +// http://www.billdwhite.com/wordpress/2013/11/26/d3-minimap-pan-and-zoom-demo/ +d3.demo = {}; + + /** CANVAS **/ + d3.demo.canvas = function() { + + "use strict"; + + var width = 500, + height = 500, + zoomEnabled = true, + dragEnabled = true, + scale = 1, + translation = [0,0], + base = null, + wrapperBorder = 2, + minimap = null, + minimapPadding = 20, + minimapScale = 0.25; + + function canvas(selection) { + + base = selection; + + var xScale = d3.scale.linear() + .domain([-width / 2, width / 2]) + .range([0, width]); + + var yScale = d3.scale.linear() + .domain([-height / 2, height / 2]) + .range([height, 0]); + + var zoomHandler = function(newScale) { + if (!zoomEnabled) { return; } + if (d3.event) { + scale = d3.event.scale; + } else { + scale = newScale; + } + if (dragEnabled) { + var tbound = -height * scale, + bbound = height * scale, + lbound = -width * scale, + rbound = width * scale; + // limit translation to thresholds + translation = d3.event ? d3.event.translate : [0, 0]; + translation = [ + Math.max(Math.min(translation[0], rbound), lbound), + Math.max(Math.min(translation[1], bbound), tbound) + ]; + } + + d3.select(".panCanvas, .panCanvas .bg") + .attr("transform", "translate(" + translation + ")" + " scale(" + scale + ")"); + + minimap.scale(scale).render(); + }; // startoff zoomed in a bit to show pan/zoom rectangle + + var zoom = d3.behavior.zoom() + .x(xScale) + .y(yScale) + .scaleExtent([0.1, 10]) + .on("zoom.canvas", zoomHandler); + var w=width + (wrapperBorder*2) + minimapPadding*2 + (width*minimapScale); + var h=height + (wrapperBorder*2); + var svg = selection.append("svg") + .attr("class", "svg canvas") + .attr("width", "100%") + .attr("height", "100%") + .attr("viewBox", "0 0 "+w + " "+h) + .attr("shape-rendering", "auto"); + + var svgDefs = svg.append("defs"); + + svgDefs.append("clipPath") + .attr("id", "wrapperClipPath_qwpyza") + .attr("class", "wrapper clipPath") + .append("rect") + .attr("class", "background") + .attr("width", width) + .attr("height", height); + + svgDefs.append("clipPath") + .attr("id", "minimapClipPath_qwpyza") + .attr("class", "minimap clipPath") + .attr("width", width) + .attr("height", height) + //.attr("transform", "translate(" + (width + minimapPadding) + "," + (minimapPadding/2) + ")") + .append("rect") + .attr("class", "background") + .attr("width", width) + .attr("height", height); + + var filter = svgDefs.append("svg:filter") + .attr("id", "minimapDropShadow_qwpyza") + .attr("x", "-20%") + .attr("y", "-20%") + .attr("width", "150%") + .attr("height", "150%"); + + filter.append("svg:feOffset") + .attr("result", "offOut") + .attr("in", "SourceGraphic") + .attr("dx", "1") + .attr("dy", "1"); + + filter.append("svg:feColorMatrix") + .attr("result", "matrixOut") + .attr("in", "offOut") + .attr("type", "matrix") + .attr("values", "0.1 0 0 0 0 0 0.1 0 0 0 0 0 0.1 0 0 0 0 0 0.5 0"); + + filter.append("svg:feGaussianBlur") + .attr("result", "blurOut") + .attr("in", "matrixOut") + .attr("stdDeviation", "10"); + + filter.append("svg:feBlend") + .attr("in", "SourceGraphic") + .attr("in2", "blurOut") + .attr("mode", "normal"); + + var minimapRadialFill = svgDefs.append("radialGradient") + .attr({ + id:"minimapGradient_qwpyza", + gradientUnits:"userSpaceOnUse", + cx:"500", + cy:"500", + r:"400", + fx:"500", + fy:"500" + }); + minimapRadialFill.append("stop") + .attr("offset", "0%") + .attr("stop-color", "#FFFFFF"); + minimapRadialFill.append("stop") + .attr("offset", "40%") + .attr("stop-color", "#EEEEEE"); + minimapRadialFill.append("stop") + .attr("offset", "100%") + .attr("stop-color", "#E0E0E0"); + + var outerWrapper = svg.append("g") + .attr("class", "wrapper outer") + .attr("transform", "translate(0, " + minimapPadding + ")"); + + outerWrapper.append("rect") + .attr("class", "background") + .attr("width", width + wrapperBorder*2) + .attr("height", height + wrapperBorder*2); + + var innerWrapper = outerWrapper.append("g") + .attr("class", "wrapper inner") + .attr("clip-path", "url(#wrapperClipPath_qwpyza)") + .attr("transform", "translate(" + (wrapperBorder) + "," + (wrapperBorder) + ")") + .call(zoom); + + innerWrapper.append("rect") + .attr("class", "background") + .attr("width", width) + .attr("height", height); + + var panCanvas = innerWrapper.append("g") + .attr("class", "panCanvas") + .attr("width", width) + .attr("height", height) + .attr("transform", "translate(0,0)"); + + panCanvas.append("rect") + .attr("class", "background") + .attr("width", width) + .attr("height", height); + + minimap = d3.demo.minimap() + .zoom(zoom) + .target(panCanvas) + .minimapScale(minimapScale) + .x(width + minimapPadding) + .y(minimapPadding); + + svg.call(minimap); + + // startoff zoomed in a bit to show pan/zoom rectangle + zoom.scale(1.75); + zoomHandler(1.75); + + /** ADD SHAPE **/ + canvas.addItem = function(item) { + panCanvas.node().appendChild(item.node()); + minimap.render(); + }; + canvas.clear = function() { + var node=panCanvas.node(); + while (node.hasChildNodes()) { + node.removeChild(node.lastChild); + }; + }; + /** RENDER **/ + canvas.render = function() { + svgDefs + .select(".clipPath .background") + .attr("width", width) + .attr("height", height); + var w=width + (wrapperBorder*2) + minimapPadding*2 + (width*minimapScale); + var h=height + (wrapperBorder*2); + svg + .attr("width", "100%") + .attr("height", "100%") + .attr("viewBox", "0 0 "+w + " "+h); + outerWrapper + .select(".background") + .attr("width", width + wrapperBorder*2) + .attr("height", height + wrapperBorder*2); + + innerWrapper + .attr("transform", "translate(" + (wrapperBorder) + "," + (wrapperBorder) + ")") + .select(".background") + .attr("width", width) + .attr("height", height); + + panCanvas + .attr("width", width) + .attr("height", height) + .select(".background") + .attr("width", width) + .attr("height", height); + + minimap + .x(width + minimapPadding) + .y(minimapPadding) + .render(); + }; + + canvas.zoomEnabled = function(isEnabled) { + if (!arguments.length) { return zoomEnabled } + zoomEnabled = isEnabled; + }; + + canvas.dragEnabled = function(isEnabled) { + if (!arguments.length) { return dragEnabled } + dragEnabled = isEnabled; + }; + + canvas.reset = function() { + svg.call(zoom.event); + zoom.scale(1); + zoom.translate([0,0]); + svg.transition().duration(750).call(zoom.event); + }; + } + + + //============================================================ + // Accessors + //============================================================ + + canvas.width = function(value) { + if (!arguments.length) return width; + width = parseInt(value, 10); + return this; + }; + + canvas.height = function(value) { + if (!arguments.length) return height; + height = parseInt(value, 10); + return this; + }; + + canvas.scale = function(value) { + if (!arguments.length) { return scale; } + scale = value; + return this; + }; + + return canvas; + }; + + + + /** MINIMAP **/ + d3.demo.minimap = function() { + + "use strict"; + + var minimapScale = 0.15, + scale = 1, + zoom = null, + base = null, + target = null, + width = 0, + height = 0, + x = 0, + y = 0, + frameX = 0, + frameY = 0; + + function minimap(selection) { + + base = selection; + + var container = selection.append("g") + .attr("class", "minimap") + .call(zoom); + + zoom.on("zoom.minimap", function() { + scale = d3.event.scale; + }); + + + minimap.node = container.node(); + + var frame = container.append("g") + .attr("class", "frame") + + frame.append("rect") + .attr("class", "background") + .attr("width", width) + .attr("height", height) + .attr("filter", "url(#minimapDropShadow_qwpyza)"); + + var drag = d3.behavior.drag() + .on("dragstart.minimap", function() { + var frameTranslate = d3.demo.util.getXYFromTranslate(frame.attr("transform")); + frameX = frameTranslate[0]; + frameY = frameTranslate[1]; + }) + .on("drag.minimap", function() { + d3.event.sourceEvent.stopImmediatePropagation(); + frameX += d3.event.dx; + frameY += d3.event.dy; + frame.attr("transform", "translate(" + frameX + "," + frameY + ")"); + var translate = [(-frameX*scale),(-frameY*scale)]; + target.attr("transform", "translate(" + translate + ")scale(" + scale + ")"); + zoom.translate(translate); + }); + + frame.call(drag); + + /** RENDER **/ + minimap.render = function() { + scale = zoom.scale(); + container.attr("transform", "translate(" + x + "," + y + ")scale(" + minimapScale + ")"); + var node = target.node().cloneNode(true); + node.removeAttribute("id"); + base.selectAll(".minimap .panCanvas").remove(); + minimap.node.appendChild(node); + var targetTransform = d3.demo.util.getXYFromTranslate(target.attr("transform")); + frame.attr("transform", "translate(" + (-targetTransform[0]/scale) + "," + (-targetTransform[1]/scale) + ")") + .select(".background") + .attr("width", width/scale) + .attr("height", height/scale); + frame.node().parentNode.appendChild(frame.node()); + d3.select(node).attr("transform", "translate(1,1)"); + }; + } + + + //============================================================ + // Accessors + //============================================================ + + + minimap.width = function(value) { + if (!arguments.length) return width; + width = parseInt(value, 10); + return this; + }; + + + minimap.height = function(value) { + if (!arguments.length) return height; + height = parseInt(value, 10); + return this; + }; + + + minimap.x = function(value) { + if (!arguments.length) return x; + x = parseInt(value, 10); + return this; + }; + + + minimap.y = function(value) { + if (!arguments.length) return y; + y = parseInt(value, 10); + return this; + }; + + + minimap.scale = function(value) { + if (!arguments.length) { return scale; } + scale = value; + return this; + }; + + + minimap.minimapScale = function(value) { + if (!arguments.length) { return minimapScale; } + minimapScale = value; + return this; + }; + + + minimap.zoom = function(value) { + if (!arguments.length) return zoom; + zoom = value; + return this; + }; + + + minimap.target = function(value) { + if (!arguments.length) { return target; } + target = value; + width = parseInt(target.attr("width"), 10); + height = parseInt(target.attr("height"), 10); + return this; + }; + + return minimap; + }; + + + /** UTILS **/ + d3.demo.util = {}; + d3.demo.util.getXYFromTranslate = function(translateString) { + var currentTransform = d3.transform(translateString); + currentX = currentTransform.translate[0]; + currentY = currentTransform.translate[1]; + return [currentX, currentY]; + }; + + + /** RUN SCRIPT **/ + + \ No newline at end of file diff --git a/src/vue-poc/vue-poc.vue b/src/vue-poc/vue-poc.vue index f1db8a2..45469c8 100644 --- a/src/vue-poc/vue-poc.vue +++ b/src/vue-poc/vue-poc.vue @@ -47,11 +47,33 @@ {{$route.meta.title}} - - - favorite + + star_border - + + + + Bookmark + + + +
{{$route.meta.title}}
+ +
+ + Save + Cancel + +
+
+ + @@ -99,17 +121,17 @@ mini: false, dark: false, alert: {show:false,msg:"Hello"}, + frmFav: false, + tags: [], + taglist: [ + 'todo', + 'find', + 'some', + 'good', + 'tags' + ], items: [ - {href: '/',text: 'Home', icon: 'home' }, - { - icon: 'folder_open', - text: 'Collections' , - model: false, - children: [ - {href: '/database', text: 'Databases',icon: 'developer_mode' }, - {href: '/files', text: 'File system',icon: 'folder' }, - {href: '/history',text: 'history',icon: 'history'} - ]}, + {href: '/',text: 'Home', icon: 'home' }, { icon: 'directions_run', text: 'Actions' , @@ -121,6 +143,21 @@ {href: '/transform',text: 'XSLT Transform',icon: 'input'}, {href: '/tasks',text: 'Tasks',icon: 'history'} ]}, + { + icon: 'folder_open', + text: 'Collections' , + model: false, + children: [ + {href: '/database', text: 'Databases',icon: 'developer_mode' }, + {href: '/files', text: 'File system',icon: 'folder' }, + {href: '/history',text: 'history',icon: 'history'} + ]}, + { + icon: 'memory', + text: 'Models' , + model: false, + children: [ + ]}, { icon: 'cast_connected', text: 'Server' ,