From 8c7a0fdf0a0cebe78ee6cfca77cc89cdfd3e5a40 Mon Sep 17 00:00:00 2001 From: Joshua Milton Date: Tue, 26 Jun 2012 16:59:29 +0800 Subject: [PATCH 1/5] test --- config/routes.rb | 386 ++++++++++++------------- lib/desktopapp/desktop_app_appstore.rb | 190 ++++++------ 2 files changed, 288 insertions(+), 288 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 97ddec52e..1cabd3527 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,193 +1,193 @@ -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/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/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/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/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 diff --git a/lib/desktopapp/desktop_app_appstore.rb b/lib/desktopapp/desktop_app_appstore.rb index 5e7f6b875..5ad72f77c 100644 --- a/lib/desktopapp/desktop_app_appstore.rb +++ b/lib/desktopapp/desktop_app_appstore.rb @@ -1,96 +1,96 @@ -class Desktopapp::DesktopAppAppstore < Sinatra::Base - register Sinatra::Warden - get '/desktop_appstore/appstore' do - erb :appstore - end - - get '/desktop_appstore/widgets' do - erb :'appstore/widgets' - end - - get '/desktop_appstore/getuserwidgets' do - # @widgets = current_user.desktop.desktop_widgets - # @groups = Array.new - # @sections = current_user.desktop.sections - - # @sections.each do |section| - # @groups << section.groups - # end - - # @widgets.each do |widget| - # @count = 0; - # @sectionids = Array.new - # @groups.each do |group| - # group.each do |grp| - # @widge = 0 - # @gid = widget.id.to_s - # @widge = grp.tiles.where(:data_content.all => [@gid]).count - # @count = @count + @widge - # if @widge > 0 - # @sectionids << grp.section_id - # end - # end - # end - # if @count > 0 - # widget.status = "Installed" - # widget.section = @sectionids - # else - # widget.status = "Downloaded" - # end - # end - # @widgets.to_json - current_user.to_json - end - - get '/desktop_appstore/widgets_settings' do - what = params["what"] - @widgetid = params["widget"] - @sectionid = params["section"] - @msg = Array.new - case what - when "remove" - @section = Section.find(@sectionid) - @groups = @section.groups - @groups.each do |group| - @tile = group.tiles.where(:data_content.all => [@widgetid]) - if @tile.count > 0 - @thistile = @tile - end - end - @t = Tile.find(@thistile.first.id) - @t.delete - @msg << {"success"=>true} - when "add" - @widget = current_user.desktop.desktop_widgets.find(@widgetid) - @section = Section.find(@sectionid) - @groups = @section.groups - @totalwidgets = 0 - @groups.each do |group| - @tile = group.tiles.where(:data_content.all => [@widgetid]).count - if @tile > 0 - @msg << {"success"=>false,"error"=>"Duplicate widget"} - else - no_of_widgets = group.tiles.where(:data_category.all => ["widget"]).count - @totalwidgets = @totalwidgets + no_of_widgets - end - end - if @totalwidgets >= 12 - @msg << {"success"=>false,"error"=>"Section full"} - else - wshape = @widget.shape - wdata_content = @widgetid - wdata_category = "widget" - wname = @widget.name - if @groups.first.tiles.where(:data_category.all => ["widget"]).count >= 6 - groupid = @groups.last.id - else - groupid = @groups.first.id - end - Tile.create(data_category: wdata_category,data_content: wdata_content, group_id: groupid, position: 10, title: wname, shape: wshape) - @msg << {"success"=>true} - end - end - @msg.to_json - end - +class Desktopapp::DesktopAppAppstore < Sinatra::Base + + get '/desktop_appstore/appstore' do + erb :appstore + end + + get '/desktop_appstore/widgets' do + erb :'appstore/widgets' + end + + get '/desktop_appstore/getuserwidgets' do + # @widgets = current_user.desktop.desktop_widgets + # @groups = Array.new + # @sections = current_user.desktop.sections + + # @sections.each do |section| + # @groups << section.groups + # end + + # @widgets.each do |widget| + # @count = 0; + # @sectionids = Array.new + # @groups.each do |group| + # group.each do |grp| + # @widge = 0 + # @gid = widget.id.to_s + # @widge = grp.tiles.where(:data_content.all => [@gid]).count + # @count = @count + @widge + # if @widge > 0 + # @sectionids << grp.section_id + # end + # end + # end + # if @count > 0 + # widget.status = "Installed" + # widget.section = @sectionids + # else + # widget.status = "Downloaded" + # end + # end + # @widgets.to_json + current_user.to_json + end + + get '/desktop_appstore/widgets_settings' do + what = params["what"] + @widgetid = params["widget"] + @sectionid = params["section"] + @msg = Array.new + case what + when "remove" + @section = Section.find(@sectionid) + @groups = @section.groups + @groups.each do |group| + @tile = group.tiles.where(:data_content.all => [@widgetid]) + if @tile.count > 0 + @thistile = @tile + end + end + @t = Tile.find(@thistile.first.id) + @t.delete + @msg << {"success"=>true} + when "add" + @widget = current_user.desktop.desktop_widgets.find(@widgetid) + @section = Section.find(@sectionid) + @groups = @section.groups + @totalwidgets = 0 + @groups.each do |group| + @tile = group.tiles.where(:data_content.all => [@widgetid]).count + if @tile > 0 + @msg << {"success"=>false,"error"=>"Duplicate widget"} + else + no_of_widgets = group.tiles.where(:data_category.all => ["widget"]).count + @totalwidgets = @totalwidgets + no_of_widgets + end + end + if @totalwidgets >= 12 + @msg << {"success"=>false,"error"=>"Section full"} + else + wshape = @widget.shape + wdata_content = @widgetid + wdata_category = "widget" + wname = @widget.name + if @groups.first.tiles.where(:data_category.all => ["widget"]).count >= 6 + groupid = @groups.last.id + else + groupid = @groups.first.id + end + Tile.create(data_category: wdata_category,data_content: wdata_content, group_id: groupid, position: 10, title: wname, shape: wshape) + @msg << {"success"=>true} + end + end + @msg.to_json + end + end \ No newline at end of file From 3f42a220943c7e925ca776c85982b70c0204be79 Mon Sep 17 00:00:00 2001 From: Joshua Milton Date: Wed, 4 Jul 2012 17:55:30 +0800 Subject: [PATCH 2/5] Books section added --- Gemfile | 110 +- Gemfile.lock | 547 ++-- app/assets/javascripts/orbitdesktop.js | 2819 +++++++++-------- .../desktop_publications_controller.rb | 72 +- app/views/desktop/books.html.erb | 33 + app/views/desktop/books/add.html.erb | 87 + app/views/desktop/books/list.html.erb | 75 + app/views/desktop/books/seminar.html.erb | 1 + config/routes.rb | 398 +-- 9 files changed, 2206 insertions(+), 1936 deletions(-) create mode 100644 app/views/desktop/books.html.erb create mode 100644 app/views/desktop/books/add.html.erb create mode 100644 app/views/desktop/books/list.html.erb create mode 100644 app/views/desktop/books/seminar.html.erb diff --git a/Gemfile b/Gemfile index c572899f8..d33409841 100644 --- a/Gemfile +++ b/Gemfile @@ -1,55 +1,55 @@ -source 'http://rubygems.org' -gem 'rails', '>=3.1.0', '<3.2.0' - -gem "brakeman" - -gem 'bson_ext' -gem 'carrierwave' -gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid' -gem 'devise', '1.5.3' -gem 'exception_notification' # Send error trace -gem 'execjs' -gem 'jquery-rails' - -gem 'kaminari', :git => 'git://github.com/amatsuda/kaminari.git' - -gem 'mini_magick' -gem 'mongoid' -gem "mongo_session_store-rails3" -gem 'nokogiri' -gem 'radius' -gem 'rake' -gem 'ruby-debug19' -gem 'rubyzip' -gem 'sinatra' -#gem 'sinatra-contrib' -gem 'sprockets' -gem 'tinymce-rails' -gem 'therubyracer' if RUBY_PLATFORM.downcase.include?("linux") -gem 'mongoid-encryptor', :require => 'mongoid/encryptor' -#gem 'contacts' - -# Gems used only for assets and not required -# in production environments by default. -group :assets do - gem 'sass-rails' - gem 'coffee-rails' - gem 'uglifier' -end - - -group :test, :development do - gem 'spork' - gem 'database_cleaner' #Strategies for cleaning databases. Can be used to ensure a clean state for testing. - gem "rspec", "~> 2.0" - gem "rspec-rails", "~> 2.0" - gem "factory_girl_rails" - gem "shoulda-matchers" - gem "simplecov" - gem "delorean" - gem "watchr" - gem "spork" - # gem "capybara" - # gem 'yard' - # gem "bluecloth" -end +source 'http://rubygems.org' +gem 'rails', '>=3.1.0', '<3.2.0' + +gem "brakeman" + +gem 'bson_ext' +gem 'carrierwave' +gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid' +gem 'devise', '1.5.3' +gem 'exception_notification' # Send error trace +gem 'execjs' +gem 'jquery-rails' + +gem 'kaminari' + +gem 'mini_magick' +gem 'mongoid' +gem "mongo_session_store-rails3" +gem 'nokogiri' +gem 'radius' +gem 'rake' +gem 'ruby-debug19' +gem 'rubyzip' +gem 'sinatra' +#gem 'sinatra-contrib' +gem 'sprockets' +gem 'tinymce-rails' +gem 'therubyracer' if RUBY_PLATFORM.downcase.include?("linux") +gem 'mongoid-encryptor', :require => 'mongoid/encryptor' +#gem 'contacts' + +# Gems used only for assets and not required +# in production environments by default. +group :assets do + gem 'sass-rails' + gem 'coffee-rails' + gem 'uglifier' +end + + +group :test, :development do + #gem 'spork' + gem 'database_cleaner' #Strategies for cleaning databases. Can be used to ensure a clean state for testing. + gem "rspec", "~> 2.0" + gem "rspec-rails", "~> 2.0" + gem "factory_girl_rails" + gem "shoulda-matchers" + gem "simplecov" + gem "delorean" + gem "watchr" + #gem "spork" + # gem "capybara" + # gem 'yard' + # gem "bluecloth" +end diff --git a/Gemfile.lock b/Gemfile.lock index 339bae0f1..5d5b90ff9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,280 +1,267 @@ -GIT - remote: git://github.com/amatsuda/kaminari.git - revision: 118927a42e57d6608c10d85b8a62acfc7c175974 - specs: - kaminari (0.13.0) - actionpack (>= 3.0.0) - activesupport (>= 3.0.0) - railties (>= 3.0.0) - -GEM - remote: http://rubygems.org/ - specs: - actionmailer (3.1.4) - actionpack (= 3.1.4) - mail (~> 2.3.0) - actionpack (3.1.4) - activemodel (= 3.1.4) - activesupport (= 3.1.4) - builder (~> 3.0.0) - erubis (~> 2.7.0) - i18n (~> 0.6) - rack (~> 1.3.6) - rack-cache (~> 1.1) - rack-mount (~> 0.8.2) - rack-test (~> 0.6.1) - sprockets (~> 2.0.3) - activemodel (3.1.4) - activesupport (= 3.1.4) - builder (~> 3.0.0) - i18n (~> 0.6) - activerecord (3.1.4) - activemodel (= 3.1.4) - activesupport (= 3.1.4) - arel (~> 2.2.3) - tzinfo (~> 0.3.29) - activeresource (3.1.4) - activemodel (= 3.1.4) - activesupport (= 3.1.4) - activesupport (3.1.4) - multi_json (~> 1.0) - archive-tar-minitar (0.5.2) - arel (2.2.3) - bcrypt-ruby (3.0.1) - bcrypt-ruby (3.0.1-x86-mingw32) - brakeman (1.5.1) - activesupport - erubis (~> 2.6) - haml (~> 3.0) - i18n - ruby2ruby (~> 1.2) - ruport (~> 1.6) - sass (~> 3.0) - bson (1.6.1) - bson_ext (1.6.1) - bson (~> 1.6.1) - builder (3.0.0) - carrierwave (0.5.8) - activesupport (~> 3.0) - carrierwave-mongoid (0.1.3) - carrierwave (>= 0.5.6) - mongoid (~> 2.1) - chronic (0.6.7) - coffee-rails (3.1.1) - coffee-script (>= 2.2.0) - railties (~> 3.1.0) - coffee-script (2.2.0) - coffee-script-source - execjs - coffee-script-source (1.2.0) - color (1.4.1) - columnize (0.3.6) - database_cleaner (0.7.1) - delorean (1.2.0) - chronic - devise (1.5.3) - bcrypt-ruby (~> 3.0) - orm_adapter (~> 0.0.3) - warden (~> 1.1) - diff-lcs (1.1.3) - encrypted_strings (0.3.3) - erubis (2.7.0) - exception_notification (2.5.2) - actionmailer (>= 3.0.4) - execjs (1.3.0) - multi_json (~> 1.0) - factory_girl (2.6.3) - activesupport (>= 2.3.9) - factory_girl_rails (1.7.0) - factory_girl (~> 2.6.0) - railties (>= 3.0.0) - fastercsv (1.5.4) - haml (3.1.4) - hike (1.2.1) - hoe (2.16.1) - rake (~> 0.8) - i18n (0.6.0) - jquery-rails (1.0.19) - railties (~> 3.0) - thor (~> 0.14) - json (1.6.5) - linecache19 (0.5.12) - ruby_core_source (>= 0.1.4) - mail (2.3.3) - i18n (>= 0.4.0) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mime-types (1.17.2) - mini_magick (3.4) - subexec (~> 0.2.1) - mongo (1.6.1) - bson (~> 1.6.1) - mongo_session_store-rails3 (3.0.5) - actionpack (>= 3.0) - mongo - mongoid (2.4.6) - activemodel (~> 3.1) - mongo (~> 1.3) - tzinfo (~> 0.3.22) - mongoid-encryptor (0.0.5) - activesupport (~> 3.0) - encrypted_strings (~> 0.3.3) - mongoid (~> 2) - multi_json (1.1.0) - nokogiri (1.5.2) - nokogiri (1.5.2-x86-mingw32) - orm_adapter (0.0.6) - pdf-writer (1.1.8) - color (>= 1.4.0) - transaction-simple (~> 1.3) - polyglot (0.3.3) - rack (1.3.6) - rack-cache (1.2) - rack (>= 0.4) - rack-mount (0.8.3) - rack (>= 1.0.0) - rack-protection (1.2.0) - rack - rack-ssl (1.3.2) - rack - rack-test (0.6.1) - rack (>= 1.0) - radius (0.7.3) - rails (3.1.4) - actionmailer (= 3.1.4) - actionpack (= 3.1.4) - activerecord (= 3.1.4) - activeresource (= 3.1.4) - activesupport (= 3.1.4) - bundler (~> 1.0) - railties (= 3.1.4) - railties (3.1.4) - actionpack (= 3.1.4) - activesupport (= 3.1.4) - rack-ssl (~> 1.3.2) - rake (>= 0.8.7) - rdoc (~> 3.4) - thor (~> 0.14.6) - rake (0.9.2.2) - rdoc (3.12) - json (~> 1.4) - rspec (2.8.0) - rspec-core (~> 2.8.0) - rspec-expectations (~> 2.8.0) - rspec-mocks (~> 2.8.0) - rspec-core (2.8.0) - rspec-expectations (2.8.0) - diff-lcs (~> 1.1.2) - rspec-mocks (2.8.0) - rspec-rails (2.8.1) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec (~> 2.8.0) - ruby-debug-base19 (0.11.25) - columnize (>= 0.3.1) - linecache19 (>= 0.5.11) - ruby_core_source (>= 0.1.4) - ruby-debug19 (0.11.6) - columnize (>= 0.3.1) - linecache19 (>= 0.5.11) - ruby-debug-base19 (>= 0.11.19) - ruby2ruby (1.3.1) - ruby_parser (~> 2.0) - sexp_processor (~> 3.0) - ruby_core_source (0.1.5) - archive-tar-minitar (>= 0.5.2) - ruby_parser (2.3.1) - sexp_processor (~> 3.0) - rubyzip (0.9.6.1) - ruport (1.6.3) - fastercsv - pdf-writer (= 1.1.8) - sass (3.1.15) - sass-rails (3.1.5) - actionpack (~> 3.1.0) - railties (~> 3.1.0) - sass (~> 3.1.10) - tilt (~> 1.3.2) - sexp_processor (3.1.0) - shoulda-matchers (1.0.0) - simplecov (0.6.1) - multi_json (~> 1.0) - simplecov-html (~> 0.5.3) - simplecov-html (0.5.3) - sinatra (1.3.2) - rack (~> 1.3, >= 1.3.6) - rack-protection (~> 1.2) - tilt (~> 1.3, >= 1.3.3) - spork (0.9.0) - spork (0.9.0-x86-mingw32) - win32-process - sprockets (2.0.3) - hike (~> 1.2) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - subexec (0.2.1) - thor (0.14.6) - tilt (1.3.3) - tinymce-rails (3.4.8) - railties (>= 3.1) - transaction-simple (1.4.0) - hoe (>= 1.1.7) - treetop (1.4.10) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.32) - uglifier (1.2.3) - execjs (>= 0.3.0) - multi_json (>= 1.0.2) - warden (1.1.1) - rack (>= 1.0) - watchr (0.7) - win32-api (1.4.8-x86-mingw32) - win32-process (0.6.5) - windows-pr (>= 1.1.2) - windows-api (0.4.1) - win32-api (>= 1.4.5) - windows-pr (1.2.1) - win32-api (>= 1.4.5) - windows-api (>= 0.3.0) - -PLATFORMS - ruby - x86-mingw32 - -DEPENDENCIES - brakeman - bson_ext - carrierwave - carrierwave-mongoid - coffee-rails - database_cleaner - delorean - devise (= 1.5.3) - exception_notification - execjs - factory_girl_rails - jquery-rails - kaminari! - mini_magick - mongo_session_store-rails3 - mongoid - mongoid-encryptor - nokogiri - radius - rails (>= 3.1.0, < 3.2.0) - rake - rspec (~> 2.0) - rspec-rails (~> 2.0) - ruby-debug19 - rubyzip - sass-rails - shoulda-matchers - simplecov - sinatra - spork - sprockets - tinymce-rails - uglifier - watchr +GEM + remote: http://rubygems.org/ + specs: + actionmailer (3.1.4) + actionpack (= 3.1.4) + mail (~> 2.3.0) + actionpack (3.1.4) + activemodel (= 3.1.4) + activesupport (= 3.1.4) + builder (~> 3.0.0) + erubis (~> 2.7.0) + i18n (~> 0.6) + rack (~> 1.3.6) + rack-cache (~> 1.1) + rack-mount (~> 0.8.2) + rack-test (~> 0.6.1) + sprockets (~> 2.0.3) + activemodel (3.1.4) + activesupport (= 3.1.4) + builder (~> 3.0.0) + i18n (~> 0.6) + activerecord (3.1.4) + activemodel (= 3.1.4) + activesupport (= 3.1.4) + arel (~> 2.2.3) + tzinfo (~> 0.3.29) + activeresource (3.1.4) + activemodel (= 3.1.4) + activesupport (= 3.1.4) + activesupport (3.1.4) + multi_json (~> 1.0) + archive-tar-minitar (0.5.2) + arel (2.2.3) + bcrypt-ruby (3.0.1) + bcrypt-ruby (3.0.1-x86-mingw32) + brakeman (1.5.1) + activesupport + erubis (~> 2.6) + haml (~> 3.0) + i18n + ruby2ruby (~> 1.2) + ruport (~> 1.6) + sass (~> 3.0) + bson (1.6.1) + bson_ext (1.6.1) + bson (~> 1.6.1) + builder (3.0.0) + carrierwave (0.5.8) + activesupport (~> 3.0) + carrierwave-mongoid (0.1.3) + carrierwave (>= 0.5.6) + mongoid (~> 2.1) + chronic (0.6.7) + coffee-rails (3.1.1) + coffee-script (>= 2.2.0) + railties (~> 3.1.0) + coffee-script (2.2.0) + coffee-script-source + execjs + coffee-script-source (1.2.0) + color (1.4.1) + columnize (0.3.6) + database_cleaner (0.7.1) + delorean (1.2.0) + chronic + devise (1.5.3) + bcrypt-ruby (~> 3.0) + orm_adapter (~> 0.0.3) + warden (~> 1.1) + diff-lcs (1.1.3) + encrypted_strings (0.3.3) + erubis (2.7.0) + exception_notification (2.5.2) + actionmailer (>= 3.0.4) + execjs (1.3.0) + multi_json (~> 1.0) + factory_girl (2.6.3) + activesupport (>= 2.3.9) + factory_girl_rails (1.7.0) + factory_girl (~> 2.6.0) + railties (>= 3.0.0) + fastercsv (1.5.4) + haml (3.1.4) + hike (1.2.1) + hoe (2.16.1) + rake (~> 0.8) + i18n (0.6.0) + jquery-rails (1.0.19) + railties (~> 3.0) + thor (~> 0.14) + json (1.6.5) + kaminari (0.13.0) + actionpack (>= 3.0.0) + activesupport (>= 3.0.0) + railties (>= 3.0.0) + libv8 (3.3.10.4) + linecache19 (0.5.12) + ruby_core_source (>= 0.1.4) + mail (2.3.3) + i18n (>= 0.4.0) + mime-types (~> 1.16) + treetop (~> 1.4.8) + mime-types (1.17.2) + mini_magick (3.4) + subexec (~> 0.2.1) + mongo (1.6.1) + bson (~> 1.6.1) + mongo_session_store-rails3 (3.0.5) + actionpack (>= 3.0) + mongo + mongoid (2.4.6) + activemodel (~> 3.1) + mongo (~> 1.3) + tzinfo (~> 0.3.22) + mongoid-encryptor (0.0.5) + activesupport (~> 3.0) + encrypted_strings (~> 0.3.3) + mongoid (~> 2) + multi_json (1.1.0) + nokogiri (1.5.2) + nokogiri (1.5.2-x86-mingw32) + orm_adapter (0.0.6) + pdf-writer (1.1.8) + color (>= 1.4.0) + transaction-simple (~> 1.3) + polyglot (0.3.3) + rack (1.3.6) + rack-cache (1.2) + rack (>= 0.4) + rack-mount (0.8.3) + rack (>= 1.0.0) + rack-protection (1.2.0) + rack + rack-ssl (1.3.2) + rack + rack-test (0.6.1) + rack (>= 1.0) + radius (0.7.3) + rails (3.1.4) + actionmailer (= 3.1.4) + actionpack (= 3.1.4) + activerecord (= 3.1.4) + activeresource (= 3.1.4) + activesupport (= 3.1.4) + bundler (~> 1.0) + railties (= 3.1.4) + railties (3.1.4) + actionpack (= 3.1.4) + activesupport (= 3.1.4) + rack-ssl (~> 1.3.2) + rake (>= 0.8.7) + rdoc (~> 3.4) + thor (~> 0.14.6) + rake (0.9.2.2) + rdoc (3.12) + json (~> 1.4) + rspec (2.8.0) + rspec-core (~> 2.8.0) + rspec-expectations (~> 2.8.0) + rspec-mocks (~> 2.8.0) + rspec-core (2.8.0) + rspec-expectations (2.8.0) + diff-lcs (~> 1.1.2) + rspec-mocks (2.8.0) + rspec-rails (2.8.1) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec (~> 2.8.0) + ruby-debug-base19 (0.11.25) + columnize (>= 0.3.1) + linecache19 (>= 0.5.11) + ruby_core_source (>= 0.1.4) + ruby-debug19 (0.11.6) + columnize (>= 0.3.1) + linecache19 (>= 0.5.11) + ruby-debug-base19 (>= 0.11.19) + ruby2ruby (1.3.1) + ruby_parser (~> 2.0) + sexp_processor (~> 3.0) + ruby_core_source (0.1.5) + archive-tar-minitar (>= 0.5.2) + ruby_parser (2.3.1) + sexp_processor (~> 3.0) + rubyzip (0.9.6.1) + ruport (1.6.3) + fastercsv + pdf-writer (= 1.1.8) + sass (3.1.15) + sass-rails (3.1.5) + actionpack (~> 3.1.0) + railties (~> 3.1.0) + sass (~> 3.1.10) + tilt (~> 1.3.2) + sexp_processor (3.1.0) + shoulda-matchers (1.0.0) + simplecov (0.6.1) + multi_json (~> 1.0) + simplecov-html (~> 0.5.3) + simplecov-html (0.5.3) + sinatra (1.3.2) + rack (~> 1.3, >= 1.3.6) + rack-protection (~> 1.2) + tilt (~> 1.3, >= 1.3.3) + sprockets (2.0.3) + hike (~> 1.2) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + subexec (0.2.1) + therubyracer (0.10.1) + libv8 (~> 3.3.10) + thor (0.14.6) + tilt (1.3.3) + tinymce-rails (3.4.8) + railties (>= 3.1) + transaction-simple (1.4.0) + hoe (>= 1.1.7) + treetop (1.4.10) + polyglot + polyglot (>= 0.3.1) + tzinfo (0.3.32) + uglifier (1.2.3) + execjs (>= 0.3.0) + multi_json (>= 1.0.2) + warden (1.1.1) + rack (>= 1.0) + watchr (0.7) + +PLATFORMS + ruby + x86-mingw32 + +DEPENDENCIES + brakeman + bson_ext + carrierwave + carrierwave-mongoid + coffee-rails + database_cleaner + delorean + devise (= 1.5.3) + exception_notification + execjs + factory_girl_rails + jquery-rails + kaminari + mini_magick + mongo_session_store-rails3 + mongoid + mongoid-encryptor + nokogiri + radius + rails (>= 3.1.0, < 3.2.0) + rake + rspec (~> 2.0) + rspec-rails (~> 2.0) + ruby-debug19 + rubyzip + sass-rails + shoulda-matchers + simplecov + sinatra + sprockets + therubyracer + tinymce-rails + uglifier + watchr diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index 31f800740..66cb2a4e8 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -1,1374 +1,1445 @@ -// JavaScript Document -//harry -//Inititialize function will initialize desktop -$.extend($.expr[':'], { - 'containsi': function (elem, i, match, array) { - return (elem.textContent || elem.innerText || '').toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0; - } -}); -$.fn.sort = function(c) { - return this.pushStack([].sort.apply(this, arguments), []); - }; -var sortAscending = function(a, b) { - return $(a).find("h1").text() > $(b).find("h1").text() ? 1 : -1; -}; -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; - this.contentHolder = dom; - this.themesettings = ""; - this.theme = "4f8d3f493b67fcd05f086359"; - this.transitionTime = 500; - this.currenthtml = "desktop.html"; - this.currentface = "home"; - this.desktopData = {"home":"","settings":"","work":"","favorite":"","apps_manager":"","sections":"","journal_p":"","appstore":"","orbit":""}; - this.tp = ""; - this.sectionList; - this.initialize = function(){ - var theme = o.theme; - var custom = false; - $.getJSON("/desktop/get_desktop_settings",{"get":"desktop","desktopid":o.desktopId},function(desktopSettings){ - if(desktopSettings){ - if(desktopSettings.theme!="custom"){ - theme = desktopSettings.theme; - }else{ - theme = "4f8d3f493b67fcd05f086359"; - custom = true; - } - o.theme = theme; - loadTheme(desktopSettings.customtheme,desktopSettings.wallpaper); - }else{loadTheme();} - }) - var loadTheme = function(customtheme,customwallpaper){ //This function will load the theme from database - $.getJSON("/"+o.themefolder+"/"+theme+"/settings/"+theme+".json",function(ts){ - o.themesettings = eval(ts); - $('head').append( $('').attr('href', "/"+o.themefolder+"/"+theme+"/css/"+ts.css)); - if(custom){ - $("head").find("#dyn_css").remove(); - $("head").append(customtheme); - } - $(document).ready(function(){o.loadWallpaper(customwallpaper);o.bindDesktopEvents();o.loadIconCache();o.initializeDesktop();}); - }) - } - } - this.changeTheme = function(theme){ // this function is used for changing theme - o.theme = theme; - $.getJSON("/"+o.themefolder+"/"+theme+"/settings/"+theme+".json",function(ts){ - o.themesettings = eval(ts); - $('head').find("#dyn_css").remove(); - $('head').append( $('').attr('href', "/"+o.themefolder+"/"+theme+"/css/"+ts.css)); - o.loadWallpaper(); - o.loadIconCache(); - }) - }; - this.bindDesktopEvents = function(){ //this function will bind the global handlers to thd desktop, for example doc - $("a#d_app_manager").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.initializeAppSearch(target); - }); - } - }); - $("a#d_desktop").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.initializeDesktop(target); - }); - } - }); - $("a#d_sections").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.initializeSectionsManager(target); - }); - } - }); - $("#d_journal_p").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.initializeJournalPapers(target); - }); - } - }); - $("a#d_settings").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.initializeSettings(target); - }); - } - }); - $("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); - }); - } - }); - $("a#d_orbit").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.initializeOrbitTimeline(target); - }); - } - }); - $(window).resize(function(){ - var ww = $(window).width(); - $("img#thmbackground").attr({"width":ww}); - if( $('.tinycanvas') ){ $('.tinycanvas').tinyscrollbar_update(); } - if($(o.contentHolder).find("div.app_frame").length > 0){ - $(o.contentHolder).find("div.app_frame").each(function(){ - var app_holder_height = $(this).height() - 72; - var app_holder_width = $(this).width(); - $(this).find("div.app_holder").height(app_holder_height); - $(this).find("div.app_holder iframe").attr({"height":app_holder_height,"width":app_holder_width}); - }) - } - }); - var $widget_fn = $('.widget_fn'),$fn_des = $('.fn_des'); - $widget_fn.hover(function(){ - var fn_name = $(this).find('img').attr('alt'),nth = $(this).parents('.d_cate').index(),des_left = $('.dock_child').eq(nth).width(); - $(this).addClass('thmc1'); - $fn_des.text(fn_name).css({'top':nth * 60,'left': des_left + 60}).stop(true, true).fadeIn(); - },function(){ - $(this).removeClass('thmc1'); - $fn_des.stop(true, true).fadeOut(); - }); - }; - - this.initializeDesktop = function(target){ //this is for initializing main desktops that are sections and tiles - if(!target)target = "desktop"; - o.currenthtml = target; - o.currentface = "home"; - - 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({ - connectWith: ".g_col", - tolerance: 'pointer' , - revert: 300, - containment: '#group_wrapper', - 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 = $('