Merge remote branch 'lfortin/js-formatting'

Conflicts:
	public/javascripts/web-socket-receiver.js
This commit is contained in:
Raphael Sofaer 2011-02-11 11:31:30 -08:00
commit c1844c9be2
5 changed files with 16 additions and 13 deletions

View file

@ -72,8 +72,8 @@ $(document).ready(function() {
$("#no_contacts").fadeOut(200);
}
$(".badges").prepend(json['badge_html']);
$(this).parent().html(json['button_html']);
$(".badges").prepend(json.badge_html);
$(this).parent().html(json.button_html);
$(this).fadeTo(200,1);
});

View file

@ -9,7 +9,7 @@ $(document).ready(function() {
$("#edit_photo_toggle").bind('click', function(evt) {
evt.preventDefault();
$("#photo_edit_options").toggle();
$(".edit_photo input[type='text']").first().focus();
$(".edit_photo input:text").first().focus();
});
$('.edit_photo').bind('ajax:loading', function(data, json, xhr) {
@ -26,7 +26,7 @@ $(document).ready(function() {
$('.edit_photo').bind('ajax:success', function(data, json, xhr) {
json = $.parseJSON(json);
$(".edit_photo input[type='text']").val(json.photo.caption);
$(".edit_photo input:text").val(json.photo.caption);
$("#caption").html(json.photo.caption);
$("#show_photo").find("img").fadeTo(200,1);
$("#photo_spinner").hide();

View file

@ -56,8 +56,8 @@ var Stream = {
// reshare button action
$stream.delegate(".reshare_button", "click", function(evt) {
evt.preventDefault();
button = $(this)
box = button.siblings(".reshare_box");
var button = $(this);
var box = button.siblings(".reshare_box");
if (box.length > 0) {
button.toggleClass("active");
box.toggle();

View file

@ -5,7 +5,7 @@
var View = {
initialize: function() {
/* Buttons */
$("input[type='submit']").addClass("button");
$("input:submit").addClass("button");
/* Tooltips */
this.tooltips.bindAll();

View file

@ -1,10 +1,13 @@
var WebSocketReceiver = {
initialize: function(url) {
ws = new WebSocket(url);
var ws = new WebSocket(url);
WSR.socket = ws;
//Attach onmessage to websocket
ws.onmessage = WSR.onMessage;
ws.onclose = function() { WSR.debug("socket closed"); };
ws.onclose = function() {
WSR.debug("socket closed");
};
ws.onopen = function() {
ws.send(location.pathname);
WSR.debug("connected...");
@ -39,9 +42,9 @@ var WebSocketReceiver = {
},
processPerson: function(response) {
form = $('.webfinger_form');
var form = $('.webfinger_form');
form.siblings('#loader').hide();
result_ul = form.siblings('#request_result');
var result_ul = form.siblings('#request_result');
if(response.status == 'fail') {
result_ul.siblings('.error').show();
result_ul.find('.error').text(response.response).show();
@ -88,11 +91,11 @@ var WebSocketReceiver = {
if( $(".comment[data-guid='"+commentId+"']").length == 0 ) {
post = $("*[data-guid='"+postId+"']'");
var post = $("*[data-guid='"+postId+"']'");
$('.comments li:last', post ).before(
$(html).fadeIn("fast", function(){})
);
toggler = $('.show_post_comments', post);
var toggler = $('.show_post_comments', post);
if(toggler.length > 0){
toggler.html(