Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #197 from sun/autocomplete-user
Browse files Browse the repository at this point in the history
Username autocompletion is broken for names starting with "Co"
  • Loading branch information
markhalliwell committed Jun 2, 2014
2 parents 510b805 + 8e9e639 commit a0b0f72
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/js/plugins/commit.message.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ Drupal.behaviors.dreditorCommitMessage = {
var $comments = $context.find('section.comments div.comment');

// Build list of top commenters.
// @todo Rethink algorithm for crediting top commenters.
var commenters = $comments.find('div.author a')
// Skip test bot.
.not(':contains("System Message")')
// Add original poster.
.add('div.node div.submitted a')
.add('.node .submitted a.username')
// Count and sort by occurrences.
.countvalues();
// Compile a list of top commenters (max. 10% of # of all follow-ups).
Expand Down
2 changes: 1 addition & 1 deletion src/js/plugins/issue.summary.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Drupal.behaviors.dreditorIssueSummaryTemplate = {
// On node view, simply replace @username with the existing link to the
// original author.
else if (!location.href.match(/^.*node\/[^\/]*\/edit/)) {
var $profileLink = $('div.node > div.submitted a').clone();
var $profileLink = $('.node .submitted a.username').clone();
if ($profileLink.length) {
$profileLink.text('@' + $profileLink.text());
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/plugins/syntax.autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Drupal.dreditor.syntaxAutocomplete.prototype.suggestions.user = function (needle
self.suggestionUserList = {};
var seen = {};
// Add issue author to comment authors and build the suggestion list.
$('.comment .submitted a').add('div.node div.submitted a').each(function () {
$('.comment a.username').add('.node .submitted a.username').each(function () {
if (!seen[this.text]) {
seen[this.text] = 1;
// Use the shortest possible needle.
Expand Down

0 comments on commit a0b0f72

Please sign in to comment.