From 3f42a220943c7e925ca776c85982b70c0204be79 Mon Sep 17 00:00:00 2001 From: Joshua Milton Date: Wed, 4 Jul 2012 17:55:30 +0800 Subject: [PATCH] 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 c572899f..d3340984 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 339bae0f..5d5b90ff 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 31f80074..66cb2a4e 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 = $('