applicious_utils 0.1.68 → 0.1.69
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/app/assets/javascripts/applicious_utils/Corner/README.md +27 -0
- data/app/assets/javascripts/applicious_utils/Corner/jquery.corner.js +249 -0
- data/app/assets/javascripts/applicious_utils/LightboxMe/README.markdown +2 -0
- data/app/assets/javascripts/applicious_utils/LightboxMe/jquery.lightbox_me.js +3 -0
- data/app/assets/javascripts/applicious_utils/index.js +2 -1
- data/lib/applicious_utils/version.rb +1 -1
- metadata +5 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# jQuery Corner Plugin
|
|
2
|
+
|
|
3
|
+
Corner is a simple plugin for creating rounded (or other styled) corners on elements.
|
|
4
|
+
|
|
5
|
+
## Links
|
|
6
|
+
|
|
7
|
+
* [Home Page](http://jquery.malsup.com/corner/)
|
|
8
|
+
* [Download](http://github.com/malsup/corner/raw/master/jquery.corner.js)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
// default 10px round corner
|
|
14
|
+
$('#myDiv').corner();
|
|
15
|
+
|
|
16
|
+
// 30px round corner
|
|
17
|
+
$('#myDiv').corner('30px');
|
|
18
|
+
|
|
19
|
+
// 15px bevel corner
|
|
20
|
+
$('#myDiv').corner('15px bevel');
|
|
21
|
+
|
|
22
|
+
// dogeared top right corner
|
|
23
|
+
$('#myDiv').corner('dog tr');
|
|
24
|
+
|
|
25
|
+
// sharp corners on bottom
|
|
26
|
+
$('#myDiv').corner('sharp bottom');
|
|
27
|
+
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* jQuery corner plugin: simple corner rounding
|
|
3
|
+
* Examples and documentation at: http://jquery.malsup.com/corner/
|
|
4
|
+
* version 2.12 (23-MAY-2011)
|
|
5
|
+
* Requires jQuery v1.3.2 or later
|
|
6
|
+
* Dual licensed under the MIT and GPL licenses:
|
|
7
|
+
* http://www.opensource.org/licenses/mit-license.php
|
|
8
|
+
* http://www.gnu.org/licenses/gpl.html
|
|
9
|
+
* Authors: Dave Methvin and Mike Alsup
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* corner() takes a single string argument: $('#myDiv').corner("effect corners width")
|
|
14
|
+
*
|
|
15
|
+
* effect: name of the effect to apply, such as round, bevel, notch, bite, etc (default is round).
|
|
16
|
+
* corners: one or more of: top, bottom, tr, tl, br, or bl. (default is all corners)
|
|
17
|
+
* width: width of the effect; in the case of rounded corners this is the radius.
|
|
18
|
+
* specify this value using the px suffix such as 10px (yes, it must be pixels).
|
|
19
|
+
*/
|
|
20
|
+
;(function($) {
|
|
21
|
+
|
|
22
|
+
var style = document.createElement('div').style,
|
|
23
|
+
moz = style['MozBorderRadius'] !== undefined,
|
|
24
|
+
webkit = style['WebkitBorderRadius'] !== undefined,
|
|
25
|
+
radius = style['borderRadius'] !== undefined || style['BorderRadius'] !== undefined,
|
|
26
|
+
mode = document.documentMode || 0,
|
|
27
|
+
noBottomFold = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8),
|
|
28
|
+
|
|
29
|
+
expr = $.browser.msie && (function() {
|
|
30
|
+
var div = document.createElement('div');
|
|
31
|
+
try { div.style.setExpression('width','0+0'); div.style.removeExpression('width'); }
|
|
32
|
+
catch(e) { return false; }
|
|
33
|
+
return true;
|
|
34
|
+
})();
|
|
35
|
+
|
|
36
|
+
$.support = $.support || {};
|
|
37
|
+
$.support.borderRadius = moz || webkit || radius; // so you can do: if (!$.support.borderRadius) $('#myDiv').corner();
|
|
38
|
+
|
|
39
|
+
function sz(el, p) {
|
|
40
|
+
return parseInt($.css(el,p))||0;
|
|
41
|
+
};
|
|
42
|
+
function hex2(s) {
|
|
43
|
+
s = parseInt(s).toString(16);
|
|
44
|
+
return ( s.length < 2 ) ? '0'+s : s;
|
|
45
|
+
};
|
|
46
|
+
function gpc(node) {
|
|
47
|
+
while(node) {
|
|
48
|
+
var v = $.css(node,'backgroundColor'), rgb;
|
|
49
|
+
if (v && v != 'transparent' && v != 'rgba(0, 0, 0, 0)') {
|
|
50
|
+
if (v.indexOf('rgb') >= 0) {
|
|
51
|
+
rgb = v.match(/\d+/g);
|
|
52
|
+
return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);
|
|
53
|
+
}
|
|
54
|
+
return v;
|
|
55
|
+
}
|
|
56
|
+
if (node.nodeName.toLowerCase() == 'html')
|
|
57
|
+
break;
|
|
58
|
+
node = node.parentNode; // keep walking if transparent
|
|
59
|
+
}
|
|
60
|
+
return '#ffffff';
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
function getWidth(fx, i, width) {
|
|
64
|
+
switch(fx) {
|
|
65
|
+
case 'round': return Math.round(width*(1-Math.cos(Math.asin(i/width))));
|
|
66
|
+
case 'cool': return Math.round(width*(1+Math.cos(Math.asin(i/width))));
|
|
67
|
+
case 'sharp': return width-i;
|
|
68
|
+
case 'bite': return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));
|
|
69
|
+
case 'slide': return Math.round(width*(Math.atan2(i,width/i)));
|
|
70
|
+
case 'jut': return Math.round(width*(Math.atan2(width,(width-i-1))));
|
|
71
|
+
case 'curl': return Math.round(width*(Math.atan(i)));
|
|
72
|
+
case 'tear': return Math.round(width*(Math.cos(i)));
|
|
73
|
+
case 'wicked': return Math.round(width*(Math.tan(i)));
|
|
74
|
+
case 'long': return Math.round(width*(Math.sqrt(i)));
|
|
75
|
+
case 'sculpt': return Math.round(width*(Math.log((width-i-1),width)));
|
|
76
|
+
case 'dogfold':
|
|
77
|
+
case 'dog': return (i&1) ? (i+1) : width;
|
|
78
|
+
case 'dog2': return (i&2) ? (i+1) : width;
|
|
79
|
+
case 'dog3': return (i&3) ? (i+1) : width;
|
|
80
|
+
case 'fray': return (i%2)*width;
|
|
81
|
+
case 'notch': return width;
|
|
82
|
+
case 'bevelfold':
|
|
83
|
+
case 'bevel': return i+1;
|
|
84
|
+
case 'steep': return i/2 + 1;
|
|
85
|
+
case 'invsteep':return (width-i)/2+1;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
$.fn.corner = function(options) {
|
|
90
|
+
// in 1.3+ we can fix mistakes with the ready state
|
|
91
|
+
if (this.length == 0) {
|
|
92
|
+
if (!$.isReady && this.selector) {
|
|
93
|
+
var s = this.selector, c = this.context;
|
|
94
|
+
$(function() {
|
|
95
|
+
$(s,c).corner(options);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return this.each(function(index){
|
|
102
|
+
var $this = $(this),
|
|
103
|
+
// meta values override options
|
|
104
|
+
o = [$this.attr($.fn.corner.defaults.metaAttr) || '', options || ''].join(' ').toLowerCase(),
|
|
105
|
+
keep = /keep/.test(o), // keep borders?
|
|
106
|
+
cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]), // corner color
|
|
107
|
+
sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]), // strip color
|
|
108
|
+
width = parseInt((o.match(/(\d+)px/)||[])[1]) || 10, // corner width
|
|
109
|
+
re = /round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog|invsteep|steep/,
|
|
110
|
+
fx = ((o.match(re)||['round'])[0]),
|
|
111
|
+
fold = /dogfold|bevelfold/.test(o),
|
|
112
|
+
edges = { T:0, B:1 },
|
|
113
|
+
opts = {
|
|
114
|
+
TL: /top|tl|left/.test(o), TR: /top|tr|right/.test(o),
|
|
115
|
+
BL: /bottom|bl|left/.test(o), BR: /bottom|br|right/.test(o)
|
|
116
|
+
},
|
|
117
|
+
// vars used in func later
|
|
118
|
+
strip, pad, cssHeight, j, bot, d, ds, bw, i, w, e, c, common, $horz;
|
|
119
|
+
|
|
120
|
+
if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR )
|
|
121
|
+
opts = { TL:1, TR:1, BL:1, BR:1 };
|
|
122
|
+
|
|
123
|
+
// support native rounding
|
|
124
|
+
if ($.fn.corner.defaults.useNative && fx == 'round' && (radius || moz || webkit) && !cc && !sc) {
|
|
125
|
+
if (opts.TL)
|
|
126
|
+
$this.css(radius ? 'border-top-left-radius' : moz ? '-moz-border-radius-topleft' : '-webkit-border-top-left-radius', width + 'px');
|
|
127
|
+
if (opts.TR)
|
|
128
|
+
$this.css(radius ? 'border-top-right-radius' : moz ? '-moz-border-radius-topright' : '-webkit-border-top-right-radius', width + 'px');
|
|
129
|
+
if (opts.BL)
|
|
130
|
+
$this.css(radius ? 'border-bottom-left-radius' : moz ? '-moz-border-radius-bottomleft' : '-webkit-border-bottom-left-radius', width + 'px');
|
|
131
|
+
if (opts.BR)
|
|
132
|
+
$this.css(radius ? 'border-bottom-right-radius' : moz ? '-moz-border-radius-bottomright' : '-webkit-border-bottom-right-radius', width + 'px');
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
strip = document.createElement('div');
|
|
137
|
+
$(strip).css({
|
|
138
|
+
overflow: 'hidden',
|
|
139
|
+
height: '1px',
|
|
140
|
+
minHeight: '1px',
|
|
141
|
+
fontSize: '1px',
|
|
142
|
+
backgroundColor: sc || 'transparent',
|
|
143
|
+
borderStyle: 'solid'
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
pad = {
|
|
147
|
+
T: parseInt($.css(this,'paddingTop'))||0, R: parseInt($.css(this,'paddingRight'))||0,
|
|
148
|
+
B: parseInt($.css(this,'paddingBottom'))||0, L: parseInt($.css(this,'paddingLeft'))||0
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
if (typeof this.style.zoom != undefined) this.style.zoom = 1; // force 'hasLayout' in IE
|
|
152
|
+
if (!keep) this.style.border = 'none';
|
|
153
|
+
strip.style.borderColor = cc || gpc(this.parentNode);
|
|
154
|
+
cssHeight = $(this).outerHeight();
|
|
155
|
+
|
|
156
|
+
for (j in edges) {
|
|
157
|
+
bot = edges[j];
|
|
158
|
+
// only add stips if needed
|
|
159
|
+
if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) {
|
|
160
|
+
strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');
|
|
161
|
+
d = document.createElement('div');
|
|
162
|
+
$(d).addClass('jquery-corner');
|
|
163
|
+
ds = d.style;
|
|
164
|
+
|
|
165
|
+
bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild);
|
|
166
|
+
|
|
167
|
+
if (bot && cssHeight != 'auto') {
|
|
168
|
+
if ($.css(this,'position') == 'static')
|
|
169
|
+
this.style.position = 'relative';
|
|
170
|
+
ds.position = 'absolute';
|
|
171
|
+
ds.bottom = ds.left = ds.padding = ds.margin = '0';
|
|
172
|
+
if (expr)
|
|
173
|
+
ds.setExpression('width', 'this.parentNode.offsetWidth');
|
|
174
|
+
else
|
|
175
|
+
ds.width = '100%';
|
|
176
|
+
}
|
|
177
|
+
else if (!bot && $.browser.msie) {
|
|
178
|
+
if ($.css(this,'position') == 'static')
|
|
179
|
+
this.style.position = 'relative';
|
|
180
|
+
ds.position = 'absolute';
|
|
181
|
+
ds.top = ds.left = ds.right = ds.padding = ds.margin = '0';
|
|
182
|
+
|
|
183
|
+
// fix ie6 problem when blocked element has a border width
|
|
184
|
+
if (expr) {
|
|
185
|
+
bw = sz(this,'borderLeftWidth') + sz(this,'borderRightWidth');
|
|
186
|
+
ds.setExpression('width', 'this.parentNode.offsetWidth - '+bw+'+ "px"');
|
|
187
|
+
}
|
|
188
|
+
else
|
|
189
|
+
ds.width = '100%';
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
ds.position = 'relative';
|
|
193
|
+
ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' :
|
|
194
|
+
(pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
for (i=0; i < width; i++) {
|
|
198
|
+
w = Math.max(0,getWidth(fx,i, width));
|
|
199
|
+
e = strip.cloneNode(false);
|
|
200
|
+
e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';
|
|
201
|
+
bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (fold && $.support.boxModel) {
|
|
205
|
+
if (bot && noBottomFold) continue;
|
|
206
|
+
for (c in opts) {
|
|
207
|
+
if (!opts[c]) continue;
|
|
208
|
+
if (bot && (c == 'TL' || c == 'TR')) continue;
|
|
209
|
+
if (!bot && (c == 'BL' || c == 'BR')) continue;
|
|
210
|
+
|
|
211
|
+
common = { position: 'absolute', border: 'none', margin: 0, padding: 0, overflow: 'hidden', backgroundColor: strip.style.borderColor };
|
|
212
|
+
$horz = $('<div/>').css(common).css({ width: width + 'px', height: '1px' });
|
|
213
|
+
switch(c) {
|
|
214
|
+
case 'TL': $horz.css({ bottom: 0, left: 0 }); break;
|
|
215
|
+
case 'TR': $horz.css({ bottom: 0, right: 0 }); break;
|
|
216
|
+
case 'BL': $horz.css({ top: 0, left: 0 }); break;
|
|
217
|
+
case 'BR': $horz.css({ top: 0, right: 0 }); break;
|
|
218
|
+
}
|
|
219
|
+
d.appendChild($horz[0]);
|
|
220
|
+
|
|
221
|
+
var $vert = $('<div/>').css(common).css({ top: 0, bottom: 0, width: '1px', height: width + 'px' });
|
|
222
|
+
switch(c) {
|
|
223
|
+
case 'TL': $vert.css({ left: width }); break;
|
|
224
|
+
case 'TR': $vert.css({ right: width }); break;
|
|
225
|
+
case 'BL': $vert.css({ left: width }); break;
|
|
226
|
+
case 'BR': $vert.css({ right: width }); break;
|
|
227
|
+
}
|
|
228
|
+
d.appendChild($vert[0]);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
$.fn.uncorner = function() {
|
|
237
|
+
if (radius || moz || webkit)
|
|
238
|
+
this.css(radius ? 'border-radius' : moz ? '-moz-border-radius' : '-webkit-border-radius', 0);
|
|
239
|
+
$('div.jquery-corner', this).remove();
|
|
240
|
+
return this;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
// expose options
|
|
244
|
+
$.fn.corner.defaults = {
|
|
245
|
+
useNative: true, // true if plugin should attempt to use native browser support for border radius rounding
|
|
246
|
+
metaAttr: 'data-corner' // name of meta attribute to use for options
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
})(jQuery);
|
|
@@ -18,6 +18,8 @@ Include both jQuery and the lightbox_me JavaScript file before calling the plugi
|
|
|
18
18
|
Invoke the lightbox by calling the plugin on a jQuery object:
|
|
19
19
|
$(dom).lightbox_me();
|
|
20
20
|
|
|
21
|
+
Close the lightbox by triggering close on the dom element that is a lightbox
|
|
22
|
+
$(dom).trigger('close');
|
|
21
23
|
|
|
22
24
|
|
|
23
25
|
## License
|
|
@@ -94,6 +94,9 @@
|
|
|
94
94
|
.resize(setSelfPosition)
|
|
95
95
|
.scroll(setSelfPosition)
|
|
96
96
|
.keyup(observeKeyPress);
|
|
97
|
+
if (opts.closeClick) {
|
|
98
|
+
$overlay.click(function(e) { closeLightbox(); e.preventDefault; });
|
|
99
|
+
}
|
|
97
100
|
$self.delegate(opts.closeSelector, "click", function(e) {
|
|
98
101
|
closeLightbox(); e.preventDefault();
|
|
99
102
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
//= require ./Corner/jquery.corner.js
|
|
1
2
|
//= require ./LightboxMe/jquery.lightbox_me.js
|
|
2
|
-
//= require ./FbMultiFriendSelector/jquery.facebook.multifriend.select.min.js
|
|
3
3
|
//= require ./Plupload/js/plupload.full.js
|
|
4
|
+
//= require ./FbMultiFriendSelector/jquery.facebook.multifriend.select.min.js
|
|
4
5
|
//= require ./Applicious/applicious.js.coffee
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: applicious_utils
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.69
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2011-07-
|
|
12
|
+
date: 2011-07-12 00:00:00.000000000Z
|
|
13
13
|
dependencies: []
|
|
14
14
|
description: Helper JS & Ruby Functions
|
|
15
15
|
email:
|
|
@@ -22,6 +22,8 @@ files:
|
|
|
22
22
|
- app/assets/javascripts/applicious_utils/Applicious/applicious_class.js.coffee
|
|
23
23
|
- app/assets/javascripts/applicious_utils/Applicious/facebook_class.js.coffee
|
|
24
24
|
- app/assets/javascripts/applicious_utils/Applicious/uploader_class.js.coffee
|
|
25
|
+
- app/assets/javascripts/applicious_utils/Corner/jquery.corner.js
|
|
26
|
+
- app/assets/javascripts/applicious_utils/Corner/README.md
|
|
25
27
|
- app/assets/javascripts/applicious_utils/FbMultiFriendSelector/index.html
|
|
26
28
|
- app/assets/javascripts/applicious_utils/FbMultiFriendSelector/jquery.facebook.multifriend.select-list.css
|
|
27
29
|
- app/assets/javascripts/applicious_utils/FbMultiFriendSelector/jquery.facebook.multifriend.select.css
|
|
@@ -75,6 +77,7 @@ files:
|
|
|
75
77
|
- app/assets/stylesheets/applicious_utils/FbMultiFriendSelector/jquery.facebook.multifriend.select.min.js
|
|
76
78
|
- app/assets/stylesheets/applicious_utils/FbMultiFriendSelector/README.md
|
|
77
79
|
- app/assets/stylesheets/applicious_utils/index.css
|
|
80
|
+
- applicious_utils-0.1.69.gem
|
|
78
81
|
- applicious_utils.gemspec
|
|
79
82
|
- Gemfile
|
|
80
83
|
- lib/applicious_utils/engine.rb
|