$.mobile.pageLoading(true);
},
- showNotifications: function(m)
+ showNotifications: function(msgs)
{
- $.each(m, function(key, msg) {
- if (msg.type == 'horde.ajaxtimeout') {
- HordeMobile.logout(msg.message);
+ if (!msgs.length || HordeMobile.is_logout) {
+ return;
+ }
+
+ var list = $('#horde-notification'), li;
+ list.html('');
+
+ $.each(msgs, function(key, m) {
+ switch (m.type) {
+ case 'horde.ajaxtimeout':
+ HordeMobile.logout(m.message);
+ return false;
+
+ case 'horde.error':
+ case 'horde.warning':
+ case 'horde.message':
+ case 'horde.success':
+ li = $('<li class="' + m.type.replace('.', '-') + '">');
+ if (m.flags && $.inArray('content.raw', m.flags) != -1) {
+ // TODO: This needs some fixing:
+ li.html(m.message.replace('<a href=', '<a rel="external" href='));
+ } else {
+ li.text(m.message);
+ }
+ list.append(li);
+ break;
}
});
+ if (list.html()) {
+ $.mobile.changePage('notification');
+ list.listview('refresh');
+ }
},
logout: function(url)
--- /dev/null
+.horde-message, .horde-success, .horde-warning, .horde-error {
+ padding-left: 40px !important;
+ background-position: 14px center !important;
+ background-repeat: no-repeat !important;
+ color: #fff !important;
+ text-shadow: 0 1px 1px #000 !important;
+}
+.horde-error {
+ background-color: #e81222 !important;
+ background-image: url("graphics/alerts/error.png") !important;
+}
+.horde-message {
+ background-color: #369 !important;
+ background-image: url("graphics/alerts/message.png") !important;
+}
+.horde-success {
+ background-color: #5db110 !important;
+ background-image: url("graphics/alerts/success.png") !important;
+}
+.horde-warning {
+ background-color: #ebe20c !important;
+ background-image: url("graphics/alerts/warning.png") !important;
+ color: #444 !important;
+ text-shadow: 0 1px 1px #f6f6f6 !important;
+}
+.horde-alarm {
+ background-color: orange !important;
+ background-image: url("graphics/alerts/alarm.png") !important;
+}
<h1><?php echo _("Notice")?></h1>
</div>
<div data-role="content" class="ui-body">
+ <ul id="horde-notification" data-role="listview">
+ </ul>
</div>
</div>
\ No newline at end of file
<h1><?php echo _("Notice")?></h1>
</div>
<div data-role="content" class="ui-body">
+ <ul id="horde-notification" data-role="listview">
+ </ul>
</div>
</div>
\ No newline at end of file