Merge branch 'desktop_joshua' of https://github.com/Rulingcom/orbit into desktop_joshua

Conflicts:
	app/assets/javascripts/orbitdesktop.js
	app/controllers/desktop_publications_controller.rb
	config/routes.rb
This commit is contained in:
Joshua Milton 2012-07-04 18:31:00 +08:00
commit 6b9926539d
8 changed files with 252 additions and 224 deletions

View File

@ -14,11 +14,17 @@ var orbitTimeline = function(dom){
t.dom.html(t.timelineHtml);
$("div.scrollbar").hide();
t.constructTimeScale(function(timelineScale){
console.log(timelineScale);
$("#timeline_scale").html(timelineScale);
var totalyearwidth =timelineScale.find(".year").length * 100;
var totalul = 0;
for(eve in t.events){
t.makeBubble(t.events[eve]);
totalul = $("#scale_wrapper ul").length
$(".t_scale").width((totalul*350) + totalyearwidth);
}
$('.tinycanvas').tinyscrollbar({ axis: 'x'});
});
}
this.constructTimeScale = function(callbackFn){
@ -31,7 +37,8 @@ var orbitTimeline = function(dom){
var cur_mon = paper.created_at.substr(5,2);
var cur_year = dt.getFullYear();
var cdt = paper.created_at.substr(0,7).replace("-","");
var bubbleData = {"fulldate" : t.monthList[parseInt(cur_mon)] +", " + dt.getDate() + ", " + cur_year,"title":paper.title,"jtitle":journal.title,"coauthors":paper.coauthors,"abstract":paper.abstract,"timestamp":cdt}
var formname = (cur_mon.charAt(0) == "0"?cur_mon.charAt(1) : cur_mon)
var bubbleData = {"fulldate" : t.monthList[parseInt(formname)] +", " + dt.getDate() + ", " + cur_year,"title":paper.title,"jtitle":journal.title,"coauthors":paper.coauthors,"abstract":paper.abstract,"timestamp":cdt}
t.events.push(bubbleData);
if(cur_year != year){
year = cur_year;
@ -39,7 +46,8 @@ var orbitTimeline = function(dom){
}
if(cur_mon != mon){
mon = cur_mon;
scale.append($("<div class='scale_region month' data-content='"+cdt+"'><div class='month_heading'>"+t.monthList[parseInt(mon)]+"</div><div class='bubble_list'></div></div>"))
console.log(parseInt(cur_mon));
scale.append($("<div class='scale_region month' data-content='"+cdt+"'><div class='month_heading'>"+t.monthList[parseInt(formname)]+"</div><div class='bubble_list'></div></div>"))
}
});
})

View File

@ -24,7 +24,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":"","appstore":"","orbit":"","books":""};
this.desktopData = {"home":"","settings":"","work":"","favorite":"","apps_manager":"","sections":"","journal_p":"","appstore":"","orbit":""};
this.tp = "";
this.sectionList;
this.initialize = function(){
@ -916,7 +916,6 @@ var orbitDesktop = function(dom){
var bindHandlers = function(){
var timeline = new orbitTimeline("timeline");
timeline.initialize();
$('.tinycanvas').tinyscrollbar({ axis: 'x'});
}
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load("/desktop_orbit/"+target,function(){
@ -1152,7 +1151,10 @@ var orbitDesktop = function(dom){
switch(tfunc){
case 'widgets':
widgets();
break;
break;
case 'onlinestore':
onlinestore();
break;
}
$('.s_menu a').removeClass('thmc1 thmtxt active');
$(this).addClass('thmc1 thmtxt active');
@ -1297,15 +1299,22 @@ var orbitDesktop = function(dom){
})
})
}
var onlinestore = function(){
var bindHandlers = function(){
}
$("div#apps_store div#panel_r").load("/desktop_appstore/onlinestore",function(){
bindHandlers();
})
}
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load("/desktop_appstore/"+target,function(){
widgets();
onlinestore();
bindHandlers();
});
}else{
$(o.contentHolder).html(o.desktopData[o.currentface]);
widgets();
onlinestore();
bindHandlers();
}
}
@ -1442,4 +1451,4 @@ orbitDesktop.prototype.currentLanguage = "en";
orbitDesktop.prototype.currentUsername = "Harry";
var uselessfunction = function(){
$.post("/desktop/temp_func",{sectionid:"4f83e7bbbd98eb041600001d"});
}
}

