From 73cc8795b09adf7737fdaefc0691a7699762e12c Mon Sep 17 00:00:00 2001 From: palmieri@dia.unisa.it Date: Wed, 18 Nov 2015 18:26:13 +0100 Subject: [PATCH] dataset page and wait datalet --- datalets/base-ajax-json-jsonpath-datalet/static/js/AjaxJsonJsonPathBehavior.js | 24 +++++++++++++++++------- datalets/base-datalet/base-datalet.html | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ datalets/base-datalet/static/images/spin.svg | 1 + 3 files changed, 129 insertions(+), 13 deletions(-) create mode 100644 datalets/base-datalet/static/images/spin.svg diff --git a/datalets/base-ajax-json-jsonpath-datalet/static/js/AjaxJsonJsonPathBehavior.js b/datalets/base-ajax-json-jsonpath-datalet/static/js/AjaxJsonJsonPathBehavior.js index b5eef3e..d24bfba 100755 --- a/datalets/base-ajax-json-jsonpath-datalet/static/js/AjaxJsonJsonPathBehavior.js +++ b/datalets/base-ajax-json-jsonpath-datalet/static/js/AjaxJsonJsonPathBehavior.js @@ -2,7 +2,7 @@ @license The MIT License (MIT) - Copyright (c) 2015 Dipartimento di Informatica - Università di Salerno - Italy + Copyright (c) 2015 Dipartimento di Informatica - Universit� di Salerno - Italy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -98,7 +98,7 @@ var AjaxJsonJsonPathBehavior = { * * @method selectData */ - selectData : function(){ + selectData : function() { this.data = []; @@ -107,17 +107,27 @@ var AjaxJsonJsonPathBehavior = { this._component.fields = JSON.parse(this._component.fields); - for(var i=0;i < this._component.fields.length; i++){ + 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++){ + for (var j = 0; j < query_elements.length; j++) { query += "['" + query_elements[j] + "']"; - if(this.isFieldArray(query_elements.slice(0,j+1))){ + 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.data.push({ + name: query_elements[query_elements.length - 1], + data: jsonPath(this.properties.json_results.value, query) + }); } - } + this.deleteWaitImage(); + }, + /** + * Delete a image after loading a datalet + */ + deleteWaitImage : function() { + $("img[src$='spin.svg']").remove(); + } }; \ No newline at end of file diff --git a/datalets/base-datalet/base-datalet.html b/datalets/base-datalet/base-datalet.html index 935723c..4e9d6df 100755 --- a/datalets/base-datalet/base-datalet.html +++ b/datalets/base-datalet/base-datalet.html @@ -72,13 +72,27 @@ Example : height:32px; width: 32px; } + #image_spin { + height:32px; + width: 32px; + position: relative; + center: center; + width: 100%; + } + +
+ + +
+
Source: +
-
Powered by Route-to-PA
-
+
Powered by ROUTE-TO-PA
+
@@ -92,19 +106,51 @@ Example : diff --git a/datalets/base-datalet/static/images/spin.svg b/datalets/base-datalet/static/images/spin.svg new file mode 100644 index 0000000..5b931d7 --- /dev/null +++ b/datalets/base-datalet/static/images/spin.svg @@ -0,0 +1 @@ + \ No newline at end of file -- libgit2 0.21.4