app store page added… and few other changes..

This commit is contained in:
Harry Bomrah 2012-05-04 20:28:12 +08:00
parent 4dc82e91a0
commit fcc875bb5d
11 changed files with 131 additions and 11 deletions

View File

@ -26,6 +26,7 @@ gem 'sprockets'
gem 'tinymce-rails' gem 'tinymce-rails'
gem 'therubyracer' if RUBY_PLATFORM.downcase.include?("linux") gem 'therubyracer' if RUBY_PLATFORM.downcase.include?("linux")
gem 'mongoid-encryptor', :require => 'mongoid/encryptor' gem 'mongoid-encryptor', :require => 'mongoid/encryptor'
# gem 'twitter'
# Gems used only for assets and not required # Gems used only for assets and not required
# in production environments by default. # in production environments by default.

View File

@ -88,6 +88,8 @@ GEM
factory_girl_rails (1.7.0) factory_girl_rails (1.7.0)
factory_girl (~> 2.6.0) factory_girl (~> 2.6.0)
railties (>= 3.0.0) railties (>= 3.0.0)
faraday (0.8.0)
multipart-post (~> 1.1)
fastercsv (1.5.4) fastercsv (1.5.4)
haml (3.1.4) haml (3.1.4)
hike (1.2.1) hike (1.2.1)
@ -121,6 +123,7 @@ GEM
encrypted_strings (~> 0.3.3) encrypted_strings (~> 0.3.3)
mongoid (~> 2) mongoid (~> 2)
multi_json (1.1.0) multi_json (1.1.0)
multipart-post (1.1.5)
nokogiri (1.5.2) nokogiri (1.5.2)
nokogiri (1.5.2-x86-mingw32) nokogiri (1.5.2-x86-mingw32)
orm_adapter (0.0.6) orm_adapter (0.0.6)
@ -198,6 +201,7 @@ GEM
tilt (~> 1.3.2) tilt (~> 1.3.2)
sexp_processor (3.1.0) sexp_processor (3.1.0)
shoulda-matchers (1.0.0) shoulda-matchers (1.0.0)
simple_oauth (0.1.7)
simplecov (0.6.1) simplecov (0.6.1)
multi_json (~> 1.0) multi_json (~> 1.0)
simplecov-html (~> 0.5.3) simplecov-html (~> 0.5.3)
@ -223,6 +227,11 @@ GEM
treetop (1.4.10) treetop (1.4.10)
polyglot polyglot
polyglot (>= 0.3.1) 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) tzinfo (0.3.32)
uglifier (1.2.3) uglifier (1.2.3)
execjs (>= 0.3.0) execjs (>= 0.3.0)
@ -276,5 +285,6 @@ DEPENDENCIES
spork spork
sprockets sprockets
tinymce-rails tinymce-rails
twitter
uglifier uglifier
watchr watchr

View File

