Rename #class* to #stream*.

(imported from commit a8f15f636f3801ba1152f1020e885240984d070e)
This commit is contained in:
Tim Abbott 2012-10-10 17:33:38 -04:00
parent 98ba39700c
commit 5509419084
6 changed files with 24 additions and 24 deletions

View File

@ -39,7 +39,7 @@
</tr> </tr>
<tr id="stream-message"> <tr id="stream-message">
<td colspan="2" class="message_newstyle_class"> <td colspan="2" class="message_newstyle_class">
<input type="text" class="recipient_box" name="stream" id="class" onchange="focus_on('instance')" value="" placeholder="Stream" autocomplete="off"/> <input type="text" class="recipient_box" name="stream" id="stream" onchange="focus_on('instance')" value="" placeholder="Stream" autocomplete="off"/>
</td> </td>
<td class="message_newstyle_instance"> <td class="message_newstyle_instance">
<input type="text" class="recipient_box" name="instance" id="instance" onchange="focus_on('new_message_content')" value="" placeholder="Subject" autocomplete="off"/> <input type="text" class="recipient_box" name="instance" id="instance" onchange="focus_on('new_message_content')" value="" placeholder="Subject" autocomplete="off"/>

View File

@ -78,15 +78,15 @@ var have_initial_messages = {{ have_initial_messages }};
<strong>Can't receive messages</strong> &mdash; try reloading the page. <strong>Can't receive messages</strong> &mdash; try reloading the page.
</div> </div>
<div class="alert alert_sidebar" id="home-error"></div> <div class="alert alert_sidebar" id="home-error"></div>
<div class="alert alert_sidebar" id="class-dne"> <div class="alert alert_sidebar" id="stream-dne">
<p>The class <span class="classname" id="class-dne-name"></span> does not exist.</p> <p>The class <span class="classname" id="stream-dne-name"></span> does not exist.</p>
<button type="button" id="create-it" class="btn btn-primary">Create and send</button> <button type="button" id="create-it" class="btn btn-primary">Create and send</button>
<button type="button" class="btn" onClick="$('#class-dne').stop(true).fadeOut(500);">Cancel message</button> <button type="button" class="btn" onClick="$('#stream-dne').stop(true).fadeOut(500);">Cancel message</button>
</div> </div>
<div class="alert alert_sidebar" id="class-nosub"> <div class="alert alert_sidebar" id="stream-nosub">
<p>You're not subscribed to the class <span class="classname" id="class-nosub-name"></span>.</p> <p>You're not subscribed to the class <span class="classname" id="stream-nosub-name"></span>.</p>
<button type="button" id="sub-it" class="btn btn-primary">Subscribe and send</button> <button type="button" id="sub-it" class="btn btn-primary">Subscribe and send</button>
<button type="button" class="btn" onClick="$('#class-nosub').stop(true).fadeOut(500);">Cancel message</button> <button type="button" class="btn" onClick="$('#stream-nosub').stop(true).fadeOut(500);">Cancel message</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -22,7 +22,7 @@ function clear_compose_box() {
function compose_button() { function compose_button() {
clear_compose_box(); clear_compose_box();
$('#sidebar a[href="#home"]').tab('show'); $('#sidebar a[href="#home"]').tab('show');
show_compose('stream', $("#class")); show_compose('stream', $("#stream"));
} }
function toggle_compose() { function toggle_compose() {
@ -30,7 +30,7 @@ function toggle_compose() {
// In class tab, switch to personals. // In class tab, switch to personals.
show_compose('personal', $("#huddle_recipient")); show_compose('personal', $("#huddle_recipient"));
} else { } else {
show_compose('stream', $("#class")); show_compose('stream', $("#stream"));
} }
} }
@ -43,7 +43,7 @@ function composing_huddle_message() {
} }
function compose_stream_name() { function compose_stream_name() {
return $.trim($("#class").val()); return $.trim($("#stream").val());
} }
function compose_instance() { function compose_instance() {
@ -87,8 +87,8 @@ function check_class_for_send(stream_name) {
// The class doesn't exist // The class doesn't exist
okay = false; okay = false;
$('#send-status').removeClass(status_classes).show(); $('#send-status').removeClass(status_classes).show();
$('#class-dne-name').text(stream_name); $('#stream-dne-name').text(stream_name);
$('#class-dne').show(); $('#stream-dne').show();
submit_buttons().removeAttr('disabled'); submit_buttons().removeAttr('disabled');
hide_compose(); hide_compose();
$('#create-it').focus(); $('#create-it').focus();
@ -98,7 +98,7 @@ function check_class_for_send(stream_name) {
error: function (xhr) { error: function (xhr) {
okay = false; okay = false;
report_error("Error checking subscription", xhr, $("#home-error")); report_error("Error checking subscription", xhr, $("#home-error"));
$("#class").focus(); $("#stream").focus();
submit_buttons().removeAttr('disabled'); submit_buttons().removeAttr('disabled');
} }
}); });
@ -108,7 +108,7 @@ function check_class_for_send(stream_name) {
function validate_class_message() { function validate_class_message() {
var stream_name = compose_stream_name(); var stream_name = compose_stream_name();
if (stream_name === "") { if (stream_name === "") {
compose_error("Please specify a class", $("#class")); compose_error("Please specify a class", $("#stream"));
return false; return false;
} }
@ -128,8 +128,8 @@ function validate_class_message() {
if (!subscribed_to(stream_name)) { if (!subscribed_to(stream_name)) {
// You're not subbed to the class // You're not subbed to the class
$('#send-status').removeClass(status_classes).show(); $('#send-status').removeClass(status_classes).show();
$('#class-nosub-name').text(stream_name); $('#stream-nosub-name').text(stream_name);
$('#class-nosub').show(); $('#stream-nosub').show();
submit_buttons().removeAttr('disabled'); submit_buttons().removeAttr('disabled');
hide_compose(); hide_compose();
$('#sub-it').focus(); $('#sub-it').focus();

View File

@ -79,7 +79,7 @@ function update_autocomplete() {
people_list.sort(); people_list.sort();
// limit number of items so the list doesn't fall off the screen // limit number of items so the list doesn't fall off the screen
$( "#class" ).typeahead({ $( "#stream" ).typeahead({
source: stream_list, source: stream_list,
items: 3 items: 3
}); });
@ -134,12 +134,12 @@ $(function () {
// Prepare the click handler for subbing to a new class to which // Prepare the click handler for subbing to a new class to which
// you have composed a message. // you have composed a message.
$('#create-it').click(function () { $('#create-it').click(function () {
sub_from_home(compose_stream_name(), $('#class-dne')); sub_from_home(compose_stream_name(), $('#stream-dne'));
}); });
// Prepare the click handler for subbing to an existing class. // Prepare the click handler for subbing to an existing class.
$('#sub-it').click(function () { $('#sub-it').click(function () {
sub_from_home(compose_stream_name(), $('#class-nosub')); sub_from_home(compose_stream_name(), $('#stream-nosub'));
}); });
var throttled_scrollhandler = $.throttle(50, function(e) { var throttled_scrollhandler = $.throttle(50, function(e) {
@ -187,7 +187,7 @@ $(function () {
}); });
$('.button-slide').click(function () { $('.button-slide').click(function () {
show_compose('stream', $("#class")); show_compose('stream', $("#stream"));
}); });
$('#sidebar a[href="#subscriptions"]').click(fetch_subs); $('#sidebar a[href="#subscriptions"]').click(fetch_subs);

View File

@ -117,10 +117,10 @@ function respond_to_message(reply_type) {
var message, tabname; var message, tabname;
message = message_dict[selected_message_id]; message = message_dict[selected_message_id];
if (message.type === "stream") { if (message.type === "stream") {
$("#class").val(message.display_recipient); $("#stream").val(message.display_recipient);
$("#instance").val(message.instance); $("#instance").val(message.instance);
} else { } else {
$("#class").val(""); $("#stream").val("");
$("#instance").val(""); $("#instance").val("");
} }
$("#huddle_recipient").val(message.reply_to); $("#huddle_recipient").val(message.reply_to);

View File

@ -245,11 +245,11 @@ img.profile_picture {
display: none; display: none;
} }
#class-dne { #stream-dne {
display: none; display: none;
} }
#class-nosub { #stream-nosub {
display: none; display: none;
} }