diff --git a/app/assets/images/facebook.png b/app/assets/images/facebook.png new file mode 100644 index 000000000..3bfe4bac2 Binary files /dev/null and b/app/assets/images/facebook.png differ diff --git a/app/assets/images/gmail.png b/app/assets/images/gmail.png new file mode 100644 index 000000000..dd2d70a82 Binary files /dev/null and b/app/assets/images/gmail.png differ diff --git a/app/assets/images/linkedin.png b/app/assets/images/linkedin.png new file mode 100644 index 000000000..3c9898027 Binary files /dev/null and b/app/assets/images/linkedin.png differ diff --git a/app/assets/images/twitter.png b/app/assets/images/twitter.png new file mode 100644 index 000000000..8b8fac07a Binary files /dev/null and b/app/assets/images/twitter.png differ diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index ead5741f7..33aab4fcd 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -481,6 +481,9 @@ var orbitDesktop = function(dom){ case "sections": sections(); break; + case "connection": + connection(); + break; } $("div#settings ul#setting_left_nav li a").removeClass('thmc1 thmtxt').data('clicked',null); $(this).addClass('thmc1 thmtxt').data('clicked',true); @@ -684,6 +687,7 @@ var orbitDesktop = function(dom){ $(this).miniColors("value", o.rgb2hex(color)); }); } + $("div#settings div#panel_r").load("/desktop/settingthemes",function(){ $.getJSON("/desktop/get_desktop_settings",{"get":"theme","desktopid":o.desktopId},function(theme){ $('#st1 .theme_list [id='+theme+']') @@ -696,6 +700,16 @@ var orbitDesktop = function(dom){ }) }) } + + var connection = function(){ + var bindHandlers = function(){ + + } + $("div#settings div#panel_r").load("/desktop/settingconnection",function(){ + bindHandlers(); + }) + + } $(o.contentHolder).empty().load("/desktop/"+target,function(){ bindHandlers(); diff --git a/app/controllers/desktop_controller.rb b/app/controllers/desktop_controller.rb index 8a9670bed..0123aa87e 100644 --- a/app/controllers/desktop_controller.rb +++ b/app/controllers/desktop_controller.rb @@ -38,6 +38,10 @@ class DesktopController< ApplicationController render "desktop/settings/sections", :layout => false end + def settingconnection + render "desktop/settings/connections", :layout => false + end + def journal_p render :layout => false end diff --git a/app/controllers/otheraccounts_controller.rb b/app/controllers/otheraccounts_controller.rb index 96c4787cf..f5051cb8b 100644 --- a/app/controllers/otheraccounts_controller.rb +++ b/app/controllers/otheraccounts_controller.rb @@ -5,6 +5,13 @@ class OtheraccountsController< ApplicationController require 'net/https' include REXML + def saveaccountinfo + @email = params['email'] + @password = params['password'] + @account = params['account'] + OtherAccount.new(email: @email, encrypted_password: @password, type: @account) + end + def gmail url = URI.parse("https://mail.google.com/mail/feed/atom") req = Net::HTTP::Get.new(url.path) diff --git a/app/models/other_accounts.rb b/app/models/other_accounts.rb new file mode 100644 index 000000000..b702974fb --- /dev/null +++ b/app/models/other_accounts.rb @@ -0,0 +1,15 @@ +class OtherAccount + include Mongoid::Document + include Mongoid::Timestamps + + field :type + field :email + field :encrypted_password + + attr_encrypted :encrypted_password, :key => 'rulingorbit.com', :encode => true + + belongs_to :user + + + +end \ No newline at end of file diff --git a/app/models/user/user.rb b/app/models/user/user.rb index 39fec3f0c..84f556c2c 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -17,6 +17,7 @@ class User has_many :managing_apps,:class_name => "AppManager" has_one :desktop, :autosave => true, :dependent => :destroy + has_many :otheraccount, :autosave => true, :dependent => :destroy belongs_to :role has_and_belongs_to_many :sub_roles accepts_nested_attributes_for :attribute_values, :allow_destroy => true diff --git a/app/views/desktop/settings.html.erb b/app/views/desktop/settings.html.erb index df41ef601..8b7ad2d1f 100644 --- a/app/views/desktop/settings.html.erb +++ b/app/views/desktop/settings.html.erb @@ -14,7 +14,7 @@
  • Account
  • Sections
  • Theme
  • -
  • Connection
  • +
  • Connection
  • diff --git a/app/views/desktop/settings/connections.html.erb b/app/views/desktop/settings/connections.html.erb new file mode 100644 index 000000000..cac2acd75 --- /dev/null +++ b/app/views/desktop/settings/connections.html.erb @@ -0,0 +1,35 @@ + +
    +
    +
    +
    +
    Connections
    + + + + + + + + + + + + + + + + + + + + + + +
    +
    + Save +
    +
    +
    +
    diff --git a/config/routes.rb b/config/routes.rb index 0c793d327..8c9b3d756 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -117,7 +117,10 @@ Orbit::Application.routes.draw do match '/desktop/journal_p/'=>'desktop#journal_p' match '/desktop/journal_p_list/'=>'desktop#journal_p_list' match '/desktop/journal_p_add/'=>'desktop#journal_p_add' + match '/desktop/settingconnection/'=>'desktop#settingconnection' match '/desktop/forgmail/'=>'otheraccounts#gmail' + match '/desktop/save_account_info/'=>'otheraccounts#saveaccountinfo' + match '/desktop/temp_func/'=>'desktop#temp_func' match '/panel/:app_name/front_end/:app_action/:id' => 'pages#show_from_link', :constraints => lambda { |request| diff --git a/public/desktop_widgets/gmail/gmail.js b/public/desktop_widgets/gmail/gmail.js index e51640a15..3a267e746 100644 --- a/public/desktop_widgets/gmail/gmail.js +++ b/public/desktop_widgets/gmail/gmail.js @@ -42,4 +42,14 @@ var gmail = function(){ } }); } +} + +var saveaccount = function(){ + var usernm = $("#gmail input[type=text]").val(); + var pwd = $("#gmail input[type=password]").val(); + usernm = "hr@rulingcom.com"; + pwd = "hr08973"; + if(usernm!="" && pwd!=""){ + $.post("/desktop/save_account_info",{email:usernm,password:pwd,account:"gmail"}) + } } \ No newline at end of file