diff --git a/app/assets/images/facebook.png b/app/assets/images/facebook.png new file mode 100644 index 00000000..3bfe4bac 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 00000000..dd2d70a8 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 00000000..3c989802 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 00000000..8b8fac07 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 ead5741f..33aab4fc 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 8a9670be..0123aa87 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 96c4787c..f5051cb8 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 00000000..b702974f --- /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 39fec3f0..84f556c2 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 df41ef60..8b7ad2d1 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 00000000..cac2acd7 --- /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 0c793d32..8c9b3d75 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 e51640a1..3a267e74 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