Added teamserver picker iframe

This commit is contained in:
benweet 2014-05-11 15:08:21 +01:00
parent d4e10d4590
commit 47f4d89621
2 changed files with 25 additions and 1 deletions

View File

@ -34,6 +34,8 @@ define([
$.ajax({ $.ajax({
url: constants.TEAM_SERVER_URL + 'ping', url: constants.TEAM_SERVER_URL + 'ping',
timeout: constants.AJAX_TIMEOUT timeout: constants.AJAX_TIMEOUT
}).done(function() {
task.chain();
}).fail(function(jqXHR) { }).fail(function(jqXHR) {
var error = { var error = {
code: jqXHR.status, code: jqXHR.status,
@ -75,6 +77,7 @@ define([
timeout: constants.AJAX_TIMEOUT timeout: constants.AJAX_TIMEOUT
}).done(function(data) { }).done(function(data) {
result = data; result = data;
task.chain();
}).fail(function(jqXHR) { }).fail(function(jqXHR) {
var error = { var error = {
code: jqXHR.status, code: jqXHR.status,
@ -116,6 +119,7 @@ define([
}).done(function(data) { }).done(function(data) {
newChangeId = data.newChangeId; newChangeId = data.newChangeId;
changes = data.changes; changes = data.changes;
task.chain();
}).fail(function(jqXHR) { }).fail(function(jqXHR) {
var error = { var error = {
code: jqXHR.status, code: jqXHR.status,
@ -217,6 +221,10 @@ define([
// Add some time for user to choose his files // Add some time for user to choose his files
task.timeout = constants.ASYNC_TASK_LONG_TIMEOUT; task.timeout = constants.ASYNC_TASK_LONG_TIMEOUT;
connect(task); connect(task);
task.onRun(function() {
utils.iframe(constants.TEAM_SERVER_URL + 'index.html#/documentPicker', 800, 600);
task.chain();
});
task.onSuccess(function() { task.onSuccess(function() {
callback(undefined, docs); callback(undefined, docs);
}); });

View File

@ -308,6 +308,22 @@ define([
].join("")); ].join(""));
}; };
utils.iframe = function(url, width, height, css) {
$("<iframe src=\"" + url + "\">")
.attr("id", "remidDialogIframe")
.attr("width", width)
.attr("height", height)
//.attr("scrolling", options.iframeScrolling)
.attr("frameborder", "0")
.css("position", "fixed")
.css(css || {})
//.css("border", options.iframeBorder)
//.css("border-radius", options.iframeBorderRadius)
//.css("background", options.iframeBackground)
//.css("z-index", options.iframeZindex)
.appendTo(document.body);
};
// Shows a dialog to force the user to click a button before opening oauth popup // Shows a dialog to force the user to click a button before opening oauth popup
var redirectCallbackConfirm; var redirectCallbackConfirm;
var redirectCallbackCancel; var redirectCallbackCancel;