diff options
| author | niv-openerp <nicolas.vanhoren@openerp.com> | 2012-08-21 11:30:00 +0200 |
|---|---|---|
| committer | niv-openerp <nicolas.vanhoren@openerp.com> | 2012-08-21 11:30:00 +0200 |
| commit | 8d1836bd30f8d06b2da6e36c8b34d250b73847b0 (patch) | |
| tree | 758c20b1d64ef4f5640f808f7fbf8f01c3cd079b /addons/web/static/src | |
| parent | 0404db7742182d2dcd46f4d3319b6fb1ddbad1b3 (diff) | |
[IMP] improved loading messages
bzr revid: nicolas.vanhoren@openerp.com-20120821093000-4jf6lh7a8o124hsd
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/coresetup.js | 25 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 2 |
2 files changed, 26 insertions, 1 deletions
diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index 229a82a1784..a34a7dadd30 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -528,6 +528,14 @@ if ($.blockUI) { $.blockUI.defaults.css["background-color"] = ''; } +var messages_by_seconds = [ + [0, "Loading..."], + [30, "Still Loading..."], + [60, "Still Loading...<br />Please be patient."], + [120, "Hey, guess what?<br />It's still loading."], + [300, "You may not believe it,<br/>but the application is actually loading..."], +]; + instance.web.Throbber = instance.web.Widget.extend({ template: "Throbber", start: function() { @@ -548,6 +556,23 @@ instance.web.Throbber = instance.web.Widget.extend({ left: 'auto' // Left position relative to parent in px }; this.spin = new Spinner(opts).spin(this.$element[0]); + this.start_time = new Date().getTime(); + this.act_message(); + }, + act_message: function() { + var self = this; + setTimeout(function() { + if (self.isDestroyed()) + return; + var seconds = (new Date().getTime() - self.start_time) / 1000; + var mes; + _.each(messages_by_seconds, function(el) { + if (seconds >= el[0]) + mes = el[1]; + }); + self.$(".oe_throbber_message").html(mes); + self.act_message(); + }, 1000); }, destroy: function() { if (this.spin) diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index c91c156a2c4..330a5b3928f 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1736,7 +1736,7 @@ <div class="oe_blockui_spin" style="height: 50px"> </div> <br /> - <div style="color:white">Loading...</div> + <div class="oe_throbber_message" style="color:white"></div> </div> </t> </templates> |
