ulalume3@11: /* ulalume3@11: * websupport.js ulalume3@11: * ~~~~~~~~~~~~~ ulalume3@11: * ulalume3@11: * sphinx.websupport utilties for all documentation. ulalume3@11: * ulalume3@11: * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. ulalume3@11: * :license: BSD, see LICENSE for details. ulalume3@11: * ulalume3@11: */ ulalume3@11: ulalume3@11: (function($) { ulalume3@11: $.fn.autogrow = function() { ulalume3@11: return this.each(function() { ulalume3@11: var textarea = this; ulalume3@11: ulalume3@11: $.fn.autogrow.resize(textarea); ulalume3@11: ulalume3@11: $(textarea) ulalume3@11: .focus(function() { ulalume3@11: textarea.interval = setInterval(function() { ulalume3@11: $.fn.autogrow.resize(textarea); ulalume3@11: }, 500); ulalume3@11: }) ulalume3@11: .blur(function() { ulalume3@11: clearInterval(textarea.interval); ulalume3@11: }); ulalume3@11: }); ulalume3@11: }; ulalume3@11: ulalume3@11: $.fn.autogrow.resize = function(textarea) { ulalume3@11: var lineHeight = parseInt($(textarea).css('line-height'), 10); ulalume3@11: var lines = textarea.value.split('\n'); ulalume3@11: var columns = textarea.cols; ulalume3@11: var lineCount = 0; ulalume3@11: $.each(lines, function() { ulalume3@11: lineCount += Math.ceil(this.length / columns) || 1; ulalume3@11: }); ulalume3@11: var height = lineHeight * (lineCount + 1); ulalume3@11: $(textarea).css('height', height); ulalume3@11: }; ulalume3@11: })(jQuery); ulalume3@11: ulalume3@11: (function($) { ulalume3@11: var comp, by; ulalume3@11: ulalume3@11: function init() { ulalume3@11: initEvents(); ulalume3@11: initComparator(); ulalume3@11: } ulalume3@11: ulalume3@11: function initEvents() { ulalume3@11: $('a.comment-close').live("click", function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: hide($(this).attr('id').substring(2)); ulalume3@11: }); ulalume3@11: $('a.vote').live("click", function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: handleVote($(this)); ulalume3@11: }); ulalume3@11: $('a.reply').live("click", function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: openReply($(this).attr('id').substring(2)); ulalume3@11: }); ulalume3@11: $('a.close-reply').live("click", function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: closeReply($(this).attr('id').substring(2)); ulalume3@11: }); ulalume3@11: $('a.sort-option').live("click", function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: handleReSort($(this)); ulalume3@11: }); ulalume3@11: $('a.show-proposal').live("click", function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: showProposal($(this).attr('id').substring(2)); ulalume3@11: }); ulalume3@11: $('a.hide-proposal').live("click", function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: hideProposal($(this).attr('id').substring(2)); ulalume3@11: }); ulalume3@11: $('a.show-propose-change').live("click", function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: showProposeChange($(this).attr('id').substring(2)); ulalume3@11: }); ulalume3@11: $('a.hide-propose-change').live("click", function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: hideProposeChange($(this).attr('id').substring(2)); ulalume3@11: }); ulalume3@11: $('a.accept-comment').live("click", function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: acceptComment($(this).attr('id').substring(2)); ulalume3@11: }); ulalume3@11: $('a.delete-comment').live("click", function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: deleteComment($(this).attr('id').substring(2)); ulalume3@11: }); ulalume3@11: $('a.comment-markup').live("click", function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: toggleCommentMarkupBox($(this).attr('id').substring(2)); ulalume3@11: }); ulalume3@11: } ulalume3@11: ulalume3@11: /** ulalume3@11: * Set comp, which is a comparator function used for sorting and ulalume3@11: * inserting comments into the list. ulalume3@11: */ ulalume3@11: function setComparator() { ulalume3@11: // If the first three letters are "asc", sort in ascending order ulalume3@11: // and remove the prefix. ulalume3@11: if (by.substring(0,3) == 'asc') { ulalume3@11: var i = by.substring(3); ulalume3@11: comp = function(a, b) { return a[i] - b[i]; }; ulalume3@11: } else { ulalume3@11: // Otherwise sort in descending order. ulalume3@11: comp = function(a, b) { return b[by] - a[by]; }; ulalume3@11: } ulalume3@11: ulalume3@11: // Reset link styles and format the selected sort option. ulalume3@11: $('a.sel').attr('href', '#').removeClass('sel'); ulalume3@11: $('a.by' + by).removeAttr('href').addClass('sel'); ulalume3@11: } ulalume3@11: ulalume3@11: /** ulalume3@11: * Create a comp function. If the user has preferences stored in ulalume3@11: * the sortBy cookie, use those, otherwise use the default. ulalume3@11: */ ulalume3@11: function initComparator() { ulalume3@11: by = 'rating'; // Default to sort by rating. ulalume3@11: // If the sortBy cookie is set, use that instead. ulalume3@11: if (document.cookie.length > 0) { ulalume3@11: var start = document.cookie.indexOf('sortBy='); ulalume3@11: if (start != -1) { ulalume3@11: start = start + 7; ulalume3@11: var end = document.cookie.indexOf(";", start); ulalume3@11: if (end == -1) { ulalume3@11: end = document.cookie.length; ulalume3@11: by = unescape(document.cookie.substring(start, end)); ulalume3@11: } ulalume3@11: } ulalume3@11: } ulalume3@11: setComparator(); ulalume3@11: } ulalume3@11: ulalume3@11: /** ulalume3@11: * Show a comment div. ulalume3@11: */ ulalume3@11: function show(id) { ulalume3@11: $('#ao' + id).hide(); ulalume3@11: $('#ah' + id).show(); ulalume3@11: var context = $.extend({id: id}, opts); ulalume3@11: var popup = $(renderTemplate(popupTemplate, context)).hide(); ulalume3@11: popup.find('textarea[name="proposal"]').hide(); ulalume3@11: popup.find('a.by' + by).addClass('sel'); ulalume3@11: var form = popup.find('#cf' + id); ulalume3@11: form.submit(function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: addComment(form); ulalume3@11: }); ulalume3@11: $('#s' + id).after(popup); ulalume3@11: popup.slideDown('fast', function() { ulalume3@11: getComments(id); ulalume3@11: }); ulalume3@11: } ulalume3@11: ulalume3@11: /** ulalume3@11: * Hide a comment div. ulalume3@11: */ ulalume3@11: function hide(id) { ulalume3@11: $('#ah' + id).hide(); ulalume3@11: $('#ao' + id).show(); ulalume3@11: var div = $('#sc' + id); ulalume3@11: div.slideUp('fast', function() { ulalume3@11: div.remove(); ulalume3@11: }); ulalume3@11: } ulalume3@11: ulalume3@11: /** ulalume3@11: * Perform an ajax request to get comments for a node ulalume3@11: * and insert the comments into the comments tree. ulalume3@11: */ ulalume3@11: function getComments(id) { ulalume3@11: $.ajax({ ulalume3@11: type: 'GET', ulalume3@11: url: opts.getCommentsURL, ulalume3@11: data: {node: id}, ulalume3@11: success: function(data, textStatus, request) { ulalume3@11: var ul = $('#cl' + id); ulalume3@11: var speed = 100; ulalume3@11: $('#cf' + id) ulalume3@11: .find('textarea[name="proposal"]') ulalume3@11: .data('source', data.source); ulalume3@11: ulalume3@11: if (data.comments.length === 0) { ulalume3@11: ul.html('
  • No comments yet.
  • '); ulalume3@11: ul.data('empty', true); ulalume3@11: } else { ulalume3@11: // If there are comments, sort them and put them in the list. ulalume3@11: var comments = sortComments(data.comments); ulalume3@11: speed = data.comments.length * 100; ulalume3@11: appendComments(comments, ul); ulalume3@11: ul.data('empty', false); ulalume3@11: } ulalume3@11: $('#cn' + id).slideUp(speed + 200); ulalume3@11: ul.slideDown(speed); ulalume3@11: }, ulalume3@11: error: function(request, textStatus, error) { ulalume3@11: showError('Oops, there was a problem retrieving the comments.'); ulalume3@11: }, ulalume3@11: dataType: 'json' ulalume3@11: }); ulalume3@11: } ulalume3@11: ulalume3@11: /** ulalume3@11: * Add a comment via ajax and insert the comment into the comment tree. ulalume3@11: */ ulalume3@11: function addComment(form) { ulalume3@11: var node_id = form.find('input[name="node"]').val(); ulalume3@11: var parent_id = form.find('input[name="parent"]').val(); ulalume3@11: var text = form.find('textarea[name="comment"]').val(); ulalume3@11: var proposal = form.find('textarea[name="proposal"]').val(); ulalume3@11: ulalume3@11: if (text == '') { ulalume3@11: showError('Please enter a comment.'); ulalume3@11: return; ulalume3@11: } ulalume3@11: ulalume3@11: // Disable the form that is being submitted. ulalume3@11: form.find('textarea,input').attr('disabled', 'disabled'); ulalume3@11: ulalume3@11: // Send the comment to the server. ulalume3@11: $.ajax({ ulalume3@11: type: "POST", ulalume3@11: url: opts.addCommentURL, ulalume3@11: dataType: 'json', ulalume3@11: data: { ulalume3@11: node: node_id, ulalume3@11: parent: parent_id, ulalume3@11: text: text, ulalume3@11: proposal: proposal ulalume3@11: }, ulalume3@11: success: function(data, textStatus, error) { ulalume3@11: // Reset the form. ulalume3@11: if (node_id) { ulalume3@11: hideProposeChange(node_id); ulalume3@11: } ulalume3@11: form.find('textarea') ulalume3@11: .val('') ulalume3@11: .add(form.find('input')) ulalume3@11: .removeAttr('disabled'); ulalume3@11: var ul = $('#cl' + (node_id || parent_id)); ulalume3@11: if (ul.data('empty')) { ulalume3@11: $(ul).empty(); ulalume3@11: ul.data('empty', false); ulalume3@11: } ulalume3@11: insertComment(data.comment); ulalume3@11: var ao = $('#ao' + node_id); ulalume3@11: ao.find('img').attr({'src': opts.commentBrightImage}); ulalume3@11: if (node_id) { ulalume3@11: // if this was a "root" comment, remove the commenting box ulalume3@11: // (the user can get it back by reopening the comment popup) ulalume3@11: $('#ca' + node_id).slideUp(); ulalume3@11: } ulalume3@11: }, ulalume3@11: error: function(request, textStatus, error) { ulalume3@11: form.find('textarea,input').removeAttr('disabled'); ulalume3@11: showError('Oops, there was a problem adding the comment.'); ulalume3@11: } ulalume3@11: }); ulalume3@11: } ulalume3@11: ulalume3@11: /** ulalume3@11: * Recursively append comments to the main comment list and children ulalume3@11: * lists, creating the comment tree. ulalume3@11: */ ulalume3@11: function appendComments(comments, ul) { ulalume3@11: $.each(comments, function() { ulalume3@11: var div = createCommentDiv(this); ulalume3@11: ul.append($(document.createElement('li')).html(div)); ulalume3@11: appendComments(this.children, div.find('ul.comment-children')); ulalume3@11: // To avoid stagnating data, don't store the comments children in data. ulalume3@11: this.children = null; ulalume3@11: div.data('comment', this); ulalume3@11: }); ulalume3@11: } ulalume3@11: ulalume3@11: /** ulalume3@11: * After adding a new comment, it must be inserted in the correct ulalume3@11: * location in the comment tree. ulalume3@11: */ ulalume3@11: function insertComment(comment) { ulalume3@11: var div = createCommentDiv(comment); ulalume3@11: ulalume3@11: // To avoid stagnating data, don't store the comments children in data. ulalume3@11: comment.children = null; ulalume3@11: div.data('comment', comment); ulalume3@11: ulalume3@11: var ul = $('#cl' + (comment.node || comment.parent)); ulalume3@11: var siblings = getChildren(ul); ulalume3@11: ulalume3@11: var li = $(document.createElement('li')); ulalume3@11: li.hide(); ulalume3@11: ulalume3@11: // Determine where in the parents children list to insert this comment. ulalume3@11: for(i=0; i < siblings.length; i++) { ulalume3@11: if (comp(comment, siblings[i]) <= 0) { ulalume3@11: $('#cd' + siblings[i].id) ulalume3@11: .parent() ulalume3@11: .before(li.html(div)); ulalume3@11: li.slideDown('fast'); ulalume3@11: return; ulalume3@11: } ulalume3@11: } ulalume3@11: ulalume3@11: // If we get here, this comment rates lower than all the others, ulalume3@11: // or it is the only comment in the list. ulalume3@11: ul.append(li.html(div)); ulalume3@11: li.slideDown('fast'); ulalume3@11: } ulalume3@11: ulalume3@11: function acceptComment(id) { ulalume3@11: $.ajax({ ulalume3@11: type: 'POST', ulalume3@11: url: opts.acceptCommentURL, ulalume3@11: data: {id: id}, ulalume3@11: success: function(data, textStatus, request) { ulalume3@11: $('#cm' + id).fadeOut('fast'); ulalume3@11: $('#cd' + id).removeClass('moderate'); ulalume3@11: }, ulalume3@11: error: function(request, textStatus, error) { ulalume3@11: showError('Oops, there was a problem accepting the comment.'); ulalume3@11: } ulalume3@11: }); ulalume3@11: } ulalume3@11: ulalume3@11: function deleteComment(id) { ulalume3@11: $.ajax({ ulalume3@11: type: 'POST', ulalume3@11: url: opts.deleteCommentURL, ulalume3@11: data: {id: id}, ulalume3@11: success: function(data, textStatus, request) { ulalume3@11: var div = $('#cd' + id); ulalume3@11: if (data == 'delete') { ulalume3@11: // Moderator mode: remove the comment and all children immediately ulalume3@11: div.slideUp('fast', function() { ulalume3@11: div.remove(); ulalume3@11: }); ulalume3@11: return; ulalume3@11: } ulalume3@11: // User mode: only mark the comment as deleted ulalume3@11: div ulalume3@11: .find('span.user-id:first') ulalume3@11: .text('[deleted]').end() ulalume3@11: .find('div.comment-text:first') ulalume3@11: .text('[deleted]').end() ulalume3@11: .find('#cm' + id + ', #dc' + id + ', #ac' + id + ', #rc' + id + ulalume3@11: ', #sp' + id + ', #hp' + id + ', #cr' + id + ', #rl' + id) ulalume3@11: .remove(); ulalume3@11: var comment = div.data('comment'); ulalume3@11: comment.username = '[deleted]'; ulalume3@11: comment.text = '[deleted]'; ulalume3@11: div.data('comment', comment); ulalume3@11: }, ulalume3@11: error: function(request, textStatus, error) { ulalume3@11: showError('Oops, there was a problem deleting the comment.'); ulalume3@11: } ulalume3@11: }); ulalume3@11: } ulalume3@11: ulalume3@11: function showProposal(id) { ulalume3@11: $('#sp' + id).hide(); ulalume3@11: $('#hp' + id).show(); ulalume3@11: $('#pr' + id).slideDown('fast'); ulalume3@11: } ulalume3@11: ulalume3@11: function hideProposal(id) { ulalume3@11: $('#hp' + id).hide(); ulalume3@11: $('#sp' + id).show(); ulalume3@11: $('#pr' + id).slideUp('fast'); ulalume3@11: } ulalume3@11: ulalume3@11: function showProposeChange(id) { ulalume3@11: $('#pc' + id).hide(); ulalume3@11: $('#hc' + id).show(); ulalume3@11: var textarea = $('#pt' + id); ulalume3@11: textarea.val(textarea.data('source')); ulalume3@11: $.fn.autogrow.resize(textarea[0]); ulalume3@11: textarea.slideDown('fast'); ulalume3@11: } ulalume3@11: ulalume3@11: function hideProposeChange(id) { ulalume3@11: $('#hc' + id).hide(); ulalume3@11: $('#pc' + id).show(); ulalume3@11: var textarea = $('#pt' + id); ulalume3@11: textarea.val('').removeAttr('disabled'); ulalume3@11: textarea.slideUp('fast'); ulalume3@11: } ulalume3@11: ulalume3@11: function toggleCommentMarkupBox(id) { ulalume3@11: $('#mb' + id).toggle(); ulalume3@11: } ulalume3@11: ulalume3@11: /** Handle when the user clicks on a sort by link. */ ulalume3@11: function handleReSort(link) { ulalume3@11: var classes = link.attr('class').split(/\s+/); ulalume3@11: for (var i=0; iThank you! Your comment will show up ' ulalume3@11: + 'once it is has been approved by a moderator.'); ulalume3@11: } ulalume3@11: // Prettify the comment rating. ulalume3@11: comment.pretty_rating = comment.rating + ' point' + ulalume3@11: (comment.rating == 1 ? '' : 's'); ulalume3@11: // Make a class (for displaying not yet moderated comments differently) ulalume3@11: comment.css_class = comment.displayed ? '' : ' moderate'; ulalume3@11: // Create a div for this comment. ulalume3@11: var context = $.extend({}, opts, comment); ulalume3@11: var div = $(renderTemplate(commentTemplate, context)); ulalume3@11: ulalume3@11: // If the user has voted on this comment, highlight the correct arrow. ulalume3@11: if (comment.vote) { ulalume3@11: var direction = (comment.vote == 1) ? 'u' : 'd'; ulalume3@11: div.find('#' + direction + 'v' + comment.id).hide(); ulalume3@11: div.find('#' + direction + 'u' + comment.id).show(); ulalume3@11: } ulalume3@11: ulalume3@11: if (opts.moderator || comment.text != '[deleted]') { ulalume3@11: div.find('a.reply').show(); ulalume3@11: if (comment.proposal_diff) ulalume3@11: div.find('#sp' + comment.id).show(); ulalume3@11: if (opts.moderator && !comment.displayed) ulalume3@11: div.find('#cm' + comment.id).show(); ulalume3@11: if (opts.moderator || (opts.username == comment.username)) ulalume3@11: div.find('#dc' + comment.id).show(); ulalume3@11: } ulalume3@11: return div; ulalume3@11: } ulalume3@11: ulalume3@11: /** ulalume3@11: * A simple template renderer. Placeholders such as <%id%> are replaced ulalume3@11: * by context['id'] with items being escaped. Placeholders such as <#id#> ulalume3@11: * are not escaped. ulalume3@11: */ ulalume3@11: function renderTemplate(template, context) { ulalume3@11: var esc = $(document.createElement('div')); ulalume3@11: ulalume3@11: function handle(ph, escape) { ulalume3@11: var cur = context; ulalume3@11: $.each(ph.split('.'), function() { ulalume3@11: cur = cur[this]; ulalume3@11: }); ulalume3@11: return escape ? esc.text(cur || "").html() : cur; ulalume3@11: } ulalume3@11: ulalume3@11: return template.replace(/<([%#])([\w\.]*)\1>/g, function() { ulalume3@11: return handle(arguments[2], arguments[1] == '%' ? true : false); ulalume3@11: }); ulalume3@11: } ulalume3@11: ulalume3@11: /** Flash an error message briefly. */ ulalume3@11: function showError(message) { ulalume3@11: $(document.createElement('div')).attr({'class': 'popup-error'}) ulalume3@11: .append($(document.createElement('div')) ulalume3@11: .attr({'class': 'error-message'}).text(message)) ulalume3@11: .appendTo('body') ulalume3@11: .fadeIn("slow") ulalume3@11: .delay(2000) ulalume3@11: .fadeOut("slow"); ulalume3@11: } ulalume3@11: ulalume3@11: /** Add a link the user uses to open the comments popup. */ ulalume3@11: $.fn.comment = function() { ulalume3@11: return this.each(function() { ulalume3@11: var id = $(this).attr('id').substring(1); ulalume3@11: var count = COMMENT_METADATA[id]; ulalume3@11: var title = count + ' comment' + (count == 1 ? '' : 's'); ulalume3@11: var image = count > 0 ? opts.commentBrightImage : opts.commentImage; ulalume3@11: var addcls = count == 0 ? ' nocomment' : ''; ulalume3@11: $(this) ulalume3@11: .append( ulalume3@11: $(document.createElement('a')).attr({ ulalume3@11: href: '#', ulalume3@11: 'class': 'sphinx-comment-open' + addcls, ulalume3@11: id: 'ao' + id ulalume3@11: }) ulalume3@11: .append($(document.createElement('img')).attr({ ulalume3@11: src: image, ulalume3@11: alt: 'comment', ulalume3@11: title: title ulalume3@11: })) ulalume3@11: .click(function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: show($(this).attr('id').substring(2)); ulalume3@11: }) ulalume3@11: ) ulalume3@11: .append( ulalume3@11: $(document.createElement('a')).attr({ ulalume3@11: href: '#', ulalume3@11: 'class': 'sphinx-comment-close hidden', ulalume3@11: id: 'ah' + id ulalume3@11: }) ulalume3@11: .append($(document.createElement('img')).attr({ ulalume3@11: src: opts.closeCommentImage, ulalume3@11: alt: 'close', ulalume3@11: title: 'close' ulalume3@11: })) ulalume3@11: .click(function(event) { ulalume3@11: event.preventDefault(); ulalume3@11: hide($(this).attr('id').substring(2)); ulalume3@11: }) ulalume3@11: ); ulalume3@11: }); ulalume3@11: }; ulalume3@11: ulalume3@11: var opts = { ulalume3@11: processVoteURL: '/_process_vote', ulalume3@11: addCommentURL: '/_add_comment', ulalume3@11: getCommentsURL: '/_get_comments', ulalume3@11: acceptCommentURL: '/_accept_comment', ulalume3@11: deleteCommentURL: '/_delete_comment', ulalume3@11: commentImage: '/static/_static/comment.png', ulalume3@11: closeCommentImage: '/static/_static/comment-close.png', ulalume3@11: loadingImage: '/static/_static/ajax-loader.gif', ulalume3@11: commentBrightImage: '/static/_static/comment-bright.png', ulalume3@11: upArrow: '/static/_static/up.png', ulalume3@11: downArrow: '/static/_static/down.png', ulalume3@11: upArrowPressed: '/static/_static/up-pressed.png', ulalume3@11: downArrowPressed: '/static/_static/down-pressed.png', ulalume3@11: voting: false, ulalume3@11: moderator: false ulalume3@11: }; ulalume3@11: ulalume3@11: if (typeof COMMENT_OPTIONS != "undefined") { ulalume3@11: opts = jQuery.extend(opts, COMMENT_OPTIONS); ulalume3@11: } ulalume3@11: ulalume3@11: var popupTemplate = '\ ulalume3@11:
    \ ulalume3@11:

    \ ulalume3@11: Sort by:\ ulalume3@11: best rated\ ulalume3@11: newest\ ulalume3@11: oldest\ ulalume3@11:

    \ ulalume3@11:
    Comments
    \ ulalume3@11:
    \ ulalume3@11: loading comments...
    \ ulalume3@11: \ ulalume3@11:
    \ ulalume3@11:

    Add a comment\ ulalume3@11: (markup):

    \ ulalume3@11:
    \ ulalume3@11: reStructured text markup: *emph*, **strong**, \ ulalume3@11: ``code``, \ ulalume3@11: code blocks: :: and an indented block after blank line
    \ ulalume3@11:
    \ ulalume3@11: \ ulalume3@11:

    \ ulalume3@11: \ ulalume3@11: Propose a change ▹\ ulalume3@11: \ ulalume3@11: \ ulalume3@11: Propose a change ▿\ ulalume3@11: \ ulalume3@11:

    \ ulalume3@11: \ ulalume3@11: \ ulalume3@11: \ ulalume3@11: \ ulalume3@11:
    \ ulalume3@11:
    \ ulalume3@11:
    '; ulalume3@11: ulalume3@11: var commentTemplate = '\ ulalume3@11:
    \ ulalume3@11:
    \ ulalume3@11:
    \ ulalume3@11: \ ulalume3@11: \ ulalume3@11: \ ulalume3@11: \ ulalume3@11: \ ulalume3@11: \ ulalume3@11:
    \ ulalume3@11:
    \ ulalume3@11: \ ulalume3@11: \ ulalume3@11: \ ulalume3@11: \ ulalume3@11: \ ulalume3@11: \ ulalume3@11:
    \ ulalume3@11:
    \ ulalume3@11:
    \ ulalume3@11:

    \ ulalume3@11: <%username%>\ ulalume3@11: <%pretty_rating%>\ ulalume3@11: <%time.delta%>\ ulalume3@11:

    \ ulalume3@11:
    <#text#>
    \ ulalume3@11:

    \ ulalume3@11: \ ulalume3@11: reply ▿\ ulalume3@11: proposal ▹\ ulalume3@11: proposal ▿\ ulalume3@11: \ ulalume3@11: \ ulalume3@11:

    \ ulalume3@11:
    \
    ulalume3@11: <#proposal_diff#>\
    ulalume3@11:         
    \ ulalume3@11:
      \ ulalume3@11:
      \ ulalume3@11:
      \ ulalume3@11:
      \ ulalume3@11: '; ulalume3@11: ulalume3@11: var replyTemplate = '\ ulalume3@11:
    • \ ulalume3@11:
      \ ulalume3@11:
      \ ulalume3@11: \ ulalume3@11: \ ulalume3@11: \ ulalume3@11: \ ulalume3@11: \ ulalume3@11:
      \ ulalume3@11:
      \ ulalume3@11:
    • '; ulalume3@11: ulalume3@11: $(document).ready(function() { ulalume3@11: init(); ulalume3@11: }); ulalume3@11: })(jQuery); ulalume3@11: ulalume3@11: $(document).ready(function() { ulalume3@11: // add comment anchors for all paragraphs that are commentable ulalume3@11: $('.sphinx-has-comment').comment(); ulalume3@11: ulalume3@11: // highlight search words in search results ulalume3@11: $("div.context").each(function() { ulalume3@11: var params = $.getQueryParameters(); ulalume3@11: var terms = (params.q) ? params.q[0].split(/\s+/) : []; ulalume3@11: var result = $(this); ulalume3@11: $.each(terms, function() { ulalume3@11: result.highlightText(this.toLowerCase(), 'highlighted'); ulalume3@11: }); ulalume3@11: }); ulalume3@11: ulalume3@11: // directly open comment window if requested ulalume3@11: var anchor = document.location.hash; ulalume3@11: if (anchor.substring(0, 9) == '#comment-') { ulalume3@11: $('#ao' + anchor.substring(9)).click(); ulalume3@11: document.location.hash = '#s' + anchor.substring(9); ulalume3@11: } ulalume3@11: });