View File

@ -8,6 +8,10 @@ class DesktopAppstoreController< ApplicationController
render "desktop/appstore/widgets", :layout => false
end
def onlinestore
render "desktop/appstore/onlinestore", :layout => false
end
def getuserwidgets
@widgets = current_user.desktop.desktop_widgets
@groups = Array.new

View File

@ -11,20 +11,8 @@ class DesktopPublicationsController< ApplicationController
render "desktop/journal_pages/add", :layout => false
end
def books
render "desktop/books", :layout => false
end
def books_list
render "desktop/books/list", :layout => false
end
def books_add
render "desktop/books/add", :layout => false
end
def create_journal
Journal.create(user_id: current_user.id, title: "2012, Javascript")
Journal.create(user_id: current_user.id, title: "Google")
b = Array.new
b << {"success"=>"true"}
render :json=>b.to_json
@ -39,4 +27,12 @@ class DesktopPublicationsController< ApplicationController
end
render :json=>data.to_json
end
def delete_journal
@journals = Journal.find("")
@journals.delete
b = Array.new
b << {"success"=>"true"}
render :json=>b.to_json
end
end

View File

@ -7,6 +7,7 @@ class Paper
field :abstract, default: "The concept of microstructure engineering has gained increasingly attention with the goal to quantitatively link the operational parameters of an industrial process to the properties of its product. The key component of this concept is to accurately model the microstructure evolution along the processing path. Modelling of recrystallization in Cuinterconnects will be presented as an example of a conventional process model. Further, the potential of developing next generation process models will be discussed by using models across different length and time scale. The multi-scale modelling approach will be illustrated with a case study for phase transformation in Fe-Mn alloys."
field :level, default: "SCI"
field :coauthors, default: "Allen, Shelly, Eric, Manson, Chris, Clara, Anna, Albee, Vincent, Devin, Chunchi, Ika, Jaoshua, Ray, Matt, Lin, Spen"
field :created_at, type: Date, default: ->{12.months.ago}
belongs_to :journal

View File

@ -10,7 +10,7 @@
<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="onlinestore" 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>

View File

@ -0,0 +1,11 @@
<div class="s_title hh3">Online Store</div>
<div class="tinycanvas hp">
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview vp">
<div class="overview" id="widget_list">
</div>
</div>
</div>
</div>

View File

