Permalink
Browse files

export link now shows up if archive was exported earlier; specified <…

…title> tag for backbone app; several minor improvements to export view
  • Loading branch information...
1 parent d8b348a commit 475edf2f99f6445c2ab84fa571a37fbd81679d95 @trey0 trey0 committed Oct 22, 2012
@@ -67,3 +67,7 @@ input#locationSearch {
margin-left: 0.2em;
}
+#download_link a {
+ font-size: 1.5em;
+ font-weight: bold;
+}
@@ -167,14 +167,13 @@ $(function($) {
model.on('export_ready', function(){this.exportPending = false;}, this);
$.post(request_url, '', function(){
model.fetch({ success: function(){
- /*
- need to discuss how to detect when export is
- complete. note that a successful 200 return from
- a generate export request does *not* indicate the
- export is complete.
-
- model.trigger('export_ready');
- if (options.success) options.success();
+ /* on app engine our request to generate an export
+ gets an immediate response from the server
+ because the actual work is done in the background
+ on a backend instance. thus we'll ignore the
+ server response and detect completion by polling
+ the meta-data url until we see an exportUrl field
+ appear.
*/
} });
}, 'json')
@@ -192,8 +191,8 @@ $(function($) {
model.trigger('export_ready');
return false;
}
- //var timeout = timeout ? 1.5 * timeout : 1000;
- var timeout = 10000;
+ // exponential backoff on polling
+ var timeout = timeout ? 1.5 * timeout : 1000;
console.log("polling overlay: " + timeout);
this.pollTimer = setTimeout(_.bind(pollForExportComplete, this), timeout, model, timeout);
},
@@ -864,17 +864,18 @@ $(function($) {
_.bindAll(this);
},
- template: '<h1>Export Map</h1>'+
- '<h2><a href="#overlay/{{key}}">{{name}}</a><h2>'+
+ template: '<h1>Export Overlay {{name}}</h1>'+
+ '<p>&nbsp;</p>' +
'{{#if exportUrl}}'+
- '<p>Your exported tarball is ready.</p>' +
'<div id="download_link">'+
- '<a href="{{exportUrl}}">Click to Download</a>'+
+ '<a href="{{exportUrl}}">Download Exported Archive</a>'+
'</div>'+
'{{else}}'+
'<div id="export_controls">' +
'{{#if alignedTilesUrl}}' +
- '<span id="export_button"><button id="create_archive">Create Archive</button></span>' +
+ '<span id="export_button"><button id="create_archive">' +
+ 'Create Export Archive (this could take a few minutes)' +
+ '</button></span>' +
'<span id="exportError" style="color:red"></span>' +
'{{else}}' +
'<p>Add at least 2 tiepoint pairs before exporting the aligned image.</p>' +
@@ -907,7 +908,8 @@ $(function($) {
if ( app.currentView === thisView ) this.render();
}, this);
this.$('#create_archive').attr('disabled', true);
- this.$('#export_button').html('<img src="/static/geocamTiePoint/images/loading.gif">');
+ this.$('#export_button').html('<img src="/static/geocamTiePoint/images/loading.gif">' +
+ 'Creating export archive (this could take a few minutes)...');
},
}); //end ExportOverlayView
@@ -2,6 +2,7 @@
{% block head %}
{{ block.super }}
+<title>MapFasten</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<link rel="stylesheet" type="text/css" href="/static/mapFasten/css/base.css"></link>
{% endblock %}

0 comments on commit 475edf2

Please sign in to comment.