@ -26,7 +26,7 @@ var orbitDesktop = function(dom){
this.transitionTime = 500; this.transitionTime = 500;
this.currenthtml = "desktop.html"; this.currenthtml = "desktop.html";
this.currentface = "home"; 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.tp = "";
this.sectionList; this.sectionList;
this.initialize = function(){ 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(){ $(window).resize(function(){
var ww = $(window).width(); var ww = $(window).width();
$("img#thmbackground").attr({"width":ww}); $("img#thmbackground").attr({"width":ww});
@ -314,9 +323,7 @@ var orbitDesktop = function(dom){
}; };
this.tempFunc = function(th){ this.tempFunc = function(th){
o.confirm("What","","",function(reply){ $.post("desktop/twitter",function(){});
alert(reply);
})
}; };
this.initializeAppSearch = function(target){ //this is application search ie is app manager initialization this.initializeAppSearch = function(target){ //this is application search ie is app manager initialization
@ -1018,7 +1025,7 @@ var orbitDesktop = function(dom){
bindSecondaryHandlers(); 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){ $.getJSON("/desktop_publications/getjournals",function(journals){
journalData = eval(journals); journalData = eval(journals);
journalview(); journalview();
@ -1045,7 +1052,7 @@ var orbitDesktop = function(dom){
.delay(1500) .delay(1500)
.addClass('op00', 500); .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(); bindHandlers();
}) })
} }
@ -1061,6 +1068,55 @@ var orbitDesktop = function(dom){
list(); 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 this.loadWallpaper = function(wallpaper){ // this is to load new wallpaper
if(!wallpaper)wallpapernm = o.themesettings.background;else wallpapernm = wallpaper if(!wallpaper)wallpapernm = o.themesettings.background;else wallpapernm = wallpaper
var ww = $(window).width(); var ww = $(window).width();

View File

@ -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

View File

@ -3,6 +3,7 @@ class OtheraccountsController< ApplicationController
require 'rexml/document' require 'rexml/document'
require 'net/http' require 'net/http'
require 'net/https' require 'net/https'
# require 'twitter'
include REXML include REXML
def saveaccountinfo def saveaccountinfo
@ -50,6 +51,12 @@ class OtheraccountsController< ApplicationController
end end
def twitter 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 end

View File

@ -0,0 +1,26 @@
<div id="apps_store">
<div id="content">
<div id="header" class="hh3">
<div class="dtitle w2 hh3 hp">
<span class="thmtxth">App Store</span>
</div>
</div>
<div id="holder">
<div id="panel_l" class="ph">
<div class="s_menu sm_v">
<ul id='setting_left_nav'>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Online Store</a></li>
<li><a href="widgets" class="admtxt hh2 w2 hp" onclick='return false;'>Widgets</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Apps</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Registeration</a></li>
</ul>
</div>
</div>
<div id="panel_r" class="ph pw admbg hp">
</div>
<div class="clear"></div>
</div>
</div>
</div>

View File

@ -0,0 +1 @@
this is widget page...

View File

@ -1,10 +1,13 @@
<div id="journal_p"> <div id="journal_p">
<div id="settings">
<div id="content"> <div id="content">
<div id="header" class="hh3"> <div id="header" class="hh3">
<div class="dtitle w2 hh3 hp"> <div class="dtitle w2 hh3 hp">
<span class="thmtxth">Journal Papers</span> <span class="thmtxth">Journal Papers</span>
</div> </div>
<div id="search_app" class="hfn w2 hh2 hp thmc3">
<input type="text" class="ini_input form" value="Search" id="searchbox" />
<input type="submit" class="ini_input submit thmc1" value="Submit"/>
</div>
</div> </div>
<div id="holder"> <div id="holder">
<div id="panel_l" class="ph"> <div id="panel_l" class="ph">

View File

@ -64,5 +64,6 @@
</li> </li>
</ul> </ul>
</div> </div>
<!-- <div style="z-index:999;position:relative;"><button onclick="o.tempFunc()">Twitter</button> -->
</div> </div>
</div> </div>

View File

@ -116,16 +116,20 @@ Orbit::Application.routes.draw do
match '/desktop/newpositions/'=>'desktop#newpositions' match '/desktop/newpositions/'=>'desktop#newpositions'
match '/desktop/settingconnection/'=>'desktop#settingconnection' match '/desktop/settingconnection/'=>'desktop#settingconnection'
match '/desktop/journal_p/'=>'desktop_publications#journal_p' match '/desktop/journal_p/'=>'desktop_publications#journal_p'
match '/desktop/journal_p_list/'=>'desktop_publications#journal_p_list' match '/desktop/journal_p_list/'=>'desktop_publications#journal_p_list'
match '/desktop/journal_p_add/'=>'desktop_publications#journal_p_add' match '/desktop/journal_p_add/'=>'desktop_publications#journal_p_add'
match '/desktop_publications/getjournals' => 'desktop_publications#getjournals' match '/desktop_publications/getjournals' => 'desktop_publications#getjournals'
match '/desktop/twitter/'=>'otheraccounts#twitter'
match '/desktop/forgmail/'=>'otheraccounts#gmail' match '/desktop/forgmail/'=>'otheraccounts#gmail'
match '/desktop/getaccounts'=>'otheraccounts#getaccounts' match '/desktop/getaccounts'=>'otheraccounts#getaccounts'
match '/desktop/save_account_info/'=>'otheraccounts#saveaccountinfo' 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' match '/desktop/temp_func/'=>'desktop#temp_func'
match '/panel/:app_name/front_end/:app_action/:id' => 'pages#show_from_link', :constraints => lambda { |request| match '/panel/:app_name/front_end/:app_action/:id' => 'pages#show_from_link', :constraints => lambda { |request|