muck-auth 3.5.2 → 3.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/muck/authentications_controller.rb +1 -1
- data/lib/muck-auth/models/authentication.rb +6 -1
- data/lib/muck-auth/models/user.rb +23 -6
- data/muck-auth.gemspec +22 -2
- data/test/db/migrate/20110303183433_add_sent_to_to_access_codes.rb +9 -0
- data/test/db/migrate/20110420153714_add_provided_by_to_access_codes.rb +9 -0
- data/test/db/migrate/20110713040718_add_photo_url.rb +9 -0
- data/test/db/schema.rb +7 -4
- data/test/public/javascripts/muck-users.js +2 -7
- data/test/public/javascripts/muck.js +149 -5
- data/test/public/javascripts/muck_admin.js +0 -13
- data/test/public/javascripts/muck_countries.js +50 -0
- data/test/public/javascripts/muck_services-src.js +134 -0
- data/test/public/stylesheets/admin.css +26 -13
- data/test/public/stylesheets/muck-users.css +3 -1
- data/test/public/system/photos/32/icon/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/public/system/photos/32/medium/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/public/system/photos/32/original/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/public/system/photos/32/thumb/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/public/system/photos/32/tiny/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/public/system/photos/33/icon/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/public/system/photos/33/medium/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/public/system/photos/33/original/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/public/system/photos/33/thumb/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/public/system/photos/33/tiny/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/public/system/photos/34/icon/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/public/system/photos/34/medium/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/public/system/photos/34/original/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/public/system/photos/34/thumb/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/public/system/photos/34/tiny/GettyImages_79495526-1-0_bigger.jpg +0 -0
- data/test/spec/models/authentication_spec.rb +6 -0
- metadata +24 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.5.
|
1
|
+
3.5.3
|
@@ -27,7 +27,7 @@ class Muck::AuthenticationsController < ApplicationController
|
|
27
27
|
@user = User.new
|
28
28
|
@user.apply_omniauth(@omniauth)
|
29
29
|
@user.generate_password
|
30
|
-
if @user.save
|
30
|
+
if @user.save
|
31
31
|
UserSession.create(@user)
|
32
32
|
flash[:notice] = t('muck.users.thanks_sign_up')
|
33
33
|
status = :new_signup_success
|
@@ -5,7 +5,12 @@ module MuckAuth
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
included do
|
8
|
-
belongs_to :authenticatable, :polymorphic => true
|
8
|
+
belongs_to :authenticatable, :polymorphic => true
|
9
|
+
scope :by_newest, order("authentications.created_at DESC")
|
10
|
+
scope :by_oldest, order("authentications.created_at ASC")
|
11
|
+
scope :by_latest, order("authentications.updated_at DESC")
|
12
|
+
scope :newer_than, lambda { |*args| where("authentications.created_at > ?", args.first || DateTime.now) }
|
13
|
+
scope :older_than, lambda { |*args| where("authentications.created_at < ?", args.first || 1.day.ago.to_s(:db)) }
|
9
14
|
end
|
10
15
|
|
11
16
|
def access_token
|
@@ -7,6 +7,9 @@ module MuckAuth
|
|
7
7
|
included do
|
8
8
|
has_many :authentications, :as => :authenticatable, :dependent => :destroy
|
9
9
|
accepts_nested_attributes_for :authentications, :allow_destroy => true
|
10
|
+
|
11
|
+
after_create :set_profile_from_authentications
|
12
|
+
|
10
13
|
end
|
11
14
|
|
12
15
|
def apply_omniauth(omniauth)
|
@@ -21,21 +24,35 @@ module MuckAuth
|
|
21
24
|
self.last_name = names[1] if self.last_name.blank?
|
22
25
|
|
23
26
|
self.login = omniauth['user_info']['nickname'] if self.login.blank?
|
27
|
+
self.login = self.first_name.downcase if Float(self.login) rescue false # If the login is a number then try the first name
|
28
|
+
|
24
29
|
# Some providers don't provide a valid nickname so try the first name
|
25
30
|
self.login = self.first_name if !self.valid? && self.errors[:login].any?
|
26
31
|
|
27
|
-
|
28
|
-
|
29
|
-
|
32
|
+
# Remove the email if it's invalid
|
33
|
+
self.email = '' if self.errors[:email].any?
|
34
|
+
|
35
|
+
self.authentications.build(:provider => omniauth['provider'],
|
36
|
+
:uid => omniauth['uid'],
|
37
|
+
:raw_auth => omniauth.to_json,
|
38
|
+
:token => omniauth['credentials']['token'],
|
39
|
+
:secret => omniauth['credentials']['secret'] )
|
40
|
+
end
|
41
|
+
|
42
|
+
def set_profile_from_authentications
|
43
|
+
return unless self.respond_to?(:profile)
|
44
|
+
if authentication = self.authentications.by_newest.first
|
45
|
+
self.profile_from_omniauth(JSON.parse(authentication.raw_auth))
|
46
|
+
end
|
30
47
|
end
|
31
48
|
|
32
49
|
def profile_from_omniauth(omniauth)
|
33
50
|
if self.respond_to?(:profile)
|
51
|
+
self.build_profile if self.profile.blank? # in case profile doesn't yet exist
|
34
52
|
self.profile.location = omniauth['user_info']['location'] if self.profile.location.blank?
|
35
53
|
self.profile.about = omniauth['user_info']['description'] if self.profile.about.blank?
|
36
|
-
|
37
|
-
|
38
|
-
# self.profile.image = omniauth['user_info']['image'] if self.profile.image.blank?
|
54
|
+
self.profile.photo_url = omniauth['user_info']['image'] if self.profile.photo.original_filename.blank?
|
55
|
+
self.profile.save
|
39
56
|
end
|
40
57
|
end
|
41
58
|
|
data/muck-auth.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{muck-auth}
|
8
|
-
s.version = "3.5.
|
8
|
+
s.version = "3.5.3"
|
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"]
|
12
|
-
s.date = %q{2011-07-
|
12
|
+
s.date = %q{2011-07-13}
|
13
13
|
s.description = %q{A simple wrapper for the omniauth gem so that it is faster to include oauth in muck based applications.}
|
14
14
|
s.email = %q{justin@tatemae.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -181,6 +181,9 @@ Gem::Specification.new do |s|
|
|
181
181
|
"test/db/migrate/20101117172951_add_name_to_access_code_requests.rb",
|
182
182
|
"test/db/migrate/20110216045051_create_authentications.rb",
|
183
183
|
"test/db/migrate/20110226174321_add_cached_slugs.rb",
|
184
|
+
"test/db/migrate/20110303183433_add_sent_to_to_access_codes.rb",
|
185
|
+
"test/db/migrate/20110420153714_add_provided_by_to_access_codes.rb",
|
186
|
+
"test/db/migrate/20110713040718_add_photo_url.rb",
|
184
187
|
"test/db/schema.rb",
|
185
188
|
"test/db/seeds.rb",
|
186
189
|
"test/features/step_definitions/common_steps.rb",
|
@@ -700,6 +703,8 @@ Gem::Specification.new do |s|
|
|
700
703
|
"test/public/javascripts/muck.js",
|
701
704
|
"test/public/javascripts/muck_activities.js",
|
702
705
|
"test/public/javascripts/muck_admin.js",
|
706
|
+
"test/public/javascripts/muck_countries.js",
|
707
|
+
"test/public/javascripts/muck_services-src.js",
|
703
708
|
"test/public/javascripts/muck_services.js",
|
704
709
|
"test/public/javascripts/muck_time/en.js",
|
705
710
|
"test/public/javascripts/prototype.js",
|
@@ -2236,6 +2241,21 @@ Gem::Specification.new do |s|
|
|
2236
2241
|
"test/public/stylesheets/swfupload.css",
|
2237
2242
|
"test/public/stylesheets/tinymce.css",
|
2238
2243
|
"test/public/stylesheets/uploadify.css",
|
2244
|
+
"test/public/system/photos/32/icon/GettyImages_79495526-1-0_bigger.jpg",
|
2245
|
+
"test/public/system/photos/32/medium/GettyImages_79495526-1-0_bigger.jpg",
|
2246
|
+
"test/public/system/photos/32/original/GettyImages_79495526-1-0_bigger.jpg",
|
2247
|
+
"test/public/system/photos/32/thumb/GettyImages_79495526-1-0_bigger.jpg",
|
2248
|
+
"test/public/system/photos/32/tiny/GettyImages_79495526-1-0_bigger.jpg",
|
2249
|
+
"test/public/system/photos/33/icon/GettyImages_79495526-1-0_bigger.jpg",
|
2250
|
+
"test/public/system/photos/33/medium/GettyImages_79495526-1-0_bigger.jpg",
|
2251
|
+
"test/public/system/photos/33/original/GettyImages_79495526-1-0_bigger.jpg",
|
2252
|
+
"test/public/system/photos/33/thumb/GettyImages_79495526-1-0_bigger.jpg",
|
2253
|
+
"test/public/system/photos/33/tiny/GettyImages_79495526-1-0_bigger.jpg",
|
2254
|
+
"test/public/system/photos/34/icon/GettyImages_79495526-1-0_bigger.jpg",
|
2255
|
+
"test/public/system/photos/34/medium/GettyImages_79495526-1-0_bigger.jpg",
|
2256
|
+
"test/public/system/photos/34/original/GettyImages_79495526-1-0_bigger.jpg",
|
2257
|
+
"test/public/system/photos/34/thumb/GettyImages_79495526-1-0_bigger.jpg",
|
2258
|
+
"test/public/system/photos/34/tiny/GettyImages_79495526-1-0_bigger.jpg",
|
2239
2259
|
"test/script/rails",
|
2240
2260
|
"test/spec/controllers/authentications_controller_spec.rb",
|
2241
2261
|
"test/spec/models/authentication_spec.rb",
|
data/test/db/schema.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended to check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(:version =>
|
13
|
+
ActiveRecord::Schema.define(:version => 20110713040718) do
|
14
14
|
|
15
15
|
create_table "access_code_requests", :force => true do |t|
|
16
16
|
t.string "email"
|
@@ -24,12 +24,14 @@ ActiveRecord::Schema.define(:version => 20110226174321) do
|
|
24
24
|
|
25
25
|
create_table "access_codes", :force => true do |t|
|
26
26
|
t.string "code"
|
27
|
-
t.integer "uses",
|
28
|
-
t.boolean "unlimited",
|
27
|
+
t.integer "uses", :default => 0, :null => false
|
28
|
+
t.boolean "unlimited", :default => false, :null => false
|
29
29
|
t.datetime "expires_at"
|
30
|
-
t.integer "use_limit",
|
30
|
+
t.integer "use_limit", :default => 1, :null => false
|
31
31
|
t.datetime "created_at"
|
32
32
|
t.datetime "updated_at"
|
33
|
+
t.string "sent_to"
|
34
|
+
t.integer "provided_by_id"
|
33
35
|
end
|
34
36
|
|
35
37
|
add_index "access_codes", ["code"], :name => "index_access_codes_on_code"
|
@@ -448,6 +450,7 @@ ActiveRecord::Schema.define(:version => 20110226174321) do
|
|
448
450
|
t.integer "language_id"
|
449
451
|
t.integer "profile_views"
|
450
452
|
t.text "policy"
|
453
|
+
t.string "photo_remote_url"
|
451
454
|
end
|
452
455
|
|
453
456
|
add_index "profiles", ["lat", "lng"], :name => "index_profiles_on_lat_and_lng"
|
@@ -1,16 +1,12 @@
|
|
1
1
|
jQuery(document).ready(function() {
|
2
2
|
jQuery("#user_login").blur(function(){
|
3
|
-
jQuery.post("/users/is_login_available",{ user_login:jQuery(this).val(), format:'js' },function(data){
|
4
|
-
jQuery("#username-availibility").html(data);
|
5
|
-
});
|
3
|
+
jQuery.post("/users/is_login_available",{ user_login:jQuery(this).val(), format:'js' },function(data){});
|
6
4
|
});
|
7
5
|
jQuery("#user_login").keydown(function() {
|
8
6
|
jQuery("#username-availibility").html('');
|
9
7
|
});
|
10
8
|
jQuery("#user_email").blur(function(){
|
11
|
-
jQuery.post("/users/is_email_available",{ user_email:jQuery(this).val(), format:'js' },function(data){
|
12
|
-
jQuery("#email-availibility").html(data);
|
13
|
-
});
|
9
|
+
jQuery.post("/users/is_email_available",{ user_email:jQuery(this).val(), format:'js' },function(data){});
|
14
10
|
});
|
15
11
|
jQuery("#user_email").keydown(function() {
|
16
12
|
jQuery("#email-availibility").html('');
|
@@ -21,5 +17,4 @@ jQuery(document).ready(function() {
|
|
21
17
|
autoFill: true,
|
22
18
|
mustMatch: false
|
23
19
|
});
|
24
|
-
jQuery('a.fancy-access-request').fancybox({'hideOnContentClick':false, 'overlayShow':true, 'width':375, 'height':300 });
|
25
20
|
});
|
@@ -1,5 +1,149 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
jQuery(document).
|
4
|
-
|
5
|
-
|
1
|
+
// compress with http://closure-compiler.appspot.com/home
|
2
|
+
//jQuery.noConflict();
|
3
|
+
jQuery(document).ajaxSend(function(event, request, settings) {
|
4
|
+
add_headers(request);
|
5
|
+
if (settings.type.toUpperCase() == 'GET' || typeof(AUTH_TOKEN) == "undefined") return; // for details see: http://www.justinball.com/2009/07/08/jquery-ajax-get-in-firefox-post-in-internet-explorer/
|
6
|
+
// settings.data is a serialized string like "foo=bar&baz=boink" (or null)
|
7
|
+
settings.data = settings.data || "";
|
8
|
+
if (typeof(AUTH_TOKEN) != "undefined")
|
9
|
+
settings.data += (settings.data ? "&" : "") + "authenticity_token=" + encodeURIComponent(AUTH_TOKEN);
|
10
|
+
});
|
11
|
+
|
12
|
+
function apply_ajax_forms() {
|
13
|
+
jQuery('form.ajax').ajaxForm({
|
14
|
+
dataType: 'script',
|
15
|
+
beforeSend: add_headers
|
16
|
+
});
|
17
|
+
jQuery('form.ajax').append('<input type="hidden" name="format" value="js" />');
|
18
|
+
}
|
19
|
+
|
20
|
+
function add_headers(xhr){
|
21
|
+
xhr.setRequestHeader("Accept", "text/javascript");
|
22
|
+
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
|
23
|
+
}
|
24
|
+
|
25
|
+
jQuery(document).ready(function() {
|
26
|
+
|
27
|
+
jQuery('a.ajax-delete').live('click', function() {
|
28
|
+
var title = jQuery(this).attr('title');
|
29
|
+
var do_delete = true;
|
30
|
+
if(title.length > 0){
|
31
|
+
do_delete = confirm(title);
|
32
|
+
}
|
33
|
+
if (do_delete){
|
34
|
+
jQuery.post(this.href, { _method: 'delete', format: 'js' }, null, "script");
|
35
|
+
}
|
36
|
+
return false;
|
37
|
+
});
|
38
|
+
|
39
|
+
jQuery('a.ajax-update').live('click', function() {
|
40
|
+
jQuery.post(this.href, { _method: 'put', format: 'js' }, null, "script");
|
41
|
+
return false;
|
42
|
+
});
|
43
|
+
|
44
|
+
jQuery(".submit-form").click(function() {
|
45
|
+
jQuery(this).parent('form').submit();
|
46
|
+
});
|
47
|
+
|
48
|
+
//jQuery("ul.drop-menu").menu();
|
49
|
+
|
50
|
+
apply_ajax_forms();
|
51
|
+
|
52
|
+
jQuery('a.dialog-pop').live('click', function() {
|
53
|
+
var d = jQuery('<div class="dialog"></div>').appendTo("body");
|
54
|
+
d.dialog({ modal: true, autoOpen: false, width: 'auto', title: jQuery(this).attr('title') });
|
55
|
+
d.load(jQuery(this).attr('href'), '', function(){
|
56
|
+
d.dialog("open");
|
57
|
+
apply_ajax_forms();
|
58
|
+
});
|
59
|
+
return false;
|
60
|
+
});
|
61
|
+
|
62
|
+
jQuery(".submit-delete").live('click', function() {
|
63
|
+
jQuery(this).parents('.delete-container').fadeOut();
|
64
|
+
var form = jQuery(this).parents('form');
|
65
|
+
jQuery.post(form.attr('action') + '.json', form.serialize(),
|
66
|
+
function(data){
|
67
|
+
var json = eval('(' + data + ')');
|
68
|
+
if(!json.success){
|
69
|
+
jQuery.jGrowl.info(json.message);
|
70
|
+
}
|
71
|
+
});
|
72
|
+
return false;
|
73
|
+
});
|
74
|
+
|
75
|
+
jQuery(".submit-delete-js").live('click', function() {
|
76
|
+
jQuery(this).parents('.delete-container').fadeOut();
|
77
|
+
var form = jQuery(this).parents('form');
|
78
|
+
jQuery.post(form.attr('action') + '.js', form.serialize(),
|
79
|
+
function(data){
|
80
|
+
});
|
81
|
+
return false;
|
82
|
+
});
|
83
|
+
|
84
|
+
jQuery(document).ready(function() {
|
85
|
+
jQuery('.waiting').hide();
|
86
|
+
jQuery(".wait-button").live('click', function() {
|
87
|
+
jQuery(this).siblings('.waiting').show();
|
88
|
+
jQuery(this).hide();
|
89
|
+
});
|
90
|
+
});
|
91
|
+
|
92
|
+
});
|
93
|
+
|
94
|
+
// String list methods. These are handy for dealing with comma delimited lists
|
95
|
+
// in text boxes such as a list of emails or tags.
|
96
|
+
// Given a comma delimited string add a new item if it isn't in the string
|
97
|
+
function add_to_list(items_string, new_item){
|
98
|
+
var items = split_list(items_string);
|
99
|
+
var add = true;
|
100
|
+
for(i=0;i<items.length;i++){
|
101
|
+
if(items[i] == new_item){ add = false; }
|
102
|
+
}
|
103
|
+
if(add){
|
104
|
+
items.push(new_item);
|
105
|
+
}
|
106
|
+
return items.join(', ');
|
107
|
+
}
|
108
|
+
|
109
|
+
// Given a comma delimited list remove an item from the string
|
110
|
+
function remove_from_list(items_string, remove_item){
|
111
|
+
var items = split_list(items_string);
|
112
|
+
var cleaned = [];
|
113
|
+
for(i=0;i<items.length;i++){
|
114
|
+
if(items[i] != remove_item){
|
115
|
+
cleaned.push(items[i]);
|
116
|
+
}
|
117
|
+
}
|
118
|
+
return cleaned.join(', ');
|
119
|
+
}
|
120
|
+
|
121
|
+
// Split a string on commas
|
122
|
+
function split_list(items_string){
|
123
|
+
if(undefined != items_string && items_string.length > 0){
|
124
|
+
var items = items_string.split(',');
|
125
|
+
} else {
|
126
|
+
var items = [];
|
127
|
+
}
|
128
|
+
var cleaned = [];
|
129
|
+
for(i=0;i<items.length;i++){
|
130
|
+
var cleaned_item = jQuery.trim(items[i]);
|
131
|
+
if(cleaned_item.length > 0){
|
132
|
+
cleaned.push(cleaned_item);
|
133
|
+
}
|
134
|
+
}
|
135
|
+
return cleaned;
|
136
|
+
}
|
137
|
+
|
138
|
+
function isEncodedHtml(str) {
|
139
|
+
if(str.search(/&/g) != -1 || str.search(/</g) != -1 || str.search(/>/g) != -1)
|
140
|
+
return true;
|
141
|
+
else
|
142
|
+
return false;
|
143
|
+
};
|
144
|
+
|
145
|
+
function decodeHtml(str){
|
146
|
+
if(isEncodedHtml(str))
|
147
|
+
return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
148
|
+
return str;
|
149
|
+
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
jQuery(function(){
|
2
|
-
// BUTTONS
|
3
|
-
jQuery('.fg-button').hover(
|
4
|
-
function(){ jQuery(this).removeClass('ui-state-default').addClass('ui-state-focus'); },
|
5
|
-
function(){ jQuery(this).removeClass('ui-state-focus').addClass('ui-state-default'); }
|
6
|
-
);
|
7
|
-
jQuery('.flat').each(function() {
|
8
|
-
jQuery(this).menu({
|
9
|
-
content: jQuery(this).next().html(), // grab content from this page
|
10
|
-
showSpeed: 200
|
11
|
-
});
|
12
|
-
});
|
13
|
-
});
|
@@ -0,0 +1,50 @@
|
|
1
|
+
function setup_country(force_load){
|
2
|
+
|
3
|
+
var country_id = jQuery("#countries").val();
|
4
|
+
var state_id = jQuery("#states").val();
|
5
|
+
|
6
|
+
if (country_id == undefined){
|
7
|
+
return;
|
8
|
+
}
|
9
|
+
|
10
|
+
if (country_id == '-1'){
|
11
|
+
jQuery("#states").val('-1');
|
12
|
+
jQuery("#counties").val('-1');
|
13
|
+
}
|
14
|
+
|
15
|
+
if (country_id == '-1' || country_id == ''){
|
16
|
+
jQuery("#states-container").hide();
|
17
|
+
jQuery("#counties-container").hide();
|
18
|
+
return;
|
19
|
+
}
|
20
|
+
|
21
|
+
if(force_load || state_id == '' || state_id == null || state_id == -1) {
|
22
|
+
jQuery.getJSON("/load_states_for_country/" + country_id + ".json", function(data){
|
23
|
+
var options = '';
|
24
|
+
jQuery("#counties-container").hide();
|
25
|
+
jQuery('#states-container label').html(data.label);
|
26
|
+
states = data.states;
|
27
|
+
if(states.length > 0){
|
28
|
+
for (var i = 0; i < states.length; i++) {
|
29
|
+
var state_id = states[i].state.id;
|
30
|
+
if(state_id == undefined) { state_id = ''; }
|
31
|
+
options += '<option value="' + state_id + '">' + states[i].state.name + '</option>';
|
32
|
+
}
|
33
|
+
jQuery("#states-container").show();
|
34
|
+
jQuery("select#states").html(options);
|
35
|
+
} else {
|
36
|
+
jQuery("#states-container").hide();
|
37
|
+
}
|
38
|
+
});
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
jQuery(document).ready(function() {
|
43
|
+
jQuery("#countries-container select").change(function() {
|
44
|
+
setup_country(true);
|
45
|
+
});
|
46
|
+
if(jQuery("#states").val() == '' || jQuery("#states").val() == null) {
|
47
|
+
jQuery("#states-container").hide();
|
48
|
+
}
|
49
|
+
setup_country(false);
|
50
|
+
});
|
@@ -0,0 +1,134 @@
|
|
1
|
+
function apply_add_feed(){
|
2
|
+
jQuery('.add-identity').bind('submit', function(){
|
3
|
+
jQuery('#submit_add_feed').hide();
|
4
|
+
jQuery('#finding_uri_message').show();
|
5
|
+
jQuery(this).ajaxSubmit({
|
6
|
+
dataType: 'script',
|
7
|
+
beforeSend: add_headers
|
8
|
+
});
|
9
|
+
return false;
|
10
|
+
});
|
11
|
+
}
|
12
|
+
|
13
|
+
function apply_delete_feed(){
|
14
|
+
jQuery('.identity-feed-delete').bind('submit', function(){
|
15
|
+
jQuery(this).replaceWith(jQuery(jQuery('#muck_ajax_delete_control_message').html()).show());
|
16
|
+
jQuery(this).ajaxSubmit({
|
17
|
+
dataType: 'script',
|
18
|
+
beforeSend: add_headers
|
19
|
+
});
|
20
|
+
return false;
|
21
|
+
});
|
22
|
+
}
|
23
|
+
|
24
|
+
function apply_delete_hover(){
|
25
|
+
jQuery('ul#my-services-list li form').hide();
|
26
|
+
jQuery('ul#my-services-list li').hover(function(){
|
27
|
+
jQuery(this).children('form').show(); }, function(){
|
28
|
+
jQuery(this).children('form').hide(); });
|
29
|
+
}
|
30
|
+
|
31
|
+
function apply_show_entry_content(){
|
32
|
+
jQuery('.combined-feed-list .feed-item .feed-title').hover(
|
33
|
+
function () {
|
34
|
+
jQuery(this).next('.combined-feed-list .feed-item .feed-content').show();
|
35
|
+
},
|
36
|
+
function () {
|
37
|
+
jQuery(this).next('.combined-feed-list .feed-item .feed-content').hide();
|
38
|
+
}
|
39
|
+
);
|
40
|
+
jQuery('.combined-feed-list .feed-item .feed-content').hover(
|
41
|
+
function () {
|
42
|
+
jQuery(this).show();
|
43
|
+
},
|
44
|
+
function () {
|
45
|
+
jQuery(this).hide();
|
46
|
+
}
|
47
|
+
);
|
48
|
+
}
|
49
|
+
|
50
|
+
function show_tool(tool) {
|
51
|
+
jQuery('.tool').hide();
|
52
|
+
jQuery('#content_iframe').width('75%');
|
53
|
+
jQuery('#' + tool + '_tool').show();
|
54
|
+
jQuery('#recs_panel').css("left", jQuery("#content_iframe").width() - 252);
|
55
|
+
maximize_space();
|
56
|
+
return false;
|
57
|
+
}
|
58
|
+
function maximize_space() {
|
59
|
+
var container = jQuery(".tools_container");
|
60
|
+
var spacer = jQuery('#comments_tools_close_wrapper').height() + 5;
|
61
|
+
container.height(jQuery(window).height() - (jQuery('#toolbar').height() + spacer));
|
62
|
+
}
|
63
|
+
function setup_entry_comment_submit(){
|
64
|
+
jQuery(".entry-comment-submit").click(function() {
|
65
|
+
jQuery(this).siblings('textarea').hide();
|
66
|
+
jQuery(".entry-comment-submit").hide();
|
67
|
+
jQuery(this).parent().append('<p class="entry-comment-loading"><img src="/images/spinner.gif" alt="loading..." /> ' + ADD_COMMENT_MESSAGE + '</p>');
|
68
|
+
var form = jQuery(this).parents('form');
|
69
|
+
jQuery.post(form.attr('action'), form.serialize() + '&format=json',
|
70
|
+
function(data){
|
71
|
+
var json = eval('(' + data + ')');
|
72
|
+
if(!json.success){
|
73
|
+
jQuery.jGrowl.info(json.message);
|
74
|
+
} else {
|
75
|
+
jQuery('.entry-comment-loading').remove();
|
76
|
+
jQuery('#comments_tool').find('textarea').show();
|
77
|
+
jQuery('#comments_tool').find('textarea').val('');
|
78
|
+
jQuery(".entry-comment-submit").show();
|
79
|
+
jQuery("#comments_container").animate({ scrollTop: jQuery("#comments_tool").attr("scrollHeight") }, 3000);
|
80
|
+
var contents = jQuery(json.html)
|
81
|
+
contents.hide();
|
82
|
+
jQuery('#comments_wrapper').append(contents);
|
83
|
+
contents.fadeIn("slow");
|
84
|
+
apply_frame_comment_hover();
|
85
|
+
}
|
86
|
+
});
|
87
|
+
return false;
|
88
|
+
});
|
89
|
+
}
|
90
|
+
function apply_frame_comment_hover(){
|
91
|
+
jQuery('.comment_holder').hover(
|
92
|
+
function () { jQuery(this).addClass('comment-hover'); },
|
93
|
+
function () { jQuery(this).removeClass('comment-hover'); } );
|
94
|
+
}
|
95
|
+
function setup_share_submit(){
|
96
|
+
jQuery('#share_submit_share_new').click(function() {
|
97
|
+
jQuery(this).parent().append('<p class="share-loading"><img src="/images/spinner.gif" alt="loading..." /> ' + ADD_SHARE_MESSAGE + '</p>');
|
98
|
+
jQuery('#share_submit_share_new').hide();
|
99
|
+
var form = jQuery(this).parents('form');
|
100
|
+
jQuery.post(form.attr('action'), form.serialize() + '&format=json',
|
101
|
+
function(data){
|
102
|
+
var json = eval('(' + data + ')');
|
103
|
+
jQuery('.share-loading').remove();
|
104
|
+
jQuery('#share_submit_share_new').show();
|
105
|
+
if(!json.success){
|
106
|
+
jQuery.jGrowl.info(json.message);
|
107
|
+
} else {
|
108
|
+
jQuery.jGrowl.info(json.message);
|
109
|
+
}
|
110
|
+
});
|
111
|
+
return false;
|
112
|
+
});
|
113
|
+
}
|
114
|
+
|
115
|
+
jQuery(document).ready(function() {
|
116
|
+
jQuery("#content_iframe").load(maximize_iframe_height);
|
117
|
+
jQuery(window).bind('resize', function() {
|
118
|
+
maximize_iframe_height();
|
119
|
+
});
|
120
|
+
});
|
121
|
+
|
122
|
+
function maximize_iframe_height() {
|
123
|
+
var frame = jQuery("#content_iframe");
|
124
|
+
frame.height(jQuery(window).height() - jQuery('#toolbar').height());
|
125
|
+
jQuery('#recs_panel').css("left", jQuery("#content_iframe").width() - 252);
|
126
|
+
}
|
127
|
+
|
128
|
+
function initRecsPanel() {
|
129
|
+
var panel = jQuery("#recs_panel");
|
130
|
+
panel.append("<div id='rec_close_box' title='Close'>x</div>");
|
131
|
+
jQuery("#rec_close_box").click(function() {jQuery("#recs_panel").hide();jQuery("#show_recommendations_link").show();return false;});
|
132
|
+
panel.css("left", jQuery("#toolbar").width() - 250);
|
133
|
+
if (panel.draggable) panel.draggable();
|
134
|
+
}
|
@@ -40,18 +40,6 @@ ul.admin-list li a{font-size:1.2em;}
|
|
40
40
|
.adminTable tr{background-color:#fff;}
|
41
41
|
.adminTable table{border:2px solid #c4ad63;}
|
42
42
|
.adminTable tr td{font-size:1.1em;font-weight:bold;padding:5px;border-bottom:1px solid #eee;}
|
43
|
-
/* menu styles*/
|
44
|
-
.hidden { position:absolute; top:0; left:-9999px; width:1px; height:1px; overflow:hidden; }
|
45
|
-
.fg-button { font-size:11px; clear:left; padding: .4em 1em; text-decoration:none !important; cursor:pointer; position: relative; text-align: center; zoom: 1; }
|
46
|
-
.fg-button .ui-icon { position: absolute; top: 50%; margin-top: -8px; left: 50%; margin-left: -8px; }
|
47
|
-
a.fg-button { float:left; }
|
48
|
-
button.fg-button { width:auto; overflow:visible; } /* removes extra button width in IE */
|
49
|
-
.fg-button-icon-left { padding-left: 2.1em; }
|
50
|
-
.fg-button-icon-right { padding-right: 2.1em; }
|
51
|
-
.fg-button-icon-left .ui-icon { right: auto; left: .2em; margin-left: 0; }
|
52
|
-
.fg-button-icon-right .ui-icon { left: auto; right: .2em; margin-left: 0; }
|
53
|
-
.fg-button-icon-solo { display:block; width:8px; text-indent: -9999px; } /* solo icon buttons must have block properties for the text-indent to work */
|
54
|
-
.fg-button.ui-state-loading .ui-icon { background: url(spinner_bar.gif) no-repeat 0 0;}
|
55
43
|
/*tabs*/
|
56
44
|
.tabs{font-size:1.2em;border-bottom:solid 2px #000;position:relative;}
|
57
45
|
.tabs ul{list-style-type:none;}
|
@@ -59,4 +47,29 @@ button.fg-button { width:auto; overflow:visible; } /* removes extra button width
|
|
59
47
|
.tabs ul li a{color:#000;text-decoration:none;}
|
60
48
|
.tabs ul li a:hover{color:#333;}
|
61
49
|
.tabs ul li a.active{background-position:0 bottom;color:#fff;}
|
62
|
-
.tabs ul li a.active span{background-position:right bottom;}
|
50
|
+
.tabs ul li a.active span{background-position:right bottom;}
|
51
|
+
/* forms */
|
52
|
+
input{margin:0 10px 5px 0;padding:4px;font-size:1.3em;}
|
53
|
+
input[type="text"],input[type="password"]{border:1px solid #8f8685;}
|
54
|
+
input[type="checkbox"]{border:none;margin-bottom:0px;}
|
55
|
+
input[type="radio"]{border:none;}
|
56
|
+
textarea{font-size:1.4em;margin:0 10px 0 0;padding:4px;border:1px solid #8f8685;}
|
57
|
+
label{font-size:1.2em;font-weight:bold;margin:0 10px 5px 0;padding:0px;display:block;}
|
58
|
+
form em{color:#b61e12;font-style:normal;font-size:90%;}
|
59
|
+
form hr{border:1px solid #e3e0c3;height:1px;margin:15px 0;}
|
60
|
+
fieldset span.var{margin:2px 5px 5px 18px;display:block;}
|
61
|
+
fieldset{border:none;margin:0;padding:0;}
|
62
|
+
form fieldset{margin:0 0 2px;padding:0px;}
|
63
|
+
form fieldset input[type="text"],form fieldset input[type="password"]{width:500px;}
|
64
|
+
.form-help{font-size:12px;}
|
65
|
+
|
66
|
+
.checkbox-label{display:inline-block;}
|
67
|
+
.checklist{padding:0px;margin:0px 0 0 10px;}
|
68
|
+
.checklist input[type="checkbox"]{float:left;clear:left;}
|
69
|
+
.checklist label{display:inline;}
|
70
|
+
|
71
|
+
.user-active{}
|
72
|
+
.user-inactive{color:#ccc;}
|
73
|
+
.drop-menu ul{list-style-type:none;}
|
74
|
+
|
75
|
+
.ui-autocomplete-loading { background: white url('/images/spinner.gif') right center no-repeat; }
|
@@ -5,4 +5,6 @@
|
|
5
5
|
/*register*/
|
6
6
|
#registration{width:400px;}
|
7
7
|
span#email-availibility span.available { color:green; }
|
8
|
-
span#email-availibility span.unavailable { color:#B61E12; }
|
8
|
+
span#email-availibility span.unavailable { color:#B61E12; }
|
9
|
+
|
10
|
+
#access-code-not-found-msg a{text-decoration:underline;}
|
@@ -5,7 +5,13 @@ describe Authentication do
|
|
5
5
|
@authentication = Factory(:authentication, :provider => 'twitter')
|
6
6
|
@user = @authentication.authenticatable
|
7
7
|
end
|
8
|
+
|
8
9
|
it { should belong_to :authenticatable }
|
10
|
+
it { should scope_by_latest }
|
11
|
+
it { should scope_by_newest }
|
12
|
+
it { should scope_by_oldest }
|
13
|
+
it { should scope_newer_than }
|
14
|
+
it { should scope_older_than }
|
9
15
|
|
10
16
|
describe "access_token" do
|
11
17
|
it "should get the access_token for twitter" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muck-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 3.5.
|
9
|
+
- 3
|
10
|
+
version: 3.5.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Justin Ball
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-07-
|
18
|
+
date: 2011-07-13 00:00:00 -06:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -262,6 +262,9 @@ files:
|
|
262
262
|
- test/db/migrate/20101117172951_add_name_to_access_code_requests.rb
|
263
263
|
- test/db/migrate/20110216045051_create_authentications.rb
|
264
264
|
- test/db/migrate/20110226174321_add_cached_slugs.rb
|
265
|
+
- test/db/migrate/20110303183433_add_sent_to_to_access_codes.rb
|
266
|
+
- test/db/migrate/20110420153714_add_provided_by_to_access_codes.rb
|
267
|
+
- test/db/migrate/20110713040718_add_photo_url.rb
|
265
268
|
- test/db/schema.rb
|
266
269
|
- test/db/seeds.rb
|
267
270
|
- test/features/step_definitions/common_steps.rb
|
@@ -781,6 +784,8 @@ files:
|
|
781
784
|
- test/public/javascripts/muck.js
|
782
785
|
- test/public/javascripts/muck_activities.js
|
783
786
|
- test/public/javascripts/muck_admin.js
|
787
|
+
- test/public/javascripts/muck_countries.js
|
788
|
+
- test/public/javascripts/muck_services-src.js
|
784
789
|
- test/public/javascripts/muck_services.js
|
785
790
|
- test/public/javascripts/muck_time/en.js
|
786
791
|
- test/public/javascripts/prototype.js
|
@@ -2317,6 +2322,21 @@ files:
|
|
2317
2322
|
- test/public/stylesheets/swfupload.css
|
2318
2323
|
- test/public/stylesheets/tinymce.css
|
2319
2324
|
- test/public/stylesheets/uploadify.css
|
2325
|
+
- test/public/system/photos/32/icon/GettyImages_79495526-1-0_bigger.jpg
|
2326
|
+
- test/public/system/photos/32/medium/GettyImages_79495526-1-0_bigger.jpg
|
2327
|
+
- test/public/system/photos/32/original/GettyImages_79495526-1-0_bigger.jpg
|
2328
|
+
- test/public/system/photos/32/thumb/GettyImages_79495526-1-0_bigger.jpg
|
2329
|
+
- test/public/system/photos/32/tiny/GettyImages_79495526-1-0_bigger.jpg
|
2330
|
+
- test/public/system/photos/33/icon/GettyImages_79495526-1-0_bigger.jpg
|
2331
|
+
- test/public/system/photos/33/medium/GettyImages_79495526-1-0_bigger.jpg
|
2332
|
+
- test/public/system/photos/33/original/GettyImages_79495526-1-0_bigger.jpg
|
2333
|
+
- test/public/system/photos/33/thumb/GettyImages_79495526-1-0_bigger.jpg
|
2334
|
+
- test/public/system/photos/33/tiny/GettyImages_79495526-1-0_bigger.jpg
|
2335
|
+
- test/public/system/photos/34/icon/GettyImages_79495526-1-0_bigger.jpg
|
2336
|
+
- test/public/system/photos/34/medium/GettyImages_79495526-1-0_bigger.jpg
|
2337
|
+
- test/public/system/photos/34/original/GettyImages_79495526-1-0_bigger.jpg
|
2338
|
+
- test/public/system/photos/34/thumb/GettyImages_79495526-1-0_bigger.jpg
|
2339
|
+
- test/public/system/photos/34/tiny/GettyImages_79495526-1-0_bigger.jpg
|
2320
2340
|
- test/script/rails
|
2321
2341
|
- test/spec/controllers/authentications_controller_spec.rb
|
2322
2342
|
- test/spec/models/authentication_spec.rb
|