diff --git a/Gemfile b/Gemfile
index 8c3001b..d4ebd4c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,19 +1,16 @@
source 'http://rubygems.org'
-gem 'rake' #, '0.8.7'
+gem 'rake'
-gem 'rails', '3.0.5'
-gem 'jquery-rails', '>= 0.2.6'
-
-gem 'sqlite3'
-gem 'sqlite3-ruby', :require => 'sqlite3'
+gem 'rails', '3.1.3'
+gem 'jquery-rails', '1.0.12'
# templating
gem 'haml-rails'
-gem "sass"
-# for searching youtube
-gem "youtube_it"
+# for youtube and 7digital APIs
+gem 'youtube_it'
+gem '7digital'
# for using last.fm api
gem 'typhoeus'
@@ -22,15 +19,6 @@ gem 'typhoeus'
gem 'redis'
gem 'redis-namespace'
-# for using 7digital api
-gem '7digital'
-
-# for asset packaging
-gem 'closure'
-gem 'jammit', :git => "git://github.com/documentcloud/jammit.git"
-gem 'win32-open3-19' # win32-open3 in order to use POpen4 on Win32 (dependency of jammit)
-
-
# for converting json/xml to object
gem 'json'
gem 'hashie'
@@ -42,19 +30,23 @@ gem 'oa-openid', :require => 'omniauth/openid'
# for file upload ( -> avatar )
gem 'paperclip', '~> 2.3'
+gem 'jammit', '~> 0.6.5' #, :git => 'git://github.com/documentcloud/jammit.git'
-# youtube search
-gem 'youtube_it'
-
-group :development, :test do
- # for html2haml
- # gem 'hpricot'
- gem 'ruby_parser'
-
- # alternative servers (because openID URIs are too long for WEBRick)
- gem 'mongrel', '1.2.0.pre2'
-
+group :assets do
+ gem 'sass-rails', '~> 3.1.5'
+ gem 'coffee-rails', '~> 3.1.1'
+ gem 'uglifier', '>= 1.0.3'
+ gem 'closure'
+ gem 'win32-open3-19' # win32-open3 in order to use POpen4 on Win32 (dependency of jammit)
end
-# Deploy with Capistrano
-# gem 'capistrano'
+group :development, :test do
+ gem 'sqlite3'
+ gem 'sqlite3-ruby', :require => 'sqlite3'
+
+ # gem 'hpricot' # for html2haml
+ gem 'ruby_parser'
+
+ # alternative servers (because openID URIs are too long for WEBRick)
+ gem 'mongrel', '1.2.0.pre2'
+end
diff --git a/Gemfile.lock b/Gemfile.lock
index c3645d5..8b4a021 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,190 +1,211 @@
GEM
remote: http://rubygems.org/
specs:
- 7digital (0.0.6)
- peachy (>= 0.3.5)
- will_paginate (>= 2.3.15)
- POpen4 (0.1.4)
- Platform (>= 0.4.0)
- open4
- Platform (0.4.0)
- abstract (1.0.0)
- actionmailer (3.0.5)
- actionpack (= 3.0.5)
- mail (~> 2.2.15)
- actionpack (3.0.5)
- activemodel (= 3.0.5)
- activesupport (= 3.0.5)
- builder (~> 2.1.2)
- erubis (~> 2.6.6)
- i18n (~> 0.4)
- rack (~> 1.2.1)
- rack-mount (~> 0.6.13)
- rack-test (~> 0.5.7)
- tzinfo (~> 0.3.23)
- activemodel (3.0.5)
- activesupport (= 3.0.5)
- builder (~> 2.1.2)
- i18n (~> 0.4)
- activerecord (3.0.5)
- activemodel (= 3.0.5)
- activesupport (= 3.0.5)
- arel (~> 2.0.2)
- tzinfo (~> 0.3.23)
- activeresource (3.0.5)
- activemodel (= 3.0.5)
- activesupport (= 3.0.5)
- activesupport (3.0.5)
- addressable (2.2.6)
- arel (2.0.10)
- bcrypt-ruby (2.1.4)
- bcrypt-ruby (2.1.4-x86-mingw32)
- builder (2.1.2)
- closure (1.3.0)
- rack (>= 1.0.0)
- cocaine (0.1.0)
+ 7digital (0.1.2)
+ nokogiri (>= 1.5.0)
+ oauth (>= 0.4.5)
+ actionmailer (3.2.8)
+ actionpack (= 3.2.8)
+ mail (~> 2.4.4)
+ actionpack (3.2.8)
+ activemodel (= 3.2.8)
+ activesupport (= 3.2.8)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.4)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.3)
+ activemodel (3.2.8)
+ activesupport (= 3.2.8)
+ builder (~> 3.0.0)
+ activerecord (3.2.8)
+ activemodel (= 3.2.8)
+ activesupport (= 3.2.8)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.8)
+ activemodel (= 3.2.8)
+ activesupport (= 3.2.8)
+ activesupport (3.2.8)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ bcrypt-ruby (3.0.1)
+ builder (3.0.4)
+ cocaine (0.4.2)
+ coffee-rails (3.2.2)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.2.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.4.0)
daemons (1.0.10)
- devise (1.4.1)
- bcrypt-ruby (~> 2.1.2)
- orm_adapter (~> 0.0.3)
- warden (~> 1.0.3)
- erubis (2.6.6)
- abstract (>= 1.0.0)
- faraday (0.6.1)
- addressable (~> 2.2.4)
- multipart-post (~> 1.1.0)
- rack (< 2, >= 1.1.0)
+ devise (2.1.2)
+ bcrypt-ruby (~> 3.0)
+ orm_adapter (~> 0.1)
+ railties (~> 3.1)
+ warden (~> 1.2.1)
+ erubis (2.7.0)
+ ethon (0.5.7)
+ ffi (~> 1.2.0)
+ mime-types (~> 1.18)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
+ faraday (0.8.4)
+ multipart-post (~> 1.1)
+ ffi (1.2.0)
gem_plugin (0.2.3)
- haml (3.1.2)
- haml-rails (0.3.4)
- actionpack (~> 3.0)
- activesupport (~> 3.0)
- haml (~> 3.0)
- railties (~> 3.0)
- hashie (1.0.0)
- i18n (0.6.0)
- jammit (0.6.3)
- yui-compressor (>= 0.9.3)
+ haml (3.1.7)
+ haml-rails (0.3.5)
+ actionpack (>= 3.1, < 4.1)
+ activesupport (>= 3.1, < 4.1)
+ haml (~> 3.1)
+ railties (>= 3.1, < 4.1)
+ hashie (1.2.0)
+ hike (1.2.1)
+ httpauth (0.2.0)
+ i18n (0.6.1)
+ journey (1.0.4)
jquery-rails (1.0.12)
railties (~> 3.0)
thor (~> 0.14)
- json (1.5.3)
- mail (2.2.19)
- activesupport (>= 2.3.6)
+ json (1.7.5)
+ jwt (0.1.5)
+ multi_json (>= 1.0)
+ mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mime-types (1.16)
+ mime-types (1.19)
mongrel (1.2.0.pre2)
daemons (~> 1.0.10)
gem_plugin (~> 0.2.3)
- mongrel (1.2.0.pre2-x86-mingw32)
- gem_plugin (~> 0.2.3)
- multi_json (1.0.3)
- multi_xml (0.2.2)
- multipart-post (1.1.2)
- oa-core (0.2.6)
- oa-oauth (0.2.6)
- faraday (~> 0.6.1)
- multi_json (~> 1.0.0)
- multi_xml (~> 0.2.2)
- oa-core (= 0.2.6)
- oauth (~> 0.4.0)
- oauth2 (~> 0.4.1)
- oa-openid (0.2.6)
- oa-core (= 0.2.6)
- rack-openid (~> 1.3.1)
- ruby-openid-apps-discovery (~> 1.2.0)
- oauth (0.4.5)
- oauth2 (0.4.1)
- faraday (~> 0.6.1)
- multi_json (>= 0.0.5)
- open4 (1.1.0)
- orm_adapter (0.0.5)
- paperclip (2.3.12)
+ multi_json (1.5.0)
+ multipart-post (1.1.5)
+ nokogiri (1.5.6)
+ oa-core (0.0.5)
+ rack (~> 1.1)
+ oa-oauth (0.0.1)
+ json
+ nokogiri
+ oa-core (~> 0.0.0)
+ oauth
+ oauth2
+ oa-openid (0.0.5)
+ oa-core (= 0.0.5)
+ rack-openid (~> 1.1.1)
+ ruby-openid-apps-discovery
+ oauth (0.4.7)
+ oauth2 (0.8.0)
+ faraday (~> 0.8)
+ httpauth (~> 0.1)
+ jwt (~> 0.1.4)
+ multi_json (~> 1.0)
+ rack (~> 1.2)
+ orm_adapter (0.4.0)
+ paperclip (2.8.0)
activerecord (>= 2.3.0)
activesupport (>= 2.3.2)
cocaine (>= 0.0.2)
- peachy (0.4.1)
- polyglot (0.3.1)
- rack (1.2.3)
- rack-mount (0.6.14)
- rack (>= 1.0.0)
- rack-openid (1.3.1)
- rack (>= 1.1.0)
- ruby-openid (>= 2.1.8)
- rack-test (0.5.7)
+ mime-types
+ polyglot (0.3.3)
+ rack (1.4.1)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-openid (1.1.2)
+ rack (>= 0.4)
+ ruby-openid (>= 2.0.3)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.2)
rack (>= 1.0)
- rails (3.0.5)
- actionmailer (= 3.0.5)
- actionpack (= 3.0.5)
- activerecord (= 3.0.5)
- activeresource (= 3.0.5)
- activesupport (= 3.0.5)
+ rails (3.2.8)
+ actionmailer (= 3.2.8)
+ actionpack (= 3.2.8)
+ activerecord (= 3.2.8)
+ activeresource (= 3.2.8)
+ activesupport (= 3.2.8)
bundler (~> 1.0)
- railties (= 3.0.5)
- railties (3.0.5)
- actionpack (= 3.0.5)
- activesupport (= 3.0.5)
+ railties (= 3.2.8)
+ railties (3.2.8)
+ actionpack (= 3.2.8)
+ activesupport (= 3.2.8)
+ rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
- thor (~> 0.14.4)
- rake (0.9.2)
- redis (2.2.1)
- redis-namespace (1.0.3)
- redis (< 3.0.0)
- ruby-openid (2.1.8)
+ rdoc (~> 3.4)
+ thor (>= 0.14.6, < 2.0)
+ rake (10.0.3)
+ rdoc (3.12)
+ json (~> 1.4)
+ redis (3.0.2)
+ redis-namespace (1.2.1)
+ redis (~> 3.0.0)
+ ruby-openid (2.2.2)
ruby-openid-apps-discovery (1.2.0)
ruby-openid (>= 2.1.7)
- ruby_parser (2.0.6)
- sexp_processor (~> 3.0)
- sass (3.1.3)
- sexp_processor (3.0.5)
- sqlite3 (1.3.3)
- sqlite3 (1.3.3-x86-mingw32)
+ ruby_parser (3.1.1)
+ sexp_processor (~> 4.1)
+ sass (3.2.4)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ sexp_processor (4.1.3)
+ simple_oauth (0.1.9)
+ sprockets (2.1.3)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.6)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
- thor (0.14.6)
- treetop (1.4.9)
+ thor (0.16.0)
+ tilt (1.3.3)
+ treetop (1.4.12)
+ polyglot
polyglot (>= 0.3.1)
- typhoeus (0.2.4)
- mime-types
- mime-types
- tzinfo (0.3.29)
- warden (1.0.4)
+ typhoeus (0.5.3)
+ ethon (~> 0.5.3)
+ tzinfo (0.3.35)
+ uglifier (1.3.0)
+ execjs (>= 0.3.0)
+ multi_json (~> 1.0, >= 1.0.2)
+ warden (1.2.1)
rack (>= 1.0)
- will_paginate (2.3.15)
- win32-open3-19 (0.0.1)
- youtube_it (1.4.3)
+ youtube_it (2.1.8)
builder
- oauth (>= 0.4.4)
- yui-compressor (0.9.6)
- POpen4 (>= 0.1.4)
+ faraday (~> 0.8)
+ nokogiri (~> 1.5.2)
+ oauth (~> 0.4.4)
+ oauth2 (~> 0.6)
+ simple_oauth (~> 0.1.5)
PLATFORMS
ruby
- x86-mingw32
DEPENDENCIES
7digital
- closure
+ coffee-rails (~> 3.2.1)
devise
haml-rails
hashie
- jammit
- jquery-rails (>= 0.2.6)
+ jquery-rails (= 1.0.12)
json
mongrel (= 1.2.0.pre2)
oa-oauth
oa-openid
paperclip (~> 2.3)
- rails (= 3.0.5)
+ rails (= 3.2.8)
rake
redis
redis-namespace
ruby_parser
- sass
+ sass-rails (~> 3.2.3)
sqlite3
sqlite3-ruby
typhoeus
- win32-open3-19
+ uglifier (>= 1.0.3)
youtube_it
diff --git a/app/assets/fonts/aauxnext/AauxNext-Blk.otf b/app/assets/fonts/aauxnext/AauxNext-Blk.otf
new file mode 100644
index 0000000..f2012a5
Binary files /dev/null and b/app/assets/fonts/aauxnext/AauxNext-Blk.otf differ
diff --git a/app/assets/fonts/aauxnext/aauxnext-bd-webfont.eot b/app/assets/fonts/aauxnext/aauxnext-bd-webfont.eot
new file mode 100644
index 0000000..8a8b709
Binary files /dev/null and b/app/assets/fonts/aauxnext/aauxnext-bd-webfont.eot differ
diff --git a/app/assets/fonts/aauxnext/aauxnext-bd-webfont.otf b/app/assets/fonts/aauxnext/aauxnext-bd-webfont.otf
new file mode 100644
index 0000000..3be3d82
Binary files /dev/null and b/app/assets/fonts/aauxnext/aauxnext-bd-webfont.otf differ
diff --git a/app/assets/fonts/aauxnext/aauxnext-bd-webfont.svg b/app/assets/fonts/aauxnext/aauxnext-bd-webfont.svg
new file mode 100644
index 0000000..0c57ad9
--- /dev/null
+++ b/app/assets/fonts/aauxnext/aauxnext-bd-webfont.svg
@@ -0,0 +1,251 @@
+
+
+
+
+This is a custom SVG webfont generated by Font Squirrel.
+Copyright : Copyright c 2008 by Neil Summerour All rights reserved
+Designer : Neil Summerour
+Foundry : Neil Summerour
+Foundry URL : wwwtypetrustcom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/assets/fonts/aauxnext/aauxnext-bd-webfont.ttf b/app/assets/fonts/aauxnext/aauxnext-bd-webfont.ttf
new file mode 100644
index 0000000..35832a8
Binary files /dev/null and b/app/assets/fonts/aauxnext/aauxnext-bd-webfont.ttf differ
diff --git a/app/assets/fonts/aauxnext/aauxnext-bd-webfont.woff b/app/assets/fonts/aauxnext/aauxnext-bd-webfont.woff
new file mode 100644
index 0000000..350d004
Binary files /dev/null and b/app/assets/fonts/aauxnext/aauxnext-bd-webfont.woff differ
diff --git a/app/assets/fonts/aauxnext/aauxnext-lt-webfont.eot b/app/assets/fonts/aauxnext/aauxnext-lt-webfont.eot
new file mode 100644
index 0000000..b25d9f5
Binary files /dev/null and b/app/assets/fonts/aauxnext/aauxnext-lt-webfont.eot differ
diff --git a/app/assets/fonts/aauxnext/aauxnext-lt-webfont.otf b/app/assets/fonts/aauxnext/aauxnext-lt-webfont.otf
new file mode 100644
index 0000000..619650d
Binary files /dev/null and b/app/assets/fonts/aauxnext/aauxnext-lt-webfont.otf differ
diff --git a/app/assets/fonts/aauxnext/aauxnext-lt-webfont.svg b/app/assets/fonts/aauxnext/aauxnext-lt-webfont.svg
new file mode 100644
index 0000000..e817b0e
--- /dev/null
+++ b/app/assets/fonts/aauxnext/aauxnext-lt-webfont.svg
@@ -0,0 +1,251 @@
+
+
+
+
+This is a custom SVG webfont generated by Font Squirrel.
+Copyright : Copyright c 2008 by Neil Summerour All rights reserved
+Designer : Neil Summerour
+Foundry : Neil Summerour
+Foundry URL : wwwtypetrustcom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/assets/fonts/aauxnext/aauxnext-lt-webfont.ttf b/app/assets/fonts/aauxnext/aauxnext-lt-webfont.ttf
new file mode 100644
index 0000000..e3348e6
Binary files /dev/null and b/app/assets/fonts/aauxnext/aauxnext-lt-webfont.ttf differ
diff --git a/app/assets/fonts/aauxnext/aauxnext-lt-webfont.woff b/app/assets/fonts/aauxnext/aauxnext-lt-webfont.woff
new file mode 100644
index 0000000..c4ccc30
Binary files /dev/null and b/app/assets/fonts/aauxnext/aauxnext-lt-webfont.woff differ
diff --git a/app/assets/fonts/aauxnext/aauxnext-md-webfont.eot b/app/assets/fonts/aauxnext/aauxnext-md-webfont.eot
new file mode 100644
index 0000000..b51a005
Binary files /dev/null and b/app/assets/fonts/aauxnext/aauxnext-md-webfont.eot differ
diff --git a/app/assets/fonts/aauxnext/aauxnext-md-webfont.otf b/app/assets/fonts/aauxnext/aauxnext-md-webfont.otf
new file mode 100644
index 0000000..09d3356
Binary files /dev/null and b/app/assets/fonts/aauxnext/aauxnext-md-webfont.otf differ
diff --git a/app/assets/fonts/aauxnext/aauxnext-md-webfont.svg b/app/assets/fonts/aauxnext/aauxnext-md-webfont.svg
new file mode 100644
index 0000000..940212b
--- /dev/null
+++ b/app/assets/fonts/aauxnext/aauxnext-md-webfont.svg
@@ -0,0 +1,251 @@
+
+
+
+
+This is a custom SVG webfont generated by Font Squirrel.
+Copyright : Copyright c 2008 by Neil Summerour All rights reserved
+Designer : Neil Summerour
+Foundry : Neil Summerour
+Foundry URL : wwwtypetrustcom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/assets/fonts/aauxnext/aauxnext-md-webfont.ttf b/app/assets/fonts/aauxnext/aauxnext-md-webfont.ttf
new file mode 100644
index 0000000..abe0070
Binary files /dev/null and b/app/assets/fonts/aauxnext/aauxnext-md-webfont.ttf differ
diff --git a/app/assets/fonts/aauxnext/aauxnext-md-webfont.woff b/app/assets/fonts/aauxnext/aauxnext-md-webfont.woff
new file mode 100644
index 0000000..de978d1
Binary files /dev/null and b/app/assets/fonts/aauxnext/aauxnext-md-webfont.woff differ
diff --git a/app/assets/images/9minutes-logo.png b/app/assets/images/9minutes-logo.png
new file mode 100644
index 0000000..aa934c6
Binary files /dev/null and b/app/assets/images/9minutes-logo.png differ
diff --git a/app/assets/images/advertisment-placeholder.png b/app/assets/images/advertisment-placeholder.png
new file mode 100644
index 0000000..dfa1c39
Binary files /dev/null and b/app/assets/images/advertisment-placeholder.png differ
diff --git a/app/assets/images/backgrounds/dark.png b/app/assets/images/backgrounds/dark.png
new file mode 100644
index 0000000..4ba9605
Binary files /dev/null and b/app/assets/images/backgrounds/dark.png differ
diff --git a/app/assets/images/backgrounds/darker.png b/app/assets/images/backgrounds/darker.png
new file mode 100644
index 0000000..c7e1b39
Binary files /dev/null and b/app/assets/images/backgrounds/darker.png differ
diff --git a/app/assets/images/backgrounds/fuse.png b/app/assets/images/backgrounds/fuse.png
new file mode 100644
index 0000000..5b1c471
Binary files /dev/null and b/app/assets/images/backgrounds/fuse.png differ
diff --git a/app/assets/images/backgrounds/overallcrush.png b/app/assets/images/backgrounds/overallcrush.png
new file mode 100644
index 0000000..fd972d1
Binary files /dev/null and b/app/assets/images/backgrounds/overallcrush.png differ
diff --git a/app/assets/images/bing.png b/app/assets/images/bing.png
new file mode 100644
index 0000000..18aeb8e
Binary files /dev/null and b/app/assets/images/bing.png differ
diff --git a/app/assets/images/examples/album-kl.jpg b/app/assets/images/examples/album-kl.jpg
new file mode 100644
index 0000000..a10ced6
Binary files /dev/null and b/app/assets/images/examples/album-kl.jpg differ
diff --git a/app/assets/images/examples/artist-big.jpg b/app/assets/images/examples/artist-big.jpg
new file mode 100644
index 0000000..a7edc7b
Binary files /dev/null and b/app/assets/images/examples/artist-big.jpg differ
diff --git a/app/assets/images/examples/artist-big2.jpg b/app/assets/images/examples/artist-big2.jpg
new file mode 100644
index 0000000..f4e8401
Binary files /dev/null and b/app/assets/images/examples/artist-big2.jpg differ
diff --git a/app/assets/images/examples/artist.jpg b/app/assets/images/examples/artist.jpg
new file mode 100644
index 0000000..cd2fc3b
Binary files /dev/null and b/app/assets/images/examples/artist.jpg differ
diff --git a/app/assets/images/examples/top-artist.jpg b/app/assets/images/examples/top-artist.jpg
new file mode 100644
index 0000000..d2d7b6d
Binary files /dev/null and b/app/assets/images/examples/top-artist.jpg differ
diff --git a/app/assets/images/examples/top-artist2.jpg b/app/assets/images/examples/top-artist2.jpg
new file mode 100644
index 0000000..d2733eb
Binary files /dev/null and b/app/assets/images/examples/top-artist2.jpg differ
diff --git a/app/assets/images/examples/user-big.jpg b/app/assets/images/examples/user-big.jpg
new file mode 100644
index 0000000..d189f04
Binary files /dev/null and b/app/assets/images/examples/user-big.jpg differ
diff --git a/app/assets/images/examples/video-big.jpg b/app/assets/images/examples/video-big.jpg
new file mode 100644
index 0000000..77161da
Binary files /dev/null and b/app/assets/images/examples/video-big.jpg differ
diff --git a/app/assets/images/nine-minutes.png b/app/assets/images/nine-minutes.png
new file mode 100644
index 0000000..f2c649d
Binary files /dev/null and b/app/assets/images/nine-minutes.png differ
diff --git a/app/assets/images/placeholder/advertisment.png b/app/assets/images/placeholder/advertisment.png
new file mode 100644
index 0000000..dfa1c39
Binary files /dev/null and b/app/assets/images/placeholder/advertisment.png differ
diff --git a/app/assets/images/placeholder/artist-big.png b/app/assets/images/placeholder/artist-big.png
new file mode 100644
index 0000000..89c2da0
Binary files /dev/null and b/app/assets/images/placeholder/artist-big.png differ
diff --git a/app/assets/images/placeholder/artist.png b/app/assets/images/placeholder/artist.png
new file mode 100644
index 0000000..bc9a0b6
Binary files /dev/null and b/app/assets/images/placeholder/artist.png differ
diff --git a/app/assets/images/placeholder/related.png b/app/assets/images/placeholder/related.png
new file mode 100644
index 0000000..73ee510
Binary files /dev/null and b/app/assets/images/placeholder/related.png differ
diff --git a/app/assets/images/startsite/adele.jpg b/app/assets/images/startsite/adele.jpg
new file mode 100644
index 0000000..e0b9810
Binary files /dev/null and b/app/assets/images/startsite/adele.jpg differ
diff --git a/app/assets/images/startsite/arctic-monkeys.jpg b/app/assets/images/startsite/arctic-monkeys.jpg
new file mode 100644
index 0000000..2cff0fa
Binary files /dev/null and b/app/assets/images/startsite/arctic-monkeys.jpg differ
diff --git a/app/assets/images/startsite/beatles.jpg b/app/assets/images/startsite/beatles.jpg
new file mode 100644
index 0000000..dd6202b
Binary files /dev/null and b/app/assets/images/startsite/beatles.jpg differ
diff --git a/app/assets/images/startsite/coldplay.jpg b/app/assets/images/startsite/coldplay.jpg
new file mode 100644
index 0000000..277e436
Binary files /dev/null and b/app/assets/images/startsite/coldplay.jpg differ
diff --git a/app/assets/images/startsite/foo-fighters.jpg b/app/assets/images/startsite/foo-fighters.jpg
new file mode 100644
index 0000000..a2ed3eb
Binary files /dev/null and b/app/assets/images/startsite/foo-fighters.jpg differ
diff --git a/app/assets/images/startsite/katy-perry.jpg b/app/assets/images/startsite/katy-perry.jpg
new file mode 100644
index 0000000..02504dd
Binary files /dev/null and b/app/assets/images/startsite/katy-perry.jpg differ
diff --git a/app/assets/images/startsite/lady-gaga.jpg b/app/assets/images/startsite/lady-gaga.jpg
new file mode 100644
index 0000000..3e1dd23
Binary files /dev/null and b/app/assets/images/startsite/lady-gaga.jpg differ
diff --git a/app/assets/images/startsite/muse.jpg b/app/assets/images/startsite/muse.jpg
new file mode 100644
index 0000000..2544ec7
Binary files /dev/null and b/app/assets/images/startsite/muse.jpg differ
diff --git a/app/assets/images/startsite/radiohead.jpg b/app/assets/images/startsite/radiohead.jpg
new file mode 100644
index 0000000..a0084d7
Binary files /dev/null and b/app/assets/images/startsite/radiohead.jpg differ
diff --git a/app/assets/images/startsite/red-hot-chili-peppers.jpg b/app/assets/images/startsite/red-hot-chili-peppers.jpg
new file mode 100644
index 0000000..3e3584a
Binary files /dev/null and b/app/assets/images/startsite/red-hot-chili-peppers.jpg differ
diff --git a/app/assets/images/startsite/small/adele.jpg b/app/assets/images/startsite/small/adele.jpg
new file mode 100644
index 0000000..dc0a2a5
Binary files /dev/null and b/app/assets/images/startsite/small/adele.jpg differ
diff --git a/app/assets/images/startsite/small/arctic-monkeys.jpg b/app/assets/images/startsite/small/arctic-monkeys.jpg
new file mode 100644
index 0000000..6ff480e
Binary files /dev/null and b/app/assets/images/startsite/small/arctic-monkeys.jpg differ
diff --git a/app/assets/images/startsite/small/beatles.jpg b/app/assets/images/startsite/small/beatles.jpg
new file mode 100644
index 0000000..0c782da
Binary files /dev/null and b/app/assets/images/startsite/small/beatles.jpg differ
diff --git a/app/assets/images/startsite/small/coldplay.jpg b/app/assets/images/startsite/small/coldplay.jpg
new file mode 100644
index 0000000..4c38cdc
Binary files /dev/null and b/app/assets/images/startsite/small/coldplay.jpg differ
diff --git a/app/assets/images/startsite/small/foo-fighters.jpg b/app/assets/images/startsite/small/foo-fighters.jpg
new file mode 100644
index 0000000..cc221fd
Binary files /dev/null and b/app/assets/images/startsite/small/foo-fighters.jpg differ
diff --git a/app/assets/images/startsite/small/katy-perry.jpg b/app/assets/images/startsite/small/katy-perry.jpg
new file mode 100644
index 0000000..17c13bb
Binary files /dev/null and b/app/assets/images/startsite/small/katy-perry.jpg differ
diff --git a/app/assets/images/startsite/small/lady-gaga.jpg b/app/assets/images/startsite/small/lady-gaga.jpg
new file mode 100644
index 0000000..b6cc7ce
Binary files /dev/null and b/app/assets/images/startsite/small/lady-gaga.jpg differ
diff --git a/app/assets/images/startsite/small/muse.jpg b/app/assets/images/startsite/small/muse.jpg
new file mode 100644
index 0000000..0b80308
Binary files /dev/null and b/app/assets/images/startsite/small/muse.jpg differ
diff --git a/app/assets/images/startsite/small/radiohead.jpg b/app/assets/images/startsite/small/radiohead.jpg
new file mode 100644
index 0000000..bf89e97
Binary files /dev/null and b/app/assets/images/startsite/small/radiohead.jpg differ
diff --git a/app/assets/images/startsite/small/red-hot-chili-peppers.jpg b/app/assets/images/startsite/small/red-hot-chili-peppers.jpg
new file mode 100644
index 0000000..1917888
Binary files /dev/null and b/app/assets/images/startsite/small/red-hot-chili-peppers.jpg differ
diff --git a/app/assets/javascripts/ajax/album.js b/app/assets/javascripts/ajax/album.js
new file mode 100644
index 0000000..5dee1a2
--- /dev/null
+++ b/app/assets/javascripts/ajax/album.js
@@ -0,0 +1,34 @@
+
+function load_songs_from_album(obj){
+ if($(obj).attr("loaded") == "true")
+ {
+ $('#album_box').fadeOut(200);
+ $(obj).removeAttr("loaded");
+ }
+ else
+ {
+ $(obj).parent().parent().children().each(function(){
+ $(this).children("a").removeAttr("loaded");
+ });
+ $(obj).attr("loaded", "true");
+ artist = $(obj).parent().attr("artist");
+ album = $(obj).parent().attr("album");
+
+ url = "/album_info";
+ params = "artist="+artist+"&album="+album;
+
+ album_request(url, params, obj);
+ }
+}
+
+function show_songs_from_album(data, obj){
+ $('#album_box').remove();
+ $(obj).parent().prepend(data);
+ $('#album_box').fadeIn(200);
+ $('#album_box .wrap').jScrollPane();
+
+ $('#album_box li').each(function(){
+ if(!$(this).has(".play").length)
+ $(this).prepend(' ');
+ });
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/ajax/favourites.js b/app/assets/javascripts/ajax/favourites.js
new file mode 100644
index 0000000..ab17c18
--- /dev/null
+++ b/app/assets/javascripts/ajax/favourites.js
@@ -0,0 +1,7 @@
+$(document).ready(function(){
+ $('.heart').live("click", function(){
+ var params = "id="+$('#content .tabs .content').attr('q');
+ favourite_request(favourite_path, params);
+ });
+
+});
\ No newline at end of file
diff --git a/app/assets/javascripts/ajax/loadmore.js b/app/assets/javascripts/ajax/loadmore.js
new file mode 100644
index 0000000..edb3475
--- /dev/null
+++ b/app/assets/javascripts/ajax/loadmore.js
@@ -0,0 +1,67 @@
+$(document).ready(function(){
+ $('.more').live("click", function(){
+ hide_flash(false);
+ hide_flash(true);
+
+ more_hover_out(this);
+ loadmore(this);
+ });
+});
+
+
+function loadmore(obj){
+ $(obj).parent().children('.list').attr("wanting","true");
+
+ size = $(obj).parent().find('li').size();
+ tile = $(obj).parent().children('.list').attr("tile");
+ artist = $(obj).parent().parent(".content").attr("artist");
+ q = $(obj).parent().parent(".content").attr("q");
+
+ disable_more_button(obj);
+
+ url = "/"+tile;
+ params = "size="+size+"&artist="+artist+"&q="+q;
+
+ load_more_request(url, params);
+}
+
+function append_to_list(ctnt){
+ $list = $(".list[wanting=true]");
+ var c=0;
+ $(ctnt).hide().appendTo($list);
+
+ $list.children().each(function(){
+ if($(this).is(":hidden"))
+ {
+ show_li(this, c);
+ c+=30;
+ }
+ });
+
+ $list.removeAttr("wanting");
+ hide_flash();
+ init_artist();
+ enable_more_button();
+}
+
+function show_li(obj, c){
+ setTimeout(function(){
+ $(obj).show();
+ }, 200+c);
+}
+
+
+function disable_more_button(obj){
+ $(obj).die("click");
+ $(obj).unbind('mouseenter mouseleave');
+ $(obj).addClass("disabled");
+ $(obj).html(' ');
+}
+
+function enable_more_button(){
+ more_hover();
+ $('.more').each(function(){
+ $(this).removeClass("disabled");
+ $(this).html('SHOW MORE');
+ });
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/ajax/requests.js b/app/assets/javascripts/ajax/requests.js
new file mode 100644
index 0000000..4cac973
--- /dev/null
+++ b/app/assets/javascripts/ajax/requests.js
@@ -0,0 +1,128 @@
+function load_more_request(link, params){
+ cacheResponse = cacheRequest(link+params);
+ if(!cacheResponse)
+ {
+ console.info("=> Request to server");
+ $.ajax({
+ type: "GET",
+ dataType: "html",
+ url: link,
+ data: params,
+ error: function(){
+ hide_flash(false);
+ show_flash(true);
+ enable_more_button();
+ },
+ success: function(data){
+ cacheRequest(link+params, data);
+ append_to_list(data);
+ }
+ });
+ }
+ else
+ {
+ console.info("=> Request to jQuery Object");
+ append_to_list(cacheResponse);
+ }
+}
+
+function favourite_request(link, params){
+ $.ajax({
+ type: "GET",
+ dataType: "html",
+ url: link,
+ data: params,
+ error: function(){
+ hide_flash(false);
+ show_flash(true);
+ },
+ success: function(data){
+ $('#content .heart').addClass('loved');
+ }
+ });
+}
+
+function load_site_request(link, params){
+ changeDocumentTitle(link, params);
+
+ // proof given params
+ params = (typeof params == "undefined" || typeof params == "boolean") ? "" : params;
+ show_flash(false);
+
+ // request to object cache
+ if(link != user_path)
+ cacheResponse = cacheRequest(link+params);
+ else cacheResponse = false;
+
+ hide_flash(true); // remove error messages if shown
+ if(!cacheResponse)
+ {
+ console.info("=> Request to server");
+ $.ajax({
+ type:"GET",
+ dataType:"html",
+ url: link + params,
+ data:"remote=true",
+ error: function(){
+ hide_flash(false);
+ show_flash(true);
+ enable_more_button();
+ },
+ success: function(data){
+ cacheRequest(link+params, data);
+ $("#content").html(data);
+ $("#content").ready(function(){
+ hide_flash(false);
+ init_site(link);
+ });
+ }
+ });
+ }
+ else
+ {
+ console.info("=> Request to jQuery Object");
+ $("#content").html(cacheResponse);
+ $("#content").ready(function(){
+ hide_flash(false);
+ init_site(link);
+ });
+ }
+}
+
+function album_request(link, params, obj){
+ hide_flash(true);
+ $.ajax({
+ type: "GET",
+ dataType: "html",
+ url: link,
+ data: params,
+ error: function(){
+ hide_flash(false);
+ show_flash(true);
+ //enable_more_button();
+ },
+ success: function(data){
+ show_songs_from_album(data, obj);
+ }
+ });
+}
+
+function video_request(link, artist, track, play){
+ var params = "artist="+artist+"&track="+track;
+ var dat;
+ $.ajax({
+ type: "GET",
+ dataType: "html",
+ url: jQuery.trim(link),
+ data: params,
+ error: function(){
+ hide_flash(false);
+ show_flash(true);
+ //enable_more_button();
+ return null;
+ },
+ success: function(data){
+ videoRequestResponse(jQuery.trim(data), artist, track, play);
+ }
+ });
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/ajax/routes.js b/app/assets/javascripts/ajax/routes.js
new file mode 100644
index 0000000..6338363
--- /dev/null
+++ b/app/assets/javascripts/ajax/routes.js
@@ -0,0 +1,39 @@
+// Artist Show Page
+Path.map(hashbang+artist_path+":id").to(function(){
+ load_site_request(artist_path, this.params['id']);
+});
+
+// Home Page
+Path.map(hashbang+home_path).to(function(){
+ load_site_request(home_path);
+});
+
+// Charts Page
+Path.map(hashbang+charts_path).to(function(){
+ load_site_request(charts_path);
+});
+
+// Search Page
+Path.map(hashbang+search_path+":q").to(function(){
+ load_site_request(search_path, this.params['q']);
+});
+
+// Sign Up Page
+Path.map(hashbang+register_path).to(function(){
+ load_site_request(register_path);
+});
+
+// Sign In Page
+Path.map(hashbang+login_path).to(function(){
+ load_site_request(login_path);
+});
+
+// Sign Out Page
+Path.map(hashbang+logout_path).to(function(){
+ load_site_request(logout_path);
+});
+
+// User Show Page
+Path.map(hashbang+user_path+":id").to(function(){
+ load_site_request(user_path, this.params['id']);
+});
\ No newline at end of file
diff --git a/app/assets/javascripts/animations/animations.js b/app/assets/javascripts/animations/animations.js
new file mode 100644
index 0000000..10612ac
--- /dev/null
+++ b/app/assets/javascripts/animations/animations.js
@@ -0,0 +1,53 @@
+function show_flash(error){
+ $load = (error) ? $('#error') : $('#loading');
+ if($load.is(":visible")) return false;
+
+ $load.css({"top": "-40px", "opacity": "0"}).show();
+ $load.animate({
+ opacity: 1,
+ top: 0
+ }, 300);
+ if (!error) $('#block').show().fadeTo(400, 0.3);
+}
+
+function hide_flash(error){
+ $load = (error) ? $('#error') : $('#loading');
+ if($load.is(":hidden")) return false;
+
+ $load.animate({
+ opacity: 0,
+ top: -40
+ }, 600, function(){$(this).hide()});
+
+ if (!error) $('#block').fadeTo(300, 0, function(){ $(this).hide();});
+}
+
+
+
+function more_hover(){
+ $('.more').hover(function(){
+ $(this).animate({
+ backgroundColor: "#0086cc",
+ color: "#ffffff"
+ }, 200);
+ }, function(){
+ more_hover_out(this);
+ });
+}
+
+function more_hover_out(obj){
+ $(obj).stop().animate({
+ backgroundColor: "#f4f6f9",
+ color: "#15191d"
+ }, 100);
+}
+
+function init_playlist_scrollbar(){
+ $('#fullscreen #playlist').jScrollPane();
+
+ $('#fullscreen #playlist').hover(function(){
+ $('#fullscreen .jspVerticalBar').stop().fadeTo(300, 1);
+ }, function(){
+ $('#fullscreen .jspVerticalBar').stop().fadeTo(200, 0.02);
+ });
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/animations/fullscreen.js b/app/assets/javascripts/animations/fullscreen.js
new file mode 100644
index 0000000..6edd0d5
--- /dev/null
+++ b/app/assets/javascripts/animations/fullscreen.js
@@ -0,0 +1,52 @@
+$(document).ready(function() {
+ $('.full').live("click",function(){
+ showFullscreen(false);
+ });
+ $("#fullscreen_close").click(function(){
+ showFullscreen(false);
+ });
+});
+
+function showFullscreen(auto){
+ /*if(auto && $('.full').hasClass("open"))
+ {
+ clearInterval(fullscreenInt);
+ return;
+ }*/
+
+ if($('.full').hasClass("open")) {
+ $('#fullscreen').css("top", 0);
+ $("#fullscreen").animate({
+ marginTop: -400,
+ opacity: 0
+ }, 500, function(){
+ $('#ytPlayer').css("marginTop", -9999);
+ $("#site, #bg_stripe").show().animate({
+ marginTop: 0,
+ opacity: 1
+ }, 500);
+ $("#fullscreen_wrap").fadeTo(500, 0, function(){$(this).hide();});
+ $("#fullscreen_close").fadeTo(500, 0);
+ });
+ $('.full').removeClass("open");
+ //fullscreenInt = setInterval ( "showFullscreen(true)", 15000 );
+ }
+ else {
+ $('#fullscreen').css("top", 0);
+ $("#site, #bg_stripe").animate({
+ marginTop: 400,
+ opacity: 0
+ }, 500, function(){
+ $(this).hide();
+ $('#ytPlayer').css("marginTop", 0);
+ $("#fullscreen").css("marginTop", -100).show().animate({
+ marginTop: 120,
+ opacity: 1
+ }, 500);
+ init_playlist_scrollbar();
+ $("#fullscreen_wrap").fadeTo(1000, 0.5);
+ $("#fullscreen_close").fadeTo(500, 1);
+ });
+ $('.full').addClass("open");
+ }
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
new file mode 100644
index 0000000..06e7710
--- /dev/null
+++ b/app/assets/javascripts/application.js
@@ -0,0 +1,18 @@
+//= require jquery
+//= require jquery_ujs
+//= require_tree ./helper
+//= require_tree ./plugins
+
+//= require config
+//= require pinify
+//= require play
+//= require playlist
+//= require home
+//= require player
+//= require search
+//= require store
+//= require caching
+//= require title
+//= require_tree ./ajax
+//= require_tree ./animations
+//= require layout
diff --git a/app/assets/javascripts/caching.js b/app/assets/javascripts/caching.js
new file mode 100644
index 0000000..af43ad3
--- /dev/null
+++ b/app/assets/javascripts/caching.js
@@ -0,0 +1,9 @@
+function cacheRequest(key, value)
+{
+ value = (typeof value == "undefined" || typeof value == "boolean") ? false : value;
+
+ if(!value)
+ return (jQuery.data(document.body, key) == null) ? false : jQuery.data(document.body, key);
+ else
+ return jQuery.data(document.body, key, value);
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/config.js b/app/assets/javascripts/config.js
new file mode 100644
index 0000000..dcb50f7
--- /dev/null
+++ b/app/assets/javascripts/config.js
@@ -0,0 +1,42 @@
+
+// Default paths for application
+// DON'T CHANGE!!!
+var hashbang = "#!";
+var artist_path = "/artists/";
+var home_path = "/home";
+var charts_path = "/charts";
+var search_path = "/search/";
+var search_autocomplete_path = "/autocomplete/";
+var user_path = "/users/";
+var profile_path = "/profile";
+var register_path = "/register";
+var login_path = "/login";
+var logout_path = "/logout";
+var favourite_path = "/favourize";
+var search_video_path = "/search_video";
+
+// root title
+var documentTitle = "9minutes";
+
+$(document).ready(function(){
+ // home site
+ Path.root("#!/home");
+
+ // initialize path listener
+ Path.listen();
+
+ // redirect non existent links
+ // to the 404 page
+ Path.rescue(function(){
+ // TODO: link to 404 page
+ alert("404: Route Not Found");
+ });
+
+ // Setup default AJAX values
+ // for future requests
+ $.ajaxSetup({
+
+ // 30sec timeout for each request
+ // timeout: 30000
+ });
+});
\ No newline at end of file
diff --git a/app/assets/javascripts/helper/fauxconsole.js b/app/assets/javascripts/helper/fauxconsole.js
new file mode 100644
index 0000000..7079ce1
--- /dev/null
+++ b/app/assets/javascripts/helper/fauxconsole.js
@@ -0,0 +1 @@
+/* Faux Console by Chris Heilmann http://wait-till-i.com */ if(!window.console){var console={init:function(){console.d=document.createElement('div');document.body.appendChild(console.d);var a=document.createElement('a');a.href='javascript:console.hide()';a.innerHTML='close';console.d.appendChild(a);var a=document.createElement('a');a.href='javascript:console.clear();';a.innerHTML='clear';console.d.appendChild(a);var id='fauxconsole';if(!document.getElementById(id)){console.d.id=id;}console.hide();},hide:function(){console.d.style.display='none';},show:function(){console.d.style.display='block';},log:function(o){console.d.innerHTML+=' '+o;console.show();},clear:function(){console.d.parentNode.removeChild(console.d);console.init();console.show();},/*Simon Willison rules*/addLoadEvent:function(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){if(oldonload){oldonload();}func();}};}};console.addLoadEvent(console.init);}
\ No newline at end of file
diff --git a/app/assets/javascripts/helper/foreach.js b/app/assets/javascripts/helper/foreach.js
new file mode 100644
index 0000000..9848999
--- /dev/null
+++ b/app/assets/javascripts/helper/foreach.js
@@ -0,0 +1 @@
+Array.prototype.foreach = function( callback ) {
for( var k=0; k ');
+ });
+ });
+}
+
+
+
+function init_artist(){
+ add_controls();
+ add_more_button();
+ new_albums();
+ margin_fixes();
+ remove_links_from_description();
+}
+
+
+// get index of an element
+function get_index(obj){
+ return $(obj).parent().children().index(obj);
+}
+
+
+// redirect to submit
+function submit_redirect(obj){
+ $(obj).next("input[type=submit]").click();
+}
+
+
+function add_more_button(){
+ $('.list').each(function(){
+ if($(this).hasClass("andmore") && !$(this).parent().has(".more").length)
+ $(this).after('SHOW MORE ');
+ });
+ more_hover();
+}
+
+
+function margin_fixes(){
+ $('.list.related li:nth-child(3n)').css("marginRight", 0);
+ $('.list.related li img').each(function(){
+ $(this).imgscale({ scale: "fill"});
+ });
+}
+
+
+
+function remove_links_from_description(){
+ $("#artist_info a").each(function(){
+ $text = $(this).html();
+ $(this).after($text).remove();
+ });
+}
+
+
+function new_albums(){
+ album_hover();
+ //album_add_show_songs_button();
+}
+
+
+function album_hover(){
+ $('.albums .img').hover(function(){
+ if(!$(this).children(".playall").hasClass("playall"))
+ $(this).append('
');
+ $(this).find('.playall').fadeIn(200);
+ }, function(){
+ $(this).find('.playall').stop().fadeOut(300, function(){ $(this).remove(); });
+ });
+}
+
+function album_add_show_songs_button(){
+ $('.albums > li').each(function(){
+ if(!$(this).has(".songsbtn").length)
+ $(this).append('Songs ');
+ });
+}
+
+
+function init_site(link){
+ Path.listen();
+
+ switch(link) {
+ case artist_path:
+ init_tabs();
+ init_artist();
+ break;
+ case home_path:
+ init_home();
+ set_active_navigation(home_path);
+ break;
+ case charts_path:
+ case search_path:
+ init_tabs();
+ add_more_button();
+ add_controls();
+ init_autocomplete();
+ set_active_navigation(charts_path);
+ break;
+ case user_path:
+ init_tabs();
+ set_active_navigation(profile_path);
+ break;
+ case register_path:
+ init_tabs();
+ set_active_navigation(register_path);
+ break;
+ case login_path:
+ init_tabs();
+ set_active_navigation(home_path);
+ break;
+ }
+}
+
+
+function set_active_navigation(text){
+ text = text.replace("/","");
+ $('#navigation li.active').removeClass("active");
+ $('#navigation li').each(function(){
+ if($(this).children("a").html() == text)
+ $(this).addClass("active");
+ });
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/pinify.js b/app/assets/javascripts/pinify.js
new file mode 100644
index 0000000..faab708
--- /dev/null
+++ b/app/assets/javascripts/pinify.js
@@ -0,0 +1,61 @@
+
+// pinify 9minutes
+// Jumplist entries, media controls, ...
+// for IE9
+
+$(document).ready(function(){
+
+ // Make site pinable
+ $("head").pinify({
+ applicationName: "9minutes",
+ favIcon: "/favicon.ico",
+ navColor: "#0294df",
+ startUrl: "http://localhost:3000",
+ tooltip: "9minutes",
+ window: "width=1024;height=600"
+ });
+
+ // add jumplist
+ var stepsArray = ["Charts 1", "Charts 2"];
+ gemerateJumplist(stepsArray, "Charts");
+
+
+ // Media controls
+ $.pinify.createThumbbarButtons({
+ buttons: [{
+ icon: "/favicon.ico",
+ name: "Twitter",
+ click: function () {
+ alert("Link 1");
+ }
+ },
+ {
+ icon: "/favicon.ico",
+ name: "Facebook",
+ click: function () {
+ alert("Link 2");
+ }
+ }]
+ });
+});
+
+
+function gemerateJumplist(arr, title){
+ var stepsListArray = [];
+
+ // Generate jumplist for navigation
+ arr.foreach(function (key, val) {
+ var item = {
+ 'name': val,
+ 'url': "http://localhost:3000",
+ 'icon': "/favicon.ico"
+ };
+ stepsListArray.push(item);
+ });
+
+ // Apply jumplist entries
+ $.pinify.addJumpList({
+ title: title,
+ items: stepsListArray
+ });
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/play.js b/app/assets/javascripts/play.js
new file mode 100644
index 0000000..f23856e
--- /dev/null
+++ b/app/assets/javascripts/play.js
@@ -0,0 +1,31 @@
+$(document).ready(function(){
+
+ $('.playsong').live("click", function(){
+ videoRequest(this, true);
+ });
+ $('.addsong').live("click", function(){
+ videoRequest(this, false);
+ });
+
+});
+
+function videoRequest(me, play) {
+ var artist = $(me).parent().attr("artist");
+ var track = $(me).parent().attr("track");
+ video_request(search_video_path, artist, track, play);
+}
+
+function videoRequestResponse(data, artist, track, play) {
+ if(play)
+ playTrack(data, artist, track);
+ else
+ addTrack(data, artist, track, true);
+}
+
+
+function playTrack(url, artist, track){
+ loadVideo(url);
+ $('#fullscreen h2').text(artist);
+ $('#fullscreen h1').text(track);
+ // $('#fullscreen
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/player.js b/app/assets/javascripts/player.js
new file mode 100644
index 0000000..69f638e
--- /dev/null
+++ b/app/assets/javascripts/player.js
@@ -0,0 +1,29 @@
+// CLICK HANDLER
+$(document).ready(function(){
+ $('.play').live('click', playVideo);
+ $('.pause').live('click', pauseVideo);
+
+ $('.volume').live('click', muteVideo);
+ $('.novolume').live('click', unMuteVideo);
+
+
+ $('#scrubbar').rangeinput({
+ progress: true,
+ speed: 200
+ });
+});
+
+
+function playControl(play){
+ if(play)
+ $('.play').addClass("pause").removeClass("play");
+ else
+ $('.pause').addClass("play").removeClass("pause");
+}
+
+function volumeControl(mute){
+ if(mute)
+ $('.volume').addClass("novolume").removeClass("volume");
+ else
+ $('.novolume').addClass("volume").removeClass("novolume");
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/playlist.js b/app/assets/javascripts/playlist.js
new file mode 100644
index 0000000..2e706a0
--- /dev/null
+++ b/app/assets/javascripts/playlist.js
@@ -0,0 +1,73 @@
+var fullscreenInt;
+
+$(document).ready(function(){
+ $('#playlist .el').live('click', function(){
+ playTrack(getVid(this), getArtist(this), getTrack(this));
+ });
+
+ $('.player .forward').live('click', function(){
+ nextVideo();
+ });
+ $('.player .backward').live('click', function(){
+ prevVideo();
+ });
+});
+
+function initPlaylist() {
+ storage = $.store.get("9minutesPlaylist");
+ if(storage !== undefined) {
+ size = storage.length;
+ for(i = 0; i < size; i++) {
+ addTrack(storage[i].videoid, storage[i].artist, storage[i].title, false);
+ }
+ }
+
+ //if($('#playlist .el').size() > 0)
+ // fullscreenInt = setInterval ( "showFullscreen(true)", 15000 );
+}
+
+function savePlaylist() {
+ var tracks = [];
+ $('#playlist .el').each(function(i) {
+ tracks[i] = {
+ title : getTrack(this),
+ artist : getArtist(this),
+ videoid : getVid(this)
+ }
+ });
+
+ $.store.set("9minutesPlaylist", tracks);
+}
+
+function addTrack(url, artist, track, save){
+ var appendData = "";
+ if(save)
+ {
+ $('#playlist .jspPane').append(appendData);
+ savePlaylist();
+ }
+ else
+ $('#playlist').append(appendData);
+}
+
+
+
+function getArtist(obj) {
+ return $(obj).children('h3').children('span').text();
+}
+function getTrack(obj) {
+ return $(obj).children('h3').children('div').text();
+}
+function getVid(obj) {
+ return $(obj).attr('vid');
+}
+
+
+function setCurrentSong(vid) {
+ var me = $('#playlist .el[vid="'+vid+'"]');
+ var id = $(me).parent().children().index(me);
+ $('#playlist .el').each(function(){
+ $(this).removeClass("active");
+ });
+ $('#playlist .el:eq('+id+')').addClass("active");
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/plugins/autocomplete.js b/app/assets/javascripts/plugins/autocomplete.js
new file mode 100644
index 0000000..73ccbb6
--- /dev/null
+++ b/app/assets/javascripts/plugins/autocomplete.js
@@ -0,0 +1,843 @@
+/*
+ * jQuery Autocomplete plugin 1.2.1
+ *
+ * Copyright (c) 2009 Jörn Zaefferer
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * With small modifications by Alfonso Gómez-Arzola.
+ * See changelog for details.
+ *
+ */
+
+;(function($) {
+
+$.fn.extend({
+ autocomplete: function(urlOrData, options) {
+ var isUrl = typeof urlOrData == "string";
+ options = $.extend({}, $.Autocompleter.defaults, {
+ url: isUrl ? urlOrData : null,
+ data: isUrl ? null : urlOrData,
+ delay: isUrl ? $.Autocompleter.defaults.delay : 10,
+ max: options && !options.scroll ? 10 : 150
+ }, options);
+
+ // if highlight is set to false, replace it with a do-nothing function
+ options.highlight = options.highlight || function(value) { return value; };
+
+ // if the formatMatch option is not specified, then use formatItem for backwards compatibility
+ options.formatMatch = options.formatMatch || options.formatItem;
+
+ return this.each(function() {
+ new $.Autocompleter(this, options);
+ });
+ },
+ result: function(handler) {
+ return this.bind("result", handler);
+ },
+ search: function(handler) {
+ return this.trigger("search", [handler]);
+ },
+ flushCache: function() {
+ return this.trigger("flushCache");
+ },
+ setOptions: function(options){
+ return this.trigger("setOptions", [options]);
+ },
+ unautocomplete: function() {
+ return this.trigger("unautocomplete");
+ }
+});
+
+$.Autocompleter = function(input, options) {
+
+ var KEY = {
+ UP: 38,
+ DOWN: 40,
+ DEL: 46,
+ TAB: 9,
+ RETURN: 13,
+ ESC: 27,
+ COMMA: 188,
+ PAGEUP: 33,
+ PAGEDOWN: 34,
+ BACKSPACE: 8
+ };
+
+ var globalFailure = null;
+ if(options.failure != null && typeof options.failure == "function") {
+ globalFailure = options.failure;
+ }
+
+ // Create $ object for input element
+ var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);
+
+ var timeout;
+ var previousValue = "";
+ var cache = $.Autocompleter.Cache(options);
+ var hasFocus = 0;
+ var lastKeyPressCode;
+ var config = {
+ mouseDownOnSelect: false
+ };
+ var select = $.Autocompleter.Select(options, input, selectCurrent, config);
+
+ var blockSubmit;
+
+ // prevent form submit in opera when selecting with return key
+ $.browser.opera && $(input.form).bind("submit.autocomplete", function() {
+ if (blockSubmit) {
+ blockSubmit = false;
+ return false;
+ }
+ });
+
+ // only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
+ $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
+ // a keypress means the input has focus
+ // avoids issue where input had focus before the autocomplete was applied
+ hasFocus = 1;
+ // track last key pressed
+ lastKeyPressCode = event.keyCode;
+ switch(event.keyCode) {
+
+ case KEY.UP:
+ if ( select.visible() ) {
+ event.preventDefault();
+ select.prev();
+ } else {
+ onChange(0, true);
+ }
+ break;
+
+ case KEY.DOWN:
+ if ( select.visible() ) {
+ event.preventDefault();
+ select.next();
+ } else {
+ onChange(0, true);
+ }
+ break;
+
+ case KEY.PAGEUP:
+ if ( select.visible() ) {
+ event.preventDefault();
+ select.pageUp();
+ } else {
+ onChange(0, true);
+ }
+ break;
+
+ case KEY.PAGEDOWN:
+ if ( select.visible() ) {
+ event.preventDefault();
+ select.pageDown();
+ } else {
+ onChange(0, true);
+ }
+ break;
+
+ // matches also semicolon
+ case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
+ case KEY.TAB:
+ case KEY.RETURN:
+ if( selectCurrent() ) {
+ // stop default to prevent a form submit, Opera needs special handling
+ event.preventDefault();
+ blockSubmit = true;
+ return false;
+ }
+ break;
+
+ case KEY.ESC:
+ select.hide();
+ break;
+
+ default:
+ clearTimeout(timeout);
+ timeout = setTimeout(onChange, options.delay);
+ break;
+ }
+ }).focus(function(){
+ // track whether the field has focus, we shouldn't process any
+ // results if the field no longer has focus
+ hasFocus++;
+ }).blur(function() {
+ hasFocus = 0;
+ if (!config.mouseDownOnSelect) {
+ hideResults();
+ }
+ }).click(function() {
+ // show select when clicking in a focused field
+ // but if clickFire is true, don't require field
+ // to be focused to begin with; just show select
+ if( options.clickFire ) {
+ if ( !select.visible() ) {
+ onChange(0, true);
+ }
+ } else {
+ if ( hasFocus++ > 1 && !select.visible() ) {
+ onChange(0, true);
+ }
+ }
+ }).bind("search", function() {
+ // TODO why not just specifying both arguments?
+ var fn = (arguments.length > 1) ? arguments[1] : null;
+ function findValueCallback(q, data) {
+ var result;
+ if( data && data.length ) {
+ for (var i=0; i < data.length; i++) {
+ if( data[i].result.toLowerCase() == q.toLowerCase() ) {
+ result = data[i];
+ break;
+ }
+ }
+ }
+ if( typeof fn == "function" ) fn(result);
+ else $input.trigger("result", result && [result.data, result.value]);
+ }
+ $.each(trimWords($input.val()), function(i, value) {
+ request(value, findValueCallback, findValueCallback);
+ });
+ }).bind("flushCache", function() {
+ cache.flush();
+ }).bind("setOptions", function() {
+ $.extend(true, options, arguments[1]);
+ // if we've updated the data, repopulate
+ if ( "data" in arguments[1] )
+ cache.populate();
+ }).bind("unautocomplete", function() {
+ select.unbind();
+ $input.unbind();
+ $(input.form).unbind(".autocomplete");
+ });
+
+
+ function selectCurrent() {
+ var selected = select.selected();
+ if( !selected )
+ return false;
+
+ var v = selected.result;
+ previousValue = v;
+
+ if ( options.multiple ) {
+ var words = trimWords($input.val());
+ if ( words.length > 1 ) {
+ var seperator = options.multipleSeparator.length;
+ var cursorAt = $(input).selection().start;
+ var wordAt, progress = 0;
+ $.each(words, function(i, word) {
+ progress += word.length;
+ if (cursorAt <= progress) {
+ wordAt = i;
+ return false;
+ }
+ progress += seperator;
+ });
+ words[wordAt] = v;
+ // TODO this should set the cursor to the right position, but it gets overriden somewhere
+ //$.Autocompleter.Selection(input, progress + seperator, progress + seperator);
+ v = words.join( options.multipleSeparator );
+ }
+ v += options.multipleSeparator;
+ }
+
+ $input.val(v);
+ hideResultsNow();
+ $input.trigger("result", [selected.data, selected.value]);
+ return true;
+ }
+
+ function onChange(crap, skipPrevCheck) {
+ if( lastKeyPressCode == KEY.DEL ) {
+ select.hide();
+ return;
+ }
+
+ var currentValue = $input.val();
+
+ if ( !skipPrevCheck && currentValue == previousValue )
+ return;
+
+ previousValue = currentValue;
+
+ currentValue = lastWord(currentValue);
+ if ( currentValue.length >= options.minChars) {
+ $input.addClass(options.loadingClass);
+ if (!options.matchCase)
+ currentValue = currentValue.toLowerCase();
+ request(currentValue, receiveData, hideResultsNow);
+ } else {
+ stopLoading();
+ select.hide();
+ }
+ $inval = escape($input.val());
+ $input.next("a").attr("href", hashbang+search_path+$inval);
+ };
+
+ function trimWords(value) {
+ if (!value)
+ return [""];
+ if (!options.multiple)
+ return [$.trim(value)];
+ return $.map(value.split(options.multipleSeparator), function(word) {
+ return $.trim(value).length ? $.trim(word) : null;
+ });
+ }
+
+ function lastWord(value) {
+ if ( !options.multiple )
+ return value;
+ var words = trimWords(value);
+ if (words.length == 1)
+ return words[0];
+ var cursorAt = $(input).selection().start;
+ if (cursorAt == value.length) {
+ words = trimWords(value)
+ } else {
+ words = trimWords(value.replace(value.substring(cursorAt), ""));
+ }
+ return words[words.length - 1];
+ }
+
+ // fills in the input box w/the first match (assumed to be the best match)
+ // q: the term entered
+ // sValue: the first matching result
+ function autoFill(q, sValue){
+ // autofill in the complete box w/the first match as long as the user hasn't entered in more data
+ // if the last user key pressed was backspace, don't autofill
+ if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
+ // fill in the value (keep the case the user has typed)
+ $input.val($input.val() + sValue.substring(lastWord(previousValue).length));
+ // select the portion of the value not typed by the user (so the next character will erase)
+ $(input).selection(previousValue.length, previousValue.length + sValue.length);
+ }
+ };
+
+ function hideResults() {
+ clearTimeout(timeout);
+ timeout = setTimeout(hideResultsNow, 200);
+ };
+
+ function hideResultsNow() {
+ var wasVisible = select.visible();
+ select.hide();
+ clearTimeout(timeout);
+ stopLoading();
+ if (options.mustMatch) {
+ // call search and run callback
+ $input.search(
+ function (result){
+ // if no value found, clear the input box
+ if( !result ) {
+ if (options.multiple) {
+ var words = trimWords($input.val()).slice(0, -1);
+ $input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") );
+ }
+ else {
+ $input.val( "" );
+ $input.trigger("result", null);
+ }
+ }
+ }
+ );
+ }
+ };
+
+ function receiveData(q, data) {
+ if ( data && data.length && hasFocus ) {
+ stopLoading();
+ select.display(data, q);
+ autoFill(q, data[0].value);
+ select.show();
+ } else {
+ hideResultsNow();
+ }
+ };
+
+ function request(term, success, failure) {
+ if (!options.matchCase)
+ term = term.toLowerCase();
+ var data = cache.load(term);
+ // recieve the cached data
+ if (data && data.length) {
+ success(term, data);
+ // if an AJAX url has been supplied, try loading the data now
+ } else if( (typeof options.url == "string") && (options.url.length > 0) ){
+
+ var extraParams = {
+ timestamp: +new Date()
+ };
+ $.each(options.extraParams, function(key, param) {
+ extraParams[key] = typeof param == "function" ? param() : param;
+ });
+
+ $.ajax({
+ // try to leverage ajaxQueue plugin to abort previous requests
+ mode: "abort",
+ // limit abortion to this input
+ port: "autocomplete" + input.name,
+ dataType: options.dataType,
+ url: options.url,
+ data: $.extend({
+ q: lastWord(term),
+ limit: options.max
+ }, extraParams),
+ success: function(data) {
+ var parsed = options.parse && options.parse(data) || parse(data);
+ cache.add(term, parsed);
+ success(term, parsed);
+ }
+ });
+ } else {
+ // if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
+ select.emptyList();
+ if(globalFailure != null) {
+ globalFailure();
+ }
+ else {
+ failure(term);
+ }
+ }
+ };
+
+ function parse(data) {
+ var parsed = [];
+ var rows = data.split("\n");
+ for (var i=0; i < rows.length; i++) {
+ var row = $.trim(rows[i]);
+ if (row) {
+ row = row.split("|");
+ parsed[parsed.length] = {
+ data: row,
+ value: row[0],
+ result: options.formatResult && options.formatResult(row, row[0]) || row[0]
+ };
+ }
+ }
+ return parsed;
+ };
+
+ function stopLoading() {
+ $input.removeClass(options.loadingClass);
+ };
+
+};
+
+$.Autocompleter.defaults = {
+ inputClass: "ac_input",
+ resultsClass: "ac_results",
+ loadingClass: "ac_loading",
+ minChars: 1,
+ delay: 400,
+ matchCase: false,
+ matchSubset: true,
+ matchContains: false,
+ cacheLength: 100,
+ max: 1000,
+ mustMatch: false,
+ extraParams: {},
+ selectFirst: true,
+ formatItem: function(row) { return row[0]; },
+ formatMatch: null,
+ autoFill: false,
+ width: 0,
+ multiple: false,
+ multipleSeparator: " ",
+ inputFocus: true,
+ clickFire: false,
+ highlight: function(value, term) {
+ return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1 ");
+ },
+ scroll: true,
+ scrollHeight: 180,
+ scrollJumpPosition: true
+};
+
+$.Autocompleter.Cache = function(options) {
+
+ var data = {};
+ var length = 0;
+
+ function matchSubset(s, sub) {
+ if (!options.matchCase)
+ s = s.toLowerCase();
+ var i = s.indexOf(sub);
+ if (options.matchContains == "word"){
+ i = s.toLowerCase().search("\\b" + sub.toLowerCase());
+ }
+ if (i == -1) return false;
+ return i == 0 || options.matchContains;
+ };
+
+ function add(q, value) {
+ if (length > options.cacheLength){
+ flush();
+ }
+ if (!data[q]){
+ length++;
+ }
+ data[q] = value;
+ }
+
+ function populate(){
+ if( !options.data ) return false;
+ // track the matches
+ var stMatchSets = {},
+ nullData = 0;
+
+ // no url was specified, we need to adjust the cache length to make sure it fits the local data store
+ if( !options.url ) options.cacheLength = 1;
+
+ // track all options for minChars = 0
+ stMatchSets[""] = [];
+
+ // loop through the array and create a lookup structure
+ for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
+ var rawValue = options.data[i];
+ // if rawValue is a string, make an array otherwise just reference the array
+ rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
+
+ var value = options.formatMatch(rawValue, i+1, options.data.length);
+ if ( value === false )
+ continue;
+
+ var firstChar = value.charAt(0).toLowerCase();
+ // if no lookup array for this character exists, look it up now
+ if( !stMatchSets[firstChar] )
+ stMatchSets[firstChar] = [];
+
+ // if the match is a string
+ var row = {
+ value: value,
+ data: rawValue,
+ result: options.formatResult && options.formatResult(rawValue) || value
+ };
+
+ // push the current match into the set list
+ stMatchSets[firstChar].push(row);
+
+ // keep track of minChars zero items
+ if ( nullData++ < options.max ) {
+ stMatchSets[""].push(row);
+ }
+ };
+
+ // add the data items to the cache
+ $.each(stMatchSets, function(i, value) {
+ // increase the cache size
+ options.cacheLength++;
+ // add to the cache
+ add(i, value);
+ });
+ }
+
+ // populate any existing data
+ setTimeout(populate, 25);
+
+ function flush(){
+ data = {};
+ length = 0;
+ }
+
+ return {
+ flush: flush,
+ add: add,
+ populate: populate,
+ load: function(q) {
+ if (!options.cacheLength || !length)
+ return null;
+ /*
+ * if dealing w/local data and matchContains than we must make sure
+ * to loop through all the data collections looking for matches
+ */
+ if( !options.url && options.matchContains ){
+ // track all matches
+ var csub = [];
+ // loop through all the data grids for matches
+ for( var k in data ){
+ // don't search through the stMatchSets[""] (minChars: 0) cache
+ // this prevents duplicates
+ if( k.length > 0 ){
+ var c = data[k];
+ $.each(c, function(i, x) {
+ // if we've got a match, add it to the array
+ if (matchSubset(x.value, q)) {
+ csub.push(x);
+ }
+ });
+ }
+ }
+ return csub;
+ } else
+ // if the exact item exists, use it
+ if (data[q]){
+ return data[q];
+ } else
+ if (options.matchSubset) {
+ for (var i = q.length - 1; i >= options.minChars; i--) {
+ var c = data[q.substr(0, i)];
+ if (c) {
+ var csub = [];
+ $.each(c, function(i, x) {
+ if (matchSubset(x.value, q)) {
+ csub[csub.length] = x;
+ }
+ });
+ return csub;
+ }
+ }
+ }
+ return null;
+ }
+ };
+};
+
+$.Autocompleter.Select = function (options, input, select, config) {
+ var CLASSES = {
+ ACTIVE: "ac_over"
+ };
+
+ var listItems,
+ active = -1,
+ data,
+ term = "",
+ needsInit = true,
+ element,
+ list;
+
+ // Create results
+ function init() {
+ if (!needsInit)
+ return;
+ element = $("
")
+ .hide()
+ .addClass(options.resultsClass)
+ .css("position", "absolute")
+ .appendTo(document.body)
+ .hover(function(event) {
+ // Browsers except FF do not fire mouseup event on scrollbars, resulting in mouseDownOnSelect remaining true, and results list not always hiding.
+ if($(this).is(":visible")) {
+ input.focus();
+ }
+ config.mouseDownOnSelect = false;
+ });
+
+ list = $("").appendTo(element).mouseover( function(event) {
+ if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
+ active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
+ $(target(event)).addClass(CLASSES.ACTIVE);
+ }
+ }).click(function(event) {
+ $(target(event)).addClass(CLASSES.ACTIVE);
+ select();
+ if( options.inputFocus )
+ input.focus();
+ return false;
+ }).mousedown(function() {
+ config.mouseDownOnSelect = true;
+ }).mouseup(function() {
+ config.mouseDownOnSelect = false;
+ });
+
+ if( options.width > 0 )
+ element.css("width", options.width);
+
+ needsInit = false;
+ }
+
+ function target(event) {
+ var element = event.target;
+ while(element && element.tagName != "LI")
+ element = element.parentNode;
+ // more fun with IE, sometimes event.target is empty, just ignore it then
+ if(!element)
+ return [];
+ return element;
+ }
+
+ function moveSelect(step) {
+ listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
+ movePosition(step);
+ var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
+ if(options.scroll) {
+ var offset = 0;
+ listItems.slice(0, active).each(function() {
+ offset += this.offsetHeight;
+ });
+ if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
+ list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
+ } else if(offset < list.scrollTop()) {
+ list.scrollTop(offset);
+ }
+ }
+ };
+
+ function movePosition(step) {
+ if (options.scrollJumpPosition || (!options.scrollJumpPosition && !((step < 0 && active == 0) || (step > 0 && active == listItems.size() - 1)) )) {
+ active += step;
+ if (active < 0) {
+ active = listItems.size() - 1;
+ } else if (active >= listItems.size()) {
+ active = 0;
+ }
+ }
+ }
+
+
+ function limitNumberOfItems(available) {
+ return options.max && options.max < available
+ ? options.max
+ : available;
+ }
+
+ function fillList() {
+ list.empty();
+ var max = limitNumberOfItems(data.length);
+ for (var i=0; i < max; i++) {
+ if (!data[i])
+ continue;
+ var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
+ if ( formatted === false )
+ continue;
+ var li = $(" ").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
+ $.data(li, "ac_data", data[i]);
+ }
+ listItems = list.find("li");
+ if ( options.selectFirst ) {
+ listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
+ active = 0;
+ }
+ // apply bgiframe if available
+ if ( $.fn.bgiframe )
+ list.bgiframe();
+ }
+
+ return {
+ display: function(d, q) {
+ init();
+ data = d;
+ term = q;
+ fillList();
+ },
+ next: function() {
+ moveSelect(1);
+ },
+ prev: function() {
+ moveSelect(-1);
+ },
+ pageUp: function() {
+ if (active != 0 && active - 8 < 0) {
+ moveSelect( -active );
+ } else {
+ moveSelect(-8);
+ }
+ },
+ pageDown: function() {
+ if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
+ moveSelect( listItems.size() - 1 - active );
+ } else {
+ moveSelect(8);
+ }
+ },
+ hide: function() {
+ element && element.hide();
+ listItems && listItems.removeClass(CLASSES.ACTIVE);
+ active = -1;
+ },
+ visible : function() {
+ return element && element.is(":visible");
+ },
+ current: function() {
+ return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
+ },
+ show: function() {
+ var offset = $(input).offset();
+ element.css({
+ width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
+ top: offset.top + input.offsetHeight,
+ left: offset.left
+ }).show();
+ if(options.scroll) {
+ list.scrollTop(0);
+ list.css({
+ maxHeight: options.scrollHeight,
+ overflow: 'auto'
+ });
+
+ if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
+ var listHeight = 0;
+ listItems.each(function() {
+ listHeight += this.offsetHeight;
+ });
+ var scrollbarsVisible = listHeight > options.scrollHeight;
+ list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
+ if (!scrollbarsVisible) {
+ // IE doesn't recalculate width when scrollbar disappears
+ listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
+ }
+ }
+
+ }
+ },
+ selected: function() {
+ var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
+ return selected && selected.length && $.data(selected[0], "ac_data");
+ },
+ emptyList: function (){
+ list && list.empty();
+ },
+ unbind: function() {
+ element && element.remove();
+ }
+ };
+};
+
+$.fn.selection = function(start, end) {
+ if (start !== undefined) {
+ return this.each(function() {
+ if( this.createTextRange ){
+ var selRange = this.createTextRange();
+ if (end === undefined || start == end) {
+ selRange.move("character", start);
+ selRange.select();
+ } else {
+ selRange.collapse(true);
+ selRange.moveStart("character", start);
+ selRange.moveEnd("character", end);
+ selRange.select();
+ }
+ } else if( this.setSelectionRange ){
+ this.setSelectionRange(start, end);
+ } else if( this.selectionStart ){
+ this.selectionStart = start;
+ this.selectionEnd = end;
+ }
+ });
+ }
+ var field = this[0];
+ if ( field.createTextRange ) {
+ var range = document.selection.createRange(),
+ orig = field.value,
+ teststring = "<->",
+ textLength = range.text.length;
+ range.text = teststring;
+ var caretAt = field.value.indexOf(teststring);
+ field.value = orig;
+ this.selection(caretAt, caretAt + textLength);
+ return {
+ start: caretAt,
+ end: caretAt + textLength
+ }
+ } else if( field.selectionStart !== undefined ){
+ return {
+ start: field.selectionStart,
+ end: field.selectionEnd
+ }
+ }
+};
+
+})(jQuery);
\ No newline at end of file
diff --git a/app/assets/javascripts/plugins/bing.js.erb b/app/assets/javascripts/plugins/bing.js.erb
new file mode 100644
index 0000000..84f96be
--- /dev/null
+++ b/app/assets/javascripts/plugins/bing.js.erb
@@ -0,0 +1,62 @@
+var app_id = "<%= ENV['BING_API_KEY'] %>";
+
+function bing_search(search_term)
+{
+ var requestStr = "http://api.bing.net/json.aspx?"
+ + "AppId=" + app_id
+ + "&Query=" + search_term
+ + "&Sources=Web"
+ + "&Version=2.0"
+ + "&Market=en-us"
+ + "&Adult=Moderate"
+ + "&Options=EnableHighlighting"
+ + "&Web.Count=4"
+ + "&Web.Offset=0"
+ + "&Web.Options=DisableHostCollapsing+DisableQueryAlterations"
+ + "&JsonType=callback"
+ + "&JsonCallback=SearchCompleted";
+ return requestStr;
+ var head = document.getElementsByTagName('head');
+ var script = document.createElement('script');
+ script.type = "text/javascript";
+ script.src = requestStr;
+ head[0].appendChild(script);
+
+ $('#artist_links .bing').wrap(' ');
+}
+
+function SearchCompleted(response)
+{
+ var errors = response.SearchResponse.Errors;
+ if (errors != null) DisplayErrors(errors);
+ else DisplayResults(response);
+}
+
+function DisplayResults(response)
+{
+ var results = response.SearchResponse.Web.Results;
+ var resultsListItem = null;
+ var resultStr = "";
+ for (var i = 0; i < results.length; ++i)
+ {
+ title = (results[i].Title.length > 40) ? results[i].Title.substring(0,40) + "…" : results[i].Title;
+ url = (results[i].DisplayUrl.length > 55) ? results[i].DisplayUrl.substring(0,55) + "…" : results[i].DisplayUrl;
+
+ $appendData = ""+title+" "+url+" ";
+ $appendData = ReplaceHighlightingCharacters($appendData, "", " ");
+
+ $('#artist_links ul').append($appendData);
+ }
+}
+function ReplaceHighlightingCharacters(text, beginStr, endStr)
+{
+ var regexBegin = new RegExp("\uE000", "g");
+ var regexEnd = new RegExp("\uE001", "g");
+
+ return text.replace(regexBegin, beginStr).replace(regexEnd, endStr);
+}
+
+function DisplayErrors(errors)
+{
+ $('#artist_links').prepend("Error. Try again!");
+}
diff --git a/app/assets/javascripts/plugins/coloranimations.js b/app/assets/javascripts/plugins/coloranimations.js
new file mode 100644
index 0000000..d9c1f86
--- /dev/null
+++ b/app/assets/javascripts/plugins/coloranimations.js
@@ -0,0 +1,123 @@
+/*
+ * jQuery Color Animations
+ * Copyright 2007 John Resig
+ * Released under the MIT and GPL licenses.
+ */
+
+(function(jQuery){
+
+ // We override the animation for all of these color styles
+ jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
+ jQuery.fx.step[attr] = function(fx){
+ if ( fx.state == 0 ) {
+ fx.start = getColor( fx.elem, attr );
+ fx.end = getRGB( fx.end );
+ }
+
+ fx.elem.style[attr] = "rgb(" + [
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
+ ].join(",") + ")";
+ }
+ });
+
+ // Color Conversion functions from highlightFade
+ // By Blair Mitchelmore
+ // http://jquery.offput.ca/highlightFade/
+
+ // Parse strings looking for color tuples [255,255,255]
+ function getRGB(color) {
+ var result;
+
+ // Check if we're already dealing with an array of colors
+ if ( color && color.constructor == Array && color.length == 3 )
+ return color;
+
+ // Look for rgb(num,num,num)
+ if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
+ return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];
+
+ // Look for rgb(num%,num%,num%)
+ if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
+ return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
+
+ // Look for #a0b1c2
+ if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
+ return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
+
+ // Look for #fff
+ if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
+ return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
+
+ // Otherwise, we're most likely dealing with a named color
+ return colors[jQuery.trim(color).toLowerCase()];
+ }
+
+ function getColor(elem, attr) {
+ var color;
+
+ do {
+ color = jQuery.curCSS(elem, attr);
+
+ // Keep going until we find an element that has color, or we hit the body
+ if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
+ break;
+
+ attr = "backgroundColor";
+ } while ( elem = elem.parentNode );
+
+ return getRGB(color);
+ };
+
+ // Some named colors to work with
+ // From Interface by Stefan Petre
+ // http://interface.eyecon.ro/
+
+ var colors = {
+ aqua:[0,255,255],
+ azure:[240,255,255],
+ beige:[245,245,220],
+ black:[0,0,0],
+ blue:[0,0,255],
+ brown:[165,42,42],
+ cyan:[0,255,255],
+ darkblue:[0,0,139],
+ darkcyan:[0,139,139],
+ darkgrey:[169,169,169],
+ darkgreen:[0,100,0],
+ darkkhaki:[189,183,107],
+ darkmagenta:[139,0,139],
+ darkolivegreen:[85,107,47],
+ darkorange:[255,140,0],
+ darkorchid:[153,50,204],
+ darkred:[139,0,0],
+ darksalmon:[233,150,122],
+ darkviolet:[148,0,211],
+ fuchsia:[255,0,255],
+ gold:[255,215,0],
+ green:[0,128,0],
+ indigo:[75,0,130],
+ khaki:[240,230,140],
+ lightblue:[173,216,230],
+ lightcyan:[224,255,255],
+ lightgreen:[144,238,144],
+ lightgrey:[211,211,211],
+ lightpink:[255,182,193],
+ lightyellow:[255,255,224],
+ lime:[0,255,0],
+ magenta:[255,0,255],
+ maroon:[128,0,0],
+ navy:[0,0,128],
+ olive:[128,128,0],
+ orange:[255,165,0],
+ pink:[255,192,203],
+ purple:[128,0,128],
+ violet:[128,0,128],
+ red:[255,0,0],
+ silver:[192,192,192],
+ white:[255,255,255],
+ yellow:[255,255,0]
+ };
+
+})(jQuery);
\ No newline at end of file
diff --git a/app/assets/javascripts/plugins/imageresize.js b/app/assets/javascripts/plugins/imageresize.js
new file mode 100644
index 0000000..b400c37
--- /dev/null
+++ b/app/assets/javascripts/plugins/imageresize.js
@@ -0,0 +1,2 @@
+// http://imgscale.kjmeath.com
+(function(a){a.fn.imgscale=function(f){f=a.extend({parent:false,scale:"fill",center:true,fade:0},f);var i,e,j,k,c,d,h,b;this.each(function(){var l=a(this);var m=(!f.parent?l.parent():l.parents(f.parent));m.css({opacity:0,overflow:'hidden'});if(m.length>0){l.removeAttr("height").removeAttr("width");if(this.complete){g(l,m,false)}else{l.load(function(){g(l,m,true)})}}});function g(l,p,r){i=p.height();e=p.width();j=l.height();k=l.width();n();function n(){if(e>i){m("w")}else{if(ej){t(v,"w")}else{if(k=e){s("t")}else{s("w")}}function s(v){switch(v){case"t":if(f.scale=="fit"){l.attr("width",e)}else{l.attr("height",i)}break;case"w":if(f.scale=="fit"){l.attr("height",i)}else{l.attr("width",e)}break}if(f.center){o()}else{u()}}function o(){c=l.width();d=l.height();if(d>i){b="-"+(Math.floor((d-i)/2))+"px";l.css("margin-top",b)}if(c>e){h="-"+(Math.floor((c-e)/2))+"px";l.css("margin-left",h)}u()}function u(){if(f.fade>0&&r){p.animate({opacity:1},f.fade)}else{p.css("opacity",1)}}}}})(jQuery);
\ No newline at end of file
diff --git a/app/assets/javascripts/plugins/nivoslider.js b/app/assets/javascripts/plugins/nivoslider.js
new file mode 100644
index 0000000..2a2b20c
--- /dev/null
+++ b/app/assets/javascripts/plugins/nivoslider.js
@@ -0,0 +1,685 @@
+/*
+ * jQuery Nivo Slider v2.5.2
+ * http://nivo.dev7studios.com
+ *
+ * Copyright 2011, Gilbert Pellegrom
+ * Free to use and abuse under the MIT license.
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * March 2010
+ */
+
+(function($) {
+
+ var NivoSlider = function(element, options){
+ //Defaults are below
+ var settings = $.extend({}, $.fn.nivoSlider.defaults, options);
+
+ //Useful variables. Play carefully.
+ var vars = {
+ currentSlide: 0,
+ currentImage: '',
+ totalSlides: 0,
+ randAnim: '',
+ running: false,
+ paused: false,
+ stop: false
+ };
+
+ //Get this slider
+ var slider = $(element);
+ slider.data('nivo:vars', vars);
+ slider.css('position','relative');
+ slider.addClass('nivoSlider');
+
+ //Find our slider children
+ var kids = slider.children();
+ kids.each(function() {
+ var child = $(this);
+ var link = '';
+ if(!child.is('img')){
+ if(child.is('a')){
+ child.addClass('nivo-imageLink');
+ link = child;
+ }
+ child = child.find('img:first');
+ }
+ //Get img width & height
+ var childWidth = child.width();
+ if(childWidth == 0) childWidth = child.attr('width');
+ var childHeight = child.height();
+ if(childHeight == 0) childHeight = child.attr('height');
+ //Resize the slider
+ if(childWidth > slider.width()){
+ slider.width(childWidth);
+ }
+ if(childHeight > slider.height()){
+ slider.height(childHeight);
+ }
+ if(link != ''){
+ link.css('display','none');
+ }
+ child.css('display','none');
+ vars.totalSlides++;
+ });
+
+ //Set startSlide
+ if(settings.startSlide > 0){
+ if(settings.startSlide >= vars.totalSlides) settings.startSlide = vars.totalSlides - 1;
+ vars.currentSlide = settings.startSlide;
+ }
+
+ //Get initial image
+ if($(kids[vars.currentSlide]).is('img')){
+ vars.currentImage = $(kids[vars.currentSlide]);
+ } else {
+ vars.currentImage = $(kids[vars.currentSlide]).find('img:first');
+ }
+
+ //Show initial link
+ if($(kids[vars.currentSlide]).is('a')){
+ $(kids[vars.currentSlide]).css('display','block');
+ }
+
+ //Set first background
+ slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat');
+
+ //Create caption
+ slider.append(
+ $('').css({ display:'none', opacity:settings.captionOpacity })
+ );
+
+ // Process caption function
+ var processCaption = function(settings){
+ var nivoCaption = $('.nivo-caption', slider);
+ if(vars.currentImage.attr('title') != '' && vars.currentImage.attr('title') != undefined){
+ var title = vars.currentImage.attr('title');
+ if(title.substr(0,1) == '#') title = $(title).html();
+
+ if(nivoCaption.css('display') == 'block'){
+ nivoCaption.find('p').fadeOut(settings.animSpeed, function(){
+ $(this).html(title);
+ $(this).fadeIn(settings.animSpeed);
+ });
+ } else {
+ nivoCaption.find('p').html(title);
+ }
+ nivoCaption.fadeIn(settings.animSpeed);
+ } else {
+ nivoCaption.fadeOut(settings.animSpeed);
+ }
+ }
+
+ //Process initial caption
+ processCaption(settings);
+
+ //In the words of Super Mario "let's a go!"
+ var timer = 0;
+ if(!settings.manualAdvance && kids.length > 1){
+ timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
+ }
+
+ //Add Direction nav
+ if(settings.directionNav){
+ slider.append('');
+
+ //Hide Direction nav
+ if(settings.directionNavHide){
+ $('.nivo-directionNav', slider).hide();
+ slider.hover(function(){
+ $('.nivo-directionNav', slider).show();
+ }, function(){
+ $('.nivo-directionNav', slider).hide();
+ });
+ }
+
+ $('a.nivo-prevNav', slider).live('click', function(){
+ if(vars.running) return false;
+ clearInterval(timer);
+ timer = '';
+ vars.currentSlide -= 2;
+ nivoRun(slider, kids, settings, 'prev');
+ });
+
+ $('a.nivo-nextNav', slider).live('click', function(){
+ if(vars.running) return false;
+ clearInterval(timer);
+ timer = '';
+ nivoRun(slider, kids, settings, 'next');
+ });
+ }
+
+ //Add Control nav
+ if(settings.controlNav){
+ var nivoControl = $('
');
+ slider.append(nivoControl);
+ for(var i = 0; i < kids.length; i++){
+ if(settings.controlNavThumbs){
+ var child = kids.eq(i);
+ if(!child.is('img')){
+ child = child.find('img:first');
+ }
+ if (settings.controlNavThumbsFromRel) {
+ nivoControl.append(' ');
+ } else {
+ nivoControl.append(' ');
+ }
+ } else {
+ nivoControl.append(''+ (i + 1) +' ');
+ }
+
+ }
+ //Set initial active link
+ $('.nivo-controlNav a:eq('+ vars.currentSlide +')', slider).addClass('active');
+
+ $('.nivo-controlNav a', slider).live('click', function(){
+ if(vars.running) return false;
+ if($(this).hasClass('active')) return false;
+ clearInterval(timer);
+ timer = '';
+ slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat');
+ vars.currentSlide = $(this).attr('rel') - 1;
+ nivoRun(slider, kids, settings, 'control');
+ });
+ }
+
+ //Keyboard Navigation
+ if(settings.keyboardNav){
+ $(window).keypress(function(event){
+ //Left
+ if(event.keyCode == '37'){
+ if(vars.running) return false;
+ clearInterval(timer);
+ timer = '';
+ vars.currentSlide-=2;
+ nivoRun(slider, kids, settings, 'prev');
+ }
+ //Right
+ if(event.keyCode == '39'){
+ if(vars.running) return false;
+ clearInterval(timer);
+ timer = '';
+ nivoRun(slider, kids, settings, 'next');
+ }
+ });
+ }
+
+ //For pauseOnHover setting
+ if(settings.pauseOnHover){
+ slider.hover(function(){
+ vars.paused = true;
+ clearInterval(timer);
+ timer = '';
+ }, function(){
+ vars.paused = false;
+ //Restart the timer
+ if(timer == '' && !settings.manualAdvance){
+ timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
+ }
+ });
+ }
+
+ //Event when Animation finishes
+ slider.bind('nivo:animFinished', function(){
+ vars.running = false;
+ //Hide child links
+ $(kids).each(function(){
+ if($(this).is('a')){
+ $(this).css('display','none');
+ }
+ });
+ //Show current link
+ if($(kids[vars.currentSlide]).is('a')){
+ $(kids[vars.currentSlide]).css('display','block');
+ }
+ //Restart the timer
+ if(timer == '' && !vars.paused && !settings.manualAdvance){
+ timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
+ }
+ //Trigger the afterChange callback
+ settings.afterChange.call(this);
+ });
+
+ // Add slices for slice animations
+ var createSlices = function(slider, settings, vars){
+ for(var i = 0; i < settings.slices; i++){
+ var sliceWidth = Math.round(slider.width()/settings.slices);
+ if(i == settings.slices-1){
+ slider.append(
+ $('
').css({
+ left:(sliceWidth*i)+'px', width:(slider.width()-(sliceWidth*i))+'px',
+ height:'0px',
+ opacity:'0',
+ background: 'url("'+ vars.currentImage.attr('src') +'") no-repeat -'+ ((sliceWidth + (i * sliceWidth)) - sliceWidth) +'px 0%'
+ })
+ );
+ } else {
+ slider.append(
+ $('
').css({
+ left:(sliceWidth*i)+'px', width:sliceWidth+'px',
+ height:'0px',
+ opacity:'0',
+ background: 'url("'+ vars.currentImage.attr('src') +'") no-repeat -'+ ((sliceWidth + (i * sliceWidth)) - sliceWidth) +'px 0%'
+ })
+ );
+ }
+ }
+ }
+
+ // Add boxes for box animations
+ var createBoxes = function(slider, settings, vars){
+ var boxWidth = Math.round(slider.width()/settings.boxCols);
+ var boxHeight = Math.round(slider.height()/settings.boxRows);
+
+ for(var rows = 0; rows < settings.boxRows; rows++){
+ for(var cols = 0; cols < settings.boxCols; cols++){
+ if(cols == settings.boxCols-1){
+ slider.append(
+ $('
').css({
+ opacity:0,
+ left:(boxWidth*cols)+'px',
+ top:(boxHeight*rows)+'px',
+ width:(slider.width()-(boxWidth*cols))+'px',
+ height:boxHeight+'px',
+ background: 'url("'+ vars.currentImage.attr('src') +'") no-repeat -'+ ((boxWidth + (cols * boxWidth)) - boxWidth) +'px -'+ ((boxHeight + (rows * boxHeight)) - boxHeight) +'px'
+ })
+ );
+ } else {
+ slider.append(
+ $('
').css({
+ opacity:0,
+ left:(boxWidth*cols)+'px',
+ top:(boxHeight*rows)+'px',
+ width:boxWidth+'px',
+ height:boxHeight+'px',
+ background: 'url("'+ vars.currentImage.attr('src') +'") no-repeat -'+ ((boxWidth + (cols * boxWidth)) - boxWidth) +'px -'+ ((boxHeight + (rows * boxHeight)) - boxHeight) +'px'
+ })
+ );
+ }
+ }
+ }
+ }
+
+ // Private run method
+ var nivoRun = function(slider, kids, settings, nudge){
+ //Get our vars
+ var vars = slider.data('nivo:vars');
+
+ //Trigger the lastSlide callback
+ if(vars && (vars.currentSlide == vars.totalSlides - 1)){
+ settings.lastSlide.call(this);
+ }
+
+ // Stop
+ if((!vars || vars.stop) && !nudge) return false;
+
+ //Trigger the beforeChange callback
+ settings.beforeChange.call(this);
+
+ //Set current background before change
+ if(!nudge){
+ slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat');
+ } else {
+ if(nudge == 'prev'){
+ slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat');
+ }
+ if(nudge == 'next'){
+ slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat');
+ }
+ }
+ vars.currentSlide++;
+ //Trigger the slideshowEnd callback
+ if(vars.currentSlide == vars.totalSlides){
+ vars.currentSlide = 0;
+ settings.slideshowEnd.call(this);
+ }
+ if(vars.currentSlide < 0) vars.currentSlide = (vars.totalSlides - 1);
+ //Set vars.currentImage
+ if($(kids[vars.currentSlide]).is('img')){
+ vars.currentImage = $(kids[vars.currentSlide]);
+ } else {
+ vars.currentImage = $(kids[vars.currentSlide]).find('img:first');
+ }
+
+ //Set active links
+ if(settings.controlNav){
+ $('.nivo-controlNav a', slider).removeClass('active');
+ $('.nivo-controlNav a:eq('+ vars.currentSlide +')', slider).addClass('active');
+ }
+
+ //Process caption
+ processCaption(settings);
+
+ // Remove any slices from last transition
+ $('.nivo-slice', slider).remove();
+
+ // Remove any boxes from last transition
+ $('.nivo-box', slider).remove();
+
+ if(settings.effect == 'random'){
+ var anims = new Array('sliceDownRight','sliceDownLeft','sliceUpRight','sliceUpLeft','sliceUpDown','sliceUpDownLeft','fold','fade',
+ 'boxRandom','boxRain','boxRainReverse','boxRainGrow','boxRainGrowReverse');
+ vars.randAnim = anims[Math.floor(Math.random()*(anims.length + 1))];
+ if(vars.randAnim == undefined) vars.randAnim = 'fade';
+ }
+
+ //Run random effect from specified set (eg: effect:'fold,fade')
+ if(settings.effect.indexOf(',') != -1){
+ var anims = settings.effect.split(',');
+ vars.randAnim = anims[Math.floor(Math.random()*(anims.length))];
+ if(vars.randAnim == undefined) vars.randAnim = 'fade';
+ }
+
+ //Run effects
+ vars.running = true;
+ if(settings.effect == 'sliceDown' || settings.effect == 'sliceDownRight' || vars.randAnim == 'sliceDownRight' ||
+ settings.effect == 'sliceDownLeft' || vars.randAnim == 'sliceDownLeft'){
+ createSlices(slider, settings, vars);
+ var timeBuff = 0;
+ var i = 0;
+ var slices = $('.nivo-slice', slider);
+ if(settings.effect == 'sliceDownLeft' || vars.randAnim == 'sliceDownLeft') slices = $('.nivo-slice', slider)._reverse();
+
+ slices.each(function(){
+ var slice = $(this);
+ slice.css({ 'top': '0px' });
+ if(i == settings.slices-1){
+ setTimeout(function(){
+ slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
+ }, (100 + timeBuff));
+ } else {
+ setTimeout(function(){
+ slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed);
+ }, (100 + timeBuff));
+ }
+ timeBuff += 50;
+ i++;
+ });
+ }
+ else if(settings.effect == 'sliceUp' || settings.effect == 'sliceUpRight' || vars.randAnim == 'sliceUpRight' ||
+ settings.effect == 'sliceUpLeft' || vars.randAnim == 'sliceUpLeft'){
+ createSlices(slider, settings, vars);
+ var timeBuff = 0;
+ var i = 0;
+ var slices = $('.nivo-slice', slider);
+ if(settings.effect == 'sliceUpLeft' || vars.randAnim == 'sliceUpLeft') slices = $('.nivo-slice', slider)._reverse();
+
+ slices.each(function(){
+ var slice = $(this);
+ slice.css({ 'bottom': '0px' });
+ if(i == settings.slices-1){
+ setTimeout(function(){
+ slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
+ }, (100 + timeBuff));
+ } else {
+ setTimeout(function(){
+ slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed);
+ }, (100 + timeBuff));
+ }
+ timeBuff += 50;
+ i++;
+ });
+ }
+ else if(settings.effect == 'sliceUpDown' || settings.effect == 'sliceUpDownRight' || vars.randAnim == 'sliceUpDown' ||
+ settings.effect == 'sliceUpDownLeft' || vars.randAnim == 'sliceUpDownLeft'){
+ createSlices(slider, settings, vars);
+ var timeBuff = 0;
+ var i = 0;
+ var v = 0;
+ var slices = $('.nivo-slice', slider);
+ if(settings.effect == 'sliceUpDownLeft' || vars.randAnim == 'sliceUpDownLeft') slices = $('.nivo-slice', slider)._reverse();
+
+ slices.each(function(){
+ var slice = $(this);
+ if(i == 0){
+ slice.css('top','0px');
+ i++;
+ } else {
+ slice.css('bottom','0px');
+ i = 0;
+ }
+
+ if(v == settings.slices-1){
+ setTimeout(function(){
+ slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
+ }, (100 + timeBuff));
+ } else {
+ setTimeout(function(){
+ slice.animate({ height:'100%', opacity:'1.0' }, settings.animSpeed);
+ }, (100 + timeBuff));
+ }
+ timeBuff += 50;
+ v++;
+ });
+ }
+ else if(settings.effect == 'fold' || vars.randAnim == 'fold'){
+ createSlices(slider, settings, vars);
+ var timeBuff = 0;
+ var i = 0;
+
+ $('.nivo-slice', slider).each(function(){
+ var slice = $(this);
+ var origWidth = slice.width();
+ slice.css({ top:'0px', height:'100%', width:'0px' });
+ if(i == settings.slices-1){
+ setTimeout(function(){
+ slice.animate({ width:origWidth, opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
+ }, (100 + timeBuff));
+ } else {
+ setTimeout(function(){
+ slice.animate({ width:origWidth, opacity:'1.0' }, settings.animSpeed);
+ }, (100 + timeBuff));
+ }
+ timeBuff += 50;
+ i++;
+ });
+ }
+ else if(settings.effect == 'fade' || vars.randAnim == 'fade'){
+ createSlices(slider, settings, vars);
+
+ var firstSlice = $('.nivo-slice:first', slider);
+ firstSlice.css({
+ 'height': '100%',
+ 'width': slider.width() + 'px'
+ });
+
+ firstSlice.animate({ opacity:'1.0' }, (settings.animSpeed*2), '', function(){ slider.trigger('nivo:animFinished'); });
+ }
+ else if(settings.effect == 'slideInRight' || vars.randAnim == 'slideInRight'){
+ createSlices(slider, settings, vars);
+
+ var firstSlice = $('.nivo-slice:first', slider);
+ firstSlice.css({
+ 'height': '100%',
+ 'width': '0px',
+ 'opacity': '1'
+ });
+
+ firstSlice.animate({ width: slider.width() + 'px' }, (settings.animSpeed*2), '', function(){ slider.trigger('nivo:animFinished'); });
+ }
+ else if(settings.effect == 'slideInLeft' || vars.randAnim == 'slideInLeft'){
+ createSlices(slider, settings, vars);
+
+ var firstSlice = $('.nivo-slice:first', slider);
+ firstSlice.css({
+ 'height': '100%',
+ 'width': '0px',
+ 'opacity': '1',
+ 'left': '',
+ 'right': '0px'
+ });
+
+ firstSlice.animate({ width: slider.width() + 'px' }, (settings.animSpeed*2), '', function(){
+ // Reset positioning
+ firstSlice.css({
+ 'left': '0px',
+ 'right': ''
+ });
+ slider.trigger('nivo:animFinished');
+ });
+ }
+ else if(settings.effect == 'boxRandom' || vars.randAnim == 'boxRandom'){
+ createBoxes(slider, settings, vars);
+
+ var totalBoxes = settings.boxCols * settings.boxRows;
+ var i = 0;
+ var timeBuff = 0;
+
+ var boxes = shuffle($('.nivo-box', slider));
+ boxes.each(function(){
+ var box = $(this);
+ if(i == totalBoxes-1){
+ setTimeout(function(){
+ box.animate({ opacity:'1' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
+ }, (100 + timeBuff));
+ } else {
+ setTimeout(function(){
+ box.animate({ opacity:'1' }, settings.animSpeed);
+ }, (100 + timeBuff));
+ }
+ timeBuff += 20;
+ i++;
+ });
+ }
+ else if(settings.effect == 'boxRain' || vars.randAnim == 'boxRain' || settings.effect == 'boxRainReverse' || vars.randAnim == 'boxRainReverse' ||
+ settings.effect == 'boxRainGrow' || vars.randAnim == 'boxRainGrow' || settings.effect == 'boxRainGrowReverse' || vars.randAnim == 'boxRainGrowReverse'){
+ createBoxes(slider, settings, vars);
+
+ var totalBoxes = settings.boxCols * settings.boxRows;
+ var i = 0;
+ var timeBuff = 0;
+
+ // Split boxes into 2D array
+ var rowIndex = 0;
+ var colIndex = 0;
+ var box2Darr = new Array();
+ box2Darr[rowIndex] = new Array();
+ var boxes = $('.nivo-box', slider);
+ if(settings.effect == 'boxRainReverse' || vars.randAnim == 'boxRainReverse' ||
+ settings.effect == 'boxRainGrowReverse' || vars.randAnim == 'boxRainGrowReverse'){
+ boxes = $('.nivo-box', slider)._reverse();
+ }
+ boxes.each(function(){
+ box2Darr[rowIndex][colIndex] = $(this);
+ colIndex++;
+ if(colIndex == settings.boxCols){
+ rowIndex++;
+ colIndex = 0;
+ box2Darr[rowIndex] = new Array();
+ }
+ });
+
+ // Run animation
+ for(var cols = 0; cols < (settings.boxCols * 2); cols++){
+ var prevCol = cols;
+ for(var rows = 0; rows < settings.boxRows; rows++){
+ if(prevCol >= 0 && prevCol < settings.boxCols){
+ /* Due to some weird JS bug with loop vars
+ being used in setTimeout, this is wrapped
+ with an anonymous function call */
+ (function(row, col, time, i, totalBoxes) {
+ var box = $(box2Darr[row][col]);
+ var w = box.width();
+ var h = box.height();
+ if(settings.effect == 'boxRainGrow' || vars.randAnim == 'boxRainGrow' ||
+ settings.effect == 'boxRainGrowReverse' || vars.randAnim == 'boxRainGrowReverse'){
+ box.width(0).height(0);
+ }
+ if(i == totalBoxes-1){
+ setTimeout(function(){
+ box.animate({ opacity:'1', width:w, height:h }, settings.animSpeed/1.3, '', function(){ slider.trigger('nivo:animFinished'); });
+ }, (100 + time));
+ } else {
+ setTimeout(function(){
+ box.animate({ opacity:'1', width:w, height:h }, settings.animSpeed/1.3);
+ }, (100 + time));
+ }
+ })(rows, prevCol, timeBuff, i, totalBoxes);
+ i++;
+ }
+ prevCol--;
+ }
+ timeBuff += 100;
+ }
+ }
+ }
+
+ // Shuffle an array
+ var shuffle = function(arr){
+ for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x);
+ return arr;
+ }
+
+ // For debugging
+ var trace = function(msg){
+ if (this.console && typeof console.log != "undefined")
+ console.log(msg);
+ }
+
+ // Start / Stop
+ this.stop = function(){
+ if(!$(element).data('nivo:vars').stop){
+ $(element).data('nivo:vars').stop = true;
+ trace('Stop Slider');
+ }
+ }
+
+ this.start = function(){
+ if($(element).data('nivo:vars').stop){
+ $(element).data('nivo:vars').stop = false;
+ trace('Start Slider');
+ }
+ }
+
+ //Trigger the afterLoad callback
+ settings.afterLoad.call(this);
+
+ return this;
+ };
+
+ $.fn.nivoSlider = function(options) {
+
+ return this.each(function(key, value){
+ var element = $(this);
+ // Return early if this element already has a plugin instance
+ if (element.data('nivoslider')) return element.data('nivoslider');
+ // Pass options to plugin constructor
+ var nivoslider = new NivoSlider(this, options);
+ // Store plugin object in this element's data
+ element.data('nivoslider', nivoslider);
+ });
+
+ };
+
+ //Default settings
+ $.fn.nivoSlider.defaults = {
+ effect: 'random',
+ slices: 15,
+ boxCols: 8,
+ boxRows: 4,
+ animSpeed: 500,
+ pauseTime: 3000,
+ startSlide: 0,
+ directionNav: true,
+ directionNavHide: true,
+ controlNav: true,
+ controlNavThumbs: false,
+ controlNavThumbsFromRel: false,
+ controlNavThumbsSearch: '.jpg',
+ controlNavThumbsReplace: '_thumb.jpg',
+ keyboardNav: true,
+ pauseOnHover: true,
+ manualAdvance: false,
+ captionOpacity: 0.8,
+ prevText: 'Prev',
+ nextText: 'Next',
+ beforeChange: function(){},
+ afterChange: function(){},
+ slideshowEnd: function(){},
+ lastSlide: function(){},
+ afterLoad: function(){}
+ };
+
+ $.fn._reverse = [].reverse;
+
+})(jQuery);
\ No newline at end of file
diff --git a/app/assets/javascripts/plugins/path.js b/app/assets/javascripts/plugins/path.js
new file mode 100644
index 0000000..26de6b8
--- /dev/null
+++ b/app/assets/javascripts/plugins/path.js
@@ -0,0 +1,149 @@
+var Path = {
+ 'version': "0.6.4",
+ 'map': function (path) {
+ if (Path.routes.defined.hasOwnProperty(path)) {
+ return Path.routes.defined[path];
+ } else {
+ return new Path.core.route(path);
+ }
+ },
+ 'root': function (path) {
+ Path.routes.root = path;
+ },
+ 'rescue': function (fn) {
+ Path.routes.rescue = fn;
+ },
+ 'match': function (path, parameterize) {
+ var params = {}, route = null, possible_routes, slice, i, j, compare;
+ for (route in Path.routes.defined) {
+ if (route !== null && route !== undefined) {
+ route = Path.routes.defined[route];
+ possible_routes = route.partition();
+ for (j = 0; j < possible_routes.length; j++) {
+ slice = possible_routes[j];
+ compare = path;
+ if (slice.search(/:/) > 0) {
+ for (i = 0; i < slice.split("/").length; i++) {
+ if ((i < compare.split("/").length) && (slice.split("/")[i][0] === ":")) {
+ params[slice.split('/')[i].replace(/:/, '')] = compare.split("/")[i];
+ compare = compare.replace(compare.split("/")[i], slice.split("/")[i]);
+ }
+ }
+ }
+ if (slice === compare) {
+ if (parameterize) {
+ route.params = params;
+ }
+ return route;
+ }
+ }
+ }
+ }
+ return null;
+ },
+ 'dispatch': function () {
+ var previous_route, matched_route;
+ if (Path.routes.current !== location.hash) {
+ Path.routes.previous = Path.routes.current;
+ Path.routes.current = location.hash;
+ matched_route = Path.match(location.hash, true);
+
+ if (Path.routes.previous) {
+ previous_route = Path.match(Path.routes.previous);
+ if (previous_route !== null && previous_route.do_exit !== null) {
+ previous_route.do_exit();
+ }
+ }
+
+ if (matched_route !== null) {
+ matched_route.run();
+ } else {
+ if (Path.routes.rescue !== null) {
+ Path.routes.rescue();
+ }
+ }
+ }
+ },
+ 'listen': function () {
+ if (location.hash === "") {
+ if (Path.routes.root !== null) {
+ location.hash = Path.routes.root;
+ // artistandarchitects:
+ // Added to init response on hashchange
+ Path.dispatch();
+ }
+ } else {
+ Path.dispatch();
+ }
+
+ if ("onhashchange" in window) {
+ window.onhashchange = Path.dispatch;
+ } else {
+ setInterval(Path.dispatch, 50);
+ }
+ },
+ 'core': {
+ 'route': function (path) {
+ this.path = path;
+ this.action = null;
+ this.do_enter = [];
+ this.do_exit = null;
+ this.params = {};
+ Path.routes.defined[path] = this;
+ }
+ },
+ 'routes': {
+ 'current': null,
+ 'root': null,
+ 'rescue': null,
+ 'previous': null,
+ 'defined': {}
+ }
+};
+Path.core.route.prototype = {
+ 'to': function (fn) {
+ this.action = fn;
+ return this;
+ },
+ 'enter': function (fns) {
+ if (fns instanceof Array) {
+ this.do_enter = this.do_enter.concat(fns);
+ } else {
+ this.do_enter.push(fns);
+ }
+ return this;
+ },
+ 'exit': function (fn) {
+ this.do_exit = fn;
+ return this;
+ },
+ 'partition': function () {
+ var parts = [], options = [], re = /\(([^}]+?)\)/g, text, i;
+ while (text = re.exec(this.path)) {
+ parts.push(text[1]);
+ }
+ options.push(this.path.split("(")[0]);
+ for (i = 0; i < parts.length; i++) {
+ options.push(options[options.length - 1] + parts[i]);
+ }
+ return options;
+ },
+ 'run': function () {
+ var halt_execution = false, i, result, previous;
+
+ if (Path.routes.defined[this.path].hasOwnProperty("do_enter")) {
+ if (Path.routes.defined[this.path].do_enter.length > 0) {
+ for (i = 0; i < Path.routes.defined[this.path].do_enter.length; i++) {
+ result = Path.routes.defined[this.path].do_enter[i]();
+ if (result === false) {
+ halt_execution = true;
+ break;
+ }
+ }
+ }
+ }
+ if (!halt_execution) {
+ Path.routes.defined[this.path].action();
+ }
+ }
+};
\ No newline at end of file
diff --git a/app/assets/javascripts/plugins/pinify.js b/app/assets/javascripts/plugins/pinify.js
new file mode 100644
index 0000000..ba719d2
--- /dev/null
+++ b/app/assets/javascripts/plugins/pinify.js
@@ -0,0 +1,426 @@
+/*!
+* jQuery pinify Plugin v1.2
+* http://ie9ify.codeplex.com
+*
+* Copyright 2011, Brandon Satrom and Clark Sell
+* Licensed under MS-PL.
+* http://ie9ify.codeplex.com/license
+*
+* Date: Wednesday May 11 2011 11:47:27 -05
+*/
+(function ($, undefined) {
+ //private functions
+ function createMetaTag(name, content, head) {
+ if ($('meta[name=' + name + ']').length && name !== 'msapplication-task') {
+ return;
+ }
+
+ if (!content.length) { return; }
+
+ $(' ', {
+ name: name,
+ content: content
+ }).appendTo(head);
+ }
+
+ function siteModeSupported() {
+ return (!!window.external) && ('msIsSiteMode' in window.external);
+ }
+
+ /* pinify jQuery Functions:
+ * init: Adds meta tags and startup tasks to a page
+ * enablePinning: Enables a content item to be enabled for pinning (meaning that it can be dragged to the taskbar to pin a site)
+ * enableSiteMode: Enables binding of an event that triggers a site mode dialog (asking if the user wants to pin the site to the *start* menu)
+ * pinTeaser: Adds a teaser bar to the site, directly underneath the address bar. Teaser bar encourages the user to pin the site.
+ */
+ var methods = {
+ init: function (options) {
+ var defaultOptions = {
+ applicationName: document.title.toString(),
+ favIcon: 'http://' + location.host + '/favicon.ico',
+ navColor: '',
+ startUrl: 'http://' + location.host,
+ tooltip: document.title.toString(),
+ window: 'width=800;height=600',
+ tasks: []
+ };
+
+ options = $.extend({}, defaultOptions, options);
+
+ return this.each(function () {
+ var taskList = options.tasks;
+ var head = this;
+
+ if ($('link[type^=image]').length === 0) {
+ $(" ", {
+ rel: "shortcut icon",
+ type: "image/ico",
+ href: options.favIcon
+ }).appendTo(this);
+
+ }
+
+ createMetaTag('application-name', options.applicationName, this);
+ createMetaTag('msapplication-tooltip', options.tooltip, this);
+ createMetaTag('msapplication-starturl', options.startUrl, this);
+ createMetaTag('msapplication-navbutton-color', options.navColor, this);
+ createMetaTag('msapplication-window', options.window, this);
+
+ $.each(taskList, function (key, value) {
+ createMetaTag('msapplication-task', 'name=' + value.name + ';action-uri=' + value.action + ';icon-uri=' + value.icon, head);
+ });
+ });
+ },
+ enablePinning: function (title) {
+ return this.each(function () {
+ title = title || "Drag this image to your Windows 7 Taskbar to pin this site with IE9";
+
+ $(this).addClass('msPinSite').attr("title", title);
+ });
+ },
+ enableSiteMode: function (eventName) {
+ eventName = eventName || "click";
+
+ return this.each(function () {
+ $(this).bind(eventName, function (event) {
+ event.preventDefault();
+
+ try {
+ window.external.msAddSiteMode();
+ } catch (e) { }
+ });
+ });
+ },
+ pinTeaser: function (options) {
+ if (window.external.msIsSiteMode()) {
+ return this;
+ }
+
+ var teaser = $(this);
+ var defaultOptions = {
+ type: 'hangingChad', //Options are: hangingChad, topHat, brandedTopHat and doubleTopHat
+ icon: 'http://' + location.host + '/favicon.ico',
+ pinText: 'Drag this image to the taskbar to pin this site',
+ secondaryText: 'Simply drag the icon or tab to taskbar to pin.',
+ addStartLink: true,
+ linkText: 'Click here to add this site to the start menu',
+ sticky: true,
+ timeout: 10000,
+ style: {
+ linkColor: 'rgb(0, 108, 172)',
+ backgroundColor: 'rgb(0, 108, 172)',
+ textColor: 'white',
+ backgroundImage: null,
+ leftBackgoundImage: null,
+ rightBackgoundImage: null,
+ closeButtonImage: null
+ }
+ };
+ var alignmentDiv, contentDiv, leftDiv, leftBar, rightDiv, mainContent;
+ var builder = {
+ topHat: function () {
+ teaser.addClass('pinify-topHat-container pinify-teaser').css('color', options.style.textColor);
+ if (options.style.backgoundImage) {
+ teaser.css('background-image', options.style.backgroundImage);
+ }
+ alignmentDiv = $('', { 'class': 'pinify-topHat-alignment' }).appendTo(teaser);
+ contentDiv = $('
', { 'class': 'pinify-topHat-content' }).appendTo(alignmentDiv);
+ $('
', { id: 'pinify-topHat-logo', src: options.icon, alt: 'Drag Me', 'class': 'msPinSite' }).appendTo(contentDiv);
+ $('
').addClass('pinify-topHat-text').text(options.pinText).appendTo(contentDiv);
+ },
+ brandedTopHat: function () {
+ teaser.addClass('pinify-brandedTopHat-container pinify-teaser').css('color', options.style.textColor);
+ if (options.style.backgoundImage) {
+ teaser.css('background-image', options.style.backgroundImage);
+ }
+
+ contentDiv = $('', { 'class': 'pinify-brandedTopHat-content' }).appendTo(teaser);
+ $('
', { id: 'pinify-brandedTopHat-firstLogo', src: options.icon, alt: 'Drag Me', 'class': 'msPinSite' }).appendTo(contentDiv);
+ $('
', { id: 'pinify-brandedTopHat-thirdLogo', src: options.icon, alt: 'Drag Me', 'class': 'msPinSite' }).appendTo(contentDiv);
+ $('
', { 'class': 'pinify-mainText' }).text(options.pinText).appendTo(contentDiv);
+ $('
', { 'class': 'pinify-brandedTopHat-secondaryText' }).text(options.secondaryText).appendTo(contentDiv);
+ },
+ doubleTopHat: function () {
+ teaser.addClass('pinify-doubleTopHat-container pinify-teaser').css('color', options.style.textColor);
+
+ leftDiv = $('
', { 'class': 'pinify-doubleTopHat-left' }).appendTo(teaser);
+ if (options.style.leftBackgroundImage) {
+ $(leftDiv).css('background-image', options.style.leftBackgoundImage);
+ }
+ leftBar = $('
', { id: 'pinify-doubleTopHat-leftBar' }).appendTo(leftDiv);
+ $('
', { id: 'pinify-doubleTopHat-logo', src: options.icon, alt: 'Drag Me', 'class': 'msPinSite' }).appendTo(leftBar);
+
+ rightDiv = $('
', { 'class': 'pinify-doubleTopHat-right' }).appendTo(teaser);
+ if (options.style.rightBackgroundImage) {
+ $(rightDiv).css('background-image', options.style.rightBackgoundImage);
+ }
+ $('
', { id: 'pinify-doubleTopHat-rightBar' }).appendTo(rightDiv);
+ mainContent = $('
', { id: 'pinify-doubleTopHat-rightBarMainContent' }).appendTo(rightDiv);
+ $('
', { 'class': 'pinify-mainText' }).text(options.pinText).appendTo(mainContent);
+ $('
', { 'class': 'pinify-doubleTopHat-lighterText' }).text(options.secondaryText).appendTo(rightDiv);
+ },
+ hangingChad: function () {
+ teaser.hide();
+ teaser.css({ 'color': options.style.textColor, 'background-color': options.style.backgroundColor }).addClass('pinify-hanging-container pinify-teaser');
+ $('
', { src: options.icon, 'class': 'msPinSite' }).appendTo(teaser);
+ $('
', { 'class': 'pinify-hanging-content' }).appendTo(teaser);
+ $('
', { id: 'pinify-pinText' }).text(options.pinText).appendTo(teaser);
+ teaser.fadeIn('slow');
+ }
+ };
+
+ options = $.extend({}, defaultOptions, options);
+
+ return this.each(function () {
+ //Call the correct builder function based on the type passed in
+ builder[options.type]();
+
+ //If it's not a sticky teaser, fade it out after a delay. Otherwise put a close button on the div
+ if (!options.sticky) {
+ this.delay(options.timeout).fadeOut('slow');
+ } else {
+ $('
').addClass('pinify-closePin').click(function () {
+ $('.pinify-teaser').slideUp('slow');
+ teaser.slideUp('slow');
+ }).appendTo(teaser);
+ }
+
+ if (!options.addStartLink) {
+ return;
+ }
+
+ $('
').addClass('pinify-addSiteLink').attr('href', '#').click(function (event) {
+ event.preventDefault();
+
+ try {
+ window.external.msAddSiteMode();
+ } catch (e) { }
+ }).css('color', options.linkColor).appendTo(teaser).text(options.linkText);
+ });
+ }
+ };
+
+ //main entry point for pinify methods that operate on a jQuery wrapped set (above)
+ $.fn.pinify = function (method) {
+ if (!siteModeSupported()) {
+ return this;
+ }
+
+ if (methods[method]) {
+ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
+ } else if (typeof method === 'object' || !method) {
+ return methods.init.apply(this, arguments);
+ } else {
+ $.error('Method ' + method + ' does not exist on jQuery.pinify');
+ }
+ };
+
+ /* pinify Utility Functions
+ * firstRunState: determines wheter a pinned site has been lanched for the first time
+ * isPinned: Returns true if the site is pinned to the taskbar, false if not
+ * addJumpList: Given options, adds jumplist items to a pinned window
+ * clearJumpList: Clears all dynamic jumplist items from the pinned window
+ * addOverlay: Given options, adds an overlay icon to the taskbar for the pinned site
+ * clearOverlay: Clears the current overlay icon
+ * flashTaskbar: Flashes the taskbar box of a pinned site
+ * createThumbbarButtons: creates buttons on the pinned site preview window thumbbar, and wires events to respond to button clicks
+ */
+ $.pinify = {}; //create the pinify namespace for all of our pinify utilty functions
+
+ /* Return Values
+ * 0 = The pinned site is not in a first run state, or is not pinned
+ * 1 = First run from a drag and drop operation
+ * 2 = First run from a shortcut added to the Start menu (msAddSiteMode)
+ */
+ $.pinify.firstRunState = function (preserveState) {
+ if (!siteModeSupported()) {
+ return 0;
+ }
+
+ if (preserveState) {
+ preserveState = false;
+ }
+
+ try {
+ return window.external.msIsSiteModeFirstRun(preserveState);
+ } catch (e) {
+ return 0;
+ }
+ };
+
+ $.pinify.isPinned = function () {
+ if (!siteModeSupported()) {
+ return false;
+ }
+
+ try {
+ return window.external.msIsSiteMode();
+ } catch (e) {
+ return false;
+ }
+ };
+
+ $.pinify.addJumpList = function (options) {
+ if (!siteModeSupported()) {
+ return this;
+ }
+
+ var defaultOptions = {
+ title: '',
+ items: []
+ };
+
+ options = $.extend({}, defaultOptions, options);
+
+ try {
+ if (window.external.msIsSiteMode()) {
+ window.external.msSiteModeClearJumplist();
+ window.external.msSiteModeCreateJumplist(options.title);
+
+ var items = options.items;
+
+ $.each(items, function (key, value) {
+ window.external.msSiteModeAddJumpListItem(value.name, value.url, value.icon);
+ });
+
+ window.external.msSiteModeShowJumplist();
+ }
+ } catch (e) { }
+
+ return this;
+ };
+
+ $.pinify.clearJumpList = function () {
+ if (!siteModeSupported()) {
+ return this;
+ }
+
+ try {
+ if (window.external.msIsSiteMode()) {
+ window.external.msSiteModeClearJumpList();
+ }
+ } catch (e) { }
+ };
+
+ $.pinify.addOverlay = function (options) {
+ if (!siteModeSupported()) {
+ return this;
+ }
+
+ var defaultOptions = {
+ eventName: 'click',
+ title: '',
+ icon: ''
+ };
+
+ options = $.extend({}, defaultOptions, options);
+
+ try {
+ if (window.external.msIsSiteMode()) {
+ window.external.msSiteModeClearIconOverlay();
+ window.external.msSiteModeSetIconOverlay(options.icon, options.title);
+ }
+ } catch (e) { }
+ };
+
+ $.pinify.clearOverlay = function () {
+ if (!siteModeSupported()) {
+ return this;
+ }
+
+ try {
+ if (window.external.msIsSiteMode()) {
+ window.external.msSiteModeClearIconOverlay();
+ }
+ } catch (e) { }
+ };
+
+ $.pinify.flashTaskbar = function (options) {
+ if (!siteModeSupported()) {
+ return this;
+ }
+
+ try {
+ if (window.external.msIsSiteMode()) {
+ window.external.msSiteModeActivate();
+ }
+ } catch (e) { }
+ };
+
+ $.pinify.createThumbbarButtons = function (options) {
+ if (!siteModeSupported()) {
+ return this;
+ }
+
+ var defaultOptions = {
+ buttons: []
+ };
+
+ options = $.extend({}, defaultOptions, options);
+
+ try {
+ if (window.external.msIsSiteMode()) {
+ var buttons = [];
+ //Create a ButtonStyle Object to hold a reference to the current button, an alternate style,
+ //if any, and the active Style
+ var ButtonStyle = function () { };
+ ButtonStyle.prototype.button = null;
+ ButtonStyle.prototype.alternateStyle = null;
+ ButtonStyle.prototype.activeStyle = 0;
+ ButtonStyle.prototype.click = null;
+
+ //Create the method to respond to thumbbar button clicks
+ var clickCurrent = function (btn) {
+ var curr = buttons[btn.buttonID];
+ curr.click();
+
+ if (curr.alternateStyle) {
+ var newStyle = curr.activeStyle === 0 ? curr.alternateStyle : 0;
+ window.external.msSiteModeShowButtonStyle(curr.button, newStyle);
+ curr.activeStyle = newStyle;
+ }
+ };
+
+ $.each(options.buttons, function (key, value) {
+ var btn = window.external.msSiteModeAddThumbBarButton(value.icon, value.name);
+ var altBtn;
+
+ if (value.alternateStyle) {
+ var style = value.alternateStyle;
+ altBtn = window.external.msSiteModeAddButtonStyle(btn, style.icon, style.name);
+ }
+
+ var buttonStyle = new ButtonStyle();
+ buttonStyle.button = btn;
+ buttonStyle.alternateStyle = altBtn;
+ buttonStyle.click = value.click;
+ buttons[btn] = buttonStyle;
+
+ document.addEventListener('msthumbnailclick', clickCurrent, false);
+ });
+
+ //Hide thumbbar buttons when the page is unloaded.
+ window.onunload = function () {
+ var key;
+ for (key in buttons) {
+ if (buttons.hasOwnProperty(key)) {
+ window.external.msSiteModeUpdateThumbBarButton(buttons[key].button, true, false);
+ }
+ }
+ };
+
+ //Make sure to re-display thumbbar buttons if they are hidden on a page unload.
+ window.onload = function () {
+ var key;
+ for (key in buttons) {
+ if (buttons.hasOwnProperty(key)) {
+ window.external.msSiteModeUpdateThumbBarButton(buttons[key].button, true, true);
+ }
+ }
+ };
+
+ window.external.msSiteModeShowThumbBar();
+ }
+ } catch (e) { }
+ };
+})(jQuery);
diff --git a/app/assets/javascripts/plugins/player.js b/app/assets/javascripts/plugins/player.js
new file mode 100644
index 0000000..b6c6e72
--- /dev/null
+++ b/app/assets/javascripts/plugins/player.js
@@ -0,0 +1,145 @@
+var active = null;
+
+function updateHTML(elmId, value) {
+ document.getElementById(elmId).innerHTML = value;
+}
+
+function onPlayerError(errorCode) {
+ alert("An error occured of type:" + errorCode);
+}
+
+function onPlayerStateChange(newState) {
+ switch(newState) {
+ case 1: // PLAY
+ playControl(true);
+ break;
+ case 2: // PAUSE
+ case 5:
+ playControl(false);
+ break;
+ case 0:
+ playControl(false);
+ nextVideo();
+ break;
+ }
+
+}
+
+function updatePlayerInfo() {
+ if(ytplayer && ytplayer.getDuration) {
+ var crnt = (parseInt(ytplayer.getCurrentTime()) / parseInt(ytplayer.getDuration())) * 100;
+ $(".sidebar #scrubbar").data("rangeinput").setValue(crnt);
+ }
+}
+
+function playVideo() {
+ if (ytplayer) {
+ ytplayer.playVideo();
+ }
+}
+
+function pauseVideo() {
+ if (ytplayer) {
+ ytplayer.pauseVideo();
+ }
+}
+
+function muteVideo() {
+ if(ytplayer) {
+ volumeControl(true);
+ ytplayer.mute();
+ }
+}
+
+function unMuteVideo() {
+ if(ytplayer) {
+ volumeControl(false);
+ ytplayer.unMute();
+ }
+}
+
+
+
+function nextVideo()
+{
+ $e = activeVid();
+ $next = $e.next('div');
+ if($next.html() != null)
+ loadVideo($next.attr('vid'));
+ else loadVideo($('#playlist .el:first-child').attr('vid'));
+}
+
+function prevVideo()
+{
+ $e = activeVid();
+ $prev = $e.prev('div');
+ if($prev.html() != null)
+ loadVideo($prev.attr('vid'));
+ else loadVideo($('#playlist .el:last-child').attr('vid'));
+ //$(this).parent().children().index(this);
+}
+
+
+
+
+
+
+function loadVideo(vid) {
+ ytplayer.loadVideoById(vid);
+
+ active = vid;
+ setCurrentSong(vid);
+ /*
+ active = videoID;
+ $li = activeVid();
+ $('#playlist li').each(function(){
+ $(this).removeClass("active");
+ });
+ $li.addClass("active");
+
+ $('#track .artist').text($li.children('a').text());
+ $('#track .track').text($li.children('span').text());*/
+}
+
+
+
+
+
+
+// This function is automatically called by the player once it loads
+function onYouTubePlayerReady(playerId) {
+ ytplayer = document.getElementById("ytPlayer");
+ // This causes the updatePlayerInfo function to be called every 250ms to
+ // get fresh data from the player
+ setInterval(updatePlayerInfo, 250);
+ updatePlayerInfo();
+ ytplayer.addEventListener("onStateChange", "onPlayerStateChange");
+ ytplayer.addEventListener("onError", "onPlayerError");
+ //Load an initial video into the player
+ ytplayer.cueVideoById("sEOLtJZjnEA");
+}
+
+// The "main method" of this sample. Called when someone clicks "Run".
+function loadPlayer() {
+ // Lets Flash from another domain call JavaScript
+ var params = { allowScriptAccess: "always" };
+ // The element id of the Flash embed
+ var atts = { id: "ytPlayer" };
+ // All of the magic handled by SWFObject (http://code.google.com/p/swfobject/)
+ swfobject.embedSWF("http://www.youtube.com/apiplayer?" +
+ "&enablejsapi=1&playerapiid=player1",
+ "video", "640", "360", "8", null, null, params, atts);
+}
+
+function _run() {
+ loadPlayer();
+ $('#fullscreen').css("top", -9999);
+}
+
+
+
+function activeVid()
+{
+ $x = $('#playlist .el[vid='+active+']');
+ return ($x==null) ? '' : $x;
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/plugins/rangeinput.js b/app/assets/javascripts/plugins/rangeinput.js
new file mode 100644
index 0000000..582fc39
--- /dev/null
+++ b/app/assets/javascripts/plugins/rangeinput.js
@@ -0,0 +1,49 @@
+/*
+ * jQuery Tools 1.2.5 - The missing UI library for the Web
+ *
+ * [dateinput, rangeinput, validator]
+ *
+ * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
+ *
+ * http://flowplayer.org/tools/
+ *
+ * File generated: Wed Sep 22 06:12:54 GMT 2010
+ */
+(function(d){function R(a,c){return 32-(new Date(a,c,32)).getDate()}function S(a,c){a=""+a;for(c=c||2;a.length=0){if(!w){h.show(e);return e.preventDefault()}var i=d("#"+f.weeks+" a"),t=d("."+f.focus),o=i.index(t);t.removeClass(f.focus);if(g==74||g==40)o+=7;else if(g==75||g==38)o-=7;else if(g==76||g==39)o+=1;else if(g==72||g==37)o-=1;if(o>41){h.addMonth();t=d("#"+
+f.weeks+" a:eq("+(o-42)+")")}else if(o<0){h.addMonth(-1);t=d("#"+f.weeks+" a:eq("+(o+42)+")")}else t=i.eq(o);t.addClass(f.focus);return e.preventDefault()}if(g==34)return h.addMonth();if(g==33)return h.addMonth(-1);if(g==36)return h.today();if(g==13)d(e.target).is("select")||d("."+f.focus).click();return d([16,17,18,9]).index(g)>=0});d(document).bind("click.d",function(e){var g=e.target;if(!d(g).parents("#"+f.root).length&&g!=a[0]&&(!L||g!=L[0]))h.hide(e)})}var h=this,r=new Date,f=c.css,s=B[c.lang],
+k=d("#"+f.root),M=k.find("#"+f.title),L,I,J,D,E,G,n=a.attr("data-value")||c.value||a.val(),m=a.attr("min")||c.min,p=a.attr("max")||c.max,w;if(m===0)m="0";n=C(n)||r;m=C(m||c.yearRange[0]*365);p=C(p||c.yearRange[1]*365);if(!s)throw"Dateinput: invalid language: "+c.lang;if(a.attr("type")=="date"){var N=d(" ");d.each("class,disabled,id,maxlength,name,readonly,required,size,style,tabindex,title,value".split(","),function(b,e){N.attr(e,a.attr(e))});a.replaceWith(N);a=N}a.addClass(f.input);var H=
+a.add(h);if(!k.length){k=d("").hide().css({position:"absolute"}).attr("id",f.root);k.children().eq(0).attr("id",f.head).end().eq(1).attr("id",f.body).children().eq(0).attr("id",f.days).end().eq(1).attr("id",f.weeks).end().end().end().find("a").eq(0).attr("id",f.prev).end().eq(1).attr("id",f.next);M=k.find("#"+f.head).find("div").attr("id",f.title);if(c.selectors){var z=d(" ").attr("id",f.month),A=d(" ").attr("id",f.year);M.html(z.add(A))}for(var $=
+k.find("#"+f.days),O=0;O<7;O++)$.append(d(" ").text(s.shortDays[(O+c.firstDay)%7]));d("body").append(k)}if(c.trigger)L=d(" ").attr("href","#").addClass(f.trigger).click(function(b){h.show();return b.preventDefault()}).insertAfter(a);var K=k.find("#"+f.weeks);A=k.find("#"+f.year);z=k.find("#"+f.month);d.extend(h,{show:function(b){if(!(a.attr("readonly")||a.attr("disabled")||w)){b=b||d.Event();b.type="onBeforeShow";H.trigger(b);if(!b.isDefaultPrevented()){d.each(W,function(){this.hide()});
+w=true;z.unbind("change").change(function(){h.setValue(A.val(),d(this).val())});A.unbind("change").change(function(){h.setValue(d(this).val(),z.val())});I=k.find("#"+f.prev).unbind("click").click(function(){I.hasClass(f.disabled)||h.addMonth(-1);return false});J=k.find("#"+f.next).unbind("click").click(function(){J.hasClass(f.disabled)||h.addMonth();return false});h.setValue(n);var e=a.offset();if(/iPad/i.test(navigator.userAgent))e.top-=d(window).scrollTop();k.css({top:e.top+a.outerHeight({margins:true})+
+c.offset[0],left:e.left+c.offset[1]});if(c.speed)k.show(c.speed,function(){q(b)});else{k.show();q(b)}return h}}},setValue:function(b,e,g){var i=v(e)>=-1?new Date(v(b),v(e),v(g||1)):b||n;if(ip)i=p;b=i.getFullYear();e=i.getMonth();g=i.getDate();if(e==-1){e=11;b--}else if(e==12){e=0;b++}if(!w){j(i,c);return h}E=e;D=b;g=new Date(b,e,1-c.firstDay);g=g.getDay();var t=R(b,e),o=R(b,e-1),P;if(c.selectors){z.empty();d.each(s.months,function(x,F){mnew Date(b,x,0)&&z.append(d(" ").html(F).attr("value",
+x))});A.empty();i=r.getFullYear();for(var l=i+c.yearRange[0];lnew Date(l,0,0)&&A.append(d(" ").text(l));z.val(e);A.val(b)}else M.html(s.months[e]+" "+b);K.empty();I.add(J).removeClass(f.disabled);l=!g?-7:0;for(var u,y;l<(!g?35:42);l++){u=d(" ");if(l%7===0){P=d("
").addClass(f.week);K.append(P)}if(l=g+t){u.addClass(f.off);y=l-t-g+1;i=new Date(b,e+1,y)}else{y=l-g+1;i=new Date(b,
+e,y);if(U(n,i))u.attr("id",f.current).addClass(f.focus);else U(r,i)&&u.attr("id",f.today)}m&&ip&&u.add(J).addClass(f.disabled);u.attr("href","#"+y).text(y).data("date",i);P.append(u)}K.find("a").click(function(x){var F=d(this);if(!F.hasClass(f.disabled)){d("#"+f.current).removeAttr("id");F.attr("id",f.current);j(F.data("date"),c,x)}return false});f.sunday&&K.find(f.week).each(function(){var x=c.firstDay?7-c.firstDay:0;d(this).children().slice(x,x+1).addClass(f.sunday)});
+return h},setMin:function(b,e){m=C(b);e&&np&&h.setValue(p);return h},today:function(){return h.setValue(r)},addDay:function(b){return this.setValue(D,E,G+(b||1))},addMonth:function(b){return this.setValue(D,E+(b||1),G)},addYear:function(b){return this.setValue(D+(b||1),E,G)},hide:function(b){if(w){b=d.Event();b.type="onHide";H.trigger(b);d(document).unbind("click.d").unbind("keydown.d");if(b.isDefaultPrevented())return;k.hide();w=false}return h},
+getConf:function(){return c},getInput:function(){return a},getCalendar:function(){return k},getValue:function(b){return b?T(n,b,c.lang):n},isOpen:function(){return w}});d.each(["onBeforeShow","onShow","change","onHide"],function(b,e){d.isFunction(c[e])&&d(h).bind(e,c[e]);h[e]=function(g){g&&d(h).bind(e,g);return h}});a.bind("focus click",h.show).keydown(function(b){var e=b.keyCode;if(!w&&d(V).index(e)>=0){h.show(b);return b.preventDefault()}return b.shiftKey||b.ctrlKey||b.altKey||e==9?true:b.preventDefault()});
+C(a.val())&&j(n,c)}d.tools=d.tools||{version:"1.2.5"};var W=[],Q,V=[75,76,38,39,74,72,40,37],B={};Q=d.tools.dateinput={conf:{format:"mm/dd/yy",selectors:false,yearRange:[-5,5],lang:"en",offset:[0,0],speed:0,firstDay:0,min:undefined,max:undefined,trigger:false,css:{prefix:"cal",input:"date",root:0,head:0,title:0,prev:0,next:0,month:0,year:0,days:0,body:0,weeks:0,today:0,current:0,week:0,off:0,sunday:0,focus:0,disabled:0,trigger:0}},localize:function(a,c){d.each(c,function(j,q){c[j]=q.split(",")});
+B[a]=c}};Q.localize("en",{months:"January,February,March,April,May,June,July,August,September,October,November,December",shortMonths:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",days:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",shortDays:"Sun,Mon,Tue,Wed,Thu,Fri,Sat"});var X=/d{1,4}|m{1,4}|yy(?:yy)?|"[^"]*"|'[^']*'/g,Y=d(" ");d.expr[":"].date=function(a){var c=a.getAttribute("type");return c&&c=="date"||!!d(a).data("dateinput")};d.fn.dateinput=function(a){if(this.data("dateinput"))return this;
+a=d.extend(true,{},Q.conf,a);d.each(a.css,function(j,q){if(!q&&j!="prefix")a.css[j]=(a.css.prefix||"")+(q||j)});var c;this.each(function(){var j=new Z(d(this),a);W.push(j);j=j.getInput().data("dateinput",j);c=c?c.add(j):j});return c?c:this}})(jQuery);
+(function(e){function F(d,a){a=Math.pow(10,a);return Math.round(d*a)/a}function q(d,a){if(a=parseInt(d.css(a),10))return a;return(d=d[0].currentStyle)&&d.width&&parseInt(d.width,10)}function C(d){return(d=d.data("events"))&&d.onSlide}function G(d,a){function h(c,b,f,j){if(f===undefined)f=b/k*z;else if(j)f-=a.min;if(s)f=Math.round(f/s)*s;if(b===undefined||s)b=f*k/z;if(isNaN(f))return g;b=Math.max(0,Math.min(b,k));f=b/k*z;if(j||!n)f+=a.min;if(n)if(j)b=k-b;else f=a.max-f;f=F(f,t);var r=c.type=="click";
+if(D&&l!==undefined&&!r){c.type="onSlide";A.trigger(c,[f,b]);if(c.isDefaultPrevented())return g}j=r?a.speed:0;r=r?function(){c.type="change";A.trigger(c,[f])}:null;if(n){m.animate({top:b},j,r);a.progress&&B.animate({height:k-b+m.width()/2},j)}else{m.animate({left:b},j,r);a.progress&&B.animate({width:b+m.width()/2},j)}l=f;H=b;d.val(f);return g}function o(){if(n=a.vertical||q(i,"height")>q(i,"width")){k=q(i,"height")-q(m,"height");u=i.offset().top+k}else{k=q(i,"width")-q(m,"width");u=i.offset().left}}
+function v(){o();g.setValue(a.value!==undefined?a.value:a.min)}var g=this,p=a.css,i=e("").data("rangeinput",g),n,l,u,k,H;d.before(i);var m=i.addClass(p.slider).find("a").addClass(p.handle),B=i.find("div").addClass(p.progress);e.each("min,max,step,value".split(","),function(c,b){c=d.attr(b);if(parseFloat(c))a[b]=parseFloat(c,10)});var z=a.max-a.min,s=a.step=="any"?0:a.step,t=a.precision;if(t===undefined)try{t=s.toString().split(".")[1].length}catch(I){t=0}if(d.attr("type")==
+"range"){var w=e(" ");e.each("class,disabled,id,maxlength,name,readonly,required,size,style,tabindex,title,value".split(","),function(c,b){w.attr(b,d.attr(b))});w.val(a.value);d.replaceWith(w);d=w}d.addClass(p.input);var A=e(g).add(d),D=true;e.extend(g,{getValue:function(){return l},setValue:function(c,b){o();return h(b||e.Event("api"),undefined,c,true)},getConf:function(){return a},getProgress:function(){return B},getHandle:function(){return m},getInput:function(){return d},step:function(c,
+b){b=b||e.Event();var f=a.step=="any"?1:a.step;g.setValue(l+f*(c||1),b)},stepUp:function(c){return g.step(c||1)},stepDown:function(c){return g.step(-c||-1)}});e.each("onSlide,change".split(","),function(c,b){e.isFunction(a[b])&&e(g).bind(b,a[b]);g[b]=function(f){f&&e(g).bind(b,f);return g}});m.drag({drag:false}).bind("dragStart",function(){o();D=C(e(g))||C(d)}).bind("drag",function(c,b,f){if(d.is(":disabled"))return false;h(c,n?b:f)}).bind("dragEnd",function(c){if(!c.isDefaultPrevented()){c.type=
+"change";A.trigger(c,[l])}}).click(function(c){return c.preventDefault()});i.click(function(c){if(d.is(":disabled")||c.target==m[0])return c.preventDefault();o();var b=m.width()/2;h(c,n?k-u-b+c.pageY:c.pageX-u-b)});a.keyboard&&d.keydown(function(c){if(!d.attr("readonly")){var b=c.keyCode,f=e([75,76,38,33,39]).index(b)!=-1,j=e([74,72,40,34,37]).index(b)!=-1;if((f||j)&&!(c.shiftKey||c.altKey||c.ctrlKey)){if(f)g.step(b==33?10:1,c);else if(j)g.step(b==34?-10:-1,c);return c.preventDefault()}}});d.blur(function(c){var b=
+e(this).val();b!==l&&g.setValue(b,c)});e.extend(d[0],{stepUp:g.stepUp,stepDown:g.stepDown});v();k||e(window).load(v)}e.tools=e.tools||{version:"1.2.5"};var E;E=e.tools.rangeinput={conf:{min:0,max:100,step:"any",steps:0,value:0,precision:undefined,vertical:0,keyboard:true,progress:false,speed:100,css:{input:"range",slider:"slider",progress:"progress",handle:"handle"}}};var x,y;e.fn.drag=function(d){document.ondragstart=function(){return false};d=e.extend({x:true,y:true,drag:true},d);x=x||e(document).bind("mousedown mouseup",
+function(a){var h=e(a.target);if(a.type=="mousedown"&&h.data("drag")){var o=h.position(),v=a.pageX-o.left,g=a.pageY-o.top,p=true;x.bind("mousemove.drag",function(i){var n=i.pageX-v;i=i.pageY-g;var l={};if(d.x)l.left=n;if(d.y)l.top=i;if(p){h.trigger("dragStart");p=false}d.drag&&h.css(l);h.trigger("drag",[i,n]);y=h});a.preventDefault()}else try{y&&y.trigger("dragEnd")}finally{x.unbind("mousemove.drag");y=null}});return this.data("drag",true)};e.expr[":"].range=function(d){var a=d.getAttribute("type");
+return a&&a=="range"||!!e(d).filter("input").data("rangeinput")};e.fn.rangeinput=function(d){if(this.data("rangeinput"))return this;d=e.extend(true,{},E.conf,d);var a;this.each(function(){var h=new G(e(this),e.extend(true,{},d));h=h.getInput().data("rangeinput",h);a=a?a.add(h):h});return a?a:this}})(jQuery);
+(function(e){function t(a,b,c){var k=a.offset().top,f=a.offset().left,l=c.position.split(/,?\s+/),p=l[0];l=l[1];k-=b.outerHeight()-c.offset[0];f+=a.outerWidth()+c.offset[1];if(/iPad/i.test(navigator.userAgent))k-=e(window).scrollTop();c=b.outerHeight()+a.outerHeight();if(p=="center")k+=c/2;if(p=="bottom")k+=c;a=a.outerWidth();if(l=="center")f-=(a+b.outerWidth())/2;if(l=="left")f-=a;return{top:k,left:f}}function y(a){function b(){return this.getAttribute("type")==a}b.key="[type="+a+"]";return b}function u(a,
+b,c){function k(g,d,i){if(!(!c.grouped&&g.length)){var j;if(i===false||e.isArray(i)){j=h.messages[d.key||d]||h.messages["*"];j=j[c.lang]||h.messages["*"].en;(d=j.match(/\$\d/g))&&e.isArray(i)&&e.each(d,function(m){j=j.replace(this,i[m])})}else j=i[c.lang]||i;g.push(j)}}var f=this,l=b.add(f);a=a.not(":button, :image, :reset, :submit");e.extend(f,{getConf:function(){return c},getForm:function(){return b},getInputs:function(){return a},reflow:function(){a.each(function(){var g=e(this),d=g.data("msg.el");
+if(d){g=t(g,d,c);d.css({top:g.top,left:g.left})}});return f},invalidate:function(g,d){if(!d){var i=[];e.each(g,function(j,m){j=a.filter("[name='"+j+"']");if(j.length){j.trigger("OI",[m]);i.push({input:j,messages:[m]})}});g=i;d=e.Event()}d.type="onFail";l.trigger(d,[g]);d.isDefaultPrevented()||q[c.effect][0].call(f,g,d);return f},reset:function(g){g=g||a;g.removeClass(c.errorClass).each(function(){var d=e(this).data("msg.el");if(d){d.remove();e(this).data("msg.el",null)}}).unbind(c.errorInputEvent||
+"");return f},destroy:function(){b.unbind(c.formEvent+".V").unbind("reset.V");a.unbind(c.inputEvent+".V").unbind("change.V");return f.reset()},checkValidity:function(g,d){g=g||a;g=g.not(":disabled");if(!g.length)return true;d=d||e.Event();d.type="onBeforeValidate";l.trigger(d,[g]);if(d.isDefaultPrevented())return d.result;var i=[];g.not(":radio:not(:checked)").each(function(){var m=[],n=e(this).data("messages",m),v=r&&n.is(":date")?"onHide.v":c.errorInputEvent+".v";n.unbind(v);e.each(w,function(){var o=
+this,s=o[0];if(n.filter(s).length){o=o[1].call(f,n,n.val());if(o!==true){d.type="onBeforeFail";l.trigger(d,[n,s]);if(d.isDefaultPrevented())return false;var x=n.attr(c.messageAttr);if(x){m=[x];return false}else k(m,s,o)}}});if(m.length){i.push({input:n,messages:m});n.trigger("OI",[m]);c.errorInputEvent&&n.bind(v,function(o){f.checkValidity(n,o)})}if(c.singleError&&i.length)return false});var j=q[c.effect];if(!j)throw'Validator: cannot find effect "'+c.effect+'"';if(i.length){f.invalidate(i,d);return false}else{j[1].call(f,
+g,d);d.type="onSuccess";l.trigger(d,[g]);g.unbind(c.errorInputEvent+".v")}return true}});e.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","),function(g,d){e.isFunction(c[d])&&e(f).bind(d,c[d]);f[d]=function(i){i&&e(f).bind(d,i);return f}});c.formEvent&&b.bind(c.formEvent+".V",function(g){if(!f.checkValidity(null,g))return g.preventDefault()});b.bind("reset.V",function(){f.reset()});a[0]&&a[0].validity&&a.each(function(){this.oninvalid=function(){return false}});if(b[0])b[0].checkValidity=
+f.checkValidity;c.inputEvent&&a.bind(c.inputEvent+".V",function(g){f.checkValidity(e(this),g)});a.filter(":checkbox, select").filter("[required]").bind("change.V",function(g){var d=e(this);if(this.checked||d.is("select")&&e(this).val())q[c.effect][1].call(f,d,g)});var p=a.filter(":radio").change(function(g){f.checkValidity(p,g)});e(window).resize(function(){f.reflow()})}e.tools=e.tools||{version:"1.2.5"};var z=/\[type=([a-z]+)\]/,A=/^-?[0-9]*(\.[0-9]+)?$/,r=e.tools.dateinput,B=/^([a-z0-9_\.\-\+]+)@([\da-z\.\-]+)\.([a-z\.]{2,6})$/i,
+C=/^(https?:\/\/)?[\da-z\.\-]+\.[a-z\.]{2,6}[#&+_\?\/\w \.\-=]*$/i,h;h=e.tools.validator={conf:{grouped:false,effect:"default",errorClass:"invalid",inputEvent:null,errorInputEvent:"keyup",formEvent:"submit",lang:"en",message:"
",messageAttr:"data-message",messageClass:"error",offset:[0,0],position:"center right",singleError:false,speed:"normal"},messages:{"*":{en:"Please correct this value"}},localize:function(a,b){e.each(b,function(c,k){h.messages[c]=h.messages[c]||{};h.messages[c][a]=k})},
+localizeFn:function(a,b){h.messages[a]=h.messages[a]||{};e.extend(h.messages[a],b)},fn:function(a,b,c){if(e.isFunction(b))c=b;else{if(typeof b=="string")b={en:b};this.messages[a.key||a]=b}if(b=z.exec(a))a=y(b[1]);w.push([a,c])},addEffect:function(a,b,c){q[a]=[b,c]}};var w=[],q={"default":[function(a){var b=this.getConf();e.each(a,function(c,k){c=k.input;c.addClass(b.errorClass);var f=c.data("msg.el");if(!f){f=e(b.message).addClass(b.messageClass).appendTo(document.body);c.data("msg.el",f)}f.css({visibility:"hidden"}).find("p").remove();
+e.each(k.messages,function(l,p){e("
").html(p).appendTo(f)});f.outerWidth()==f.parent().width()&&f.add(f.find("p")).css({display:"inline"});k=t(c,f,b);f.css({visibility:"visible",position:"absolute",top:k.top,left:k.left}).fadeIn(b.speed)})},function(a){var b=this.getConf();a.removeClass(b.errorClass).each(function(){var c=e(this).data("msg.el");c&&c.css({visibility:"hidden"})})}]};e.each("email,url,number".split(","),function(a,b){e.expr[":"][b]=function(c){return c.getAttribute("type")===b}});
+e.fn.oninvalid=function(a){return this[a?"bind":"trigger"]("OI",a)};h.fn(":email","Please enter a valid email address",function(a,b){return!b||B.test(b)});h.fn(":url","Please enter a valid URL",function(a,b){return!b||C.test(b)});h.fn(":number","Please enter a numeric value.",function(a,b){return A.test(b)});h.fn("[max]","Please enter a value smaller than $1",function(a,b){if(b===""||r&&a.is(":date"))return true;a=a.attr("max");return parseFloat(b)<=parseFloat(a)?true:[a]});h.fn("[min]","Please enter a value larger than $1",
+function(a,b){if(b===""||r&&a.is(":date"))return true;a=a.attr("min");return parseFloat(b)>=parseFloat(a)?true:[a]});h.fn("[required]","Please complete this mandatory field.",function(a,b){if(a.is(":checkbox"))return a.is(":checked");return!!b});h.fn("[pattern]",function(a){var b=new RegExp("^"+a.attr("pattern")+"$");return b.test(a.val())});e.fn.validator=function(a){var b=this.data("validator");if(b){b.destroy();this.removeData("validator")}a=e.extend(true,{},h.conf,a);if(this.is("form"))return this.each(function(){var c=
+e(this);b=new u(c.find(":input"),c,a);c.data("validator",b)});else{b=new u(this,this.eq(0).closest("form"),a);return this.data("validator",b)}}})(jQuery);
\ No newline at end of file
diff --git a/app/assets/javascripts/plugins/replaceall.js b/app/assets/javascripts/plugins/replaceall.js
new file mode 100644
index 0000000..3e2a700
--- /dev/null
+++ b/app/assets/javascripts/plugins/replaceall.js
@@ -0,0 +1,22 @@
+String.prototype.replaceAll = function(
+ strTarget,
+ strSubString
+ ){
+ var strText = this;
+ var intIndexOfMatch = strText.indexOf( strTarget );
+
+ while (intIndexOfMatch != -1)
+ {
+ strText = strText.replace( strTarget, strSubString )
+ intIndexOfMatch = strText.indexOf( strTarget );
+ }
+
+ return(strText);
+}
+
+String.prototype.urifyAll = function(){
+ var strText = this;
+ var text = unescape(decodeURI(strText).replaceAll("+", " "));
+
+ return(text);
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/plugins/scrolling.js b/app/assets/javascripts/plugins/scrolling.js
new file mode 100644
index 0000000..b4ebc00
--- /dev/null
+++ b/app/assets/javascripts/plugins/scrolling.js
@@ -0,0 +1,118 @@
+/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
+ * Licensed under the MIT License (LICENSE.txt).
+ *
+ * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
+ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
+ * Thanks to: Seamus Leahy for adding deltaX and deltaY
+ *
+ * Version: 3.0.4
+ *
+ * Requires: 1.2.2+
+ */
+
+(function($) {
+
+var types = ['DOMMouseScroll', 'mousewheel'];
+
+$.event.special.mousewheel = {
+ setup: function() {
+ if ( this.addEventListener ) {
+ for ( var i=types.length; i; ) {
+ this.addEventListener( types[--i], handler, false );
+ }
+ } else {
+ this.onmousewheel = handler;
+ }
+ },
+
+ teardown: function() {
+ if ( this.removeEventListener ) {
+ for ( var i=types.length; i; ) {
+ this.removeEventListener( types[--i], handler, false );
+ }
+ } else {
+ this.onmousewheel = null;
+ }
+ }
+};
+
+$.fn.extend({
+ mousewheel: function(fn) {
+ return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
+ },
+
+ unmousewheel: function(fn) {
+ return this.unbind("mousewheel", fn);
+ }
+});
+
+
+function handler(event) {
+ var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
+ event = $.event.fix(orgEvent);
+ event.type = "mousewheel";
+
+ // Old school scrollwheel delta
+ if ( event.wheelDelta ) { delta = event.wheelDelta/120; }
+ if ( event.detail ) { delta = -event.detail/3; }
+
+ // New school multidimensional scroll (touchpads) deltas
+ deltaY = delta;
+
+ // Gecko
+ if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
+ deltaY = 0;
+ deltaX = -1*delta;
+ }
+
+ // Webkit
+ if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
+ if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
+
+ // Add event and delta to the front of the arguments
+ args.unshift(event, delta, deltaX, deltaY);
+
+ return $.event.handle.apply(this, args);
+}
+
+})(jQuery);
+
+
+
+
+
+
+
+
+
+
+
+
+/*
+* jScrollPane - v2.0.0beta6 - 2010-10-28
+* http://jscrollpane.kelvinluck.com/
+*
+* Copyright (c) 2010 Kelvin Luck
+* Dual licensed under the MIT and GPL licenses.
+*/
+(function (b, a, c) {
+ b.fn.jScrollPane = function (f) {
+ function d(C, L) {
+ var au, N = this, V, ah, v, aj, Q, W, y, q, av, aB, ap, i, H, h, j, X, R, al, U, t, A, am, ac, ak, F, l, ao, at, x, aq, aE, g, aA, ag = true, M = true, aD = false, k = false, Z = b.fn.mwheelIntent ? "mwheelIntent.jsp" : "mousewheel.jsp"; aE = C.css("paddingTop") + " " + C.css("paddingRight") + " " + C.css("paddingBottom") + " " + C.css("paddingLeft"); g = (parseInt(C.css("paddingLeft")) || 0) + (parseInt(C.css("paddingRight")) || 0); an(L); function an(aH) { var aL, aK, aJ, aG, aF, aI; au = aH; if (V == c) { C.css({ overflow: "hidden", padding: 0 }); ah = C.innerWidth() + g; v = C.innerHeight(); C.width(ah); V = b('
').wrap(b('
').css({ width: ah + "px", height: v + "px" })); C.wrapInner(V.parent()); aj = C.find(">.jspContainer"); V = aj.find(">.jspPane"); V.css("padding", aE) } else { C.css("width", ""); aI = C.outerWidth() + g != ah || C.outerHeight() != v; if (aI) { ah = C.innerWidth() + g; v = C.innerHeight(); aj.css({ width: ah + "px", height: v + "px" }) } aA = V.innerWidth(); if (!aI && V.outerWidth() == Q && V.outerHeight() == W) { if (aB || av) { V.css("width", aA + "px"); C.css("width", (aA + g) + "px") } return } V.css("width", ""); C.css("width", (ah) + "px"); aj.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end() } aL = V.clone().css("position", "absolute"); aK = b('
').append(aL); b("body").append(aK); Q = Math.max(V.outerWidth(), aL.outerWidth()); aK.remove(); W = V.outerHeight(); y = Q / ah; q = W / v; av = q > 1; aB = y > 1; if (!(aB || av)) { C.removeClass("jspScrollable"); V.css({ top: 0, width: aj.width() - g }); n(); D(); O(); w(); af() } else { C.addClass("jspScrollable"); aJ = au.maintainPosition && (H || X); if (aJ) { aG = ay(); aF = aw() } aC(); z(); E(); if (aJ) { K(aG); J(aF) } I(); ad(); if (au.enableKeyboardNavigation) { P() } if (au.clickOnTrack) { p() } B(); if (au.hijackInternalLinks) { m() } } if (au.autoReinitialise && !aq) { aq = setInterval(function () { an(au) }, au.autoReinitialiseDelay) } else { if (!au.autoReinitialise && aq) { clearInterval(aq) } } C.trigger("jsp-initialised", [aB || av]) } function aC() { if (av) { aj.append(b('
').append(b('
'), b('
').append(b('
').append(b('
'), b('
'))), b('
'))); R = aj.find(">.jspVerticalBar"); al = R.find(">.jspTrack"); ap = al.find(">.jspDrag"); if (au.showArrows) { am = b(' ').bind("mousedown.jsp", az(0, -1)).bind("click.jsp", ax); ac = b(' ').bind("mousedown.jsp", az(0, 1)).bind("click.jsp", ax); if (au.arrowScrollOnHover) { am.bind("mouseover.jsp", az(0, -1, am)); ac.bind("mouseover.jsp", az(0, 1, ac)) } ai(al, au.verticalArrowPositions, am, ac) } t = v; aj.find(">.jspVerticalBar>.jspCap,>.jspVerticalBar>.jspArrow").each(function () { t -= b(this).outerHeight() }); ap.hover(function () { ap.addClass("jspHover") }, function () { ap.removeClass("jspHover") }).bind("mousedown.jsp", function (aF) { b("html").bind("dragstart.jsp selectstart.jsp", function () { return false }); ap.addClass("jspActive"); var s = aF.pageY - ap.position().top; b("html").bind("mousemove.jsp", function (aG) { S(aG.pageY - s, false) }).bind("mouseup.jsp mouseleave.jsp", ar); return false }); o() } } function o() { al.height(t + "px"); H = 0; U = au.verticalGutter + al.outerWidth(); V.width(ah - U - g); if (R.position().left == 0) { V.css("margin-left", U + "px") } } function z() {
+ if (aB) {
+ aj.append(b('
').append(b('
'), b('
').append(b('
').append(b('
'), b('
'))), b('
'))); ak = aj.find(">.jspHorizontalBar"); F = ak.find(">.jspTrack"); h = F.find(">.jspDrag"); if (au.showArrows) {
+ at = b(' ').bind("mousedown.jsp", az(-1, 0)).bind("click.jsp", ax); x = b(' ').bind("mousedown.jsp", az(1, 0)).bind("click.jsp", ax); if (au.arrowScrollOnHover) {
+ at.bind("mouseover.jsp", az(-1, 0, at));
+ x.bind("mouseover.jsp", az(1, 0, x))
+ } ai(F, au.horizontalArrowPositions, at, x)
+ } h.hover(function () { h.addClass("jspHover") }, function () { h.removeClass("jspHover") }).bind("mousedown.jsp", function (aF) { b("html").bind("dragstart.jsp selectstart.jsp", function () { return false }); h.addClass("jspActive"); var s = aF.pageX - h.position().left; b("html").bind("mousemove.jsp", function (aG) { T(aG.pageX - s, false) }).bind("mouseup.jsp mouseleave.jsp", ar); return false }); l = aj.innerWidth(); ae()
+ } else { }
+ } function ae() { aj.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function () { l -= b(this).outerWidth() }); F.width(l + "px"); X = 0 } function E() { if (aB && av) { var aF = F.outerHeight(), s = al.outerWidth(); t -= aF; b(ak).find(">.jspCap:visible,>.jspArrow").each(function () { l += b(this).outerWidth() }); l -= s; v -= s; ah -= aF; F.parent().append(b('
').css("width", aF + "px")); o(); ae() } if (aB) { V.width((aj.outerWidth() - g) + "px") } W = V.outerHeight(); q = W / v; if (aB) { ao = 1 / y * l; if (ao > au.horizontalDragMaxWidth) { ao = au.horizontalDragMaxWidth } else { if (ao < au.horizontalDragMinWidth) { ao = au.horizontalDragMinWidth } } h.width(ao + "px"); j = l - ao; ab(X) } if (av) { A = 1 / q * t; if (A > au.verticalDragMaxHeight) { A = au.verticalDragMaxHeight } else { if (A < au.verticalDragMinHeight) { A = au.verticalDragMinHeight } } ap.height(A + "px"); i = t - A; aa(H) } } function ai(aG, aI, aF, s) { var aK = "before", aH = "after", aJ; if (aI == "os") { aI = /Mac/.test(navigator.platform) ? "after" : "split" } if (aI == aK) { aH = aI } else { if (aI == aH) { aK = aI; aJ = aF; aF = s; s = aJ } } aG[aK](aF)[aH](s) } function az(aF, s, aG) { return function () { G(aF, s, this, aG); this.blur(); return false } } function G(aH, aF, aK, aJ) { aK = b(aK).addClass("jspActive"); var aI, s = function () { if (aH != 0) { T(X + aH * au.arrowButtonSpeed, false) } if (aF != 0) { S(H + aF * au.arrowButtonSpeed, false) } }, aG = setInterval(s, au.arrowRepeatFreq); s(); aI = aJ == c ? "mouseup.jsp" : "mouseout.jsp"; aJ = aJ || b("html"); aJ.bind(aI, function () { aK.removeClass("jspActive"); clearInterval(aG); aJ.unbind(aI) }) } function p() { w(); if (av) { al.bind("mousedown.jsp", function (aH) { if (aH.originalTarget == c || aH.originalTarget == aH.currentTarget) { var aG = b(this), s = setInterval(function () { var aI = aG.offset(), aJ = aH.pageY - aI.top; if (H + A < aJ) { S(H + au.trackClickSpeed) } else { if (aJ < H) { S(H - au.trackClickSpeed) } else { aF() } } }, au.trackClickRepeatFreq), aF = function () { s && clearInterval(s); s = null; b(document).unbind("mouseup.jsp", aF) }; b(document).bind("mouseup.jsp", aF); return false } }) } if (aB) { F.bind("mousedown.jsp", function (aH) { if (aH.originalTarget == c || aH.originalTarget == aH.currentTarget) { var aG = b(this), s = setInterval(function () { var aI = aG.offset(), aJ = aH.pageX - aI.left; if (X + ao < aJ) { T(X + au.trackClickSpeed) } else { if (aJ < X) { T(X - au.trackClickSpeed) } else { aF() } } }, au.trackClickRepeatFreq), aF = function () { s && clearInterval(s); s = null; b(document).unbind("mouseup.jsp", aF) }; b(document).bind("mouseup.jsp", aF); return false } }) } } function w() { F && F.unbind("mousedown.jsp"); al && al.unbind("mousedown.jsp") } function ar() { b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp"); ap && ap.removeClass("jspActive"); h && h.removeClass("jspActive") } function S(s, aF) { if (!av) { return } if (s < 0) { s = 0 } else { if (s > i) { s = i } } if (aF == c) { aF = au.animateScroll } if (aF) { N.animate(ap, "top", s, aa) } else { ap.css("top", s); aa(s) } } function aa(aF) { if (aF == c) { aF = ap.position().top } aj.scrollTop(0); H = aF; var aI = H == 0, aG = H == i, aH = aF / i, s = -aH * (W - v); if (ag != aI || aD != aG) { ag = aI; aD = aG; C.trigger("jsp-arrow-change", [ag, aD, M, k]) } u(aI, aG); V.css("top", s); C.trigger("jsp-scroll-y", [-s, aI, aG]) } function T(aF, s) { if (!aB) { return } if (aF < 0) { aF = 0 } else { if (aF > j) { aF = j } } if (s == c) { s = au.animateScroll } if (s) { N.animate(h, "left", aF, ab) } else { h.css("left", aF); ab(aF) } } function ab(aF) { if (aF == c) { aF = h.position().left } aj.scrollTop(0); X = aF; var aI = X == 0, aH = X == j, aG = aF / j, s = -aG * (Q - ah); if (M != aI || k != aH) { M = aI; k = aH; C.trigger("jsp-arrow-change", [ag, aD, M, k]) } r(aI, aH); V.css("left", s); C.trigger("jsp-scroll-x", [-s, aI, aH]) } function u(aF, s) { if (au.showArrows) { am[aF ? "addClass" : "removeClass"]("jspDisabled"); ac[s ? "addClass" : "removeClass"]("jspDisabled") } } function r(aF, s) {
+ if (au.showArrows) {
+ at[aF ? "addClass" : "removeClass"]("jspDisabled");
+ x[s ? "addClass" : "removeClass"]("jspDisabled")
+ }
+ } function J(s, aF) { var aG = s / (W - v); S(aG * i, aF) } function K(aF, s) { var aG = aF / (Q - ah); T(aG * j, s) } function Y(aR, aM, aG) { var aK, aH, aI, s = 0, aQ = 0, aF, aL, aO, aN, aP; try { aK = b(aR) } catch (aJ) { return } aH = aK.outerHeight(); aI = aK.outerWidth(); aj.scrollTop(0); aj.scrollLeft(0); while (!aK.is(".jspPane")) { s += aK.position().top; aQ += aK.position().left; aK = aK.offsetParent(); if (/^body|html$/i.test(aK[0].nodeName)) { return } } aF = aw(); aL = aF + v; if (s < aF || aM) { aN = s - au.verticalGutter } else { if (s + aH > aL) { aN = s - v + aH + au.verticalGutter } } if (aN) { J(aN, aG) } viewportLeft = ay(); aO = viewportLeft + ah; if (aQ < viewportLeft || aM) { aP = aQ - au.horizontalGutter } else { if (aQ + aI > aO) { aP = aQ - ah + aI + au.horizontalGutter } } if (aP) { K(aP, aG) } } function ay() { return -V.position().left } function aw() { return -V.position().top } function ad() { aj.unbind(Z).bind(Z, function (aI, aJ, aH, aF) { var aG = X, s = H; T(X + aH * au.mouseWheelSpeed, false); S(H - aF * au.mouseWheelSpeed, false); return aG == X && s == H }) } function n() { aj.unbind(Z) } function ax() { return false } function I() { V.unbind("focusin.jsp").bind("focusin.jsp", function (s) { if (s.target === V[0]) { return } Y(s.target, false) }) } function D() { V.unbind("focusin.jsp") } function P() { var aF, s; C.attr("tabindex", 0).unbind("keydown.jsp").bind("keydown.jsp", function (aJ) { if (aJ.target !== C[0]) { return } var aH = X, aG = H, aI = aF ? 2 : 16; switch (aJ.keyCode) { case 40: S(H + aI, false); break; case 38: S(H - aI, false); break; case 34: case 32: J(aw() + Math.max(32, v) - 16); break; case 33: J(aw() - v + 16); break; case 35: J(W - v); break; case 36: J(0); break; case 39: T(X + aI, false); break; case 37: T(X - aI, false); break } if (!(aH == X && aG == H)) { aF = true; clearTimeout(s); s = setTimeout(function () { aF = false }, 260); return false } }); if (au.hideFocus) { C.css("outline", "none"); if ("hideFocus" in aj[0]) { C.attr("hideFocus", true) } } else { C.css("outline", ""); if ("hideFocus" in aj[0]) { C.attr("hideFocus", false) } } } function O() { C.attr("tabindex", "-1").removeAttr("tabindex").unbind("keydown.jsp") } function B() { if (location.hash && location.hash.length > 1) { var aG, aF; try { aG = b(location.hash) } catch (s) { return } if (aG.length && V.find(aG)) { if (aj.scrollTop() == 0) { aF = setInterval(function () { if (aj.scrollTop() > 0) { Y(location.hash, true); b(document).scrollTop(aj.position().top); clearInterval(aF) } }, 50) } else { Y(location.hash, true); b(document).scrollTop(aj.position().top) } } } } function af() { b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack") } function m() { af(); b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack", function () { var s = this.href.split("#"), aF; if (s.length > 1) { aF = s[1]; if (aF.length > 0 && V.find("#" + aF).length > 0) { Y("#" + aF, true); return false } } }) } b.extend(N, { reinitialise: function (aF) { aF = b.extend({}, aF, au); an(aF) }, scrollToElement: function (aG, aF, s) { Y(aG, aF, s) }, scrollTo: function (aG, s, aF) { K(aG, aF); J(s, aF) }, scrollToX: function (aF, s) { K(aF, s) }, scrollToY: function (s, aF) { J(s, aF) }, scrollBy: function (aF, s, aG) { N.scrollByX(aF, aG); N.scrollByY(s, aG) }, scrollByX: function (s, aG) { var aF = ay() + s, aH = aF / (Q - ah); T(aH * j, aG) }, scrollByY: function (s, aG) { var aF = aw() + s, aH = aF / (W - v); S(aH * i, aG) }, animate: function (aF, aI, s, aH) { var aG = {}; aG[aI] = s; aF.animate(aG, { duration: au.animateDuration, ease: au.animateEase, queue: false, step: aH }) }, getContentPositionX: function () { return ay() }, getContentPositionY: function () { return aw() }, getIsScrollableH: function () { return aB }, getIsScrollableV: function () { return av }, getContentPane: function () { return V }, scrollToBottom: function (s) { S(i, s) }, hijackInternalLinks: function () { m() } })
+ } f = b.extend({}, b.fn.jScrollPane.defaults, f); var e; this.each(function () { var g = b(this), h = g.data("jsp"); if (h) { h.reinitialise(f) } else { h = new d(g, f); g.data("jsp", h) } e = e ? e.add(g) : g }); return e
+ }; b.fn.jScrollPane.defaults = { showArrows: false, maintainPosition: true, clickOnTrack: true, autoReinitialise: false, autoReinitialiseDelay: 500, verticalDragMinHeight: 0, verticalDragMaxHeight: 99999, horizontalDragMinWidth: 0, horizontalDragMaxWidth: 99999, animateScroll: false, animateDuration: 300, animateEase: "linear", hijackInternalLinks: false, verticalGutter: 4, horizontalGutter: 4, mouseWheelSpeed: 10, arrowButtonSpeed: 10, arrowRepeatFreq: 100, arrowScrollOnHover: false, trackClickSpeed: 30, trackClickRepeatFreq: 100, verticalArrowPositions: "split", horizontalArrowPositions: "split", enableKeyboardNavigation: true, hideFocus: false }
+})(jQuery, this);
diff --git a/app/assets/javascripts/plugins/store.js b/app/assets/javascripts/plugins/store.js
new file mode 100644
index 0000000..944c1e9
--- /dev/null
+++ b/app/assets/javascripts/plugins/store.js
@@ -0,0 +1,94 @@
+jQuery.store = (function(){
+ var api = {},
+ win = window,
+ doc = win.document,
+ localStorageName = 'localStorage',
+ globalStorageName = 'globalStorage',
+ storage
+
+ api.disabled = false
+ api.set = function(key, value) {}
+ api.get = function(key) {}
+ api.remove = function(key) {}
+ api.clear = function() {}
+ api.transact = function(key, transactionFn) {
+ var val = api.get(key)
+ if (typeof val == 'undefined') { val = {} }
+ transactionFn(val)
+ api.set(key, val)
+ }
+
+ api.serialize = function(value) {
+ return JSON.stringify(value)
+ }
+ api.deserialize = function(value) {
+ if (typeof value != 'string') { return undefined }
+ return JSON.parse(value)
+ }
+
+ // Functions to encapsulate questionable FireFox 3.6.13 behavior
+ // when about.config::dom.storage.enabled === false
+ // See https://github.com/marcuswestin/store.js/issues#issue/13
+ function isLocalStorageNameSupported() {
+ try { return (localStorageName in win && win[localStorageName]) }
+ catch(err) { return false }
+ }
+
+ function isGlobalStorageNameSupported() {
+ try { return (globalStorageName in win && win[globalStorageName] && win[globalStorageName][win.location.hostname]) }
+ catch(err) { return false }
+ }
+
+ if (isLocalStorageNameSupported()) {
+ storage = win[localStorageName]
+ api.set = function(key, val) { storage.setItem(key, api.serialize(val)) }
+ api.get = function(key) { return api.deserialize(storage.getItem(key)) }
+ api.remove = function(key) { storage.removeItem(key) }
+ api.clear = function() { storage.clear() }
+
+ } else if (isGlobalStorageNameSupported()) {
+ storage = win[globalStorageName][win.location.hostname]
+ api.set = function(key, val) { storage[key] = api.serialize(val) }
+ api.get = function(key) { return api.deserialize(storage[key] && storage[key].value) }
+ api.remove = function(key) { delete storage[key] }
+ api.clear = function() { for (var key in storage ) { delete storage[key] } }
+
+ } else if (doc.documentElement.addBehavior) {
+ var storage = doc.createElement('div')
+ function withIEStorage(storeFunction) {
+ return function() {
+ var args = Array.prototype.slice.call(arguments, 0)
+ args.unshift(storage)
+ doc.body.appendChild(storage)
+ storage.addBehavior('#default#userData')
+ storage.load(localStorageName)
+ var result = storeFunction.apply(api, args)
+ doc.body.removeChild(storage)
+ return result
+ }
+ }
+ api.set = withIEStorage(function(storage, key, val) {
+ storage.setAttribute(key, api.serialize(val))
+ storage.save(localStorageName)
+ })
+ api.get = withIEStorage(function(storage, key) {
+ return api.deserialize(storage.getAttribute(key))
+ })
+ api.remove = withIEStorage(function(storage, key) {
+ storage.removeAttribute(key)
+ storage.save(localStorageName)
+ })
+ api.clear = withIEStorage(function(storage) {
+ var attributes = storage.XMLDocument.documentElement.attributes
+ storage.load(localStorageName)
+ for (var i=0, attr; attr = attributes[i]; i++) {
+ storage.removeAttribute(attr.name)
+ }
+ storage.save(localStorageName)
+ })
+ } else {
+ api.disabled = true
+ }
+
+ return api
+})();
diff --git a/app/assets/javascripts/search.js b/app/assets/javascripts/search.js
new file mode 100644
index 0000000..e050685
--- /dev/null
+++ b/app/assets/javascripts/search.js
@@ -0,0 +1,13 @@
+$(document).ready(function(){
+ $("#search_form .text").autocomplete('', {
+ width: 300,
+ multiple: true
+ });
+});
+
+function init_autocomplete(){
+ $("#search_bar .text").autocomplete('', {
+ width: 300,
+ multiple: true
+ });
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/store.js b/app/assets/javascripts/store.js
new file mode 100644
index 0000000..e69de29
diff --git a/app/assets/javascripts/title.js b/app/assets/javascripts/title.js
new file mode 100644
index 0000000..3bb0148
--- /dev/null
+++ b/app/assets/javascripts/title.js
@@ -0,0 +1,25 @@
+function changeDocumentTitle(to, special)
+{
+ special = (typeof special == "undefined" || typeof special == "boolean") ? null : special;
+
+ titleLink = (to.substring(to.length-1, to.length) == "/") ?
+ to.substring(0, to.length-1) : to;
+
+ titleLink = titleLink.replaceAll("/","");
+
+ switch(titleLink)
+ {
+ case "artists":
+ titleLink = special;
+ special = null;
+ break;
+ case "home":
+ document.title = documentTitle;
+ return;
+ break;
+ }
+
+ document.title = titleLink.urifyAll();
+ if (special) document.title += " » " + special.urifyAll();
+ document.title += " on " + documentTitle;
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/.gitkeep b/app/assets/stylesheets/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/app/assets/stylesheets/album.css.scss b/app/assets/stylesheets/album.css.scss
new file mode 100644
index 0000000..aa5b5e6
--- /dev/null
+++ b/app/assets/stylesheets/album.css.scss
@@ -0,0 +1,78 @@
+/*********************************/
+/************* ALBUM *************/
+/*********************************/
+
+$bg: #f4f6f9;
+
+#album_box {
+ position: absolute;
+ top: 69px;
+ left: 100px;
+ display: none;
+ z-index: 12;
+ border: 7px solid rgba(255,255,255,0.8);
+ //@include rounded(10px);
+ @include shadow(0 0 2px 2px rgba(31,34,40,0.10));
+ > span {
+ position: absolute;
+ top: -19px;
+ left: 70px;
+ background: url('#{$ico-url}/arrow.png') no-repeat;
+ width: 47px;
+ height: 23px;
+ }
+ .headline {
+ background: desaturate(darken($bg,6%),10%);
+ float: left;
+ width: 128px;
+ height: 180px;
+ padding: 10px;
+ border-right: 1px solid desaturate(darken($bg,10%),10%);
+ h4 {
+ font-size: 18px;
+ line-height: 16px;
+ span {
+ font-size: 14px;
+ color: $blue;
+ }
+ }
+ img {
+ margin-bottom: 10px;
+ width: 128px;
+ height: 128px;
+ }
+ }
+
+ .wrap {
+ background: $bg;
+ float: right;
+ max-height: 200px;
+ overflow:auto;
+ width: 279px;
+ //@include rounded(8px);
+ li {
+ padding: 7px 9px;
+ overflow: hidden;
+ width: 259px;
+ border-bottom: 1px solid darken($bg,6%);
+ border-top: 1px solid lighten($bg,01%);
+ span {
+ color: #9aa7b3;
+ width: 20px;
+ display: inline-block;
+ }
+ .playsong, .add {
+ width: 20px;
+ height: 20px;
+ display: inline-block;
+ background: url('#{$ico-url}/list-controls.png') no-repeat 0 0;
+ vertical-align: middle;
+ float: right;
+ }
+ .add {
+ margin-right: 6px;
+ background-position: 0 -20px;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss
new file mode 100644
index 0000000..23f91d2
--- /dev/null
+++ b/app/assets/stylesheets/application.css.scss
@@ -0,0 +1,18 @@
+@import "reset.css.scss";
+@import "fauxconsole.css.scss";
+@import "layout.css.scss";
+
+@import "artist.css.scss";
+@import "home.css.scss";
+@import "user.css.scss";
+@import "charts.css.scss";
+@import "search.css.scss";
+@import "album.css.scss";
+
+@import "player.css.scss";
+@import "sidebar.css.scss";
+@import "nivoslider.css.scss";
+@import "scrolling.css.scss";
+@import "lists.css.scss";
+@import "fullscreen.css.scss";
+@import "autocomplete.css.scss";
diff --git a/app/assets/stylesheets/artist.css.scss b/app/assets/stylesheets/artist.css.scss
new file mode 100644
index 0000000..04c8392
--- /dev/null
+++ b/app/assets/stylesheets/artist.css.scss
@@ -0,0 +1,93 @@
+/*********************************/
+/************ LAYOUT *************/
+/*********************************/
+
+@mixin set-width-for-artist-left($w){
+ width: $w;
+ h1 { width: $w }
+ .information { width: $w }
+}
+
+$padding: 28px;
+
+#artist_left {
+ float: left;
+ @include set-width-for-artist-left(386px);
+
+ #slider {
+ position: relative;
+ width: 386px;
+ height: 240px;
+ overflow: hidden;
+ background: url('#{$place-url}/artist-big.png') no-repeat 0 0;
+
+ img {
+ position: absolute;
+ top: 0;
+ left: 0;
+ max-width: 386px;
+ }
+ }
+ h1 {
+ color: #fff;
+ font-size: 30px;
+ $height: 74px;
+ overflow: hidden;
+ height: $height;
+ line-height: $height - 4;
+ text-indent: $padding;
+ margin-bottom: 23px;
+ @include stripe-bg();
+ }
+ #artist_links {
+ ul { margin: -2px 0 30px 0; }
+ li {
+ margin-bottom: 12px;
+ @include std-font();
+ overflow: hidden;
+ a {
+ text-decoration: none;
+ font-size: 10px;
+ color: #fff;
+ &:hover h3 { color: lighten($blue, 10) }
+ }
+ h3 {
+ color: $blue;
+ font-size: 13px;
+ font-weight: normal;
+ }
+ }
+ }
+ #artist_tags {
+ li {
+ background: url('#{$ico-url}/tag.png') no-repeat left 2px;
+ color: #fff;
+ padding-left: 20px;
+ margin-bottom: 12px;
+ @include std-font();
+ }
+ }
+ #artist_info {
+ @include std-font();
+ font-size: 11px;
+ line-height: 16px;
+ }
+ h2 {
+ font-size: 18px;
+ color: $blue;
+ font-weight: normal;
+ margin: -2px 0 10px 0;
+ }
+ .heart {
+ float: right;
+ width: 22px;
+ height: 19px;
+ display: inline-block;
+ margin: 28px 20px 0 0;
+ cursor: pointer;
+ background: url('#{$ico-url}/heart.png') no-repeat 0 0;
+ &.loved {
+ background-position: 0 -19px;
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/autocomplete.css.scss b/app/assets/stylesheets/autocomplete.css.scss
new file mode 100644
index 0000000..e6059e4
--- /dev/null
+++ b/app/assets/stylesheets/autocomplete.css.scss
@@ -0,0 +1,52 @@
+/*********************************/
+/********* AUTOCOMPLETE **********/
+/*********************************/
+
+.ac_results {
+ padding: 0px;
+ border: 1px solid black;
+ background-color: white;
+ overflow: hidden;
+ z-index: 99999;
+}
+
+.ac_results ul {
+ width: 100%;
+ list-style-position: outside;
+ list-style: none;
+ padding: 0;
+ margin: 0;
+}
+
+.ac_results li {
+ margin: 0px;
+ padding: 2px 5px;
+ cursor: default;
+ display: block;
+ /*
+ if width will be 100% horizontal scrollbar will apear
+ when scroll mode will be used
+ */
+ /*width: 100%;*/
+ font: menu;
+ font-size: 12px;
+ /*
+ it is very important, if line-height not setted or setted
+ in relative units scroll will be broken in firefox
+ */
+ line-height: 16px;
+ overflow: hidden;
+}
+
+.ac_loading {
+ background: white url('indicator.gif') right center no-repeat;
+}
+
+.ac_odd {
+ background-color: #eee;
+}
+
+.ac_over {
+ background-color: #0A246A;
+ color: white;
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/charts.css.scss b/app/assets/stylesheets/charts.css.scss
new file mode 100644
index 0000000..bf356f2
--- /dev/null
+++ b/app/assets/stylesheets/charts.css.scss
@@ -0,0 +1,50 @@
+/*********************************/
+/************ LAYOUT *************/
+/*********************************/
+
+#charts {
+ width: 530px;
+ float: left;
+ li {
+ $height: 50px;
+ overflow: hidden;
+ display: block;
+ padding-bottom: 10px;
+ border-bottom: 1px solid #f0f2f4;
+ margin-bottom: 10px;
+ h6 {
+ font-size: 28px;
+ font-weight: bold;
+ float: left;
+ height: $height;
+ color: $light-blue;
+ line-height: $height;
+ margin-left: 15px;
+ width: 50px;
+ }
+ .img {
+ width: 90px;
+ height: $height;
+ background: url('#{$place-url}/artist.png') no-repeat 0 0;
+ float: left;
+ overflow: hidden;
+ position: relative;
+ img {
+ max-width: 90px;
+ }
+ }
+ .text {
+ float: left;
+ margin-left: 15px;
+ h2 {
+ margin: -3px 0 5px 0;
+ a {
+ color: $blue;
+ font-size: 16px;
+ text-decoration: none;
+ &:hover { text-decoration: underline; }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/fauxconsole.css.scss b/app/assets/stylesheets/fauxconsole.css.scss
new file mode 100644
index 0000000..b50ceb7
--- /dev/null
+++ b/app/assets/stylesheets/fauxconsole.css.scss
@@ -0,0 +1,20 @@
+#fauxconsole{
+ position:absolute;
+ top:0;
+ right:0;
+ width:300px;
+ border:1px solid #999;
+ font-family:courier,monospace;
+ background:#eee;
+ font-size:10px;
+ padding:10px;
+}
+html>body #fauxconsole{
+ position:fixed;
+}
+#fauxconsole a{
+ float:right;
+ padding-left:1em;
+ padding-bottom:.5em;
+ text-align:right;
+}
diff --git a/app/assets/stylesheets/fonts.css.scss b/app/assets/stylesheets/fonts.css.scss
new file mode 100644
index 0000000..0542c66
--- /dev/null
+++ b/app/assets/stylesheets/fonts.css.scss
@@ -0,0 +1,28 @@
+/** FONTS **/
+@font-face{
+ font-family: AauxNextLight;
+ src: url('../fonts/aauxnext/aauxnext-lt-webfont.eot');
+ src: local('☺'),
+ url('../fonts/aauxnext/aauxnext-lt-webfont.ttf') format("truetype"),
+ url('../fonts/aauxnext/aauxnext-lt-webfont.otf') format("opentype"),
+ url('../fonts/aauxnext/aauxnext-lt-webfont.woff') format("woff"),
+ url('../fonts/aauxnext/aauxnext-lt-webfont.svg#webfont') format("svg");
+}
+@font-face{
+ font-family: AauxNextMedium;
+ src: url('../fonts/aauxnext/aauxnext-md-webfont.eot');
+ src: local('☺'),
+ url('../fonts/aauxnext/aauxnext-md-webfont.ttf') format("truetype"),
+ url('../fonts/aauxnext/aauxnext-md-webfont.otf') format("opentype"),
+ url('../fonts/aauxnext/aauxnext-md-webfont.woff') format("woff"),
+ url('../fonts/aauxnext/aauxnext-md-webfont.svg#webfont') format("svg");
+}
+@font-face{
+ font-family: AauxNextBold;
+ src: url('../fonts/aauxnext/aauxnext-bd-webfont.eot');
+ src: local('☺'),
+ url('../fonts/aauxnext/aauxnext-bd-webfont.ttf') format("truetype"),
+ url('../fonts/aauxnext/aauxnext-bd-webfont.otf') format("opentype"),
+ url('../fonts/aauxnext/aauxnext-bd-webfont.woff') format("woff"),
+ url('../fonts/aauxnext/aauxnext-bd-webfont.svg#webfont') format("svg");
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/fullscreen.css.scss b/app/assets/stylesheets/fullscreen.css.scss
new file mode 100644
index 0000000..f8b2e1e
--- /dev/null
+++ b/app/assets/stylesheets/fullscreen.css.scss
@@ -0,0 +1,137 @@
+/*********************************/
+/************ LAYOUT *************/
+/*********************************/
+
+
+#fullscreen_wrap {
+ width: 100%;
+ height: 100%;
+ position: fixed;
+ z-index: 70;
+ background: #000;
+ top: 0; left: 0;
+ display: none;
+}
+
+#fullscreen_close {
+ width: 78px;
+ height: 78px;
+ position: fixed;
+ left: -10px;
+ top: -20px;
+ background: url('#{$ico-url}/fullscreen-close.png');
+ opacity: 0;
+ z-index: 71;
+ cursor: pointer;
+}
+
+#fullscreen {
+ width: 950px;
+ position: absolute;
+ margin-left: -475px;
+ z-index: 70;
+ opacity: 0;
+ top: 0; left: 50%;
+ h2 {
+ font-size: 18px;
+ color: #fff;
+ text-transform: uppercase;
+ font-weight: bold;
+ line-height: 14px;
+ }
+ h1 {
+ font-size: 28px;
+ color: #fff;
+ margin-bottom: 20px;
+ }
+ #video {
+ float: left;
+ width: 640px;
+ height: 360px;
+ @include stripe-bg();
+ }
+
+
+ .sidebar {
+ $width: 310px;
+ $height: 3px;
+
+ float: right;
+ width: $width;
+ height: 360px;
+
+ /* slider root element */
+ .slider
+ {
+ background: transparent;
+ position: relative;
+ cursor: pointer;
+ width: $width; height: $height;
+ float: left;
+ clear: right;
+ }
+
+ /* progress bar (enabled with progress: true) */
+ .progress {
+ height: $height; width: $width;
+ background: $blue;
+ position: absolute;
+ }
+
+ /* drag handle */
+ .handle {
+ background: lighten($blue, 5%);
+ width: 0; height: $height;
+ position:absolute;
+ display:block;
+ cursor: pointer;
+ }
+
+ /* the input field */
+ .range { display: none; }
+
+
+ @include stripe-bg();
+ .top {
+ width: 310px;
+ height: 125px;
+ @include stripe-bg();
+ text-align: center;
+ line-height: 125px;
+ .player {
+ float: left;
+ margin-top: 47px;
+ margin-left: 40px;
+ }
+ }
+ #playlist {
+ width: 310px;
+ height: 230px;
+ padding: 10px 0;
+ overflow: auto;
+ .el {
+ cursor: pointer;
+ padding: 6px 25px;
+ h3 {
+ font-size: 22px;
+ color: white;
+ line-height: 22px;
+ span {
+ display: block;
+ font-size: 12px;
+ text-transform: uppercase;
+ color: $blue;
+ }
+ }
+ &.active {
+ margin-left: -20px;
+ h3 {
+ background: url('#{$ico-url}/playing.png') no-repeat 0 7px;
+ text-indent: 18px;
+ }
+ }
+ }
+ .jspVerticalBar { left: 0!important; opacity: 0.02; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/home.css.scss b/app/assets/stylesheets/home.css.scss
new file mode 100644
index 0000000..df8a82d
--- /dev/null
+++ b/app/assets/stylesheets/home.css.scss
@@ -0,0 +1,63 @@
+/*********************************/
+/************ LAYOUT *************/
+/*********************************/
+
+#top_artist {
+ position: relative;
+ width: 500px;
+ height: 270px;
+ background: url('#{$ico-url}/loading.gif') no-repeat 50% 50%;
+ overflow: hidden;
+ float: left;
+
+
+ img {
+ position: absolute;
+ top: 0;
+ right: 0;
+ display: none;
+ max-width: 500px;
+ max-height: 270px; overflow: hidden;
+ }
+ .nivo-controlNav {
+ position:absolute;
+ bottom:-70px; /* Put the nav below the slider */
+ }
+ .nivo-controlNav img {
+ display:inline; /* Unhide the thumbnails */
+ position:relative;
+ margin-right:10px;
+ }
+}
+#top_artist_nav {
+ float: right;
+ li, a, img {
+ width: 150px;
+ height: 199px;
+ display: inline-block;
+ float: left;
+ }
+ a, img { position: absolute; }
+ .ll img, .rr img { opacity: 0.4 }
+ .ll { background: url('#{$ico-url}/home-left.png') }
+ .rr { background: url('#{$ico-url}/home-right.png') }
+}
+#search_home {
+ width: 428px;
+ height: 43px;
+ background: #fff;
+ float: right;
+ padding: 14px 11px;
+}
+#home_foot {
+ display: block;
+ width: 950px;
+ height: 200px;
+ @include stripe-bg();
+ .right {
+ width: 300px;
+ height: 200px;
+ @include stripe-bg();
+ float: right;
+ }
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/layout.css.scss b/app/assets/stylesheets/layout.css.scss
new file mode 100644
index 0000000..c63414d
--- /dev/null
+++ b/app/assets/stylesheets/layout.css.scss
@@ -0,0 +1,339 @@
+/*********************************/
+/*********** SETTINGS ************/
+/*********************************/
+
+/* SIZES */
+$site-width: 950px;
+
+/* COLORS */
+$dark-blue: #2f3a40;
+$content-black: #15191d;
+$blue: #0086cc;
+$light-blue: #a3adb5;
+$red: #ee0000;
+$ultra-light: #f4f6f9;
+
+/* URLS */
+$base-url: "/images";
+$bg-url: "#{$base-url}/backgrounds";
+$ico-url: "#{$base-url}/icons";
+$place-url: "#{$base-url}/placeholder";
+$home-url: "#{$base-url}/startsite";
+
+
+/* FUNCTIONS */
+@mixin center() {
+ position: relative;
+ margin: 0 auto;
+}
+@mixin stripe-bg() {
+ background: transparent url('#{$bg-url}/dark.png') repeat;
+}
+@mixin stripe-dark-bg() {
+ background: transparent url('#{$bg-url}/darker.png') repeat;
+}
+
+@mixin rounded($radius) {
+ border-radius: $radius;
+ -moz-border-radius: $radius;
+ -webkit-border-radius: $radius;
+}
+@mixin shadow($value) {
+ -moz-box-shadow: $value;
+ -webkit-box-shadow: $value;
+ box-shadow: $value;
+}
+
+
+/* SHORTCUTS */
+.clean { clear: both; }
+
+/* FONTS */
+@mixin font() { font-family: "Segoe UI", Corbel, Arial, sans-serif; }
+@mixin medium-font() { @include font(); }
+@mixin light-font() { @include font(); font-weight: 100; }
+@mixin bold-font() { @include font(); font-weight: bold; }
+@mixin std-font() { @include font(); }
+b, strong { @include medium-font();}
+
+/* DEFAULTS */
+a { cursor: pointer; }
+*:focus {outline: none;}
+
+/*********************************/
+/************ LAYOUT *************/
+/*********************************/
+
+/* OVERALL */
+body {
+ background: #05070a url('#{$bg-url}/overallcrush.png') no-repeat center top;
+ color: $content-black;
+ font-size: 12px;
+ @include medium-font()
+}
+#bg_stripe {
+ height: 228px;
+ width: 100%;
+ position: absolute;
+ top: 136px;
+ @include stripe-bg();
+}
+#site {
+ width: $site-width;
+ @include center();
+}
+
+/* HEAD */
+#head {
+ height: 115px;
+
+ h1 {
+ margin: 36px 0 0 94px;
+ float: left;
+ }
+}
+
+/* NAVIGATION */
+#navigation {
+ $height: 79px;
+ $width: 141px;
+ float: right;
+ overflow: hidden;
+
+ li {
+ float: left;
+ &.active { background: url('#{$bg-url}/fuse.png') 0 -127px }
+ &.search {
+ $top: 21px;
+ width: 260px;
+ font-size: 16px;
+ color: #ffffff;
+ line-height: $height - $top;
+ display: inline-block;
+ @include stripe-bg();
+ margin-top: $top;
+ height: $height - $top;
+ padding-left: 20px;
+ img {
+ vertical-align: middle;
+ margin-left: 10px;
+ }
+ .text {
+ width: 210px;
+ height: 45px;
+ border: 0;
+ background: 0;
+ color: #fff;
+ }
+ .submit { display: none;}
+ }
+ > a {
+ font-size: 16px;
+ font-weight: bold;
+ color: #ffffff;
+ height: $height;
+ line-height: $height + 20;
+ width: $width;
+ display: inline-block;
+ text-decoration: none;
+ text-align: center;
+ }
+ &.login {
+ a {
+ width: auto;
+ margin: 0 15px 0 10px;
+ margin-top: 7px;
+ height: $height - 7;
+ }
+ }
+ }
+}
+
+
+/* FOOT */
+#foot {
+ $font-size: 11px;
+ $height: 20px;
+ clear: both;
+ padding: 25px 0;
+ float: right;
+
+ h6 {
+ color: #aab7c4;
+ font-size: $font-size;
+ float: left;
+ height: $height;
+ line-height: $height + 2;
+ }
+ ul {
+ float: left;
+ height: $height;
+ line-height: $height;
+ }
+ li {
+ float: left;
+ margin-left: 33px;
+ }
+ a {
+ color: #ffffff;
+ text-transform: uppercase;
+ text-decoration: none;
+ font-size: $font-size;
+ background: url('#{$ico-url}/arrow-foot.png') left 3px no-repeat;
+ padding-left: 22px;
+ display: inline-block;
+ height: $height;
+ line-height: $height;
+ }
+}
+
+@mixin set-width-for-tabs($w, $p){
+ .nav { width: $w }
+ .content {
+ width: $w - 2*$p;
+ > div { width: $w - 2*$p; }
+ .more {
+ width: $w;
+ margin: 7px 0 - $p -48px 0 - $p;
+ }
+ }
+}
+
+/* TABS */
+.tabs_js .nav li { cursor: pointer }
+.tabs {
+ float: right;
+ $padding-width: 37px;
+ .content {
+ background: #fff;
+ > div { display: none; position: relative; }
+ padding: 48px $padding-width;
+ }
+ .more {
+ background: $ultra-light;
+ border-top: 1px solid #e5e9ef;
+ height: 40px;
+ display: block;
+ text-align: center;
+ line-height: 40px;
+ font-weight: bold;
+ &.disabled {
+ cursor: default;
+ background: #0086cc!important;
+ }
+ .loadingimg {
+ display: inline-block;
+ margin-top: 10px;
+ }
+ }
+ &.w01 { @include set-width-for-tabs(564px, $padding-width) }
+ &.w02 { @include set-width-for-tabs(750px, $padding-width) }
+ &.w03 { @include set-width-for-tabs(950px, $padding-width) }
+ .nav {
+ color: #fff;
+ overflow: hidden;
+ @include stripe-dark-bg();
+
+ li {
+ $height: 54px;
+ width: 120px;
+ height: $height;
+ line-height: $height;
+ float: left;
+ text-align: center;
+ text-transform: lowercase;
+ font-size: 15px;
+
+ &.active {
+ background: #fff;
+ color: $dark-blue;
+ }
+ }
+ }
+}
+
+
+
+
+$padding: 22px;
+
+#content {
+ .information {
+ overflow: hidden;
+ padding-bottom: 22px;
+ @include stripe-bg();
+ .content {
+ > div { display: none; }
+ }
+ .nav {
+ margin-left: $padding;
+ float: left;
+ li {
+ width: 37px;
+ height: 25px;
+ margin-bottom: 13px;
+
+ &.active {
+ background: url('#{$ico-url}/artist-information-active-arrow.png') no-repeat right 10px;
+ cursor: default;
+ }
+ }
+ }
+ .content {
+ float: right;
+ width: 280px;
+ margin-right: $padding;
+ color: #fff;
+ }
+ }
+}
+
+
+#loading, #error {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 30px;
+ line-height: 30px;
+ background: $blue;
+ color: #fff;
+ text-align: center;
+ font-weight: bold;
+ text-transform: uppercase;
+ display: none;
+ z-index: 999;
+ .loadingimg {
+ margin-top: 5px;
+ }
+}
+#error {
+ background: $red;
+}
+
+
+#white {
+ $padding: 40px;
+ width: $site-width - 2 * $padding;
+ padding: 50px $padding;
+ background: #fff;
+}
+
+
+#block {
+ width: 100%;
+ height: 100%;
+ position: fixed;
+ z-index: 22;
+ background: #000;
+ opacity: 0;
+ display: none;
+}
+
+.box {
+ padding: 10px;
+ border: 1px solid desaturate(darken($ultra-light, 6%), 20%);
+ background: $ultra-light;
+}
+
+#videoInfo { color: White!important; }
\ No newline at end of file
diff --git a/app/assets/stylesheets/lists.css.scss b/app/assets/stylesheets/lists.css.scss
new file mode 100644
index 0000000..fbc8ad7
--- /dev/null
+++ b/app/assets/stylesheets/lists.css.scss
@@ -0,0 +1,183 @@
+/*********************************/
+/************ LAYOUT *************/
+/*********************************/
+
+.list {
+ margin-bottom: 20px;
+ display: block;
+ float: left;
+ &.songs {
+ li {
+ $height: 24px;
+ height: $height;
+ line-height: $height;
+ width: 100%;
+ font-size: 13px;
+ margin-bottom: 12px;
+ span { color: $light-blue; }
+ a {
+ color: $light-blue;
+ text-decoration: none;
+ &:hover { color: $blue }
+ }
+ @include std-font();
+ &:last-child { margin-bottom: 0; }
+ .playsong, .addsong {
+ width: 20px;
+ height: 20px;
+ display: inline-block;
+ margin-right: 6px;
+ background: url('#{$ico-url}/list-controls.png') no-repeat 0 0;
+ vertical-align: middle;
+ }
+ .addsong {
+ margin-right: 16px;
+ background-position: 0 -20px;
+ }
+ }
+ }
+
+ &.albums {
+ margin-bottom: 10px;
+ > li {
+ margin-bottom: 15px;
+ min-width: 450px;
+ position: relative;
+ clear: both;
+ &:last-child { margin-bottom: 0; }
+ .songsbtn {
+ text-transform: uppercase;
+ text-decoration: none;
+ color: $blue;
+ background: url('#{$ico-url}/list-controls.png') no-repeat 0 -60px;
+ height: 20px;
+ line-height: 20px;
+ text-indent: 25px;
+ display: inline-block;
+ margin-top: 10px;
+ font-size: 11px;
+ }
+ }
+ .img {
+ $dim: 64px;
+ $left: 18px;
+ margin-right: 10px;
+ position: relative;
+ float: left;
+ overflow: hidden;
+ background: url('#{$bg-url}/fuse.png') 0 6px no-repeat;
+ width: 90px;
+ height: 74px;
+ .cover {
+ width: $dim;
+ height: $dim;
+ margin-left: $left;
+ }
+ .playall {
+ position: absolute;
+ top: 0;
+ left: $left;
+ @include stripe-bg();
+ width: $dim;
+ height: $dim;
+ display: none;
+ a {
+ display: inline-block;
+ width: 20px;
+ height: 20px;
+ background: url('#{$ico-url}/list-controls.png') no-repeat 0 -40px;
+ margin: 22px 0 0 22px;
+ }
+ }
+ }
+ .name {
+ font-size: 16px;
+ line-height: 17px;
+ margin-top: -2px;
+ }
+ .artist {
+ font-size: 12px;
+ color: $light-blue;
+ }
+ }
+
+ &.related {
+ li {
+ overflow: hidden;
+ float: left;
+ margin: 0 20px 20px 0;
+ width: 150px;
+ a { text-decoration: none }
+ h5 {
+ font-size: 14px;
+ text-decoration: none!important;
+ color: $dark-blue;
+ $height: 30px;
+ height: $height;
+ line-height: $height;
+ border-bottom: 2px solid $blue;
+ span {
+ &:before { content: "(" }
+ &:after { content: "%)" }
+ color: $blue;
+ font-size: 11px;
+ }
+ }
+ div {
+ width: 150px;
+ height: 95px;
+ float: left;
+ overflow: hidden;
+ position: relative;
+ background: url('#{$place-url}/related.png') no-repeat 0 0;
+ }
+ }
+ }
+ &.artists {
+ width: 530px;
+ float: left;
+ li {
+ $height: 50px;
+ overflow: hidden;
+ display: block;
+ padding-bottom: 10px;
+ border-bottom: 1px solid #f0f2f4;
+ margin-bottom: 10px;
+ .img {
+ width: 90px;
+ height: $height;
+ float: left;
+ overflow: hidden;
+ position: relative;
+ background: url('#{$place-url}/artist.png') no-repeat 0 0;
+ img {
+ max-width: 90px;
+ }
+ }
+ .text {
+ float: left;
+ margin-left: 15px;
+ h2 {
+ margin: -3px 0 5px 0;
+ a {
+ color: $blue;
+ font-size: 16px;
+ text-decoration: none;
+ &:hover { text-decoration: underline; }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+
+.playlist {
+ background: #080a0c;
+ width: 150px;
+ display: none;
+ position: absolute;
+ left: 0;
+ top: 0;
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/nivoslider.css.scss b/app/assets/stylesheets/nivoslider.css.scss
new file mode 100644
index 0000000..88d72b5
--- /dev/null
+++ b/app/assets/stylesheets/nivoslider.css.scss
@@ -0,0 +1,20 @@
+/* The Nivo Slider styles */
+.nivoSlider {
+ position:relative;
+ img {
+ position:absolute;
+ top:0px;
+ left:0px;
+ }
+}
+.nivo-slice {
+ display:block;
+ position:absolute;
+ z-index:5;
+ height:100%;
+}
+.nivo-box {
+ display:block;
+ position:absolute;
+ z-index:5;
+}
diff --git a/app/assets/stylesheets/player.css.scss b/app/assets/stylesheets/player.css.scss
new file mode 100644
index 0000000..5e41d40
--- /dev/null
+++ b/app/assets/stylesheets/player.css.scss
@@ -0,0 +1,51 @@
+/*********************************/
+/************ LAYOUT *************/
+/*********************************/
+
+.player {
+ float: right;
+ height: 47px;
+ margin: 52px 17px 0 0;
+ line-height: 47px;
+ a { float: left; }
+ .play, .pause {
+ margin: -8px 5px 0 5px;
+ width: 47px;
+ height: 47px;
+ display: inline-block;
+ background: url("#{$ico-url}/player/play.png");
+ }
+ .pause {
+ background: url("#{$ico-url}/player/pause.png");
+ }
+ .forward, .backward {
+ display: inline-block;
+ width: 32px;
+ height: 32px;
+ background: url("#{$ico-url}/player/forward.png");
+ }
+ .backward {
+ background: url("#{$ico-url}/player/backward.png");
+ }
+
+ .volume, .novolume, .repeat, .full {
+ margin: 8px 0 0 20px;
+ }
+ .volume, .novolume {
+ width: 16px;
+ height: 16px;
+ display: inline-block;
+ background: url("#{$ico-url}/player/volume.png");
+ }
+ .novolume {
+ background: url("#{$ico-url}/player/novolume.png");
+ }
+
+ .full {
+ width: 16px;
+ height: 12px;
+ margin-top: 9px;
+ display: inline-block;
+ background: url("#{$ico-url}/player/fullscreen.png");
+ }
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/reset.css.scss b/app/assets/stylesheets/reset.css.scss
new file mode 100644
index 0000000..9c6a477
--- /dev/null
+++ b/app/assets/stylesheets/reset.css.scss
@@ -0,0 +1 @@
+body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}
\ No newline at end of file
diff --git a/app/assets/stylesheets/scrolling.css.scss b/app/assets/stylesheets/scrolling.css.scss
new file mode 100644
index 0000000..ddba7a7
--- /dev/null
+++ b/app/assets/stylesheets/scrolling.css.scss
@@ -0,0 +1,122 @@
+/*********************************/
+/********** SCROLLING ************/
+/*********************************/
+
+/*
+ * CSS Styles that are needed by jScrollPane for it to operate correctly.
+ *
+ * Include this stylesheet in your site or copy and paste the styles below into your stylesheet - jScrollPane
+ * may not operate correctly without them.
+ */
+
+.jspContainer
+{
+ overflow: hidden;
+ position: relative;
+}
+
+.jspPane
+{
+ position: absolute;
+}
+
+.jspVerticalBar
+{
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 6px;
+ height: 100%;
+}
+
+.jspHorizontalBar
+{
+ width: 0; height: 0;
+ display: none;
+}
+
+.jspVerticalBar *,
+.jspHorizontalBar *
+{
+ margin: 0;
+ padding: 0;
+}
+
+.jspCap
+{
+ display: none;
+}
+
+.jspHorizontalBar .jspCap
+{
+ float: left;
+}
+
+.jspTrack
+{
+ background: transparent;
+ position: relative;
+ padding: 0 0;
+}
+
+.jspDrag
+{
+ background: #e0e6ee;
+ position: relative;
+ top: 0;
+ left: 2px;
+ width: 4px;
+ cursor: pointer;
+}
+
+.jspHorizontalBar .jspTrack,
+.jspHorizontalBar .jspDrag
+{
+ float: left;
+ height: 100%;
+}
+
+.jspArrow
+{
+ background: #50506d;
+ text-indent: -20000px;
+ display: block;
+ cursor: pointer;
+}
+
+.jspArrow.jspDisabled
+{
+ cursor: default;
+ background: #80808d;
+}
+
+.jspVerticalBar .jspArrow
+{
+ height: 16px;
+}
+
+.jspHorizontalBar .jspArrow
+{
+ width: 16px;
+ float: left;
+ height: 100%;
+}
+
+.jspVerticalBar .jspArrow:focus
+{
+ outline: none;
+}
+
+.jspCorner
+{
+ background: #eeeef4;
+ float: left;
+ height: 100%;
+}
+
+/* Yuk! CSS Hack for IE6 3 pixel bug :( */
+* html .jspCorner
+{
+ margin: 0 -3px 0 0;
+}
+
diff --git a/app/assets/stylesheets/search.css.scss b/app/assets/stylesheets/search.css.scss
new file mode 100644
index 0000000..515cceb
--- /dev/null
+++ b/app/assets/stylesheets/search.css.scss
@@ -0,0 +1,28 @@
+/*********************************/
+/************ LAYOUT *************/
+/*********************************/
+
+#search_bar {
+ width: 500px;
+ float: left;
+ border: 0;
+ margin-bottom: 20px;
+ position: relative;
+ padding: 15px;
+ input {
+ width: 488px;
+ height: 35px;
+ padding-left: 10px;
+ font-size: 14px;
+ border: 1px solid desaturate(darken($ultra-light, 10%), 20%);
+ @include rounded(4px);
+ &:focus { border-color: $blue }
+ }
+ .button {
+ position: absolute;
+ width: 20px;
+ height: 20px;
+ right: 26px;
+ top: 24px;
+ }
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/sidebar.css.scss b/app/assets/stylesheets/sidebar.css.scss
new file mode 100644
index 0000000..dcb6665
--- /dev/null
+++ b/app/assets/stylesheets/sidebar.css.scss
@@ -0,0 +1,19 @@
+/*********************************/
+/************ LAYOUT *************/
+/*********************************/
+
+#sidebar {
+ float: right;
+ width: 320px;
+ .advertisment {
+ width: 300px;
+ height: 270px;
+ }
+ img { float: left; }
+ sup {
+ display: block;
+ height: 20px;
+ line-height: 20px;
+ float: left;
+ }
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/user.css.scss b/app/assets/stylesheets/user.css.scss
new file mode 100644
index 0000000..fcdabfa
--- /dev/null
+++ b/app/assets/stylesheets/user.css.scss
@@ -0,0 +1,67 @@
+/*********************************/
+/************ LAYOUT *************/
+/*********************************/
+
+@mixin set-width-for-user-left($w){
+ width: $w;
+ h1 { width: $w }
+ .information { width: $w }
+}
+
+#user_left {
+ $padding: 28px;
+ float: left;
+ @include set-width-for-user-left(200px);
+ .picture {
+ float: left;
+ position: relative;
+ width: 200px;
+ height: 200px;
+ }
+ h1 {
+ font-size: 18px;
+ $height: 44px;
+ line-height: $height;
+ height: $height;
+ color: #fff;
+ @include stripe-bg();
+ margin-bottom: 20px;
+ text-indent: 22px;
+ }
+ .nav li {
+ background: url('#{$ico-url}/artist-information-active-arrow.png') no-repeat right 10px;
+ cursor: default;
+ &:last-child { margin-bottom: 0 }
+ }
+ .con {
+ margin-left: 80px;
+ li {
+ $height: 25px;
+ height: $height;
+ margin-bottom: 13px;
+ color: White;
+ line-height: $height;
+ &:last-child { margin-bottom: 0 }
+ }
+ }
+}
+
+
+
+.signuptab {
+ input[type=text], input[type=email], input[type=password] {
+ width: 300px;
+ height: 28px;
+ margin-bottom: 10px;
+ padding-left: 10px;
+ }
+ input[type=submit] {
+ width: 70px;
+ height: 25px;
+ margin-bottom: 20px;
+ }
+ a {
+ color: $blue!important;
+ margin-right: 20px;
+ }
+}
\ No newline at end of file
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 1956c45..7f1717d 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -2,9 +2,11 @@
%html
%head
%title 9minutes
- = include_stylesheets :common, :media=>'all'
= javascript_include_tag "http://www.google.com/jsapi"
- = include_javascripts :jquery, :helper, :plugins, :common
+ = stylesheet_link_tag "application", :media=>'all'
+ = javascript_include_tag "application"
+ -# = include_stylesheets :common, :media=>'all'
+ -# = include_javascripts :jquery, :helper, :plugins, :common
:javascript
google.load("swfobject", "2.1");
google.setOnLoadCallback(_run);
diff --git a/config/application.rb b/config/application.rb
index 1f9c228..d7385d5 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -5,7 +5,8 @@ Bundler.require(:default, Rails.env) if defined?(Bundler)
module Nineminutes
class Application < Rails::Application
-
+ config.autoload_once_paths += %W(#{config.root}/lib)
+
# enable caching in development mode
config.action_controller.perform_caching = true
config.action_controller.page_cache_directory = Rails.root.to_s+"/public/cache/"
@@ -17,5 +18,11 @@ module Nineminutes
config.encoding = "utf-8"
config.filter_parameters += [:password]
+
+ config.assets.enabled = true
+ config.assets.version = '1.0'
+
+ # Defaults to '/assets'
+ # config.assets.prefix = '/asset-files'
end
end
diff --git a/config/assets.yml b/config/assets.yml
index 0fc9928..9a96b25 100644
--- a/config/assets.yml
+++ b/config/assets.yml
@@ -1,6 +1,6 @@
-embed_assets: on
+embed_assets: off
javascript_compressor: closure
-
+package_path: jammit
javascripts:
jquery:
diff --git a/config/config.yml.template b/config/config.yml.template
index 2335351..3b3743a 100644
--- a/config/config.yml.template
+++ b/config/config.yml.template
@@ -1,8 +1,9 @@
-secret_token: ""
-lastfm_api_key: ""
+secret_token:
+lastfm_api_key:
+bing_api_key:
facebook:
- app_id: ""
- secret: ""
+ app_id:
+ secret:
redis:
- development: ""
- production: ""
\ No newline at end of file
+ development:
+ production:
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 8bdcc0f..17ea73a 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,9 +1,9 @@
Nineminutes::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
-
+
# Reloads modules and files in lib directory
config.autoload_paths += %W(#{config.root}/lib)
-
+
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
@@ -14,7 +14,6 @@ Nineminutes::Application.configure do
# Show full error reports and disable caching
config.consider_all_requests_local = true
- config.action_view.debug_rjs = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
@@ -26,5 +25,11 @@ Nineminutes::Application.configure do
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
+
+ # Do not compress assets
+ config.assets.compress = false
+
+ # Expands the lines which load the assets
+ config.assets.debug = true
end
diff --git a/config/environments/production.rb b/config/environments/production.rb
index bed7f83..ddd7264 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -47,4 +47,22 @@ Nineminutes::Application.configure do
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
+
+ # Compress JavaScripts and CSS
+ config.assets.compress = true
+
+ # Don't fallback to assets pipeline if a precompiled asset is missed
+ config.assets.compile = false
+
+ # Generate digests for assets URLs
+ config.assets.digest = true
+
+ # Defaults to Rails.root.join("public/assets")
+ # config.assets.manifest = YOUR_PATH
+
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
+ # config.assets.precompile += %w( search.js )
+
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # config.force_ssl = true
end
diff --git a/config/environments/test.rb b/config/environments/test.rb
index f36aefd..6413791 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -32,4 +32,8 @@ Nineminutes::Application.configure do
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
+
+ # Configure static asset server for tests with Cache-Control for performance
+ config.serve_static_assets = true
+ config.static_cache_control = "public, max-age=3600"
end
diff --git a/config/initializers/lastfm.rb b/config/initializers/lastfm.rb
index eaee98b..3859f0e 100644
--- a/config/initializers/lastfm.rb
+++ b/config/initializers/lastfm.rb
@@ -1,3 +1,3 @@
ActionDispatch::Callbacks.to_prepare do
LastFM::Request::api_key = ENV['LASTFM_API_KEY']
-end
\ No newline at end of file
+end
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb
new file mode 100644
index 0000000..7ebab83
--- /dev/null
+++ b/config/initializers/wrap_parameters.rb
@@ -0,0 +1,13 @@
+# Be sure to restart your server when you modify this file.
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+ wrap_parameters :format => [:json]
+end
+
+# Disable root element in JSON by default.
+ActiveSupport.on_load(:active_record) do
+ self.include_root_in_json = false
+end
diff --git a/config/routes.rb b/config/routes.rb
index b271763..2d59630 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,7 +1,11 @@
Nineminutes::Application.routes.draw do
- devise_for :users,
- :controllers => { :omniauth_callbacks => "users/omniauth_callbacks", :registrations => "devise_auth/registrations", :sessions => "devise_auth/sessions" }
+ devise_for :users, :controllers => {
+ :omniauth_callbacks => "users/omniauth_callbacks",
+ :registrations => "devise_auth/registrations",
+ :sessions => "devise_auth/sessions"
+ }
+
devise_scope :user do
get "/users/auth/:provider" => "users/omniauth_callbacks#passthru"
get "/register" => "devise_auth/registrations#new", :as => :new_user_registration
@@ -27,8 +31,8 @@ Nineminutes::Application.routes.draw do
match "/charts", :to => "charts#index"
resources :users, :only => [ :show, :update, :edit, :create ]
-
+
get "/home", :to => "home#index"
-
+
root :to => "home#index"
end
diff --git a/db/schema.rb b/db/schema.rb
index 033efac..70b4614 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1,3 +1,4 @@
+# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.