diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c93a3860..ae17f3da 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,12 +5,8 @@ updates: schedule: interval: daily open-pull-requests-limit: 10 -- package-ecosystem: docker +- package-ecosystem: npm directory: "/" schedule: interval: daily open-pull-requests-limit: 10 - ignore: - - dependency-name: node - versions: - - "15" diff --git a/.github/workflows/dependabot-gerrit.yml b/.github/workflows/dependabot-gerrit.yml new file mode 100644 index 00000000..baafd0e8 --- /dev/null +++ b/.github/workflows/dependabot-gerrit.yml @@ -0,0 +1,15 @@ +name: Dependabot to Gerrit +on: + pull_request_target: + types: [opened, reopened, synchronize, closed] +jobs: + open-or-update-change: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + steps: + - name: Run dependabot gerrit action + uses: wmde/dependabot-gerrit-action@main + with: + password: ${{ secrets.DEPENDABOT_GERRIT_PASSWORD }} + user: Addbot + email: addshorewiki+addbot-dependabot@gmail.com diff --git a/.stylelintrc b/.stylelintrc index bcf61396..a1440c90 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -3,7 +3,7 @@ "rules": { "color-named": null, "declaration-no-important": null, - "declaration-property-value-blacklist": null, + "declaration-property-unit-disallowed-list": null, "no-descending-specificity": null, "selector-max-id": null } diff --git a/Gruntfile.js b/Gruntfile.js index 24768cf4..94d8b662 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -72,7 +72,8 @@ module.exports = function( grunt ) { banana: { all: 'i18n/', options: { - disallowBlankTranslations: false + disallowBlankTranslations: false, + requireKeyPrefix: 'wdqs-' } }, clean: { @@ -179,6 +180,10 @@ module.exports = function( grunt ) { ], dest: buildFolder + '/default-config.json', filter: 'isFile' + }, + {// query builder dropdown image + src: 'wikibase/queryService/ui/304px_querybuilder_final.gif', + dest: buildFolder + '/', } ] } @@ -335,7 +340,7 @@ module.exports = function( grunt ) { 'test', 'browser_test', 'clean', 'shell:cloneDeploy', 'clean:deploy', 'only_build' ] ); grunt.registerTask( 'deploy', [ - 'build-for-deploy', 'shell:commitDeploy', 'shell:review' + 'build_for_deploy', 'shell:commitDeploy', 'shell:review' ] ); grunt.registerTask( 'security', [ 'clean', 'shell:cloneDeploy', 'clean:deploy', 'only_build', 'shell:commitDeploy', 'shell:formatPatchDeploy' diff --git a/default-config.json b/default-config.json index c0f58856..0f261bbb 100644 --- a/default-config.json +++ b/default-config.json @@ -14,7 +14,7 @@ }, "urlShortener": "tinyurl", "query-builder": { - "server": "https://query-builder-test.toolforge.org/" + "server": "https://query.wikidata.org/querybuilder/" } }, "brand": { @@ -27,5 +27,6 @@ "root": "./", "index": "./index.html" }, + "showBanner": false, "prefixes": {} } diff --git a/dist/css/style.min.css b/dist/css/style.min.css index 4eb5d4da..7194da3a 100644 --- a/dist/css/style.min.css +++ b/dist/css/style.min.css @@ -1 +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 +.bootstrap-tags.bootstrap-3 .tag a{margin:0 0 0 .3em}.bootstrap-tags.bootstrap-3 .glyphicon-white{color:#fff}.bootstrap-tags.bootstrap-2 .tag.md{padding:.3em .4em .4em}.bootstrap-tags.bootstrap-2 .tag.lg{padding:.4em .4em .5em}.bootstrap-tags{position:relative}.bootstrap-tags .tags{width:inherit;height:0;position:absolute;padding:0;margin:0}.bootstrap-tags .tag-data{display:none}.bootstrap-tags .tags-input{width:100%;margin:0;padding:0;height:1.7em;box-sizing:content-box;-webkit-box-sizing:content-box;-moz-box-sizing:content-box}.bootstrap-tags .tag-list{width:280px;height:auto;min-height:26px;left:2px;top:2px;position:relative}.bootstrap-tags .tag{padding:.4em .4em .4em;margin:0 .1em;float:left}.bootstrap-tags .tag.sm{padding:.4em .4em .5em;font-size:12px}.bootstrap-tags .tag.md{font-size:14px}.bootstrap-tags .tag.lg{font-size:18px;padding:.4em .4em .4em;margin:0 .2em .2em 0}.bootstrap-tags .tag a{color:#bbb;cursor:pointer;opacity:.5}.bootstrap-tags .tag .remove{vertical-align:bottom;top:0}.bootstrap-tags ul.tags-suggestion-list{width:300px;height:auto;list-style:none;margin:0;z-index:2;max-height:160px;overflow:scroll}.bootstrap-tags ul.tags-suggestion-list li.tags-suggestion{padding:3px 20px;height:auto}.bootstrap-tags ul.tags-suggestion-list li.tags-suggestion-highlighted{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x}html{background-color:#fff}body{height:100%;overflow-y:scroll;width:100%}pre{background:#f8f9fa;border-radius:2px;color:#222}a{color:#36c}a:hover{color:#447ff5}a:active{color:#2a4b8d}#empty-query-error,#hide-explorer,#loading-spinner,#query-error,#query-error-short,#query-result,.action-bar,.explorer-panel,.result{display:none}.navbar,.toolbar{-webkit-box-shadow:none;box-shadow:none;white-space:nowrap}.navbar{margin-bottom:0}.navbar .dropdown-menu{background:#f8f9fa;z-index:1001}.navbar .dropdown-menu>li>a{border-radius:2px;padding:5px 20px}.navbar .dropdown-menu>li>a:hover{background:#fff}.navbar .help{padding-left:0}.navbar-brand{line-height:35px;padding:5px 15px;vertical-align:middle}.navbar-brand a{text-decoration:none}.navbar-brand img{margin-left:2px;margin-right:10px;height:31px;width:auto}.navbar-btn{margin-left:15px}.navbar-default{background:#f8f9fa;border-bottom:1px solid #c8ccd1;border-radius:2px}.navbar-right{margin-right:0}.navbar-toggle{z-index:100}a.disabled{color:#72777d}.btn:active{box-shadow:none}.btn-default{-webkit-box-shadow:none;background:#f8f9fa;border-radius:2px;border:1px solid #c8ccd1;box-shadow:none;text-shadow:none}.btn-default:active{background:#c8ccd1}.btn-default:hover{background:#fff}.form-control{border-radius:2px}.wikibase-queryservice{background-color:#fff}.action-bar .progress{font-size:30px;height:30px}.action-bar .progress-bar{font-size:16px;font-weight:700;line-height:30px}.action-bar .label{display:block;font-size:16px;line-height:20px}#empty-query-error{color:#d33;font-size:1.5em;margin-top:5%}.error{font-family:monospace;margin:20px;overflow-x:scroll;white-space:pre}.label,.progress{border-radius:2px}.label-danger{background:#d33}.graph-iframe{border:0;height:90vh;margin:0;width:100%}#layout-options{margin-top:-35px;text-align:center}.error-line{border-bottom:2px dotted #d33}.error-character{background:#d33;color:#fff}#execute-button{-webkit-box-shadow:none;background:#36c;border-radius:2px;border:2px solid #36c;box-shadow:none;margin-bottom:5px;padding-bottom:7px;padding-top:7px;width:46px}#execute-button:hover{background:#447ff5;border-color:#447ff5}#execute-button:active{background:#2a4b8d;border-color:#2a4b8d}#query-result{width:100%}#query-result pre{background-color:inherit;border:0;display:inline;font-family:serif;font-size:12px;margin:10px 30px;overflow:auto;tab-size:21;width:900px}#query-result .foreground path{fill:none;pointer-events:none;stroke-opacity:.4;stroke-width:3px;stroke:#222}#query-result .axis line,#query-result .axis path{fill:none;stroke-width:1px;stroke:#000}#query-result .axis .title{font-size:8px;font-weight:700;text-transform:uppercase;transform:rotate(-12deg) translate(-5px,-6px)}#query-result .brush .extent{fill-opacity:.3;stroke-width:1px;stroke:#fff}#query-result .jstree{padding:1em}#query-result .jstree-default .jstree-wholerow-hovered{background:#447ff5;border-radius:2px;color:#fff}#query-result .jstree-default .jstree-wholerow-clicked{background:#36c;border-radius:2px;color:#fff}#query-result .jstree a.jstree-anchor.jstree-clicked{color:#fff}#query-result .labelbody{background:0 0;cursor:pointer;overflow:hidden}#query-result .img-grid{font-size:.85em;margin:2em auto;padding:0;width:95%}#result-browser-menu .fa,#result-browser-menu .glyphicon{padding:0 .5em 0 0}.toolbar-label{position:absolute}.toolbar-icon{position:relative;left:105px}.table-cell-selected{background-color:#eaf3ff}.fixed-table-pagination{margin-bottom:2.5em}.CodeMirror{border-left:1px solid #c8ccd1;border:0;height:100%}.CodeMirror .cm-atom{color:#2a4b8d}.CodeMirror .cm-bracket{color:inherit}.CodeMirror .cm-builtin{color:#b32424}.CodeMirror .cm-comment{color:#72777d}.CodeMirror .cm-keyword{color:#b32424}.CodeMirror .cm-operator{color:inherit}.CodeMirror .cm-string{color:#ac6600}.CodeMirror .cm-variable-2{color:#14866d}.CodeMirror-scroll{min-height:320px}.CodeMirror-hints{direction:ltr}.CodeMirror-hint{max-width:19em}pre.CodeMirror-placeholder{color:#72777d}.queryEditor{border:0;font-family:monospace;min-height:273px;padding:0;width:100%}.exampleQueries{width:160px}.exampleIcons{width:0}iframe.shortUrl{border:0;height:40px;width:250px}div.shortUrl{height:40px;width:250px}.dropdown-menu{border-radius:2px}.query-main{display:flex;flex-direction:row;max-width:100%}.query-main>.toolbar{display:flex;flex-direction:column;flex:0 0 55px}.query-main>.toolbar .dropdown-menu{padding-left:.8em;padding-right:.8em}.query-helper-and-editor{display:flex;flex-direction:row;flex:1 1 auto}#query-box{position:relative}#query-box .status{color:#72777d;font-size:12px;margin-bottom:5px;min-height:25px;padding:3px}#query-box .status .badge{border-radius:2px;border:1px solid #eaecf0}#query-box .status .list-group-item-danger{background-color:#fee7e6;color:#b32424;text-decoration-color:#b32424}#query-box .status .list-group-item-success{background-color:#d5fdf4;color:#14866d;text-decoration-color:#14866d}#query-box .status .list-group-item-warning{background-color:#fef6e7;color:#ac6600;text-decoration-color:#ac6600}#query-box .nav{margin-left:0}#query-box .toolbar{border-right:1px solid #c8ccd1}#query-box .toolbar .fa{font-size:1.5em}#query-box .toolbar-bottom{flex-grow:0;padding-bottom:.2em;padding-top:1em;text-align:center}#query-box .toolbar-bottom .fa{font-size:1.8em}#query-box .toolbar-top{flex-grow:1;opacity:.5;padding-top:.5em;text-align:center;visibility:hidden;margin-right:4px}#query-box .toolbar-top:hover{opacity:1}.dataUpdated>span:nth-child(1){padding:5px}.query-editor-container{flex:1 1 auto;width:100%}.splitter{background-color:#eaf3ff;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAhCAQAAABOpSL+AAAAIklEQVR4AWMwbb/PdR+JZDD9f1/oPhI5sgVGBSruc9xHIgGdSQqqQJGkRgAAAABJRU5ErkJggg== );background-position:center center;background-repeat:no-repeat;cursor:col-resize;flex:0 0 auto;width:1em}.jq-toast-single a{border:0}.alert{margin-bottom:0}.popover{border-radius:2px;max-width:80vw;width:auto}.popover-title{border-radius:2px}.dropdown-toggle .fa:before,.dropdown-toggle .glyphicon:before{margin-right:3px}.nav>li{float:left}.nav-tabs>li>a{border-radius:2px 2px 0 0}@media (max-width:768px){.navbar-left{float:left!important;margin:0}.navbar-right{float:right!important}.navbar-nav .open .dropdown-menu{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.175);background-color:#fff;border:1px solid #eaecf0;box-shadow:0 1px 2px rgba(0,0,0,.175);position:absolute;width:auto}.navbar-collapse.in{overflow-y:visible}.panel-body .table td{display:inline-block}}.wikibase-rdf-hint{border-bottom:1px solid #c8ccd1;white-space:normal}.keyboard-shortcut-help td,.keyboard-shortcut-help th{padding:8px;vertical-align:middle}.QueryExamples .modal-content{border-radius:2px;padding:20px 15px}.QueryExamples .modal-content .tag{background-color:#36c;background-image:none;padding:.4em .6em;text-shadow:none}.QueryExamples .modal-content .tag:active,.QueryExamples .modal-content .tag:hover{background:#36c}.QueryExamples .modal-content .tagCloud{height:200px;width:100%}.QueryExamples .modal-content input.tags-input{visibility:hidden}.QueryExamples .modal-content .tagFilter{padding-bottom:5px!important}.QueryExamples .modal-content .exampleTable{border:1px solid #a2a9b1;max-height:500px;overflow-x:hidden;overflow-y:auto}.QueryExamples .modal-content .exampleTable td{padding:8px 10px}.QueryExamples .modal-content .exampleTable .glyphicon-pencil{margin-left:.3em}.QueryExamples .modal-content .input-group-addon{border-radius:2px;border:1px solid #a2a9b1}.modal-content{border-radius:2px}.explorer-dialog{position:absolute!important;display:none;z-index:1000;background-color:#fff;resize:both;overflow:none}.explorer-dialog iframe{height:100%;width:100%}.explorer-body{height:100%;width:100%;padding:0 0 15px 0}.explorer-header{height:55px;background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x}.explorer-title{font-size:1.3em}.gj-resizable-e,.gj-resizable-n,.gj-resizable-ne,.gj-resizable-nw,.gj-resizable-s,.gj-resizable-sw,.gj-resizable-w{display:none}.disable-selection{-moz-user-select:none;-ms-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;user-select:none}.CodeExamples .tab-content .url{margin:2em;word-wrap:break-word}div.jqcloud{color:#36c}div.jqcloud a{color:inherit}div.jqcloud a:hover{color:#447ff5}div.jqcloud span.w10{color:#36c}div.jqcloud span.w9{color:rgba(51,102,204,.9)}div.jqcloud span.w8{color:rgba(51,102,204,.8)}div.jqcloud span.w7{color:rgba(51,102,204,.75)}div.jqcloud span.w6{color:rgba(51,102,204,.7)}div.jqcloud span.w5{color:rgba(51,102,204,.65)}div.jqcloud span.w4{color:rgba(51,102,204,.6)}div.jqcloud span.w3{color:rgba(51,102,204,.55)}div.jqcloud span.w2{color:rgba(51,102,204,.5)}div.jqcloud span.w1{color:rgba(51,102,204,.45)}.item{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;background:#fff;box-shadow:2px 2px 4px 0 #ccc;box-sizing:border-box;display:inline-block;margin:0 .75em 1.5em;padding:1em}.item.hidden{visibility:hidden}.item-row{width:100%}.hidden-row{height:50px;visibility:hidden}.hidden-row>.item{display:none}.item-img{width:100%}.summary .glyphicon{display:inline}.summary>div{height:1.5em}.summary>div>span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#loading-spinner{color:#72777d}#loading-spinner>.fa-spinner{display:block;margin:0 auto 20px}#query-box .query-helper{flex:0 0 auto;max-width:80vw;min-width:300px;width:30vw;z-index:100}#query-box .query-helper .panel{-webkit-box-shadow:none;border:0;box-shadow:none}#query-box .query-helper .panel-heading{background:#fff;border-bottom:1px solid #eaecf0;padding:8px 10px}#query-box .query-helper .panel-body{font-size:11pt;padding:10px 0}#query-box .query-helper .panel-body>span{padding:10px}#query-box .query-helper .panel-body-sub .query-helper-data{margin-bottom:10px;margin-top:10px;width:auto}#query-box .query-helper .panel-body-sub .query-helper-data tbody>tr>td{padding:6px}#query-box .query-helper .panel-body-sub .query-helper-data tr{padding:.8em}#query-box .query-helper .panel-body-sub .query-helper-data tr:first-child,#query-box .query-helper .panel-body-sub .query-helper-data tr:last-child{border-bottom:0}#query-box .query-helper .panel-body-sub .query-helper-data tr:hover{background:inherit}#query-box .query-helper .panel-body-sub .query-helper-data td{border:0;vertical-align:middle}#query-box .query-helper .panel-body-sub .query-helper-data .fa{font-size:1.25em;margin:0 6px 0 0;text-decoration:none}#query-box .query-helper .panel-body-sub .query-helper-limit-section{padding:12px}#query-box .query-helper .panel-body-sub .query-helper-section{border-bottom:1px solid #eaecf0;height:3em;padding:10px 0;width:100%}#query-box .query-helper .panel-body-sub .query-helper-section>tr>td:first-child{min-width:95px;width:0}#query-box .query-helper .panel .close{float:inline-end}#query-box .query-helper tr:hover>.toolbar{opacity:1}#query-box .query-helper .popover{min-width:250px;white-space:nowrap}#query-box .query-helper-hidden,#query-box .query-helper-hidden+.splitter{display:none}.select2-container{min-width:150px;margin:2px}.select2-container .select2-dropdown{border-radius:0 0 2px 2px;background:#f8f9fa}.select2-container .select2-results__option[aria-selected=true]{background:inherit}.select2-container .select2-results__option--highlighted[aria-selected]{background:#fff;color:#222}.select2-container .select2-selection--single{border-radius:2px}.select2-container .select2-selection--single .select2-selection__rendered{color:#222}.popover .select2-container{min-width:200px}.query-helper-tag-cloud .tagCloud{height:200px;width:45vw}.nav .uls-trigger{display:none;padding-left:30px}.vis-item{color:#222;padding:15px}.vis-item.vis-selected{background:#c8ccd1;border-color:#a2a9b1;color:#000}.vis-item,.vis-item.vis-line{background:#f8f9fa;border-color:#a2a9b1}.vis-item.vis-range:hover{width:unset!important;z-index:100}@media (max-width:900px){.CodeMirror{border:0;border-top:1px solid #c8ccd1}.CodeMirror-scroll{min-height:150px}#query-box .query-helper{max-width:none;min-width:0;width:100%}#query-box .query-helper .panel{margin:0}.query-helper-and-editor{flex-direction:column}.query-helper-and-editor>.splitter{display:none}}.ekko-lightbox-nav-overlay a span{padding:0} \ No newline at end of file diff --git a/dist/js/wdqs.min.js b/dist/js/wdqs.min.js index 910d1943..0ded3232 100644 --- a/dist/js/wdqs.min.js +++ b/dist/js/wdqs.min.js @@ -1,4 +1 @@ -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("