summaryrefslogtreecommitdiffstats
path: root/static
diff options
context:
space:
mode:
authortoshio <toshio@mm3test.fedoraproject.org>2012-03-12 23:27:56 +0000
committertoshio <toshio@mm3test.fedoraproject.org>2012-03-12 23:27:56 +0000
commit1c4f1cb5a0332a1fcc4d2fa8cf908f029cf23594 (patch)
tree53779390ff498842d2b919da62182fe582d4d0ca /static
downloadhyperkitty-1c4f1cb5a0332a1fcc4d2fa8cf908f029cf23594.tar.gz
hyperkitty-1c4f1cb5a0332a1fcc4d2fa8cf908f029cf23594.tar.xz
hyperkitty-1c4f1cb5a0332a1fcc4d2fa8cf908f029cf23594.zip
Import the initial version of the hyperkitty archiver
Diffstat (limited to 'static')
-rw-r--r--static/css/stats.css124
-rw-r--r--static/css/style.css324
-rw-r--r--static/img/discussion.pngbin0 -> 514 bytes
-rw-r--r--static/img/email_bg.pngbin0 -> 541 bytes
-rw-r--r--static/img/like.pngbin0 -> 915 bytes
-rw-r--r--static/img/likealot.pngbin0 -> 912 bytes
-rw-r--r--static/img/neutral.pngbin0 -> 895 bytes
-rw-r--r--static/img/newthread.pngbin0 -> 6161 bytes
-rw-r--r--static/img/notsaved.pngbin0 -> 671 bytes
-rw-r--r--static/img/participant.pngbin0 -> 675 bytes
-rw-r--r--static/img/saved.pngbin0 -> 700 bytes
-rw-r--r--static/img/show_discussion.pngbin0 -> 3368 bytes
-rw-r--r--static/img/youdislike.pngbin0 -> 400 bytes
-rw-r--r--static/img/youlike.pngbin0 -> 498 bytes
-rw-r--r--static/jquery.expander.js382
15 files changed, 830 insertions, 0 deletions
diff --git a/static/css/stats.css b/static/css/stats.css
new file mode 100644
index 0000000..cd39079
--- /dev/null
+++ b/static/css/stats.css
@@ -0,0 +1,124 @@
+h2 {
+ margin-top: 0px;
+ padding-top: 10px;
+}
+/* Add icons to some text */
+.neutral {
+ background: url("../img/neutral.png") no-repeat scroll left;
+ padding-left: 20px;
+ padding-right: 20px;
+ font-weight: bold;
+}
+
+.like {
+ background: url("../img/like.png") no-repeat scroll left;
+ padding-left: 20px;
+ padding-right: 20px;
+ font-weight: bold;
+}
+
+.likealot {
+ background: url("../img/likealot.png") no-repeat scroll left;
+ padding-left: 20px;
+ padding-right: 20px;
+ font-weight: bold;
+}
+
+/* The content section of the page */
+.content {
+ width: 90%;
+ margin: auto;
+}
+
+#top_discussion {
+ width: 45%;
+ margin-right: 22px;
+}
+
+#discussion_by_topic {
+ width: 45%;
+ margin-top: 20px;
+ margin-right: 22px;
+}
+
+#most_active {
+ float: right;
+ width: 45%;
+}
+
+#discussion_marker {
+ float: right;
+ width: 45%;
+ margin-top: 20px;
+}
+
+.thread {
+ white-space: nowrap;
+}
+
+.thread * {
+ white-space: normal;
+}
+
+.thread_id {
+ font-weight: bold;
+ font-size: 125%;
+ color: rgb(102, 102, 102);
+ vertical-align: top;
+ padding-right: 10px;
+}
+
+.thread_title{
+ padding-right:20px;
+ color: rgb(102, 102, 102);
+ display: inline-block;
+}
+
+.thread_stats ul li {
+ margin-right:20px;
+}
+
+.category {
+ font-variant: small-caps;
+ font-weight: bold;
+ color: white;
+ -webkit-border-radius: 5px 5px 5px 5px;
+ -moz-border-radius: 5px 5px 5px 5px;
+ border-radius: 5px 5px 5px 5px;
+ vertical-align: top;
+ margin-bottom: 10px;
+ padding-top: 0px;
+ padding-left: 10px;
+}
+
+.category_entry {
+ list-style-type: circle;
+ margin-top: 0px;
+ padding-bottom: 10px;
+ padding-left: 25px;
+}
+
+.category_entry li {
+ padding-bottom: 10px;
+}
+
+.maker {
+ color: rgb(102, 102, 102);
+ padding-right: 10px;
+ padding-bottom: 20px;
+}
+
+.maker_id, .marker_name{
+ font-weight: bold;
+ font-size: 125%;
+ vertical-align: top;
+ padding-right: 20px;
+}
+
+.gravatar {
+ padding-right: 20px;
+}
+
+.score{
+ font-weight: bold;
+}
diff --git a/static/css/style.css b/static/css/style.css
new file mode 100644
index 0000000..00e46d8
--- /dev/null
+++ b/static/css/style.css
@@ -0,0 +1,324 @@
+
+@import url(http://fonts.googleapis.com/css?family=Droid+Sans);
+
+/* Generic classes */
+body {
+ margin: 0;
+ padding: 0;
+ font-family: 'Droid Sans', sans-serif;
+ color: rgb(77, 77, 77);
+}
+
+a {
+ color: rgb(55, 113, 200);
+ text-decoration: none;
+}
+
+.right {
+ text-align: right;
+}
+
+.inline-block {
+ display: inline-block;
+}
+
+.inline li, .inline-block li {
+ display: inline-block;
+ list-style-type: none;
+}
+
+/* Add icons to some text */
+.participant {
+ background: url("../img/participant.png") no-repeat scroll left top;
+ padding-left: 20px;
+}
+
+.discussion {
+ background: url("../img/discussion.png") no-repeat scroll left top;
+ padding-left: 20px;
+}
+
+.saved {
+ background: url("../img/saved.png") no-repeat scroll left top;
+ padding-left: 20px;
+}
+
+.notsaved {
+ background: url("../img/notsaved.png") no-repeat scroll left top;
+ padding-left: 20px;
+}
+
+.gravatar {
+ vertical-align: top;
+ width:40px;
+ font-size: 70%;
+}
+
+.gravatar img {
+ width: 40px;
+}
+
+.neutral {
+ background: url("../img/neutral.png") no-repeat scroll left;
+ padding-left: 20px;
+ padding-right: 20px;
+ font-weight: bold;
+}
+
+.like {
+ background: url("../img/like.png") no-repeat scroll left;
+ padding-left: 20px;
+ padding-right: 20px;
+ font-weight: bold;
+}
+
+.likealot {
+ background: url("../img/likealot.png") no-repeat scroll left;
+ padding-left: 20px;
+ padding-right: 20px;
+ font-weight: bold;
+}
+
+.youlike {
+ background: url("../img/youlike.png") no-repeat scroll left;
+ padding-left: 15px;
+ padding-right: 5px;
+}
+
+.youdislike {
+ background: url("../img/youdislike.png") no-repeat scroll left;
+ padding-left: 15px;
+ padding-right: 5px;
+}
+
+.showdiscussion {
+ background-image: linear-gradient(bottom, rgb(204,204,204) 11%, rgb(255,255,255) 100%);
+ background-image: -o-linear-gradient(bottom, rgb(204,204,204) 11%, rgb(255,255,255) 100%);
+ background-image: -moz-linear-gradient(bottom, rgb(204,204,204) 11%, rgb(255,255,255) 100%);
+ background-image: -webkit-linear-gradient(bottom, rgb(204,204,204) 11%, rgb(255,255,255) 100%);
+ background-image: -ms-linear-gradient(bottom, rgb(204,204,204) 11%, rgb(255,255,255) 100%);
+ background-image: -webkit-gradient(
+ linear,
+ left bottom,
+ left top,
+ color-stop(0.11, rgb(204,204,204)),
+ color-stop(1, rgb(255,255,255))
+ );
+ padding: 3px 7px 3px 7px;
+ -webkit-border-radius: 5px 5px 5px 5px;
+ -moz-border-radius: 5px 5px 5px 5px;
+ border-radius: 5px 5px 5px 5px;
+ border-style: solid;
+ border-width: 1px;
+ border-color: rgb(179, 179, 179);
+}
+
+.showdiscussion a {
+ color: rgb(77, 77, 77);
+}
+
+
+/* Top of the page -- header */
+.header {
+ background-color: rgb(236, 236, 236);
+ padding: 0;
+}
+
+.header ul {
+ padding: 0;
+ margin: 0;
+}
+
+.header hr{
+ color: rgb(204, 204, 204);
+ background-color: rgb(204, 204, 204);
+ border: 0 none;
+ margin-top: 0px;
+}
+
+#white {
+ color: rgb(255, 255, 255);
+ background-color: rgb(255, 255, 255);
+ margin-bottom: 0px;
+}
+
+#headline {
+ padding-left: 20px;
+ position: relative;
+}
+
+#top_right {
+ position: absolute;
+ right: 20px;
+ bottom: 0;
+ color: rgb(102, 102, 102);
+}
+
+#top_right li {
+ margin-left:10px;
+}
+
+#list_name {
+ font-size: 200%;
+ font-weight: bold;
+}
+
+#list_name a {
+ color: rgb(77, 77, 77);
+}
+
+#page_date {
+ font-size: 150%;
+}
+
+#list_email {
+ font-size:80%;
+ padding: 0 0 0 20px;
+ margin: 0;
+}
+
+#searchbox {
+ text-align:right;
+ padding-right: 20px;
+}
+
+#searchbox input {
+ width: 250px
+}
+
+#searchbox input::-webkit-input-placeholder {
+ font-style: italic;
+}
+
+#searchbox input:-moz-placeholder {
+ font-style: italic;
+}
+
+#newthread {
+ padding-left: 20px;
+}
+
+/* The content section of the page */
+.content {
+ width: 1024px;
+ margin: auto;
+}
+
+/* Thread list */
+
+.thread_title {
+ font-weight: bold;
+ font-size: 125%;
+}
+
+.thread_date {
+ font-style: italic;
+ font-size: 70%;
+ color: rgb(128, 0, 0);
+}
+
+.thread_content {
+ margin-top:10px;
+}
+
+.thread_email {
+}
+
+.thread_info {
+ text-align:right;
+ padding-right: 50px;
+}
+
+.tags {
+ text-align:left;
+ margin: 0px 0px 0px 200px;
+ padding: 0px;
+}
+
+/* Part containing the body of the mail which can be shown/hidden */
+.expander {
+ width: 768px;
+ background-image: linear-gradient(bottom, rgb(236,236,236) 11%, rgb(255,255,255) 100%);
+ background-image: -o-linear-gradient(bottom, rgb(236,236,236) 11%, rgb(255,255,255) 100%);
+ background-image: -moz-linear-gradient(bottom, rgb(236,236,236) 11%, rgb(255,255,255) 100%);
+ background-image: -webkit-linear-gradient(bottom, rgb(236,236,236) 11%, rgb(255,255,255) 100%);
+ background-image: -ms-linear-gradient(bottom, rgb(236,236,236) 11%, rgb(255,255,255) 100%);
+
+ background-image: -webkit-gradient(
+ linear,
+ left bottom,
+ left top,
+ color-stop(0.11, rgb(236,236,236)),
+ color-stop(1, rgb(255,255,255))
+ );
+ border-style: solid;
+ border-width: 1px;
+ border-color: rgb(236,236,236);
+ -webkit-border-radius: 5px 5px 5px 5px;
+ -moz-border-radius: 5px 5px 5px 5px;
+ border-radius: 5px 5px 5px 5px;
+ padding-left: 20px;
+ margin-left: 21px;
+ display: inline-block;
+ vertical-align: top;
+ white-space: pre;
+}
+
+.expander a {
+ float: right;
+ padding: 20px 10px 0px 0px;
+}
+
+/* Thread types */
+.type {
+ font-variant: small-caps;
+ font-weight: bold;
+ color: white;
+ padding: 3px;
+ -webkit-border-radius: 5px 5px 5px 5px;
+ -moz-border-radius: 5px 5px 5px 5px;
+ border-radius: 5px 5px 5px 5px;
+ vertical-align: top;
+ width: 110px;
+ text-align:center;
+}
+
+.type a {
+ color: white;
+}
+
+.type_question {
+ background-color: rgb(179, 128, 255);
+}
+
+.type_agenda {
+ background-color: rgb(42, 127, 255);
+}
+
+.type_todo {
+ background-color: rgb(200, 171, 55);
+}
+
+.type_dead {
+ background-color: rgb(0, 0, 0);
+}
+
+.type_announcement {
+ background-color: rgb(170, 212, 0);
+}
+
+.type_policy {
+ background-color: rgb(200, 55, 171);
+}
+
+.type_test {
+ background-color: rgb(200, 171, 55);
+}
+
+.invisible {
+ visibility: hidden;
+}
+
+.removed {
+ display: none;
+}[
diff --git a/static/img/discussion.png b/static/img/discussion.png
new file mode 100644
index 0000000..26e60d9
--- /dev/null
+++ b/static/img/discussion.png
Binary files differ
diff --git a/static/img/email_bg.png b/static/img/email_bg.png
new file mode 100644
index 0000000..f3ae7b7
--- /dev/null
+++ b/static/img/email_bg.png
Binary files differ
diff --git a/static/img/like.png b/static/img/like.png
new file mode 100644
index 0000000..7406cdd
--- /dev/null
+++ b/static/img/like.png
Binary files differ
diff --git a/static/img/likealot.png b/static/img/likealot.png
new file mode 100644
index 0000000..5ce4b88
--- /dev/null
+++ b/static/img/likealot.png
Binary files differ
diff --git a/static/img/neutral.png b/static/img/neutral.png
new file mode 100644
index 0000000..392f8c7
--- /dev/null
+++ b/static/img/neutral.png
Binary files differ
diff --git a/static/img/newthread.png b/static/img/newthread.png
new file mode 100644
index 0000000..e61b871
--- /dev/null
+++ b/static/img/newthread.png
Binary files differ
diff --git a/static/img/notsaved.png b/static/img/notsaved.png
new file mode 100644
index 0000000..a427a91
--- /dev/null
+++ b/static/img/notsaved.png
Binary files differ
diff --git a/static/img/participant.png b/static/img/participant.png
new file mode 100644
index 0000000..f2d700b
--- /dev/null
+++ b/static/img/participant.png
Binary files differ
diff --git a/static/img/saved.png b/static/img/saved.png
new file mode 100644
index 0000000..b240cd5
--- /dev/null
+++ b/static/img/saved.png
Binary files differ
diff --git a/static/img/show_discussion.png b/static/img/show_discussion.png
new file mode 100644
index 0000000..f7f42f1
--- /dev/null
+++ b/static/img/show_discussion.png
Binary files differ
diff --git a/static/img/youdislike.png b/static/img/youdislike.png
new file mode 100644
index 0000000..0c6387b
--- /dev/null
+++ b/static/img/youdislike.png
Binary files differ
diff --git a/static/img/youlike.png b/static/img/youlike.png
new file mode 100644
index 0000000..affe451
--- /dev/null
+++ b/static/img/youlike.png
Binary files differ
diff --git a/static/jquery.expander.js b/static/jquery.expander.js
new file mode 100644
index 0000000..9eabab4
--- /dev/null
+++ b/static/jquery.expander.js
@@ -0,0 +1,382 @@
+/*!
+ * jQuery Expander Plugin v1.4
+ *
+ * Date: Sun Dec 11 15:08:42 2011 EST
+ * Requires: jQuery v1.3+
+ *
+ * Copyright 2011, Karl Swedberg
+ * Dual licensed under the MIT and GPL licenses (just like jQuery):
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ *
+ *
+ *
+*/
+
+(function($) {
+ $.expander = {
+ version: '1.4',
+ defaults: {
+ // the number of characters at which the contents will be sliced into two parts.
+ slicePoint: 100,
+
+ // whether to keep the last word of the summary whole (true) or let it slice in the middle of a word (false)
+ preserveWords: true,
+
+ // a threshold of sorts for whether to initially hide/collapse part of the element's contents.
+ // If after slicing the contents in two there are fewer words in the second part than
+ // the value set by widow, we won't bother hiding/collapsing anything.
+ widow: 4,
+
+ // text displayed in a link instead of the hidden part of the element.
+ // clicking this will expand/show the hidden/collapsed text
+ expandText: 'read more',
+ expandPrefix: '&hellip; ',
+
+ expandAfterSummary: false,
+
+ // class names for summary element and detail element
+ summaryClass: 'summary',
+ detailClass: 'details',
+
+ // class names for <span> around "read-more" link and "read-less" link
+ moreClass: 'read-more',
+ lessClass: 'read-less',
+
+ // number of milliseconds after text has been expanded at which to collapse the text again.
+ // when 0, no auto-collapsing
+ collapseTimer: 0,
+
+ // effects for expanding and collapsing
+ expandEffect: 'fadeIn',
+ expandSpeed: 250,
+ collapseEffect: 'fadeOut',
+ collapseSpeed: 200,
+
+ // allow the user to re-collapse the expanded text.
+ userCollapse: true,
+
+ // text to use for the link to re-collapse the text
+ userCollapseText: 'read less',
+ userCollapsePrefix: ' ',
+
+
+ // all callback functions have the this keyword mapped to the element in the jQuery set when .expander() is called
+
+ onSlice: null, // function() {}
+ beforeExpand: null, // function() {},
+ afterExpand: null, // function() {},
+ onCollapse: null // function(byUser) {}
+ }
+ };
+
+ $.fn.expander = function(options) {
+ var meth = 'init';
+
+ if (typeof options == 'string') {
+ meth = options;
+ options = {};
+ }
+
+ var opts = $.extend({}, $.expander.defaults, options),
+ rSelfClose = /^<(?:area|br|col|embed|hr|img|input|link|meta|param).*>$/i,
+ rAmpWordEnd = /(&(?:[^;]+;)?|\w+)$/,
+ rOpenCloseTag = /<\/?(\w+)[^>]*>/g,
+ rOpenTag = /<(\w+)[^>]*>/g,
+ rCloseTag = /<\/(\w+)>/g,
+ rLastCloseTag = /(<\/[^>]+>)\s*$/,
+ rTagPlus = /^<[^>]+>.?/,
+ delayedCollapse;
+
+ var methods = {
+ init: function() {
+ this.each(function() {
+ var i, l, tmp, summTagLess, summOpens, summCloses, lastCloseTag, detailText,
+ $thisDetails, $readMore,
+ openTagsForDetails = [],
+ closeTagsForsummaryText = [],
+ defined = {},
+ thisEl = this,
+ $this = $(this),
+ $summEl = $([]),
+ o = $.meta ? $.extend({}, opts, $this.data()) : opts,
+ hasDetails = !!$this.find('.' + o.detailClass).length,
+ hasBlocks = !!$this.find('*').filter(function() {
+ var display = $(this).css('display');
+ return (/^block|table|list/).test(display);
+ }).length,
+ el = hasBlocks ? 'div' : 'span',
+ detailSelector = el + '.' + o.detailClass,
+ moreSelector = 'span.' + o.moreClass,
+ expandSpeed = o.expandSpeed || 0,
+ allHtml = $.trim( $this.html() ),
+ allText = $.trim( $this.text() ),
+ summaryText = allHtml.slice(0, o.slicePoint);
+
+ // bail out if we've already set up the expander on this element
+ if ( $.data(this, 'expander') ) {
+ return;
+ }
+ $.data(this, 'expander', true);
+
+ // determine which callback functions are defined
+ $.each(['onSlice','beforeExpand', 'afterExpand', 'onCollapse'], function(index, val) {
+ defined[val] = $.isFunction(o[val]);
+ });
+
+ // back up if we're in the middle of a tag or word
+ summaryText = backup(summaryText);
+
+ // summary text sans tags length
+ summTagless = summaryText.replace(rOpenCloseTag, '').length;
+
+ // add more characters to the summary, one for each character in the tags
+ while (summTagless < o.slicePoint) {
+ newChar = allHtml.charAt(summaryText.length);
+ if (newChar == '<') {
+ newChar = allHtml.slice(summaryText.length).match(rTagPlus)[0];
+ }
+ summaryText += newChar;
+ summTagless++;
+ }
+
+ summaryText = backup(summaryText, o.preserveWords);
+
+ // separate open tags from close tags and clean up the lists
+ summOpens = summaryText.match(rOpenTag) || [];
+ summCloses = summaryText.match(rCloseTag) || [];
+
+ // filter out self-closing tags
+ tmp = [];
+ $.each(summOpens, function(index, val) {
+ if ( !rSelfClose.test(val) ) {
+ tmp.push(val);
+ }
+ });
+ summOpens = tmp;
+
+ // strip close tags to just the tag name
+ l = summCloses.length;
+ for (i = 0; i < l; i++) {
+ summCloses[i] = summCloses[i].replace(rCloseTag, '$1');
+ }
+
+ // tags that start in summary and end in detail need:
+ // a). close tag at end of summary
+ // b). open tag at beginning of detail
+ $.each(summOpens, function(index, val) {
+ var thisTagName = val.replace(rOpenTag, '$1');
+ var closePosition = $.inArray(thisTagName, summCloses);
+ if (closePosition === -1) {
+ openTagsForDetails.push(val);
+ closeTagsForsummaryText.push('</' + thisTagName + '>');
+
+ } else {
+ summCloses.splice(closePosition, 1);
+ }
+ });
+
+ // reverse the order of the close tags for the summary so they line up right
+ closeTagsForsummaryText.reverse();
+
+ // create necessary summary and detail elements if they don't already exist
+ if ( !hasDetails ) {
+
+ // end script if there is no detail text or if detail has fewer words than widow option
+ detailText = allHtml.slice(summaryText.length);
+
+ if ( detailText === '' || detailText.split(/\s+/).length < o.widow ) {
+ return;
+ }
+
+ // otherwise, continue...
+ lastCloseTag = closeTagsForsummaryText.pop() || '';
+ summaryText += closeTagsForsummaryText.join('');
+ detailText = openTagsForDetails.join('') + detailText;
+
+ } else {
+ // assume that even if there are details, we still need readMore/readLess/summary elements
+ // (we already bailed out earlier when readMore el was found)
+ // but we need to create els differently
+
+ // remove the detail from the rest of the content
+ detailText = $this.find(detailSelector).remove().html();
+
+ // The summary is what's left
+ summaryText = $this.html();
+
+ // allHtml is the summary and detail combined (this is needed when content has block-level elements)
+ allHtml = summaryText + detailText;
+
+ lastCloseTag = '';
+ }
+ o.moreLabel = $this.find(moreSelector).length ? '' : buildMoreLabel(o);
+
+ if (hasBlocks) {
+ detailText = allHtml;
+ }
+ summaryText += lastCloseTag;
+
+ // onSlice callback
+ o.summary = summaryText;
+ o.details = detailText;
+ o.lastCloseTag = lastCloseTag;
+
+ if (defined.onSlice) {
+ // user can choose to return a modified options object
+ // one last chance for user to change the options. sneaky, huh?
+ // but could be tricky so use at your own risk.
+ tmp = o.onSlice.call(thisEl, o);
+
+ // so, if the returned value from the onSlice function is an object with a details property, we'll use that!
+ o = tmp && tmp.details ? tmp : o;
+ }
+
+ // build the html with summary and detail and use it to replace old contents
+ var html = buildHTML(o, hasBlocks);
+
+ $this.html( html );
+
+ // set up details and summary for expanding/collapsing
+ $thisDetails = $this.find(detailSelector);
+ $readMore = $this.find(moreSelector);
+ $thisDetails.hide();
+ $readMore.find('a').unbind('click.expander').bind('click.expander', expand);
+
+ $summEl = $this.find('div.' + o.summaryClass);
+
+ if ( o.userCollapse && !$this.find('span.' + o.lessClass).length ) {
+ $this
+ .find(detailSelector)
+ .append('<span class="' + o.lessClass + '">' + o.userCollapsePrefix + '<a href="#">' + o.userCollapseText + '</a></span>');
+ }
+
+ $this
+ .find('span.' + o.lessClass + ' a')
+ .unbind('click.expander')
+ .bind('click.expander', function(event) {
+ event.preventDefault();
+ clearTimeout(delayedCollapse);
+ var $detailsCollapsed = $(this).closest(detailSelector);
+ reCollapse(o, $detailsCollapsed);
+ if (defined.onCollapse) {
+ o.onCollapse.call(thisEl, true);
+ }
+ });
+
+ function expand(event) {
+ event.preventDefault();
+ $readMore.hide();
+ $summEl.hide();
+ if (defined.beforeExpand) {
+ o.beforeExpand.call(thisEl);
+ }
+
+ $thisDetails.stop(false, true)[o.expandEffect](expandSpeed, function() {
+ $thisDetails.css({zoom: ''});
+ if (defined.afterExpand) {o.afterExpand.call(thisEl);}
+ delayCollapse(o, $thisDetails, thisEl);
+ });
+ }
+
+ }); // this.each
+ },
+ destroy: function() {
+ if ( !this.data('expander') ) {
+ return;
+ }
+ this.removeData('expander');
+ this.each(function() {
+ var $this = $(this),
+ o = $.meta ? $.extend({}, opts, $this.data()) : opts,
+ details = $this.find('.' + o.detailClass).contents();
+
+ $this.find('.' + o.moreClass).remove();
+ $this.find('.' + o.summaryClass).remove();
+ $this.find('.' + o.detailClass).after(details).remove();
+ $this.find('.' + o.lessClass).remove();
+
+ });
+ }
+ };
+
+ // run the methods (almost always "init")
+ if ( methods[meth] ) {
+ methods[ meth ].call(this);
+ }
+
+ // utility functions
+ function buildHTML(o, blocks) {
+ var el = 'span',
+ summary = o.summary;
+ if ( blocks ) {
+ el = 'div';
+ // if summary ends with a close tag, tuck the moreLabel inside it
+ if ( rLastCloseTag.test(summary) && !o.expandAfterSummary) {
+ summary = summary.replace(rLastCloseTag, o.moreLabel + '$1');
+ } else {
+ // otherwise (e.g. if ends with self-closing tag) just add moreLabel after summary
+ // fixes #19
+ summary += o.moreLabel;
+ }
+
+ // and wrap it in a div
+ summary = '<div class="' + o.summaryClass + '">' + summary + '</div>';
+ } else {
+ summary += o.moreLabel;
+ }
+
+ return [
+ summary,
+ '<',
+ el + ' class="' + o.detailClass + '"',
+ '>',
+ o.details,
+ '</' + el + '>'
+ ].join('');
+ }
+
+ function buildMoreLabel(o) {
+ var ret = '<span class="' + o.moreClass + '">' + o.expandPrefix;
+ ret += '<a href="#">' + o.expandText + '</a></span>';
+ return ret;
+ }
+
+ function backup(txt, preserveWords) {
+ if ( txt.lastIndexOf('<') > txt.lastIndexOf('>') ) {
+ txt = txt.slice( 0, txt.lastIndexOf('<') );
+ }
+ if (preserveWords) {
+ txt = txt.replace(rAmpWordEnd,'');
+ }
+ return txt;
+ }
+
+ function reCollapse(o, el) {
+ el.stop(true, true)[o.collapseEffect](o.collapseSpeed, function() {
+ var prevMore = el.prev('span.' + o.moreClass).show();
+ if (!prevMore.length) {
+ el.parent().children('div.' + o.summaryClass).show()
+ .find('span.' + o.moreClass).show();
+ }
+ });
+ }
+
+ function delayCollapse(option, $collapseEl, thisEl) {
+ if (option.collapseTimer) {
+ delayedCollapse = setTimeout(function() {
+ reCollapse(option, $collapseEl);
+ if ( $.isFunction(option.onCollapse) ) {
+ option.onCollapse.call(thisEl, false);
+ }
+ }, option.collapseTimer);
+ }
+ }
+
+ return this;
+ };
+
+ // plugin defaults
+ $.fn.expander.defaults = $.expander.defaults;
+})(jQuery);