1
0
Fork 0

total cleanup

This commit is contained in:
magnolia-fan 2011-06-13 16:54:56 +04:00
parent 1d9a0398c6
commit 447239f824
49 changed files with 571 additions and 1854 deletions

10
Gemfile
View File

@ -1,16 +1,11 @@
source 'http://rubygems.org'
gem 'rails', '3.0.5'
gem 'rails', '3.0.8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'mongo', '1.3.0'
gem 'bson_ext', '1.3.0'
gem 'mongoid', '~> 2.0'
gem 'nokogiri'
gem 'daemons'
gem 'sqlite3'
# Use unicorn as the web server
# gem 'unicorn'
@ -34,4 +29,3 @@ gem 'daemons'
# group :development, :test do
# gem 'webrat'
# end

View File

@ -1,90 +0,0 @@
GEM
remote: http://rubygems.org/
specs:
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)
arel (2.0.9)
bson (1.3.0)
bson_ext (1.3.0)
builder (2.1.2)
daemons (1.1.2)
erubis (2.6.6)
abstract (>= 1.0.0)
i18n (0.5.0)
mail (2.2.15)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
mongo (1.3.0)
bson (>= 1.3.0)
mongoid (2.0.1)
activemodel (~> 3.0)
mongo (~> 1.3)
tzinfo (~> 0.3.22)
will_paginate (~> 3.0.pre)
nokogiri (1.4.4)
pg (0.10.1)
polyglot (0.3.1)
rack (1.2.2)
rack-mount (0.6.14)
rack (>= 1.0.0)
rack-test (0.5.7)
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)
bundler (~> 1.0)
railties (= 3.0.5)
railties (3.0.5)
actionpack (= 3.0.5)
activesupport (= 3.0.5)
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
thor (0.14.6)
treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.26)
will_paginate (3.0.pre2)
PLATFORMS
ruby
DEPENDENCIES
bson_ext (= 1.3.0)
daemons
mongo (= 1.3.0)
mongoid (~> 2.0)
nokogiri
pg
rails (= 3.0.5)

257
README
View File

@ -1 +1,256 @@
Gouranga gives a fuck
== Welcome to Rails
Rails is a web-application framework that includes everything needed to create
database-backed web applications according to the Model-View-Control pattern.
This pattern splits the view (also called the presentation) into "dumb"
templates that are primarily responsible for inserting pre-built data in between
HTML tags. The model contains the "smart" domain objects (such as Account,
Product, Person, Post) that holds all the business logic and knows how to
persist themselves to a database. The controller handles the incoming requests
(such as Save New Account, Update Product, Show Post) by manipulating the model
and directing data to the view.
In Rails, the model is handled by what's called an object-relational mapping
layer entitled Active Record. This layer allows you to present the data from
database rows as objects and embellish these data objects with business logic
methods. You can read more about Active Record in
link:files/vendor/rails/activerecord/README.html.
The controller and view are handled by the Action Pack, which handles both
layers by its two parts: Action View and Action Controller. These two layers
are bundled in a single package due to their heavy interdependence. This is
unlike the relationship between the Active Record and Action Pack that is much
more separate. Each of these packages can be used independently outside of
Rails. You can read more about Action Pack in
link:files/vendor/rails/actionpack/README.html.
== Getting Started
1. At the command prompt, create a new Rails application:
<tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
2. Change directory to <tt>myapp</tt> and start the web server:
<tt>cd myapp; rails server</tt> (run with --help for options)
3. Go to http://localhost:3000/ and you'll see:
"Welcome aboard: You're riding Ruby on Rails!"
4. Follow the guidelines to start developing your application. You can find
the following resources handy:
* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
== Debugging Rails
Sometimes your application goes wrong. Fortunately there are a lot of tools that
will help you debug it and get it back on the rails.
First area to check is the application log files. Have "tail -f" commands
running on the server.log and development.log. Rails will automatically display
debugging and runtime information to these files. Debugging info will also be
shown in the browser on requests from 127.0.0.1.
You can also log your own messages directly into the log file from your code
using the Ruby logger class from inside your controllers. Example:
class WeblogController < ActionController::Base
def destroy
@weblog = Weblog.find(params[:id])
@weblog.destroy
logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
end
end
The result will be a message in your log file along the lines of:
Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
More information on how to use the logger is at http://www.ruby-doc.org/core/
Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
several books available online as well:
* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
These two books will bring you up to speed on the Ruby language and also on
programming in general.
== Debugger
Debugger support is available through the debugger command when you start your
Mongrel or WEBrick server with --debugger. This means that you can break out of
execution at any point in the code, investigate and change the model, and then,
resume execution! You need to install ruby-debug to run the server in debugging
mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
class WeblogController < ActionController::Base
def index
@posts = Post.find(:all)
debugger
end
end
So the controller will accept the action, run the first line, then present you
with a IRB prompt in the server window. Here you can do things like:
>> @posts.inspect
=> "[#<Post:0x14a6be8
@attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
#<Post:0x14a6620
@attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
>> @posts.first.title = "hello from a debugger"
=> "hello from a debugger"
...and even better, you can examine how your runtime objects actually work:
>> f = @posts.first
=> #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
>> f.
Display all 152 possibilities? (y or n)
Finally, when you're ready to resume execution, you can enter "cont".
== Console
The console is a Ruby shell, which allows you to interact with your
application's domain model. Here you'll have all parts of the application
configured, just like it is when the application is running. You can inspect
domain models, change values, and save to the database. Starting the script
without arguments will launch it in the development environment.
To start the console, run <tt>rails console</tt> from the application
directory.
Options:
* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
made to the database.
* Passing an environment name as an argument will load the corresponding
environment. Example: <tt>rails console production</tt>.
To reload your controllers and models after launching the console run
<tt>reload!</tt>
More information about irb can be found at:
link:http://www.rubycentral.com/pickaxe/irb.html
== dbconsole
You can go to the command line of your database directly through <tt>rails
dbconsole</tt>. You would be connected to the database with the credentials
defined in database.yml. Starting the script without arguments will connect you
to the development database. Passing an argument will connect you to a different
database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
PostgreSQL and SQLite 3.
== Description of Contents
The default directory structure of a generated Ruby on Rails application:
|-- app
| |-- controllers
| |-- helpers
| |-- mailers
| |-- models
| `-- views
| `-- layouts
|-- config
| |-- environments
| |-- initializers
| `-- locales
|-- db
|-- doc
|-- lib
| `-- tasks
|-- log
|-- public
| |-- images
| |-- javascripts
| `-- stylesheets
|-- script
|-- test
| |-- fixtures
| |-- functional
| |-- integration
| |-- performance
| `-- unit
|-- tmp
| |-- cache
| |-- pids
| |-- sessions
| `-- sockets
`-- vendor
`-- plugins
app
Holds all the code that's specific to this particular application.
app/controllers
Holds controllers that should be named like weblogs_controller.rb for
automated URL mapping. All controllers should descend from
ApplicationController which itself descends from ActionController::Base.
app/models
Holds models that should be named like post.rb. Models descend from
ActiveRecord::Base by default.
app/views
Holds the template files for the view that should be named like
weblogs/index.html.erb for the WeblogsController#index action. All views use
eRuby syntax by default.
app/views/layouts
Holds the template files for layouts to be used with views. This models the
common header/footer method of wrapping views. In your views, define a layout
using the <tt>layout :default</tt> and create a file named default.html.erb.
Inside default.html.erb, call <% yield %> to render the view using this
layout.
app/helpers
Holds view helpers that should be named like weblogs_helper.rb. These are
generated for you automatically when using generators for controllers.
Helpers can be used to wrap functionality for your views into methods.
config
Configuration files for the Rails environment, the routing map, the database,
and other dependencies.
db
Contains the database schema in schema.rb. db/migrate contains all the
sequence of Migrations for your schema.
doc
This directory is where your application documentation will be stored when
generated using <tt>rake doc:app</tt>
lib
Application specific libraries. Basically, any kind of custom code that
doesn't belong under controllers, models, or helpers. This directory is in
the load path.
public
The directory available for the web server. Contains subdirectories for
images, stylesheets, and javascripts. Also contains the dispatchers and the
default HTML files. This should be set as the DOCUMENT_ROOT of your web
server.
script
Helper scripts for automation and generation.
test
Unit and functional tests along with fixtures. When using the rails generate
command, template test files will be generated for you and placed in this
directory.
vendor
External libraries that the application depends on. Also includes the plugins
subdirectory. If the app has frozen rails, those gems also go here, under
vendor/rails/. This directory is in the load path.

View File

@ -1,6 +1,3 @@
class ApplicationController < ActionController::Base
protect_from_forgery
require 'beatdb'
require 'pp'
#require 'cobravsmongoose'
end

View File

@ -1,5 +0,0 @@
class ErrorsController < ApplicationController
def routing
render :file => "#{Rails.root}/public/404.html", :status => 404, :layout => false
end
end

View File

@ -1,18 +1,2 @@
module ApplicationHelper
def navigation
end
end
class Numeric
def toSeconds
(self / 1000).round
end
def toTime
s = self.toSeconds
m = (s / 60).floor
s -= m * 60
m.to_s << ':' << (s < 10 ? '0' : '') << s.to_s
end
end

View File

@ -1,98 +0,0 @@
module Vkontakte
require 'uri'
require 'net/http'
require 'erb'
require 'pp'
#require 'nokogiri'
@@accounts = YAML.load_file("#{Rails.root.to_s}/config/vk_accounts.yml")
@@bot = nil
def self.get(artist, track, length)
self.randomBot()
html = self.getHtml(artist << ' - ' << track).force_encoding("WINDOWS-1251").encode("UTF-8")
files = self.parseHtml(html)
files = self.calcWeight(files, artist, track, length)
return {
'url' => files.first['url'],
'remixsid' => @@bot['remixsid'],
'remixchk' => @@bot['remixchk']
}
end
private
def self.randomBot()
botname = @@accounts.keys[rand(@@accounts.keys.length - 1)]
@@bot = @@accounts[botname]
pp 'Using bot ' << botname
end
def self.getHtml(q)
headers = {
'Cookie' => 'remixsid='+ @@bot['remixsid'] + ';remixchk='+ @@bot['remixchk'].to_s,
'Referer' => 'http://vkontakte.ru/audio?album_id=0',
'X-Requested-With' => 'XMLHttpRequest',
'Origin' => 'http://vkontakte.ru',
'Content-Type' => 'application/x-www-form-urlencoded',
'User-Agent' => @@bot['user_agent'],
'Connection' => 'close'
}
data = {
'act' => 'search',
'al' => 1,
'gid' => 0,
'id' => @@bot['user_id'],
'offset' => 0,
'q' => q,
'sort' => 2
}
data_str = []
data.each {|k, v| data_str << k +'='+ ERB::Util.url_encode(v.to_s)}
http = Net::HTTP.new('vkontakte.ru', 80)
resp, data = http.post('/audio', data_str.join('&'), headers)
data
end
def self.parseHtml(html)
files = []
html
.scan(/<table.*?<input.*?value=\"(.*?)\,\d{1,4}\".*?>.*?<div\sclass=\"duration.*?>(.*?)<\/div>.*?<div\sclass=\"title_wrap\".*?>.*?selectPerformer\(event\,\s\'(.*?)\'\).*?<span\sclass=\"title\">(.*?)<\/span><\/div>.*?<\/table>/mi)
.each do |item|
t = item[1].split(':')
files << {
'url' => item[0],
'length' => (t[0].to_i * 60) + t[1].to_i,
'artist' => item[2],
'track' => item[3].gsub(/<.*?>/, '')
}
end
files
end
def self.calcWeight(files, artist, track, length)
files.each do |file|
weight = 0
if file['artist'] == artist then weight += 10 else
if file['artist'].include? artist then weight += 5 else
if file['track'].include? artist then weight += 4
end end end
if file['track'] == track then weight += 10 else
if file['track'].include? track then weight += 5
end end
if file['length'] == length then weight +=10 else
delta = (length - file['length']).abs
if delta < 5 then weight += (5 - delta) end
end
file['weight'] = weight
end
files.sort_by{|file| file['weight']}.reverse
end
end

View File

@ -1,57 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>BeatHaven</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :all %>
<%= csrf_meta_tag %>
<title>Beathaven</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
</head>
<body>
<div id="nav">
<ul>
<li><a href="/">Search</a></li>
<li><a href="/user/profile">Profile</a></li>
<li><a href="/logout">Logout</a></li>
</ul>
</div>
<% if @hide_player.nil? -%>
<div id="player">
<div id="audiobox"></div>
<div class="prev" title="Play Previous Track"><img src="/images/player/prev.svg" alt="prv" /></div>
<div class="play" title="Play"><img src="/images/player/play.svg" alt="ply" /></div>
<div class="pause" title="Pause" style="display:none"><img src="/images/player/pause.svg" alt="pause" /></div>
<div class="next" title="Play Next Track"><img src="/images/player/next.svg" alt="pse" /></div>
<div class="time-played">0:00</div>
<div class="progress">
<div class="track-title">No track</div>
<div class="progress-bar">
<div class="progress-loaded">
<div title="Drag It Now!" class="progress-point"></div>
</div>
</div>
</div>
<div class="time-left">0:00</div>
<div title="Play Tracks In Random Order" class="shuffle"><img src="/images/player/shuffle.svg" alt="shu" /></div>
<div title="Repeat Playlist" class="repeat"><img src="/images/player/repeat.svg" alt="rep" /></div>
<div title="Show/Hide Playlist" class="playlist">
<img src="/images/player/playlist.svg" alt="pls" />
<div class="count">0</div>
</div>
</div>
<div id="playlist">
<ul class="list"></ul>
</div>
<div class="corner-fix left"></div>
<div class="corner-fix right"></div>
<%- end %>
<div id="contents">
<div class="inner-1">
<%= yield %>
</div>
</div>
<%= yield %>
</body>
</html>

View File

@ -38,7 +38,5 @@ module Beathaven
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
#config.autoload_paths += %W(#{config.root}/lib/db)
end
end

View File

@ -1,8 +1,6 @@
#utf-8
require 'rubygems'
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
require 'json'

View File

@ -1,14 +1,22 @@
defaults: &defaults
adapter: postgresql
database: beathaven
host: 192.168.0.128
username: postgres
password: password
# SQLite version 3.x
# gem install sqlite3
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
development:
<<: *defaults
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
<<: *defaults
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000

View File

@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Beathaven::Application.config.secret_token = '4640513caed8bd0f9d5de3f39e95fd8cf6c070424b3f1c6da5c6e1a0aac18af67242e6866f1f7c970b426db07c68c960a22dcf45e4e8ac0a02a5fd32a6ba4bee'
Beathaven::Application.config.secret_token = '9f7bfb8b5bebe7befaa38b67e70694dc98c19780eb161b75b1c7251a93874c27138865f5cc3319a72c244560c74994eb69f193f17333943f2a18b867389c48c7'

View File

@ -1,20 +0,0 @@
defaults: &defaults
host: 192.168.0.100
port: 27017
database: beathaven
# slaves:
# - host: slave1.local
# port: 27018
# - host: slave2.local
# port: 27019
development:
<<: *defaults
test:
<<: *defaults
# set these environment variables on your prod server
production:
<<: *defaults

View File

@ -1,28 +1,58 @@
Beathaven::Application.routes.draw do
get "bot/list"
# The priority is based upon order of creation:
# first created -> highest priority.
get "bot/stats"
# Sample of regular route:
# match 'products/:id' => 'catalog#view'
# Keep in mind you can assign values other than :controller and :action
match "bot/queue/" => "bot#queue"
match "bot/start/:name" => "bot#start"
match "bot/stop/:name" => "bot#stop"
match "bot/add/:name" => "bot#add"
# Sample of named route:
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
# This route can be invoked with purchase_url(:id => product.id)
get "main/index"
# Sample resource route (maps HTTP verbs to controller actions automatically):
# resources :products
root :to => "main#index", :as => "main"
# Sample resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end
match 'artist(/:name)' => 'artist#view'
match 'listen/:id' => 'track#listen'
match 'search/autocomplete' => 'artist#autocomplete'
# Sample resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end
# Registration & login
match 'reg/:email/:code' => 'user#register', :constraints => { :email => /[-a-z0-9\._@]+/i, :code => /[a-f0-9]{64}/ }
match 'reg/complete' => 'user#complete'
match 'login' => 'user#login'
match 'user/profile' => 'user#update'
match 'user/invite' => 'user#invite'
# Sample resource route with more complex sub-resources
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', :on => :collection
# end
# end
match '*a', :to => 'errors#routing'
# Sample resource route within a namespace:
# namespace :admin do
# # Directs /admin/products/* to Admin::ProductsController
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
# root :to => "welcome#index"
# See how all your routes lay out with "rake routes"
# This is a legacy wild controller route that's not recommended for RESTful applications.
# Note: This route will make all actions in every controller accessible via GET requests.
# match ':controller(/:action(/:id(.:format)))'
end

View File

@ -1,71 +0,0 @@
# Vkontake accounts config
Bach: # Bach himself
user_id: 5728795
email: chezzzy@yandex.ru
password: yabach!
remixsid: 47c2f5501b22a3e3aa6947e5e74d1a72381267df2502570eb75c94481ade
remixchk: 5
user_agent: "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"
Mozart: # Hedg
user_id: 69139853
email: alexgreen1978@gmail.com
password: fbcn136
remixsid: bc5386a4f49f8bf7df20e11bdd311a7120818d83c23d93cd08177d5d3674
remixchk: 5
user_agent: "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.307.9 Safari/532.9"
Schubert: # Chez
user_id: 1217744
email: phpdev.ru@gmail.com
password: yanebach!
remixsid: fc27c3a7874bc0b84477015e187e5e0bd3a71bdca02d98327595ef255773
remixchk: 5
user_agent: "Mozilla/5.0 (Macintosh; U; PPC Max OS X Mach-O; en-US; rv:1.8.0.7) Gecko/200609211 Camino/1.0.3"
Vivaldi: # Flint
user_id: 382067
remixsid: 9afa6f2e6d352b01d1a3742b2c0f6c09dbefe2158f3dcb61d30fe438dbc2
remixchk: 5
user_agent: "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
# Prokofiev: # Daddy
# user_id:24538630
# remixsid: 832fae47c8dfc8df66551b8c72927ca26f6ee49f5754b24e9a9a317805c5
# remixchk: 5
# user_agent: "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; WebMoney Advisor; GTB6.3; InfoPath.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
Paganini: # Tom_Orrow
user_id: 1554168
email: agent_smith@gmail.ru
password: GoTo17db14DB
remixsid: cf89c2e8ef6ab2337c3b4ef22bdd38be70c880da7f9ef73ff7d02ff9608e
remixchk: 5
user_agent: "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
# Stolen
# Stolen_Moroz:
# user_id: 9444259
# email: 89232979779@mail.ru
# password: beatcobot1
# remixsid: d5b1289ae534887319f41bdebf435f9ed3721ccf9203d7
# remixchk: 5
# user_agent: "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
Stolen_NarutoSasuke:
user_id: 29280365
email: narutosasuke1@mail.ru
password: beatcobot
remixsid: 3c2174798f22fdf06643efb2fe8661f43805def362c8c0fce9c32c8fb8c4
remixchk: 5
user_agent: "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"
Stolen_Nelpon:
user_id: 42952537
email: nelpon@mail.ru
password: beatcobot
remixsid: 1864242e856873120b38b27abe271a46e73f93b848b7ccf87e711a402271
remixchk: 5
user_agent: "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16"

View File

@ -1,47 +0,0 @@
worker_processes 1;
error_log logs/error.log debug;
events {
worker_connections 256;
}
http {
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_types text/plain;
upstream mongrel {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name bh.vim.me localhost susanna brooklyn;
#root /Users/chez/Sites;
#index index.html index.htm;
try_files $uri @mongrel;
location @mongrel {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://mongrel;
}
include proxy.conf;
#error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}

View File

@ -1,43 +0,0 @@
# Proxy download
location ~* ^/proxy-stream/(.*?)/(.*?)/(.*?)/(.*?)/(.*) {
# Do not allow people to mess with this location directly
# Only internal redirects are allowed
internal;
# Location-specific logging
#access_log logs/proxy_stream.access.log debug;
#error_log logs/proxy_stream.error.log debug;
# Extract download url from the request
set $token $1;
set $remixsid $2;
set $remixchk $3;
set $download_host $4;
set $download_uri $5;
# Compose download url
set $download_url http://$download_host/$download_uri;
# Compose cookie string
set $cookie "remixsid=$remixsid;remixchk=$remixchk";
# Set download request headers
proxy_set_header Host $download_host;
proxy_set_header Cookie $cookie;
proxy_set_header Referer "http://vkontakte.ru/audio?album_id=0";
# The next two lines could be used if your storage
# backend does not support Content-Disposition
# headers used to specify file name browsers use
# when save content to the disk
proxy_ignore_headers Cache-Control Expires;
# Do not touch local disks when proxying
# content to clients
proxy_max_temp_file_size 0;
# Download the file and send it to client
resolver 192.168.0.1;
proxy_pass $download_url;
}

View File

@ -1 +0,0 @@
/Users/chez/Sites/Progress/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

View File

@ -1,5 +0,0 @@
<?xml version="1.0" standalone="no"?>
<svg width="1000" height="1000" version="1.1" xmlns="http://www.w3.org/2000/svg">
<rect x="400" y="0" width="200" height="1000" style="fill:rgb(220,220,220);"/>
<rect x="0" y="400" width="1000" height="200" style="fill:rgb(220,220,220);"/>
</svg>

Before

Width:  |  Height:  |  Size: 286 B

View File

@ -1,6 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="1000" height="1000" version="1.1" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,250 500,500 0,750" style="fill:rgb(200,200,200);"/>
<polygon points="500,250 1000,500 500,750" style="fill:rgb(200,200,200);"/>
</svg>

Before

Width:  |  Height:  |  Size: 374 B

View File

@ -1,5 +0,0 @@
<?xml version="1.0" standalone="no"?>
<svg width="1000" height="1000" version="1.1" xmlns="http://www.w3.org/2000/svg">
<rect x="50" width="400" height="1000" style="fill:rgb(200,200,200);"/>
<rect x="600" width="400" height="1000" style="fill:rgb(200,200,200);"/>
</svg>

Before

Width:  |  Height:  |  Size: 273 B

View File

@ -1,5 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="1000" height="1000" version="1.1" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 1000,500 0,1000" style="fill:rgb(200,200,200);"/>
</svg>

Before

Width:  |  Height:  |  Size: 297 B

View File

@ -1,9 +0,0 @@
<?xml version="1.0" standalone="no"?>
<svg width="700" height="900" version="1.1" xmlns="http://www.w3.org/2000/svg">
<rect x="50" y="50" rx="50" ry="50" width="600" height="800" style="stroke:rgb(200,200,200);stroke-width:50;"/>
<rect x="150" y="150" width="400" height="70" style="fill:rgb(200,200,200);"/>
<rect x="150" y="282" width="400" height="70" style="fill:rgb(200,200,200);"/>
<rect x="150" y="415" width="400" height="70" style="fill:rgb(200,200,200);"/>
<rect x="150" y="548" width="400" height="70" style="fill:rgb(200,200,200);"/>
<rect x="150" y="680" width="400" height="70" style="fill:rgb(200,200,200);"/>
</svg>

Before

Width:  |  Height:  |  Size: 637 B

View File

@ -1,6 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="1000" height="1000" version="1.1" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,500 500,250 500,750" style="fill:rgb(200,200,200);"/>
<polygon points="500,500 1000,250 1000,750" style="fill:rgb(200,200,200);"/>
</svg>

Before

Width:  |  Height:  |  Size: 377 B

View File

@ -1,5 +0,0 @@
<?xml version="1.0" standalone="no"?>
<svg width="700" height="500" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path d="M250 400 L150 400 C125 400 100 375 100 350 L100 150 C100 125 125 100 150 100 L550 100 C575 100 600 125 600 150 L600 350 C600 375 575 400 550 400 L440 400" style="stroke:rgb(200,200,200);stroke-width:70;" />
<polygon points="249,300 369,400 249,500" style="fill:rgb(200,200,200);"/>
</svg>

Before

Width:  |  Height:  |  Size: 417 B

View File

@ -1,41 +0,0 @@
<?xml version="1.0" standalone="no"?>
<svg width="700" height="500" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path d="M100 400
L250 400
C300 400
325 375
350 325
L400 225
C425 175
450 150
500 150
L560 150
M100 150
L250 150
C300 150
325 175
350 225
L400 325
C425 375
450 400
500 400
L560 400
" style="stroke:rgb(200,200,200);stroke-width:70;" />
<path d="M295 300 L371 150" style="stroke:rgb(0,0,0);stroke-width:50;" />
<path d="M379 400 L455 250" style="stroke:rgb(0,0,0);stroke-width:50;" />
<polygon points="559,50 680,150 559,210" style="fill:rgb(200,200,200);"/>
<polygon points="559,300 680,400 559,500" style="fill:rgb(200,200,200);"/>
</svg>

Before

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

239
public/index.html Normal file
View File

@ -0,0 +1,239 @@
<!DOCTYPE html>
<html>
<head>
<title>Ruby on Rails: Welcome aboard</title>
<style type="text/css" media="screen">
body {
margin: 0;
margin-bottom: 25px;
padding: 0;
background-color: #f0f0f0;
font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
font-size: 13px;
color: #333;
}
h1 {
font-size: 28px;
color: #000;
}
a {color: #03c}
a:hover {
background-color: #03c;
color: white;
text-decoration: none;
}
#page {
background-color: #f0f0f0;
width: 750px;
margin: 0;
margin-left: auto;
margin-right: auto;
}
#content {
float: left;
background-color: white;
border: 3px solid #aaa;
border-top: none;
padding: 25px;
width: 500px;
}
#sidebar {
float: right;
width: 175px;
}
#footer {
clear: both;
}
#header, #about, #getting-started {
padding-left: 75px;
padding-right: 30px;
}
#header {
background-image: url("images/rails.png");
background-repeat: no-repeat;
background-position: top left;
height: 64px;
}
#header h1, #header h2 {margin: 0}
#header h2 {
color: #888;
font-weight: normal;
font-size: 16px;
}
#about h3 {
margin: 0;
margin-bottom: 10px;
font-size: 14px;
}
#about-content {
background-color: #ffd;
border: 1px solid #fc0;
margin-left: -55px;
margin-right: -10px;
}
#about-content table {
margin-top: 10px;
margin-bottom: 10px;
font-size: 11px;
border-collapse: collapse;
}
#about-content td {
padding: 10px;
padding-top: 3px;
padding-bottom: 3px;
}
#about-content td.name {color: #555}
#about-content td.value {color: #000}
#about-content ul {
padding: 0;
list-style-type: none;
}
#about-content.failure {
background-color: #fcc;
border: 1px solid #f00;
}
#about-content.failure p {
margin: 0;
padding: 10px;
}
#getting-started {
border-top: 1px solid #ccc;
margin-top: 25px;
padding-top: 15px;
}
#getting-started h1 {
margin: 0;
font-size: 20px;
}
#getting-started h2 {
margin: 0;
font-size: 14px;
font-weight: normal;
color: #333;
margin-bottom: 25px;
}
#getting-started ol {
margin-left: 0;
padding-left: 0;
}
#getting-started li {
font-size: 18px;
color: #888;
margin-bottom: 25px;
}
#getting-started li h2 {
margin: 0;
font-weight: normal;
font-size: 18px;
color: #333;
}
#getting-started li p {
color: #555;
font-size: 13px;
}
#sidebar ul {
margin-left: 0;
padding-left: 0;
}
#sidebar ul h3 {
margin-top: 25px;
font-size: 16px;
padding-bottom: 10px;
border-bottom: 1px solid #ccc;
}
#sidebar li {
list-style-type: none;
}
#sidebar ul.links li {
margin-bottom: 5px;
}
</style>
<script type="text/javascript">
function about() {
info = document.getElementById('about-content');
if (window.XMLHttpRequest)
{ xhr = new XMLHttpRequest(); }
else
{ xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
xhr.open("GET","rails/info/properties",false);
xhr.send("");
info.innerHTML = xhr.responseText;
info.style.display = 'block'
}
</script>
</head>
<body>
<div id="page">
<div id="sidebar">
<ul id="sidebar-items">
<li>
<h3>Browse the documentation</h3>
<ul class="links">
<li><a href="http://api.rubyonrails.org/">Rails API</a></li>
<li><a href="http://stdlib.rubyonrails.org/">Ruby standard library</a></li>
<li><a href="http://corelib.rubyonrails.org/">Ruby core</a></li>
<li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
</ul>
</li>
</ul>
</div>
<div id="content">
<div id="header">
<h1>Welcome aboard</h1>
<h2>You&rsquo;re riding Ruby on Rails!</h2>
</div>
<div id="about">
<h3><a href="rails/info/properties" onclick="about(); return false">About your application&rsquo;s environment</a></h3>
<div id="about-content" style="display: none"></div>
</div>
<div id="getting-started">
<h1>Getting started</h1>
<h2>Here&rsquo;s how to get rolling:</h2>
<ol>
<li>
<h2>Use <code>rails generate</code> to create your models and controllers</h2>
<p>To see all available options, run it without parameters.</p>
</li>
<li>
<h2>Set up a default route and remove or rename this file</h2>
<p>Routes are set up in config/routes.rb.</p>
</li>
<li>
<h2>Create your database</h2>
<p>Run <code>rake db:migrate</code> to create your database. If you're not using SQLite (the default), edit <code>config/database.yml</code> with your username and password.</p>
</li>
</ol>
</div>
</div>
<div id="footer">&nbsp;</div>
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,15 +0,0 @@
/*
* jQuery.fn.rand();
*
* Return a random, but defined numbers of elements from a jQuery Object.
* $('element').rand(); // returns one element from the jQuery Object.
* $('element').rand(4); // returns four elements from the jQuery Object.
*
* Version 0.8.5
* www.labs.skengdon.com/rand
* www.labs.skengdon.com/rand/js/rand.min.js
*
* And:
* http://phpjs.org/functions/array_rand:332
*/
;(function($){$.fn.rand=function(number){var array_rand=function(input,num_req){var indexes=[];var ticks=num_req||1;var checkDuplicate=function(input,value){var exist=false,index=0;while(index<input.length){if(input[index]===value){exist=true;break;};index++;};return exist;};while(true){var rand=Math.floor((Math.random()*input.length));if(indexes.length===ticks){break;};if(!checkDuplicate(indexes,rand)){indexes.push(rand);}};return((ticks==1)?indexes.join():indexes);};if(typeof number!=='number')var number=1;if(number>this.length)number=this.length;var numbers=array_rand(this,number);var $return=[];for(var i=0;i<number;i++){$return[i]=this.get(numbers[i]);};return $($return);};}(jQuery));

View File

@ -1,390 +0,0 @@
/**
* Ajax Autocomplete for jQuery, version 1.1.3
* (c) 2010 Tomas Kirda
*
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
* For details, see the web site: http://www.devbridge.com/projects/autocomplete/jquery/
*
* Last Review: 04/19/2010
*/
/*jslint onevar: true, evil: true, nomen: true, eqeqeq: true, bitwise: true, regexp: true, newcap: true, immed: true */
/*global window: true, document: true, clearInterval: true, setInterval: true, jQuery: true */
(function($) {
var reEscape = new RegExp('(\\' + ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'].join('|\\') + ')', 'g');
function fnFormatResult(value, data, currentValue) {
var pattern = '(' + currentValue.replace(reEscape, '\\$1') + ')';
return value.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');
}
function Autocomplete(el, options) {
this.el = $(el);
this.el.attr('autocomplete', 'off');
this.suggestions = [];
this.data = [];
this.badQueries = [];
this.selectedIndex = -1;
this.currentValue = this.el.val();
this.intervalId = 0;
this.cachedResponse = [];
this.onChangeInterval = null;
this.ignoreValueChange = false;
this.serviceUrl = options.serviceUrl;
this.isLocal = false;
this.options = {
autoSubmit: false,
minChars: 1,
maxHeight: 300,
deferRequestBy: 0,
width: 0,
highlight: true,
params: {},
fnFormatResult: fnFormatResult,
delimiter: null,
zIndex: 9999
};
this.initialize();
this.setOptions(options);
}
$.fn.autocomplete = function(options) {
return new Autocomplete(this.get(0)||$('<input />'), options);
};
Autocomplete.prototype = {
killerFn: null,
initialize: function() {
var me, uid, autocompleteElId;
me = this;
uid = Math.floor(Math.random()*0x100000).toString(16);
autocompleteElId = 'Autocomplete_' + uid;
this.killerFn = function(e) {
if ($(e.target).parents('.autocomplete').size() === 0) {
me.killSuggestions();
me.disableKillerFn();
}
};
if (!this.options.width) { this.options.width = this.el.width(); }
this.mainContainerId = 'AutocompleteContainter_' + uid;
$('<div id="' + this.mainContainerId + '" style="position:absolute;z-index:9999;"><div class="autocomplete-w1"><div class="autocomplete" id="' + autocompleteElId + '" style="display:none; width:300px;"></div></div></div>').appendTo('body');
this.container = $('#' + autocompleteElId);
this.fixPosition();
if (window.opera) {
this.el.keypress(function(e) { me.onKeyPress(e); });
} else {
this.el.keydown(function(e) { me.onKeyPress(e); });
}
this.el.keyup(function(e) { me.onKeyUp(e); });
this.el.blur(function() { me.enableKillerFn(); });
this.el.focus(function() { me.fixPosition(); });
},
setOptions: function(options){
var o = this.options;
$.extend(o, options);
if(o.lookup){
this.isLocal = true;
if($.isArray(o.lookup)){ o.lookup = { suggestions:o.lookup, data:[] }; }
}
$('#'+this.mainContainerId).css({ zIndex:o.zIndex });
this.container.css({ maxHeight: o.maxHeight + 'px', width:o.width });
},
clearCache: function(){
this.cachedResponse = [];
this.badQueries = [];
},
disable: function(){
this.disabled = true;
},
enable: function(){
this.disabled = false;
},
fixPosition: function() {
var offset = this.el.offset();
$('#' + this.mainContainerId).css({ top: (offset.top + this.el.innerHeight()) + 'px', left: offset.left + 'px' });
},
enableKillerFn: function() {
var me = this;
$(document).bind('click', me.killerFn);
},
disableKillerFn: function() {
var me = this;
$(document).unbind('click', me.killerFn);
},
killSuggestions: function() {
var me = this;
this.stopKillSuggestions();
this.intervalId = window.setInterval(function() { me.hide(); me.stopKillSuggestions(); }, 300);
},
stopKillSuggestions: function() {
window.clearInterval(this.intervalId);
},
onKeyPress: function(e) {
if (this.disabled || !this.enabled) { return; }
// return will exit the function
// and event will not be prevented
switch (e.keyCode) {
case 27: //KEY_ESC:
this.el.val(this.currentValue);
this.hide();
break;
case 9: //KEY_TAB:
case 13: //KEY_RETURN:
if (this.selectedIndex === -1) {
this.hide();
return;
}
this.select(this.selectedIndex);
if(e.keyCode === 9){ return; }
break;
case 38: //KEY_UP:
this.moveUp();
break;
case 40: //KEY_DOWN:
this.moveDown();
break;
default:
return;
}
e.stopImmediatePropagation();
e.preventDefault();
},
onKeyUp: function(e) {
if(this.disabled){ return; }
switch (e.keyCode) {
case 38: //KEY_UP:
case 40: //KEY_DOWN:
return;
}
clearInterval(this.onChangeInterval);
if (this.currentValue !== this.el.val()) {
if (this.options.deferRequestBy > 0) {
// Defer lookup in case when value changes very quickly:
var me = this;
this.onChangeInterval = setInterval(function() { me.onValueChange(); }, this.options.deferRequestBy);
} else {
this.onValueChange();
}
}
},
onValueChange: function() {
clearInterval(this.onChangeInterval);
this.currentValue = this.el.val();
var q = this.getQuery(this.currentValue);
this.selectedIndex = -1;
if (this.ignoreValueChange) {
this.ignoreValueChange = false;
return;
}
if (q === '' || q.length < this.options.minChars) {
this.hide();
} else {
this.getSuggestions(q);
}
},
getQuery: function(val) {
var d, arr;
d = this.options.delimiter;
if (!d) { return $.trim(val); }
arr = val.split(d);
return $.trim(arr[arr.length - 1]);
},
getSuggestionsLocal: function(q) {
var ret, arr, len, val, i;
arr = this.options.lookup;
len = arr.suggestions.length;
ret = { suggestions:[], data:[] };
q = q.toLowerCase();
for(i=0; i< len; i++){
val = arr.suggestions[i];
if(val.toLowerCase().indexOf(q) === 0){
ret.suggestions.push(val);
ret.data.push(arr.data[i]);
}
}
return ret;
},
getSuggestions: function(q) {
var cr, me;
cr = this.isLocal ? this.getSuggestionsLocal(q) : this.cachedResponse[q];
if (cr && $.isArray(cr.suggestions)) {
this.suggestions = cr.suggestions;
this.data = cr.data;
this.suggest();
} else if (!this.isBadQuery(q)) {
me = this;
me.options.params.query = q;
$.get(this.serviceUrl, me.options.params, function(txt) { me.processResponse(txt); }, 'text');
}
},
isBadQuery: function(q) {
var i = this.badQueries.length;
while (i--) {
if (q.indexOf(this.badQueries[i]) === 0) { return true; }
}
return false;
},
hide: function() {
this.enabled = false;
this.selectedIndex = -1;
this.container.hide();
},
suggest: function() {
if (this.suggestions.length === 0) {
this.hide();
return;
}
var me, len, div, f, v, i, s, mOver, mClick;
me = this;
len = this.suggestions.length;
f = this.options.fnFormatResult;
v = this.getQuery(this.currentValue);
mOver = function(xi) { return function() { me.activate(xi); }; };
mClick = function(xi) { return function() { me.select(xi); }; };
this.container.hide().empty();
for (i = 0; i < len; i++) {
s = this.suggestions[i];
div = $((me.selectedIndex === i ? '<div class="selected"' : '<div') + ' title="' + s + '">' + f(s, this.data[i], v) + '</div>');
div.mouseover(mOver(i));
div.click(mClick(i));
this.container.append(div);
}
this.enabled = true;
this.container.show();
},
processResponse: function(text) {
var response;
try {
response = eval('(' + text + ')');
} catch (err) { return; }
if (!$.isArray(response.data)) { response.data = []; }
if(!this.options.noCache){
this.cachedResponse[response.query] = response;
if (response.suggestions.length === 0) { this.badQueries.push(response.query); }
}
if (response.query === this.getQuery(this.currentValue)) {
this.suggestions = response.suggestions;
this.data = response.data;
this.suggest();
}
},
activate: function(index) {
var divs, activeItem;
divs = this.container.children();
// Clear previous selection:
if (this.selectedIndex !== -1 && divs.length > this.selectedIndex) {
$(divs.get(this.selectedIndex)).removeClass();
}
this.selectedIndex = index;
if (this.selectedIndex !== -1 && divs.length > this.selectedIndex) {
activeItem = divs.get(this.selectedIndex);
$(activeItem).addClass('selected');
}
return activeItem;
},
deactivate: function(div, index) {
div.className = '';
if (this.selectedIndex === index) { this.selectedIndex = -1; }
},
select: function(i) {
var selectedValue, f;
selectedValue = this.suggestions[i];
if (selectedValue) {
this.el.val(selectedValue);
if (this.options.autoSubmit) {
f = this.el.parents('form');
if (f.length > 0) { f.get(0).submit(); }
}
this.ignoreValueChange = true;
this.hide();
this.onSelect(i);
}
},
moveUp: function() {
if (this.selectedIndex === -1) { return; }
if (this.selectedIndex === 0) {
this.container.children().get(0).className = '';
this.selectedIndex = -1;
this.el.val(this.currentValue);
return;
}
this.adjustScroll(this.selectedIndex - 1);
},
moveDown: function() {
if (this.selectedIndex === (this.suggestions.length - 1)) { return; }
this.adjustScroll(this.selectedIndex + 1);
},
adjustScroll: function(i) {
var activeItem, offsetTop, upperBound, lowerBound;
activeItem = this.activate(i);
offsetTop = activeItem.offsetTop;
upperBound = this.container.scrollTop();
lowerBound = upperBound + this.options.maxHeight - 25;
if (offsetTop < upperBound) {
this.container.scrollTop(offsetTop);
} else if (offsetTop > lowerBound) {
this.container.scrollTop(offsetTop - this.options.maxHeight + 25);
}
this.el.val(this.getValue(this.suggestions[i]));
},
onSelect: function(i) {
var me, fn, s, d;
me = this;
fn = me.options.onSelect;
s = me.suggestions[i];
d = me.data[i];
me.el.val(me.getValue(s));
if ($.isFunction(fn)) { fn(s, d, me.el); }
},
getValue: function(value){
var del, currVal, arr, me;
me = this;
del = me.options.delimiter;
if (!del) { return value; }
currVal = me.currentValue;
arr = currVal.split(del);
if (arr.length === 1) { return value; }
return currVal.substr(0, currVal.length - arr[arr.length - 1].length) + value;
}
};
}(jQuery));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,11 +0,0 @@
/*
* jScrollPane - v2.0.0beta10 - 2011-04-04
* 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(E,P){var aA,R=this,Z,al,w,an,U,aa,z,r,aB,aG,aw,j,J,i,k,ab,V,ar,Y,u,B,at,ag,ao,H,m,av,az,y,ax,aJ,g,M,ak=true,Q=true,aI=false,l=false,aq=E.clone(false,false).empty(),ad=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aJ=E.css("paddingTop")+" "+E.css("paddingRight")+" "+E.css("paddingBottom")+" "+E.css("paddingLeft");g=(parseInt(E.css("paddingLeft"),10)||0)+(parseInt(E.css("paddingRight"),10)||0);function au(aU){var aS,aT,aN,aP,aO,aL,aK,aR,aQ=false,aM=false;aA=aU;if(Z===c){aK=E.scrollTop();aR=E.scrollLeft();E.css({overflow:"hidden",padding:0});al=E.innerWidth()+g;w=E.innerHeight();E.width(al);Z=b('<div class="jspPane" />').css("padding",aJ).append(E.children());an=b('<div class="jspContainer" />').css({width:al+"px",height:w+"px"}).append(Z).appendTo(E)}else{E.css("width","");aQ=aA.stickToBottom&&L();aM=aA.stickToRight&&C();aL=E.innerWidth()+g!=al||E.outerHeight()!=w;if(aL){al=E.innerWidth()+g;w=E.innerHeight();an.css({width:al+"px",height:w+"px"})}if(!aL&&M==U&&Z.outerHeight()==aa){E.width(al);return}M=U;Z.css("width","");E.width(al);an.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}if(aU.contentWidth){U=aU.contentWidth}else{aS=Z.clone(false,false).css("position","absolute");aT=b('<div style="width:1px; position: relative;" />').append(aS);b("body").append(aT);U=Math.max(Z.outerWidth(),aS.outerWidth());aT.remove()}aa=Z.outerHeight();z=U/al;r=aa/w;aB=r>1;aG=z>1;if(!(aG||aB)){E.removeClass("jspScrollable");Z.css({top:0,width:an.width()-g});o();F();S();x();aj()}else{E.addClass("jspScrollable");aN=aA.maintainPosition&&(J||ab);if(aN){aP=aE();aO=aC()}aH();A();G();if(aN){O(aM?(U-al):aP,false);N(aQ?(aa-w):aO,false)}K();ah();ap();if(aA.enableKeyboardNavigation){T()}if(aA.clickOnTrack){q()}D();if(aA.hijackInternalLinks){n()}}if(aA.autoReinitialise&&!ax){ax=setInterval(function(){au(aA)},aA.autoReinitialiseDelay)}else{if(!aA.autoReinitialise&&ax){clearInterval(ax)}}aK&&E.scrollTop(0)&&N(aK,false);aR&&E.scrollLeft(0)&&O(aR,false);E.trigger("jsp-initialised",[aG||aB])}function aH(){if(aB){an.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'),b('<div class="jspDragBottom" />'))),b('<div class="jspCap jspCapBottom" />')));V=an.find(">.jspVerticalBar");ar=V.find(">.jspTrack");aw=ar.find(">.jspDrag");if(aA.showArrows){at=b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",aF(0,-1)).bind("click.jsp",aD);ag=b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",aF(0,1)).bind("click.jsp",aD);if(aA.arrowScrollOnHover){at.bind("mouseover.jsp",aF(0,-1,at));ag.bind("mouseover.jsp",aF(0,1,ag))}am(ar,aA.verticalArrowPositions,at,ag)}u=w;an.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){u-=b(this).outerHeight()});aw.hover(function(){aw.addClass("jspHover")},function(){aw.removeClass("jspHover")}).bind("mousedown.jsp",function(aK){b("html").bind("dragstart.jsp selectstart.jsp",aD);aw.addClass("jspActive");var s=aK.pageY-aw.position().top;b("html").bind("mousemove.jsp",function(aL){W(aL.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",ay);return false});p()}}function p(){ar.height(u+"px");J=0;Y=aA.verticalGutter+ar.outerWidth();Z.width(al-Y-g);try{if(V.position().left===0){Z.css("margin-left",Y+"px")}}catch(s){}}function A(){if(aG){an.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'),b('<div class="jspDragRight" />'))),b('<div class="jspCap jspCapRight" />')));ao=an.find(">.jspHorizontalBar");H=ao.find(">.jspTrack");i=H.find(">.jspDrag");if(aA.showArrows){az=b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",aF(-1,0)).bind("click.jsp",aD);
y=b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",aF(1,0)).bind("click.jsp",aD);if(aA.arrowScrollOnHover){az.bind("mouseover.jsp",aF(-1,0,az));y.bind("mouseover.jsp",aF(1,0,y))}am(H,aA.horizontalArrowPositions,az,y)}i.hover(function(){i.addClass("jspHover")},function(){i.removeClass("jspHover")}).bind("mousedown.jsp",function(aK){b("html").bind("dragstart.jsp selectstart.jsp",aD);i.addClass("jspActive");var s=aK.pageX-i.position().left;b("html").bind("mousemove.jsp",function(aL){X(aL.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",ay);return false});m=an.innerWidth();ai()}}function ai(){an.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){m-=b(this).outerWidth()});H.width(m+"px");ab=0}function G(){if(aG&&aB){var aK=H.outerHeight(),s=ar.outerWidth();u-=aK;b(ao).find(">.jspCap:visible,>.jspArrow").each(function(){m+=b(this).outerWidth()});m-=s;w-=s;al-=aK;H.parent().append(b('<div class="jspCorner" />').css("width",aK+"px"));p();ai()}if(aG){Z.width((an.outerWidth()-g)+"px")}aa=Z.outerHeight();r=aa/w;if(aG){av=Math.ceil(1/z*m);if(av>aA.horizontalDragMaxWidth){av=aA.horizontalDragMaxWidth}else{if(av<aA.horizontalDragMinWidth){av=aA.horizontalDragMinWidth}}i.width(av+"px");k=m-av;af(ab)}if(aB){B=Math.ceil(1/r*u);if(B>aA.verticalDragMaxHeight){B=aA.verticalDragMaxHeight}else{if(B<aA.verticalDragMinHeight){B=aA.verticalDragMinHeight}}aw.height(B+"px");j=u-B;ae(J)}}function am(aL,aN,aK,s){var aP="before",aM="after",aO;if(aN=="os"){aN=/Mac/.test(navigator.platform)?"after":"split"}if(aN==aP){aM=aN}else{if(aN==aM){aP=aN;aO=aK;aK=s;s=aO}}aL[aP](aK)[aM](s)}function aF(aK,s,aL){return function(){I(aK,s,this,aL);this.blur();return false}}function I(aN,aM,aQ,aP){aQ=b(aQ).addClass("jspActive");var aO,aL,aK=true,s=function(){if(aN!==0){R.scrollByX(aN*aA.arrowButtonSpeed)}if(aM!==0){R.scrollByY(aM*aA.arrowButtonSpeed)}aL=setTimeout(s,aK?aA.initialDelay:aA.arrowRepeatFreq);aK=false};s();aO=aP?"mouseout.jsp":"mouseup.jsp";aP=aP||b("html");aP.bind(aO,function(){aQ.removeClass("jspActive");aL&&clearTimeout(aL);aL=null;aP.unbind(aO)})}function q(){x();if(aB){ar.bind("mousedown.jsp",function(aP){if(aP.originalTarget===c||aP.originalTarget==aP.currentTarget){var aN=b(this),aQ=aN.offset(),aO=aP.pageY-aQ.top-J,aL,aK=true,s=function(){var aT=aN.offset(),aU=aP.pageY-aT.top-B/2,aR=w*aA.scrollPagePercent,aS=j*aR/(aa-w);if(aO<0){if(J-aS>aU){R.scrollByY(-aR)}else{W(aU)}}else{if(aO>0){if(J+aS<aU){R.scrollByY(aR)}else{W(aU)}}else{aM();return}}aL=setTimeout(s,aK?aA.initialDelay:aA.trackClickRepeatFreq);aK=false},aM=function(){aL&&clearTimeout(aL);aL=null;b(document).unbind("mouseup.jsp",aM)};s();b(document).bind("mouseup.jsp",aM);return false}})}if(aG){H.bind("mousedown.jsp",function(aP){if(aP.originalTarget===c||aP.originalTarget==aP.currentTarget){var aN=b(this),aQ=aN.offset(),aO=aP.pageX-aQ.left-ab,aL,aK=true,s=function(){var aT=aN.offset(),aU=aP.pageX-aT.left-av/2,aR=al*aA.scrollPagePercent,aS=k*aR/(U-al);if(aO<0){if(ab-aS>aU){R.scrollByX(-aR)}else{X(aU)}}else{if(aO>0){if(ab+aS<aU){R.scrollByX(aR)}else{X(aU)}}else{aM();return}}aL=setTimeout(s,aK?aA.initialDelay:aA.trackClickRepeatFreq);aK=false},aM=function(){aL&&clearTimeout(aL);aL=null;b(document).unbind("mouseup.jsp",aM)};s();b(document).bind("mouseup.jsp",aM);return false}})}}function x(){if(H){H.unbind("mousedown.jsp")}if(ar){ar.unbind("mousedown.jsp")}}function ay(){b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");if(aw){aw.removeClass("jspActive")}if(i){i.removeClass("jspActive")}}function W(s,aK){if(!aB){return}if(s<0){s=0}else{if(s>j){s=j}}if(aK===c){aK=aA.animateScroll}if(aK){R.animate(aw,"top",s,ae)}else{aw.css("top",s);ae(s)}}function ae(aK){if(aK===c){aK=aw.position().top}an.scrollTop(0);J=aK;var aN=J===0,aL=J==j,aM=aK/j,s=-aM*(aa-w);if(ak!=aN||aI!=aL){ak=aN;aI=aL;E.trigger("jsp-arrow-change",[ak,aI,Q,l])}v(aN,aL);Z.css("top",s);E.trigger("jsp-scroll-y",[-s,aN,aL]).trigger("scroll")}function X(aK,s){if(!aG){return
}if(aK<0){aK=0}else{if(aK>k){aK=k}}if(s===c){s=aA.animateScroll}if(s){R.animate(i,"left",aK,af)}else{i.css("left",aK);af(aK)}}function af(aK){if(aK===c){aK=i.position().left}an.scrollTop(0);ab=aK;var aN=ab===0,aM=ab==k,aL=aK/k,s=-aL*(U-al);if(Q!=aN||l!=aM){Q=aN;l=aM;E.trigger("jsp-arrow-change",[ak,aI,Q,l])}t(aN,aM);Z.css("left",s);E.trigger("jsp-scroll-x",[-s,aN,aM]).trigger("scroll")}function v(aK,s){if(aA.showArrows){at[aK?"addClass":"removeClass"]("jspDisabled");ag[s?"addClass":"removeClass"]("jspDisabled")}}function t(aK,s){if(aA.showArrows){az[aK?"addClass":"removeClass"]("jspDisabled");y[s?"addClass":"removeClass"]("jspDisabled")}}function N(s,aK){var aL=s/(aa-w);W(aL*j,aK)}function O(aK,s){var aL=aK/(U-al);X(aL*k,s)}function ac(aX,aS,aL){var aP,aM,aN,s=0,aW=0,aK,aR,aQ,aU,aT,aV;try{aP=b(aX)}catch(aO){return}aM=aP.outerHeight();aN=aP.outerWidth();an.scrollTop(0);an.scrollLeft(0);while(!aP.is(".jspPane")){s+=aP.position().top;aW+=aP.position().left;aP=aP.offsetParent();if(/^body|html$/i.test(aP[0].nodeName)){return}}aK=aC();aQ=aK+w;if(s<aK||aS){aT=s-aA.verticalGutter}else{if(s+aM>aQ){aT=s-w+aM+aA.verticalGutter}}if(aT){N(aT,aL)}aR=aE();aU=aR+al;if(aW<aR||aS){aV=aW-aA.horizontalGutter}else{if(aW+aN>aU){aV=aW-al+aN+aA.horizontalGutter}}if(aV){O(aV,aL)}}function aE(){return -Z.position().left}function aC(){return -Z.position().top}function L(){var s=aa-w;return(s>20)&&(s-aC()<10)}function C(){var s=U-al;return(s>20)&&(s-aE()<10)}function ah(){an.unbind(ad).bind(ad,function(aN,aO,aM,aK){var aL=ab,s=J;R.scrollBy(aM*aA.mouseWheelSpeed,-aK*aA.mouseWheelSpeed,false);return aL==ab&&s==J})}function o(){an.unbind(ad)}function aD(){return false}function K(){Z.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){ac(s.target,false)})}function F(){Z.find(":input,a").unbind("focus.jsp")}function T(){var s,aK,aM=[];aG&&aM.push(ao[0]);aB&&aM.push(V[0]);Z.focus(function(){E.focus()});E.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aP){if(aP.target!==this&&!(aM.length&&b(aP.target).closest(aM).length)){return}var aO=ab,aN=J;switch(aP.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aP.keyCode;aL();break;case 35:N(aa-w);s=null;break;case 36:N(0);s=null;break}aK=aP.keyCode==s&&aO!=ab||aN!=J;return !aK}).bind("keypress.jsp",function(aN){if(aN.keyCode==s){aL()}return !aK});if(aA.hideFocus){E.css("outline","none");if("hideFocus" in an[0]){E.attr("hideFocus",true)}}else{E.css("outline","");if("hideFocus" in an[0]){E.attr("hideFocus",false)}}function aL(){var aO=ab,aN=J;switch(s){case 40:R.scrollByY(aA.keyboardSpeed,false);break;case 38:R.scrollByY(-aA.keyboardSpeed,false);break;case 34:case 32:R.scrollByY(w*aA.scrollPagePercent,false);break;case 33:R.scrollByY(-w*aA.scrollPagePercent,false);break;case 39:R.scrollByX(aA.keyboardSpeed,false);break;case 37:R.scrollByX(-aA.keyboardSpeed,false);break}aK=aO!=ab||aN!=J;return aK}}function S(){E.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function D(){if(location.hash&&location.hash.length>1){var aL,aK;try{aL=b(location.hash)}catch(s){return}if(aL.length&&Z.find(location.hash)){if(an.scrollTop()===0){aK=setInterval(function(){if(an.scrollTop()>0){ac(location.hash,true);b(document).scrollTop(an.position().top);clearInterval(aK)}},50)}else{ac(location.hash,true);b(document).scrollTop(an.position().top)}}}}function aj(){b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function n(){aj();b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var s=this.href.split("#"),aK;if(s.length>1){aK=s[1];if(aK.length>0&&Z.find("#"+aK).length>0){ac("#"+aK,true);return false}}})}function ap(){var aL,aK,aN,aM,aO,s=false;an.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aP){var aQ=aP.originalEvent.touches[0];aL=aE();aK=aC();aN=aQ.pageX;aM=aQ.pageY;aO=false;s=true}).bind("touchmove.jsp",function(aS){if(!s){return}var aR=aS.originalEvent.touches[0],aQ=ab,aP=J;
R.scrollTo(aL+aN-aR.pageX,aK+aM-aR.pageY);aO=aO||Math.abs(aN-aR.pageX)>5||Math.abs(aM-aR.pageY)>5;return aQ==ab&&aP==J}).bind("touchend.jsp",function(aP){s=false}).bind("click.jsp-touchclick",function(aP){if(aO){aO=false;return false}})}function h(){var s=aC(),aK=aE();E.removeClass("jspScrollable").unbind(".jsp");E.replaceWith(aq.append(Z.children()));aq.scrollTop(s);aq.scrollLeft(aK)}b.extend(R,{reinitialise:function(aK){aK=b.extend({},aA,aK);au(aK)},scrollToElement:function(aL,aK,s){ac(aL,aK,s)},scrollTo:function(aL,s,aK){O(aL,aK);N(s,aK)},scrollToX:function(aK,s){O(aK,s)},scrollToY:function(s,aK){N(s,aK)},scrollToPercentX:function(aK,s){O(aK*(U-al),s)},scrollToPercentY:function(aK,s){N(aK*(aa-w),s)},scrollBy:function(aK,s,aL){R.scrollByX(aK,aL);R.scrollByY(s,aL)},scrollByX:function(s,aL){var aK=aE()+s,aM=aK/(U-al);X(aM*k,aL)},scrollByY:function(s,aL){var aK=aC()+s,aM=aK/(aa-w);W(aM*j,aL)},positionDragX:function(s,aK){X(s,aK)},positionDragY:function(aK,s){X(aK,s)},animate:function(aK,aN,s,aM){var aL={};aL[aN]=s;aK.animate(aL,{duration:aA.animateDuration,ease:aA.animateEase,queue:false,step:aM})},getContentPositionX:function(){return aE()},getContentPositionY:function(){return aC()},getContentWidth:function(){return U},getContentHeight:function(){return aa},getPercentScrolledX:function(){return aE()/(U-al)},getPercentScrolledY:function(){return aC()/(aa-w)},getIsScrollableH:function(){return aG},getIsScrollableV:function(){return aB},getContentPane:function(){return Z},scrollToBottom:function(s){W(j,s)},hijackInternalLinks:function(){n()},destroy:function(){h()}});au(P)}f=b.extend({},b.fn.jScrollPane.defaults,f);b.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){f[this]=f[this]||f.speed});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,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:c,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:0.8}})(jQuery,this);

View File

@ -1,78 +0,0 @@
/*! 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);

View File

@ -1,169 +0,0 @@
var audio;
var prev_audio;
var next_audio;
var utid;
$(function(){
$.extend($.fn.disableTextSelect = function() {
return this.each(function(){
if ($.browser.mozilla) {//Firefox
$(this).css('MozUserSelect','none');
} else if ($.browser.msie) {//IE
$(this).bind('selectstart',function(){return false;});
} else {//Opera, etc.
$(this).mousedown(function(){return false;});
}
});
});
$('#player .play').click(function(){
if (! audio) return;
audio.play();
utid = window.setTimeout(updatePlayer, 100);
$('#player .pause').show();
$('#player .play').hide();
}).disableTextSelect();
$('#player .pause').click(function(){
audio.pause();
clearTimeout(utid);
$('#player .pause').hide();
$('#player .play').show();
}).disableTextSelect();
$('.tracks .play').click(function(){
addToPlaylist(
$('h1.artist > span > span:first').html(),
$(this).parent().find('.track-name').html(),
Math.round($(this).parent().find('.duration').attr('data-length') / 1000),
$(this).parent().attr('id')
);
})
$('.album > h3.name > span.play').click(function(){
$(this).parent().parent().find('ul > li > span.play').click();
})
$('h1.artist > span > span.play').click(function(){
$('.album > ul > li > span.play').click();
})
$('#player .prev').click(function(){
playPrev();
}).disableTextSelect();
$('#player .next').click(function(){
playNext();
}).disableTextSelect();
$('#player .shuffle, #player .repeat').click(function(){
$(this).toggleClass('on');
setNext();
}).disableTextSelect();
$('#player .playlist').click(function(){
$('#playlist').toggle();
//$('#playlist').data('jsp').reinitialise();
})
$('#player .progress-bar').click(function(e){
if (typeof(audio) !== 'undefined' && typeof(audio.duration) !== 'undefined') {
desired_progress = Math.abs(e.pageX - $(this).offset().left) / $('#player .progress-bar').innerWidth();
audio.currentTime = Math.round(audio.duration * desired_progress);
}
})
$('#playlist').hide();
})
function updatePlayer() {
duration = audio.duration;
cur_time = audio.currentTime;
if (cur_time > 0 && cur_time == duration) {
playNext();
}
loaded = 0;
if ((audio.buffered != undefined) && (audio.buffered.length != 0)) {
loaded = Math.round((audio.buffered.end(0) / audio.duration) * 390);
$('#player .time-played').html(formatTime(cur_time));
$('#player .time-left').html(formatTime(duration - cur_time));
progress = Math.round((cur_time / duration) * 390);
$('#player .progress-loaded').css('width', loaded +'px')
$('#player .progress-point').css('margin-left', progress - $('#player .progress-point').width() +'px')
/* Starting buffering next track */
if (Math.round(cur_time / duration * 100) > 10) {
addAudio(next_audio);
}
}
utid = window.setTimeout(updatePlayer, 100);
}
function formatTime(sec) {
sec = Math.round(sec);
m = Math.floor(sec / 60);
s = sec - (m * 60);
return m +':'+ (s < 10 ? '0' : '') +s;
}
function playTrack(artist, track, id) {
switchAudio(id);
setNext();
$('#player .track-title').html(artist +' &mdash; '+ track);
$('#player .time-played').html('0:00');
$('#player .time-left').html('0:00');
$('#player .progress-loaded').css('width', '0px')
$('#player .progress-point').css('margin-left', '-6px')
$('#player .play').trigger('click');
}
function setPrev() {
if ($('#playlist ul.list li').length == 0) return false;
if (!audio) {
prev_audio = $(audio).attr('data-id');
}
}
function setNext() {
if ($('#playlist ul.list li').length == 0) return false;
if ($('#player .shuffle').hasClass('on')) {
next_audio = $('#playlist ul.list li').rand().attr('data-id');
}
if ($('#playlist ul.list li.now-playing').next().length == 0) {
if ($('#player .repeat').hasClass('on')) {
next_audio = $('#playlist ul.list li:first').attr('data-id');
}
} else {
next_audio = $('#playlist ul.list li.now-playing').next().attr('data-id');
}
}
function playPrev() {
return false;
}
function playNext() {
$('#playlist ul.list li[data-id="'+ next_audio +'"]').dblclick();
}
function addToPlaylist(artist, track, length, id) {
$('#playlist ul.list').append($(
'<li data-id="'+ id +'" title="Double-click To Play">'+
'<span class="artist">'+ artist +'</span> &mdash; '+
'<span class="track">'+ track +'</span>'+
'<span class="length" data-seconds="'+ length +'">'+ formatTime(length) +'</span>'+
'</li>'
));
$('#playlist ul.list li').disableTextSelect();
$('#playlist ul.list li[data-id="'+ id +'"]').dblclick(function(){
playTrack(artist, track, id);
$('#playlist li').removeClass('now-playing');
$(this).addClass('now-playing');
setNext();
})
if ($('#playlist ul.list li').length == 1) {
$('#playlist ul.list li:first').dblclick();
}
if ($('#playlist ul.list li').length > 6) {
$('#playlist').jScrollPane();
}
$('#player .playlist .count').html($('#playlist ul.list li').length);
setNext();
}
function addAudio(id) {
if ($('#audio_'+ id).length == 0) {
$('#audiobox').append('<audio id="audio_'+ id +'" src="" preload="preload"></audio>');
$('#audio_'+ id).attr('src', '/listen/'+ id +'.mp3');
}
}
function switchAudio(id) {
if (typeof(audio) != 'undefined' && audio.buffered.length != 0) {
console.log(audio, audio.buffered.length);
audio.pause();
audio.currentTime = 0;
}
if ($('#audio_'+ id).length == 0) {
addAudio(id);
}
audio = document.getElementById('audio_'+ id);
}

View File

@ -1,184 +0,0 @@
body, h1, h2, h3, h4, form, ul, li {
margin: 0;
padding: 0;
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
#contents {
width: 750px;
margin: 0 0 0 -375px;
left: 50%;
position: relative;
/* background-color: #EEE;*/
}
.inner-1 {
/* margin: 2em;*/
}
h1.artist {
display: block;
width: 100%;
text-align: center;
margin: 75px 0 0.5em 0;
font-size: 3em;
}
h1.artist > span {
width: auto;
}
.album {
width: 100%;
clear: both;
}
.album .pic {
width: 250px;
height: 250px;
background-color: #DDD;
float: left;
margin: 0 20px 1em 0;
}
.album .name {
display: block;
float: left;
width: 480px;
font-size: 1.5em;
margin: 0 0 0.5em 0;
/* background-color: yellowgreen;*/
}
.album .name span{
float: left;
width: auto;
}
.album .tracks {
display: block;
float: left;
width: 480px;
margin-bottom: 1em;
/* background-color: lightblue;*/
}
.album .tracks li {
display: block;
float: left;
width: 100%;
line-height: 30px;
margin: 0 0 0.2em 0;
}
.album .tracks li .duration {
font-size: 0.5em;
display: block;
float: right;
}
span.play {
display: block;
float: left;
width: 20px;
height: 20px;
border-radius: 20px;
background-color: #081;
margin: 0.4em 0.3em 0 0;
cursor: pointer;
line-height: 18px;
}
span.play img {
width: 10px;
height: 10px;
margin: 0 0 0 5px;
}
span.play.disabled {
background-color: #810;
}
.album h3.name span.play {
display: block;
width: 20px;
line-height: 11px;
margin: 0.2em 0 0 0.2em;
background-color: #04A;
}
h1.artist > span > span.play {
display: inline-block;
float: none;
width: 28px;
height: 28px;
line-height: 20px;
margin: 0;
background-color: #04A;
}
h1.artist > span > span.play img {
margin: 10px 0 20px 0;
}
.search {
width: 100%;
text-align: center;
margin-top: 200px;
}
.search #name {
width: 300px;
border: #AAA 3px solid;
border-radius: 7px;
font-size: 1.5em;
padding: 0.2em;
}
#nav {
position: fixed;
z-index: 6;
top: 0;
left: 50%;
margin-left: -375px;
width: 750px;
height: 25px;
background-color: #000;
border-bottom: #222 1px solid;
}
#nav ul {
margin: 0 5px;
padding: 0;
list-style: none;
}
#nav ul li {
display: inline-block;
width: auto;
margin: 0 5px;
}
#nav ul li a {
color: #CCC;
line-height: 25px;
font-size: 12px;
text-decoration: none;
font-weight: bold;
}
#nav ul li a:hover {
color: #DDD;
}
.corner-fix {
position: fixed;
z-index: 4;
width: 8px;
height: 8px;
background-color: #000;
top: 25px;
left: 50%;
}
.corner-fix.left {
margin-left: -375px;
}
.corner-fix.right {
margin-left: 367px;
}

View File

@ -1,113 +0,0 @@
/*
* 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: 10px;
height: 100%;
background: red;
}
.jspHorizontalBar
{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 16px;
background: red;
}
.jspVerticalBar *,
.jspHorizontalBar *
{
margin: 0;
padding: 0;
}
.jspCap
{
display: none;
}
.jspHorizontalBar .jspCap
{
float: left;
}
.jspTrack
{
background: #111;
position: relative;
}
.jspDrag
{
background: #555;
position: relative;
top: 0;
left: 0;
cursor: default;
}
.jspHorizontalBar .jspTrack,
.jspHorizontalBar .jspDrag
{
float: left;
height: 100%;
}
.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;
}

View File

@ -1,199 +0,0 @@
audio {
width: 0;
height: 0;
position: absolute;
top: -1000px;
left: -1000px;
}
#player {
position: fixed;
z-index: 5;
width: 750px;
height: 50px;
left: 50%;
top: 25px;
margin-left: -375px;
background-color: #000;
font-size: 12px;
border-radius: 8px;
}
#player .prev, #player .next, #player .play, #player .pause {
float: left;
color: #AAA;
background-color: #222;
cursor: pointer;
}
#player .prev, #player .next {
width: 30px;
height: 30px;
margin: 10px 0;
border-radius: 40px;
}
#player .prev img, #player .next img {
width: 14px;
height: 14px;
}
#player .prev img {
margin: 8px 0 0 7px;
}
#player .next img {
margin: 8px 0 0 9px;
}
#player .play, #player .pause {
width: 40px;
height: 40px;
margin: 5px;
border-radius: 40px;
}
#player .play img {
width: 16px;
height: 16px;
margin: 12px 0 0 14px;
}
#player .pause img {
width: 16px;
height: 16px;
margin: 12px 0 0 12px;
}
#player .prev {
margin-left: 20px;
}
#player .next {
margin-right: 6px;
}
#player .time-played, #player .time-left {
float: left;
height: 50px;
width: 50px;
color: #AAA;
margin-right: 2px;
text-align: center;
line-height: 50px;
}
#player .progress {
float: left;
margin-top: 25px;
height: 25px;
width: 400px;
}
#player .track-title {
float: left;
width: 390px;
height: 25px;
margin-left: 5px;
margin-top: -25px;
color: #DDD;
line-height: 30px;
}
#player .progress-bar {
float: left;
margin: 11px 5px;
background-color: #013;
width: 390px;
height: 3px;
}
#player .progress-bar:hover {
cursor: pointer;
}
#player .progress-loaded {
float: left;
width: 0;
height: 3px;
background-color: #05A;
}
#player .progress-point {
float: left;
width: 6px;
height: 6px;
background-color: #013;
margin-top: -4px;
margin-left: -6px;
border: #FFF 3px solid;
border-radius: 6px;
cursor: pointer;
}
#player .shuffle, #player .repeat, #player .playlist {
float: left;
cursor: pointer;
}
#player .shuffle {
margin: 17px 0 0 0;
}
#player .shuffle img {
width: 20px;
}
#player .repeat {
margin: 17px 0 0 12px;
}
#player .repeat img {
width: 20px;
}
#player .playlist {
margin: 12px 0 0 12px;
}
#player .playlist img {
width: 20px;
}
#player .playlist .count {
color: #DDD;
font-size: 9px;
width: auto;
float: right;
margin: -33px 0 0 2px;
}
#player .shuffle, #player .repeat {
opacity: 0.5;
-moz-opacity: 0.5;
-khtml-opacity: 0.5;
-webkit-opacity: 0.5;
filter:alpha(opacity=50);
}
#player .shuffle.on, #player .repeat.on {
opacity: 1;
-moz-opacity: 1;
-khtml-opacity: 1;
-webkit-opacity: 1;
filter:alpha(opacity=100);
}
#playlist {
position: fixed;
z-index: 5;
top: 75px;
left: 50%;
width: 734px;
margin-left: -367px;
background-color: #000;
opacity: 0.9;
-moz-opacity: 0.9;
-khtml-opacity: 0.9;
-webkit-opacity: 0.9;
filter:alpha(opacity=90);
overflow-y: auto;
max-height: 10em;
}
#playlist ul {
margin: 0.2em 0.3em;
padding: 0;
position: relative;
}
#playlist ul li {
margin: 0;
padding: 0.4em 0;
display: block;
width: 100%;
font-size: 0.75em;
color: #FFF;
}
#playlist ul li:hover {
background-color: #050505;
cursor: default;
}
#playlist ul li.now-playing {
background-color: #013;
font-weight: bold;
}
#playlist ul li .length {
margin: 0 0.5em;
color: #AAA;
}

View File

@ -1,54 +0,0 @@
#registration {
position: fixed;
top: 50%;
left: 50%;
margin: -145px 0 0 -195px;
padding: 20px;
width: 350px;
height: 250px;
background-color: #FFF;
}
#registration h1 {
width: 100%;
text-align: center;
font-size: 28px;
font-weight: normal;
margin: 0 0 30px 0;
}
#registration label {
display: block;
float: left;
width: 100px;
font-size: 20px;
line-height: 35px;
}
#registration input[type="email"], input[type="password"], input[type="text"] {
width: 230px;
font-size: 20px;
border: #EAEAEA 1px solid;
background-color: #FCFCFC;
padding: 5px;
}
#registration input[type="submit"] {
color: #FFF;
border: #EAEAEA 1px solid;
background-color: #05A;
font-size: 25px;
padding: 10px;
cursor: pointer;
}
#registration .complete {
width: 100%;
text-align: center;
margin-top: 20px;
}
#email_error, #password_error, #password_c_error {
float: right;
color: #E30;
width: 350px;
height: 30px;
margin: 4px -350px 0 0;
line-height: 30px;
font-size: 15px;
}

View File

@ -1,35 +0,0 @@
.autocomplete-w1 {
background: url(../images/shadow.png) no-repeat bottom right;
position: absolute;
top: 0px;
left: 0px;
margin: 8px 0 0 6px;
/* IE6 fix: */
_background: none;
_margin: 0;
}
.autocomplete {
border:1px solid #999;
background:#FFF;
cursor:default;
text-align:left;
max-height:350px;
overflow:auto;
margin:-6px 6px 6px -6px;
/* IE6 specific: */
_height: 350px;
_margin: 0;
_overflow-x: hidden;
}
.autocomplete .selected {
background: #F0F0F0;
}
.autocomplete div {
padding: 2px 5px;
white-space: nowrap;
}
.autocomplete strong {
font-weight: normal;
color: #3399FF;
}

View File

@ -1 +0,0 @@
/Users/chez/Sites/vkapi_test.html