formagic 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/CONTRIBUTING.md +24 -0
  4. data/Gemfile +3 -0
  5. data/LICENSE.md +21 -0
  6. data/README.md +29 -0
  7. data/Rakefile +1 -0
  8. data/app/assets/images/datedropper/done.png +0 -0
  9. data/app/assets/images/datedropper/done.svg +1 -0
  10. data/app/assets/images/datedropper/next.png +0 -0
  11. data/app/assets/images/datedropper/next.svg +1 -0
  12. data/app/assets/images/datedropper/prev.png +0 -0
  13. data/app/assets/images/datedropper/prev.svg +1 -0
  14. data/app/assets/javascripts/formagic/form.coffee +229 -0
  15. data/app/assets/javascripts/formagic/group.coffee +28 -0
  16. data/app/assets/javascripts/formagic/inputs/checkbox.coffee +83 -0
  17. data/app/assets/javascripts/formagic/inputs/color.coffee +55 -0
  18. data/app/assets/javascripts/formagic/inputs/date.coffee +69 -0
  19. data/app/assets/javascripts/formagic/inputs/datetime.coffee +130 -0
  20. data/app/assets/javascripts/formagic/inputs/document.coffee +0 -0
  21. data/app/assets/javascripts/formagic/inputs/documents.coffee +173 -0
  22. data/app/assets/javascripts/formagic/inputs/documents_reorder.coffee +67 -0
  23. data/app/assets/javascripts/formagic/inputs/file.coffee +114 -0
  24. data/app/assets/javascripts/formagic/inputs/hidden.coffee +57 -0
  25. data/app/assets/javascripts/formagic/inputs/html.coffee +81 -0
  26. data/app/assets/javascripts/formagic/inputs/image.coffee +28 -0
  27. data/app/assets/javascripts/formagic/inputs/list.coffee +154 -0
  28. data/app/assets/javascripts/formagic/inputs/list_reorder.coffee +39 -0
  29. data/app/assets/javascripts/formagic/inputs/list_typeahead.coffee +55 -0
  30. data/app/assets/javascripts/formagic/inputs/markdown.coffee +93 -0
  31. data/app/assets/javascripts/formagic/inputs/password.coffee +32 -0
  32. data/app/assets/javascripts/formagic/inputs/redactor.coffee +53 -0
  33. data/app/assets/javascripts/formagic/inputs/redactor_character.coffee +75 -0
  34. data/app/assets/javascripts/formagic/inputs/redactor_images.coffee +166 -0
  35. data/app/assets/javascripts/formagic/inputs/select.coffee +84 -0
  36. data/app/assets/javascripts/formagic/inputs/select2.coffee +33 -0
  37. data/app/assets/javascripts/formagic/inputs/string.coffee +160 -0
  38. data/app/assets/javascripts/formagic/inputs/text.coffee +43 -0
  39. data/app/assets/javascripts/formagic/inputs/time.coffee +0 -0
  40. data/app/assets/javascripts/formagic.coffee +22 -0
  41. data/app/assets/javascripts/vendor/ace.js +18280 -0
  42. data/app/assets/javascripts/vendor/datedropper.js +1005 -0
  43. data/app/assets/javascripts/vendor/jquery.scrollparent.js +14 -0
  44. data/app/assets/javascripts/vendor/jquery.textarea_autosize.js +55 -0
  45. data/app/assets/javascripts/vendor/jquery.typeahead.js +1782 -0
  46. data/app/assets/javascripts/vendor/marked.js +1272 -0
  47. data/app/assets/javascripts/vendor/mode-html.js +2436 -0
  48. data/app/assets/javascripts/vendor/mode-markdown.js +2820 -0
  49. data/app/assets/javascripts/vendor/moment.js +3083 -0
  50. data/app/assets/javascripts/vendor/redactor.fixedtoolbar.js +107 -0
  51. data/app/assets/javascripts/vendor/select2.js +5274 -0
  52. data/app/assets/stylesheets/formagic/checkbox.scss +8 -0
  53. data/app/assets/stylesheets/formagic/color.scss +12 -0
  54. data/app/assets/stylesheets/formagic/date.scss +37 -0
  55. data/app/assets/stylesheets/formagic/file.scss +29 -0
  56. data/app/assets/stylesheets/formagic/form.scss +36 -0
  57. data/app/assets/stylesheets/formagic/group.scss +22 -0
  58. data/app/assets/stylesheets/formagic/image.scss +19 -0
  59. data/app/assets/stylesheets/formagic/list.scss +39 -0
  60. data/app/assets/stylesheets/formagic/nested-form.scss +23 -0
  61. data/app/assets/stylesheets/formagic/redactor.scss +41 -0
  62. data/app/assets/stylesheets/formagic/select.scss +5 -0
  63. data/app/assets/stylesheets/formagic/select2.scss +95 -0
  64. data/app/assets/stylesheets/formagic/string.scss +14 -0
  65. data/app/assets/stylesheets/formagic/switch.scss +86 -0
  66. data/app/assets/stylesheets/formagic/text.scss +9 -0
  67. data/app/assets/stylesheets/formagic.scss +15 -0
  68. data/app/assets/stylesheets/vendor/datedropper.scss +523 -0
  69. data/app/assets/stylesheets/vendor/select2.scss +258 -0
  70. data/formagic.gemspec +30 -0
  71. data/lib/formagic/engine.rb +5 -0
  72. data/lib/formagic/version.rb +3 -0
  73. data/lib/formagic.rb +5 -0
  74. metadata +146 -0
