Skip to content

Commit

Permalink
Updated rails so we don't get bitten by the JSON bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgifford committed Feb 11, 2013
2 parents 9231078 + 688b52a commit 5f81fb8
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 65 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ gem 'airbrake'
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'bourbon'
gem 'bourbon', '~> 1.4.0'
gem 'execjs'
gem 'eco'
gem 'uglifier'
Expand Down
107 changes: 54 additions & 53 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,29 @@ GEM
i18n (~> 0.6)
multi_json (~> 1.0)
addressable (2.3.2)
airbrake (3.0.9)
airbrake (3.1.8)
activesupport
builder
json
arel (3.0.2)
awesome_print (1.1.0)
aws-sdk (1.3.8)
httparty (~> 0.7)
aws-sdk (1.8.1.2)
json (~> 1.4)
nokogiri (<= 1.5.0)
nokogiri (>= 1.4.4)
uuidtools (~> 2.1)
bcrypt-ruby (3.0.1)
better_errors (0.3.2)
better_errors (0.5.0)
coderay (>= 1.0.0)
erubis (>= 2.7.0)
erubis (>= 2.6.6)
binding_of_caller (0.6.8)
bourbon (1.4.0)
sass (>= 3.1)
bourne (1.1.2)
mocha (= 0.10.5)
builder (3.0.4)
childprocess (0.3.7)
ffi (~> 1.0, >= 1.0.6)
cloudfuji (0.0.39)
childprocess (0.3.8)
ffi (~> 1.0, >= 1.0.11)
cloudfuji (0.0.46)
highline (>= 1.6.1)
json (>= 1.4.6)
orm_adapter (~> 0.0.3)
Expand All @@ -73,9 +73,9 @@ GEM
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.2.0)
coffee-script-source (1.4.0)
cookiejar (0.3.0)
daemons (1.1.8)
daemons (1.1.9)
database_cleaner (0.9.1)
devise (1.5.3)
bcrypt-ruby (~> 3.0)
Expand All @@ -90,36 +90,38 @@ GEM
eco-source
execjs
eco-source (1.1.0.rc.1)
em-http-request (0.3.0)
addressable (>= 2.0.0)
escape_utils
eventmachine (>= 0.12.9)
em-http-request (1.0.3)
addressable (>= 2.2.3)
cookiejar
em-socksify
eventmachine (>= 1.0.0.beta.4)
http_parser.rb (>= 0.5.3)
em-socksify (0.2.1)
eventmachine (>= 1.0.0.beta.4)
erubis (2.7.0)
escape_utils (0.2.4)
eventmachine (0.12.10)
execjs (1.3.0)
eventmachine (1.0.0)
execjs (1.4.0)
multi_json (~> 1.0)
factory_girl (3.1.0)
factory_girl (4.2.0)
activesupport (>= 3.0.0)
factory_girl_rails (3.1.0)
factory_girl (~> 3.1.0)
factory_girl_rails (4.2.1)
factory_girl (~> 4.2.0)
railties (>= 3.0.0)
faker (1.1.2)
i18n (~> 0.5)
ffi (1.3.1)
guard (1.6.1)
guard (1.6.2)
listen (>= 0.6.0)
lumberjack (>= 1.0.2)
pry (>= 0.9.10)
terminal-table (>= 1.4.3)
thor (>= 0.14.6)
guard-rspec (2.3.3)
guard-rspec (2.4.0)
guard (>= 1.1)
rspec (~> 2.11)
highline (1.6.11)
highline (1.6.15)
hike (1.2.1)
httparty (0.8.1)
multi_json
multi_xml
http_parser.rb (0.5.3)
i18n (0.6.1)
jasmine (1.3.1)
jasmine-core (~> 1.3.1)
Expand All @@ -128,15 +130,14 @@ GEM
selenium-webdriver (>= 0.1.3)
jasmine-core (1.3.1)
journey (1.0.4)
jquery-rails (2.0.1)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
jquery-rails (2.2.1)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.7.7)
kaminari (0.13.0)
kaminari (0.14.1)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
listen (0.7.1)
listen (0.7.2)
lumberjack (1.0.2)
mail (2.4.4)
i18n (>= 0.4.0)
Expand All @@ -148,21 +149,20 @@ GEM
mocha (0.10.5)
metaclass (~> 0.0.1)
multi_json (1.5.1)
multi_xml (0.4.2)
nokogiri (1.5.0)
orm_adapter (0.0.6)
nokogiri (1.5.6)
orm_adapter (0.0.7)
paperclip (3.4.0)
activemodel (>= 3.0.0)
activerecord (>= 3.0.0)
activesupport (>= 3.0.0)
cocaine (~> 0.4.0)
mime-types
pg (0.12.2)
pg (0.14.1)
polyglot (0.3.3)
pry (0.9.10)
pry (0.9.11.4)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.3.1)
slop (~> 3.4)
pry-rails (0.2.2)
pry (>= 0.9.10)
quiet_assets (1.0.1)
Expand Down Expand Up @@ -192,7 +192,7 @@ GEM
rake (10.0.3)
rdoc (3.12.1)
json (~> 1.4)
remotipart (1.0.2)
remotipart (1.0.5)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.12.0)
Expand All @@ -202,19 +202,19 @@ GEM
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.1)
rspec-rails (2.12.1)
rspec-mocks (2.12.2)
rspec-rails (2.12.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
rubycas-client (2.3.8)
rubycas-client (2.3.9)
activesupport
rubyzip (0.9.9)
sass (3.2.5)
sass-rails (3.2.4)
sass-rails (3.2.6)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
Expand All @@ -230,14 +230,15 @@ GEM
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
slop (3.3.3)
slop (3.4.3)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
thin (1.3.1)
sqlite3 (1.3.7)
terminal-table (1.4.5)
thin (1.5.0)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
Expand All @@ -247,13 +248,13 @@ GEM
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.35)
uglifier (1.2.3)
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
uuidtools (2.1.2)
warden (1.1.1)
multi_json (~> 1.0, >= 1.0.2)
uuidtools (2.1.3)
warden (1.2.1)
rack (>= 1.0)
websocket (1.0.6)
websocket (1.0.7)
yajl-ruby (1.1.0)

