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,7 +1,7 @@
1
1
  /**
2
- * RightJS-UI Slider v2.2.3
2
+ * RightJS-UI Slider v2.3.0
3
3
  * http://rightjs.org/ui/slider
4
4
  *
5
5
  * Copyright (C) 2009-2011 Nikolay Nemshilov
6
6
  */
7
- var Slider=RightJS.Slider=function(a,b,c){function d(a,b){b||(b=a,a="DIV");var d=new c.Class(c.Element.Wrappers[a]||c.Element,{initialize:function(b,d){this.key=b;var e=[{"class":"rui-"+b}];this instanceof c.Input||this instanceof c.Form||e.unshift(a),this.$super.apply(this,e),c.isString(d)&&(d=c.$(d)),d instanceof c.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return c.Wrapper.Cache[c.$uid(this._)]=this},setOptions:function(a,b){b&&(a=c.Object.merge(a,(new Function("return "+(b.get("data-"+this.key)||"{}")))())),a&&c.Options.setOptions.call(this,c.Object.merge(this.options,a));return this}}),e=new c.Class(d,b);c.Observer.createShortcuts(e.prototype,e.EVENTS||c([]));return e}var e={assignTo:function(b){var c=f(function(a,b){(a=g(a))&&a[a.setValue?"setValue":"update"](b.target.getValue())}).curry(b),d=f(function(a,b){a=g(a),a&&a.onChange&&a.onChange(f(function(){this.setValue(a.value())}).bind(b))}).curry(b);g(b)?(c({target:this}),d(this)):g(a).onReady(f(function(){c({target:this}),d(this)}.bind(this)));return this.onChange(c)}},f=c,g=c.$,h=c.$$,i=c.$w,j=c.$E,k=c.$A,l=c.isHash,m=c.Element,n=new d({include:e,extend:{version:"2.2.3",EVENTS:i("change"),Options:{min:0,max:100,snap:0,value:null,direction:"x",update:null,round:0},current:!1},initialize:function(){var a=k(arguments).compact(),b=a.pop(),c=a.pop();if(!l(b)||b instanceof m)c=g(c||b),b={};this.$super("slider",c).setOptions(b).on("selectstart","stopEvent"),this.level=this.first(".level")||j("div",{"class":"level"}).insertTo(this),this.handle=this.first(".handle")||j("div",{"class":"handle"}).insertTo(this),b=this.options,this.value=b.value===null?b.min:b.value,b.update&&this.assignTo(b.update),b.direction==="y"?this.addClass("rui-slider-vertical"):this.hasClass("rui-slider-vertical")&&(b.direction="y"),this.setValue(this.value)},setValue:function(a){return this.precalc().shiftTo(a)},getValue:function(){return this.value},insertTo:function(a,b){return this.$super(a,b).setValue(this.value)},precalc:function(){var a=this.options.direction==="x",b=this.handle.setStyle(a?{left:0}:{bottom:0}).dimensions(),c=this.hSize=a?b.width:b.height,d=this.dims=this.dimensions();this.offset=a?b.left-d.left:d.top+d.height-b.top-c,this.space=(a?d.width:d.height)-c-this.offset*2;return this},start:function(a){return this.precalc().e2val(a)},move:function(a){return this.e2val(a)},shiftTo:function(a){var c=this.options,d=b.pow(10,c.round),e=c.direction==="x";a=b.round(a*d)/d,a<c.min&&(a=c.min),a>c.max&&(a=c.max);if(c.snap){var f=c.snap,g=(a-c.min)%f;a=g<f/2?a-g:a-g+f}var h=this.space/(c.max-c.min)*(a-c.min);this.handle._.style[e?"left":"bottom"]=h+"px",this.level._.style[e?"width":"height"]=(h>0?h:0)+2+"px",a!==this.value&&(this.value=a,this.fire("change",{value:a}));return this},e2val:function(a){var b=this.options,c=b.direction==="x",d=this.dims,e=this.offset,f=this.space,g=a.position()[c?"x":"y"]-e-this.hSize/2,h=c?d.left+e:d.top+e,i=(b.max-b.min)/f*(g-h);return this.shiftTo(c?b.min+i:b.max-i)}});g(a).on({ready:function(){h(".rui-slider").each(function(a){a instanceof n||(a=new n(a))})},mousedown:function(a){var b=a.find(".rui-slider");b&&(a.stop(),b instanceof n||(b=new n(b)),n.current=b.start(a))},mousemove:function(a){n.current&&n.current.move(a)},mouseup:function(a){n.current&&(n.current=!1)}}),g(window).onBlur(function(){n.current&&(n.current=!1)});var o=a.createElement("style"),p=a.createTextNode("div.rui-slider,div.rui-slider .handle div.rui-slider .level{margin:0;padding:0;border:none;background:none}div.rui-slider{height:0.4em;width:20em;border:1px solid #bbb;background:#F8F8F8;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;position:relative;margin:.6em 0;display:inline-block; *display:inline; *zoom:1;vertical-align:middle;user-select:none;-moz-user-select:none;-webkit-user-select:none;cursor:pointer}div.rui-slider .handle{font-size:25%;position:absolute;left:0;top:0;width:4pt;height:10pt;margin-top:-4pt;margin-left:0.4em;background:#BBB;border:1px solid #999;border-radius:.8em;-moz-border-radius:.8em;-webkit-border-radius:.8em;z-index:20}div.rui-slider .level{font-size:25%;position:absolute;top:0;left:0;width:0;height:100%;background:#ddd;z-index:1}div.rui-slider-vertical{height:10em;width:0.4em;margin:0 .3em}div.rui-slider-vertical .handle{top:auto;bottom:0;margin:0;margin-left:-4pt;margin-bottom:0.4em;height:5pt;width:10pt}div.rui-slider-vertical .level{height:0;width:100%;top:auto;bottom:0}");o.type="text/css",a.getElementsByTagName("head")[0].appendChild(o),o.styleSheet?o.styleSheet.cssText=p.nodeValue:o.appendChild(p);return n}(document,Math,RightJS)
7
+ var Slider=RightJS.Slider=function(a,b,c){function d(a,b){b||(b=a,a="DIV");var d=new c.Class(c.Element.Wrappers[a]||c.Element,{initialize:function(b,d){this.key=b;var e=[{"class":"rui-"+b}];this instanceof c.Input||this instanceof c.Form||e.unshift(a),this.$super.apply(this,e),c.isString(d)&&(d=c.$(d)),d instanceof c.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return c.Wrapper.Cache[c.$uid(this._)]=this},setOptions:function(a,b){b&&(a=c.Object.merge(a,(new Function("return "+(b.get("data-"+this.key)||"{}")))())),a&&c.Options.setOptions.call(this,c.Object.merge(this.options,a));return this}}),e=new c.Class(d,b);c.Observer.createShortcuts(e.prototype,e.EVENTS||c([]));return e}var e={assignTo:function(b){var c=f(function(a,b){(a=g(a))&&a[a.setValue?"setValue":"update"](b.target.getValue())}).curry(b),d=f(function(a,b){a=g(a),a&&a.onChange&&a.onChange(f(function(){this.setValue(a.value())}).bind(b))}).curry(b);g(b)?(c({target:this}),d(this)):g(a).onReady(f(function(){c({target:this}),d(this)}.bind(this)));return this.onChange(c)}},f=c,g=c.$,h=c.$$,i=c.$w,j=c.$E,k=c.$A,l=c.isHash,m=c.Element,n=new d({include:e,extend:{version:"2.3.0",EVENTS:i("change"),Options:{min:0,max:100,snap:0,range:!1,value:null,values:null,direction:"x",update:null,round:0},current:!1},initialize:function(){var a=k(arguments).compact(),b=a.pop(),c=a.pop();if(!l(b)||b instanceof m)c=g(c||b),b={};this.$super("slider",c).setOptions(b).on("selectstart","stopEvent"),this.level=this.first(".level")||j("div",{"class":"level"}).insertTo(this),b=this.options,this.value=b.value===null?b.min:b.value,b.range===!0?(this.handles=[],this.handles[0]=this.first(".handle.from")||j("div",{"class":"handle from"}).insertTo(this),this.handles[1]=this.first(".handle.to")||j("div",{"class":"handle to"}).insertTo(this),this.values=[0,0],this.values[0]=b.values===null?b.min:b.values[0],this.values[1]=b.values===null?b.max:b.values[1],this.setValue(this.values[0],"from"),this.setValue(this.values[1],"to")):(this.handle=this.first(".handle")||j("div",{"class":"handle"}).insertTo(this),this.setValue(this.value)),b.update&&this.assignTo(b.update),b.direction==="y"?this.addClass("rui-slider-vertical"):this.hasClass("rui-slider-vertical")&&(b.direction="y")},setValue:function(a,b){return this.precalc().shiftTo(a,b)},getValue:function(){return this.options.range===!0?this.values[0]:this.value},getValues:function(){return this.values},insertTo:function(a,b){return this.$super(a,b).setValue(this.value)},precalc:function(){var a=this.options.direction==="x",b=this.dims=this.dimensions();if(this.options.range===!0){var c=this.handles[0].setStyle(a?{left:0}:{bottom:0}).dimensions(),d=this.hSize=a?c.width:c.height;this.offset=a?c.left-b.left:b.top+b.height-c.top-d,this.space=(a?b.width:b.height)-d-this.offset*2;var e=this.handles[1].setStyle(a?{left:this.space+"px"}:{bottom:this.space+"px"}).dimensions()}else{var f=this.handle.setStyle(a?{left:0}:{bottom:0}).dimensions(),d=this.hSize=a?f.width:f.height;this.offset=a?f.left-b.left:b.top+b.height-f.top-d,this.space=(a?b.width:b.height)-d-this.offset*2}return this},start:function(a){this._type=null,a.target.hasClass("handle")&&(a.target.hasClass("from")?this._type="from":a.target.hasClass("to")&&(this._type="to"));return this.precalc().e2val(a)},move:function(a){return this.e2val(a)},shiftTo:function(a,c){var d=this.options,e=b.pow(10,d.round),f=d.direction==="x";a=b.round(a*e)/e,a<d.min&&(a=d.min),a>d.max&&(a=d.max);if(d.range===!0){c==="to"&&a<this.values[0]&&(a=this.values[0]);if(c==="from"||c===undefined)a>this.values[1]&&(a=this.values[1])}if(d.snap){var g=d.snap,h=(a-d.min)%g;a=h<g/2?a-h:a-h+g}if(d.range===!0){var i=c==="from"?a:this.values[0],j=c==="to"?a:this.values[1],k=this.space/(d.max-d.min)*(i-d.min),l=this.space/(d.max-d.min)*(j-d.min),m=l-k;c==="to"?this.handles[1]._.style[f?"left":"bottom"]=l+"px":this.handles[0]._.style[f?"left":"bottom"]=k+"px",this.level._.style[f?"left":"top"]=(k>0?k:0)+2+"px",this.level._.style[f?"width":"height"]=(m>0?m:0)+2+"px";var n=!1;c==="from"&&a!==this.values[0]&&(this.values[0]=a,n=!0),c==="to"&&a!==this.values[1]&&(this.values[1]=a,n=!0),n&&this.fire("change",{value:a,values:this.values})}else{var o=this.space/(d.max-d.min)*(a-d.min);this.handle._.style[f?"left":"bottom"]=o+"px",this.level._.style[f?"width":"height"]=(o>0?o:0)+2+"px",a!==this.value&&(this.value=a,this.fire("change",{value:a}))}return this},e2val:function(a){var b=this.options,c=b.direction==="x",d=this.dims,e=this.offset,f=this.space,g=a.position()[c?"x":"y"]-e-this.hSize/2,h=c?d.left+e:d.top+e,i=(b.max-b.min)/f*(g-h),j=this._type;if(j==null)return this.shiftTo(c?b.min+i:b.max-i);if(j==="to"){this.shiftTo(this.values[0],"from");return this.shiftTo(c?b.min+i:b.max-i,"to")}this.shiftTo(this.values[1],"to");return this.shiftTo(c?b.min+i:b.max-i,"from")}});g(a).on({ready:function(){h(".rui-slider").each(function(a){a instanceof n||(a=new n(a))})},mousedown:function(a){var b=a.find(".rui-slider");b&&(a.stop(),b instanceof n||(b=new n(b)),n.current=b.start(a))},mousemove:function(a){n.current&&n.current.move(a)},mouseup:function(a){n.current&&(n.current=!1)}}),g(window).onBlur(function(){n.current&&(n.current=!1)});var o=a.createElement("style"),p=a.createTextNode("div.rui-slider,div.rui-slider .handle,div.rui-slider .level{margin:0;padding:0;border:none;background:none}div.rui-slider{height:0.4em;width:20em;border:1px solid #bbb;background:#F8F8F8;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;position:relative;margin:.6em 0;display:inline-block; *display:inline; *zoom:1;vertical-align:middle;user-select:none;-moz-user-select:none;-webkit-user-select:none;cursor:pointer}div.rui-slider .handle{font-size:25%;position:absolute;left:0;top:0;width:4pt;height:10pt;margin-top:-4pt;margin-left:0.4em;background:#BBB;border:1px solid #999;border-radius:.8em;-moz-border-radius:.8em;-webkit-border-radius:.8em;z-index:20}div.rui-slider .level{font-size:25%;position:absolute;top:0;left:0;width:0;height:100%;background:#ddd;z-index:1}div.rui-slider-vertical{height:10em;width:0.4em;margin:0 .3em}div.rui-slider-vertical .handle{top:auto;bottom:0;margin:0;margin-left:-4pt;margin-bottom:0.4em;height:5pt;width:10pt}div.rui-slider-vertical .level{height:0;width:100%;top:auto;bottom:0}");o.type="text/css",a.getElementsByTagName("head")[0].appendChild(o),o.styleSheet?o.styleSheet.cssText=p.nodeValue:o.appendChild(p);return n}(document,Math,RightJS)
metadata CHANGED
@@ -1,118 +1,25 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: right-rails
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.0
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 2
9
- - 2
10
- version: 1.2.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Nikolay Nemshilov
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-06-12 00:00:00 Z
12
+ date: 2011-11-11 00:00:00.000000000 Z
19
13
  dependencies: []
