Skip to content
This repository has been archived by the owner on Apr 7, 2018. It is now read-only.

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
hlcfan committed Apr 23, 2013
1 parent fbf0b91 commit ad2194d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
15 changes: 10 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ GIT
railties (>= 3.0)
sass (>= 3.2)

GIT
remote: git://github.com/hlcfan/tqq_2.git
revision: 61d27773e76358f3f3323e1b88bc7f8a592e7916
specs:
tqq_2 (0.0.2)
httparty
httparty (>= 0.5.2)
rest-client (>= 1.6.7)

GIT
remote: git://github.com/ichord/jquery-atwho-rails.git
revision: d6558909f1025464adef8d77926706bbc534bd86
Expand Down Expand Up @@ -197,10 +206,6 @@ GEM
ref
thor (0.18.1)
tilt (1.3.7)
tqq_2 (0.0.2)
httparty
httparty (>= 0.5.2)
rest-client (>= 1.6.7)
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
Expand Down Expand Up @@ -251,7 +256,7 @@ DEPENDENCIES
redcarpet
sass-rails (~> 3.2.3)
therubyracer
tqq_2
tqq_2!
uglifier (>= 1.0.3)
wicked_pdf
will_paginate
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/messages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ def tencent_share
@msg = Message.find(params[:id])
begin
tencent = Tqq_2::Tweet.new(current_user.auth_token, current_user.openid)
logger.info "=============Create Tqq_2 #{tencent}"
text = Nokogiri::HTML(@msg.body).text
tencent.add("#{@msg.user.username}:#{text} - #{@msg.room.name} http://hlcfan.tk/rooms/#{@msg.room.id}")
logger.info "=============Share Tqq_2 Success!"
render :js => "$('#edit_form').modal('hide')"
rescue Exception => e
logger.error "Tencent Weibo Share Error #{e.backtrace}"
Expand Down
6 changes: 3 additions & 3 deletions app/views/messages/_index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
console.log("Got data: " +data["username"] + "|" + data["msg"] + "#{current_user.username}");
online_users = data["online"];
console.log("Now Online_Users:" + online_users);

$("textarea").atwho("@",{'data':online_users});

var flag = false;
console.log(data["msg_id"] + "|" + data["notify_users"]);
for( i in data["notify_users"] )
Expand Down Expand Up @@ -98,7 +97,8 @@
}
});


$("textarea").atwho("@",{'data':online_users});

$("#message_body").keypress(function(e)
{
if(e.which == 13 && !e.shiftKey)
Expand Down

0 comments on commit ad2194d

Please sign in to comment.