From 24599479d750f7f2e5d847061984bbb35b793659 Mon Sep 17 00:00:00 2001 From: jk Date: Wed, 16 Nov 2016 14:34:30 +0100 Subject: [PATCH] Provide dist files for npm package At the moment this is a manually build and will not update automatically. Also we don't have versioning for it. Change-Id: Iad2917ed1a137c617baa2eb5140891a5427d9b01 --- README.md | 14 ++++++-------- dist/css/style.min.css | 1 + dist/js/wdqs.min.js | 4 ++++ 3 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 dist/css/style.min.css create mode 100644 dist/js/wdqs.min.js diff --git a/README.md b/README.md index f226f70d..18f0f591 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ $ npm install Alternative use npm install ```bash -npm i wikidata-query-gui +npm install wikidata-query-gui ``` #Run tests @@ -53,7 +53,7 @@ git config --global --add gitreview.username "[username]" #Components ## Editor -A code mirror based SPARQL editor with code completion (ctrl+space) and tooltips +A [CodeMirror](https://codemirror.net/) based SPARQL editor with code completion (ctrl+space) and tooltips (hover) ``` var editor = new wikibase.queryService.ui.editor.Editor(); editor.fromTextArea( $( '.editor' )[0] ); @@ -88,12 +88,10 @@ api.query( query ).done(function() { result.setResult( api.getResultRawData() ); result.draw( element ); } ); - - -See examples/result.html ``` +See examples/result.html +## Release Notes and npm package - - - +Unfortunately there are no releases and the provided code and interfaces are not considered to be stable. +Also the dist/ folder contains a build that may not reflect the current code on master branch. \ No newline at end of file diff --git a/dist/css/style.min.css b/dist/css/style.min.css new file mode 100644 index 00000000..4eb5d4da --- /dev/null +++ b/dist/css/style.min.css @@ -0,0 +1 @@ +.QueryExamples input.tags-input,.queryEditor{visibility:hidden}body{overflow-y:scroll}.error{margin:20px;overflow-x:scroll;font-family:monospace;white-space:pre}#clear-button{margin-right:10px}#query-box .navbar-left,#query-box .navbar-right,.navbar-right{margin-right:0}#hide-explorer,#query-error,#query-error-short,#query-result,.query-total{display:none}.graph-iframe{width:100%;height:90vh;border:none;margin:0}.error-line{border-bottom:2px dotted red}.error-character{background:#ffa07a}#query-result pre{display:inline;font-family:serif;border:none;background-color:inherit}#query-result{width:100%}#result-browser-menu .fa,#result-browser-menu .glyphicon{padding:0 .5em 0 0}.cm-s-default .cm-bracket{color:#000}.CodeMirror{border:1px solid #ccc;height:auto!important}.CodeMirror-scroll{min-height:300px}.CodeMirror-hint{max-width:19em}.queryEditor{min-height:273px;padding:0}pre.CodeMirror-placeholder{color:#777}.exampleQueries{width:160px}#query-box{position:relative}#query-box .status{padding:3px;font-size:13px;min-height:25px;color:#777;margin-bottom:5px}.dataUpdated>span:nth-child(1){padding:5px}#query-box .nav{margin-left:0}.shareQuery{z-index:100;position:absolute;top:10px;right:10px;font-size:25px;background:rgba(255,255,255,.5)}.alert,.navbar{margin-bottom:0}.navbar .dropdown-menu{z-index:1001}.popover{max-width:500px;width:auto}.dropdown-toggle .fa:before,.dropdown-toggle .glyphicon:before{margin-right:3px}.navbar-brand{line-height:35px;padding:5px 15px}.navbar-brand img{padding-right:5px}.navbar-toggle{z-index:100}.navbar-btn{margin-left:15px}.nav>li{float:left}@media (max-width:900px){.navbar-header{float:none}.navbar-toggle{display:block}.navbar-collapse{border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.collapse{display:none!important}.navbar-nav{float:none!important;margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px}.navbar-text{float:left;margin:15px 0}.navbar-collapse.collapse.in{display:block!important}.collapsing{overflow:hidden!important}}.wikibase-rdf-hint{border-bottom:1px solid gray;white-space:normal}.QueryExamples .tagCloud{width:100%;height:200px}.QueryExamples .tag{background-color:#337ab7;background-image:none}.QueryExamples .tagFilter{padding-bottom:5px!important}.QueryExamples .exampleTable{max-height:500px;overflow-y:auto;overflow-x:hidden;border:1px solid #ccc}iframe.shortUrl{border:none;width:250px;height:40px}.explorer-panel{position:fixed;right:0;bottom:0;background-color:rgba(255,255,255,.8);z-index:100;display:none;overflow:auto}.visual-editor,.visual-editor-trigger{z-index:100;position:absolute;right:45px}.explorer-panel iframe{height:70vh;width:50vw}div.jqcloud{color:#337ab7}div.jqcloud a{color:inherit}div.jqcloud a:hover{color:#337ab7}div.jqcloud span.w10{color:rgba(51,122,183,1)}div.jqcloud span.w9{color:rgba(51,122,183,.9)}div.jqcloud span.w8{color:rgba(51,122,183,.8)}div.jqcloud span.w7{color:rgba(51,122,183,.75)}div.jqcloud span.w6{color:rgba(51,122,183,.6)}div.jqcloud span.w5{color:rgba(51,122,183,.65)}div.jqcloud span.w4{color:rgba(51,122,183,.5)}div.jqcloud span.w3{color:rgba(51,122,183,.55)}div.jqcloud span.w2{color:rgba(51,122,183,.4)}div.jqcloud span.w1{color:rgba(51,122,183,.45)}.masonry{width:95%;margin:1.5em 0;padding:0;-moz-column-gap:1.5em;-webkit-column-gap:1.5em;column-gap:1.5em;font-size:.85em}.item,.item>a>img{display:inline-block;width:100%}.item{background:#fff;padding:1em;margin:0 0 1.5em;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-shadow:2px 2px 4px 0 #ccc}@media only screen and (min-width:400px){.masonry{-moz-column-count:2;-webkit-column-count:2;column-count:2}}@media only screen and (min-width:700px){.masonry{-moz-column-count:3;-webkit-column-count:3;column-count:3}}@media only screen and (min-width:900px){.masonry{-moz-column-count:4;-webkit-column-count:4;column-count:4}}@media only screen and (min-width:1100px){.masonry{-moz-column-count:5;-webkit-column-count:5;column-count:5}}@media only screen and (min-width:1280px){.wrapper{width:1260px}}.action-bar .progress{height:30px;font-size:30px}.action-bar .progress-bar{font-size:16px;line-height:30px;font-weight:700}.action-bar .label{display:block;font-size:16px;line-height:20px}.action-bar{display:none}#query-result .labelbody{background:0 0;overflow:hidden;cursor:pointer}.visual-editor .panel-heading,.visual-editor .panel-info{background:rgba(255,255,255,.9)}.visual-editor-trigger{display:none;top:10px;font-size:25px}.visual-editor{display:none;min-width:300px;max-width:500px;top:5px;font-size:15px;padding-left:35px}.visual-editor .panel-heading{padding:8px 10px}.visual-editor .panel-body{font-size:120%}.select2-container{z-index:2000;min-width:200px}.visual-editor .popover{min-width:250px;white-space:nowrap}.visual-editor .spacer{min-height:.8em}.nav .uls-trigger{display:none;padding-left:30px}.vis-item{padding:15px;box-shadow:5px 5px 20px rgba(0,0,0,.2)}.vis-item,.vis-item.vis-line,.vis-item.vis-selected{background-color:#fff;border-color:#888a85}#query-result .foreground path{fill:none;stroke:#222;stroke-opacity:.4;pointer-events:none;stroke-width:3px}#query-result .axis .title{font-size:8px;font-weight:700;text-transform:uppercase;transform:rotate(-12deg) translate(-5px,-6px)}#query-result .axis line,#query-result .axis path{fill:none;stroke:#000;stroke-width:1px}#query-result .brush .extent{fill-opacity:.3;stroke:#fff;stroke-width:1px}#query-result pre{width:900px;margin:10px 30px;tab-size:21;font-size:12px;overflow:auto} \ No newline at end of file diff --git a/dist/js/wdqs.min.js b/dist/js/wdqs.min.js new file mode 100644 index 00000000..bf27bcc7 --- /dev/null +++ b/dist/js/wdqs.min.js @@ -0,0 +1,4 @@ +var wikibase=wikibase||{};wikibase.queryService=wikibase.queryService||{},wikibase.queryService.ui=wikibase.queryService.ui||{},wikibase.queryService.ui.App=function(a,b,c,d,e,f){"use strict";function g(a,b,c,d,e){this._$element=a,this._editor=b,this._visualEditor=c,this._sparqlApi=d,this._querySamplesApi=e,this._init()}var h="//tinyurl.com/api-create.php?url=",i="wikibase.queryService.ui.app.";return g.prototype._$element=null,g.prototype._sparqlApi=null,g.prototype._querySamplesApi=null,g.prototype._editor=null,g.prototype._visualEditor=null,g.prototype._isHistoryDisabled=!1,g.prototype._selectedResultBrowser=null,g.prototype._actionBar=null,g.prototype._trackingApi=null,g.prototype._hasRunFirstQuery=!1,g.prototype._resultBrowsers={Table:{icon:"glyphicon-th-list",label:"Table","class":"TableResultBrowser",object:null,$element:null},ImageGrid:{icon:"glyphicon-picture",label:"Image Grid","class":"ImageResultBrowser",object:null,$element:null},Polestar:{icon:"fa-certificate",label:"Graph builder","class":"PolestarResultBrowser",object:null,$element:null},Map:{icon:"glyphicon-map-marker",label:"Map","class":"CoordinateResultBrowser",object:null,$element:null},LineChart:{icon:"fa-line-chart",label:"Line Chart","class":"LineChartResultBrowser",object:null,$element:null},BarChart:{icon:"fa-bar-chart",label:"Bar Chart","class":"BarChartResultBrowser",object:null,$element:null},ScatterChart:{icon:"fa-braille",label:"Scatter Chart","class":"ScatterChartResultBrowser",object:null,$element:null},AreaChart:{icon:"fa-area-chart",label:"Area Chart","class":"AreaChartResultBrowser",object:null,$element:null},BubbleChart:{icon:"glyphicon-tint",label:"Bubble Chart","class":"BubbleChartResultBrowser",object:null,$element:null},TreeMap:{icon:"glyphicon-th",label:"Tree Map","class":"TreeMapResultBrowser",object:null,$element:null},Timeline:{icon:"glyphicon-calendar",label:"Timeline","class":"TimelineResultBrowser",object:null,$element:null},Dimensions:{icon:"glyphicon-random",label:"Dimensions","class":"MultiDimensionResultBrowser",object:null,$element:null},Graph:{icon:"glyphicon-retweet",label:"Graph","class":"GraphResultBrowser",object:null,$element:null}},g.prototype._init=function(){this._sparqlApi||(this._sparqlApi=new wikibase.queryService.api.Sparql),this._querySamplesApi||(this._querySamplesApi=new wikibase.queryService.api.QuerySamples),this._trackingApi||(this._trackingApi=new wikibase.queryService.api.Tracking),this._editor||(this._editor=new wikibase.queryService.ui.editor.Editor),this._track("init"),this._initApp(),this._initEditor(),this._initVisualEditor(),this._initExamples(),this._initDataUpdated(),this._initQuery(),this._initRdfNamespaces(),this._initHandlers(),this._initResultBrowserMenu()},g.prototype._initApp=function(){a(c).keydown(function(b){b.ctrlKey&&13===b.keyCode&&a("#execute-button").click()}),this._actionBar=new wikibase.queryService.ui.toolbar.Actionbar(a(".action-bar"))},g.prototype._initEditor=function(){this._editor.fromTextArea(this._$element.find(".queryEditor")[0])},g.prototype._initVisualEditor=function(){var b=this,c="visual-editor-hide";this._visualEditor||(this._visualEditor=new wikibase.queryService.ui.visualEditor.VisualEditor),this._visualEditor.setChangeListener(function(a){b._editor.setValue(a.getQuery())}),"true"===e.get(c)&&a(".visual-editor-trigger").show(),this._editor&&this._editor.registerCallback("change",d.debounce(function(){a(".visual-editor-trigger").is(":visible")||b._editor.getValue()===b._visualEditor.getQuery()||(a(".visual-editor").hide(),b._drawVisualEditor())},1500)),a(".visual-editor .panel-heading .close").click(function(){return e.set(c,!0),a(".visual-editor").hide(),a(".visual-editor-trigger").show(),!1}),a(".visual-editor-trigger").click(function(){return a(".visual-editor-trigger").hide(),e.set(c,!1),b._drawVisualEditor(),!1})},g.prototype._drawVisualEditor=function(){try{this._visualEditor.setQuery(this._editor.getValue()),this._visualEditor.draw(a(".visual-editor .panel-body")),a(".visual-editor").delay(500).fadeIn()}catch(b){b.stack&&c.console.log(b.stack)}},g.prototype._initExamples=function(){var b=this;new wikibase.queryService.ui.QueryExampleDialog(a("#QueryExamples"),this._querySamplesApi,function(a,c){a&&a.trim()&&b._editor.setValue("#"+c+"\n"+a)})},g.prototype._initRdfNamespaces=function(){var b,c,d,e=a(".namespace-shortcuts"),f=wikibase.queryService.RdfNamespaces.NAMESPACE_SHORTCUTS;e.click(function(a){a.stopPropagation()});for(b in f){c=a("