From 6c3f4bff8cb42beb5b154412641b13a404def4ef Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 26 Dec 2013 17:41:05 +0800 Subject: [PATCH] new stuff for gmail and fb --- app/assets/images/connection/Thumbs.db | Bin 0 -> 6144 bytes app/assets/images/connection/facebook.png | Bin 0 -> 820 bytes app/assets/images/connection/gmail.png | Bin 0 -> 2408 bytes app/assets/images/connection/twitter.png | Bin 0 -> 1475 bytes .../javascripts/desktop/orbitdesktop.js | 109 +++++++++--------- app/controllers/desktop_controller.rb | 3 +- app/controllers/otheraccounts_controller.rb | 13 ++- .../desktop/settings/connections.html.erb | 15 +-- app/views/desktop/settings/themes.html.erb | 2 +- config/routes.rb | 2 +- 10 files changed, 74 insertions(+), 70 deletions(-) create mode 100755 app/assets/images/connection/Thumbs.db create mode 100755 app/assets/images/connection/facebook.png create mode 100755 app/assets/images/connection/gmail.png create mode 100755 app/assets/images/connection/twitter.png diff --git a/app/assets/images/connection/Thumbs.db b/app/assets/images/connection/Thumbs.db new file mode 100755 index 0000000000000000000000000000000000000000..47897e3f3bc28bd197373d4b4c5e43a4ea03dd0a GIT binary patch literal 6144 zcmeH~XH-<#mVhroz=9$N$%5pZbF@&RMa~jRvQQvFG6-UU2#O7ePy_)9Hccp!k|l^G z6j1~U5RnW`rVvDIc(=M=&+3_Z{bpv({F%3U-}T*n&OWE^K5OrjYGjz1bzX>O3WV-axjVKK!`b~ z1fc>s4*~%pw*MvndJ(Vy0>CE(xCmSU{6QTAM1a};?+Yt9V}6gyzwHfw@^hWm9PUWr zK@u{sU5EC!PI7=Epai&p$OG;G0z?^50o(w&U*9qS@lpDd?-9)+04WL4KXET2>VMMp z-!*v>Cp9R)`&R`$yZ!1H0geO#`jiFRWWiA&098=`nTUbAAkpvd@@M`2Xcq%3C}I%) zkK}jXMEyVgBr#{i*b#^G&(=RR*iHii1tF%64g@>`00t075GD|25Ec+t5H^qtAnYI< zAep7@V~Ez6^Yr(=aR4NlFi`yPzVRn3NL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`*hBcI}%;2 ZTH}ujnuyEszh0jIc+vi4{g;Wr-vII$sH^}0 literal 0 HcmV?d00001 diff --git a/app/assets/images/connection/facebook.png b/app/assets/images/connection/facebook.png new file mode 100755 index 0000000000000000000000000000000000000000..f8c4f2190fee49b804e9d61aff25a4bd65a21c9e GIT binary patch literal 820 zcmV-41Izr0P)X)>i_@( zib+I4RA_uwg@uKPiorq=5;%gwhRf~cV=R_EFSqN?yN)+IJ3CLau=~#JJUe^u%+Bty ztFsFn3}7&w&~T^(rblo}=8K`c8=x91Y&xYAcJgk32+p&`GeH*CR=8Jm>iiirCdYBS z?&6o<#>Thp#4=k=ADc}-Ra!gYNYtxUFni-N?%tXrmt9)^h{w;?Qe(6dj$|8?V|f1X zcINVL-~SNCXp^*LWdUHP)e**MBMbniPuBlgmWmd_QSUyPzd7)8X(0@RnRsH{8~Ay& z5x#T%l9Kailcg`7n;^ycI{{w4`Or7kGI+HLwwk`Myf(teJXaX=;OPopuYO65DeO$E zpY5NmuB=EZ4Q+nIB7DLaOQA5rQLoDME>Ixh|AiGco!o`9KHz7K??>sdB-7Z|?jE_G zw8X|{<`yKc86D1nwHNmXR{yJ&&v>-B`WNBo&4WR#zxytXF-o{_3jivx!lq-CFy(pJ zDB(>V7XW7F78Cc2#^+C8o47Z>B&=Vn1%RZ+P-kDY(UH`8sN{Z2XKlQF9?pmrHXSQ$ zI#$?ptgvcwUBr{EY>*rt{%M@dr%bWA^tI^*g3bY;NS=dZx4kEft9w;kxo{Sv)e$ht zC%_DFE5le`-#D^6CLDAQ&<^&M3R8%BxE<`1g_DR0bI!pzS0+q{cQ@3F#1roQ+>@4S ztgz{nPB@md7-L|v%L*Cbpe9Jx-B7c1l1EI~tqeykQ37=wK6Ro70I0f7rg1p7yZ7y( y&ND3;!j29vk`q5*HclD-lh#XNK1`D*?AYJSey%!KFX(�X)>i_@< zzDYzuRA_<4o8590#}$CTvuI~`MGAO_TsYHK;cjt&?_R1Fcs%urKILCi2wcWj2J`s;#;B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52>2YhDetS6CC0Y|Mf4|&5bPQv@AeE!opdvAy*4EBv3j)# zDBV~6=yeuqE8*?G;oVV*6psu0qiAWVkVCZY#Z$(A-KODdTS(;7K70g{5%ieO~dI~Y3Ku5X;QJ| zdAspn%d{m)OjpqClk(N>ms80GUABOQv~kgl5dA9&BT3Q33Q34~brX*aw%AL$x3S9qss4LJ{QA<0;y7@l5R;UmzcT@ will be binded with language, data-lang = string ex "en"|"zh_tw" will toggle all data-langunage throughout the page //enableSharing( dom ) children will be binded with share, data-mode = string ex "public"|"private" will change the mode for all the selected items. the dom with class should have data-link = url data-var = vaiable_name, default will be mode - $.extend($.expr[':'], { 'containsi': function (elem, i, match, array) { return (elem.textContent || elem.innerText || '').toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0; @@ -1349,50 +1348,52 @@ var orbitDesktop = function(dom){ this.initializeSettings.connection = function(){ var bindHandlers = function(){ - $("#connection_setting ul a").click(function(){ + $("#connection_setting ul div.s_action a").click(function(){ var what = $(this).attr("for"), - type = $(this).attr("href"), - $ul = $("#"+type+"_connection"), - usernm = $ul.find("input[type=text]").val(), - pwd = $ul.find("input[type=password]").val(); - switch(what){ - case "save": - case "new": - if(usernm!="" && pwd!=""){ - $ul.find("input[type=text]").replaceWith("
"+usernm+"
") - $ul.find("input[type=password]").replaceWith("
••••••
"); - $(this).text("Edit").attr("for","edit"); - $(this).parent().find("a[for=delete]").show(); - $ul.find("span.c_status").text("Connected").addClass("c_status_on"); - if(what=="save") - what="edit"; - saveaccount(usernm,pwd,type,what); - } - break; - case "edit": - var un = $ul.find("div.usrnm").text(); - $ul.find("div.usrnm").replaceWith(''); - $ul.find("div.pwd").replaceWith(''); - $(this).text("Save").attr("for","save"); - break; - case "delete": - var $this = $(this); - o.confirm({ - message : "Are you sure that you want to remove this account?", - buttons : ["Yes","No"], - highlighted : 2 - },function(reply){ - if(reply){ - $this.hide(); - $ul.find("div.usrnm").replaceWith(''); - $ul.find("div.pwd").replaceWith(''); - $ul.find("span.c_status").text("No Connection").removeClass("c_status_on"); - $this.parent().find("a[for=edit]").text("Connect").attr("for","new"); - saveaccount("","",type,what); + type = $(this).attr("href"), + $ul = $("#"+type+"_connection"), + usernm = $ul.find("input[type=text]").val(), + pwd = $ul.find("input[type=password]").val(); + + switch(what){ + case "save": + case "new": + if(usernm!="" && pwd!=""){ + $ul.find("input[type=text]").replaceWith("
"+usernm+"
") + $ul.find("input[type=password]").replaceWith("
••••••
"); + $(this).text("Edit").attr("for","edit"); + $(this).parent().find("a[for=delete]").show(); + $ul.find("span.c_status").text("Connected").addClass("c_status_on"); + if(what=="save") + what="edit"; + saveaccount(usernm,pwd,type,what); + } - }) - break; - } + break; + case "edit": + var un = $ul.find("div.usrnm").text(); + $ul.find("div.usrnm").replaceWith(''); + $ul.find("div.pwd").replaceWith(''); + $(this).text("Save").attr("for","save"); + break; + case "delete": + var $this = $(this); + o.confirm({ + message : "Are you sure that you want to remove this account?", + buttons : ["Yes","No"], + highlighted : 2 + },function(reply){ + if(reply){ + $this.hide(); + $ul.find("div.usrnm").replaceWith(''); + $ul.find("div.pwd").replaceWith(''); + $ul.find("span.c_status").text("No Connection").removeClass("c_status_on"); + $this.parent().find("a[for=edit]").text("Connect").attr("for","new"); + saveaccount("","",type,what); + } + }) + break; + } }) var $conlist = $('.s_form'), @@ -1418,17 +1419,17 @@ var orbitDesktop = function(dom){ }) } - // $.getJSON("/otheraccounts/getaccounts",function(accounts){ - // $.each(accounts,function(i,account){ - // $ul = $("#"+account.type+"_connection"); - // $ul.find("input[type=text]").replaceWith("
"+account.email+"
") - // $ul.find("input[type=password]").replaceWith("
••••••
"); - // $ul.find("a[for=new]").text("Edit").attr("for","edit"); - // $ul.find("a[for=delete]").show(); - // $ul.find(".c_status").text("Connected").addClass("c_status_on"); - // }) - // bindHandlers(); - // }) + $.getJSON("/otheraccounts/getaccounts",function(accounts){ + $.each(accounts,function(i,account){ + $ul = $("#"+account.type+"_connection"); + $ul.find("input[type=text]").replaceWith("
"+account.email+"
") + $ul.find("input[type=password]").replaceWith("
••••••
"); + $ul.find("a[for=new]").text("Edit").attr("for","edit"); + $ul.find("a[for=delete]").show(); + $ul.find(".c_status").text("Connected").addClass("c_status_on"); + }) + bindHandlers(); + }) } diff --git a/app/controllers/desktop_controller.rb b/app/controllers/desktop_controller.rb index 79c9f926..4e301dc9 100644 --- a/app/controllers/desktop_controller.rb +++ b/app/controllers/desktop_controller.rb @@ -52,7 +52,8 @@ class DesktopController< ApplicationController end def connections - @url = "http://fb.tp.rulingcom.com/login?callback=http://harry.tp.rulingcom.com/facebook/register_fb?user="+current_user.id.to_s + # @url = "http://fb.tp.rulingcom.com/login?callback=http://harry.tp.rulingcom.com/facebook/register_fb?user="+current_user.id.to_s + @user_id = current_user.id.to_s render "desktop/settings/connections", :layout => false end diff --git a/app/controllers/otheraccounts_controller.rb b/app/controllers/otheraccounts_controller.rb index d946bd3c..ee4e9b9f 100644 --- a/app/controllers/otheraccounts_controller.rb +++ b/app/controllers/otheraccounts_controller.rb @@ -1,4 +1,4 @@ -class Desktop::OtheraccountsController< ApplicationController +class OtheraccountsController < ApplicationController require 'open-uri' require 'rexml/document' require 'net/http' @@ -11,12 +11,13 @@ class Desktop::OtheraccountsController< ApplicationController @email = params['email'] @password = params['password'] @account = params['account'] + case @dowhat when "new" OtherAccount.create(user_id: current_user.id, email: @email, encrypted_password: @password, type: @account) when "edit" - @otheraccount = OtherAccount.where(:type.all => [@account],:user_id.all => [current_user.id]) rescue nil - @otheraccount.first.update_attributes(:email => @email, :encrypted_password => @password) + @otheraccount = current_user.other_accounts.where(:type => @account).first rescue nil + @otheraccount.update_attributes(:email => @email, :encrypted_password => @password) when "delete" @otheraccount = OtherAccount.where(:type.all => [@account], :user_id.all => [current_user.id]) rescue nil @otheraccount.destroy_all @@ -27,7 +28,7 @@ class Desktop::OtheraccountsController< ApplicationController end def gmail - @gmailaccount = OtherAccount.where(:type.all => ["gmail"],:user_id.all => [current_user.id]) rescue nil + @gmailaccount = current_user.other_accounts.where(:type => "gmail") rescue nil if @gmailaccount.first != nil @decrypted_password = @gmailaccount.first.encrypted_password.decrypt @email = @gmailaccount.first.email @@ -44,7 +45,7 @@ class Desktop::OtheraccountsController< ApplicationController root = Document.new(response.read_body).root render :text=>root else - msg = "trueAccount setting problem." + msg = "Unauthorized