20
-
21
- description: RightRails is a RubyOnRails plugin for the RightJS JavaScript framework. It has transparent Prototype helpers replacement, a new RJS generator, the most common ajax operations interface and RightJS own features support like remote files uploading handler, UI, plugins, etc.
14
+ description: RightRails is a RubyOnRails plugin for the RightJS JavaScript framework.
15
+ It has transparent Prototype helpers replacement, a new RJS generator, the most
16
+ common ajax operations interface and RightJS own features support like remote files
17
+ uploading handler, UI, plugins, etc.
22
18
  email: nemshilov@gmail.com
23
19
  executables: []
24
-
25
20
  extensions: []
26
-
27
21
  extra_rdoc_files: []
28
-
29
- files:
30
- - generators/right_rails/right_rails_generator.rb
31
- - generators/right_rails/templates/iframed.html.erb
32
- - generators/right_scaffold/right_scaffold_generator.rb
33
- - generators/right_scaffold/templates/controller.rb
34
- - generators/right_scaffold/templates/helper.rb
35
- - generators/right_scaffold/templates/layout.html.erb
36
- - generators/right_scaffold/templates/style.css
37
- - generators/right_scaffold/templates/view__form.html.erb
38
- - generators/right_scaffold/templates/view__item.html.erb
39
- - generators/right_scaffold/templates/view_edit.html.erb
40
- - generators/right_scaffold/templates/view_index.html.erb
41
- - generators/right_scaffold/templates/view_new.html.erb
42
- - generators/right_scaffold/templates/view_show.html.erb
43
- - public/images/rightjs-ui/colorpicker.png
44
- - public/images/rightjs-ui/resizable.png
45
- - public/images/rightjs-ui/rte.png
46
- - public/javascripts/right/autocompleter-src.js
47
- - public/javascripts/right/autocompleter.js
48
- - public/javascripts/right/billboard-src.js
49
- - public/javascripts/right/billboard.js
50
- - public/javascripts/right/calendar-src.js
51
- - public/javascripts/right/calendar.js
52
- - public/javascripts/right/casting-src.js
53
- - public/javascripts/right/casting.js
54
- - public/javascripts/right/colorpicker-src.js
55
- - public/javascripts/right/colorpicker.js
56
- - public/javascripts/right/dialog-src.js
57
- - public/javascripts/right/dialog.js
58
- - public/javascripts/right/dnd-src.js
59
- - public/javascripts/right/dnd.js
60
- - public/javascripts/right/effects-src.js
61
- - public/javascripts/right/effects.js
62
- - public/javascripts/right/i18n/de.js
63
- - public/javascripts/right/i18n/en-us.js
64
- - public/javascripts/right/i18n/es.js
65
- - public/javascripts/right/i18n/fi.js
66
- - public/javascripts/right/i18n/fr.js
67
- - public/javascripts/right/i18n/hu.js
68
- - public/javascripts/right/i18n/it.js
69
- - public/javascripts/right/i18n/jp.js
70
- - public/javascripts/right/i18n/nl.js
71
- - public/javascripts/right/i18n/pt-br.js
72
- - public/javascripts/right/i18n/ru.js
73
- - public/javascripts/right/i18n/ua.js
74
- - public/javascripts/right/in-edit-src.js
75
- - public/javascripts/right/in-edit.js
76
- - public/javascripts/right/jquerysh-src.js
77
- - public/javascripts/right/jquerysh.js
78
- - public/javascripts/right/json-src.js
79
- - public/javascripts/right/json.js
80
- - public/javascripts/right/keys-src.js
81
- - public/javascripts/right/keys.js
82
- - public/javascripts/right/lightbox-src.js
83
- - public/javascripts/right/lightbox.js
84
- - public/javascripts/right/rails-src.js
85
- - public/javascripts/right/rails.js
86
- - public/javascripts/right/rater-src.js
87
- - public/javascripts/right/rater.js
88
- - public/javascripts/right/resizable-src.js
89
- - public/javascripts/right/resizable.js
90
- - public/javascripts/right/rte-src.js
91
- - public/javascripts/right/rte.js
92
- - public/javascripts/right/selectable-src.js
93
- - public/javascripts/right/selectable.js
94
- - public/javascripts/right/sizzle-src.js
95
- - public/javascripts/right/sizzle.js
96
- - public/javascripts/right/slider-src.js
97
- - public/javascripts/right/slider.js
98
- - public/javascripts/right/sortable-src.js
99
- - public/javascripts/right/sortable.js
100
- - public/javascripts/right/table-src.js
101
- - public/javascripts/right/table.js
102
- - public/javascripts/right/tabs-src.js
103
- - public/javascripts/right/tabs.js
104
- - public/javascripts/right/tags-src.js
105
- - public/javascripts/right/tags.js
106
- - public/javascripts/right/tooltips-src.js
107
- - public/javascripts/right/tooltips.js
108
- - public/javascripts/right/uploader-src.js
109
- - public/javascripts/right/uploader.js
110
- - public/javascripts/right-olds-src.js
111
- - public/javascripts/right-olds.js
112
- - public/javascripts/right-safe-src.js
113
- - public/javascripts/right-safe.js
114
- - public/javascripts/right-src.js
115
- - public/javascripts/right.js
22
+ files:
116
23
  - vendor/assets/images/rightjs-ui/colorpicker.png
