From 9c0486b7381f4abb2ab2cf774fa57637b2096e21 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 30 Aug 2011 10:53:51 +0200 Subject: [PATCH] [IMP] move file download API to session, so it can more easily be used for operations other than db backup bzr revid: xmo@openerp.com-20110830085351-puvbzwwru9rbfo14 --- addons/base/static/src/js/chrome.js | 66 +++++++---------------------- addons/base/static/src/js/core.js | 44 +++++++++++++++++++ addons/base/static/src/xml/base.xml | 1 - 3 files changed, 59 insertions(+), 52 deletions(-) diff --git a/addons/base/static/src/js/chrome.js b/addons/base/static/src/js/chrome.js index a4a3b73cc77..972cd7e2b6e 100644 --- a/addons/base/static/src/js/chrome.js +++ b/addons/base/static/src/js/chrome.js @@ -339,62 +339,26 @@ openerp.base.Database = openerp.base.Widget.extend({ } }); }, - wait_for_file: function (token, cleanup) { - var self = this, - cookie_name = 'fileToken', - cookie_length = cookie_name.length; - this.backup_timer = setInterval(function () { - var cookies = document.cookie.split(';'); - for(var i=0; i'}); - // need to detect when the file is done downloading (not used - // yet, but we'll need it to fix the UI e.g. with a throbber - // while dump is being generated), iframe load event only fires - // when the iframe content loads, so we need to go smarter: - // http://geekswithblogs.net/GruffCode/archive/2010/10/28/detecting-the-file-download-dialog-in-the-browser.aspx - var $target = $('#backup-target'), - token = new Date().getTime(); - if (!$target.length) { - $target = $('