@ -1,201 +1,200 @@
Orbit::Application.routes.draw do
devise_for :users
# routes for sinatra app
match '/site/set_registered', :to => CentralServerExchangeApp
match '/site/public_key', :to => CentralServerExchangeApp
match '/site/update', :to => GithubApp
match '/purchase/:type', :to => CentralServerExchangeApp
match 'load_orbit_bar' => 'pages#load_orbit_bar'
# routes for admin
namespace :admin do
resources :assets
resources :app_auths
resources :object_auths do
collection do
match 'new/:type/:obj_id',:action => 'new',:via => "get",:as => :init
end
member do
match ':id/create_role',:action => 'create_role',:via => "post",:as => :create_role
match 'remove/:type/:target_id' ,:action=> 'remove_role',:via => "delete",:as =>:remove
end
end
resources :ad_banners do
collection do
match 'new_ad_image' => 'ad_images#new',:as => :new_ad_image,:via => :get
match 'new_ad_image' => 'ad_images#create',:as => :create_ad_image,:via => :post
end
resources :ad_images ,:except => [:show,:index]
end
resources :dashboards
resources :designs do
collection do
get 'upload_package'
post 'upload_package'
end
member do
post 'edit_file' => 'designs#edit_file'
end
end
resources :infos do
get 'add_attribute_field'
end
resources :items
resources :links do
member do
get 'delete'
end
end
resources :pages do
member do
get 'delete'
get 'reload_themes'
end
end
resources :module_apps do
resources :app_auths do
member do
match 'remove/:type/:target_id' ,:action=> 'remove',:via => "delete",:as =>:remove
end
end
member do
match 'assign_manager' ,:action=> 'assign_manager',:via => "post",:as =>:assign_manager
match 'assign_sub_manager' ,:action=> 'assign_sub_manager',:via => "post",:as =>:assign_sub_manager
match 'remove_manager/:app_manager_id' ,:action=> 'remove_manager',:via => "delete",:as =>:remove_manager
match 'remove_sub_manager/:app_sub_manager_id' ,:action=> 'remove_sub_manager',:via => "delete",:as =>:remove_sub_manager
get 'reload_frontend_pages'
end
end
resources :page_parts do
member do
get 'reload_widgets'
end
end
resources :purchases do
collection do
get 'install_app'
end
member do
get 'download'
end
end
resources :roles do
get 'add_sub_role'
get 'add_attribute_field'
end
resources :sites
resources :snippets
resources :tags
resources :translations
resources :users
end
# end admin
namespace :panel do
resources :users
end
match '/desktop/'=>'desktop#index'
# Sinatra Routes start
# match '/desktop/desktop', :to => Desktopapp::DesktopApp
# match '/desktop/app_manager', :to => Desktopapp::DesktopApp
# match '/desktop/sections', :to => Desktopapp::DesktopApp
# match '/desktop/settings', :to => Desktopapp::DesktopApp
# match '/desktop/get_desktop_settings/', :to => Desktopapp::DesktopApp
# match '/desktop/save_desktop_settings/', :to => Desktopapp::DesktopApp
# match '/desktop/getgroups/', :to => Desktopapp::DesktopApp
# match '/desktop/getsectionlist/', :to => Desktopapp::DesktopApp
# match '/desktop/settingthemes/', :to => Desktopapp::DesktopApp
# match '/desktop/settingsections/', :to => Desktopapp::DesktopApp
# match '/desktop/getapplist/', :to => Desktopapp::DesktopApp
# match '/desktop/newpositions/', :to => Desktopapp::DesktopApp
# match '/desktop/settingconnection/', :to => Desktopapp::DesktopApp
# match '/desktop/journal_p/', :to => Desktopapp::DesktopAppPublications
# match '/desktop/journal_p_list/', :to => Desktopapp::DesktopAppPublications
# match '/desktop/journal_p_add/', :to => Desktopapp::DesktopAppPublications
# match '/desktop_publications/getjournals', :to => Desktopapp::DesktopAppPublications
# match '/desktop/twitter/', :to => Desktopapp::Otheraccounts
# match '/desktop/forgmail/', :to => Desktopapp::Otheraccounts
# match '/desktop/getaccounts', :to => Desktopapp::Otheraccounts
# match '/desktop/save_account_info/', :to => Desktopapp::Otheraccounts
# match '/desktop_appstore/appstore', :to => Desktopapp::DesktopAppAppstore
# match '/desktop_appstore/widgets', :to => Desktopapp::DesktopAppAppstore
# match '/desktop_appstore/getuserwidgets', :to => Desktopapp::DesktopAppAppstore
# match '/desktop_appstore/widgets_settings', :to => Desktopapp::DesktopAppAppstore
# Sinatra Routes end
match '/desktop/desktop'=>'desktop#desktop'
match '/desktop/app_manager'=>'desktop#app_manager'
match '/desktop/sections'=>'desktop#sections'
match '/desktop/settings'=>'desktop#settings'
match '/desktop/get_desktop_settings/'=>'desktop#get_desktop_settings'
match '/desktop/save_desktop_settings/'=>'desktop#save_desktop_settings'
match '/desktop/getgroups/'=>'desktop#getgroups'
match '/desktop/getsectionlist/'=>'desktop#getsectionlist'
match '/desktop/settingthemes/'=>'desktop#settingthemes'
match '/desktop/settingsections/'=>'desktop#settingsections'
match '/desktop/getapplist/'=>'desktop#getapplist'
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/books' => 'desktop_publications#books'
match '/desktop/books_list/'=>'desktop_publications#books_list'
match '/desktop/books_add/'=>'desktop_publications#books_add'
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_appstore/getuserwidgets'=>'desktop_appstore#getuserwidgets'
match '/desktop_appstore/widgets_settings'=>'desktop_appstore#widgets_settings'
match '/desktop_orbit/orbit' => 'desktop_orbit#orbit'
match '/desktop_orbit/getevents' => 'desktop_orbit#getevents'
#match '/desktop_orbit/getevents' => 'desktop_publications#create_journal'
match '/desktop/temp_func/'=>'desktop#temp_func'
match '/panel/:app_name/front_end/:app_action/:id' => 'pages#show_from_link', :constraints => lambda { |request|
!request.query_string.include?("inner=true")
}
match '/panel/:app_name/front_end/:app_action' => 'pages#index_from_link', :constraints => lambda { |request|
!request.query_string.include?("inner=true")
}
# routes for gridfs files
match "/gridfs/*path" => "gridfs#serve"
# match "/images/*path" => "gridfs#serve_images"
# match "/admin/pages/images/*path" => "gridfs#serve_images"
# routes for pages to generate
match '*page_name' => 'pages#show', :as => :page, :constraints => lambda{|request|
!request.path.starts_with?("/panel")
}
root :to => 'pages#index'
end
Orbit::Application.routes.draw do
devise_for :users
# routes for sinatra app
match '/site/set_registered', :to => CentralServerExchangeApp
match '/site/public_key', :to => CentralServerExchangeApp
match '/site/update', :to => GithubApp
match '/purchase/:type', :to => CentralServerExchangeApp
match 'load_orbit_bar' => 'pages#load_orbit_bar'
# routes for admin
namespace :admin do
resources :assets
resources :app_auths
resources :object_auths do
collection do
match 'new/:type/:obj_id',:action => 'new',:via => "get",:as => :init
end
member do
match ':id/create_role',:action => 'create_role',:via => "post",:as => :create_role
match 'remove/:type/:target_id' ,:action=> 'remove_role',:via => "delete",:as =>:remove
end
end
resources :ad_banners do
collection do
match 'new_ad_image' => 'ad_images#new',:as => :new_ad_image,:via => :get
match 'new_ad_image' => 'ad_images#create',:as => :create_ad_image,:via => :post
end
resources :ad_images ,:except => [:show,:index]
end
resources :dashboards
resources :designs do
collection do
get 'upload_package'
post 'upload_package'
end
member do
post 'edit_file' => 'designs#edit_file'
end
end
resources :infos do
get 'add_attribute_field'
end
resources :items
resources :links do
member do
get 'delete'
end
end
resources :pages do
member do
get 'delete'
get 'reload_themes'
end
end
resources :module_apps do
resources :app_auths do
member do
match 'remove/:type/:target_id' ,:action=> 'remove',:via => "delete",:as =>:remove
end
end
member do
match 'assign_manager' ,:action=> 'assign_manager',:via => "post",:as =>:assign_manager
match 'assign_sub_manager' ,:action=> 'assign_sub_manager',:via => "post",:as =>:assign_sub_manager
match 'remove_manager/:app_manager_id' ,:action=> 'remove_manager',:via => "delete",:as =>:remove_manager
match 'remove_sub_manager/:app_sub_manager_id' ,:action=> 'remove_sub_manager',:via => "delete",:as =>:remove_sub_manager
get 'reload_frontend_pages'
end
end
resources :page_parts do
member do
get 'reload_widgets'
end
end
resources :purchases do
collection do
get 'install_app'
end
member do
get 'download'
end
end
resources :roles do
get 'add_sub_role'
get 'add_attribute_field'
end
resources :sites
resources :snippets
resources :tags
resources :translations
resources :users
end
# end admin
namespace :panel do
resources :users
end
match '/desktop/'=>'desktop#index'
# Sinatra Routes start
# match '/desktop/desktop', :to => Desktopapp::DesktopApp
# match '/desktop/app_manager', :to => Desktopapp::DesktopApp
# match '/desktop/sections', :to => Desktopapp::DesktopApp
# match '/desktop/settings', :to => Desktopapp::DesktopApp
# match '/desktop/get_desktop_settings/', :to => Desktopapp::DesktopApp
# match '/desktop/save_desktop_settings/', :to => Desktopapp::DesktopApp
# match '/desktop/getgroups/', :to => Desktopapp::DesktopApp
# match '/desktop/getsectionlist/', :to => Desktopapp::DesktopApp
# match '/desktop/settingthemes/', :to => Desktopapp::DesktopApp
# match '/desktop/settingsections/', :to => Desktopapp::DesktopApp
# match '/desktop/getapplist/', :to => Desktopapp::DesktopApp
# match '/desktop/newpositions/', :to => Desktopapp::DesktopApp
# match '/desktop/settingconnection/', :to => Desktopapp::DesktopApp
# match '/desktop/journal_p/', :to => Desktopapp::DesktopAppPublications
# match '/desktop/journal_p_list/', :to => Desktopapp::DesktopAppPublications
# match '/desktop/journal_p_add/', :to => Desktopapp::DesktopAppPublications
# match '/desktop_publications/getjournals', :to => Desktopapp::DesktopAppPublications
# match '/desktop/twitter/', :to => Desktopapp::Otheraccounts
# match '/desktop/forgmail/', :to => Desktopapp::Otheraccounts
# match '/desktop/getaccounts', :to => Desktopapp::Otheraccounts
# match '/desktop/save_account_info/', :to => Desktopapp::Otheraccounts
# match '/desktop_appstore/appstore', :to => Desktopapp::DesktopAppAppstore
# match '/desktop_appstore/widgets', :to => Desktopapp::DesktopAppAppstore
# match '/desktop_appstore/getuserwidgets', :to => Desktopapp::DesktopAppAppstore
# match '/desktop_appstore/widgets_settings', :to => Desktopapp::DesktopAppAppstore
# Sinatra Routes end
match '/desktop/desktop'=>'desktop#desktop'
match '/desktop/app_manager'=>'desktop#app_manager'
match '/desktop/sections'=>'desktop#sections'
match '/desktop/settings'=>'desktop#settings'
match '/desktop/get_desktop_settings/'=>'desktop#get_desktop_settings'
match '/desktop/save_desktop_settings/'=>'desktop#save_desktop_settings'
match '/desktop/getgroups/'=>'desktop#getgroups'
match '/desktop/getsectionlist/'=>'desktop#getsectionlist'
match '/desktop/settingthemes/'=>'desktop#settingthemes'
match '/desktop/settingsections/'=>'desktop#settingsections'
match '/desktop/getapplist/'=>'desktop#getapplist'
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/books' => 'desktop_publications#books'
match '/desktop/books_list/'=>'desktop_publications#books_list'
match '/desktop/books_add/'=>'desktop_publications#books_add'
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_appstore/getuserwidgets'=>'desktop_appstore#getuserwidgets'
match '/desktop_appstore/widgets_settings'=>'desktop_appstore#widgets_settings'
match '/desktop_orbit/orbit' => 'desktop_orbit#orbit'
match '/desktop_orbit/getevents' => 'desktop_orbit#getevents'
#match '/desktop_orbit/getevents' => 'desktop_publications#create_journal'
match '/desktop/temp_func/'=>'desktop#temp_func'
match '/panel/:app_name/front_end/:app_action/:id' => 'pages#show_from_link', :constraints => lambda { |request|
!request.query_string.include?("inner=true")
}
match '/panel/:app_name/front_end/:app_action' => 'pages#index_from_link', :constraints => lambda { |request|
!request.query_string.include?("inner=true")
}
# routes for gridfs files
match "/gridfs/*path" => "gridfs#serve"
# match "/images/*path" => "gridfs#serve_images"
# match "/admin/pages/images/*path" => "gridfs#serve_images"
# routes for pages to generate
match '*page_name' => 'pages#show', :as => :page, :constraints => lambda{|request|
!request.path.starts_with?("/panel")
}
root :to => 'pages#index'
end