117
24
  - vendor/assets/images/rightjs-ui/resizable.png
118
25
  - vendor/assets/images/rightjs-ui/rte.png
@@ -140,6 +47,7 @@ files:
140
47
  - vendor/assets/javascripts/right/i18n/hu.js
141
48
  - vendor/assets/javascripts/right/i18n/it.js
142
49
  - vendor/assets/javascripts/right/i18n/jp.js
50
+ - vendor/assets/javascripts/right/i18n/lt.js
143
51
  - vendor/assets/javascripts/right/i18n/nl.js
144
52
  - vendor/assets/javascripts/right/i18n/pt-br.js
145
53
  - vendor/assets/javascripts/right/i18n/ru.js
@@ -187,7 +95,6 @@ files:
187
95
  - vendor/assets/javascripts/right-src.js
188
96
  - vendor/assets/javascripts/right.js
189
97
  - lib/generators/right_rails/right_rails_generator.rb
190
- - lib/generators/right_rails/templates/iframed.html.erb
191
98
  - lib/right-rails.rb
192
99
  - lib/right_rails/config.rb
193
100
  - lib/right_rails/controller_extensions.rb
@@ -198,6 +105,7 @@ files:
198
105
  - lib/right_rails/helpers.rb
199
106
  - lib/right_rails/java_script_generator.rb
