avatars_for_rails 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/{lib/generators/avatars_for_rails/templates/public → app/assets}/images/Jcrop.gif +0 -0
- data/{lib/generators/avatars_for_rails/templates/public → app/assets}/images/cancel.png +0 -0
- data/avatars_for_rails.gemspec +1 -1
- data/vendor/assets/javascripts/jquery.fileupload-ui.js +333 -63
- data/vendor/assets/javascripts/jquery.fileupload.js +654 -173
- data/vendor/assets/stylesheets/jquery.fileupload-ui.css +91 -21
- metadata +27 -46
- data/lib/generators/avatars_for_rails/templates/public/images/pbar-ani.gif +0 -0
- data/lib/generators/avatars_for_rails/templates/public/images/rails.png +0 -0
- data/lib/generators/avatars_for_rails/templates/public/javascripts/application.js +0 -2
- data/lib/generators/avatars_for_rails/templates/public/javascripts/avatars.js +0 -8
- data/lib/generators/avatars_for_rails/templates/public/javascripts/controls.js +0 -965
- data/lib/generators/avatars_for_rails/templates/public/javascripts/dragdrop.js +0 -974
- data/lib/generators/avatars_for_rails/templates/public/javascripts/effects.js +0 -1123
- data/lib/generators/avatars_for_rails/templates/public/javascripts/jquery-ui.min.js +0 -401
- data/lib/generators/avatars_for_rails/templates/public/javascripts/jquery.Jcrop.min.js +0 -163
- data/lib/generators/avatars_for_rails/templates/public/javascripts/jquery.fileupload-ui.js +0 -529
- data/lib/generators/avatars_for_rails/templates/public/javascripts/jquery.fileupload.js +0 -956
- data/lib/generators/avatars_for_rails/templates/public/javascripts/jquery.form.js +0 -815
- data/lib/generators/avatars_for_rails/templates/public/javascripts/jquery.js +0 -7179
- data/lib/generators/avatars_for_rails/templates/public/javascripts/prototype.js +0 -6001
- data/lib/generators/avatars_for_rails/templates/public/javascripts/rails.js +0 -158
- data/lib/generators/avatars_for_rails/templates/public/stylesheets/.gitkeep +0 -0
- data/lib/generators/avatars_for_rails/templates/public/stylesheets/avatars.css +0 -115
- data/lib/generators/avatars_for_rails/templates/public/stylesheets/jquery.Jcrop.css +0 -35
- data/lib/generators/avatars_for_rails/templates/public/stylesheets/jquery.fileupload-ui.css +0 -140
@@ -1,158 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Unobtrusive scripting adapter for jQuery
|
3
|
-
*
|
4
|
-
* Requires jQuery 1.4.3 or later.
|
5
|
-
* https://github.com/rails/jquery-ujs
|
6
|
-
*/
|
7
|
-
|
8
|
-
(function($) {
|
9
|
-
// Make sure that every Ajax request sends the CSRF token
|
10
|
-
function CSRFProtection(xhr) {
|
11
|
-
var token = $('meta[name="csrf-token"]').attr('content');
|
12
|
-
if (token) xhr.setRequestHeader('X-CSRF-Token', token);
|
13
|
-
}
|
14
|
-
if ('ajaxPrefilter' in $) $.ajaxPrefilter(function(options, originalOptions, xhr){ CSRFProtection(xhr) });
|
15
|
-
else $(document).ajaxSend(function(e, xhr){ CSRFProtection(xhr) });
|
16
|
-
|
17
|
-
// Triggers an event on an element and returns the event result
|
18
|
-
function fire(obj, name, data) {
|
19
|
-
var event = $.Event(name);
|
20
|
-
obj.trigger(event, data);
|
21
|
-
return event.result !== false;
|
22
|
-
}
|
23
|
-
|
24
|
-
// Submits "remote" forms and links with ajax
|
25
|
-
function handleRemote(element) {
|
26
|
-
var method, url, data,
|
27
|
-
dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType);
|
28
|
-
|
29
|
-
if (fire(element, 'ajax:before')) {
|
30
|
-
if (element.is('form')) {
|
31
|
-
method = element.attr('method');
|
32
|
-
url = element.attr('action');
|
33
|
-
data = element.serializeArray();
|
34
|
-
// memoized value from clicked submit button
|
35
|
-
var button = element.data('ujs:submit-button');
|
36
|
-
if (button) {
|
37
|
-
data.push(button);
|
38
|
-
element.data('ujs:submit-button', null);
|
39
|
-
}
|
40
|
-
} else {
|
41
|
-
method = element.data('method');
|
42
|
-
url = element.attr('href');
|
43
|
-
data = null;
|
44
|
-
}
|
45
|
-
$.ajax({
|
46
|
-
url: url, type: method || 'GET', data: data, dataType: dataType,
|
47
|
-
// stopping the "ajax:beforeSend" event will cancel the ajax request
|
48
|
-
beforeSend: function(xhr, settings) {
|
49
|
-
if (settings.dataType === undefined) {
|
50
|
-
xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
|
51
|
-
}
|
52
|
-
return fire(element, 'ajax:beforeSend', [xhr, settings]);
|
53
|
-
},
|
54
|
-
success: function(data, status, xhr) {
|
55
|
-
element.trigger('ajax:success', [data, status, xhr]);
|
56
|
-
},
|
57
|
-
complete: function(xhr, status) {
|
58
|
-
element.trigger('ajax:complete', [xhr, status]);
|
59
|
-
},
|
60
|
-
error: function(xhr, status, error) {
|
61
|
-
element.trigger('ajax:error', [xhr, status, error]);
|
62
|
-
}
|
63
|
-
});
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
// Handles "data-method" on links such as:
|
68
|
-
// <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
|
69
|
-
function handleMethod(link) {
|
70
|
-
var href = link.attr('href'),
|
71
|
-
method = link.data('method'),
|
72
|
-
csrf_token = $('meta[name=csrf-token]').attr('content'),
|
73
|
-
csrf_param = $('meta[name=csrf-param]').attr('content'),
|
74
|
-
form = $('<form method="post" action="' + href + '"></form>'),
|
75
|
-
metadata_input = '<input name="_method" value="' + method + '" type="hidden" />';
|
76
|
-
|
77
|
-
if (csrf_param !== undefined && csrf_token !== undefined) {
|
78
|
-
metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
|
79
|
-
}
|
80
|
-
|
81
|
-
form.hide().append(metadata_input).appendTo('body');
|
82
|
-
form.submit();
|
83
|
-
}
|
84
|
-
|
85
|
-
function disableFormElements(form) {
|
86
|
-
form.find('input[data-disable-with]').each(function() {
|
87
|
-
var input = $(this);
|
88
|
-
input.data('ujs:enable-with', input.val())
|
89
|
-
.val(input.data('disable-with'))
|
90
|
-
.attr('disabled', 'disabled');
|
91
|
-
});
|
92
|
-
}
|
93
|
-
|
94
|
-
function enableFormElements(form) {
|
95
|
-
form.find('input[data-disable-with]').each(function() {
|
96
|
-
var input = $(this);
|
97
|
-
input.val(input.data('ujs:enable-with')).removeAttr('disabled');
|
98
|
-
});
|
99
|
-
}
|
100
|
-
|
101
|
-
function allowAction(element) {
|
102
|
-
var message = element.data('confirm');
|
103
|
-
return !message || (fire(element, 'confirm') && confirm(message));
|
104
|
-
}
|
105
|
-
|
106
|
-
function requiredValuesMissing(form) {
|
107
|
-
var missing = false;
|
108
|
-
form.find('input[name][required]').each(function() {
|
109
|
-
if (!$(this).val()) missing = true;
|
110
|
-
});
|
111
|
-
return missing;
|
112
|
-
}
|
113
|
-
|
114
|
-
$('a[data-confirm], a[data-method], a[data-remote]').live('click.rails', function(e) {
|
115
|
-
var link = $(this);
|
116
|
-
if (!allowAction(link)) return false;
|
117
|
-
|
118
|
-
if (link.data('remote') != undefined) {
|
119
|
-
handleRemote(link);
|
120
|
-
return false;
|
121
|
-
} else if (link.data('method')) {
|
122
|
-
handleMethod(link);
|
123
|
-
return false;
|
124
|
-
}
|
125
|
-
});
|
126
|
-
|
127
|
-
$('form').live('submit.rails', function(e) {
|
128
|
-
var form = $(this), remote = form.data('remote') != undefined;
|
129
|
-
if (!allowAction(form)) return false;
|
130
|
-
|
131
|
-
// skip other logic when required values are missing
|
132
|
-
if (requiredValuesMissing(form)) return !remote;
|
133
|
-
|
134
|
-
if (remote) {
|
135
|
-
handleRemote(form);
|
136
|
-
return false;
|
137
|
-
} else {
|
138
|
-
// slight timeout so that the submit button gets properly serialized
|
139
|
-
setTimeout(function(){ disableFormElements(form) }, 13);
|
140
|
-
}
|
141
|
-
});
|
142
|
-
|
143
|
-
$('form input[type=submit], form button[type=submit], form button:not([type])').live('click.rails', function() {
|
144
|
-
var button = $(this);
|
145
|
-
if (!allowAction(button)) return false;
|
146
|
-
// register the pressed submit button
|
147
|
-
var name = button.attr('name'), data = name ? {name:name, value:button.val()} : null;
|
148
|
-
button.closest('form').data('ujs:submit-button', data);
|
149
|
-
});
|
150
|
-
|
151
|
-
$('form').live('ajax:beforeSend.rails', function(event) {
|
152
|
-
if (this == event.target) disableFormElements($(this));
|
153
|
-
});
|
154
|
-
|
155
|
-
$('form').live('ajax:complete.rails', function(event) {
|
156
|
-
if (this == event.target) enableFormElements($(this));
|
157
|
-
});
|
158
|
-
})( jQuery );
|
File without changes
|
@@ -1,115 +0,0 @@
|
|
1
|
-
/******************** Common ***********************/
|
2
|
-
*{
|
3
|
-
font-family: Arial;
|
4
|
-
font-size: 11px;
|
5
|
-
}
|
6
|
-
|
7
|
-
.clearfloat { clear: both; height: 0px;}
|
8
|
-
.space_center { padding-top: 9px; padding-right: 4px; text-align: center;}
|
9
|
-
h2{padding-left:10px;font-size: 14px;color: #2A3890;}
|
10
|
-
/******************** Avatars ***********************/
|
11
|
-
.avatars {
|
12
|
-
padding-left: 10px;
|
13
|
-
}
|
14
|
-
.avatar {
|
15
|
-
float:left;
|
16
|
-
position:relative;
|
17
|
-
}
|
18
|
-
.avatar .actions {
|
19
|
-
}
|
20
|
-
.avatar .delete_avatar {
|
21
|
-
position:absolute;
|
22
|
-
top:5px;
|
23
|
-
right:5px;
|
24
|
-
display:none;
|
25
|
-
}
|
26
|
-
.avatar .default {
|
27
|
-
border: 5px solid #2A3890;
|
28
|
-
}
|
29
|
-
.avatar .non_default {
|
30
|
-
border: 5px solid #E0EEF5;
|
31
|
-
}
|
32
|
-
/******************** New form ***********************/
|
33
|
-
.new_logo_form {
|
34
|
-
}
|
35
|
-
/******************** Slide Effect ***********************/
|
36
|
-
.boxgrid {
|
37
|
-
width: 104px;
|
38
|
-
height: 104px;
|
39
|
-
float:left;
|
40
|
-
overflow: hidden;
|
41
|
-
position: relative;
|
42
|
-
}
|
43
|
-
.boxgrid img {
|
44
|
-
position: absolute;
|
45
|
-
top: 0;
|
46
|
-
left: 0;
|
47
|
-
border: 0;
|
48
|
-
}
|
49
|
-
.boxcaption {
|
50
|
-
top: 104px;
|
51
|
-
left: 5px;
|
52
|
-
float: left;
|
53
|
-
position: absolute;
|
54
|
-
background: #E0EEF5;
|
55
|
-
opacity: .8;
|
56
|
-
width: 84px;
|
57
|
-
height: 28px;
|
58
|
-
/* For IE 5-7 */
|
59
|
-
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
|
60
|
-
/* For IE 8 */
|
61
|
-
-MS-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
|
62
|
-
}
|
63
|
-
.captionfull .boxcaption {
|
64
|
-
top: 104px;
|
65
|
-
left: 5px;
|
66
|
-
padding: 5px;
|
67
|
-
}
|
68
|
-
/**************** Crop **************/
|
69
|
-
#precropDiv {
|
70
|
-
width:499px;
|
71
|
-
display:inline-block;
|
72
|
-
padding: 0px 30px 0px 29px;
|
73
|
-
}
|
74
|
-
#precropPrev {
|
75
|
-
vertical-align:top;
|
76
|
-
display:inline-block;
|
77
|
-
/*padding: 5px 4px 5px 4px;*/
|
78
|
-
}
|
79
|
-
#precropPrevImg {
|
80
|
-
width:100px;
|
81
|
-
height:100px;
|
82
|
-
overflow:hidden;
|
83
|
-
margin-left:30px;
|
84
|
-
border: 1px solid #E0EEF5;
|
85
|
-
}
|
86
|
-
/************** BLOCK DIV SECTION *********/
|
87
|
-
.block .content{ padding: 5px 4px 5px 4px;}
|
88
|
-
.block .form_row { display: block; padding:5px; padding-left:20px; }
|
89
|
-
|
90
|
-
|
91
|
-
/*************REVIEW ********************/
|
92
|
-
* { margin: 0; padding: 0; font-family: Arial; }
|
93
|
-
html, body {height: 100%;}
|
94
|
-
.p { margin: 0px; padding: 0px; font-size: inherit; font-family: inherit; font-weight: inherit;
|
95
|
-
text-align: inherit; color: inherit; line-height: inherit; vertical-align: top;}
|
96
|
-
p { padding-top: 0px; margin-top: 0px;}
|
97
|
-
img { border: 0px;}
|
98
|
-
div { margin: 0px; padding: 0px; font-family: Helvetica; font-size: 11px;}
|
99
|
-
.AbsWrap { width: 100%; position: relative;}
|
100
|
-
.rowWrap { width: 100%;}
|
101
|
-
a:link,a:visited { color: inherit; text-decoration: inherit;}
|
102
|
-
a:hover { text-decoration: underline;}
|
103
|
-
.clearfloat { clear: both; height: 0px;}
|
104
|
-
h2{padding-left:10px;}
|
105
|
-
body{font-size:1.0em; color:#2A3890; background-color:#ffffff; }
|
106
|
-
#wrapper { background-color: #f5f5f5; width: 100%; margin: 0px auto; }
|
107
|
-
#wrapper_body{min-height: 552px; width: 960px; margin:0px auto; margin-left: auto; margin-right: auto;
|
108
|
-
margin-top: auto; margin-bottom:auto;}
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
.button{margin: 10px 0 10px 10px;padding: 3px 3px 3px 3px;color:#FFFFFF;background-color: #1F4A75;}
|
114
|
-
|
115
|
-
|
@@ -1,35 +0,0 @@
|
|
1
|
-
/* Fixes issue here http://code.google.com/p/jcrop/issues/detail?id=1 */
|
2
|
-
.jcrop-holder { text-align: left; }
|
3
|
-
|
4
|
-
.jcrop-vline, .jcrop-hline
|
5
|
-
{
|
6
|
-
font-size: 0;
|
7
|
-
position: absolute;
|
8
|
-
background: white url('Jcrop.gif') top left repeat;
|
9
|
-
}
|
10
|
-
.jcrop-vline { height: 100%; width: 1px !important; }
|
11
|
-
.jcrop-hline { width: 100%; height: 1px !important; }
|
12
|
-
.jcrop-handle {
|
13
|
-
font-size: 1px;
|
14
|
-
width: 7px !important;
|
15
|
-
height: 7px !important;
|
16
|
-
border: 1px #eee solid;
|
17
|
-
background-color: #333;
|
18
|
-
*width: 9px;
|
19
|
-
*height: 9px;
|
20
|
-
}
|
21
|
-
|
22
|
-
.jcrop-tracker { width: 100%; height: 100%; }
|
23
|
-
|
24
|
-
.custom .jcrop-vline,
|
25
|
-
.custom .jcrop-hline
|
26
|
-
{
|
27
|
-
background: yellow;
|
28
|
-
}
|
29
|
-
.custom .jcrop-handle
|
30
|
-
{
|
31
|
-
border-color: black;
|
32
|
-
background-color: #C7BB00;
|
33
|
-
-moz-border-radius: 3px;
|
34
|
-
-webkit-border-radius: 3px;
|
35
|
-
}
|
@@ -1,140 +0,0 @@
|
|
1
|
-
@charset 'UTF-8';
|
2
|
-
/*
|
3
|
-
* jQuery File Upload Plugin CSS 4.1
|
4
|
-
* https://github.com/blueimp/jQuery-File-Upload
|
5
|
-
*
|
6
|
-
* Copyright 2010, Sebastian Tschan
|
7
|
-
* https://blueimp.net
|
8
|
-
*
|
9
|
-
* Licensed under the MIT license:
|
10
|
-
* http://creativecommons.org/licenses/MIT/
|
11
|
-
*/
|
12
|
-
|
13
|
-
form.file_upload {
|
14
|
-
position: relative;
|
15
|
-
overflow: hidden;
|
16
|
-
direction: ltr;
|
17
|
-
cursor: pointer;
|
18
|
-
text-align: center;
|
19
|
-
color: #333;
|
20
|
-
font-weight: bold;
|
21
|
-
-moz-border-radius: 10px;
|
22
|
-
-webkit-border-radius: 10px;
|
23
|
-
border-radius: 10px;
|
24
|
-
width: 15em;
|
25
|
-
height: 2.5em;
|
26
|
-
line-height: 2.5em;
|
27
|
-
background: palegreen;
|
28
|
-
border: 1px solid limegreen;
|
29
|
-
}
|
30
|
-
|
31
|
-
form.file_upload_small {
|
32
|
-
width: 15em;
|
33
|
-
height: 2.5em;
|
34
|
-
line-height: 2.5em;
|
35
|
-
font-size: 100%;
|
36
|
-
background: palegreen;
|
37
|
-
border: 1px solid limegreen;
|
38
|
-
}
|
39
|
-
|
40
|
-
form.file_upload_large {
|
41
|
-
width: 100%;
|
42
|
-
height: 7em;
|
43
|
-
line-height: 7em;
|
44
|
-
font-size: 2em;
|
45
|
-
background: palegreen;
|
46
|
-
border: 1px solid limegreen;
|
47
|
-
}
|
48
|
-
|
49
|
-
form.file_upload_highlight,
|
50
|
-
form.file_upload:hover {
|
51
|
-
background: lawngreen;
|
52
|
-
}
|
53
|
-
|
54
|
-
form.file_upload input {
|
55
|
-
position: absolute;
|
56
|
-
top: 0;
|
57
|
-
right: 0;
|
58
|
-
margin: 0;
|
59
|
-
border: 300px solid transparent;
|
60
|
-
opacity: 0;
|
61
|
-
-ms-filter: 'alpha(opacity=0)';
|
62
|
-
filter: alpha(opacity=0);
|
63
|
-
-o-transform: translate(-300px, -300px) scale(10);
|
64
|
-
-moz-transform: translate(-800px, 0) scale(10);
|
65
|
-
cursor: pointer;
|
66
|
-
height: 100%;
|
67
|
-
}
|
68
|
-
|
69
|
-
:root form.file_upload input {
|
70
|
-
height: auto;
|
71
|
-
}
|
72
|
-
|
73
|
-
form.file_upload button,
|
74
|
-
.no-js .file_upload_label,
|
75
|
-
.no-js .file_upload_overall_progress,
|
76
|
-
.no-js .file_upload_buttons {
|
77
|
-
display: none;
|
78
|
-
}
|
79
|
-
|
80
|
-
.file_upload .file_upload_label,
|
81
|
-
.file_upload .file_upload_overall_progress,
|
82
|
-
.file_upload .file_upload_buttons {
|
83
|
-
display: block;
|
84
|
-
}
|
85
|
-
|
86
|
-
.file_upload img {
|
87
|
-
border: none;
|
88
|
-
}
|
89
|
-
|
90
|
-
.progressbar, .progressbar div {
|
91
|
-
border: 1px solid #aaa;
|
92
|
-
-moz-border-radius: 4px;
|
93
|
-
-webkit-border-radius: 4px;
|
94
|
-
border-radius: 4px;
|
95
|
-
}
|
96
|
-
|
97
|
-
.progressbar div {
|
98
|
-
width: 100%;
|
99
|
-
height: 100%;
|
100
|
-
margin: -1px;
|
101
|
-
}
|
102
|
-
|
103
|
-
.file_upload_progress .ui-progressbar-value,
|
104
|
-
.file_upload_overall_progress .ui-progressbar-value,
|
105
|
-
.progressbar div {
|
106
|
-
background: url(pbar-ani.gif);
|
107
|
-
}
|
108
|
-
|
109
|
-
.file_upload_progress div {
|
110
|
-
width: 150px;
|
111
|
-
height: 17px;
|
112
|
-
}
|
113
|
-
|
114
|
-
.file_upload_overall_progress div {
|
115
|
-
width: 350px;
|
116
|
-
height: 17px;
|
117
|
-
}
|
118
|
-
|
119
|
-
.file_upload .file_name {
|
120
|
-
padding: 0 10px;
|
121
|
-
font-size: 1.1em;
|
122
|
-
}
|
123
|
-
|
124
|
-
.file_upload .file_size {
|
125
|
-
padding: 0 10px 0 0;
|
126
|
-
text-align: right;
|
127
|
-
font-size: 1.1em;
|
128
|
-
}
|
129
|
-
|
130
|
-
.file_upload .files,
|
131
|
-
.file_upload_overall_progress {
|
132
|
-
margin: 10px 0;
|
133
|
-
}
|
134
|
-
|
135
|
-
.file_upload .ui-widget {
|
136
|
-
font-size: 1em;
|
137
|
-
}
|
138
|
-
.files{
|
139
|
-
margin-left: 20px;
|
140
|
-
}
|