more JS formatting

This commit is contained in:
lfortin 2011-01-02 19:41:20 -05:00
parent efb711963f
commit 62585aa445
4 changed files with 10 additions and 8 deletions

View file

@ -60,8 +60,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

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

View file

@ -4,7 +4,9 @@ var WebSocketReceiver = {
//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...");
@ -140,7 +142,7 @@ var WebSocketReceiver = {
onPageForAspects: function(aspectIds) {
if(location.pathname == '/aspects' && WebSocketReceiver.onPageOne()) {
return true
return true;
}
var found = false;
$.each(aspectIds, function(index, value) {
@ -152,7 +154,7 @@ var WebSocketReceiver = {
},
onPageForAspect: function(aspectId) {
return (location.href.indexOf(aspectId) != -1 )
return (location.href.indexOf(aspectId) != -1 );
},
onPageOne: function() {