Remove the old and now unused flat nicklist
This commit is contained in:
parent
4e08a52f25
commit
921e28d0e2
|
@ -868,7 +868,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
// get last word
|
// get last word
|
||||||
var lastSpace = trimmedValue.lastIndexOf(' ') + 1;
|
var lastSpace = trimmedValue.lastIndexOf(' ') + 1;
|
||||||
var lastWord = trimmedValue.slice(lastSpace, trimmedValue.length - 1);
|
var lastWord = trimmedValue.slice(lastSpace, trimmedValue.length - 1);
|
||||||
var nicklist = models.getActiveBuffer().flatNicklist();
|
var nicklist = models.getActiveBuffer().getNicklistByTime();
|
||||||
// check against nicklist to see if it's a list of highlights
|
// check against nicklist to see if it's a list of highlights
|
||||||
if (nicklist.indexOf(lastWord) !== -1) {
|
if (nicklist.indexOf(lastWord) !== -1) {
|
||||||
// It's another highlight!
|
// It's another highlight!
|
||||||
|
@ -1230,7 +1230,7 @@ weechat.directive('inputBar', function() {
|
||||||
// get current caret position
|
// get current caret position
|
||||||
var caretPos = inputNode.selectionStart;
|
var caretPos = inputNode.selectionStart;
|
||||||
|
|
||||||
// create flat array of nicks
|
// get current active buffer
|
||||||
var activeBuffer = models.getActiveBuffer();
|
var activeBuffer = models.getActiveBuffer();
|
||||||
|
|
||||||
// complete nick
|
// complete nick
|
||||||
|
|
|
@ -3,24 +3,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var IrcUtils = {
|
var IrcUtils = {
|
||||||
/**
|
|
||||||
* Get a new version of a nick list, sorted alphabetically by lowercase nick.
|
|
||||||
*
|
|
||||||
* @param nickList Original nick list
|
|
||||||
* @return Nick list sorted alphabetically by lowercase nick
|
|
||||||
*/
|
|
||||||
_ciSearchNickList: function(nickList) {
|
|
||||||
var newList = [];
|
|
||||||
|
|
||||||
nickList.forEach(function(nick) {
|
|
||||||
newList.push(nick);
|
|
||||||
});
|
|
||||||
newList.sort(function(a, b) {
|
|
||||||
return a.toLowerCase() < b.toLowerCase() ? -1 : 1;
|
|
||||||
});
|
|
||||||
|
|
||||||
return newList;
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* Get a new version of a nick list, sorted by last speaker
|
* Get a new version of a nick list, sorted by last speaker
|
||||||
*
|
*
|
||||||
|
|
20
js/models.js
20
js/models.js
|
@ -20,7 +20,6 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
var lines = [];
|
var lines = [];
|
||||||
var requestedLines = 0;
|
var requestedLines = 0;
|
||||||
var nicklist = {};
|
var nicklist = {};
|
||||||
var flatnicklist = [];
|
|
||||||
var history = [];
|
var history = [];
|
||||||
var historyPos = 0;
|
var historyPos = 0;
|
||||||
var active = false;
|
var active = false;
|
||||||
|
@ -53,7 +52,6 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
if (nicklistRequested()) {
|
if (nicklistRequested()) {
|
||||||
nick.spokeAt = Date.now();
|
nick.spokeAt = Date.now();
|
||||||
nicklist[group].nicks.push(nick);
|
nicklist[group].nicks.push(nick);
|
||||||
flatnicklist = getFlatNicklist();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
|
@ -65,7 +63,6 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
group.nicks = _.filter(group.nicks, function(n) { return n.name !== nick.name;});
|
group.nicks = _.filter(group.nicks, function(n) { return n.name !== nick.name;});
|
||||||
flatnicklist = getFlatNicklist();
|
|
||||||
/*
|
/*
|
||||||
for (i in group.nicks) {
|
for (i in group.nicks) {
|
||||||
if (group.nicks[i].name == nick.name) {
|
if (group.nicks[i].name == nick.name) {
|
||||||
|
@ -86,7 +83,6 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
flatnicklist = getFlatNicklist();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -116,7 +112,6 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
flatnicklist = getFlatNicklist();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -139,20 +134,6 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
return newlist;
|
return newlist;
|
||||||
};
|
};
|
||||||
|
|
||||||
var getFlatNicklist = function() {
|
|
||||||
var newlist = [];
|
|
||||||
_.each(nicklist, function(nickGroup) {
|
|
||||||
_.each(nickGroup.nicks, function(nickObj) {
|
|
||||||
newlist.push(nickObj.name);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return newlist;
|
|
||||||
};
|
|
||||||
|
|
||||||
var flatNicklist = function() {
|
|
||||||
return flatnicklist;
|
|
||||||
};
|
|
||||||
|
|
||||||
var addToHistory = function(line) {
|
var addToHistory = function(line) {
|
||||||
var result = "";
|
var result = "";
|
||||||
if (historyPos !== history.length) {
|
if (historyPos !== history.length) {
|
||||||
|
@ -234,7 +215,6 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
addNick: addNick,
|
addNick: addNick,
|
||||||
delNick: delNick,
|
delNick: delNick,
|
||||||
updateNick: updateNick,
|
updateNick: updateNick,
|
||||||
flatNicklist: flatNicklist,
|
|
||||||
getNicklistByTime: getNicklistByTime,
|
getNicklistByTime: getNicklistByTime,
|
||||||
serverSortKey: serverSortKey,
|
serverSortKey: serverSortKey,
|
||||||
indent: indent,
|
indent: indent,
|
||||||
|
|
Loading…
Reference in New Issue