No account connected.

" respond_to do |m| m.xml {render :xml=>msg} end @@ -72,7 +73,7 @@ class Desktop::OtheraccountsController< ApplicationController end def getaccounts - @accounts = OtherAccount.where(:user_id.all => [current_user.id]).without(:encrypted_password) + @accounts = current_user.other_accounts.without(:encrypted_password) render :json => @accounts.to_json end end \ No newline at end of file diff --git a/app/views/desktop/settings/connections.html.erb b/app/views/desktop/settings/connections.html.erb index 57b186d1..da543b3c 100644 --- a/app/views/desktop/settings/connections.html.erb +++ b/app/views/desktop/settings/connections.html.erb @@ -1,11 +1,11 @@ -
- Connect FaceBook +
+ +
    + +
  • No Connection
  • @@ -39,7 +40,7 @@
- --> +
diff --git a/app/views/desktop/settings/themes.html.erb b/app/views/desktop/settings/themes.html.erb index 9960d374..836ccec9 100644 --- a/app/views/desktop/settings/themes.html.erb +++ b/app/views/desktop/settings/themes.html.erb @@ -7,7 +7,7 @@ -
+
<% @themes.each do |theme| %> diff --git a/config/routes.rb b/config/routes.rb index f8174291..69430665 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -317,7 +317,7 @@ Orbit::Application.routes.draw do match '/twitter/'=>'otheraccounts#twitter' match '/forgmail/'=>'otheraccounts#gmail' match '/otheraccounts/getaccounts'=>'otheraccounts#getaccounts' - match '/save_account_info/'=>'otheraccounts#saveaccountinfo' + match '/desktop/save_account_info/'=>'otheraccounts#saveaccountinfo' match '/desktop_appstore/appstore'=>'desktop_appstore#appstore' match '/desktop_appstore/onlinestore'=>'desktop_appstore#onlinestore'