right-rails 1.0.10 → 1.0.12
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/README.rdoc +4 -4
- data/Rakefile +4 -4
- data/lib/right_rails.rb +1 -1
- data/public/javascripts/right/autocompleter-src.js +115 -106
- data/public/javascripts/right/autocompleter.js +3 -14
- data/public/javascripts/right/billboard-src.js +58 -38
- data/public/javascripts/right/billboard.js +3 -13
- data/public/javascripts/right/calendar-src.js +136 -133
- data/public/javascripts/right/calendar.js +4 -33
- data/public/javascripts/right/colorpicker-src.js +128 -125
- data/public/javascripts/right/colorpicker.js +4 -23
- data/public/javascripts/right/dialog-src.js +67 -37
- data/public/javascripts/right/dialog.js +3 -17
- data/public/javascripts/right/dnd-src.js +44 -43
- data/public/javascripts/right/dnd.js +3 -16
- data/public/javascripts/right/effects-src.js +125 -98
- data/public/javascripts/right/effects.js +3 -13
- data/public/javascripts/right/in-edit-src.js +54 -38
- data/public/javascripts/right/in-edit.js +4 -10
- data/public/javascripts/right/jquerysh-src.js +344 -20
- data/public/javascripts/right/jquerysh.js +3 -3
- data/public/javascripts/right/json-src.js +22 -35
- data/public/javascripts/right/json.js +4 -7
- data/public/javascripts/right/keys-src.js +87 -0
- data/public/javascripts/right/keys.js +7 -0
- data/public/javascripts/right/lightbox-src.js +76 -58
- data/public/javascripts/right/lightbox.js +3 -20
- data/public/javascripts/right/rails-src.js +108 -107
- data/public/javascripts/right/rails.js +4 -11
- data/public/javascripts/right/rater-src.js +47 -31
- data/public/javascripts/right/rater.js +3 -9
- data/public/javascripts/right/resizable-src.js +60 -33
- data/public/javascripts/right/resizable.js +3 -11
- data/public/javascripts/right/selectable-src.js +87 -51
- data/public/javascripts/right/selectable.js +3 -18
- data/public/javascripts/right/sizzle-src.js +15 -10
- data/public/javascripts/right/sizzle.js +4 -27
- data/public/javascripts/right/slider-src.js +49 -33
- data/public/javascripts/right/slider.js +3 -10
- data/public/javascripts/right/sortable-src.js +46 -32
- data/public/javascripts/right/sortable.js +4 -13
- data/public/javascripts/right/table-src.js +19 -10
- data/public/javascripts/right/table.js +4 -6
- data/public/javascripts/right/tabs-src.js +69 -47
- data/public/javascripts/right/tabs.js +4 -26
- data/public/javascripts/right/tooltips-src.js +78 -56
- data/public/javascripts/right/tooltips.js +4 -9
- data/public/javascripts/right/uploader-src.js +50 -34
- data/public/javascripts/right/uploader.js +3 -9
- data/public/javascripts/right-olds-src.js +528 -355
- data/public/javascripts/right-olds.js +4 -13
- data/public/javascripts/right-safe-src.js +4 -99
- data/public/javascripts/right-safe.js +3 -4
- data/public/javascripts/right-src.js +1618 -1245
- data/public/javascripts/right.js +4 -91
- metadata +8 -6
@@ -1,8 +1,8 @@
|
|
1
1
|
/**
|
2
|
-
*
|
2
|
+
* RightJS-UI Uploader v2.2.0
|
3
3
|
* http://rightjs.org/ui/uploader
|
4
4
|
*
|
5
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
5
|
+
* Copyright (C) 2010-2011 Nikolay Nemshilov
|
6
6
|
*/
|
7
7
|
var Uploader = RightJS.Uploader = (function(RightJS) {
|
8
8
|
/**
|
@@ -10,27 +10,9 @@ var Uploader = RightJS.Uploader = (function(RightJS) {
|
|
10
10
|
* it creates an abstract proxy with the common functionality
|
11
11
|
* which then we reuse and override in the actual widgets
|
12
12
|
*
|
13
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
13
|
+
* Copyright (C) 2010-2011 Nikolay Nemshilov
|
14
14
|
*/
|
15
15
|
|
16
|
-
/**
|
17
|
-
* The uploader initialization script
|
18
|
-
*
|
19
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
20
|
-
*/
|
21
|
-
var R = RightJS,
|
22
|
-
$ = RightJS.$,
|
23
|
-
$w = RightJS.$w,
|
24
|
-
$E = RightJS.$E,
|
25
|
-
Xhr = RightJS.Xhr,
|
26
|
-
Form = RightJS.Form,
|
27
|
-
RegExp = RightJS.RegExp;
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
16
|
/**
|
35
17
|
* The widget units constructor
|
36
18
|
*
|
@@ -49,7 +31,7 @@ function Widget(tag_name, methods) {
|
|
49
31
|
*
|
50
32
|
* Copyright (C) 2010 Nikolay Nemshilov
|
51
33
|
*/
|
52
|
-
var AbstractWidget = new RightJS.
|
34
|
+
var AbstractWidget = new RightJS.Class(RightJS.Element.Wrappers[tag_name] || RightJS.Element, {
|
53
35
|
/**
|
54
36
|
* The common constructor
|
55
37
|
*
|
@@ -81,7 +63,8 @@ function Widget(tag_name, methods) {
|
|
81
63
|
options = {};
|
82
64
|
}
|
83
65
|
this.setOptions(options, this);
|
84
|
-
|
66
|
+
|
67
|
+
return (RightJS.Wrapper.Cache[RightJS.$uid(this._)] = this);
|
85
68
|
},
|
86
69
|
|
87
70
|
// protected
|
@@ -94,12 +77,16 @@ function Widget(tag_name, methods) {
|
|
94
77
|
* @return void
|
95
78
|
*/
|
96
79
|
setOptions: function(options, element) {
|
97
|
-
|
98
|
-
|
99
|
-
RightJS.Object.merge(options, eval("("+(
|
80
|
+
if (element) {
|
81
|
+
options = RightJS.Object.merge(options, new Function("return "+(
|
100
82
|
element.get('data-'+ this.key) || '{}'
|
101
|
-
)
|
102
|
-
|
83
|
+
))());
|
84
|
+
}
|
85
|
+
|
86
|
+
if (options) {
|
87
|
+
RightJS.Options.setOptions.call(this, RightJS.Object.merge(this.options, options));
|
88
|
+
}
|
89
|
+
|
103
90
|
return this;
|
104
91
|
}
|
105
92
|
});
|
@@ -108,7 +95,7 @@ function Widget(tag_name, methods) {
|
|
108
95
|
* Creating the actual widget class
|
109
96
|
*
|
110
97
|
*/
|
111
|
-
var Klass = new RightJS.
|
98
|
+
var Klass = new RightJS.Class(AbstractWidget, methods);
|
112
99
|
|
113
100
|
// creating the widget related shortcuts
|
114
101
|
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || []);
|
@@ -118,13 +105,31 @@ function Widget(tag_name, methods) {
|
|
118
105
|
|
119
106
|
|
120
107
|
/**
|
121
|
-
* The
|
108
|
+
* The uploader initialization script
|
122
109
|
*
|
123
110
|
* Copyright (C) 2010 Nikolay Nemshilov
|
124
111
|
*/
|
112
|
+
var R = RightJS,
|
113
|
+
$ = RightJS.$,
|
114
|
+
$w = RightJS.$w,
|
115
|
+
$E = RightJS.$E,
|
116
|
+
Xhr = RightJS.Xhr,
|
117
|
+
Form = RightJS.Form,
|
118
|
+
RegExp = RightJS.RegExp;
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
/**
|
126
|
+
* The uploading progress feature
|
127
|
+
*
|
128
|
+
* Copyright (C) 2010-2011 Nikolay Nemshilov
|
129
|
+
*/
|
125
130
|
var Uploader = new Widget({
|
126
131
|
extend: {
|
127
|
-
version: '2.
|
132
|
+
version: '2.2.0',
|
128
133
|
|
129
134
|
EVENTS: $w('start update finish error'),
|
130
135
|
|
@@ -231,7 +236,7 @@ var Uploader = new Widget({
|
|
231
236
|
Xhr.load(this.options.url + "?" + this.options.param + "=" + this.uid, {
|
232
237
|
evalJSON: false,
|
233
238
|
onSuccess: R(function(xhr) {
|
234
|
-
this.update(
|
239
|
+
this.update(new Function('return '+xhr.text)());
|
235
240
|
}).bind(this)
|
236
241
|
});
|
237
242
|
|
@@ -245,7 +250,7 @@ var Uploader = new Widget({
|
|
245
250
|
|
246
251
|
var param = this.options.param;
|
247
252
|
var url = this.form.get('action').replace(new RegExp('(\\?|&)'+RegExp.escape(param) + '=[^&]*', 'i'), '');
|
248
|
-
this.form.set('action', (R(url).includes('?') ? '&' : '?') + param + '=' + this.uid);
|
253
|
+
this.form.set('action', url + (R(url).includes('?') ? '&' : '?') + param + '=' + this.uid);
|
249
254
|
|
250
255
|
this.show();
|
251
256
|
|
@@ -279,7 +284,18 @@ Form.include({
|
|
279
284
|
});
|
280
285
|
|
281
286
|
|
282
|
-
|
287
|
+
var embed_style = document.createElement('style'),
|
288
|
+
embed_rules = document.createTextNode("div.rui-progress-bar,div.rui-progress-bar *{margin:0;padding:0;border:none;background:none}div.rui-progress-bar{position:relative;height:1.4em;line-height:1.4em;width:20em;border:1px solid #999}div.rui-progress-bar,div.rui-progress-bar div.bar{border-radius:0.25em;-moz-border-radius:0.25em;-webkit-border-radius:0.25em}div.rui-progress-bar div.bar{position:absolute;left:0;top:0;width:0%;height:100%;background:#CCC;z-index:1}div.rui-progress-bar div.num{position:absolute;width:100%;height:100%;z-index:2;text-align:center}div.rui-progress-bar-failed{border-color:red;color:red;background:pink}.rui-uploader{display:none}");
|
289
|
+
|
290
|
+
embed_style.type = 'text/css';
|
291
|
+
document.getElementsByTagName('head')[0].appendChild(embed_style);
|
292
|
+
|
293
|
+
if(embed_style.styleSheet) {
|
294
|
+
embed_style.styleSheet.cssText = embed_rules.nodeValue;
|
295
|
+
} else {
|
296
|
+
embed_style.appendChild(embed_rules);
|
297
|
+
}
|
298
|
+
|
283
299
|
|
284
300
|
return Uploader;
|
285
301
|
})(RightJS);
|
@@ -1,13 +1,7 @@
|
|
1
1
|
/**
|
2
|
-
*
|
2
|
+
* RightJS-UI Uploader v2.2.0
|
3
3
|
* http://rightjs.org/ui/uploader
|
4
4
|
*
|
5
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
5
|
+
* Copyright (C) 2010-2011 Nikolay Nemshilov
|
6
6
|
*/
|
7
|
-
var Uploader=RightJS.Uploader=function(
|
8
|
-
c){c=c||this;b.Options.setOptions.call(this,b.Object.merge(f,eval("("+(c.get("data-"+this.key)||"{}")+")")));return this}});e=new b.Wrapper(e,d);b.Observer.createShortcuts(e.prototype,e.EVENTS||[]);return e})({extend:{version:"2.0.0",EVENTS:n("start update finish error"),Options:{url:"/progress",param:"X-Progress-ID",timeout:1E3,round:0,fxDuration:400,cssRule:"[data-uploader]"}},initialize:function(a,d){this.form=a=m(a);var e=a.first(".rui-uploader");this.$super("uploader",e).setOptions(d,this.form).addClass("rui-progress-bar").insert([this.bar=
|
9
|
-
this.first(".bar")||h("div",{"class":"bar"}),this.num=this.first(".num")||h("div",{"class":"num"})]);e||this.insertTo(a)},start:function(){var a={state:"starting"};return this.paint(a).prepare().request().fire("start",{data:a})},update:function(a){this.paint(a).fire("update",{data:a});switch(a.state){case "starting":case "uploading":b(this.request).bind(this).delay(this.options.timeout);break;case "done":this.fire("finish",{data:a});break;case "error":this.fire("error",{data:a});break}return this},
|
10
|
-
paint:function(a){var d=(this.percent||0)/100;switch(a.state){case "starting":d=0;break;case "done":d=1;break;case "uploading":d=a.received/(a.size||1);break}this.percent=b(d*100).round(this.options.round);if(this.percent===0||!b.Fx||!this.options.fxDuration){this.bar._.style.width=this.percent+"%";this.num._.innerHTML=this.percent+"%"}else{this.bar.morph({width:this.percent+"%"},{duration:this.options.fxDuration});b(function(){this.num._.innerHTML=this.percent+"%"}).bind(this).delay(this.options.fxDuration/
|
11
|
-
2)}this[a.state==="error"?"addClass":"removeClass"]("rui-progress-bar-failed");return this},request:function(){o.load(this.options.url+"?"+this.options.param+"="+this.uid,{evalJSON:false,onSuccess:b(function(a){this.update(eval("("+a.text+")"))}).bind(this)});return this},prepare:function(){this.uid="";for(i=0;i<32;i++)this.uid+=Math.random(0,15).toString(16);var a=this.options.param,d=this.form.get("action").replace(new k("(\\?|&)"+k.escape(a)+"=[^&]*","i"),"");this.form.set("action",(b(d).includes("?")?
|
12
|
-
"&":"?")+a+"="+this.uid);this.show();return this}}),p=j.prototype.send;j.include({send:function(){if(!this.uploader&&(this.match(g.Options.cssRule)||this.first(".rui-uploader")))this.uploader=new g(this);this.uploader&&this.uploader.start();return p.apply(this,arguments)}});document.write('<style type="text/css">div.rui-progress-bar,div.rui-progress-bar *{margin:0;padding:0;border:none;background:none}div.rui-progress-bar{position:relative;height:1.4em;line-height:1.4em;width:20em;border:1px solid #999}div.rui-progress-bar,div.rui-progress-bar div.bar{border-radius:0.25em;-moz-border-radius:0.25em;-webkit-border-radius:0.25em}div.rui-progress-bar div.bar{position:absolute;left:0;top:0;width:0%;height:100%;background:#CCC;z-index:1}div.rui-progress-bar div.num{position:absolute;width:100%;height:100%;z-index:2;text-align:center}div.rui-progress-bar-failed{border-color:red;color:red;background:pink}.rui-uploader{display:none}</style>');
|
13
|
-
return g}(RightJS);
|
7
|
+
var Uploader=RightJS.Uploader=function(a){function b(b,c){c||(c=b,b="DIV");var d=new a.Class(a.Element.Wrappers[b]||a.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof a.Input||this instanceof a.Form||e.unshift(b),this.$super.apply(this,e),a.isString(d)&&(d=a.$(d)),d instanceof a.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return a.Wrapper.Cache[a.$uid(this._)]=this},setOptions:function(b,c){c&&(b=a.Object.merge(b,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),b&&a.Options.setOptions.call(this,a.Object.merge(this.options,b));return this}}),e=new a.Class(d,c);a.Observer.createShortcuts(e.prototype,e.EVENTS||[]);return e}var c=a,d=a.$,e=a.$w,f=a.$E,g=a.Xhr,h=a.Form,j=a.RegExp,k=new b({extend:{version:"2.2.0",EVENTS:e("start update finish error"),Options:{url:"/progress",param:"X-Progress-ID",timeout:1e3,round:0,fxDuration:400,cssRule:"[data-uploader]"}},initialize:function(a,b){this.form=a=d(a);var c=a.first(".rui-uploader");this.$super("uploader",c).setOptions(b,this.form).addClass("rui-progress-bar").insert([this.bar=this.first(".bar")||f("div",{"class":"bar"}),this.num=this.first(".num")||f("div",{"class":"num"})]),c||this.insertTo(a)},start:function(){var a={state:"starting"};return this.paint(a).prepare().request().fire("start",{data:a})},update:function(a){this.paint(a).fire("update",{data:a});switch(a.state){case"starting":case"uploading":c(this.request).bind(this).delay(this.options.timeout);break;case"done":this.fire("finish",{data:a});break;case"error":this.fire("error",{data:a})}return this},paint:function(b){var d=(this.percent||0)/100;switch(b.state){case"starting":d=0;break;case"done":d=1;break;case"uploading":d=b.received/(b.size||1)}this.percent=c(d*100).round(this.options.round),this.percent!==0&&a.Fx&&this.options.fxDuration?(this.bar.morph({width:this.percent+"%"},{duration:this.options.fxDuration}),c(function(){this.num._.innerHTML=this.percent+"%"}).bind(this).delay(this.options.fxDuration/2)):(this.bar._.style.width=this.percent+"%",this.num._.innerHTML=this.percent+"%"),this[b.state==="error"?"addClass":"removeClass"]("rui-progress-bar-failed");return this},request:function(){g.load(this.options.url+"?"+this.options.param+"="+this.uid,{evalJSON:!1,onSuccess:c(function(a){this.update((new Function("return "+a.text))())}).bind(this)});return this},prepare:function(){this.uid="";for(i=0;i<32;i++)this.uid+=Math.random(0,15).toString(16);var a=this.options.param,b=this.form.get("action").replace(new j("(\\?|&)"+j.escape(a)+"=[^&]*","i"),"");this.form.set("action",b+(c(b).includes("?")?"&":"?")+a+"="+this.uid),this.show();return this}}),l=h.prototype.send;h.include({send:function(){!this.uploader&&(this.match(k.Options.cssRule)||this.first(".rui-uploader"))&&(this.uploader=new k(this)),this.uploader&&this.uploader.start();return l.apply(this,arguments)}});var m=document.createElement("style"),n=document.createTextNode("div.rui-progress-bar,div.rui-progress-bar *{margin:0;padding:0;border:none;background:none}div.rui-progress-bar{position:relative;height:1.4em;line-height:1.4em;width:20em;border:1px solid #999}div.rui-progress-bar,div.rui-progress-bar div.bar{border-radius:0.25em;-moz-border-radius:0.25em;-webkit-border-radius:0.25em}div.rui-progress-bar div.bar{position:absolute;left:0;top:0;width:0%;height:100%;background:#CCC;z-index:1}div.rui-progress-bar div.num{position:absolute;width:100%;height:100%;z-index:2;text-align:center}div.rui-progress-bar-failed{border-color:red;color:red;background:pink}.rui-uploader{display:none}");m.type="text/css",document.getElementsByTagName("head")[0].appendChild(m),m.styleSheet?m.styleSheet.cssText=n.nodeValue:m.appendChild(n);return k}(RightJS)
|