Interactive interface for browsing global, full-resolution satellite imagery
WV-597: Removed list.js, placed it in the data download widget, refactored, removed unnecessary code, and wraped the whole thing in one list
Mike McGannf1c0e390626e
diff --git a/etc/ant/js.build.xml b/etc/ant/js.build.xmlindex 48b7345f0..9c86203ba 100644--- a/etc/ant/js.build.xml+++ b/etc/ant/js.build.xml@@ -60,7 +60,6 @@<file name="js/datePicker.js"/><file name="js/rubberBand.js"/><file name="js/imageDownload.js"/>- <file name="js/list.js"/><file name="js/sote.js"/><file name="js/events.js"/>diff --git a/src/index.html b/src/index.htmlindex 2885e9658..86b0fce13 100644--- a/src/index.html+++ b/src/index.html@@ -128,7 +128,6 @@<!-- link.dev --> <script type="text/javascript" src="js/datePicker.js"></script><!-- link.dev --> <script type="text/javascript" src="js/rubberBand.js"></script><!-- link.dev --> <script type="text/javascript" src="js/imageDownload.js"></script>- <!-- link.dev --> <script type="text/javascript" src="js/list.js"></script><!-- link.dev --> <script type="text/javascript" src="js/sote.js"></script><!-- link.dev --> <script type="text/javascript" src="js/events.js"></script>diff --git a/src/js/Worldview/Widget/DataDownload.js b/src/js/Worldview/Widget/DataDownload.jsindex 7915f5815..cfb15673e 100644--- a/src/js/Worldview/Widget/DataDownload.js+++ b/src/js/Worldview/Widget/DataDownload.js@@ -43,7 +43,8 @@ Worldview.Widget.DataDownload = function(config, spec) {var lastResults = null;var self = {};- self.containerId = "DataDownload";+ self.selector = "#DataDownload";+ self.id = "DataDownload";var init = function() {model.events@@ -59,9 +60,11 @@ Worldview.Widget.DataDownload = function(config, spec) {.on("granuleSelect", updateSelection).on("granuleUnselect", updateSelection);- REGISTRY.register(self.containerId, self);- REGISTRY.markComponentReady(self.containerId);+ REGISTRY.register(self.id, self);+ REGISTRY.markComponentReady(self.id);self.updateComponent();++ $(window).resize(resize);};self.updateComponent = function(queryString) {@@ -98,30 +101,114 @@ Worldview.Widget.DataDownload = function(config, spec) {};self.render = function() {- var tabs_height = $(".ui-tabs-nav").outerHeight(true);- $(spec.selector).addClass('bank');- $(spec.selector).height($(spec.selector).parent().outerHeight() - tabs_height);-- list = new SOTE.widget.List(self.containerId, {- config: config,- data: [],- selected: "~",- close: false,- filter: true,- search: false,- action: {- text: "Download",- callback: function() { showDownloadList(); }- },- selectableCategories: {- callback: function(product) { model.selectProduct(product); },- defaultText: "0 selected"- },- onchange: function() {},- args: self+ var $container = $(spec.selector).empty()+ .addClass(self.id + "list")+ .addClass("bank");+ var $actionButton = $("<input></input>")+ .attr("id", "DataDownload_Button")+ .addClass("action")+ .attr("type", "button")+ .attr("value", "")+ .on("click", showDownloadList);++ $container.append($actionButton);++ var $list = $("<div></div>")+ .attr("id", self.id + "content")+ .addClass("content");+ $container.append($list);++ self.refresh();+ };++ self.refresh = function() {+ var $content = $(self.selector + "content");+ var api = $content.data("jsp");+ if ( api ) {+ api.destroy();+ }+ $content = $(self.selector + "content").empty();+ var data = model.groupByProducts();+ $.each(data, function(key, value) {+ refreshProduct($content, key, value);+ });++ $('#DataDownload #DataDownloadcontent h3 span').click(function(e){+ showUnavailableReason();});+ resize();};+ var refreshProduct = function($content, key, value) {+ var title = value.title;+ var $header = $("<h3></h3>")+ .addClass("head")+ .html(title);++ if ( !value.notSelectable ) {+ var $selectedCount = $("<div></div>")+ .attr("id", key + "dynamictext")+ .addClass("dynamic")+ .html("0 selected");+ $header.append($("<nobr></nobr>").append($selectedCount));+ var $productSelector = $("<input></input>")+ .attr("type", "radio")+ .attr("name", "cats")+ .addClass("cats")+ .addClass(self.id + "cats")+ .attr("value", key)+ .attr("data-product", key)+ .click(function() {+ model.selectProduct($(this).attr("data-product"));+ });+ if ( model.selectedProduct === key ) {+ $productSelector.attr("checked", "checked");+ }+ $header.append($productSelector);+ }+ $content.append($header);++ var $products = $("<ul></ul>")+ .attr("id", self.id + key)+ .addClass(self.id + "category");++ $.each(value.items, function(index, item) {+ refreshLayers($products, key, value, item);+ });+ $content.append($products);+ };++ var refreshLayers = function($container, key, value, layer) {+ var $item = $("<li></li>")+ .attr("id", self.id + key + Worldview.id(layer.value))+ .addClass("item")+ .addClass("item-static");+ $item.append("<h4>" + layer.label + "</h4>");+ $item.append("<p>" + layer.sublablel + "</p>");+ $container.append($item);+ };++ var resize = function() {+ var tabs_height = $(".ui-tabs-nav").outerHeight(true);+ $(self.selector).height(+ $(self.selector).parent().outerHeight() - tabs_height+ );++ var $pane = $(self.selector + "content");+ var api = $pane.data("jsp");+ if ( $(window).width() > Worldview.TRANSITION_WIDTH ) {+ if ( api ) {+ api.reinitialise();+ } else {+ $pane.jScrollPane({verticalGutter:0});+ }+ } else {+ if ( api ) {+ api.destroy();+ }+ }+ };+self.onViewChange = function(map) {if ( !model.active || queryActive || !lastResults ) {return;@@ -178,16 +265,15 @@ Worldview.Widget.DataDownload = function(config, spec) {var onProductSelect = function(product) {log.debug("selectProduct", product);- list.selectCategory(product);+ $(self.selector + " input[value='" + product + "']")+ .prop("checked", "true");};var onLayerUpdate = function() {if ( !model.active ) {return;}- list.data = model.groupByProducts();- list.selected = list.unserialize(model.getProductsString())[1];- list.update();+ self.refresh();};var onQuery = function() {@@ -250,24 +336,24 @@ Worldview.Widget.DataDownload = function(config, spec) {};var updateSelection = function() {+ $button = $("#DataDownload_Button");var selected = Worldview.size(model.selectedGranules);if ( selected > 0 ) {- list.setButtonEnabled(true);+ $button.removeAttr("disabled");var totalSize = model.getSelectionSize();if ( totalSize ) {var formattedSize = Math.round(totalSize * 100) / 100;- list.setActionButtonText("Download Data (" + formattedSize + " MB)");+ $button.val("Download Data (" + formattedSize + " MB)");} else {- list.setActionButtonText("Download Selected Data");+ $button.val("Download Selected Data");}} else {- list.setButtonEnabled(false);- list.setActionButtonText("No Data Selected");+ $button.attr("disabled", "disabled").val("No Data Selected");}var counts = model.getSelectionCounts();$.each(counts, function(productId, count) {- list.setCategoryDynamicText(productId, "" + count + " selected");+ $("#" + productId).html("" + count + " selected");});if ( downloadListPanel && downloadListPanel.visible() ) {downloadListPanel.show();@@ -295,6 +381,26 @@ Worldview.Widget.DataDownload = function(config, spec) {model.setPreference(event.target.value);};+ var showUnavailableReason = function() {+ var o;+ bodyMsg = 'Some layers in Worldview do not have corresponding source data products available for download. These include National Boundaries, Orbit Tracks, Earth at Night, and MODIS Corrected Reflectance products.<br><br>For a downloadable product similar to MODIS Corrected Reflectance, please try the MODIS Land Surface Reflectance layers available in Worldview. If you would like to generate MODIS Corrected Reflectance imagery yourself, please see the following document: <a href="https://earthdata.nasa.gov/sites/default/files/field/document/MODIS_True_Color.pdf" target="_blank">https://earthdata.nasa.gov/sites/default/files/field/document/MODIS_True_Color.pdf</a><br><br>If you would like to download only an image, please use the "camera" icon in the upper right.';+ o = new YAHOO.widget.Panel("WVerror", {+ width: "600px",+ zIndex: 1020,+ visible: false,+ constraintoviewport: true+ });+ title = "Notice";+ o.setHeader('<b>Why are these layers not available for downloading?</b>');+ o.setBody(bodyMsg);+ o.render(document.body);+ o.show();+ o.center();+ o.hideEvent.subscribe(function(i) {+ setTimeout(function() {o.destroy();}, 25);+ });+ };+init();return self;diff --git a/src/js/list.js b/src/js/list.jsindex 9f6cb3bb8..ae73e089a 100644--- a/src/js/list.js+++ b/src/js/list.js@@ -1,27 +1,27 @@-SOTE.namespace("SOTE.widget.List");+SOTE.namespace("SOTE.widget.List");SOTE.widget.List.prototype = new SOTE.widget.Component;/*** A selection device classifying radio buttons/checkboxes into categories that are displayed in Accordion form.* Radio buttons allow single selection accross categories. Checkboxes allow multiple selections accross categories.- * Radio selections cannot span multiple categories.+ * Radio selections cannot span multiple categories.** @module SOTE.widget* @class List* @constructor* @this {List}- * @param {String} containerId is the container id of the div in which to render the object+ * @param {String} containerId is the container id of the div in which to render the object* @param {Object} [config] is a hash allowing configuration of this component- * @config {Object[]} [items] a JS Array of JS Objects: items.category[i..n].key, items.category[i..n].value+ * @config {Object[]} [items] a JS Array of JS Objects: items.category[i..n].key, items.category[i..n].value* , items.category[i..n].action, items.type[i..n] representing the available options* @config {String} [selected] the key of the initially selected option(s)* @augments SOTE.widget.Component- *+ **/SOTE.widget.List = function(containerId, spec){this.log = Logging.getLogger("Worldview.Widget.List");-+//Get the ID of the container elementthis.container=document.getElementById(containerId);if (this.container==null){@@ -30,9 +30,9 @@ SOTE.widget.List = function(containerId, spec){}this.id = containerId;//Store the container's ID- this.containerId=containerId;+ this.containerId=containerId;- //Define an object for holding configuration+ //Define an object for holding configurationif (spec===undefined){spec={};}@@ -44,28 +44,28 @@ SOTE.widget.List = function(containerId, spec){if(spec.data === undefined){SOTE.util.throwError("List data is not defined.");}-+if(spec.search == undefined){spec.search = false;spec.selectedCategory = 'All';}-+if(spec.search && spec.category == undefined){spec.selectedCategory = 'All';}-+if(spec.filter == undefined){spec.filter = false;}-+if(spec.customClasses == undefined){spec.customClasses = '';}-+if(spec.sortable == undefined){spec.sortable = false;}-+this.customClasses = spec.customClasses;this.hidden = new Object;@@ -86,7 +86,7 @@ SOTE.widget.List = function(containerId, spec){this.config = spec.config;this.data = spec.data;this.paletteWidget = spec.paletteWidget;-+this.selected = this.unserialize(spec.selected);this.selected = this.selected[1];@@ -96,36 +96,36 @@ SOTE.widget.List = function(containerId, spec){/*** Displays all options in HTML in an Accordion format (see JQuery UI Accordion) with the selected states being indicated- * by radio button and checkbox selection. All callbacks should be set. The component UI should be rendered+ * by radio button and checkbox selection. All callbacks should be set. The component UI should be rendered* with controllers to call the events.*- *+ ** @this {List}- *+ **/SOTE.widget.List.prototype.init = function(){-+this.render();- this.trigger();+ this.trigger();};SOTE.widget.List.prototype.trigger = function(){//$("#"+this.id).trigger("listchange");- this.callback(this.args);+ this.callback(this.args);};/*** Renders the UI accordion from this.items*- *+ ** @this {List}- *+ **/SOTE.widget.List.prototype.render = function(){- // options: category (id: txt, title:txt, notification:txt, checkbox:bool),+ // options: category (id: txt, title:txt, notification:txt, checkbox:bool),// item (id: txt, label:txt, value: txt, hide:bool, remove:bool, checkbox:bool)-+// setNotification: id,txt@@ -133,9 +133,9 @@ SOTE.widget.List.prototype.render = function(){// Clear div$(this.container).empty().addClass(this.id+'list');-+// If action is enabled, render an action button-+if(this.action){var $actionButton = $("<input type='button' class='action' value='"+this.action.text+"' id='"+this.id+"action' />");$(this.container).append($actionButton);@@ -147,31 +147,31 @@ SOTE.widget.List.prototype.render = function(){if(this.search){var $facetedSearch = $("<div class='facetedSearch' id='"+this.id+"facetedSearch'></div>");var $select = $("<select class='select' id='"+this.id+"select'></select");-+for (var c in this.categories){if(c != 'palettes'){$select.append($("<option value='"+c+"'>"+c+"</option>"));}}-- $facetedSearch.append($select);++ $facetedSearch.append($select);$facetedSearch.append($("<input type='text' name='search' class='search' autocomplete='off' placeholder='ex. modis, terra, fire' id='"+this.id+"search'/>"));-+$(this.container).append($facetedSearch);-+// Set events to capture data from search and category fields-+$("#"+this.id+"select").on('change',{self:this,select:true},SOTE.widget.List.setCategory);$('#'+this.id+"select").val("All");$("#"+this.id+"search").on('keyup',{self:this,select:false},SOTE.widget.List.search);}-+// Creating main content block-+$(this.container).append($("<div id='"+this.id+"content' class='content "+this.customClasses+"'></div>"));this.update();--++};SOTE.widget.List.prototype.update = function() {@@ -191,9 +191,9 @@ SOTE.widget.List.prototype._update = function(){} else {self.paletteWidget.displaySelector(name);}- };+ };};-+$content = $("#" + this.id + "content").empty();// If search is enabled and a keyword exists, break keyword down into words array@@ -203,20 +203,20 @@ SOTE.widget.List.prototype._update = function(){this.keyword = this.keyword.replace(/[\(\)\"\'!\$\%\&\?\+\*\\\@\=]/g,"");var keywords = this.keyword.split(/\s/);}-+// Traverse data by category (i.e. baselayers, overlays)-+for(var key in this.data){-+// Category header (i.e. "Base Layers")-+var title = this.data[key].title;var $header = $("<h3 class='head'></h3>").html(title);-+if(this.selectableCategories && !this.data[key].notSelectable){$header.append($("<nobr><div id='"+key+"dynamictext' class='dynamic'>"+this.selectableCategories.defaultText+"</div></nobr>"));- $header.append($("<input type='radio' name='cats' class='cats "+this.id+"cats' value='"+key+"' />"));- $("#"+this.id).undelegate("."+this.id+"cats" ,'click');+ $header.append($("<input type='radio' name='cats' class='cats "+this.id+"cats' value='"+key+"' />"));+ $("#"+this.id).undelegate("."+this.id+"cats" ,'click');$("#"+this.id).delegate("."+this.id+"cats" ,'click',{self:this},SOTE.widget.List.handleCategorySelection);}@@ -224,32 +224,32 @@ SOTE.widget.List.prototype._update = function(){$category = $("<ul id='"+this.id+key+"'></ul>").addClass(this.id+'category');- this.values[key] = new Object;-+ this.values[key] = new Object;+// For all items in category (i.e. for all items in baselayers)-+for(var i=0; i<this.data[key].items.length; ++i){-+var item = this.data[key].items[i];var label = item.label;var itemKey = item.value.replace(/:/g,"colon");var fLabel = item.label.replace(" ","-").toLowerCase();-+if(item.value in this.selected){this.values[key][item.value] = 1;}// If only showing a subset of items (i.e. only show items that are in selected)-+if(!this.filter || item.value in this.selected) {-- // Do keyword search if the keyword is not empty-++ // Do keyword search if the keyword is not empty+if(this.search && !this.keyword.match(/^\s*$/)){var count = 0;for(var j=0; j<keywords.length; ++j){var myVal = new RegExp(keywords[j]);if(item.label.toUpperCase().match(myVal) || item.sublabel.toUpperCase().match(myVal) || item.tags && item.tags.toUpperCase().match(myVal)) {- count++;+ count++;}}}@@ -262,18 +262,18 @@ SOTE.widget.List.prototype._update = function(){if(item.categories && !(this.selectedCategory in item.categories)){count = -1;}-+// If search is selected, see if the item matched all words in the keywords list, if so, display// If search is not selected, display all items-+if(!this.search || (keywords && count == keywords.length)){-+$item = $("<li id='"+ this.id + key + itemKey + "' class='item item-static'></li>");-+if(this.close){$item.append("<a><img class='close bank-item-img' id='close"+key+"-"+item.value.replace(/:/g,"colon")+"' title='Remove Layer' src='images/close-red-x.png' /></a>");}-+if(this.hide){if (item.value in this.hidden){$item.append("<a class='hdanchor'><img class='hide bank-item-img' title='Show Layer' id='hide"+key+"-"+item.value.replace(/:/g,"colon")+"' src='images/invisible.png' /></a>");@@ -282,7 +282,7 @@ SOTE.widget.List.prototype._update = function(){$item.append("<a class='hdanchor'><img class='hide bank-item-img' title='Hide Layer' id='hide"+key+"-"+item.value.replace(/:/g,"colon")+"' src='images/visible.png' /></a>");}}-+if(this.checkbox){var checked = (item.value in this.selected)? "checked":"";$item.append("<input type='checkbox' class='check' id='"+item.value.replace(/:/g,"colon")+"' value='"+item.value+"' "+checked+"/>");@@ -290,7 +290,7 @@ SOTE.widget.List.prototype._update = function(){$item.append("<h4>"+label+"</h4>");$item.append("<p>"+item.sublabel+"</p>");- var paletteInfo = this.getPaletteInfo(item.value);+ var paletteInfo = this.getPaletteInfo(item.value);if ( paletteInfo ) {if ( paletteInfo ) {var units = "";@@ -302,28 +302,28 @@ SOTE.widget.List.prototype._update = function(){"<span class='palette'>" +"<span class='p-min'>" + paletteInfo.min + "</span>" +"<canvas class='colorBar' id='canvas_" + this.id + itemKey + "'></canvas>" +- "<span class='p-max'>" + paletteInfo.max + "</span>" +- units ++ "<span class='p-max'>" + paletteInfo.max + "</span>" ++ units +"</span>" +"</div>");}}- $category.append($item);+ $category.append($item);}}-+}$('#DataDownload #DataDownloadcontent h3 span').click(function(e){var o;bodyMsg = 'Some layers in Worldview do not have corresponding source data products available for download. These include National Boundaries, Orbit Tracks, Earth at Night, and MODIS Corrected Reflectance products.<br><br>For a downloadable product similar to MODIS Corrected Reflectance, please try the MODIS Land Surface Reflectance layers available in Worldview. If you would like to generate MODIS Corrected Reflectance imagery yourself, please see the following document: <a href="https://earthdata.nasa.gov/sites/default/files/field/document/MODIS_True_Color.pdf" target="_blank">https://earthdata.nasa.gov/sites/default/files/field/document/MODIS_True_Color.pdf</a><br><br>If you would like to download only an image, please use the "camera" icon in the upper right.';o = new YAHOO.widget.Panel("WVerror", {- width: "600px",- zIndex: 1020,+ width: "600px",+ zIndex: 1020,visible: false,- constraintoviewport: true+ constraintoviewport: true});- title = title || "Notice";+ title = "Notice";o.setHeader('<b>Why are these layers not available for downloading?</b>');o.setBody(bodyMsg);o.render(document.body);@@ -334,15 +334,15 @@ SOTE.widget.List.prototype._update = function(){});});// Append the category (heading + items) to the content div-+$content.append($category);-+for(var i=0; i<this.data[key].items.length; ++i){var item = this.data[key].items[i];var label = item.label;var itemKey = item.value.replace(/:/g,"colon");if((!this.filter || item.value in this.selected) && (!this.search || (keywords && count == keywords.length))){- var paletteInfo = this.getPaletteInfo(item.value);+ var paletteInfo = this.getPaletteInfo(item.value);if ( paletteInfo ) {Worldview.Palette.ColorBar({selector: "#canvas_" + this.id + itemKey,@@ -355,35 +355,35 @@ SOTE.widget.List.prototype._update = function(){.css("cursor", "pointer");}}- }+ }}-+// Append show/hide/checkbox events if this.hide = true / this.close = true / this.checkbox = true$("#"+this.id).undelegate(".close" ,'click');- $("#"+this.id).undelegate(".hide" ,'click');- $("#"+this.id).undelegate(".check" ,'click');+ $("#"+this.id).undelegate(".hide" ,'click');+ $("#"+this.id).undelegate(".check" ,'click');$("#"+this.id).delegate(".close" ,'click',{self:this},SOTE.widget.List.removeItem);- $("#"+this.id).delegate(".hide" ,'click',{self:this},SOTE.widget.List.hideItem);+ $("#"+this.id).delegate(".hide" ,'click',{self:this},SOTE.widget.List.hideItem);$("#"+this.id).delegate(".check" ,'click',{self:this},SOTE.widget.List.toggleValue);--++if($(window).width() > 720){if(this.jsp){var api = this.jsp.data('jsp');if(api) api.destroy();- }+ }this.jsp = $( "."+this.id+"category" ).jScrollPane({autoReinitialise: false, verticalGutter:0});}-+if(this.sortable){$( "."+this.id+"category" ).sortable({items: "li:not(.head)"});$( "."+this.id+"category" ).bind('sortstart',{self:this},SOTE.widget.List.initiateSort);$( "."+this.id+"category" ).bind('sortstop',{self:this},SOTE.widget.List.handleSort);}- setTimeout(SOTE.widget.List.adjustCategoryHeights,1,{self:this});+ setTimeout(SOTE.widget.List.adjustCategoryHeights,1,{self:this});};SOTE.widget.List.prototype.getPaletteInfo = function(layerName) {@@ -399,11 +399,11 @@ SOTE.widget.List.prototype.getPaletteInfo = function(layerName) {}return {units: layerConfig.units,- min: ( layerConfig.min === undefined )- ? "  "+ min: ( layerConfig.min === undefined )+ ? "  ": layerConfig.min,max: ( layerConfig.max === undefined )- ? "  "+ ? "  ": layerConfig.max,bins: layerConfig.bins,stops: layerConfig.stops,@@ -413,18 +413,18 @@ SOTE.widget.List.prototype.getPaletteInfo = function(layerName) {SOTE.widget.List.prototype.setButtonEnabled = function(enabled) {if ( enabled ) {- $("#" + this.id + "action").removeAttr("disabled");+ $("#" + this.id + "action").removeAttr("disabled");} else {$("#" + this.id + "action").attr("disabled", "disabled");}};SOTE.widget.List.prototype.setActionButtonText = function(text) {- $("#" + this.id + "action").attr("value", text);+ $("#" + this.id + "action").attr("value", text);};SOTE.widget.List.prototype.setCategoryDynamicText = function(id, text) {- $("#" + id + "dynamictext").html(text);+ $("#" + id + "dynamictext").html(text);};SOTE.widget.List.act = function(e){@@ -448,7 +448,7 @@ SOTE.widget.List.prototype.selectCategory = function(id) {SOTE.widget.List.search = function(e){var self = e.data.self;- var val = e.target.value.toUpperCase();+ var val = e.target.value.toUpperCase();self.keyword = val;self.update();};@@ -466,12 +466,12 @@ SOTE.widget.List.toggleValue = function(e){self.values[category] = new Object();}if(checked !== undefined && checked){- self.values[category][value] = 1;+ self.values[category][value] = 1;}else{delete self.values[category][value];}-+self.trigger();};@@ -508,20 +508,20 @@ SOTE.widget.List.adjustCategoryHeights = function(args){heights.push({name:self.id+key,height:actual_height,count:count});}-+if(heights.length > 1){if(heights[0].height + heights[1].height > container_height){- if(heights[0].height > container_height/2) {+ if(heights[0].height > container_height/2) {heights[0].height = container_height/2;}-+heights[1].height = container_height - heights[0].height;-+}-+$("#" + heights[0].name).css("height",heights[0].height+"px");$("#" + heights[1].name).css("height",heights[1].height+"px");-+}else if ( heights.length === 1 ) {heights[0].height = container_height;@@ -534,7 +534,7 @@ SOTE.widget.List.reinitializeScrollbars = function(self) {var pane = $("."+self.id+"category").each(function(){var api = $(this).data('jsp');if(api) api.reinitialise();- });+ });};SOTE.widget.List.initiateSort = function(e,ui){@@ -556,7 +556,7 @@ SOTE.widget.List.handleSort = function(e,ui){if(!self.filter || val in self.selected)self.values[key][val] = 1;});- }+ }self.trigger();};@@ -568,7 +568,7 @@ SOTE.widget.List.removeItem = function(e){var val = t[1];delete self.values[category][val];-+var formattedVal = "close"+val.replace(/:/g,"colon");$("#"+self.id+" #"+e.target.id).parent().parent().remove();@@ -592,13 +592,13 @@ SOTE.widget.List.hideItem = function(e){else {self.hidden[val] = 1;e.target.src = 'images/invisible.png';- $("#"+e.target.id).attr("title","Show Layer");+ $("#"+e.target.id).attr("title","Show Layer");}self.trigger();};/**- * Sets the selected option(s) in the List from the passed in value(s), if valid+ * Sets the selected option(s) in the List from the passed in value(s), if valid* [containerId]=[options] (options is a dot delimited string with the first item containing* a single select item, and the remaining items containing the multi-select items).*@@ -610,8 +610,8 @@ SOTE.widget.List.hideItem = function(e){SOTE.widget.List.prototype.setValue = function(valString, selector){this.selected = this.unserialize(valString, selector)[1];-- this.render();++ this.render();this.trigger();};@@ -623,12 +623,12 @@ SOTE.widget.List.prototype.currCount = function(){* Gets the currently selected option(s) [containerId]=[options]** @this {List}- * @returns {String} [container]=[options], options being a dot delimited string+ * @returns {String} [container]=[options], options being a dot delimited string* representing the key(s) of the currently selected option(s)**/SOTE.widget.List.prototype.getValue = function(){-+var value = this.serialize(this.values);return value;};@@ -638,7 +638,7 @@ SOTE.widget.List.prototype.serialize = function(values){if(!values)return "";for(var category in values){- var catStr = [category];+ var catStr = [category];for(var item in values[category]){if(item in this.hidden)catStr.push("!" + item);@@ -647,7 +647,7 @@ SOTE.widget.List.prototype.serialize = function(values){}categories.push(catStr.join(","));}-+return categories.join("~");};@@ -657,14 +657,14 @@ SOTE.widget.List.prototype.unserialize = function(string, selector){var categories = string.split("~");var values = new Object;this.count = 0;--++for(var i=0; i<categories.length; i++){var items = categories[i].split(/[\.,]/);unserialized[items[0]] = new Object;for(var j=1; j<items.length; j++){if(hideIndicator.test(items[j])){- items[j] = items[j].replace(/!/g, "");+ items[j] = items[j].replace(/!/g, "");this.hidden[items[j]] = 1;}else {@@ -677,15 +677,15 @@ SOTE.widget.List.prototype.unserialize = function(string, selector){values[items[j]] = 1;this.count++;}-+}-+for(var key in this.hidden){if( !key in values ){delete this.hidden[key];}}-+return [unserialized,values];};@@ -698,7 +698,7 @@ SOTE.widget.List.prototype.setHeight = function(height){* Sets the data accessor that provides state change instructions given dependencies** @this {List}- * @param {String} datasourceurl is the relative location of the data accessor+ * @param {String} datasourceurl is the relative location of the data accessor**/SOTE.widget.List.prototype.setDataSourceUrl = function(dataSourceUrl){@@ -707,7 +707,7 @@ SOTE.widget.List.prototype.setDataSourceUrl = function(dataSourceUrl){/*** Gets the data accessor- *+ ** @this {List}* @returns {String} the relative location of the accessor*