mirror of https://github.com/zulip/zulip.git
Get rid of the narrowbar
(imported from commit 53335b8177561d4b103659a51704d6b2ce7ec367)
This commit is contained in:
parent
15f606a2ef
commit
3c9b9227f8
|
@ -12,12 +12,6 @@
|
|||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="narrowed_to_bar">
|
||||
<div id="narrowlabel">
|
||||
<div class="close" onclick="narrow.show_all_messages()">×</div>
|
||||
<span id="currently_narrowed_to"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="floating_recipient_bar">
|
||||
<table class="floating_recipient">
|
||||
<tr id="floating_recipient_layout_row" class="ztable_layout_row">
|
||||
|
@ -42,7 +36,6 @@
|
|||
<div class="span9">
|
||||
<div class="message_list" id="main_div">
|
||||
<div id="top_whitespace"></div>
|
||||
<div id="top_narrowed_whitespace"></div>
|
||||
<table id="load_more_messages_indicator">
|
||||
<tr><td id="load_more_messages_spinner"></td></tr>
|
||||
</table>
|
||||
|
|
|
@ -25,10 +25,6 @@
|
|||
{% rawjstemplate "timeinfo_popover_content" %}
|
||||
</script>
|
||||
|
||||
<script id="template_narrowbar" type="text/x-handlebars-template">
|
||||
{% rawjstemplate "narrowbar" %}
|
||||
</script>
|
||||
|
||||
<link href="{{ static_hidden }}styles/zephyr.css?dummy_time={% now "U" %}" rel="stylesheet">
|
||||
<link href="{{ static_hidden }}styles/pygments.css" rel="stylesheet">
|
||||
<script type="text/javascript" src="/static/third/jquery/jquery.form.js"></script>
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
<span id="currently_narrowed_to"
|
||||
title="{{description}}{{#if subject}} | {{subject}}{{/if}}">
|
||||
|
||||
<i class="icon-{{icon}}"></i>
|
||||
{{description}}
|
||||
{{#if subject}}
|
||||
| {{subject}}
|
||||
{{/if}}
|
||||
</span>
|
|
@ -42,9 +42,7 @@ function parse_narrow(hash) {
|
|||
var operand = decodeURIComponent(hash[i+1] || '');
|
||||
operators.push([operator, operand]);
|
||||
}
|
||||
// The narrowbar description here is bogus, but it's going away in
|
||||
// a subsequent commit.
|
||||
narrow.activate(operators, {icon: 'search', description: 'FIXME'});
|
||||
narrow.activate(operators);
|
||||
}
|
||||
|
||||
// Returns true if this function performed a narrow
|
||||
|
|
|
@ -110,7 +110,7 @@ function build_filter(operators) {
|
|||
};
|
||||
}
|
||||
|
||||
exports.activate = function (operators, bar, opts) {
|
||||
exports.activate = function (operators, opts) {
|
||||
opts = $.extend({}, {
|
||||
time_travel: false,
|
||||
show_floating_recipient: true,
|
||||
|
@ -154,12 +154,8 @@ exports.activate = function (operators, bar, opts) {
|
|||
|
||||
reset_load_more_status();
|
||||
$("#show_all_messages").removeAttr("disabled");
|
||||
$(".narrowed_to_bar").show();
|
||||
$("#top_narrowed_whitespace").show();
|
||||
$("#main_div").addClass("narrowed_view");
|
||||
$("#searchbox").addClass("narrowed_view");
|
||||
$("#currently_narrowed_to").remove();
|
||||
$("#narrowlabel").append(templates.narrowbar(bar));
|
||||
|
||||
$("#zhome").removeClass("focused_table");
|
||||
// Indicate both which message is persistently selected and which
|
||||
|
@ -179,11 +175,7 @@ exports.activate = function (operators, bar, opts) {
|
|||
};
|
||||
|
||||
exports.time_travel = function () {
|
||||
var bar = {
|
||||
icon: 'time',
|
||||
description: 'Messages around time ' + message_dict[target_id].full_date_str
|
||||
};
|
||||
exports.activate([], bar, {time_travel: true});
|
||||
exports.activate([], {time_travel: true});
|
||||
};
|
||||
|
||||
// This is the message we're about to select, within the narrowed view.
|
||||
|
@ -196,8 +188,7 @@ exports.target = function (id) {
|
|||
};
|
||||
|
||||
exports.all_private_messages = function () {
|
||||
var bar = {icon: 'user', description: 'You and anyone else'};
|
||||
exports.activate([['is', 'private-message']], bar);
|
||||
exports.activate([['is', 'private-message']]);
|
||||
};
|
||||
|
||||
exports.by_subject = function () {
|
||||
|
@ -216,28 +207,21 @@ exports.by_stream_and_subject_names = function (stream, subject) {
|
|||
var operators = [
|
||||
['stream', stream],
|
||||
['subject', subject.toLowerCase()]];
|
||||
var bar = {
|
||||
icon: 'bullhorn',
|
||||
description: stream,
|
||||
subject: subject
|
||||
};
|
||||
exports.activate(operators, bar, {show_floating_recipient: false});
|
||||
exports.activate(operators, {show_floating_recipient: false});
|
||||
};
|
||||
|
||||
exports.by_stream_name = function (name) {
|
||||
var bar = {icon: 'bullhorn', description: name};
|
||||
exports.activate([['stream', name]], bar);
|
||||
exports.activate([['stream', name]]);
|
||||
};
|
||||
|
||||
exports.by_private_message_group = function (names, emails) {
|
||||
var bar = {icon: 'user', description: "You and " + names};
|
||||
exports.activate([['pm-with', emails]], bar, {show_floating_recipient: false});
|
||||
exports.activate([['pm-with', emails]], {show_floating_recipient: false});
|
||||
};
|
||||
|
||||
// Called for the 'narrow by stream' hotkey.
|
||||
exports.by_recipient = function () {
|
||||
var message = message_dict[target_id];
|
||||
var bar, new_narrow, emails;
|
||||
var new_narrow, emails;
|
||||
switch (message.type) {
|
||||
case 'private':
|
||||
exports.by_private_message_group(message.display_reply_to,
|
||||
|
@ -251,8 +235,7 @@ exports.by_recipient = function () {
|
|||
};
|
||||
|
||||
exports.by_search_term = function (term) {
|
||||
var bar = {icon: 'search', description: 'Messages containing "' + term + '"'};
|
||||
exports.activate([['search', term.toLowerCase()]], bar, {allow_collapse: false});
|
||||
exports.activate([['search', term.toLowerCase()]], {allow_collapse: false});
|
||||
load_more_messages();
|
||||
};
|
||||
|
||||
|
@ -264,13 +247,10 @@ exports.show_all_messages = function () {
|
|||
|
||||
$("#zfilt").removeClass('focused_table');
|
||||
$("#zhome").addClass('focused_table');
|
||||
$(".narrowed_to_bar").hide();
|
||||
reset_load_more_status();
|
||||
$("#top_narrowed_whitespace").hide();
|
||||
$("#main_div").removeClass('narrowed_view');
|
||||
$("#searchbox").removeClass('narrowed_view');
|
||||
$("#show_all_messages").attr("disabled", "disabled");
|
||||
$("#currently_narrowed_to").empty();
|
||||
$('#search_query').val('');
|
||||
// Includes scrolling.
|
||||
select_message_by_id(persistent_message_id, {then_scroll: true});
|
||||
|
|
|
@ -14,7 +14,7 @@ $(function () {
|
|||
}
|
||||
|
||||
// Compile Handlebars templates.
|
||||
$.each(['message', 'subscription', 'narrowbar',
|
||||
$.each(['message', 'subscription',
|
||||
'userinfo_popover_title', 'userinfo_popover_content',
|
||||
'timeinfo_popover_content'],
|
||||
function (index, name) {
|
||||
|
|
|
@ -448,18 +448,6 @@ input.recipient_box {
|
|||
-moz-border-radius: 0;
|
||||
}
|
||||
|
||||
.narrowed_to_bar {
|
||||
/* We use display: to toggle whether or not this actually shows up,
|
||||
but we need visibility: visible because its parent,
|
||||
top_statusbar, is visibility: hidden and we don't want to
|
||||
inherit that. */
|
||||
visibility: visible;
|
||||
display: none;
|
||||
padding: 5px 10px;
|
||||
background-color: #DDD;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
.floating_recipient_bar {
|
||||
max-width: 640px;
|
||||
/* from .message_list */
|
||||
|
@ -473,17 +461,6 @@ table.floating_recipient {
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
#narrowlabel {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
padding-left: 46px;
|
||||
}
|
||||
|
||||
#currently_narrowed_to {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.narrowed_view {
|
||||
background-color: #DDD;
|
||||
}
|
||||
|
@ -493,12 +470,6 @@ table.floating_recipient {
|
|||
height: 40px;
|
||||
}
|
||||
|
||||
#top_narrowed_whitespace {
|
||||
visibility: hidden;
|
||||
display: none;
|
||||
height: 34px; /* Height of narrowlabel + floating indicator */
|
||||
}
|
||||
|
||||
#bottom_whitespace {
|
||||
display: block;
|
||||
height: 300px;
|
||||
|
|
|
@ -115,7 +115,7 @@ function expected_messages(table, headings, bodies) {
|
|||
|
||||
function un_narrow() {
|
||||
casper.test.info('Un-narrowing');
|
||||
casper.click('.narrowed_to_bar .close');
|
||||
keypress(27); // Esc
|
||||
}
|
||||
|
||||
// Start of test script.
|
||||
|
|
Loading…
Reference in New Issue