diff --git a/controllets/datalet-selection-controllet/datalet-selection-controllet.html b/controllets/datalet-selection-controllet/datalet-selection-controllet.html
index 11b03fa..fe47c36 100755
--- a/controllets/datalet-selection-controllet/datalet-selection-controllet.html
+++ b/controllets/datalet-selection-controllet/datalet-selection-controllet.html
@@ -14,6 +14,8 @@
+
+
@@ -169,6 +171,11 @@
paper-button[disabled] {
background-color: #B6B6B6;
}
+
+ #dialog_info {
+ border: 2px solid #2196F3;
+ background-color: #E0E0E0;
+ }
@@ -239,6 +246,11 @@
+
+
+
+
+
@@ -301,6 +313,11 @@
value : undefined
},
+ params:{
+ type: Object,
+ value: undefined
+ },
+
modify : {
type : Boolean,
value : false
@@ -325,6 +342,8 @@
this._preselectDatalet();
this.preselectedDatalet = undefined;
}
+
+ this.params = {'data-url' : this.dataUrl};
},
attached : function() {
@@ -440,6 +459,14 @@
}
if(load){
+ var labels = this.$.datalet_selection_labels.querySelectorAll("paper-textarea");
+ console.log(labels);
+ for (var i = 0; i < labels.length; i++) {
+ if (labels[i].innerHTML.trim() != "") {
+ this.params[labels[i].label] = labels[i].value;
+ }
+ }
+
this._loadDatalet(selectedFields);
}
@@ -451,11 +478,11 @@
},
_loadDatalet : function(selectedFields){
- var params = {'data-url' : this.dataUrl};
+// var params = {'data-url' : this.dataUrl};
var dataletParams ={
component : this.selectedDatalet+"-datalet",
- params : params,
+ params : this.params,
fields : selectedFields,
placeHolder : this.$.datalet_selection_datalet_placeholder
};
@@ -475,8 +502,8 @@
var data = {
dataUrl : this.dataUrl,
-// params : this.paramsFields,
- params : {'data-url' : this.dataUrl},
+ params : this.params,
+// params : {'data-url' : this.dataUrl},
fields : selectedFields,
datalet : this.selectedDatalet+"-datalet",
comment : this.$.comment.value,
@@ -487,6 +514,26 @@
},
+ _showInfo : function(e){
+ var t = e.target;
+ if(t.tagName.indexOf("IRON-ICON") != -1)
+ t = $(e.target).parents("paper-icon-button")[0];
+
+ var name = t.getAttribute("title").replace(" info", "");
+
+ var dataset = $.grep(this.inputs, function(e){ return e.name == name; })[0];
+ if(!dataset)
+ dataset = $.grep(this.labels, function(e){ return e.name == name; })[0];
+
+ this.$.dialog_name.innerHTML = dataset.name;
+ this.$.dialog_description.innerHTML = dataset.description;
+ this.$.dialog_info.open();
+
+ var pos = t.getBoundingClientRect();
+ $("#dialog_info").css("top", pos.top - 4);
+ $("#dialog_info").css("left", pos.left - 4);
+ },
+
_copy : function(o) {
var out, v, key;
out = Array.isArray(o) ? new Array(o.length) : {};
diff --git a/controllets/dataset-selection-controllet/dataset-selection-controllet.html b/controllets/dataset-selection-controllet/dataset-selection-controllet.html
index b32a383..7d5fba1 100755
--- a/controllets/dataset-selection-controllet/dataset-selection-controllet.html
+++ b/controllets/dataset-selection-controllet/dataset-selection-controllet.html
@@ -20,12 +20,9 @@
-
-
-
@@ -63,7 +60,6 @@
}
paper-dropdown-menu {
- /*display: block;*/
width: 45%;
margin-bottom: 32px;
--paper-input-container-focus-color: #2196F3;
@@ -93,20 +89,11 @@
}
.info_button {
- /*background-color: red;*/
position: absolute;
top: 18px;
left: 45%;
}
- /*paper-menu{*/
- /*/!*visibility: visible ! important;*!/*/
- /*}*/
-
- /*paper-item[focused] {*/
- /*background: #FFFFFF;*/
- /*}*/
-
paper-textarea {
width: 90%;
margin-bottom: 32px;
@@ -124,27 +111,16 @@
#material_container {
margin-top: 8px;
- /*height: 55vh;*/
}
#div_selection {
padding-left: 10%;
padding-top: 64px;
- /*padding-bottom: 64px;*/
}
#dialog_info {
border: 2px solid #2196F3;
background-color: #E0E0E0;
- position: fixed;
- top: 232px;
- width: 60%;
- height: auto;
- /*overflow: auto;*/
- }
-
- #div_datasetexplorer {
- /*padding-top: 48px;*/
}
@@ -162,11 +138,10 @@
-
+
{{dataset.name}}
-
@@ -177,12 +152,12 @@
+
-
+
{{dataset.name}}
-
@@ -196,7 +171,6 @@
-
@@ -207,9 +181,6 @@
-
-
-
@@ -286,12 +257,6 @@
this._loadTreeMap();
},
-// _isSuggested : function(){
-// if(this.suggestedDatasets)
-// return true;
-// return false;
-// },
-
_filterDatasets : function(e){
var filter = e.detail.inputValue;
var filteredDatasets = [];
@@ -306,68 +271,79 @@
_loadTreeMap : function(){
var h = $("#material_container").height() - 48;
var w = $("#material_container").width();
-
-// if(this.selected != 1 && this.$.div_datasetexplorer.innerHTML == "")
+ // /oxwall_x.y.z
this.$.div_datasetexplorer.innerHTML = "";
},
- _selectDataUrl_treeMap : function(e){
- var url = e.detail.url;
- url = url.split('/');
- var index = url.indexOf('resource')
- if (index != -1) { // ckan
- var resourceId = url[index + 1];
- url = "http://ckan.routetopa.eu/api/action/datastore_search?resource_id=" + resourceId;
+ _selectDataUrl_treeMap : function(e) {
+ $("#_datasets")[0]._setSelectedItem(null);
+ $("#_datasets")[0].inputValue = "";
+ $("#info_dataset")[0].setAttribute("disabled", "true");
- } else
- url = "sorry, data provider not supported yet";
+ if (this.isSuggested) {
+ $("#s_datasets")[0]._setSelectedItem(null);
+ $("#s_datasets")[0].contentElement.select(-1);
+ $("#info_s_dataset")[0].setAttribute("disabled", "true");
+ }
- this.dataUrl = url;
+ this.dataUrl = e.detail.url;
this.selected=0;
},
_selectDataUrl : function(e){
- console.log(e.target);
+ if (this.isSuggested) {
+ $("#s_datasets")[0]._setSelectedItem(null);
+ $("#s_datasets")[0].contentElement.select(-1);
+ $("#info_s_dataset")[0].setAttribute("disabled", "true");
+ }
+
var dataset = this.filteredDatasets[parseInt(e.target.id)]
this.dataUrl = dataset.url;
-// if(dataset.description != ""){
-// this.$.info_button.removeAttribute("disabled");
-// this.$.dialog_name.innerHTML = dataset.name;
-// this.$.dialog_description.innerHTML = dataset.description;
-// }
-// else
-// this.$.info_button.setAttribute("disabled", "true");
+ if(dataset.description != ""){
+ $("#info_dataset")[0].removeAttribute("disabled");
+ this.$.dialog_name.innerHTML = dataset.name;
+ this.$.dialog_description.innerHTML = dataset.description;
+ }
+ else
+ $("#info_dataset")[0].setAttribute("disabled", "true");
},
_selectSuggestedDataUrl : function(e){
- console.log(e.target);
+ $("#_datasets")[0]._setSelectedItem(null);
+ $("#_datasets")[0].inputValue = "";
+ $("#info_dataset")[0].setAttribute("disabled", "true");
+
var dataset = this.suggestedDatasets[parseInt(e.target.id)]
this.dataUrl = dataset.url;
-// if(dataset.description != ""){
-// this.$.info_button.removeAttribute("disabled");
-// this.$.dialog_name.innerHTML = dataset.name;
-// this.$.dialog_description.innerHTML = dataset.description;
-// }
-// else
-// this.$.info_button.setAttribute("disabled", "true");
+ if(dataset.description != ""){
+ $("#info_s_dataset")[0].removeAttribute("disabled");
+ this.$.dialog_name.innerHTML = dataset.name;
+ this.$.dialog_description.innerHTML = dataset.description;
+ }
+ else
+ $("#info_s_dataset")[0].setAttribute("disabled", "true");
},
- _showInfo : function(){
+ _showInfo : function(e){
+ var t = e.target;
+ if(t.tagName.indexOf("IRON-ICON") != -1)
+ t = $(e.target).parents("paper-icon-button")[0];
+
this.$.dialog_info.open();
+
+ var pos = t.getBoundingClientRect();
+ $("#dialog_info").css("top", pos.top - 4);
+ $("#dialog_info").css("left", pos.left - 4);
},
_fireDataUrl : function(){
this.fire('dataset-selection-controllet_data-url', {url: this.dataUrl});
},
-// _addHTMLSpace : function(name){
-// return name.replace(/ /g, ' ');
-// },
-
_resize : function(){
var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0) - 16;
h = h - 64 - 8; //height with page scroller
diff --git a/controllets/dataset-selection-controllet/paper-input-search.html b/controllets/dataset-selection-controllet/paper-input-search.html
index 1730302..411b5d9 100755
--- a/controllets/dataset-selection-controllet/paper-input-search.html
+++ b/controllets/dataset-selection-controllet/paper-input-search.html
@@ -441,236 +441,4 @@ respectively.
}
});
})();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file