From: Jan Schneider Date: Mon, 29 Nov 2010 17:01:26 +0000 (+0100) Subject: Finish display of notification messages. Embedded HTML doesn't work well yet. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=78d3eb59161010091dc54896579fae404ac8e8e0;p=horde.git Finish display of notification messages. Embedded HTML doesn't work well yet. --- diff --git a/horde/js/mobile.js b/horde/js/mobile.js index 116aa622b..6edfb0ae5 100644 --- a/horde/js/mobile.js +++ b/horde/js/mobile.js @@ -68,13 +68,40 @@ $.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 = $('
  • '); + if (m.flags && $.inArray('content.raw', m.flags) != -1) { + // TODO: This needs some fixing: + li.html(m.message.replace('
    +
      +
    \ No newline at end of file diff --git a/kronolith/templates/mobile/notice.html.php b/kronolith/templates/mobile/notice.html.php index b00cab50e..97113461f 100644 --- a/kronolith/templates/mobile/notice.html.php +++ b/kronolith/templates/mobile/notice.html.php @@ -3,5 +3,7 @@

    +
      +
    \ No newline at end of file