200
107
  - lib/right_rails.rb
108
+ - lib/rjs_renderer.rb
201
109
  - spec/lib/right_rails/config_spec.rb
202
110
  - spec/lib/right_rails/controller_extensions_spec.rb
203
111
  - spec/lib/right_rails/helpers/basic_spec.rb
@@ -216,36 +124,26 @@ files:
216
124
  - init.rb
217
125
  homepage: http://github.com/MadRabbit/right-rails
218
126
  licenses: []
219
-
220
127
  post_install_message:
221
128
  rdoc_options: []
222
-
223
- require_paths:
129
+ require_paths:
224
130
  - lib
225
- required_ruby_version: !ruby/object:Gem::Requirement
131
+ required_ruby_version: !ruby/object:Gem::Requirement
226
132
  none: false
227
- requirements:
228
- - - ">="
229
- - !ruby/object:Gem::Version
230
- hash: 3
231
- segments:
232
- - 0
233
- version: "0"
234
- required_rubygems_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ! '>='
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ required_rubygems_version: !ruby/object:Gem::Requirement
235
138
  none: false
236
- requirements:
237
- - - ">="
238
- - !ruby/object:Gem::Version
239
- hash: 3
240
- segments:
241
- - 0
242
- version: "0"
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
243
143
  requirements: []
