diff --git a/extensions/gdata/module/scripts/index/gdata-source-ui.js b/extensions/gdata/module/scripts/index/gdata-source-ui.js index a940a3e16..9d3656707 100644 --- a/extensions/gdata/module/scripts/index/gdata-source-ui.js +++ b/extensions/gdata/module/scripts/index/gdata-source-ui.js @@ -59,39 +59,21 @@ Refine.GDataSourceUI.prototype.attachUI = function(body) { self._elmts.signinPage.show(); }); - var importURL1 = function(evt) { - if ($.trim(self._elmts.urlInput1[0].value).length === 0) { - window.alert("You must specify a web address (URL) to import."); + this._elmts.urlNextButton.click(function(evt) { + var url = $.trim(self._elmts.urlInput[0].value); + if (url.length === 0) { + window.alert("You must specify a web address (URL) to import."); } else { - var doc={} - doc.docSelfLink = self._elmts.urlInput1[0].value; - if (doc.docSelfLink.contains('spreadsheet')) { // TODO: fragile? - doc.type = 'spreadsheet'; - } else { - doc.type = 'table'; - } - self._controller.startImportingDocument(doc); - } - } - // TODO: Consolidate these two URL input forms - var importURL2 = function(evt) { - if ($.trim(self._elmts.urlInput2[0].value).length === 0) { - window.alert("You must specify a web address (URL) to import."); - } else { - var doc={} - doc.docSelfLink = self._elmts.urlInput2[0].value; - if (doc.docSelfLink.contains('spreadsheet')) { // TODO: fragile? - doc.type = 'spreadsheet'; - } else { - doc.type = 'table'; - } - self._controller.startImportingDocument(doc); - } - } - - this._elmts.urlNextButton1.click(importURL1); - this._elmts.urlNextButton2.click(importURL2); - + var doc = { isPublic: true }; + doc.docSelfLink = url; + if (doc.docSelfLink.contains('spreadsheet')) { // TODO: fragile? + doc.type = 'spreadsheet'; + } else { + doc.type = 'table'; + } + self._controller.startImportingDocument(doc); + } + }); this._body.find('.gdata-page').hide(); this._elmts.signinPage.show(); diff --git a/extensions/gdata/module/scripts/index/import-from-gdata-form.html b/extensions/gdata/module/scripts/index/import-from-gdata-form.html index e0ab296a8..eb69291d1 100644 --- a/extensions/gdata/module/scripts/index/import-from-gdata-form.html +++ b/extensions/gdata/module/scripts/index/import-from-gdata-form.html @@ -1,31 +1,31 @@
Please - access to your Google data.
- +Import a public Google Spreadsheet or Fusion Table by its URL: | |
+ | + |
Retrieving Google Docs documents ...
+ +Please + access to your Google data.
+Retrieving Google Docs documents ...
++ | with another account | +
Google Docs documents | -with another account | -- |
Click one of the documents below or enter the web address (URL) of a public Google Spreadsheet or Fusion Table and click "Next": | ||
- | - -- | |