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.
Files changed (131) hide show
  1. data/CHANGELOG +7 -0
  2. data/README.rdoc +1 -1
  3. data/Rakefile +1 -1
  4. data/init.rb +1 -0
  5. data/lib/generators/right_rails/right_rails_generator.rb +15 -6
  6. data/lib/right_rails.rb +1 -1
  7. data/lib/right_rails/controller_extensions.rb +28 -15
  8. data/lib/right_rails/helpers/misc.rb +38 -38
  9. data/lib/right_rails/helpers/rails.rb +50 -7
  10. data/lib/rjs_renderer.rb +26 -0
  11. data/spec/lib/right_rails/controller_extensions_spec.rb +25 -14
  12. data/spec/lib/right_rails/helpers/forms_spec.rb +6 -6
  13. data/spec/lib/right_rails/helpers/rails_spec.rb +44 -45
  14. data/vendor/assets/images/rightjs-ui/rte.png +0 -0
  15. data/vendor/assets/javascripts/right-safe-src.js +2 -2
  16. data/vendor/assets/javascripts/right-safe.js +2 -2
  17. data/vendor/assets/javascripts/right-src.js +386 -100
  18. data/vendor/assets/javascripts/right.js +2 -2
  19. data/vendor/assets/javascripts/right/calendar-src.js +19 -3
  20. data/vendor/assets/javascripts/right/calendar.js +2 -2
  21. data/vendor/assets/javascripts/right/colorpicker-src.js +59 -20
  22. data/vendor/assets/javascripts/right/colorpicker.js +2 -2
  23. data/vendor/assets/javascripts/right/i18n/de.js +43 -42
  24. data/vendor/assets/javascripts/right/i18n/es.js +1 -0
  25. data/vendor/assets/javascripts/right/i18n/fi.js +1 -0
  26. data/vendor/assets/javascripts/right/i18n/fr.js +1 -0
  27. data/vendor/assets/javascripts/right/i18n/hu.js +1 -0
  28. data/vendor/assets/javascripts/right/i18n/it.js +1 -0
  29. data/vendor/assets/javascripts/right/i18n/jp.js +1 -0
  30. data/vendor/assets/javascripts/right/i18n/lt.js +96 -0
  31. data/vendor/assets/javascripts/right/i18n/nl.js +1 -0
  32. data/vendor/assets/javascripts/right/i18n/pt-br.js +1 -0
  33. data/vendor/assets/javascripts/right/i18n/ru.js +1 -0
  34. data/vendor/assets/javascripts/right/i18n/ua.js +1 -0
  35. data/vendor/assets/javascripts/right/jquerysh-src.js +4 -4
  36. data/vendor/assets/javascripts/right/jquerysh.js +2 -2
  37. data/vendor/assets/javascripts/right/rails-src.js +51 -15
  38. data/vendor/assets/javascripts/right/rails.js +2 -2
  39. data/vendor/assets/javascripts/right/resizable-src.js +11 -11
  40. data/vendor/assets/javascripts/right/rte-src.js +33 -13
  41. data/vendor/assets/javascripts/right/rte.js +2 -2
  42. data/vendor/assets/javascripts/right/slider-src.js +137 -28
  43. data/vendor/assets/javascripts/right/slider.js +2 -2
  44. metadata +24 -126
  45. data/generators/right_rails/right_rails_generator.rb +0 -46
  46. data/generators/right_rails/templates/iframed.html.erb +0 -10
  47. data/generators/right_scaffold/right_scaffold_generator.rb +0 -53
  48. data/generators/right_scaffold/templates/controller.rb +0 -99
  49. data/generators/right_scaffold/templates/helper.rb +0 -2
  50. data/generators/right_scaffold/templates/layout.html.erb +0 -18
  51. data/generators/right_scaffold/templates/style.css +0 -54
  52. data/generators/right_scaffold/templates/view__form.html.erb +0 -16
  53. data/generators/right_scaffold/templates/view__item.html.erb +0 -13
  54. data/generators/right_scaffold/templates/view_edit.html.erb +0 -6
  55. data/generators/right_scaffold/templates/view_index.html.erb +0 -9
  56. data/generators/right_scaffold/templates/view_new.html.erb +0 -5
  57. data/generators/right_scaffold/templates/view_show.html.erb +0 -10
  58. data/lib/generators/right_rails/templates/iframed.html.erb +0 -10
  59. data/public/images/rightjs-ui/colorpicker.png +0 -0
  60. data/public/images/rightjs-ui/resizable.png +0 -0
  61. data/public/images/rightjs-ui/rte.png +0 -0
  62. data/public/javascripts/right-olds-src.js +0 -652
  63. data/public/javascripts/right-olds.js +0 -9
  64. data/public/javascripts/right-safe-src.js +0 -68
  65. data/public/javascripts/right-safe.js +0 -7
  66. data/public/javascripts/right-src.js +0 -6014
  67. data/public/javascripts/right.js +0 -7
  68. data/public/javascripts/right/autocompleter-src.js +0 -625
  69. data/public/javascripts/right/autocompleter.js +0 -7
  70. data/public/javascripts/right/billboard-src.js +0 -564
  71. data/public/javascripts/right/billboard.js +0 -7
  72. data/public/javascripts/right/calendar-src.js +0 -1464
  73. data/public/javascripts/right/calendar.js +0 -7
  74. data/public/javascripts/right/casting-src.js +0 -183
  75. data/public/javascripts/right/casting.js +0 -7
  76. data/public/javascripts/right/colorpicker-src.js +0 -981
  77. data/public/javascripts/right/colorpicker.js +0 -7
  78. data/public/javascripts/right/dialog-src.js +0 -768
  79. data/public/javascripts/right/dialog.js +0 -7
  80. data/public/javascripts/right/dnd-src.js +0 -591
  81. data/public/javascripts/right/dnd.js +0 -7
  82. data/public/javascripts/right/effects-src.js +0 -508
  83. data/public/javascripts/right/effects.js +0 -7
  84. data/public/javascripts/right/i18n/de.js +0 -95
  85. data/public/javascripts/right/i18n/en-us.js +0 -11
  86. data/public/javascripts/right/i18n/es.js +0 -95
  87. data/public/javascripts/right/i18n/fi.js +0 -96
  88. data/public/javascripts/right/i18n/fr.js +0 -95
  89. data/public/javascripts/right/i18n/hu.js +0 -100
  90. data/public/javascripts/right/i18n/it.js +0 -95
  91. data/public/javascripts/right/i18n/jp.js +0 -99
  92. data/public/javascripts/right/i18n/nl.js +0 -95
  93. data/public/javascripts/right/i18n/pt-br.js +0 -95
  94. data/public/javascripts/right/i18n/ru.js +0 -95
  95. data/public/javascripts/right/i18n/ua.js +0 -99
  96. data/public/javascripts/right/in-edit-src.js +0 -373
  97. data/public/javascripts/right/in-edit.js +0 -7
  98. data/public/javascripts/right/jquerysh-src.js +0 -362
  99. data/public/javascripts/right/jquerysh.js +0 -7
  100. data/public/javascripts/right/json-src.js +0 -147
  101. data/public/javascripts/right/json.js +0 -7
  102. data/public/javascripts/right/keys-src.js +0 -87
  103. data/public/javascripts/right/keys.js +0 -7
  104. data/public/javascripts/right/lightbox-src.js +0 -931
  105. data/public/javascripts/right/lightbox.js +0 -7
  106. data/public/javascripts/right/rails-src.js +0 -402
  107. data/public/javascripts/right/rails.js +0 -7
  108. data/public/javascripts/right/rater-src.js +0 -384
  109. data/public/javascripts/right/rater.js +0 -7
  110. data/public/javascripts/right/resizable-src.js +0 -465
  111. data/public/javascripts/right/resizable.js +0 -7
  112. data/public/javascripts/right/rte-src.js +0 -2685
  113. data/public/javascripts/right/rte.js +0 -7
  114. data/public/javascripts/right/selectable-src.js +0 -725
  115. data/public/javascripts/right/selectable.js +0 -7
  116. data/public/javascripts/right/sizzle-src.js +0 -1132
  117. data/public/javascripts/right/sizzle.js +0 -7
  118. data/public/javascripts/right/slider-src.js +0 -395
  119. data/public/javascripts/right/slider.js +0 -7
  120. data/public/javascripts/right/sortable-src.js +0 -430
  121. data/public/javascripts/right/sortable.js +0 -7
  122. data/public/javascripts/right/table-src.js +0 -176
  123. data/public/javascripts/right/table.js +0 -7
  124. data/public/javascripts/right/tabs-src.js +0 -1157
  125. data/public/javascripts/right/tabs.js +0 -7
  126. data/public/javascripts/right/tags-src.js +0 -745
  127. data/public/javascripts/right/tags.js +0 -7
  128. data/public/javascripts/right/tooltips-src.js +0 -331
  129. data/public/javascripts/right/tooltips.js +0 -7
  130. data/public/javascripts/right/uploader-src.js +0 -302
  131. 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);