244
-
245
144
  rubyforge_project:
246
- rubygems_version: 1.7.2
145
+ rubygems_version: 1.8.10
247
146
  signing_key:
248
147
  specification_version: 3
249
148
  summary: RightJS plugin for Rails
250
149
  test_files: []
251
-
@@ -1,46 +0,0 @@
1
- #
2
- # Copies all the javascripts in place and updates them if necessary
3
- #
4
-
5
- class RightRailsGenerator < Rails::Generator::Base
6
-
7
- def manifest
8
- source_path = File.dirname(__FILE__)
9
- images_path = "#{source_path}/../../public/images/rightjs-ui"
10
- javascripts_path = "#{source_path}/../../public/javascripts"
11
-
12
- record do |m|
13
- # creating the javascript directories
14
- m.directory 'public/javascripts/right'
15
- m.directory 'public/javascripts/right/i18n'
16
-
17
- Dir["#{javascripts_path}/**/*.js"].each do |filename|
18
- m.file(
19
- filename.gsub("#{javascripts_path}/", "../../../public/javascripts/"),
20
- "public/javascripts/#{filename.gsub("#{javascripts_path}/", '')}",
21
- :chmod => 0644
22
- )
23
- end
24
-
25
- # creating the iframed uploads layout
26
- m.file "iframed.html.erb", "app/views/layouts/iframed.html.erb"
27
-
28
- # copying the images in place
29
- m.directory "public/images/rightjs-ui"
30
-
31
- Dir["#{images_path}/*"].each do |filename|
32
- m.file(
33
- filename.gsub("#{images_path}/", "../../../public/images/rightjs-ui/"),
34
- "public/images/rightjs-ui/#{filename.gsub("#{images_path}/", '')}",
35
- :chmod => 0644
36
- )
37
- end
38
- end
39
- end
40
-
41
-
42
- def banner
43
- "Usage: #{$0} right_rails"
44
- end
45
-
46
- end
@@ -1,10 +0,0 @@
1
- <!-- iframed uploads JS responses layout -->
2
- <html>
3
- <head>
4
- <script type="text/javascript">
5
- with (window.parent) {
6
- <%= yield %>
7
- }
8
- </script>
9
- </head>
10
- </html>
@@ -1,53 +0,0 @@
1
- #
2
- # This is pretty much the same thing as the native rails scaffold generator
3
- # only without tests, plust it adds the '.js' format responses and fixes
4
- # the templates organization
5
- #
6
- #
7
- class RightScaffoldGenerator < ScaffoldGenerator
8
- def manifest
9
- record do |m|
10
- # Check for class naming collisions.
11
- m.class_collisions("#{controller_class_name}Controller", "#{controller_class_name}Helper")
12
- m.class_collisions(class_name)
13
-
14
- # Controller, helper, views, test and stylesheets directories.
15
- m.directory(File.join('app/models', class_path))
16
- m.directory(File.join('app/controllers', controller_class_path))
17
- m.directory(File.join('app/helpers', controller_class_path))
18
- m.directory(File.join('app/views', controller_class_path, controller_file_name))
19
- m.directory(File.join('app/views/layouts', controller_class_path))
20
- m.directory(File.join('public/stylesheets', class_path))
21
-
22
- for action in scaffold_views
23
- m.template(
24
- "view_#{action}.html.erb",
25
- File.join('app/views', controller_class_path, controller_file_name, "#{action}.html.erb")
26
- )
27
- end
28
-
29
- m.template "view__form.html.erb", File.join('app/views', controller_class_path, controller_file_name, "_form.html.erb")
30
- m.template "view__item.html.erb", File.join('app/views', controller_class_path, controller_file_name, "_#{file_name}.html.erb")
31
-
32
- # Layout and stylesheet.
33
- m.template('layout.html.erb', File.join('app/views/layouts', controller_class_path, "#{controller_file_name}.html.erb"))
34
- m.template('style.css', 'public/stylesheets/scaffold.css')
35
-
36
- m.template(
37
- 'controller.rb', File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")
38
- )
39
-
40
- m.template('helper.rb', File.join('app/helpers', controller_class_path, "#{controller_file_name}_helper.rb"))
41
-
42
- m.route_resources controller_file_name
43
-
44
- m.dependency 'model', [name] + @args, :collision => :skip
45
- end
46
- end
47
-
48
- protected
49
-
50
- def banner
51
- "Usage: #{$0} right_scaffold ModelName [field:type, field:type]"
52
- end
53
- end
@@ -1,99 +0,0 @@
1
- class <%= controller_class_name %>Controller < ApplicationController
2
- # GET /<%= table_name %>
3
- # GET /<%= table_name %>.xml
4
- def index
5
- @<%= table_name %> = <%= class_name %>.all
6
-
7
- respond_to do |format|
8
- format.html # index.html.erb
9
- format.xml { render :xml => @<%= table_name %> }
10
- end
11
- end
12
-
13
- # GET /<%= table_name %>/1
14
- # GET /<%= table_name %>/1.xml
15
- def show
16
- @<%= file_name %> = <%= class_name %>.find(params[:id])
17
-
18
- respond_to do |format|
19
- format.html # show.html.erb
20
- format.xml { render :xml => @<%= file_name %> }
21
- end
22
- end
23
-
24
- # GET /<%= table_name %>/new
25
- # GET /<%= table_name %>/new.xml
26
- def new
27
- @<%= file_name %> = <%= class_name %>.new
28
-
29
- respond_to do |format|
30
- format.html # new.html.erb
31
- format.xml { render :xml => @<%= file_name %> }
32
- end
33
- end
34
-
35
- # GET /<%= table_name %>/1/edit
36
- # GET /<%= table_name %>/1/edit.js
37
- def edit
38
- @<%= file_name %> = <%= class_name %>.find(params[:id])
39
-
40
- respond_to do |format|
41
- format.js { render rjs.show_form_for(@<%= file_name %>) }
42
- format.any # edit.html.erb
43
- end
44
- end
45
-
46
- # POST /<%= table_name %>
47
- # POST /<%= table_name %>.xml
48
- # POST /<%= table_name %>.js
49
- def create
50
- @<%= file_name %> = <%= class_name %>.new(params[:<%= file_name %>])
51
-
52
- respond_to do |format|
53
- if @<%= file_name %>.save
54
- flash[:notice] = '<%= class_name %> was successfully created.'
55
- format.html { redirect_to(@<%= file_name %>) }
56
- format.xml { render :xml => @<%= file_name %>, :status => :created, :location => @<%= file_name %> }
57
- format.js { render rjs.insert_and_care(@<%= file_name %>) }
58
- else
59
- format.html { render :action => "new" }
60
- format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }
61
- format.js { render rjs.replace_form_for(@<%= file_name %>) }
62
- end
63
- end
64
- end
65
-
66
- # PUT /<%= table_name %>/1
67
- # PUT /<%= table_name %>/1.xml
68
- # PUT /<%= table_name %>/1.js
69
- def update
70
- @<%= file_name %> = <%= class_name %>.find(params[:id])
71
-
72
- respond_to do |format|
73
- if @<%= file_name %>.update_attributes(params[:<%= file_name %>])
74
- flash[:notice] = '<%= class_name %> was successfully updated.'
75
- format.html { redirect_to(@<%= file_name %>) }
76
- format.xml { head :ok }
77
- format.js { render rjs.replace_and_care(@<%= file_name %>) }
78
- else
79
- format.html { render :action => "edit" }
80
- format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }
81
- format.js { render rjs.replace_form_for(@<%= file_name %>) }
82
- end
83
- end
84
- end
85
-
86
- # DELETE /<%= table_name %>/1
87
- # DELETE /<%= table_name %>/1.xml
88
- # DELETE /<%= table_name %>/1.js
89
- def destroy
90
- @<%= file_name %> = <%= class_name %>.find(params[:id])
91
- @<%= file_name %>.destroy
92
-
93
- respond_to do |format|
94
- format.html { redirect_to(<%= table_name %>_url) }
95
- format.xml { head :ok }
96
- format.js { render rjs.remove(@<%= file_name %>) }
97
- end
98
- end
99
- end
@@ -1,2 +0,0 @@
1
- module <%= controller_class_name %>Helper
2
- end
@@ -1,18 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
-
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
- <head>
6
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7
- <title><%= controller_class_name %>: <%%= controller.action_name %></title>
8
- <%%= stylesheet_link_tag 'scaffold' %>
9
- <%%= rightjs_scripts %>
10
- </head>
11
- <body>
12
-
13
- <%%= flashes %>
14
-
15
- <%%= yield %>
16
-
17
- </body>
18
- </html>