Merge branch 'desktop_harry' into desktop_devin
This commit is contained in:
commit
81ff0f2c1c
2
Gemfile
2
Gemfile
|
@ -26,7 +26,7 @@ gem 'sprockets'
|
|||
gem 'tinymce-rails'
|
||||
gem 'therubyracer' if RUBY_PLATFORM.downcase.include?("linux")
|
||||
gem 'mongoid-encryptor', :require => 'mongoid/encryptor'
|
||||
# gem 'twitter'
|
||||
#gem 'contacts'
|
||||
|
||||
# Gems used only for assets and not required
|
||||
# in production environments by default.
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
// JavaScript Document
|
||||
//harry
|
||||
//Inititialize function will initialize desktop
|
||||
|
@ -16,7 +15,6 @@ var sortAscending = function(a, b) {
|
|||
var sortDescending = function(a, b) {
|
||||
return $(a).find("h1").text() < $(b).find("h1").text() ? 1 : -1;
|
||||
};
|
||||
|
||||
var orbitDesktop = function(dom){
|
||||
orbitDesktopAPI.apply(this);
|
||||
o = this;
|
||||
|
@ -145,7 +143,7 @@ var orbitDesktop = function(dom){
|
|||
var bindHandlers = function(){ // this function will bind all the handlers in the desktop
|
||||
var groupWrapperWidth = 0;
|
||||
$("div#desktop .group").each(function(){groupWrapperWidth+=$(this).outerWidth(true);});
|
||||
|
||||
var grps = new Array;
|
||||
$("div#desktop #group_wrapper").css("width",groupWrapperWidth);
|
||||
var first = true;
|
||||
$("div#desktop .g_col").sortable({
|
||||
|
@ -156,6 +154,27 @@ var orbitDesktop = function(dom){
|
|||
helper: 'clone',
|
||||
stop:function(){
|
||||
first = true;
|
||||
var grpwidth = 0;
|
||||
for(i in grps){
|
||||
var grp = grps[i];
|
||||
if(grp.find(".element").length == 0){
|
||||
grp.animate({"width":"0px"},500,function(){$(this).remove();});
|
||||
grpwidth+=225;
|
||||
}
|
||||
}
|
||||
grps = [];
|
||||
$("#group_wrapper").width($("#group_wrapper").width()-grpwidth);
|
||||
},
|
||||
start:function(){
|
||||
$("#group_wrapper").find("div.group").each(function(i,par){
|
||||
var nextnumber = $(this).find("ul").length;
|
||||
$newcol = $('<ul class="g_col g_col_w2 col'+nextnumber+' ui-sortable">');
|
||||
$(this).append($newcol);
|
||||
$newcol.sortable({connectWith: '.g_col'});
|
||||
grps.push($newcol);
|
||||
$("#group_wrapper").width($("#group_wrapper").width()+225);
|
||||
});
|
||||
$("div#desktop .g_col").sortable('refresh');
|
||||
},
|
||||
update:function(){
|
||||
if(first){
|
||||
|
@ -180,7 +199,11 @@ var orbitDesktop = function(dom){
|
|||
if ((last.top+lasth)>528){
|
||||
$(this).sortable('cancel');
|
||||
}
|
||||
}else{$(this).remove();}
|
||||
}
|
||||
$("#group_wrapper ul").each(function(){
|
||||
if($(this).find('.element').length == 0)
|
||||
$(this).animate({"width":"0px"},500,function(){$(this).remove();});
|
||||
})
|
||||
},
|
||||
receive: function(event, ui){
|
||||
var s = $(this).find('.element').length,
|
||||
|
@ -1174,6 +1197,7 @@ var orbitDesktop = function(dom){
|
|||
.addClass('op00', 500);
|
||||
}
|
||||
$("div#apps_store div#panel_r").load("/desktop_appstore/widgets",function(){
|
||||
|
||||
$.getJSON("/desktop_appstore/getuserwidgets",function(userwidgets){
|
||||
var column = $('<div class="g_col list_t"><ul></ul></div>'),
|
||||
counter = 1,
|
||||
|
@ -1211,7 +1235,7 @@ var orbitDesktop = function(dom){
|
|||
if(s_name_list_not)
|
||||
li.find("div.not_status").html("Install on "+s_name_list_not);
|
||||
}else{
|
||||
li.find("div.not_status").html("Install on "+o.sectionList[0].name+", "+o.sectionList[1].name+", "+o.sectionList[2].name+", "+o.sectionList[3].name);
|
||||
li.find("div.not_status").html("Install on <a href='addthis' for='"+o.sectionList[0]._id+"' style='text-decoration:underline;'>"+o.sectionList[0].name+"</a> <a href='addthis' for='"+o.sectionList[1]._id+"' style='text-decoration:underline;'>"+o.sectionList[1].name+"</a> <a href='addthis' for='"+o.sectionList[2]._id+"' style='text-decoration:underline;'>"+o.sectionList[2].name+"</a> <a href='addthis' for='"+o.sectionList[3]._id+"' style='text-decoration:underline;'>"+o.sectionList[3].name)+"</a>";
|
||||
}
|
||||
//console.log(section_names);
|
||||
column.find("ul").append(li);
|
||||
|
|
|
@ -32,6 +32,7 @@ class OtheraccountsController< ApplicationController
|
|||
@decrypted_password = @gmailaccount.first.encrypted_password.decrypt
|
||||
@email = @gmailaccount.first.email
|
||||
url = URI.parse("https://mail.google.com/mail/feed/atom")
|
||||
#url = URI.parse("https://www.google.com/m8/feeds/contacts/default/full")
|
||||
req = Net::HTTP::Get.new(url.path)
|
||||
req.basic_auth @email, @decrypted_password
|
||||
req.content_type = 'text/xml'
|
||||
|
@ -57,6 +58,16 @@ class OtheraccountsController< ApplicationController
|
|||
|
||||
# oauth_token = oauth.request_token.token
|
||||
# oauth_secret = oauth.request_token.secret
|
||||
#require File.dirname(__FILE__)+"/../lib/contacts"
|
||||
@gmailaccount = OtherAccount.where(:type.all => ["gmail"],:user_id.all => [current_user.id]) rescue nil
|
||||
if @gmailaccount.first != nil
|
||||
login = @gmailaccount.first.encrypted_password.decrypt
|
||||
password = @gmailaccount.first.email
|
||||
|
||||
@contacts = Contacts::Gmail.new(login, password).contacts
|
||||
|
||||
render :json => @contacts.to_json
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue