#kiwi.theme_relaxed .messages .msg.highlight { background:#D9D9D9; }
+#kiwi.theme_relaxed .messages .msg .media { margin-left:0.5em; }
+#kiwi.theme_relaxed .messages .msg .media .media_close { font-size:0.9em; }
+#kiwi.theme_relaxed .messages .msg .media .media_content { margin:10px 0 0 10px; }
+#kiwi.theme_relaxed .messages .msg .media .media_content img { padding:3px; border:1px solid gray; }
+
#kiwi.theme_relaxed #memberlists {
background-color: #DADADA;
},\r
\r
initialize: function () {\r
+ // Get the URL from the data\r
this.url = this.$el.data('url');\r
},\r
\r
+ // Close the media content and remove it from display\r
close: function () {\r
- this.$el.find('.media_content').remove();\r
+ var that = this;\r
+ this.$content.slideUp('fast', function () {\r
+ that.$content.remove();\r
+ });\r
},\r
\r
+ // Open the media content within its wrapper\r
open: function () {\r
- var $content = $('<div class="media_content"><a class="media_close">[x]</a></div>');\r
- $content.append('<a href="' + this.url + '" target="_blank"><img height="100" src="' + this.url + '" /></a>');\r
+ // Create the content div if we haven't already\r
+ if (!this.$content) {\r
+ this.$content = $('<div class="media_content"><a class="media_close"><i class="icon-chevron-up"></i> Close media</a><br /></div>');\r
+ this.$content.append('<a href="' + this.url + '" target="_blank"><img height="100" src="' + this.url + '" /></a>');\r
+ }\r
\r
- this.$el.append($content);\r
+ // Now show the content if not already\r
+ if (!this.$content.is(':visible')) {\r
+ // Hide it first so the slideDown always plays\r
+ this.$content.hide();\r
+\r
+ // Add the media content and slide it into view\r
+ this.$el.append(this.$content);\r
+ this.$content.slideDown();\r
+ }\r
}\r
\r
}, {\r
\r
- // Build the HTML from a URL\r
+ // Build the closed media HTML from a URL\r
buildHtml: function (url) {\r
var html = '';\r
\r
// Is it an image?\r
if (url.match(/(\.jpe?g|\.gif|\.bmp|\.png)\??$/i)) {\r
- html += '<span class="media" data-url="' + url + '" title="Open Image"><a class="open"><i class="icon-play"></i></a></span>';\r
+ html += '<span class="media" data-url="' + url + '" title="Open Image"><a class="open"><i class="icon-chevron-right"></i></a></span>';\r
}\r
\r
return html;\r