Mercurial > hg > mpiwg_geobrowser
view js/lineoverlay_edit_form_populate.js @ 2:35c11979b58b
added current version of platin
author | Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 02 Jun 2015 13:52:44 +0200 |
parents | b57c7821382f |
children |
line wrap: on
line source
(function ($) { Drupal.behaviors.mpiwg_geobrowser_lineoverlay_edit = { attach: function(context, settings) { var datasets = []; $("body").find(".mpiwg_geobrowser_dataSource .block-title").each(function() { var datasetDescription = $(this).html().replace("datasource: ", ""); var fields = []; $(GeoTemConfig.datasets).each(function() { if (this.label == datasetDescription) { if (this.objects.length > 0) { for (var i=0; i<Object.keys(this.objects[0]).length; i++) { fields.push(Object.keys(this.objects[0])[i]); } } } }); datasets[datasetDescription] = fields; }); var htmlList = '<p class="mpiwg_geobrowser_overlay_datasets_info">here u see the available datasources and their respective available fields. u have to manually copy ur preferred items and paste them into the respective text field below.</p>'; htmlList += '<ul class="mpiwg_geobrowser_overlay_datasets">'; for (var dataset in datasets) { htmlList += '<li>'+dataset+': '; for (var i=0; i<Object.keys(datasets[dataset]).length; i++) { htmlList += datasets[dataset][i]+', '; } htmlList += '</li>'; } htmlList += '</ul>'; $("#datasets_placeholder").html(htmlList); } } })(jQuery);