formagic 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/CONTRIBUTING.md +24 -0
- data/Gemfile +3 -0
- data/LICENSE.md +21 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/app/assets/images/datedropper/done.png +0 -0
- data/app/assets/images/datedropper/done.svg +1 -0
- data/app/assets/images/datedropper/next.png +0 -0
- data/app/assets/images/datedropper/next.svg +1 -0
- data/app/assets/images/datedropper/prev.png +0 -0
- data/app/assets/images/datedropper/prev.svg +1 -0
- data/app/assets/javascripts/formagic/form.coffee +229 -0
- data/app/assets/javascripts/formagic/group.coffee +28 -0
- data/app/assets/javascripts/formagic/inputs/checkbox.coffee +83 -0
- data/app/assets/javascripts/formagic/inputs/color.coffee +55 -0
- data/app/assets/javascripts/formagic/inputs/date.coffee +69 -0
- data/app/assets/javascripts/formagic/inputs/datetime.coffee +130 -0
- data/app/assets/javascripts/formagic/inputs/document.coffee +0 -0
- data/app/assets/javascripts/formagic/inputs/documents.coffee +173 -0
- data/app/assets/javascripts/formagic/inputs/documents_reorder.coffee +67 -0
- data/app/assets/javascripts/formagic/inputs/file.coffee +114 -0
- data/app/assets/javascripts/formagic/inputs/hidden.coffee +57 -0
- data/app/assets/javascripts/formagic/inputs/html.coffee +81 -0
- data/app/assets/javascripts/formagic/inputs/image.coffee +28 -0
- data/app/assets/javascripts/formagic/inputs/list.coffee +154 -0
- data/app/assets/javascripts/formagic/inputs/list_reorder.coffee +39 -0
- data/app/assets/javascripts/formagic/inputs/list_typeahead.coffee +55 -0
- data/app/assets/javascripts/formagic/inputs/markdown.coffee +93 -0
- data/app/assets/javascripts/formagic/inputs/password.coffee +32 -0
- data/app/assets/javascripts/formagic/inputs/redactor.coffee +53 -0
- data/app/assets/javascripts/formagic/inputs/redactor_character.coffee +75 -0
- data/app/assets/javascripts/formagic/inputs/redactor_images.coffee +166 -0
- data/app/assets/javascripts/formagic/inputs/select.coffee +84 -0
- data/app/assets/javascripts/formagic/inputs/select2.coffee +33 -0
- data/app/assets/javascripts/formagic/inputs/string.coffee +160 -0
- data/app/assets/javascripts/formagic/inputs/text.coffee +43 -0
- data/app/assets/javascripts/formagic/inputs/time.coffee +0 -0
- data/app/assets/javascripts/formagic.coffee +22 -0
- data/app/assets/javascripts/vendor/ace.js +18280 -0
- data/app/assets/javascripts/vendor/datedropper.js +1005 -0
- data/app/assets/javascripts/vendor/jquery.scrollparent.js +14 -0
- data/app/assets/javascripts/vendor/jquery.textarea_autosize.js +55 -0
- data/app/assets/javascripts/vendor/jquery.typeahead.js +1782 -0
- data/app/assets/javascripts/vendor/marked.js +1272 -0
- data/app/assets/javascripts/vendor/mode-html.js +2436 -0
- data/app/assets/javascripts/vendor/mode-markdown.js +2820 -0
- data/app/assets/javascripts/vendor/moment.js +3083 -0
- data/app/assets/javascripts/vendor/redactor.fixedtoolbar.js +107 -0
- data/app/assets/javascripts/vendor/select2.js +5274 -0
- data/app/assets/stylesheets/formagic/checkbox.scss +8 -0
- data/app/assets/stylesheets/formagic/color.scss +12 -0
- data/app/assets/stylesheets/formagic/date.scss +37 -0
- data/app/assets/stylesheets/formagic/file.scss +29 -0
- data/app/assets/stylesheets/formagic/form.scss +36 -0
- data/app/assets/stylesheets/formagic/group.scss +22 -0
- data/app/assets/stylesheets/formagic/image.scss +19 -0
- data/app/assets/stylesheets/formagic/list.scss +39 -0
- data/app/assets/stylesheets/formagic/nested-form.scss +23 -0
- data/app/assets/stylesheets/formagic/redactor.scss +41 -0
- data/app/assets/stylesheets/formagic/select.scss +5 -0
- data/app/assets/stylesheets/formagic/select2.scss +95 -0
- data/app/assets/stylesheets/formagic/string.scss +14 -0
- data/app/assets/stylesheets/formagic/switch.scss +86 -0
- data/app/assets/stylesheets/formagic/text.scss +9 -0
- data/app/assets/stylesheets/formagic.scss +15 -0
- data/app/assets/stylesheets/vendor/datedropper.scss +523 -0
- data/app/assets/stylesheets/vendor/select2.scss +258 -0
- data/formagic.gemspec +30 -0
- data/lib/formagic/engine.rb +5 -0
- data/lib/formagic/version.rb +3 -0
- data/lib/formagic.rb +5 -0
- 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);
|