Don't encode notifications with content.raw flag, and redirect embedded links to...
authorJan Schneider <jan@horde.org>
Mon, 17 May 2010 22:38:37 +0000 (00:38 +0200)
committerJan Schneider <jan@horde.org>
Mon, 17 May 2010 23:35:44 +0000 (01:35 +0200)
kronolith/js/kronolith.js

index 52beeff..1d5d214 100644 (file)
@@ -212,12 +212,16 @@ KronolithCore = {
             case 'horde.warning':
             case 'horde.message':
             case 'horde.success':
-                this.Growler.growl(m.message.escapeHTML(), {
-                    className: m.type.replace('.', '-'),
-                    life: 8,
-                    log: true,
-                    sticky: m.type == 'horde.error'
-                });
+                this.Growler.growl(
+                    m.flags.include('content.raw')
+                        ? m.message.replace(/<a href="([^"]+)"/, '<a href="#" onclick="KronolithCore.iframeContent(\'$1\')"')
+                        : m.message.escapeHTML(),
+                    {
+                        className: m.type.replace('.', '-'),
+                        life: 8,
+                        log: true,
+                        sticky: m.type == 'horde.error'
+                    });
                 var notify = $('kronolithNotifications'),
                     className = m.type.replace(/\./, '-'),
                     order = 'horde-error,horde-warning,horde-message,horde-success,kronolithNotifications',