diff --git a/controllets/create-card-controllet/create-card-controllet.html b/controllets/create-card-controllet/create-card-controllet.html index ebfa895..83caacb 100755 --- a/controllets/create-card-controllet/create-card-controllet.html +++ b/controllets/create-card-controllet/create-card-controllet.html @@ -50,7 +50,14 @@ } p { - margin: 16px 8px 0px 8px; + padding: 16px 0px 0px 8px; + margin: 0px; + } + + #create_card_text { + width: 100%; + height: 100%; + background-color: #FFFFCC; } #create_card_title { @@ -62,11 +69,6 @@ #create_card_description { font-style: italic; color: #727272; - text-align: center; - } - - #create_card_text { - } paper-input, paper-textarea { @@ -138,6 +140,7 @@ +
PREVIEW
@@ -204,49 +162,54 @@ Polymer({ is: "paper-card-controllet", properties: { + width: { type: Number, observer: "_changeWidth" }, + height: { type: Number, observer: "_changeHeight" }, + + elevation:{ + type: Number, + value: 3 + }, + cardType:{ type: String, value: "text" }, - comment:{ - cardType: String, - value: "" - }, + cardTitle:{ type: String, value: "" }, - elevation:{ - type: Number, - value: 3 + + comment:{//cardDescription + cardType: String, + value: "" } }, attached: function(){ if(this.cardType == "text"){ - this.$.content.style.backgroundColor = "#ffc"; + this.$.content.style.backgroundColor = "#FFFFCC"; } + $(this.$.fullscreen_container).perfectScrollbar(); }, - _changeWidth: function(data){ - this.style.width = data + "px"; - //this.$.content.style.width = data + "px"; - //$(this.$.content).perfectScrollbar(); + _changeWidth: function(){ + this.style.width = this.width + "px"; + this.$.content.style.width = this.width - 8 + "px"; }, - _changeHeight: function(data){ - this.style.height = (data) + "px"; - this.$.content.style.height = data + "px"; - this.style.height = (this.height + ((this.text != "") ? 50 : 0)) + "px"; + _changeHeight: function(){ + this.style.height = this.height + 64 + "px"; + this.$.content.style.height = this.height - 4 + "px"; $(this.$.content).perfectScrollbar(); }, @@ -254,40 +217,32 @@ return (type == check); }, - _handleDetailsClick: function(e){ - this.fire('paper-card-controllet_details-clicked', {data : this}); - }, - - _handleDeleteClick: function(e){ + _handleDeleteClick: function(){ this.fire('paper-card-controllet_delete-clicked', {data : this}); }, - _handleFullscreenClick: function(e){ + _handleModifyClick: function(){ + this.fire('paper-card-controllet_details-clicked', {data : this}); + }, + _handleOpenClick: function(){ + var html; switch(this.cardType){ case 'text': - this.$.fullscreen_content.style.backgroundColor = "#ffc"; + this.$.fullscreen_container.style.backgroundColor = "#ffc"; break; case 'link': - window.open(this.getAttribute('card-link'),'_blank'); + window.open(this.getAttribute('card-link'), '_blank'); return; } var html = this.$.content.innerHTML; - this.$.content.innerHTML = ""; this.$.fullscreen_content.innerHTML = html; - this.$.fullscreen_container.style.display = "inline-block"; - }, - - _handleCloseFullscreenClick: function(e){ - - var html = this.$.fullscreen_content.innerHTML; - this.$.fullscreen_content.innerHTML = ""; - this.$.content.innerHTML = html; - - this.$.fullscreen_container.style.display = "none"; + this.$.fullscreen_container.open(); + this.$.fullscreen_container.style.display = "inline";//datalet resize in chrome } + }) diff --git a/controllets/paper-card-controllet/paper-card-controllet_old.html b/controllets/paper-card-controllet/paper-card-controllet_old.html new file mode 100755 index 0000000..05c7022 --- /dev/null +++ b/controllets/paper-card-controllet/paper-card-controllet_old.html @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/datalets/base-datalet/base-datalet.html b/datalets/base-datalet/base-datalet.html index c6ff64c..85f9c4b 100755 --- a/datalets/base-datalet/base-datalet.html +++ b/datalets/base-datalet/base-datalet.html @@ -169,6 +169,11 @@ Example : }); } } + + else { + this.hideFooter(); + this.$.base_datalet_spin.remove(); + } }, attached: function(){ diff --git a/datalets/datasetexplorer-datalet/datasetexplorer-datalet.html b/datalets/datasetexplorer-datalet/datasetexplorer-datalet.html index 0c79232..030a7d2 100755 --- a/datalets/datasetexplorer-datalet/datasetexplorer-datalet.html +++ b/datalets/datasetexplorer-datalet/datasetexplorer-datalet.html @@ -187,12 +187,38 @@ Example: var xyz = function(url) { me.selectResource(url); } - build(this.map, "treemap_placeholder", xyz, this._component.width, this._component.height); + build(this.map, this.meta, "treemap_placeholder", xyz, this._component.width, this._component.height); }, selectResource: function(url) { this._component.fire("datasetexplorer-datalet_data-url", { url: url }); - } + }, + + selectData : function() { + this.data = []; + this.meta = this.properties.json_results.value.result.providers; + + //Deal the fields with "'" char + //this._component.fields = this._component.fields.replace(/#/g,"'"); + + this._component.fields = JSON.parse(this._component.fields); + + for (var i = 0; i < this._component.fields.length; i++) { + var query = "$"; + var query_elements = this._component.fields[i].split(','); + for (var j = 0; j < query_elements.length; j++) { + query += "['" + query_elements[j] + "']"; + if (this.isFieldArray(query_elements.slice(0, j + 1))) { + query += "[*]"; + } + } + this.data.push({ + name: query_elements[query_elements.length - 1], + data: jsonPath(this.properties.json_results.value, query) + }); + } + this.deleteWaitImage(); + }, }; @@ -214,12 +240,12 @@ Example: width : { type : Number, - value: -1 + value: 968 }, height : { type : Number, - value: -1 + value: 700 } }, diff --git a/datalets/datasetexplorer-datalet/js/buildtreemap.js b/datalets/datasetexplorer-datalet/js/buildtreemap.js index b5318f0..d311b04 100755 --- a/datalets/datasetexplorer-datalet/js/buildtreemap.js +++ b/datalets/datasetexplorer-datalet/js/buildtreemap.js @@ -2,7 +2,7 @@ * Created by Utente on 17/07/2015. */ -function build(root, place_holder, select_listener, width, height) { +function build(root, meta, place_holder, select_listener, width, height) { var plwidth = width >= 0 ? width : $("#" + place_holder).width(), plheight = height >= 0 ? height : $("#" + place_holder).height(); @@ -223,6 +223,17 @@ function build(root, place_holder, select_listener, width, height) { text.call(wrap); } + function checkProviderName(name) { + console.log(name); + if (name.substr(0, 2) == 'p:') { + console.log("in"); + var pid = name.substr(2); + name = meta[pid].title; + } + console.log(name); + return name; + } + function wrap(d) { var wwidth = width; var hheight = height; @@ -230,7 +241,7 @@ function build(root, place_holder, select_listener, width, height) { d.each(function(){ var text = d3.select(this), d = text[0][0].__data__, - name = d.name.trim(), + name = checkProviderName(d.name.trim()); words = name.search(/\s+/) >= 0 ? name.split(/\s+/).reverse() : [name], word = words.pop(), line = [word], diff --git a/datalets/leafletjs-datalet/leafletjs-datalet.html b/datalets/leafletjs-datalet/leafletjs-datalet.html index 106b6bb..2ba78a2 100755 --- a/datalets/leafletjs-datalet/leafletjs-datalet.html +++ b/datalets/leafletjs-datalet/leafletjs-datalet.html @@ -52,7 +52,7 @@ Example: