crowdblog 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.rvmrc +1 -0
- data/.simplecov +13 -0
- data/Gemfile +35 -0
- data/Gemfile.lock +291 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +32 -0
- data/app/assets/images/crowdblog/.gitkeep +0 -0
- data/app/assets/images/crowdblog/logo.png +0 -0
- data/app/assets/javascripts/crowdblog/models/post.js.coffee +11 -0
- data/app/assets/javascripts/crowdblog/posts_main.js.coffee +42 -0
- data/app/assets/javascripts/crowdblog/templates/posts/attachment.jst.eco +1 -0
- data/app/assets/javascripts/crowdblog/templates/posts/edit.jst.eco +38 -0
- data/app/assets/javascripts/crowdblog/templates/posts/index.jst.eco +17 -0
- data/app/assets/javascripts/crowdblog/templates/posts/post.jst.eco +27 -0
- data/app/assets/javascripts/crowdblog/views/posts/attachment_view.js.coffee +8 -0
- data/app/assets/javascripts/crowdblog/views/posts/edit_post_view.js.coffee +41 -0
- data/app/assets/javascripts/crowdblog/views/posts/index.js.coffee +28 -0
- data/app/assets/javascripts/crowdblog/views/posts/post_view.js.coffee +40 -0
- data/app/assets/javascripts/crowdblog/xhr_fix.js.coffee +4 -0
- data/app/assets/javascripts/crowdblog.js +16 -0
- data/app/assets/stylesheets/crowdblog/posts.css.scss +3 -0
- data/app/assets/stylesheets/crowdblog.css +7 -0
- data/app/controllers/crowdblog/application_controller.rb +16 -0
- data/app/controllers/crowdblog/assets_controller.rb +14 -0
- data/app/controllers/crowdblog/authors_controller.rb +9 -0
- data/app/controllers/crowdblog/posts_controller.rb +48 -0
- data/app/controllers/crowdblog/sessions_controller.rb +25 -0
- data/app/controllers/crowdblog/users/omniauth_callbacks_controller.rb +21 -0
- data/app/helpers/crowdblog/application_helper.rb +4 -0
- data/app/models/crowdblog/asset.rb +8 -0
- data/app/models/crowdblog/post.rb +121 -0
- data/app/models/crowdblog/user.rb +32 -0
- data/app/sweepers/post_sweeper.rb +5 -0
- data/app/uploaders/attachment_uploader.rb +48 -0
- data/app/views/crowdblog/authors/index.html.slim +18 -0
- data/app/views/crowdblog/posts/index.html.slim +13 -0
- data/app/views/layouts/crowdblog/application.html.slim +25 -0
- data/config/cucumber.yml +8 -0
- data/config/routes.rb +14 -0
- data/crowdblog.gemspec +46 -0
- data/db/migrate/20120215232711_create_users.rb +10 -0
- data/db/migrate/20120216154516_add_devise_to_users.rb +56 -0
- data/db/migrate/20120217213920_create_posts.rb +13 -0
- data/db/migrate/20120219014520_add_author_to_posts.rb +6 -0
- data/db/migrate/20120219040607_add_state_to_post.rb +7 -0
- data/db/migrate/20120219071614_create_assets.rb +10 -0
- data/db/migrate/20120219234253_add_alias_to_users.rb +6 -0
- data/db/migrate/20120220033923_create_vestal_versions.rb +28 -0
- data/features/posts/manage_posts.feature +46 -0
- data/features/step_definitions/index_steps.rb +16 -0
- data/features/step_definitions/interaction_steps.rb +26 -0
- data/features/step_definitions/posts_steps.rb +35 -0
- data/features/step_definitions/session_steps.rb +15 -0
- data/features/support/env.rb +69 -0
- data/lib/crowdblog/engine.rb +5 -0
- data/lib/crowdblog/version.rb +3 -0
- data/lib/crowdblog.rb +4 -0
- data/lib/tasks/crowdblog_tasks.rake +4 -0
- data/script/build +29 -0
- data/script/cucumber +10 -0
- data/script/rails +8 -0
- data/spec/dummy/.rvmrc +1 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +16 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +62 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/carrierwave.rb +18 -0
- data/spec/dummy/config/initializers/devise.rb +230 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +6 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/schema.rb +76 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/lib/tasks/cucumber.rake +65 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/helpers/application_helper_spec.rb +4 -0
- data/spec/models/post_spec.rb +94 -0
- data/spec/spec_helper.rb +39 -0
- data/vendor/assets/javascripts/jquery.uploadify.js +296 -0
- data/vendor/assets/javascripts/swfobject.js +4 -0
- metadata +428 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
|
2
|
+
# It is recommended to regenerate this file in the future when you upgrade to a
|
|
3
|
+
# newer version of cucumber-rails. Consider adding your own code to a new file
|
|
4
|
+
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
|
5
|
+
# files.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
|
|
9
|
+
|
|
10
|
+
vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
|
|
11
|
+
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
|
|
12
|
+
|
|
13
|
+
begin
|
|
14
|
+
require 'cucumber/rake/task'
|
|
15
|
+
|
|
16
|
+
namespace :cucumber do
|
|
17
|
+
Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
|
|
18
|
+
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
|
|
19
|
+
t.fork = true # You may get faster startup if you set this to false
|
|
20
|
+
t.profile = 'default'
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
|
|
24
|
+
t.binary = vendored_cucumber_bin
|
|
25
|
+
t.fork = true # You may get faster startup if you set this to false
|
|
26
|
+
t.profile = 'wip'
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
|
|
30
|
+
t.binary = vendored_cucumber_bin
|
|
31
|
+
t.fork = true # You may get faster startup if you set this to false
|
|
32
|
+
t.profile = 'rerun'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
desc 'Run all features'
|
|
36
|
+
task :all => [:ok, :wip]
|
|
37
|
+
|
|
38
|
+
task :statsetup do
|
|
39
|
+
require 'rails/code_statistics'
|
|
40
|
+
::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
|
|
41
|
+
::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
desc 'Alias for cucumber:ok'
|
|
45
|
+
task :cucumber => 'cucumber:ok'
|
|
46
|
+
|
|
47
|
+
task :default => :cucumber
|
|
48
|
+
|
|
49
|
+
task :features => :cucumber do
|
|
50
|
+
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# In case we don't have ActiveRecord, append a no-op task that we can depend upon.
|
|
54
|
+
task 'db:test:prepare' do
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
task :stats => 'cucumber:statsetup'
|
|
58
|
+
rescue LoadError
|
|
59
|
+
desc 'cucumber rake task not available (cucumber not installed)'
|
|
60
|
+
task :cucumber do
|
|
61
|
+
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
end
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
|
7
|
+
div.dialog {
|
|
8
|
+
width: 25em;
|
|
9
|
+
padding: 0 4em;
|
|
10
|
+
margin: 4em auto 0 auto;
|
|
11
|
+
border: 1px solid #ccc;
|
|
12
|
+
border-right-color: #999;
|
|
13
|
+
border-bottom-color: #999;
|
|
14
|
+
}
|
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<!-- This file lives in public/404.html -->
|
|
21
|
+
<div class="dialog">
|
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
|
24
|
+
</div>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
|
7
|
+
div.dialog {
|
|
8
|
+
width: 25em;
|
|
9
|
+
padding: 0 4em;
|
|
10
|
+
margin: 4em auto 0 auto;
|
|
11
|
+
border: 1px solid #ccc;
|
|
12
|
+
border-right-color: #999;
|
|
13
|
+
border-bottom-color: #999;
|
|
14
|
+
}
|
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<!-- This file lives in public/422.html -->
|
|
21
|
+
<div class="dialog">
|
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
|
24
|
+
</div>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
|
7
|
+
div.dialog {
|
|
8
|
+
width: 25em;
|
|
9
|
+
padding: 0 4em;
|
|
10
|
+
margin: 4em auto 0 auto;
|
|
11
|
+
border: 1px solid #ccc;
|
|
12
|
+
border-right-color: #999;
|
|
13
|
+
border-bottom-color: #999;
|
|
14
|
+
}
|
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<!-- This file lives in public/500.html -->
|
|
21
|
+
<div class="dialog">
|
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
|
23
|
+
</div>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
|
3
|
+
|
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
|
6
|
+
require 'rails/commands'
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Crowdblog::Post do
|
|
4
|
+
describe "#regenerate_permalink" do
|
|
5
|
+
it "generates the permalink based on the post title" do
|
|
6
|
+
subject.title = 'A big long post title'
|
|
7
|
+
subject.regenerate_permalink
|
|
8
|
+
subject.permalink.should == 'a-big-long-post-title'
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
describe "#allowed_to_update_permalink?" do
|
|
13
|
+
context "post is published" do
|
|
14
|
+
before do
|
|
15
|
+
subject.state = 'published'
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "returns false" do
|
|
19
|
+
subject.allowed_to_update_permalink?.should be_false
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
context "post is not published" do
|
|
24
|
+
before do
|
|
25
|
+
subject.state = 'draft'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it "returns true" do
|
|
29
|
+
subject.allowed_to_update_permalink?.should be_true
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
describe "#formatted_published_date" do
|
|
35
|
+
it "Formats the published_at date" do
|
|
36
|
+
subject.published_at = Time.at(1329619863)
|
|
37
|
+
subject.formatted_published_date.should == 'Feb 18, 2012'
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
describe "#publish_if_allowed" do
|
|
42
|
+
let(:user) { Crowdblog::User.new }
|
|
43
|
+
context "user is publisher" do
|
|
44
|
+
before do
|
|
45
|
+
user.is_publisher = true
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
it "changes its state" do
|
|
49
|
+
subject.should_receive('publish')
|
|
50
|
+
subject.publish_if_allowed('publish', user)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
it "sets the user as publisher" do
|
|
54
|
+
subject.publish_if_allowed('publish', user)
|
|
55
|
+
subject.publisher.should be(user)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
context "user is not publisher" do
|
|
60
|
+
before do
|
|
61
|
+
user.is_publisher = false
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
it "does not change its state" do
|
|
65
|
+
subject.should_not_receive('publish')
|
|
66
|
+
subject.publish_if_allowed('publish', user)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
describe "#month" do
|
|
72
|
+
context "published at in february" do
|
|
73
|
+
before do
|
|
74
|
+
subject.published_at = stub(:month => 2)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
it "returns 02" do
|
|
78
|
+
subject.month.should == "02"
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
describe "#day" do
|
|
84
|
+
context "published at in february" do
|
|
85
|
+
before do
|
|
86
|
+
subject.published_at = stub(:day => 2)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
it "returns 02" do
|
|
90
|
+
subject.day.should == "02"
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require 'simplecov'
|
|
2
|
+
|
|
3
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
|
4
|
+
ENV["RAILS_ENV"] ||= 'test'
|
|
5
|
+
require File.expand_path("../dummy/config/environment", __FILE__)
|
|
6
|
+
require 'rspec/rails'
|
|
7
|
+
require 'rspec/autorun'
|
|
8
|
+
|
|
9
|
+
ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
|
|
10
|
+
|
|
11
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
|
12
|
+
# in spec/support/ and its subdirectories.
|
|
13
|
+
Dir[File.join(ENGINE_RAILS_ROOT, 'spec/support/**/*.rb')].each {|f| require f }
|
|
14
|
+
|
|
15
|
+
RSpec.configure do |config|
|
|
16
|
+
# ## Mock Framework
|
|
17
|
+
#
|
|
18
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
|
19
|
+
#
|
|
20
|
+
# config.mock_with :mocha
|
|
21
|
+
# config.mock_with :flexmock
|
|
22
|
+
# config.mock_with :rr
|
|
23
|
+
|
|
24
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
|
25
|
+
config.fixture_path = "#{ENGINE_RAILS_ROOT}/spec/fixtures"
|
|
26
|
+
|
|
27
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
|
28
|
+
# examples within a transaction, remove the following line or assign false
|
|
29
|
+
# instead of true.
|
|
30
|
+
config.use_transactional_fixtures = true
|
|
31
|
+
|
|
32
|
+
# If true, the base class of anonymous controllers will be inferred
|
|
33
|
+
# automatically. This will be the default behavior in future versions of
|
|
34
|
+
# rspec-rails.
|
|
35
|
+
config.infer_base_class_for_anonymous_controllers = false
|
|
36
|
+
|
|
37
|
+
# Include Engine routes (needed for Controller specs)
|
|
38
|
+
config.include Crowdblog::Engine.routes.url_helpers
|
|
39
|
+
end
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Uploadify v2.1.4
|
|
3
|
+
Release Date: November 8, 2010
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2010 Ronnie Garcia, Travis Nickels
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in
|
|
15
|
+
all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
THE SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
if(jQuery)(
|
|
27
|
+
function(jQuery){
|
|
28
|
+
jQuery.extend(jQuery.fn,{
|
|
29
|
+
uploadify:function(options) {
|
|
30
|
+
jQuery(this).each(function(){
|
|
31
|
+
var settings = jQuery.extend({
|
|
32
|
+
id : jQuery(this).attr('id'), // The ID of the object being Uploadified
|
|
33
|
+
uploader : 'uploadify.swf', // The path to the uploadify swf file
|
|
34
|
+
script : 'uploadify.php', // The path to the uploadify backend upload script
|
|
35
|
+
expressInstall : null, // The path to the express install swf file
|
|
36
|
+
folder : '', // The path to the upload folder
|
|
37
|
+
height : 30, // The height of the flash button
|
|
38
|
+
width : 120, // The width of the flash button
|
|
39
|
+
cancelImg : 'cancel.png', // The path to the cancel image for the default file queue item container
|
|
40
|
+
wmode : 'opaque', // The wmode of the flash file
|
|
41
|
+
scriptAccess : 'sameDomain', // Set to "always" to allow script access across domains
|
|
42
|
+
fileDataName : 'Filedata', // The name of the file collection object in the backend upload script
|
|
43
|
+
method : 'POST', // The method for sending variables to the backend upload script
|
|
44
|
+
queueSizeLimit : 999, // The maximum size of the file queue
|
|
45
|
+
simUploadLimit : 1, // The number of simultaneous uploads allowed
|
|
46
|
+
queueID : false, // The optional ID of the queue container
|
|
47
|
+
displayData : 'percentage', // Set to "speed" to show the upload speed in the default queue item
|
|
48
|
+
removeCompleted : true, // Set to true if you want the queue items to be removed when a file is done uploading
|
|
49
|
+
onInit : function() {}, // Function to run when uploadify is initialized
|
|
50
|
+
onSelect : function() {}, // Function to run when a file is selected
|
|
51
|
+
onSelectOnce : function() {}, // Function to run once when files are added to the queue
|
|
52
|
+
onQueueFull : function() {}, // Function to run when the queue reaches capacity
|
|
53
|
+
onCheck : function() {}, // Function to run when script checks for duplicate files on the server
|
|
54
|
+
onCancel : function() {}, // Function to run when an item is cleared from the queue
|
|
55
|
+
onClearQueue : function() {}, // Function to run when the queue is manually cleared
|
|
56
|
+
onError : function() {}, // Function to run when an upload item returns an error
|
|
57
|
+
onProgress : function() {}, // Function to run each time the upload progress is updated
|
|
58
|
+
onComplete : function() {}, // Function to run when an upload is completed
|
|
59
|
+
onAllComplete : function() {} // Function to run when all uploads are completed
|
|
60
|
+
}, options);
|
|
61
|
+
jQuery(this).data('settings',settings);
|
|
62
|
+
var pagePath = location.pathname;
|
|
63
|
+
pagePath = pagePath.split('/');
|
|
64
|
+
pagePath.pop();
|
|
65
|
+
pagePath = pagePath.join('/') + '/';
|
|
66
|
+
var data = {};
|
|
67
|
+
data.uploadifyID = settings.id;
|
|
68
|
+
data.pagepath = pagePath;
|
|
69
|
+
if (settings.buttonImg) data.buttonImg = escape(settings.buttonImg);
|
|
70
|
+
if (settings.buttonText) data.buttonText = escape(settings.buttonText);
|
|
71
|
+
if (settings.rollover) data.rollover = true;
|
|
72
|
+
data.script = settings.script;
|
|
73
|
+
data.folder = escape(settings.folder);
|
|
74
|
+
if (settings.scriptData) {
|
|
75
|
+
var scriptDataString = '';
|
|
76
|
+
for (var name in settings.scriptData) {
|
|
77
|
+
scriptDataString += '&' + name + '=' + settings.scriptData[name];
|
|
78
|
+
}
|
|
79
|
+
data.scriptData = escape(scriptDataString.substr(1));
|
|
80
|
+
}
|
|
81
|
+
data.width = settings.width;
|
|
82
|
+
data.height = settings.height;
|
|
83
|
+
data.wmode = settings.wmode;
|
|
84
|
+
data.method = settings.method;
|
|
85
|
+
data.queueSizeLimit = settings.queueSizeLimit;
|
|
86
|
+
data.simUploadLimit = settings.simUploadLimit;
|
|
87
|
+
if (settings.hideButton) data.hideButton = true;
|
|
88
|
+
if (settings.fileDesc) data.fileDesc = settings.fileDesc;
|
|
89
|
+
if (settings.fileExt) data.fileExt = settings.fileExt;
|
|
90
|
+
if (settings.multi) data.multi = true;
|
|
91
|
+
if (settings.auto) data.auto = true;
|
|
92
|
+
if (settings.sizeLimit) data.sizeLimit = settings.sizeLimit;
|
|
93
|
+
if (settings.checkScript) data.checkScript = settings.checkScript;
|
|
94
|
+
if (settings.fileDataName) data.fileDataName = settings.fileDataName;
|
|
95
|
+
if (settings.queueID) data.queueID = settings.queueID;
|
|
96
|
+
if (settings.onInit() !== false) {
|
|
97
|
+
jQuery(this).css('display','none');
|
|
98
|
+
jQuery(this).after('<div id="' + jQuery(this).attr('id') + 'Uploader"></div>');
|
|
99
|
+
swfobject.embedSWF(settings.uploader, settings.id + 'Uploader', settings.width, settings.height, '9.0.24', settings.expressInstall, data, {'quality':'high','wmode':settings.wmode,'allowScriptAccess':settings.scriptAccess},{},function(event) {
|
|
100
|
+
if (typeof(settings.onSWFReady) == 'function' && event.success) settings.onSWFReady();
|
|
101
|
+
});
|
|
102
|
+
if (settings.queueID == false) {
|
|
103
|
+
jQuery("#" + jQuery(this).attr('id') + "Uploader").after('<div id="' + jQuery(this).attr('id') + 'Queue" class="uploadifyQueue"></div>');
|
|
104
|
+
} else {
|
|
105
|
+
jQuery("#" + settings.queueID).addClass('uploadifyQueue');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (typeof(settings.onOpen) == 'function') {
|
|
109
|
+
jQuery(this).bind("uploadifyOpen", settings.onOpen);
|
|
110
|
+
}
|
|
111
|
+
jQuery(this).bind("uploadifySelect", {'action': settings.onSelect, 'queueID': settings.queueID}, function(event, ID, fileObj) {
|
|
112
|
+
if (event.data.action(event, ID, fileObj) !== false) {
|
|
113
|
+
var byteSize = Math.round(fileObj.size / 1024 * 100) * .01;
|
|
114
|
+
var suffix = 'KB';
|
|
115
|
+
if (byteSize > 1000) {
|
|
116
|
+
byteSize = Math.round(byteSize *.001 * 100) * .01;
|
|
117
|
+
suffix = 'MB';
|
|
118
|
+
}
|
|
119
|
+
var sizeParts = byteSize.toString().split('.');
|
|
120
|
+
if (sizeParts.length > 1) {
|
|
121
|
+
byteSize = sizeParts[0] + '.' + sizeParts[1].substr(0,2);
|
|
122
|
+
} else {
|
|
123
|
+
byteSize = sizeParts[0];
|
|
124
|
+
}
|
|
125
|
+
if (fileObj.name.length > 20) {
|
|
126
|
+
fileName = fileObj.name.substr(0,20) + '...';
|
|
127
|
+
} else {
|
|
128
|
+
fileName = fileObj.name;
|
|
129
|
+
}
|
|
130
|
+
queue = '#' + jQuery(this).attr('id') + 'Queue';
|
|
131
|
+
if (event.data.queueID) {
|
|
132
|
+
queue = '#' + event.data.queueID;
|
|
133
|
+
}
|
|
134
|
+
jQuery(queue).append('<div id="' + jQuery(this).attr('id') + ID + '" class="uploadifyQueueItem">\
|
|
135
|
+
<div class="cancel">\
|
|
136
|
+
<a href="javascript:jQuery(\'#' + jQuery(this).attr('id') + '\').uploadifyCancel(\'' + ID + '\')"><img src="' + settings.cancelImg + '" border="0" /></a>\
|
|
137
|
+
</div>\
|
|
138
|
+
<span class="fileName">' + fileName + ' (' + byteSize + suffix + ')</span><span class="percentage"></span>\
|
|
139
|
+
<div class="uploadifyProgress">\
|
|
140
|
+
<div id="' + jQuery(this).attr('id') + ID + 'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div>\
|
|
141
|
+
</div>\
|
|
142
|
+
</div>');
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
jQuery(this).bind("uploadifySelectOnce", {'action': settings.onSelectOnce}, function(event, data) {
|
|
146
|
+
event.data.action(event, data);
|
|
147
|
+
if (settings.auto) {
|
|
148
|
+
if (settings.checkScript) {
|
|
149
|
+
jQuery(this).uploadifyUpload(null, false);
|
|
150
|
+
} else {
|
|
151
|
+
jQuery(this).uploadifyUpload(null, true);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
jQuery(this).bind("uploadifyQueueFull", {'action': settings.onQueueFull}, function(event, queueSizeLimit) {
|
|
156
|
+
if (event.data.action(event, queueSizeLimit) !== false) {
|
|
157
|
+
alert('The queue is full. The max size is ' + queueSizeLimit + '.');
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
jQuery(this).bind("uploadifyCheckExist", {'action': settings.onCheck}, function(event, checkScript, fileQueueObj, folder, single) {
|
|
161
|
+
var postData = new Object();
|
|
162
|
+
postData = fileQueueObj;
|
|
163
|
+
postData.folder = (folder.substr(0,1) == '/') ? folder : pagePath + folder;
|
|
164
|
+
if (single) {
|
|
165
|
+
for (var ID in fileQueueObj) {
|
|
166
|
+
var singleFileID = ID;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
jQuery.post(checkScript, postData, function(data) {
|
|
170
|
+
for(var key in data) {
|
|
171
|
+
if (event.data.action(event, data, key) !== false) {
|
|
172
|
+
var replaceFile = confirm("Do you want to replace the file " + data[key] + "?");
|
|
173
|
+
if (!replaceFile) {
|
|
174
|
+
document.getElementById(jQuery(event.target).attr('id') + 'Uploader').cancelFileUpload(key,true,true);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (single) {
|
|
179
|
+
document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(singleFileID, true);
|
|
180
|
+
} else {
|
|
181
|
+
document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(null, true);
|
|
182
|
+
}
|
|
183
|
+
}, "json");
|
|
184
|
+
});
|
|
185
|
+
jQuery(this).bind("uploadifyCancel", {'action': settings.onCancel}, function(event, ID, fileObj, data, remove, clearFast) {
|
|
186
|
+
if (event.data.action(event, ID, fileObj, data, clearFast) !== false) {
|
|
187
|
+
if (remove) {
|
|
188
|
+
var fadeSpeed = (clearFast == true) ? 0 : 250;
|
|
189
|
+
jQuery("#" + jQuery(this).attr('id') + ID).fadeOut(fadeSpeed, function() { jQuery(this).remove() });
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
jQuery(this).bind("uploadifyClearQueue", {'action': settings.onClearQueue}, function(event, clearFast) {
|
|
194
|
+
var queueID = (settings.queueID) ? settings.queueID : jQuery(this).attr('id') + 'Queue';
|
|
195
|
+
if (clearFast) {
|
|
196
|
+
jQuery("#" + queueID).find('.uploadifyQueueItem').remove();
|
|
197
|
+
}
|
|
198
|
+
if (event.data.action(event, clearFast) !== false) {
|
|
199
|
+
jQuery("#" + queueID).find('.uploadifyQueueItem').each(function() {
|
|
200
|
+
var index = jQuery('.uploadifyQueueItem').index(this);
|
|
201
|
+
jQuery(this).delay(index * 100).fadeOut(250, function() { jQuery(this).remove() });
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
var errorArray = [];
|
|
206
|
+
jQuery(this).bind("uploadifyError", {'action': settings.onError}, function(event, ID, fileObj, errorObj) {
|
|
207
|
+
if (event.data.action(event, ID, fileObj, errorObj) !== false) {
|
|
208
|
+
var fileArray = new Array(ID, fileObj, errorObj);
|
|
209
|
+
errorArray.push(fileArray);
|
|
210
|
+
jQuery("#" + jQuery(this).attr('id') + ID).find('.percentage').text(" - " + errorObj.type + " Error");
|
|
211
|
+
jQuery("#" + jQuery(this).attr('id') + ID).find('.uploadifyProgress').hide();
|
|
212
|
+
jQuery("#" + jQuery(this).attr('id') + ID).addClass('uploadifyError');
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
if (typeof(settings.onUpload) == 'function') {
|
|
216
|
+
jQuery(this).bind("uploadifyUpload", settings.onUpload);
|
|
217
|
+
}
|
|
218
|
+
jQuery(this).bind("uploadifyProgress", {'action': settings.onProgress, 'toDisplay': settings.displayData}, function(event, ID, fileObj, data) {
|
|
219
|
+
if (event.data.action(event, ID, fileObj, data) !== false) {
|
|
220
|
+
jQuery("#" + jQuery(this).attr('id') + ID + "ProgressBar").animate({'width': data.percentage + '%'},250,function() {
|
|
221
|
+
if (data.percentage == 100) {
|
|
222
|
+
jQuery(this).closest('.uploadifyProgress').fadeOut(250,function() {jQuery(this).remove()});
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
if (event.data.toDisplay == 'percentage') displayData = ' - ' + data.percentage + '%';
|
|
226
|
+
if (event.data.toDisplay == 'speed') displayData = ' - ' + data.speed + 'KB/s';
|
|
227
|
+
if (event.data.toDisplay == null) displayData = ' ';
|
|
228
|
+
jQuery("#" + jQuery(this).attr('id') + ID).find('.percentage').text(displayData);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
jQuery(this).bind("uploadifyComplete", {'action': settings.onComplete}, function(event, ID, fileObj, response, data) {
|
|
232
|
+
if (event.data.action(event, ID, fileObj, unescape(response), data) !== false) {
|
|
233
|
+
jQuery("#" + jQuery(this).attr('id') + ID).find('.percentage').text(' - Completed');
|
|
234
|
+
if (settings.removeCompleted) {
|
|
235
|
+
jQuery("#" + jQuery(event.target).attr('id') + ID).fadeOut(250,function() {jQuery(this).remove()});
|
|
236
|
+
}
|
|
237
|
+
jQuery("#" + jQuery(event.target).attr('id') + ID).addClass('completed');
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
if (typeof(settings.onAllComplete) == 'function') {
|
|
241
|
+
jQuery(this).bind("uploadifyAllComplete", {'action': settings.onAllComplete}, function(event, data) {
|
|
242
|
+
if (event.data.action(event, data) !== false) {
|
|
243
|
+
errorArray = [];
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
},
|
|
249
|
+
uploadifySettings:function(settingName, settingValue, resetObject) {
|
|
250
|
+
var returnValue = false;
|
|
251
|
+
jQuery(this).each(function() {
|
|
252
|
+
if (settingName == 'scriptData' && settingValue != null) {
|
|
253
|
+
if (resetObject) {
|
|
254
|
+
var scriptData = settingValue;
|
|
255
|
+
} else {
|
|
256
|
+
var scriptData = jQuery.extend(jQuery(this).data('settings').scriptData, settingValue);
|
|
257
|
+
}
|
|
258
|
+
var scriptDataString = '';
|
|
259
|
+
for (var name in scriptData) {
|
|
260
|
+
scriptDataString += '&' + name + '=' + scriptData[name];
|
|
261
|
+
}
|
|
262
|
+
settingValue = escape(scriptDataString.substr(1));
|
|
263
|
+
}
|
|
264
|
+
returnValue = document.getElementById(jQuery(this).attr('id') + 'Uploader').updateSettings(settingName, settingValue);
|
|
265
|
+
});
|
|
266
|
+
if (settingValue == null) {
|
|
267
|
+
if (settingName == 'scriptData') {
|
|
268
|
+
var returnSplit = unescape(returnValue).split('&');
|
|
269
|
+
var returnObj = new Object();
|
|
270
|
+
for (var i = 0; i < returnSplit.length; i++) {
|
|
271
|
+
var iSplit = returnSplit[i].split('=');
|
|
272
|
+
returnObj[iSplit[0]] = iSplit[1];
|
|
273
|
+
}
|
|
274
|
+
returnValue = returnObj;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return returnValue;
|
|
278
|
+
},
|
|
279
|
+
uploadifyUpload:function(ID,checkComplete) {
|
|
280
|
+
jQuery(this).each(function() {
|
|
281
|
+
if (!checkComplete) checkComplete = false;
|
|
282
|
+
document.getElementById(jQuery(this).attr('id') + 'Uploader').startFileUpload(ID, checkComplete);
|
|
283
|
+
});
|
|
284
|
+
},
|
|
285
|
+
uploadifyCancel:function(ID) {
|
|
286
|
+
jQuery(this).each(function() {
|
|
287
|
+
document.getElementById(jQuery(this).attr('id') + 'Uploader').cancelFileUpload(ID, true, true, false);
|
|
288
|
+
});
|
|
289
|
+
},
|
|
290
|
+
uploadifyClearQueue:function() {
|
|
291
|
+
jQuery(this).each(function() {
|
|
292
|
+
document.getElementById(jQuery(this).attr('id') + 'Uploader').clearFileUploadQueue(false);
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
})
|
|
296
|
+
})(jQuery);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
|
|
2
|
+
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
|
3
|
+
*/
|
|
4
|
+
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
|