Interactive interface for browsing global, full-resolution satellite imagery
Basics of data download working, still needs work
Mike McGannd6514294a71e
diff --git a/src/css/accordionPicker.css b/src/css/accordionPicker.cssindex 7e94db0be..debe9a3c9 100644--- a/src/css/accordionPicker.css+++ b/src/css/accordionPicker.css@@ -1,8 +1,12 @@+/* FIXME: Remove if no longer needed */+/*a.accordionToggler { float:left; display:block; width:28px; height:36px; border-radius: 0 10px 10px 0; -moz-border-radius: 0 10px 10px 0; -webkit-border-radius: 0 10px 10px 0; text-decoration:none; background: none no-repeat scroll center rgba(0, 0, 0, 0.88); color:#fff; position:relative; top:30px; letter-spacing:2px; font-family:"Gill Sans","Helvetica",sans-serif;}a.atcollapse {background-image: url("../images/expandIn.png"); }a.atexpand {background-image: url("../images/expandOut.png");}*/++/*.accordion {position:relative;}-.ui-accordion { float:left; display:block; width:230px; /* background:rgba(50,50,60,0.89); */color:#fff; font: 1.05em "Gill Sans",sans-serif; text-shadow:none; font-weight:120;}+.ui-accordion { float:left; display:block; width:230px; color:#fff; font: 1.05em "Gill Sans",sans-serif; text-shadow:none; font-weight:120;}.ui-accordion{ border-radius: 0 20px 20px 0; -moz-border-radius: 0 20px 20px 0; -webkit-border-radius: 0 20px 20px 0; background: none repeat scroll 0 0 rgba(0,0,0,0.8); border:rgba(0,0,0,0.35) 10px solid; border-width:10px 10px 10px 0;}.ui-accordion a{ display: block; text-decoration:none;}@@ -17,4 +21,5 @@ ul.ui-accordion-content li{border:rgba(30,30,30,0.2) 1px solid; background: rgbaa.ui-accordion-header span { margin-left:5px;}a.ui-accordion-header span.ui-icon { }a.ui-accordion-header span.ui-icon-triangle-1-e { margin: 2px 0 0 0; float:left; width:14px; height:12px; display:block; background:transparent url("../images/collapsed.png");}-a.ui-accordion-header span.ui-icon-triangle-1-s { margin: 2px 0 0 0;float:left; width:14px; height:12px; display:block; background:transparent url("../images/expanded.png"); }\ No newline at end of file+a.ui-accordion-header span.ui-icon-triangle-1-s { margin: 2px 0 0 0;float:left; width:14px; height:12px; display:block; background:transparent url("../images/expanded.png"); }+*/\ No newline at end of filediff --git a/src/css/dataDownload.css b/src/css/dataDownload.cssindex e1b705955..2c0bfb8f3 100644--- a/src/css/dataDownload.css+++ b/src/css/dataDownload.css@@ -1,4 +1,4 @@-#dataDownload {+#wv-data {padding-top: 10px;display: inline-block;float: left;@@ -9,11 +9,11 @@text-shadow: none;}-#DataDownload .jspPane {+#wv-data .jspPane {left: 0 !important;}-#dataDownload div.ui-button {+#wv-data .ui-button {margin-left: 20px;margin-right: 20px;}@@ -31,84 +31,53 @@border-radius: 5px;}-/*-.action:hover {- background: #609060;-}--.action:active {- background: #407040;-}--.action[disabled='disabled'] {- border: 1px solid #404040;- background: black;- color: #808080;- cursor: auto;- border-radius: 5px;-}-*/--#DataDownload_DownloadListPanel .bd {- background-color: rgb(25, 28, 32);- overflow: auto;- padding: 10px;- color: #FFFBE7;-}-#DataDownload_DownloadListPanel ul {+#wv-data-selection ul {display: list;margin: 0 5px;}-#DataDownload_DownloadListPanel li {+#wv-data-selection li {margin-top: 3px;display: list-item;list-style-type: none;}-#DataDownload_DownloadListPanel div.product li {+#wv-data-selection div.product li {list-style-type: disc;margin-left: 10px;}+#wv-data-selection .link {+ margin-left: 10px;+ list-style-type: disc;+}+#DataDownload_DownloadListPanel .BulkDownload li {list-style-type: disc;margin-left: 10px;}-#DataDownload_DownloadListPanel h3 {+#wv-data-selection h3 {font-size: 12pt;font-weight: bold;color: #FFFBE7;}-#DataDownload_DownloadListPanel h4 {+#wv-data-selection h4 {font-size: 11pt;font-weight: bold;color: #FFFBE7;}-#DataDownload_DownloadListPanel h5 {+#wv-data-selection h5 {font-size: 10pt;margin-top: 10px;margin-bottom: 5px;color: #FFFBE7;}-#DataDownload_DownloadListPanel a {- text-decoration: none;-}--#DataDownload_DownloadListPanel a:link {- color: #82cdfa;-}--#DataDownload_DownloadListPanel a:visited {- color: #82cdfa;-}--#DataDownload_DownloadListPanel hr {+#wv-data-selection hr {display: block;height: 1px;border: 0;@@ -117,13 +86,13 @@padding: 0;}-#DataDownload_DownloadListPanel td {- border-bottom: 1px solid #303030;+#wv-data-selection td {+ border-bottom: 1px solid #404040;padding: 5px;vertical-align: top;}-#DataDownload_DownloadListPanel .remove {+#wv-data-selection .remove {display: block;padding: 3px;border: 1px solid #707070;@@ -132,71 +101,98 @@border-radius: 5px;}-#DataDownload_DownloadListPanel .remove:hover {- background: #ffaaaa;- border-color: #ffaaaa;- color: #000000;+#wv-data-selection .remove:hover {+ background: #eee;+ border-color: #444;+ color: #444;+}++#wv-data-selection .remove:active {+ background: #888;+ border-color: #444;+ color: #000;}-#DataDownload_DownloadListPanel .remove:active {- background: #df8a8a;- border-color: #df8a8a;- color: #000000;+#wv-data-selection table {+ width: 100%;+ border-collapse: collapse;}-#DataDownload_DownloadListPanel tr:hover {+#wv-data-selection tr:hover {background-color: rgb(55, 58, 62);}-#DataDownload_Notice {+#wv-data-selection .collapse {+ width: 100%;+ border: 0;+}++#wv-data-selection .collapse .ui-accordion-header {+ background: rgba(0, 0, 0, 0);+ border: 0;+ font-weight: normal;+}++#wv-data-selection .bulk h5 {+ margin-top: 5px;+}++#wv-data-selection .collapse .ui-accordion-content {+ border: 0;+ padding: 0 0 0.5em 2.5em;+}++.wv-data-unavailable-header {+ color: #eeeeee;+ font-size: 12pt;+ font-weight: bold;+ margin-bottom: 10px;+}++#wv-data-selection-notice {width: 80%;margin: 0 auto;- border: 1px solid #ccccff;border-radius: 5px;- background-color: #ddddff;+ background-color: #eee;padding: 5px;}-#DataDownload_Notice .icon {+#wv-data-selection-notice .icon {+ color: #404040;width: 32px;height: 32px;float: left;}-#DataDownload_Notice .text {- padding-left: 42px;- color: #000000;-}--#DataDownload_Notice .text a {- color: #202070;+#wv-data-selection-notice .text {+ margin-left: 47px;+ color: #404040;}-#DataDownload_DownloadListPanel div.wget {- float: right;+#wv-data-selection-notice .text a {+ color: #444;}-#DataDownload_SelectionListPanel .bd {- background-color: rgb(25, 28, 32);- overflow: auto;- padding: 10px;- color: #FFFBE7;+#wv-data-selection-notice .text a:hover {+ color: #24d;}+/*#DataDownload_GranuleList .button {width: 16px;height: 16px;}+*/-#DataDownload_GranuleList table {+#wv-data-list table {width: 100%;}-#DataDownload_GranuleList td {+#wv-data-list td {padding: 3px;}-#DataDownload_GranuleList tr:nth-child(even) {+#wv-data-list tr:nth-child(even) {background-color: rgb(45, 48, 52);}diff --git a/src/css/wv.main.css b/src/css/wv.main.cssindex f0723f7d0..be23a4f05 100644--- a/src/css/wv.main.css+++ b/src/css/wv.main.css@@ -228,12 +228,12 @@ div.horizontalContainer {width:100%; display:block; float:left; position:absolucolor: #eeeeee;}-.ui-button:hover {+.ui-button:hover:enabled {background: #eeeeee;color: #404040;}-.ui-button:active {+.ui-button:active:enabled {border: 1px solid #808080;background: #808080;}@@ -267,6 +267,7 @@ div.horizontalContainer {width:100%; display:block; float:left; position:absolu.ui-dialog .ui-dialog-content {background: rgba(0, 0, 0, 0.7);+ padding-top: 15px;}.ui-state-active {@@ -281,20 +282,25 @@ div.horizontalContainer {width:100%; display:block; float:left; position:absolucolor: #000;}-#wv-dialog a {- /*color: #82cdfa;*/+a:hover {+ color: #8cf;}-#wv-dialog a:hover {- color: #82cdfa;+.ui-accordion .ui-accordion-content {+ background: rgba(0, 0, 0, 0);}-#wv-dialog a:link {- /*font-weight: bold;*/+.error-icon {+ margin-right: 10px;+ vertical-align: middle;}-#wv-dialog a:visited {- /*font-weight: bold;*/+.error-header {+ margin-top: 5px;+}++.error-body {+ margin-top: 10px;}#wv-dialog h3 {diff --git a/src/js/data/wv.data.ui.js b/src/js/data/wv.data.ui.jsindex bcf16bdf5..412bc39f7 100644--- a/src/js/data/wv.data.ui.js+++ b/src/js/data/wv.data.ui.js@@ -14,9 +14,6 @@ wv.data = wv.data || {};wv.data.ui = wv.data.ui || function(models, ui, config) {- var HTML_WIDGET_INACTIVE = "<img src='images/camera.png'></img>";- var HTML_WIDGET_ACTIVE = "<img src='images/cameraon.png'></img>";-var queryActive = false;var list = null;var model = models.data;@@ -27,8 +24,8 @@ wv.data.ui = wv.data.ui || function(models, ui, config) {var maps = models.map.maps;var self = {};- self.selector = "#DataDownload";- self.id = "DataDownload";+ self.selector = "#wv-data";+ self.id = "wv-data";var init = function() {model.events@@ -59,7 +56,7 @@ wv.data.ui = wv.data.ui || function(models, ui, config) {.addClass(self.id + "list").addClass("bank");var $actionButton = $("<button></button>")- .attr("id", "DataDownload_Button")+ .attr("id", "wv-data-download-button").addClass("action").attr("type", "button").attr("value", "")@@ -71,7 +68,7 @@ wv.data.ui = wv.data.ui || function(models, ui, config) {.attr("id", self.id + "content").addClass("content");$container.append($list);- $("#DataDownload_Button").button();+ $("#wv-data-download-button").button();self.refresh();};@@ -280,8 +277,8 @@ wv.data.ui = wv.data.ui || function(models, ui, config) {wv.ui.indicator.hide();if ( status !== "abort" ) {console.error("Unable to search", status, error);- wv.ui.notify("Unable to search at this time. Please try " +- "again later");+ wv.ui.notify("Unable to search at this time.<br/><br/>Please try " ++ "again later.");}};@@ -295,7 +292,7 @@ wv.data.ui = wv.data.ui || function(models, ui, config) {};var updateSelection = function() {- $button = $("#DataDownload_Button");+ $button = $("#wv-data-download-button");var selected = _.size(model.selectedGranules);if ( selected > 0 ) {$button.button("enable");@@ -342,22 +339,12 @@ wv.data.ui = wv.data.ui || function(models, ui, config) {};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);+ var headerMsg = "<h3 class='wv-data-unavailable-header'>Why are these layers not available for downloading?</h3>";+ var 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.';++ wv.ui.notify(headerMsg + bodyMsg, {+ width: 600,+ height: 275});};@@ -495,8 +482,8 @@ wv.data.ui.downloadListPanel = function(config, model) {var echo = wv.data.echo;var NOTICE =- "<div id='DataDownload_Notice'>" +- "<img class='icon' src='images/info-icon-blue.svg'>" ++ "<div id='wv-data-selection-notice'>" ++ "<i class='icon fa fa-info-circle fa-3x'></i>" +"<p class='text'>" +"Some items you have selected require an account with the " +"EOSDIS User Registration System (URS) to download. " +@@ -506,79 +493,67 @@ wv.data.ui.downloadListPanel = function(config, model) {"</p>" +"</div>";- var panel = null;var selection;var self = {};var urs = false;+ var $dialog;self.events = wv.util.events();self.show = function() {- $("#DataDownload_DownloadListPanel .remove").off("click", removeGranule);- $("#DataDownload_DownloadListPanel a.wget").off("click", showWgetPage);- $("#DataDownload_DownloadListPanel a.curl").off("click", showCurlPage);- $("#DataDownload_DownloadListPanel tr").off("mouseenter", onHoverOver);- $("#DataDownload_DownloadListPanel tr").off("mouseleave", onHoverOut);-selection = reformatSelection();var newPanel = false;- if ( !panel ) {- newPanel = true;- panel = new YAHOO.widget.Panel("DataDownload_DownloadListPanel", {- width: "650px",- height: "500px",- zIndex: 1020,- visible: false,- constraintoviewport: true- });- panel.setHeader("Download Links");- }- panel.setBody(bodyText(selection));- panel.setFooter(bulkDownloadText());-- if ( newPanel ) {- panel.render(document.body);- panel.show();- panel.center();- panel.hideEvent.subscribe(function() {- setTimeout(dispose, 25);- });- }+ $dialog = wv.ui.getDialog()+ .attr("id", "wv-data-selection")+ .html(bodyText(selection));+ $dialog.dialog({+ title: "Download links",+ width: 600,+ height: 400+ });- $("#DataDownload_DownloadListPanel a.wget").click(showWgetPage);- $("#DataDownload_DownloadListPanel a.curl").click(showCurlPage);- $("#DataDownload_DownloadListPanel .remove").click(removeGranule);- $("#DataDownload_DownloadListPanel tr").on("mouseenter", onHoverOver);- $("#DataDownload_DownloadListPanel tr").on("mouseleave", onHoverOut);+ $("#wv-data-selection a.wget").click(showWgetPage);+ $("#wv-data-selection a.curl").click(showCurlPage);+ $("#wv-data-selection .remove").click(removeGranule);+ $("#wv-data-selection tr").on("mouseenter", onHoverOver);+ $("#wv-data-selection tr").on("mouseleave", onHoverOut);var bulkVisible = isBulkDownloadable() &&_.size(model.selectedGranules) !== 0;if ( bulkVisible ) {- $("#DataDownload_DownloadListPanel .ft .bulk")+ $("#wv-data-selection .ft .bulk").css("visibility", "visible");} else {- $("#DataDownload_DownloadListPanel .ft .bulk")+ $("#wv-data-selection .ft .bulk").css("visibility", "hidden");}++ $dialog.find(".collapse").accordion({+ collapsible: true,+ active: false,+ icons: {+ header: "fa fa-caret-right fa-fw",+ activeHeader: "fa fa-caret-down fa-fw"+ }+ });};self.hide = function() {- if ( panel ) {- panel.hide();+ var $d = $(".ui-dialog");+ if ( $d.length !== 0 ) {+ $d.hide();}};self.visible = function() {- return panel !== null;+ var $d = $(".ui-dialog");+ if ( $d.length !== 0 ) {+ return $d.is(":visible");+ }+ return false;};var dispose = function() {- $("#DataDownload_DownloadListPanel .remove").off("click", removeGranule);- $("#DataDownload_DownloadListPanel a.wget").off("click", showWgetPage);- $("#DataDownload_DownloadListPanel a.curl").off("click", showCurlPage);- $("#DataDownload_DownloadListPanel tr").off("mouseenter", onHoverOver);- $("#DataDownload_DownloadListPanel tr").off("mouseleave", onHoverOut);-self.events.trigger("close");panel.destroy();panel = null;@@ -695,7 +670,7 @@ wv.data.ui.downloadListPanel = function(config, model) {elements.push("<ul>");$.each(links, function(index, link) {elements.push(- "<li><a href='" + link.href + "' target='_blank'>" ++ "<li class='link'><a href='" + link.href + "' target='_blank'>" +link.title + "</a></li>");});elements.push("</ul>");@@ -732,21 +707,23 @@ wv.data.ui.downloadListPanel = function(config, model) {"<h3>" + product.name + "</h3>"];- elements.push("<h5>Selected Data</h5>");- elements.push("<table>");-- $.each(product.list, function(index, item) {- elements.push(granuleText(product, item));- });- elements.push("</table>");-if ( product.links && product.links.length > 0 ) {+ elements.push("<div class='collapse'>");elements.push("<h5>Data Collection Information</h5>");elements.push("<div class='product'>");elements.push(linksText(product.links));elements.push("</div>");+ elements.push("</div>");}+ //elements.push("<h5>Selected Data</h5>");+ elements.push("<table>");++ $.each(product.list, function(index, item) {+ elements.push(granuleText(product, item));+ });+ elements.push("</table>");+return elements.join("\n");};@@ -758,18 +735,22 @@ wv.data.ui.downloadListPanel = function(config, model) {if ( urs ) {elements.push(NOTICE);}+ if ( isBulkDownloadable() ) {+ elements.push(bulkDownloadText());+ }+ var products = [];$.each(selection, function(key, product) {- elements.push("\n<br/>\n" + productText(product));+ products.push(productText(product));});-- var text = elements.join("\n<br/>\n") + "<br/>";+ elements.push(products.join("<br/>"));+ var text = elements.join("");return text;};var bulkDownloadText = function() {var bulk =- "<div class='bulk'>" +- "<h4>Bulk Download</h4>" ++ "<div class='bulk collapse'>" ++ "<h5>Bulk Download</h5>" +"<ul class='BulkDownload'>" +"<li><a class='wget' href='#'>List of Links:</a> " +"for wget or download managers that accept a list of " +@@ -813,62 +794,58 @@ wv.data.ui.downloadListPanel = function(config, model) {wv.data.ui.selectionListPanel = function(model, results) {- var panel = null;var self = {};var granules = {};+ var $dialog;var init = function() {model.events.on("granuleUnselect", onGranuleUnselect);};self.show = function() {- panel = new YAHOO.widget.Panel("DataDownload_SelectionListPanel", {- width: "400px",- height: "400px",- zIndex: 1020,- visible: false,- close: false,- constraintoviewport: true- });- panel.setHeader("Select data");-- panel.setBody(bodyText());- panel.render(document.body);- panel.show();- panel.center();- panel.hideEvent.subscribe(function() {- setTimeout(dispose, 25);- });-+ $dialog = wv.ui.getDialog();+ $dialog+ .attr("id", "wv-data-list")+ .html(bodyText())+ .dialog({+ title: "Select data",+ width: 400,+ height: 400+ });$.each(results.granules, function(index, granule) {granules[granule.id] = granule;});- $("#DataDownload_GranuleList input").on("click", toggleSelection);+ $("#wv-data-list input").on("click", toggleSelection);};self.hide = function() {- if ( panel ) {- panel.hide();+ var $d = $(".ui-dialog");+ if ( $d.length !== 0 ) {+ $d.hide();}};self.visible = function() {- return panel !== null;+ var $d = $(".ui-dialog");+ if ( $d.length !== 0 ) {+ return $d.is(":visible");+ }+ return false;};self.setVisible = function(value) {if ( !value ) {- $("#DataDownload_SelectionListPanel").hide();+ self.hide();} else {- $("#DataDownload_SelectionListPanel").show();+ self.show();}};var dispose = function() {panel.destroy();panel = null;- $("#DataDownload_GranuleList input").off("click", toggleSelection);+ $("#wv-data-selection_GranuleList input").off("click", toggleSelection);};var resultsText = function() {@@ -891,7 +868,7 @@ wv.data.ui.selectionListPanel = function(model, results) {var bodyText = function() {var elements = [- "<div id='DataDownload_GranuleList'>",+ "<div'>","<table>",resultsText(),"</table>",@@ -912,7 +889,7 @@ wv.data.ui.selectionListPanel = function(model, results) {};var onGranuleUnselect = function(granule) {- $("#DataDownload_GranuleList input[value='" + granule.id + "']")+ $("#wv-data-list input[value='" + granule.id + "']").removeAttr("checked");};diff --git a/src/js/layers/wv.layers.sidebar.js b/src/js/layers/wv.layers.sidebar.jsindex 6c0d95f03..6ed4dd82e 100644--- a/src/js/layers/wv.layers.sidebar.js+++ b/src/js/layers/wv.layers.sidebar.js@@ -143,7 +143,7 @@ wv.layers.sidebar = wv.layers.sidebar || function(models) {$container.append($("<div id='products'></div>")).append($("<div id='selectorbox'></div>"))- .append($("<div id='DataDownload'></div>"));+ .append($("<div id='wv-data'></div>"));$container.tabs({hide: { effect: "fade", duration: 200 },diff --git a/src/js/ui/wv.ui.js b/src/js/ui/wv.ui.jsindex e9b8ba584..08921d99b 100644--- a/src/js/ui/wv.ui.js+++ b/src/js/ui/wv.ui.js@@ -37,27 +37,20 @@ wv.ui = (function(self) {self.error = function() {console.error.apply(console, arguments);- if ( window.YAHOO && window.YAHOO.widget &&- window.YAHOO.widget.Panel ) {- o = new YAHOO.widget.Panel("WVerror", {- width: "300px",- zIndex: 1020,- visible: false,- constraintoviewport: true- });- o.setHeader('Error');- o.setBody("An unexpected error has occurred.<br/><br/>" +- "Please reload the page and try again. If you " +- "continue to have problems, contact us at " +- "<a href='mailto:[email protected]'>" +- "[email protected]</a>");- o.render(document.body);- o.show();- o.center();- o.hideEvent.subscribe(function(i) {- setTimeout(function() {o.destroy();}, 25);- });- }+ self.notify(+ "<div class='error-header'>" ++ "<i class='error-icon fa fa-exclamation-triangle fa-3x'></i>" ++ "An unexpected error has occurred" ++ "</div>" ++ "<div class='error-body'>Please reload the page and try " ++ "again. If you continue to have problems, contact us at " ++ "<a href='mailto:[email protected]'>" ++ "[email protected]</a>" ++ "</div>", {+ title: "Error",+ height: 175+ }+ );};/**@@ -70,12 +63,18 @@ wv.ui = (function(self) {** @param [title="Notice"] {string} Title for the dialog box.*/- self.notify = function(message, title) {+ self.notify = function(message, options) {var $dialog = self.getDialog();+ options = options || {};+ var title = options.title || "Notice";+ var width = options.width || 300;+ var height = options.height || 150;$dialog.html(message).dialog({- title: title || "Notice",+ title: title,show: { effect: "fade" },- hide: { effect: "fade" }+ hide: { effect: "fade" },+ width: width,+ height: height});};@@ -172,14 +171,14 @@ wv.ui = (function(self) {};self.getDialog = function() {- var $dialog = $("#wv-dialog");+ var $dialog = $(".ui-dialog-content");if ( $dialog.length !== 0 ) {if ( $dialog.dialog ) {$dialog.dialog("destroy");}$dialog.remove();}- $dialog = $("<div></div>").attr("id", "wv-dialog");+ $dialog = $("<div data-boo='yeah'></div>");$("body").append($dialog);return $dialog;};