@@ -0,0 +1,14 @@
1
+ // https://github.com/slindberg/jquery-scrollparent
2
+ jQuery.fn.scrollParent = function() {
3
+ var position = this.css( "position" ),
4
+ excludeStaticParent = position === "absolute",
5
+ scrollParent = this.parents().filter( function() {
6
+ var parent = $( this );
7
+ if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
8
+ return false;
9
+ }
10
+ return (/(auto|scroll)/).test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
11
+ }).eq( 0 );
12
+
13
+ return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
14
+ };
@@ -0,0 +1,55 @@
1
+ // https://github.com/javierjulio/textarea-autosize
2
+ /*!
3
+ * jQuery Textarea AutoSize plugin
4
+ * Author: Javier Julio
5
+ * Licensed under the MIT license
6
+ */
7
+ ;(function ($, window, document, undefined) {
8
+
9
+ var pluginName = "textareaAutoSize";
10
+ var pluginDataName = "plugin_" + pluginName;
11
+
12
+ var containsText = function (value) {
13
+ return (value.replace(/\s/g, '').length > 0);
14
+ };
15
+
16
+ function Plugin(element, options) {
17
+ this.element = element;
18
+ this.$element = $(element);
19
+ this.init();
20
+ }
21
+
22
+ Plugin.prototype = {
23
+ init: function() {
24
+ var height = this.$element.outerHeight();
25
+ var diff = parseInt(this.$element.css('paddingBottom')) +
26
+ parseInt(this.$element.css('paddingTop'));
27
+
28
+ if (containsText(this.element.value)) {
29
+ this.$element.height(this.element.scrollHeight - diff);
30
+ }
31
+
32
+ // keyup is required for IE to properly reset height when deleting text
33
+ this.$element.on('input keyup', function(event) {
34
+ var $scrollParent = $(this).scrollParent();
35
+ var currentScrollPosition = $scrollParent.scrollTop();
36
+
37
+ $(this)
38
+ .height(0)
39
+ .height(this.scrollHeight - diff);
40
+
41
+ $scrollParent.scrollTop(currentScrollPosition);
42
+ });
43
+ }
44
+ };
45
+
46
+ $.fn[pluginName] = function (options) {
47
+ this.each(function() {
48
+ if (!$.data(this, pluginDataName)) {
49
+ $.data(this, pluginDataName, new Plugin(this, options));
50
+ }
51
+ });
52
+ return this;
53
+ };
54
+
55
+ })(jQuery, window, document);