PLATFORMS
Expand All @@ -266,7 +267,7 @@ DEPENDENCIES
aws-sdk
better_errors
binding_of_caller
bourbon
bourbon (~> 1.4.0)
cloudfuji
coffee-rails
database_cleaner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Kandan.Views.ChannelPane extends Backbone.View

setIdAndData: (container)->
$(container).attr "id", "channels-#{@options.channel.get("id")}"
$(container).attr "class", "channels-pane"
$(container).data "channel-id", @options.channel.get('id')

paginatedActivitiesView: ()->
Expand Down
13 changes: 7 additions & 6 deletions app/assets/javascripts/backbone/views/chatbox.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ class Kandan.Views.Chatbox extends Backbone.View
})

$chatbox.val("")
Kandan.Helpers.Channels.addActivity(
_.extend(activity.toJSON(), {cid: activity.cid, user: Kandan.Data.Users.currentUser()}, created_at: new Date()),
Kandan.Helpers.Activities.ACTIVE_STATE,
true
)

activity.save({},{success: (model, response)->
Kandan.Helpers.Channels.addActivity(
_.extend(activity.toJSON(), {cid: activity.cid, user: Kandan.Data.Users.currentUser()}, created_at: new Date()),
Kandan.Helpers.Activities.ACTIVE_STATE,
true
)

$("#activity-c#{model.cid}").attr("id", "activity-#{model.get('id')}")
$scrollbox = $(event.target).parent().find(".paginated-activities")
$scrollbox = $('.channels-pane')
$scrollbox.prop("scrollTop", $scrollbox.prop('scrollHeight'))
})

Expand Down
22 changes: 17 additions & 5 deletions app/assets/stylesheets/_chat_area.sass
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#channels
margin-top: 0px
margin-top: 12px
overflow: hidden
height: 105%

.ui-widget-header
background: transparent !important
Expand Down Expand Up @@ -109,7 +111,7 @@ html body .ui-tabs .ui-tabs-nav li
background: #FFF
padding: 10px
min-height: 110%
padding-bottom: 70px
padding-bottom: 0px
.pagination
text-decoration: underline
cursor: pointer
Expand All @@ -120,7 +122,8 @@ html body .ui-tabs .ui-tabs-nav li
padding: 0px
padding-right: 20px
padding-left: 20px



#mask_container
position: fixed
top: 0px
Expand All @@ -143,8 +146,8 @@ html body .ui-tabs .ui-tabs-panel, html body #app_body .main-area #mask_containe
html body #app_body .main-area #head-mask
min-height: 0 !important
padding-bottom: 0px !important
height: 20px
+box-shadow(0px 10px 5px -3px #FFFFFF, 0px 7px 4px -3px #FFFFFF, 6px 3px 3px -3px #cccccc, -5px 3px 5px -2px #cccccc)
height: 35px
+box-shadow(0px 5px 0px 0px #FFFFFF, 0px 5px 0px 0px #FFFFFF, 6px 3px 3px -3px #cccccc, -5px 3px 5px -2px #cccccc)

/* html body .ui-tabs .ui-tabs-panel
/* padding: 0px !important
Expand Down Expand Up @@ -193,3 +196,12 @@ html body #app_body .main-area #head-mask
margin-left: -16px
width: 81%
background: #E6EBEE url("/assets/page_bg.png") repeat

.channels-pane
overflow-y: auto
margin-right: -15px
margin-top: -13px




1 change: 1 addition & 0 deletions app/views/main/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@




<div id="kandan">
<div class="header">
<%= image_tag "logo.png", :class=>"logo" %>
Expand Down
Loading

0 comments on commit 5f81fb8

Please sign in to comment.