muck-invites 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/active_record/acts/muck_invitee.rb +1 -1
- data/lib/muck_invites/tasks.rb +2 -2
- data/locales/ar.yml +1 -0
- data/locales/bg.yml +1 -0
- data/locales/ca.yml +1 -0
- data/locales/cs.yml +1 -0
- data/locales/da.yml +1 -0
- data/locales/de.yml +1 -0
- data/locales/el.yml +1 -0
- data/locales/en.yml +13 -11
- data/locales/es.yml +1 -0
- data/locales/et.yml +1 -0
- data/locales/fa.yml +1 -0
- data/locales/fi.yml +1 -0
- data/locales/fr.yml +1 -0
- data/locales/gl.yml +2 -1
- data/locales/hi.yml +1 -0
- data/locales/hr.yml +1 -0
- data/locales/hu.yml +1 -0
- data/locales/id.yml +1 -0
- data/locales/it.yml +1 -0
- data/locales/iw.yml +1 -0
- data/locales/ja.yml +1 -0
- data/locales/ko.yml +1 -0
- data/locales/lt.yml +1 -0
- data/locales/lv.yml +1 -0
- data/locales/mt.yml +1 -0
- data/locales/nl.yml +1 -0
- data/locales/no.yml +1 -0
- data/locales/pl.yml +1 -0
- data/locales/pt-PT.yml +1 -0
- data/locales/ro.yml +1 -0
- data/locales/ru.yml +1 -0
- data/locales/sk.yml +2 -1
- data/locales/sl.yml +1 -0
- data/locales/sq.yml +1 -0
- data/locales/sr.yml +1 -0
- data/locales/sv.yml +1 -0
- data/locales/th.yml +14 -13
- data/locales/tl.yml +1 -0
- data/locales/tr.yml +1 -0
- data/locales/uk.yml +2 -1
- data/locales/vi.yml +1 -0
- data/locales/zh-CN.yml +1 -0
- data/locales/zh-TW.yml +1 -0
- data/locales/zh.yml +1 -0
- data/muck-invites.gemspec +24 -5
- data/test/rails_root/Rakefile +11 -1
- data/test/rails_root/db/migrate/{20090602041838_create_users.rb → 20090327231918_create_users.rb} +11 -10
- data/test/rails_root/db/migrate/20090402234137_create_languages.rb +1 -1
- data/test/rails_root/db/migrate/20090512013727_create_profiles.rb +21 -0
- data/test/rails_root/db/migrate/20091124203137_add_location_to_profiles.rb +15 -0
- data/test/rails_root/db/migrate/20091124205819_add_fields_to_profiles.rb +21 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_e.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_n.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_ne.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_nw.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_s.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_se.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_sw.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_w.png +0 -0
- data/test/rails_root/public/images/icons/external.png +0 -0
- data/test/rails_root/public/images/icons/feed.png +0 -0
- data/test/rails_root/public/images/icons/pending.png +0 -0
- data/test/rails_root/public/javascripts/jquery/colorpicker.js +450 -0
- data/test/rails_root/public/javascripts/jquery/jquery.autocomplete.js.readme +6 -0
- data/test/rails_root/public/javascripts/jquery/jquery.autocomplete.min.js +15 -0
- data/test/rails_root/public/javascripts/jquery/jquery.autocomplete.pack.js +767 -0
- data/test/rails_root/public/javascripts/jquery/jquery.fancybox.js +13 -6
- data/test/rails_root/public/javascripts/jquery/jquery.js +1 -1
- data/test/rails_root/public/javascripts/jquery/jquery.metadata.min.js +13 -0
- data/test/rails_root/public/javascripts/jquery/jquery.queryString.js +33 -0
- data/test/rails_root/public/javascripts/jquery/jquery.swapimage.js +66 -0
- data/test/rails_root/public/javascripts/jquery/jquery.swapimage.min.js +11 -0
- data/test/rails_root/public/javascripts/jquery/jquery.tips.js +7 -6
- data/test/rails_root/public/javascripts/jquery/jrails.js +1 -1
- data/test/rails_root/public/javascripts/muck.js +48 -2
- data/test/rails_root/public/javascripts/tree.js +107 -0
- data/test/rails_root/public/stylesheets/jquery/jquery.autocomplete.css +15 -0
- data/test/rails_root/public/stylesheets/jquery/jquery.fancybox.css +19 -25
- data/test/rails_root/public/stylesheets/styles.css +1 -0
- metadata +45 -15
data/locales/uk.yml
CHANGED
@@ -4,9 +4,10 @@ uk:
|
|
4
4
|
invites:
|
5
5
|
add_invite_button: "Додати Запросити"
|
6
6
|
continue_button: Продовжити
|
7
|
-
create_success: "Запрошення були направлені {{emails}}.
|
7
|
+
create_success: "Запрошення були направлені {{emails}}. Вам буде повідомлено, якщо вони набудуть {{app_name}}"
|
8
8
|
email_password: "Email Пароль"
|
9
9
|
email_password_help: "Пароль облікового запису електронної пошти"
|
10
|
+
invalid_email_error: "не схожий на справжню адресу електронної пошти."
|
10
11
|
invite: "{{inviter}} Запрошує Вас приєднатися до {{app_name}}"
|
11
12
|
invite_button: Запросити
|
12
13
|
invite_friends: "Запросіть своїх друзів приєднатися до {{app_name}}"
|
data/locales/vi.yml
CHANGED
@@ -7,6 +7,7 @@ vi:
|
|
7
7
|
create_success: "Lời mời được gửi đến {{emails}}. Bạn sẽ được thông báo nếu họ tham gia {{app_name}}"
|
8
8
|
email_password: "Email Mật khẩu"
|
9
9
|
email_password_help: "Mật khẩu của tài khoản email của bạn"
|
10
|
+
invalid_email_error: "không giống như một địa chỉ email hợp lệ."
|
10
11
|
invite: "{{inviter}} Mời các bạn tham gia {{app_name}}"
|
11
12
|
invite_button: Mời
|
12
13
|
invite_friends: "Mời bạn bè tham gia {{app_name}}"
|
data/locales/zh-CN.yml
CHANGED
@@ -7,6 +7,7 @@ zh-CN:
|
|
7
7
|
create_success: "请被送往{{emails}}.您将会收到通知,如果他们加入{{app_name}}"
|
8
8
|
email_password: 邮箱密码
|
9
9
|
email_password_help: 您的电子邮件帐户的密码
|
10
|
+
invalid_email_error: 不像一个有效的电子邮件地址。
|
10
11
|
invite: "{{inviter}}邀请您加入{{app_name}}"
|
11
12
|
invite_button: 邀请
|
12
13
|
invite_friends: "邀请您的朋友加入{{app_name}}"
|
data/locales/zh-TW.yml
CHANGED
@@ -7,6 +7,7 @@ zh-TW:
|
|
7
7
|
create_success: "請被送往{{emails}}.您將會收到通知,如果他們加入{{app_name}}"
|
8
8
|
email_password: 郵箱密碼
|
9
9
|
email_password_help: 您的密碼的電子郵件帳戶
|
10
|
+
invalid_email_error: 不像一個有效的電子郵件地址。
|
10
11
|
invite: "{{inviter}}邀請您加入{{app_name}}"
|
11
12
|
invite_button: 邀請
|
12
13
|
invite_friends: "邀請您的朋友加入{{app_name}}"
|
data/locales/zh.yml
CHANGED
@@ -7,6 +7,7 @@ zh:
|
|
7
7
|
create_success: "请被送往{{emails}}.您将会收到通知,如果他们加入{{app_name}}"
|
8
8
|
email_password: 邮箱密码
|
9
9
|
email_password_help: 您的电子邮件帐户的密码
|
10
|
+
invalid_email_error: 不像一个有效的电子邮件地址。
|
10
11
|
invite: "{{inviter}}邀请您加入{{app_name}}"
|
11
12
|
invite_button: 邀请
|
12
13
|
invite_friends: "邀请您的朋友加入{{app_name}}"
|
data/muck-invites.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{muck-invites}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Justin Ball, Joel Duffin"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2010-03-05}
|
13
13
|
s.description = %q{The invite engine for the muck system.}
|
14
14
|
s.email = %q{justin@tatemae.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -118,15 +118,18 @@ Gem::Specification.new do |s|
|
|
118
118
|
"test/rails_root/config/routes.rb",
|
119
119
|
"test/rails_root/db/.keep",
|
120
120
|
"test/rails_root/db/migrate/20090320174818_create_muck_permissions_and_roles.rb",
|
121
|
+
"test/rails_root/db/migrate/20090327231918_create_users.rb",
|
121
122
|
"test/rails_root/db/migrate/20090402033319_add_muck_activities.rb",
|
122
123
|
"test/rails_root/db/migrate/20090402234137_create_languages.rb",
|
123
124
|
"test/rails_root/db/migrate/20090426041056_create_countries.rb",
|
124
125
|
"test/rails_root/db/migrate/20090426041103_create_states.rb",
|
125
|
-
"test/rails_root/db/migrate/
|
126
|
+
"test/rails_root/db/migrate/20090512013727_create_profiles.rb",
|
126
127
|
"test/rails_root/db/migrate/20090608073052_create_friends.rb",
|
127
128
|
"test/rails_root/db/migrate/20090703055724_add_contents.rb",
|
128
129
|
"test/rails_root/db/migrate/20090704220055_create_slugs.rb",
|
129
130
|
"test/rails_root/db/migrate/20090928213532_create_invites.rb",
|
131
|
+
"test/rails_root/db/migrate/20091124203137_add_location_to_profiles.rb",
|
132
|
+
"test/rails_root/db/migrate/20091124205819_add_fields_to_profiles.rb",
|
130
133
|
"test/rails_root/db/migrate/20091128170318_make_invites_polymorphic.rb",
|
131
134
|
"test/rails_root/features/comments.feature",
|
132
135
|
"test/rails_root/features/step_definitions/comment_steps.rb",
|
@@ -169,10 +172,13 @@ Gem::Specification.new do |s|
|
|
169
172
|
"test/rails_root/public/images/icons/comment.png",
|
170
173
|
"test/rails_root/public/images/icons/delete.png",
|
171
174
|
"test/rails_root/public/images/icons/exclaim.png",
|
175
|
+
"test/rails_root/public/images/icons/external.png",
|
176
|
+
"test/rails_root/public/images/icons/feed.png",
|
172
177
|
"test/rails_root/public/images/icons/grey_guy.png",
|
173
178
|
"test/rails_root/public/images/icons/hide.png",
|
174
179
|
"test/rails_root/public/images/icons/information.png",
|
175
180
|
"test/rails_root/public/images/icons/minus.png",
|
181
|
+
"test/rails_root/public/images/icons/pending.png",
|
176
182
|
"test/rails_root/public/images/icons/question.png",
|
177
183
|
"test/rails_root/public/images/icons/search_box.png",
|
178
184
|
"test/rails_root/public/images/icons/star.png",
|
@@ -192,12 +198,20 @@ Gem::Specification.new do |s|
|
|
192
198
|
"test/rails_root/public/javascripts/dragdrop.js",
|
193
199
|
"test/rails_root/public/javascripts/effects.js",
|
194
200
|
"test/rails_root/public/javascripts/fancyzoom.min.js",
|
201
|
+
"test/rails_root/public/javascripts/jquery/colorpicker.js",
|
195
202
|
"test/rails_root/public/javascripts/jquery/jquery-ui.js",
|
203
|
+
"test/rails_root/public/javascripts/jquery/jquery.autocomplete.js.readme",
|
204
|
+
"test/rails_root/public/javascripts/jquery/jquery.autocomplete.min.js",
|
205
|
+
"test/rails_root/public/javascripts/jquery/jquery.autocomplete.pack.js",
|
196
206
|
"test/rails_root/public/javascripts/jquery/jquery.easing.js",
|
197
207
|
"test/rails_root/public/javascripts/jquery/jquery.fancybox.js",
|
198
208
|
"test/rails_root/public/javascripts/jquery/jquery.form.js",
|
199
209
|
"test/rails_root/public/javascripts/jquery/jquery.jgrowl.js",
|
200
210
|
"test/rails_root/public/javascripts/jquery/jquery.js",
|
211
|
+
"test/rails_root/public/javascripts/jquery/jquery.metadata.min.js",
|
212
|
+
"test/rails_root/public/javascripts/jquery/jquery.queryString.js",
|
213
|
+
"test/rails_root/public/javascripts/jquery/jquery.swapimage.js",
|
214
|
+
"test/rails_root/public/javascripts/jquery/jquery.swapimage.min.js",
|
201
215
|
"test/rails_root/public/javascripts/jquery/jquery.tips.js",
|
202
216
|
"test/rails_root/public/javascripts/jquery/jrails.js",
|
203
217
|
"test/rails_root/public/javascripts/muck.js",
|
@@ -207,6 +221,7 @@ Gem::Specification.new do |s|
|
|
207
221
|
"test/rails_root/public/javascripts/scriptaculous.js",
|
208
222
|
"test/rails_root/public/javascripts/slider.js",
|
209
223
|
"test/rails_root/public/javascripts/sound.js",
|
224
|
+
"test/rails_root/public/javascripts/tree.js",
|
210
225
|
"test/rails_root/public/robots.txt",
|
211
226
|
"test/rails_root/public/stylesheets/.keep",
|
212
227
|
"test/rails_root/public/stylesheets/admin.css",
|
@@ -260,6 +275,7 @@ Gem::Specification.new do |s|
|
|
260
275
|
"test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_cd0a0a_256x240.png",
|
261
276
|
"test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_ffffff_256x240.png",
|
262
277
|
"test/rails_root/public/stylesheets/jquery/cupertino/jquery-ui-1.7.1.custom.css",
|
278
|
+
"test/rails_root/public/stylesheets/jquery/jquery.autocomplete.css",
|
263
279
|
"test/rails_root/public/stylesheets/jquery/jquery.fancybox.css",
|
264
280
|
"test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png",
|
265
281
|
"test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_flat_55_fbec88_40x100.png",
|
@@ -362,7 +378,7 @@ Gem::Specification.new do |s|
|
|
362
378
|
s.rdoc_options = ["--charset=UTF-8"]
|
363
379
|
s.require_paths = ["lib"]
|
364
380
|
s.rubyforge_project = %q{muck-invites}
|
365
|
-
s.rubygems_version = %q{1.3.
|
381
|
+
s.rubygems_version = %q{1.3.6}
|
366
382
|
s.summary = %q{The invite engine for the muck system}
|
367
383
|
s.test_files = [
|
368
384
|
"test/rails_root/app/controllers/application_controller.rb",
|
@@ -385,15 +401,18 @@ Gem::Specification.new do |s|
|
|
385
401
|
"test/rails_root/config/initializers/session_store.rb",
|
386
402
|
"test/rails_root/config/routes.rb",
|
387
403
|
"test/rails_root/db/migrate/20090320174818_create_muck_permissions_and_roles.rb",
|
404
|
+
"test/rails_root/db/migrate/20090327231918_create_users.rb",
|
388
405
|
"test/rails_root/db/migrate/20090402033319_add_muck_activities.rb",
|
389
406
|
"test/rails_root/db/migrate/20090402234137_create_languages.rb",
|
390
407
|
"test/rails_root/db/migrate/20090426041056_create_countries.rb",
|
391
408
|
"test/rails_root/db/migrate/20090426041103_create_states.rb",
|
392
|
-
"test/rails_root/db/migrate/
|
409
|
+
"test/rails_root/db/migrate/20090512013727_create_profiles.rb",
|
393
410
|
"test/rails_root/db/migrate/20090608073052_create_friends.rb",
|
394
411
|
"test/rails_root/db/migrate/20090703055724_add_contents.rb",
|
395
412
|
"test/rails_root/db/migrate/20090704220055_create_slugs.rb",
|
396
413
|
"test/rails_root/db/migrate/20090928213532_create_invites.rb",
|
414
|
+
"test/rails_root/db/migrate/20091124203137_add_location_to_profiles.rb",
|
415
|
+
"test/rails_root/db/migrate/20091124205819_add_fields_to_profiles.rb",
|
397
416
|
"test/rails_root/db/migrate/20091128170318_make_invites_polymorphic.rb",
|
398
417
|
"test/rails_root/features/step_definitions/comment_steps.rb",
|
399
418
|
"test/rails_root/features/step_definitions/common_steps.rb",
|
data/test/rails_root/Rakefile
CHANGED
@@ -11,4 +11,14 @@ require 'tasks/rails'
|
|
11
11
|
|
12
12
|
require 'muck_users/tasks'
|
13
13
|
require 'muck_invites/tasks'
|
14
|
-
require 'muck_engine/tasks'
|
14
|
+
require 'muck_engine/tasks'
|
15
|
+
|
16
|
+
require 'muck_profiles/tasks'
|
17
|
+
|
18
|
+
namespace :muck do
|
19
|
+
|
20
|
+
def muck_gems
|
21
|
+
['muck-engine', 'muck-users', 'muck-profiles']
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
data/test/rails_root/db/migrate/{20090602041838_create_users.rb → 20090327231918_create_users.rb}
RENAMED
@@ -1,5 +1,4 @@
|
|
1
1
|
class CreateUsers < ActiveRecord::Migration
|
2
|
-
|
3
2
|
def self.up
|
4
3
|
create_table :users, :force => true do |t|
|
5
4
|
t.string :login
|
@@ -8,29 +7,31 @@ class CreateUsers < ActiveRecord::Migration
|
|
8
7
|
t.string :last_name
|
9
8
|
t.string :crypted_password
|
10
9
|
t.string :password_salt
|
11
|
-
t.string :persistence_token
|
12
|
-
t.string :single_access_token
|
13
|
-
t.string :perishable_token
|
10
|
+
t.string :persistence_token, :null => false
|
11
|
+
t.string :single_access_token, :null => false
|
12
|
+
t.string :perishable_token, :null => false
|
14
13
|
t.integer :login_count, :null => false, :default => 0
|
15
14
|
t.integer :failed_login_count, :null => false, :default => 0
|
16
15
|
t.datetime :last_request_at
|
17
|
-
t.datetime :last_login_at
|
18
16
|
t.datetime :current_login_at
|
17
|
+
t.datetime :last_login_at
|
19
18
|
t.string :current_login_ip
|
20
19
|
t.string :last_login_ip
|
21
|
-
t.boolean :terms_of_service,
|
22
|
-
t.string :time_zone,
|
20
|
+
t.boolean :terms_of_service, :default => false, :null => false
|
21
|
+
t.string :time_zone, :default => "UTC"
|
23
22
|
t.datetime :disabled_at
|
23
|
+
t.datetime :created_at
|
24
24
|
t.datetime :activated_at
|
25
|
-
t.
|
25
|
+
t.datetime :updated_at
|
26
|
+
t.string :identity_url
|
27
|
+
t.string :url_key
|
26
28
|
end
|
27
29
|
|
28
30
|
add_index :users, :login
|
29
31
|
add_index :users, :email
|
30
32
|
add_index :users, :persistence_token
|
31
|
-
add_index :users, :perishable_token
|
32
|
-
add_index :users, :single_access_token
|
33
33
|
add_index :users, :last_request_at
|
34
|
+
|
34
35
|
end
|
35
36
|
|
36
37
|
def self.down
|
@@ -5,7 +5,7 @@ class CreateLanguages < ActiveRecord::Migration
|
|
5
5
|
t.string :english_name
|
6
6
|
t.string :locale
|
7
7
|
t.boolean :supported, :default => true
|
8
|
-
t.
|
8
|
+
t.boolean :is_default, :default => false
|
9
9
|
end
|
10
10
|
add_index :languages, :name
|
11
11
|
add_index :languages, :locale
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CreateProfiles < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def self.up
|
4
|
+
|
5
|
+
create_table :profiles, :force => true do |t|
|
6
|
+
t.integer :user_id
|
7
|
+
t.string :photo_file_name
|
8
|
+
t.string :photo_content_type
|
9
|
+
t.integer :photo_file_size
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
|
13
|
+
add_index :profiles, ['user_id']
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.down
|
18
|
+
drop_table :profiles
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class AddLocationToProfiles < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :profiles, :location, :string
|
4
|
+
add_column :profiles, :lat, :decimal, :precision => 15, :scale => 10
|
5
|
+
add_column :profiles, :lng, :decimal, :precision => 15, :scale => 10
|
6
|
+
add_index :profiles, [:lat, :lng]
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.down
|
10
|
+
remove_index :profiles, [:lat, :lng]
|
11
|
+
remove_column :profiles, :location
|
12
|
+
remove_column :profiles, :lat
|
13
|
+
remove_column :profiles, :lng
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class AddFieldsToProfiles < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :profiles, :about, :text
|
4
|
+
add_column :profiles, :first_name, :string
|
5
|
+
add_column :profiles, :last_name, :string
|
6
|
+
add_column :profiles, :city, :string
|
7
|
+
add_column :profiles, :state_id, :integer
|
8
|
+
add_column :profiles, :country_id, :integer
|
9
|
+
add_column :profiles, :language_id, :integer
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.down
|
13
|
+
remove_column :profiles, :about
|
14
|
+
remove_column :profiles, :first_name
|
15
|
+
remove_column :profiles, :last_name
|
16
|
+
remove_column :profiles, :city
|
17
|
+
remove_column :profiles, :state_id
|
18
|
+
remove_column :profiles, :country_id
|
19
|
+
remove_column :profiles, :language_id
|
20
|
+
end
|
21
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,450 @@
|
|
1
|
+
/**
|
2
|
+
*
|
3
|
+
* Color picker
|
4
|
+
* Author: Stefan Petre www.eyecon.ro
|
5
|
+
*
|
6
|
+
*/
|
7
|
+
(function ($) {
|
8
|
+
var ColorPicker = function () {
|
9
|
+
var
|
10
|
+
ids = {},
|
11
|
+
inAction,
|
12
|
+
charMin = 65,
|
13
|
+
visible,
|
14
|
+
tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
|
15
|
+
defaults = {
|
16
|
+
eventName: 'click',
|
17
|
+
onShow: function () {},
|
18
|
+
onBeforeShow: function(){},
|
19
|
+
onHide: function () {},
|
20
|
+
onChange: function () {},
|
21
|
+
onSubmit: function () {},
|
22
|
+
color: 'ff0000',
|
23
|
+
livePreview: true,
|
24
|
+
flat: false
|
25
|
+
},
|
26
|
+
fillRGBFields = function (hsb, cal) {
|
27
|
+
var rgb = HSBToRGB(hsb);
|
28
|
+
$(cal).data('colorpicker').fields
|
29
|
+
.eq(1).val(rgb.r).end()
|
30
|
+
.eq(2).val(rgb.g).end()
|
31
|
+
.eq(3).val(rgb.b).end();
|
32
|
+
},
|
33
|
+
fillHSBFields = function (hsb, cal) {
|
34
|
+
$(cal).data('colorpicker').fields
|
35
|
+
.eq(4).val(hsb.h).end()
|
36
|
+
.eq(5).val(hsb.s).end()
|
37
|
+
.eq(6).val(hsb.b).end();
|
38
|
+
},
|
39
|
+
fillHexFields = function (hsb, cal) {
|
40
|
+
$(cal).data('colorpicker').fields
|
41
|
+
.eq(0).val(HSBToHex(hsb)).end();
|
42
|
+
},
|
43
|
+
setSelector = function (hsb, cal) {
|
44
|
+
$(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
|
45
|
+
$(cal).data('colorpicker').selectorIndic.css({
|
46
|
+
left: parseInt(150 * hsb.s/100, 10),
|
47
|
+
top: parseInt(150 * (100-hsb.b)/100, 10)
|
48
|
+
});
|
49
|
+
},
|
50
|
+
setHue = function (hsb, cal) {
|
51
|
+
$(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
|
52
|
+
},
|
53
|
+
setCurrentColor = function (hsb, cal) {
|
54
|
+
$(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
55
|
+
},
|
56
|
+
setNewColor = function (hsb, cal) {
|
57
|
+
$(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
58
|
+
},
|
59
|
+
keyDown = function (ev) {
|
60
|
+
var pressedKey = ev.charCode || ev.keyCode || -1;
|
61
|
+
if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
|
62
|
+
return false;
|
63
|
+
}
|
64
|
+
var cal = $(this).parent().parent();
|
65
|
+
if (cal.data('colorpicker').livePreview === true) {
|
66
|
+
change.apply(this);
|
67
|
+
}
|
68
|
+
},
|
69
|
+
change = function (ev) {
|
70
|
+
var cal = $(this).parent().parent(), col;
|
71
|
+
if (this.parentNode.className.indexOf('_hex') > 0) {
|
72
|
+
cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
|
73
|
+
} else if (this.parentNode.className.indexOf('_hsb') > 0) {
|
74
|
+
cal.data('colorpicker').color = col = fixHSB({
|
75
|
+
h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
|
76
|
+
s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
|
77
|
+
b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
|
78
|
+
});
|
79
|
+
} else {
|
80
|
+
cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
|
81
|
+
r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
|
82
|
+
g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
|
83
|
+
b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
|
84
|
+
}));
|
85
|
+
}
|
86
|
+
if (ev) {
|
87
|
+
fillRGBFields(col, cal.get(0));
|
88
|
+
fillHexFields(col, cal.get(0));
|
89
|
+
fillHSBFields(col, cal.get(0));
|
90
|
+
}
|
91
|
+
setSelector(col, cal.get(0));
|
92
|
+
setHue(col, cal.get(0));
|
93
|
+
setNewColor(col, cal.get(0));
|
94
|
+
cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
|
95
|
+
},
|
96
|
+
blur = function (ev) {
|
97
|
+
var cal = $(this).parent().parent();
|
98
|
+
cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus')
|
99
|
+
},
|
100
|
+
focus = function () {
|
101
|
+
charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
|
102
|
+
$(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
|
103
|
+
$(this).parent().addClass('colorpicker_focus');
|
104
|
+
},
|
105
|
+
downIncrement = function (ev) {
|
106
|
+
var field = $(this).parent().find('input').focus();
|
107
|
+
var current = {
|
108
|
+
el: $(this).parent().addClass('colorpicker_slider'),
|
109
|
+
max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
|
110
|
+
y: ev.pageY,
|
111
|
+
field: field,
|
112
|
+
val: parseInt(field.val(), 10),
|
113
|
+
preview: $(this).parent().parent().data('colorpicker').livePreview
|
114
|
+
};
|
115
|
+
$(document).bind('mouseup', current, upIncrement);
|
116
|
+
$(document).bind('mousemove', current, moveIncrement);
|
117
|
+
},
|
118
|
+
moveIncrement = function (ev) {
|
119
|
+
ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
|
120
|
+
if (ev.data.preview) {
|
121
|
+
change.apply(ev.data.field.get(0), [true]);
|
122
|
+
}
|
123
|
+
return false;
|
124
|
+
},
|
125
|
+
upIncrement = function (ev) {
|
126
|
+
change.apply(ev.data.field.get(0), [true]);
|
127
|
+
ev.data.el.removeClass('colorpicker_slider').find('input').focus();
|
128
|
+
$(document).unbind('mouseup', upIncrement);
|
129
|
+
$(document).unbind('mousemove', moveIncrement);
|
130
|
+
return false;
|
131
|
+
},
|
132
|
+
downHue = function (ev) {
|
133
|
+
var current = {
|
134
|
+
cal: $(this).parent(),
|
135
|
+
y: $(this).offset().top
|
136
|
+
};
|
137
|
+
current.preview = current.cal.data('colorpicker').livePreview;
|
138
|
+
$(document).bind('mouseup', current, upHue);
|
139
|
+
$(document).bind('mousemove', current, moveHue);
|
140
|
+
},
|
141
|
+
moveHue = function (ev) {
|
142
|
+
change.apply(
|
143
|
+
ev.data.cal.data('colorpicker')
|
144
|
+
.fields
|
145
|
+
.eq(4)
|
146
|
+
.val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
|
147
|
+
.get(0),
|
148
|
+
[ev.data.preview]
|
149
|
+
);
|
150
|
+
return false;
|
151
|
+
},
|
152
|
+
upHue = function (ev) {
|
153
|
+
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
154
|
+
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
155
|
+
$(document).unbind('mouseup', upHue);
|
156
|
+
$(document).unbind('mousemove', moveHue);
|
157
|
+
return false;
|
158
|
+
},
|
159
|
+
downSelector = function (ev) {
|
160
|
+
var current = {
|
161
|
+
cal: $(this).parent(),
|
162
|
+
pos: $(this).offset()
|
163
|
+
};
|
164
|
+
current.preview = current.cal.data('colorpicker').livePreview;
|
165
|
+
$(document).bind('mouseup', current, upSelector);
|
166
|
+
$(document).bind('mousemove', current, moveSelector);
|
167
|
+
},
|
168
|
+
moveSelector = function (ev) {
|
169
|
+
change.apply(
|
170
|
+
ev.data.cal.data('colorpicker')
|
171
|
+
.fields
|
172
|
+
.eq(6)
|
173
|
+
.val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
|
174
|
+
.end()
|
175
|
+
.eq(5)
|
176
|
+
.val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
|
177
|
+
.get(0),
|
178
|
+
[ev.data.preview]
|
179
|
+
);
|
180
|
+
return false;
|
181
|
+
},
|
182
|
+
upSelector = function (ev) {
|
183
|
+
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
184
|
+
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
185
|
+
$(document).unbind('mouseup', upSelector);
|
186
|
+
$(document).unbind('mousemove', moveSelector);
|
187
|
+
return false;
|
188
|
+
},
|
189
|
+
enterSubmit = function (ev) {
|
190
|
+
$(this).addClass('colorpicker_focus');
|
191
|
+
},
|
192
|
+
leaveSubmit = function (ev) {
|
193
|
+
$(this).removeClass('colorpicker_focus');
|
194
|
+
},
|
195
|
+
clickSubmit = function (ev) {
|
196
|
+
var cal = $(this).parent();
|
197
|
+
var col = cal.data('colorpicker').color;
|
198
|
+
cal.data('colorpicker').origColor = col;
|
199
|
+
setCurrentColor(col, cal.get(0));
|
200
|
+
cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col));
|
201
|
+
},
|
202
|
+
show = function (ev) {
|
203
|
+
var cal = $('#' + $(this).data('colorpickerId'));
|
204
|
+
cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
|
205
|
+
var pos = $(this).offset();
|
206
|
+
var viewPort = getViewport();
|
207
|
+
var top = pos.top + this.offsetHeight;
|
208
|
+
var left = pos.left;
|
209
|
+
if (top + 176 > viewPort.t + viewPort.h) {
|
210
|
+
top -= this.offsetHeight + 176;
|
211
|
+
}
|
212
|
+
if (left + 356 > viewPort.l + viewPort.w) {
|
213
|
+
left -= 356;
|
214
|
+
}
|
215
|
+
cal.css({left: left + 'px', top: top + 'px'});
|
216
|
+
if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
|
217
|
+
cal.show();
|
218
|
+
}
|
219
|
+
$(document).bind('mousedown', {cal: cal}, hide);
|
220
|
+
return false;
|
221
|
+
},
|
222
|
+
hide = function (ev) {
|
223
|
+
if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
|
224
|
+
if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
|
225
|
+
ev.data.cal.hide();
|
226
|
+
}
|
227
|
+
$(document).unbind('mousedown', hide);
|
228
|
+
}
|
229
|
+
},
|
230
|
+
isChildOf = function(parentEl, el, container) {
|
231
|
+
if (parentEl == el) {
|
232
|
+
return true;
|
233
|
+
}
|
234
|
+
if (parentEl.contains) {
|
235
|
+
return parentEl.contains(el);
|
236
|
+
}
|
237
|
+
if ( parentEl.compareDocumentPosition ) {
|
238
|
+
return !!(parentEl.compareDocumentPosition(el) & 16);
|
239
|
+
}
|
240
|
+
var prEl = el.parentNode;
|
241
|
+
while(prEl && prEl != container) {
|
242
|
+
if (prEl == parentEl)
|
243
|
+
return true;
|
244
|
+
prEl = prEl.parentNode;
|
245
|
+
}
|
246
|
+
return false;
|
247
|
+
},
|
248
|
+
getViewport = function () {
|
249
|
+
var m = document.compatMode == 'CSS1Compat';
|
250
|
+
return {
|
251
|
+
l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
|
252
|
+
t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
|
253
|
+
w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
|
254
|
+
h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
|
255
|
+
};
|
256
|
+
},
|
257
|
+
fixHSB = function (hsb) {
|
258
|
+
return {
|
259
|
+
h: Math.min(360, Math.max(0, hsb.h)),
|
260
|
+
s: Math.min(100, Math.max(0, hsb.s)),
|
261
|
+
b: Math.min(100, Math.max(0, hsb.b))
|
262
|
+
};
|
263
|
+
},
|
264
|
+
fixRGB = function (rgb) {
|
265
|
+
return {
|
266
|
+
r: Math.min(255, Math.max(0, rgb.r)),
|
267
|
+
g: Math.min(255, Math.max(0, rgb.g)),
|
268
|
+
b: Math.min(255, Math.max(0, rgb.b))
|
269
|
+
};
|
270
|
+
},
|
271
|
+
fixHex = function (hex) {
|
272
|
+
var len = 6 - hex.length;
|
273
|
+
if (len > 0) {
|
274
|
+
var o = [];
|
275
|
+
for (var i=0; i<len; i++) {
|
276
|
+
o.push('0');
|
277
|
+
}
|
278
|
+
o.push(hex);
|
279
|
+
hex = o.join('');
|
280
|
+
}
|
281
|
+
return hex;
|
282
|
+
},
|
283
|
+
HexToRGB = function (hex) {
|
284
|
+
var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
|
285
|
+
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
|
286
|
+
},
|
287
|
+
HexToHSB = function (hex) {
|
288
|
+
return RGBToHSB(HexToRGB(hex));
|
289
|
+
},
|
290
|
+
RGBToHSB = function (rgb) {
|
291
|
+
var hsb = {};
|
292
|
+
hsb.b = Math.max(Math.max(rgb.r,rgb.g),rgb.b);
|
293
|
+
hsb.s = (hsb.b <= 0) ? 0 : Math.round(100*(hsb.b - Math.min(Math.min(rgb.r,rgb.g),rgb.b))/hsb.b);
|
294
|
+
hsb.b = Math.round((hsb.b /255)*100);
|
295
|
+
if((rgb.r==rgb.g) && (rgb.g==rgb.b)) hsb.h = 0;
|
296
|
+
else if(rgb.r>=rgb.g && rgb.g>=rgb.b) hsb.h = 60*(rgb.g-rgb.b)/(rgb.r-rgb.b);
|
297
|
+
else if(rgb.g>=rgb.r && rgb.r>=rgb.b) hsb.h = 60 + 60*(rgb.g-rgb.r)/(rgb.g-rgb.b);
|
298
|
+
else if(rgb.g>=rgb.b && rgb.b>=rgb.r) hsb.h = 120 + 60*(rgb.b-rgb.r)/(rgb.g-rgb.r);
|
299
|
+
else if(rgb.b>=rgb.g && rgb.g>=rgb.r) hsb.h = 180 + 60*(rgb.b-rgb.g)/(rgb.b-rgb.r);
|
300
|
+
else if(rgb.b>=rgb.r && rgb.r>=rgb.g) hsb.h = 240 + 60*(rgb.r-rgb.g)/(rgb.b-rgb.g);
|
301
|
+
else if(rgb.r>=rgb.b && rgb.b>=rgb.g) hsb.h = 300 + 60*(rgb.r-rgb.b)/(rgb.r-rgb.g);
|
302
|
+
else hsb.h = 0;
|
303
|
+
hsb.h = Math.round(hsb.h);
|
304
|
+
return hsb;
|
305
|
+
},
|
306
|
+
HSBToRGB = function (hsb) {
|
307
|
+
var rgb = {};
|
308
|
+
var h = Math.round(hsb.h);
|
309
|
+
var s = Math.round(hsb.s*255/100);
|
310
|
+
var v = Math.round(hsb.b*255/100);
|
311
|
+
if(s == 0) {
|
312
|
+
rgb.r = rgb.g = rgb.b = v;
|
313
|
+
} else {
|
314
|
+
var t1 = v;
|
315
|
+
var t2 = (255-s)*v/255;
|
316
|
+
var t3 = (t1-t2)*(h%60)/60;
|
317
|
+
if(h==360) h = 0;
|
318
|
+
if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
|
319
|
+
else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
|
320
|
+
else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
|
321
|
+
else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
|
322
|
+
else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
|
323
|
+
else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
|
324
|
+
else {rgb.r=0; rgb.g=0; rgb.b=0}
|
325
|
+
}
|
326
|
+
return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
|
327
|
+
},
|
328
|
+
RGBToHex = function (rgb) {
|
329
|
+
var hex = [
|
330
|
+
rgb.r.toString(16),
|
331
|
+
rgb.g.toString(16),
|
332
|
+
rgb.b.toString(16)
|
333
|
+
];
|
334
|
+
$.each(hex, function (nr, val) {
|
335
|
+
if (val.length == 1) {
|
336
|
+
hex[nr] = '0' + val;
|
337
|
+
}
|
338
|
+
});
|
339
|
+
return hex.join('');
|
340
|
+
},
|
341
|
+
HSBToHex = function (hsb) {
|
342
|
+
return RGBToHex(HSBToRGB(hsb));
|
343
|
+
};
|
344
|
+
return {
|
345
|
+
init: function (options) {
|
346
|
+
options = $.extend({}, defaults, options||{});
|
347
|
+
if (typeof options.color == 'string') {
|
348
|
+
options.color = HexToHSB(options.color);
|
349
|
+
} else if (options.color.r != undefined && options.color.g != undefined && options.color.b != undefined) {
|
350
|
+
options.color = RGBToHSB(options.color);
|
351
|
+
} else if (options.color.h != undefined && options.color.s != undefined && options.color.b != undefined) {
|
352
|
+
options.color = fixHSB(options.color);
|
353
|
+
} else {
|
354
|
+
return this;
|
355
|
+
}
|
356
|
+
options.origColor = options.color;
|
357
|
+
return this.each(function () {
|
358
|
+
if (!$(this).data('colorpickerId')) {
|
359
|
+
var id = 'collorpicker_' + parseInt(Math.random() * 1000);
|
360
|
+
$(this).data('colorpickerId', id);
|
361
|
+
var cal = $(tpl).attr('id', id);
|
362
|
+
if (options.flat) {
|
363
|
+
cal.appendTo(this).show();
|
364
|
+
} else {
|
365
|
+
cal.appendTo(document.body);
|
366
|
+
}
|
367
|
+
options.fields = cal
|
368
|
+
.find('input')
|
369
|
+
.bind('keydown', keyDown)
|
370
|
+
.bind('change', change)
|
371
|
+
.bind('blur', blur)
|
372
|
+
.bind('focus', focus);
|
373
|
+
cal.find('span').bind('mousedown', downIncrement);
|
374
|
+
options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
|
375
|
+
options.selectorIndic = options.selector.find('div div');
|
376
|
+
options.hue = cal.find('div.colorpicker_hue div');
|
377
|
+
cal.find('div.colorpicker_hue').bind('mousedown', downHue);
|
378
|
+
options.newColor = cal.find('div.colorpicker_new_color');
|
379
|
+
options.currentColor = cal.find('div.colorpicker_current_color');
|
380
|
+
cal.data('colorpicker', options);
|
381
|
+
cal.find('div.colorpicker_submit')
|
382
|
+
.bind('mouseenter', enterSubmit)
|
383
|
+
.bind('mouseleave', leaveSubmit)
|
384
|
+
.bind('click', clickSubmit);
|
385
|
+
fillRGBFields(options.color, cal.get(0));
|
386
|
+
fillHSBFields(options.color, cal.get(0));
|
387
|
+
fillHexFields(options.color, cal.get(0));
|
388
|
+
setHue(options.color, cal.get(0));
|
389
|
+
setSelector(options.color, cal.get(0));
|
390
|
+
setCurrentColor(options.color, cal.get(0));
|
391
|
+
setNewColor(options.color, cal.get(0));
|
392
|
+
if (options.flat) {
|
393
|
+
cal.css({
|
394
|
+
position: 'relative',
|
395
|
+
display: 'block'
|
396
|
+
});
|
397
|
+
} else {
|
398
|
+
$(this).bind(options.eventName, show);
|
399
|
+
}
|
400
|
+
}
|
401
|
+
});
|
402
|
+
},
|
403
|
+
showPicker: function() {
|
404
|
+
return this.each( function () {
|
405
|
+
if ($(this).data('colorpickerId')) {
|
406
|
+
show.apply(this);
|
407
|
+
}
|
408
|
+
});
|
409
|
+
},
|
410
|
+
hidePicker: function() {
|
411
|
+
return this.each( function () {
|
412
|
+
if ($(this).data('colorpickerId')) {
|
413
|
+
$('#' + $(this).data('colorpickerId')).hide();
|
414
|
+
}
|
415
|
+
});
|
416
|
+
},
|
417
|
+
setColor: function(col) {
|
418
|
+
if (typeof col == 'string') {
|
419
|
+
col = HexToHSB(col);
|
420
|
+
} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
|
421
|
+
col = RGBToHSB(col);
|
422
|
+
} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
|
423
|
+
col = fixHSB(col);
|
424
|
+
} else {
|
425
|
+
return this;
|
426
|
+
}
|
427
|
+
return this.each(function(){
|
428
|
+
if ($(this).data('colorpickerId')) {
|
429
|
+
var cal = $('#' + $(this).data('colorpickerId'));
|
430
|
+
cal.data('colorpicker').color = col;
|
431
|
+
cal.data('colorpicker').origColor = col;
|
432
|
+
fillRGBFields(col, cal.get(0));
|
433
|
+
fillHSBFields(col, cal.get(0));
|
434
|
+
fillHexFields(col, cal.get(0));
|
435
|
+
setHue(col, cal.get(0));
|
436
|
+
setSelector(col, cal.get(0));
|
437
|
+
setCurrentColor(col, cal.get(0));
|
438
|
+
setNewColor(col, cal.get(0));
|
439
|
+
}
|
440
|
+
});
|
441
|
+
}
|
442
|
+
};
|
443
|
+
}();
|
444
|
+
$.fn.extend({
|
445
|
+
ColorPicker: ColorPicker.init,
|
446
|
+
ColorPickerHide: ColorPicker.hide,
|
447
|
+
ColorPickerShow: ColorPicker.show,
|
448
|
+
ColorPickerSetColor: ColorPicker.setColor
|
449
|
+
});
|
450
|
+
})(jQuery)
|