right-rails 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -0
- data/README.rdoc +1 -1
- data/Rakefile +1 -1
- data/init.rb +1 -0
- data/lib/generators/right_rails/right_rails_generator.rb +15 -6
- data/lib/right_rails.rb +1 -1
- data/lib/right_rails/controller_extensions.rb +28 -15
- data/lib/right_rails/helpers/misc.rb +38 -38
- data/lib/right_rails/helpers/rails.rb +50 -7
- data/lib/rjs_renderer.rb +26 -0
- data/spec/lib/right_rails/controller_extensions_spec.rb +25 -14
- data/spec/lib/right_rails/helpers/forms_spec.rb +6 -6
- data/spec/lib/right_rails/helpers/rails_spec.rb +44 -45
- data/vendor/assets/images/rightjs-ui/rte.png +0 -0
- data/vendor/assets/javascripts/right-safe-src.js +2 -2
- data/vendor/assets/javascripts/right-safe.js +2 -2
- data/vendor/assets/javascripts/right-src.js +386 -100
- data/vendor/assets/javascripts/right.js +2 -2
- data/vendor/assets/javascripts/right/calendar-src.js +19 -3
- data/vendor/assets/javascripts/right/calendar.js +2 -2
- data/vendor/assets/javascripts/right/colorpicker-src.js +59 -20
- data/vendor/assets/javascripts/right/colorpicker.js +2 -2
- data/vendor/assets/javascripts/right/i18n/de.js +43 -42
- data/vendor/assets/javascripts/right/i18n/es.js +1 -0
- data/vendor/assets/javascripts/right/i18n/fi.js +1 -0
- data/vendor/assets/javascripts/right/i18n/fr.js +1 -0
- data/vendor/assets/javascripts/right/i18n/hu.js +1 -0
- data/vendor/assets/javascripts/right/i18n/it.js +1 -0
- data/vendor/assets/javascripts/right/i18n/jp.js +1 -0
- data/vendor/assets/javascripts/right/i18n/lt.js +96 -0
- data/vendor/assets/javascripts/right/i18n/nl.js +1 -0
- data/vendor/assets/javascripts/right/i18n/pt-br.js +1 -0
- data/vendor/assets/javascripts/right/i18n/ru.js +1 -0
- data/vendor/assets/javascripts/right/i18n/ua.js +1 -0
- data/vendor/assets/javascripts/right/jquerysh-src.js +4 -4
- data/vendor/assets/javascripts/right/jquerysh.js +2 -2
- data/vendor/assets/javascripts/right/rails-src.js +51 -15
- data/vendor/assets/javascripts/right/rails.js +2 -2
- data/vendor/assets/javascripts/right/resizable-src.js +11 -11
- data/vendor/assets/javascripts/right/rte-src.js +33 -13
- data/vendor/assets/javascripts/right/rte.js +2 -2
- data/vendor/assets/javascripts/right/slider-src.js +137 -28
- data/vendor/assets/javascripts/right/slider.js +2 -2
- metadata +24 -126
- data/generators/right_rails/right_rails_generator.rb +0 -46
- data/generators/right_rails/templates/iframed.html.erb +0 -10
- data/generators/right_scaffold/right_scaffold_generator.rb +0 -53
- data/generators/right_scaffold/templates/controller.rb +0 -99
- data/generators/right_scaffold/templates/helper.rb +0 -2
- data/generators/right_scaffold/templates/layout.html.erb +0 -18
- data/generators/right_scaffold/templates/style.css +0 -54
- data/generators/right_scaffold/templates/view__form.html.erb +0 -16
- data/generators/right_scaffold/templates/view__item.html.erb +0 -13
- data/generators/right_scaffold/templates/view_edit.html.erb +0 -6
- data/generators/right_scaffold/templates/view_index.html.erb +0 -9
- data/generators/right_scaffold/templates/view_new.html.erb +0 -5
- data/generators/right_scaffold/templates/view_show.html.erb +0 -10
- data/lib/generators/right_rails/templates/iframed.html.erb +0 -10
- data/public/images/rightjs-ui/colorpicker.png +0 -0
- data/public/images/rightjs-ui/resizable.png +0 -0
- data/public/images/rightjs-ui/rte.png +0 -0
- data/public/javascripts/right-olds-src.js +0 -652
- data/public/javascripts/right-olds.js +0 -9
- data/public/javascripts/right-safe-src.js +0 -68
- data/public/javascripts/right-safe.js +0 -7
- data/public/javascripts/right-src.js +0 -6014
- data/public/javascripts/right.js +0 -7
- data/public/javascripts/right/autocompleter-src.js +0 -625
- data/public/javascripts/right/autocompleter.js +0 -7
- data/public/javascripts/right/billboard-src.js +0 -564
- data/public/javascripts/right/billboard.js +0 -7
- data/public/javascripts/right/calendar-src.js +0 -1464
- data/public/javascripts/right/calendar.js +0 -7
- data/public/javascripts/right/casting-src.js +0 -183
- data/public/javascripts/right/casting.js +0 -7
- data/public/javascripts/right/colorpicker-src.js +0 -981
- data/public/javascripts/right/colorpicker.js +0 -7
- data/public/javascripts/right/dialog-src.js +0 -768
- data/public/javascripts/right/dialog.js +0 -7
- data/public/javascripts/right/dnd-src.js +0 -591
- data/public/javascripts/right/dnd.js +0 -7
- data/public/javascripts/right/effects-src.js +0 -508
- data/public/javascripts/right/effects.js +0 -7
- data/public/javascripts/right/i18n/de.js +0 -95
- data/public/javascripts/right/i18n/en-us.js +0 -11
- data/public/javascripts/right/i18n/es.js +0 -95
- data/public/javascripts/right/i18n/fi.js +0 -96
- data/public/javascripts/right/i18n/fr.js +0 -95
- data/public/javascripts/right/i18n/hu.js +0 -100
- data/public/javascripts/right/i18n/it.js +0 -95
- data/public/javascripts/right/i18n/jp.js +0 -99
- data/public/javascripts/right/i18n/nl.js +0 -95
- data/public/javascripts/right/i18n/pt-br.js +0 -95
- data/public/javascripts/right/i18n/ru.js +0 -95
- data/public/javascripts/right/i18n/ua.js +0 -99
- data/public/javascripts/right/in-edit-src.js +0 -373
- data/public/javascripts/right/in-edit.js +0 -7
- data/public/javascripts/right/jquerysh-src.js +0 -362
- data/public/javascripts/right/jquerysh.js +0 -7
- data/public/javascripts/right/json-src.js +0 -147
- data/public/javascripts/right/json.js +0 -7
- data/public/javascripts/right/keys-src.js +0 -87
- data/public/javascripts/right/keys.js +0 -7
- data/public/javascripts/right/lightbox-src.js +0 -931
- data/public/javascripts/right/lightbox.js +0 -7
- data/public/javascripts/right/rails-src.js +0 -402
- data/public/javascripts/right/rails.js +0 -7
- data/public/javascripts/right/rater-src.js +0 -384
- data/public/javascripts/right/rater.js +0 -7
- data/public/javascripts/right/resizable-src.js +0 -465
- data/public/javascripts/right/resizable.js +0 -7
- data/public/javascripts/right/rte-src.js +0 -2685
- data/public/javascripts/right/rte.js +0 -7
- data/public/javascripts/right/selectable-src.js +0 -725
- data/public/javascripts/right/selectable.js +0 -7
- data/public/javascripts/right/sizzle-src.js +0 -1132
- data/public/javascripts/right/sizzle.js +0 -7
- data/public/javascripts/right/slider-src.js +0 -395
- data/public/javascripts/right/slider.js +0 -7
- data/public/javascripts/right/sortable-src.js +0 -430
- data/public/javascripts/right/sortable.js +0 -7
- data/public/javascripts/right/table-src.js +0 -176
- data/public/javascripts/right/table.js +0 -7
- data/public/javascripts/right/tabs-src.js +0 -1157
- data/public/javascripts/right/tabs.js +0 -7
- data/public/javascripts/right/tags-src.js +0 -745
- data/public/javascripts/right/tags.js +0 -7
- data/public/javascripts/right/tooltips-src.js +0 -331
- data/public/javascripts/right/tooltips.js +0 -7
- data/public/javascripts/right/uploader-src.js +0 -302
- data/public/javascripts/right/uploader.js +0 -7
@@ -1,99 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* RightJS UI Internationalization: Ukrainian module
|
3
|
-
*
|
4
|
-
* Copyright (C) Maxim Golubev
|
5
|
-
* Copyright (C) Nikolay Nemshilov
|
6
|
-
*/
|
7
|
-
if (self.Calendar) {
|
8
|
-
Calendar.Options.firstDay = 0;
|
9
|
-
}
|
10
|
-
|
11
|
-
RightJS.Object.each({
|
12
|
-
|
13
|
-
Calendar: {
|
14
|
-
Done: 'Гаразд',
|
15
|
-
Now: 'Зараз',
|
16
|
-
NextMonth: 'Наступный мiсяць',
|
17
|
-
PrevMonth: 'Попереднiй мiсяць',
|
18
|
-
NextYear: 'Наступний рiк',
|
19
|
-
PrevYear: 'Попереднiй рiк',
|
20
|
-
|
21
|
-
dayNames: 'Неділя Понеділок Вівторок Середа Четвер П\'ятниця Субота'.split(' '),
|
22
|
-
dayNamesShort: 'Ндл Пнд Втр Срд Чтв Птн Сбт'.split(' '),
|
23
|
-
dayNamesMin: 'Нд Пн Вт Ср Чт Пт Сб'.split(' '),
|
24
|
-
monthNames: 'Січень Лютий Березень Квітень Травень Червень Липень Серпень Вересень Жовтень Листопад Грудень'.split(' '),
|
25
|
-
monthNamesShort: 'Січ Лют Бер Квіт Трав Черв Лип Серп Вер Жовт Лист Груд'.split(' ')
|
26
|
-
},
|
27
|
-
|
28
|
-
Lightbox: {
|
29
|
-
Close: 'Сховати',
|
30
|
-
Prev: 'Попереднє зображення',
|
31
|
-
Next: 'Наступне зображення'
|
32
|
-
},
|
33
|
-
|
34
|
-
InEdit: {
|
35
|
-
Save: "Зберегти",
|
36
|
-
Cancel: "Скасувати"
|
37
|
-
},
|
38
|
-
|
39
|
-
Colorpicker: {
|
40
|
-
Done: 'Гаразд'
|
41
|
-
},
|
42
|
-
|
43
|
-
Dialog: {
|
44
|
-
Ok: 'Гаразд',
|
45
|
-
Close: 'Сховати',
|
46
|
-
Cancel: 'Сховати',
|
47
|
-
Help: 'Помощь',
|
48
|
-
Expand: 'Во все окно',
|
49
|
-
Collapse: 'Обычный размер',
|
50
|
-
Alert: 'Внимание!',
|
51
|
-
Confirm: 'Подтверждение',
|
52
|
-
Prompt: 'Ввод данных'
|
53
|
-
},
|
54
|
-
|
55
|
-
Rte: {
|
56
|
-
Clear: 'Clear',
|
57
|
-
Save: 'Save',
|
58
|
-
Source: 'Source',
|
59
|
-
Bold: 'Bold',
|
60
|
-
Italic: 'Italic',
|
61
|
-
Underline: 'Underline',
|
62
|
-
Strike: 'Strike through',
|
63
|
-
Ttext: 'Typetext',
|
64
|
-
Header: 'Header',
|
65
|
-
Cut: 'Cut',
|
66
|
-
Copy: 'Copy',
|
67
|
-
Paste: 'Paste',
|
68
|
-
Left: 'Left',
|
69
|
-
Center: 'Center',
|
70
|
-
Right: 'Right',
|
71
|
-
Justify: 'Justify',
|
72
|
-
Undo: 'Undo',
|
73
|
-
Redo: 'Redo',
|
74
|
-
Code: 'Code block',
|
75
|
-
Quote: 'Block quote',
|
76
|
-
Link: 'Add link',
|
77
|
-
Image: 'Insert image',
|
78
|
-
Video: 'Insert video',
|
79
|
-
Dotlist: 'List with dots',
|
80
|
-
Numlist: 'List with numbers',
|
81
|
-
Indent: 'Indent',
|
82
|
-
Outdent: 'Outdent',
|
83
|
-
Forecolor: 'Text color',
|
84
|
-
Backcolor: 'Background color',
|
85
|
-
Select: 'Select',
|
86
|
-
Remove: 'Remove',
|
87
|
-
Format: 'Format',
|
88
|
-
Fontname: 'Font name',
|
89
|
-
Fontsize: 'Size',
|
90
|
-
Subscript: 'Subscript',
|
91
|
-
Superscript: 'Superscript',
|
92
|
-
UrlAddress: 'URL Address'
|
93
|
-
}
|
94
|
-
|
95
|
-
}, function(module, i18n) {
|
96
|
-
if (self[module]) {
|
97
|
-
RightJS.$ext(self[module].i18n, i18n);
|
98
|
-
}
|
99
|
-
});
|
@@ -1,373 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* RightJS-UI InEdit v2.2.0
|
3
|
-
* http://rightjs.org/ui/in-edit
|
4
|
-
*
|
5
|
-
* Copyright (C) 2009-2011 Nikolay Nemshilov
|
6
|
-
*/
|
7
|
-
var InEdit = RightJS.InEdit = (function(document, RightJS) {
|
8
|
-
/**
|
9
|
-
* This module defines the basic widgets constructor
|
10
|
-
* it creates an abstract proxy with the common functionality
|
11
|
-
* which then we reuse and override in the actual widgets
|
12
|
-
*
|
13
|
-
* Copyright (C) 2010-2011 Nikolay Nemshilov
|
14
|
-
*/
|
15
|
-
|
16
|
-
/**
|
17
|
-
* The widget units constructor
|
18
|
-
*
|
19
|
-
* @param String tag-name or Object methods
|
20
|
-
* @param Object methods
|
21
|
-
* @return Widget wrapper
|
22
|
-
*/
|
23
|
-
function Widget(tag_name, methods) {
|
24
|
-
if (!methods) {
|
25
|
-
methods = tag_name;
|
26
|
-
tag_name = 'DIV';
|
27
|
-
}
|
28
|
-
|
29
|
-
/**
|
30
|
-
* An Abstract Widget Unit
|
31
|
-
*
|
32
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
33
|
-
*/
|
34
|
-
var AbstractWidget = new RightJS.Class(RightJS.Element.Wrappers[tag_name] || RightJS.Element, {
|
35
|
-
/**
|
36
|
-
* The common constructor
|
37
|
-
*
|
38
|
-
* @param Object options
|
39
|
-
* @param String optional tag name
|
40
|
-
* @return void
|
41
|
-
*/
|
42
|
-
initialize: function(key, options) {
|
43
|
-
this.key = key;
|
44
|
-
var args = [{'class': 'rui-' + key}];
|
45
|
-
|
46
|
-
// those two have different constructors
|
47
|
-
if (!(this instanceof RightJS.Input || this instanceof RightJS.Form)) {
|
48
|
-
args.unshift(tag_name);
|
49
|
-
}
|
50
|
-
this.$super.apply(this, args);
|
51
|
-
|
52
|
-
if (RightJS.isString(options)) {
|
53
|
-
options = RightJS.$(options);
|
54
|
-
}
|
55
|
-
|
56
|
-
// if the options is another element then
|
57
|
-
// try to dynamically rewrap it with our widget
|
58
|
-
if (options instanceof RightJS.Element) {
|
59
|
-
this._ = options._;
|
60
|
-
if ('$listeners' in options) {
|
61
|
-
options.$listeners = options.$listeners;
|
62
|
-
}
|
63
|
-
options = {};
|
64
|
-
}
|
65
|
-
this.setOptions(options, this);
|
66
|
-
|
67
|
-
return (RightJS.Wrapper.Cache[RightJS.$uid(this._)] = this);
|
68
|
-
},
|
69
|
-
|
70
|
-
// protected
|
71
|
-
|
72
|
-
/**
|
73
|
-
* Catches the options
|
74
|
-
*
|
75
|
-
* @param Object user-options
|
76
|
-
* @param Element element with contextual options
|
77
|
-
* @return void
|
78
|
-
*/
|
79
|
-
setOptions: function(options, element) {
|
80
|
-
if (element) {
|
81
|
-
options = RightJS.Object.merge(options, new Function("return "+(
|
82
|
-
element.get('data-'+ this.key) || '{}'
|
83
|
-
))());
|
84
|
-
}
|
85
|
-
|
86
|
-
if (options) {
|
87
|
-
RightJS.Options.setOptions.call(this, RightJS.Object.merge(this.options, options));
|
88
|
-
}
|
89
|
-
|
90
|
-
return this;
|
91
|
-
}
|
92
|
-
});
|
93
|
-
|
94
|
-
/**
|
95
|
-
* Creating the actual widget class
|
96
|
-
*
|
97
|
-
*/
|
98
|
-
var Klass = new RightJS.Class(AbstractWidget, methods);
|
99
|
-
|
100
|
-
// creating the widget related shortcuts
|
101
|
-
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || RightJS([]));
|
102
|
-
|
103
|
-
return Klass;
|
104
|
-
}
|
105
|
-
|
106
|
-
|
107
|
-
/**
|
108
|
-
* A shared module to create textual spinners
|
109
|
-
*
|
110
|
-
* Copyright (C) 2010-2011 Nikolay Nemshilov
|
111
|
-
*/
|
112
|
-
var Spinner = new RightJS.Class(RightJS.Element, {
|
113
|
-
/**
|
114
|
-
* Constructor
|
115
|
-
*
|
116
|
-
* @param Number optional spinner size (4 by default)
|
117
|
-
* @return void
|
118
|
-
*/
|
119
|
-
initialize: function(size) {
|
120
|
-
this.$super('div', {'class': 'rui-spinner'});
|
121
|
-
this.dots = [];
|
122
|
-
|
123
|
-
for (var i=0; i < (size || 4); i++) {
|
124
|
-
this.dots.push(new RightJS.Element('div'));
|
125
|
-
}
|
126
|
-
|
127
|
-
this.dots[0].addClass('glowing');
|
128
|
-
this.insert(this.dots);
|
129
|
-
RightJS(this.shift).bind(this).periodical(300);
|
130
|
-
},
|
131
|
-
|
132
|
-
/**
|
133
|
-
* Shifts the spinner elements
|
134
|
-
*
|
135
|
-
* @return void
|
136
|
-
*/
|
137
|
-
shift: function() {
|
138
|
-
if (this.visible()) {
|
139
|
-
var dot = this.dots.pop();
|
140
|
-
this.dots.unshift(dot);
|
141
|
-
this.insert(dot, 'top');
|
142
|
-
}
|
143
|
-
}
|
144
|
-
});
|
145
|
-
|
146
|
-
|
147
|
-
/**
|
148
|
-
* In-Edit plugin initalization
|
149
|
-
*
|
150
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
151
|
-
*/
|
152
|
-
var R = RightJS,
|
153
|
-
$ = RightJS.$,
|
154
|
-
$w = RightJS.$w,
|
155
|
-
Xhr = RightJS.Xhr,
|
156
|
-
Object = RightJS.Object,
|
157
|
-
Element = RightJS.Element,
|
158
|
-
Input = RightJS.Input;
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
/**
|
169
|
-
* An inline editor feature
|
170
|
-
*
|
171
|
-
* Copyright (C) 2009-2011 Nikolay Nemshilov
|
172
|
-
*/
|
173
|
-
var InEdit = new Widget('FORM', {
|
174
|
-
extend: {
|
175
|
-
version: '2.2.0',
|
176
|
-
|
177
|
-
EVENTS: $w('show hide send update'),
|
178
|
-
|
179
|
-
Options: {
|
180
|
-
url: null, // the url address where to send the stuff
|
181
|
-
name: 'text', // the field name
|
182
|
-
method: 'put', // the method
|
183
|
-
|
184
|
-
type: 'text', // the input type, 'text', 'file', 'password' or 'textarea'
|
185
|
-
|
186
|
-
toggle: null, // a reference to an element that should get hidden when the editor is active
|
187
|
-
|
188
|
-
update: true, // a marker if the element should be updated with the response-text
|
189
|
-
|
190
|
-
Xhr: {} // additional Xhr options
|
191
|
-
},
|
192
|
-
|
193
|
-
i18n: {
|
194
|
-
Save: 'Save',
|
195
|
-
Cancel: 'Cancel'
|
196
|
-
},
|
197
|
-
|
198
|
-
current: null // currently opened editor
|
199
|
-
},
|
200
|
-
|
201
|
-
/**
|
202
|
-
* Constructor
|
203
|
-
*
|
204
|
-
* @param mixed an element reference
|
205
|
-
* @param Object options
|
206
|
-
* @return void
|
207
|
-
*/
|
208
|
-
initialize: function(element, options) {
|
209
|
-
this.element = $(element);
|
210
|
-
|
211
|
-
this
|
212
|
-
.$super('in-edit', options)
|
213
|
-
.set('action', this.options.url)
|
214
|
-
.insert([
|
215
|
-
this.field = new Input({type: this.options.type, name: this.options.name, 'class': 'field'}),
|
216
|
-
this.spinner = new Spinner(4),
|
217
|
-
this.submit = new Input({type: 'submit', 'class': 'submit', value: InEdit.i18n.Save}),
|
218
|
-
this.cancel = new Element('a', {'class': 'cancel', href: '#', html: InEdit.i18n.Cancel})
|
219
|
-
])
|
220
|
-
.onClick(this.clicked)
|
221
|
-
.onSubmit(this.send);
|
222
|
-
},
|
223
|
-
|
224
|
-
/**
|
225
|
-
* Shows the inline-editor form
|
226
|
-
*
|
227
|
-
* @return InEdit this
|
228
|
-
*/
|
229
|
-
show: function() {
|
230
|
-
if (InEdit.current !== this) {
|
231
|
-
if (InEdit.current) { InEdit.current.hide(); }
|
232
|
-
|
233
|
-
this.oldContent = this.element.html();
|
234
|
-
|
235
|
-
if (!R(['file', 'password']).include(this.options.type)) {
|
236
|
-
this.field.setValue(this.oldContent);
|
237
|
-
}
|
238
|
-
|
239
|
-
this.element.update(this);
|
240
|
-
|
241
|
-
this.spinner.hide();
|
242
|
-
this.submit.show();
|
243
|
-
|
244
|
-
if (this.options.toggle) {
|
245
|
-
$(this.options.toggle).hide();
|
246
|
-
}
|
247
|
-
}
|
248
|
-
|
249
|
-
if (this.options.type !== 'file') {
|
250
|
-
this.field.focus();
|
251
|
-
}
|
252
|
-
|
253
|
-
InEdit.current = this;
|
254
|
-
return this.fire('show');
|
255
|
-
},
|
256
|
-
|
257
|
-
/**
|
258
|
-
* Hides the form and brings the content back
|
259
|
-
*
|
260
|
-
* @param String optional new content
|
261
|
-
* @return InEdit this
|
262
|
-
*/
|
263
|
-
hide: function() {
|
264
|
-
this.element._.innerHTML = this.oldContent;
|
265
|
-
|
266
|
-
if (this.xhr) {
|
267
|
-
this.xhr.cancel();
|
268
|
-
}
|
269
|
-
|
270
|
-
return this.finish();
|
271
|
-
},
|
272
|
-
|
273
|
-
/**
|
274
|
-
* Triggers the form remote submit
|
275
|
-
*
|
276
|
-
* @return InEdit this
|
277
|
-
*/
|
278
|
-
send: function(event) {
|
279
|
-
if (event) { event.stop(); }
|
280
|
-
|
281
|
-
this.spinner.show().resize(this.submit.size());
|
282
|
-
this.submit.hide();
|
283
|
-
|
284
|
-
this.xhr = new Xhr(this.options.url, Object.merge(this.options.Xhr, {
|
285
|
-
method: this.options.method,
|
286
|
-
spinner: this.spinner,
|
287
|
-
onComplete: R(this.receive).bind(this)
|
288
|
-
})).send(this);
|
289
|
-
|
290
|
-
return this.fire('send');
|
291
|
-
},
|
292
|
-
|
293
|
-
// protected
|
294
|
-
|
295
|
-
// finishes up with the form
|
296
|
-
finish: function() {
|
297
|
-
if (this.options.toggle) {
|
298
|
-
$(this.options.toggle).show();
|
299
|
-
}
|
300
|
-
|
301
|
-
InEdit.current = null;
|
302
|
-
return this.fire('hide');
|
303
|
-
},
|
304
|
-
|
305
|
-
// the xhr callback
|
306
|
-
receive: function() {
|
307
|
-
if (this.options.update) {
|
308
|
-
this.element.update(this.xhr.text);
|
309
|
-
this.fire('update');
|
310
|
-
}
|
311
|
-
|
312
|
-
this.xhr = null;
|
313
|
-
|
314
|
-
this.finish();
|
315
|
-
},
|
316
|
-
|
317
|
-
// catches clicks on the element
|
318
|
-
clicked: function(event) {
|
319
|
-
if (event.target === this.cancel) {
|
320
|
-
event.stop();
|
321
|
-
this.hide();
|
322
|
-
}
|
323
|
-
}
|
324
|
-
|
325
|
-
});
|
326
|
-
|
327
|
-
|
328
|
-
/**
|
329
|
-
* The document hooks for in-edit form
|
330
|
-
*
|
331
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
332
|
-
*/
|
333
|
-
$(document).onKeydown(function(event) {
|
334
|
-
// processing the `ESC` button
|
335
|
-
if (event.keyCode === 27 && InEdit.current) {
|
336
|
-
InEdit.current.hide();
|
337
|
-
}
|
338
|
-
});
|
339
|
-
|
340
|
-
|
341
|
-
/**
|
342
|
-
* The element level inline editor extension
|
343
|
-
*
|
344
|
-
* Copyright (C) 2009-2010 Nikolay Nemshilov
|
345
|
-
*/
|
346
|
-
Element.include({
|
347
|
-
/**
|
348
|
-
* Triggers an inline-editor feature on the element
|
349
|
-
*
|
350
|
-
* @param Object options for the InEdit class
|
351
|
-
* @return InEdit object
|
352
|
-
*/
|
353
|
-
inEdit: function(options) {
|
354
|
-
return new InEdit(this, options).show();
|
355
|
-
}
|
356
|
-
});
|
357
|
-
|
358
|
-
|
359
|
-
var embed_style = document.createElement('style'),
|
360
|
-
embed_rules = document.createTextNode("div.rui-spinner,div.rui-spinner div{margin:0;padding:0;border:none;background:none;list-style:none;font-weight:normal;float:none;display:inline-block; *display:inline; *zoom:1;border-radius:.12em;-moz-border-radius:.12em;-webkit-border-radius:.12em}div.rui-spinner{text-align:center;white-space:nowrap;background:#EEE;border:1px solid #DDD;height:1.2em;padding:0 .2em}div.rui-spinner div{width:.4em;height:70%;background:#BBB;margin-left:1px}div.rui-spinner div:first-child{margin-left:0}div.rui-spinner div.glowing{background:#777}form.rui-in-edit,form.rui-in-edit .cancel{margin:0;padding:0;float:none;position:static}form.rui-in-edit{display:inline-block; *display:inline; *zoom:1;border:none;background:none}form.rui-in-edit div.rui-spinner{margin-right:.2em}form.rui-in-edit div.rui-spinner div{margin-top:.2em}form.rui-in-edit textarea.field{width:100%;margin-bottom:.5em}form.rui-in-edit .field,form.rui-in-edit .submit{margin-right:.2em}form.rui-in-edit,form.rui-in-edit .field,form.rui-in-edit .submit,form.rui-in-edit div.rui-spinner,form.rui-in-edit .cancel{vertical-align:middle}");
|
361
|
-
|
362
|
-
embed_style.type = 'text/css';
|
363
|
-
document.getElementsByTagName('head')[0].appendChild(embed_style);
|
364
|
-
|
365
|
-
if(embed_style.styleSheet) {
|
366
|
-
embed_style.styleSheet.cssText = embed_rules.nodeValue;
|
367
|
-
} else {
|
368
|
-
embed_style.appendChild(embed_rules);
|
369
|
-
}
|
370
|
-
|
371
|
-
|
372
|
-
return InEdit;
|
373
|
-
})(document, RightJS);
|