Shorten private operator (private-message -> private).

(imported from commit f938bd56de05cc8fc0da18348d4dec8a18c96bb9)
This commit is contained in:
Steve Howell 2013-07-09 21:22:34 -04:00
parent 43602b589f
commit 97994ea7a9
7 changed files with 13 additions and 13 deletions

View File

@ -16,7 +16,7 @@
<li data-name="home"
class="active-filter"><i class="icon-vector-home"></i> <a href="#">Home <span class="count">(<span class="value"></span>)</span></a></li>
<li data-name="all" class="hidden-filter"><i class="icon-vector-list"></i> <a href="#narrow/in/all">All messages <span class="count">(<span class="value"></span>)</span></a></li>
<li data-name="private-message"><i class="icon-vector-user"></i> <a href="#narrow/is/private-message">Private messages <span class="count">(<span class="value"></span>)</span></a></li>
<li data-name="private"><i class="icon-vector-user"></i> <a href="#narrow/is/private">Private messages <span class="count">(<span class="value"></span>)</span></a></li>
<li data-name="starred"><i class="icon-vector-star"></i> <a href="#narrow/is/starred">Starred messages</a></li>
<li data-name="mentioned"><i class="icon-vector-tag"></i> <a href="#narrow/is/mentioned">@-mentions<span class="count">(<span class="value"></span>)</span></a></li>
</ul>

View File

@ -213,7 +213,7 @@ function process_hotkey(e) {
return do_narrow_action(narrow.by_subject);
case 'narrow_private':
return do_narrow_action(function (target, opts) {
narrow.by('is', 'private-message', opts);
narrow.by('is', 'private', opts);
});
}

View File

@ -108,7 +108,7 @@ Filter.prototype = {
operand = operators[i][1];
switch (operators[i][0]) {
case 'is':
if (operand === 'private-message') {
if (operand === 'private') {
if (message.type !== 'private')
return false;
} else if (operand === 'starred') {
@ -254,7 +254,7 @@ exports.describe = function (operators) {
var operand = elem[1];
switch (elem[0]) {
case 'is':
if (operand === 'private-message') {
if (operand === 'private') {
return 'Narrow to all private messages';
} else if (operand === 'starred') {
return 'Narrow to starred messages';
@ -606,7 +606,7 @@ function pick_empty_narrow_banner() {
return $("#empty_star_narrow_message");
} else if (first_operand === "mentioned") {
return $("#empty_narrow_all_mentioned");
} else if (first_operand === "private-message") {
} else if (first_operand === "private") {
// You have no private messages.
return $("#empty_narrow_all_private_message");
}
@ -651,7 +651,7 @@ exports.narrowed_to_pms = function () {
return false;
}
return (current_filter.has_operator("pm-with") ||
current_filter.has_operand("is", "private-message"));
current_filter.has_operand("is", "private"));
};
// We auto-reply under certain conditions, namely when you're narrowed

View File

@ -218,7 +218,7 @@ function do_new_messages_animation(message_type) {
function animate_private_message_changes(new_private_message_count) {
if (new_private_message_count > last_private_message_count) {
do_new_messages_animation('private-message');
do_new_messages_animation('private');
}
last_private_message_count = new_private_message_count;
}
@ -252,7 +252,7 @@ exports.update_dom_with_unread_counts = function (counts) {
});
// integer counts
exports.set_count("global", "private-message", counts.private_message_count);
exports.set_count("global", "private", counts.private_message_count);
exports.set_count("global", "mentioned", counts.mentioned_message_count);
exports.set_count("global", "home", counts.home_unread_messages);
@ -274,7 +274,7 @@ $(function () {
}
var op_is = event.filter.operands('is');
if (op_is.length !== 0) {
if (['private-message', 'starred', 'mentioned'].indexOf(op_is[0]) !== -1) {
if (['private', 'starred', 'mentioned'].indexOf(op_is[0]) !== -1) {
$("#global_filters li[data-name='" + op_is[0] + "']").addClass('active-filter');
}
}

View File

@ -33,9 +33,9 @@ function make_tab_data() {
stream = filter.operands("stream")[0];
tabs.push(make_tab(stream, hashed, stream, 'stream'));
} else if (filter.has_operator("pm-with") ||
filter.has_operand("is", "private-message")) {
filter.has_operand("is", "private")) {
tabs.push(make_tab("Private Messages", '#narrow/is/private-message',
tabs.push(make_tab("Private Messages", '#narrow/is/private',
undefined, 'private_message '));
if (filter.has_operator("pm-with")) {

View File

@ -230,7 +230,7 @@ casper.then(function () {
});
casper.thenClick('#stream_filters [data-name="Verona"] a', expect_stream);
casper.thenClick('#global_filters [data-name="home"] a', expect_home);
casper.thenClick('#global_filters [data-name="private-message"] a', expect_all_pm);
casper.thenClick('#global_filters [data-name="private"] a', expect_all_pm);
un_narrow();

View File

@ -691,7 +691,7 @@ class NarrowBuilder(object):
return Q(**dict((self.prefix + key, kwargs[key]) for key in kwargs.keys()))
def by_is(self, operand):
if operand == 'private-message':
if operand == 'private':
return (self.pQ(recipient__type=Recipient.PERSONAL) |
self.pQ(recipient__type=Recipient.HUDDLE))
elif operand == 'starred':