diff --git a/Gemfile b/Gemfile index 11a9dc2e..d59de3e8 100644 --- a/Gemfile +++ b/Gemfile @@ -26,6 +26,7 @@ gem 'sprockets' gem 'tinymce-rails' gem 'therubyracer' if RUBY_PLATFORM.downcase.include?("linux") gem 'mongoid-encryptor', :require => 'mongoid/encryptor' +# gem 'twitter' # Gems used only for assets and not required # in production environments by default. diff --git a/Gemfile.lock b/Gemfile.lock index 339bae0f..c81c0574 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,6 +88,8 @@ GEM factory_girl_rails (1.7.0) factory_girl (~> 2.6.0) railties (>= 3.0.0) + faraday (0.8.0) + multipart-post (~> 1.1) fastercsv (1.5.4) haml (3.1.4) hike (1.2.1) @@ -121,6 +123,7 @@ GEM encrypted_strings (~> 0.3.3) mongoid (~> 2) multi_json (1.1.0) + multipart-post (1.1.5) nokogiri (1.5.2) nokogiri (1.5.2-x86-mingw32) orm_adapter (0.0.6) @@ -198,6 +201,7 @@ GEM tilt (~> 1.3.2) sexp_processor (3.1.0) shoulda-matchers (1.0.0) + simple_oauth (0.1.7) simplecov (0.6.1) multi_json (~> 1.0) simplecov-html (~> 0.5.3) @@ -223,6 +227,11 @@ GEM treetop (1.4.10) polyglot polyglot (>= 0.3.1) + twitter (2.2.0) + activesupport (>= 2.3.9, < 4) + faraday (~> 0.7) + multi_json (~> 1.0) + simple_oauth (~> 0.1) tzinfo (0.3.32) uglifier (1.2.3) execjs (>= 0.3.0) @@ -276,5 +285,6 @@ DEPENDENCIES spork sprockets tinymce-rails + twitter uglifier watchr diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index 1db9e4b3..ecb39f0a 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -26,7 +26,7 @@ var orbitDesktop = function(dom){ this.transitionTime = 500; this.currenthtml = "desktop.html"; this.currentface = "home"; - this.desktopData = {"home":"","settings":"","work":"","favorite":"","apps_manager":"","sections":"","journal_p":""}; + this.desktopData = {"home":"","settings":"","work":"","favorite":"","apps_manager":"","sections":"","journal_p":"","appstore":""}; this.tp = ""; this.sectionList; this.initialize = function(){ @@ -112,6 +112,15 @@ var orbitDesktop = function(dom){ }); } }); + $("a#d_appstore").click(function(){ + var target = $(this).attr("href"); + if(o.currenthtml!=target){ + o.desktopData[o.currentface] = $(o.contentHolder).html(); + $("#content").hide("drop",o.transitionTime,function(){ + o.initializeAppstore(target); + }); + } + }); $(window).resize(function(){ var ww = $(window).width(); $("img#thmbackground").attr({"width":ww}); @@ -314,9 +323,7 @@ var orbitDesktop = function(dom){ }; this.tempFunc = function(th){ - o.confirm("What","","",function(reply){ - alert(reply); - }) + $.post("desktop/twitter",function(){}); }; this.initializeAppSearch = function(target){ //this is application search ie is app manager initialization @@ -1018,7 +1025,7 @@ var orbitDesktop = function(dom){ bindSecondaryHandlers(); } - $("div#settings div#panel_r").load("/desktop/journal_p_list",function(){ + $("div#journal_p div#panel_r").load("/desktop/journal_p_list",function(){ $.getJSON("/desktop_publications/getjournals",function(journals){ journalData = eval(journals); journalview(); @@ -1045,7 +1052,7 @@ var orbitDesktop = function(dom){ .delay(1500) .addClass('op00', 500); } - $("div#settings div#panel_r").load("/desktop/journal_p_add",function(){ + $("div#journal_p div#panel_r").load("/desktop/journal_p_add",function(){ bindHandlers(); }) } @@ -1061,6 +1068,55 @@ var orbitDesktop = function(dom){ list(); } }; + this.initializeAppstore = function(target){ + o.currenthtml = target; + o.currentface = "appstore"; + var bindHandlers = function(){ + $('.s_menu a').on({ + click: function(){ + if(!$(this).hasClass('active')){ + var tfunc = $(this).attr('href'); + switch(tfunc){ + case 'widgets': + widgets(); + break; + } + $('.s_menu a').removeClass('thmc1 thmtxt active'); + $(this).addClass('thmc1 thmtxt active'); + } + }, + mouseenter: function(){ + if(!$(this).hasClass('active')){ + $(this).switchClass('admtxt','thmc1 thmtxt',0); + } + }, + mouseleave: function(){ + var t = $(this).hasClass('active') ? '' : 'thmc1 thmtxt'; + $(this).switchClass(t,'admtxt',0); + } + }); + } + var widgets = function(){ + var bindHandlers = function(){ + + } + $("div#apps_store div#panel_r").load("/desktop_appstore/widgets",function(){ + bindHandlers(); + }) + } + + if(!o.desktopData[o.currentface]){ + $(o.contentHolder).empty().load("/desktop_appstore/"+target,function(){ + widgets(); + bindHandlers(); + + }); + }else{ + $(o.contentHolder).html(o.desktopData[o.currentface]); + widgets(); + bindHandlers(); + } + } this.loadWallpaper = function(wallpaper){ // this is to load new wallpaper if(!wallpaper)wallpapernm = o.themesettings.background;else wallpapernm = wallpaper var ww = $(window).width(); diff --git a/app/controllers/desktop_appstore_controller.rb b/app/controllers/desktop_appstore_controller.rb new file mode 100644 index 00000000..3114cafa --- /dev/null +++ b/app/controllers/desktop_appstore_controller.rb @@ -0,0 +1,11 @@ +class DesktopAppstoreController< ApplicationController + + def appstore + render "desktop/appstore", :layout => false + end + + def widgets + render "desktop/appstore/widgets", :layout => false + end + +end \ No newline at end of file diff --git a/app/controllers/desktop_publications_controller.rb b/app/controllers/desktop_publications_controller.rb index ed93c48c..0679daed 100644 --- a/app/controllers/desktop_publications_controller.rb +++ b/app/controllers/desktop_publications_controller.rb @@ -1,7 +1,7 @@ class DesktopPublicationsController< ApplicationController - def journal_p - render "desktop/journal_p", :layout => false - end + def journal_p + render "desktop/journal_p", :layout => false + end def journal_p_list render "desktop/journal_pages/list", :layout => false diff --git a/app/controllers/otheraccounts_controller.rb b/app/controllers/otheraccounts_controller.rb index 0abc14a2..ea6cff24 100644 --- a/app/controllers/otheraccounts_controller.rb +++ b/app/controllers/otheraccounts_controller.rb @@ -3,6 +3,7 @@ class OtheraccountsController< ApplicationController require 'rexml/document' require 'net/http' require 'net/https' + # require 'twitter' include REXML def saveaccountinfo @@ -50,6 +51,12 @@ class OtheraccountsController< ApplicationController end def twitter + # token = "Yh9qYe0lhWk27TZJamnhrA" + # secret = "iBgxJ5BrxfGFLkp7aB6pyCSzd0zcJiYDqJGFBK6Wdo" + # oauth = Twitter::OAuth.new(token,secret) + + # oauth_token = oauth.request_token.token + # oauth_secret = oauth.request_token.secret end diff --git a/app/views/desktop/appstore.html.erb b/app/views/desktop/appstore.html.erb new file mode 100644 index 00000000..c92ac427 --- /dev/null +++ b/app/views/desktop/appstore.html.erb @@ -0,0 +1,26 @@ +
+
+ +
+ + +
+ +
+
+
+
+
\ No newline at end of file diff --git a/app/views/desktop/appstore/widgets.html.erb b/app/views/desktop/appstore/widgets.html.erb new file mode 100644 index 00000000..294d571f --- /dev/null +++ b/app/views/desktop/appstore/widgets.html.erb @@ -0,0 +1 @@ +this is widget page... \ No newline at end of file diff --git a/app/views/desktop/journal_p.html.erb b/app/views/desktop/journal_p.html.erb index d3faa4c7..6dddb734 100644 --- a/app/views/desktop/journal_p.html.erb +++ b/app/views/desktop/journal_p.html.erb @@ -1,10 +1,13 @@
-
diff --git a/app/views/desktop/settings/connections.html.erb b/app/views/desktop/settings/connections.html.erb index fd49915a..37f4d108 100644 --- a/app/views/desktop/settings/connections.html.erb +++ b/app/views/desktop/settings/connections.html.erb @@ -64,5 +64,6 @@
+
diff --git a/config/routes.rb b/config/routes.rb index 99bf251d..27eb9770 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -116,15 +116,19 @@ Orbit::Application.routes.draw do match '/desktop/newpositions/'=>'desktop#newpositions' match '/desktop/settingconnection/'=>'desktop#settingconnection' + match '/desktop/journal_p/'=>'desktop_publications#journal_p' match '/desktop/journal_p_list/'=>'desktop_publications#journal_p_list' match '/desktop/journal_p_add/'=>'desktop_publications#journal_p_add' match '/desktop_publications/getjournals' => 'desktop_publications#getjournals' - + match '/desktop/twitter/'=>'otheraccounts#twitter' match '/desktop/forgmail/'=>'otheraccounts#gmail' match '/desktop/getaccounts'=>'otheraccounts#getaccounts' match '/desktop/save_account_info/'=>'otheraccounts#saveaccountinfo' + + match '/desktop_appstore/appstore'=>'desktop_appstore#appstore' + match '/desktop_appstore/widgets'=>'desktop_appstore#widgets' match '/desktop/temp_func/'=>'desktop#temp_func'