formagic 0.3.4 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/app/assets/javascripts/formagic.coffee +2 -0
- data/app/assets/javascripts/formagic/form.coffee +9 -39
- data/app/assets/javascripts/formagic/group.coffee +1 -11
- data/app/assets/javascripts/formagic/inputs/array.coffee +8 -26
- data/app/assets/javascripts/formagic/inputs/checkbox.coffee +3 -20
- data/app/assets/javascripts/formagic/inputs/color.coffee +2 -16
- data/app/assets/javascripts/formagic/inputs/date.coffee +6 -24
- data/app/assets/javascripts/formagic/inputs/datetime.coffee +6 -27
- data/app/assets/javascripts/formagic/inputs/document.coffee +9 -25
- data/app/assets/javascripts/formagic/inputs/documents.coffee +11 -32
- data/app/assets/javascripts/formagic/inputs/documents_reorder.coffee +1 -12
- data/app/assets/javascripts/formagic/inputs/file.coffee +2 -22
- data/app/assets/javascripts/formagic/inputs/hash.coffee +1 -4
- data/app/assets/javascripts/formagic/inputs/hidden.coffee +2 -19
- data/app/assets/javascripts/formagic/inputs/html.coffee +2 -18
- data/app/assets/javascripts/formagic/inputs/image.coffee +3 -2
- data/app/assets/javascripts/formagic/inputs/list.coffee +2 -21
- data/app/assets/javascripts/formagic/inputs/list_reorder.coffee +1 -12
- data/app/assets/javascripts/formagic/inputs/list_typeahead.coffee +1 -13
- data/app/assets/javascripts/formagic/inputs/markdown.coffee +2 -18
- data/app/assets/javascripts/formagic/inputs/password.coffee +2 -14
- data/app/assets/javascripts/formagic/inputs/redactor.coffee +2 -18
- data/app/assets/javascripts/formagic/inputs/redactor_character.coffee +1 -13
- data/app/assets/javascripts/formagic/inputs/redactor_images.coffee +0 -13
- data/app/assets/javascripts/formagic/inputs/select.coffee +2 -21
- data/app/assets/javascripts/formagic/inputs/select2.coffee +0 -13
- data/app/assets/javascripts/formagic/inputs/select2_multiple.coffee +90 -0
- data/app/assets/javascripts/formagic/inputs/select2_single.coffee +57 -0
- data/app/assets/javascripts/formagic/inputs/string.coffee +13 -34
- data/app/assets/javascripts/formagic/inputs/text.coffee +2 -13
- data/app/assets/javascripts/formagic/inputs/url.coffee +3 -12
- data/app/assets/stylesheets/formagic.scss +2 -0
- data/app/assets/stylesheets/formagic/actions.scss +9 -0
- data/app/assets/stylesheets/formagic/form.scss +16 -24
- data/app/assets/stylesheets/formagic/nested-form.scss +3 -9
- data/app/assets/stylesheets/formagic/select.scss +24 -5
- data/app/assets/stylesheets/formagic/url.scss +5 -0
- data/lib/formagic/version.rb +1 -1
- metadata +6 -2
@@ -1,23 +1,15 @@
|
|
1
1
|
# -----------------------------------------------------------------------------
|
2
2
|
# Author: Alexander Kravets <alex@slatestudio.com>,
|
3
3
|
# Slate Studio (http://www.slatestudio.com)
|
4
|
-
#
|
5
|
-
# Coding Guide:
|
6
|
-
# https://github.com/thoughtbot/guides/tree/master/style/coffeescript
|
7
|
-
# -----------------------------------------------------------------------------
|
8
|
-
|
9
4
|
# -----------------------------------------------------------------------------
|
10
5
|
# INPUT TEXT
|
11
6
|
# -----------------------------------------------------------------------------
|
12
|
-
#
|
13
7
|
# Dependencies:
|
14
8
|
#= require vendor/jquery.scrollparent
|
15
9
|
#= require vendor/jquery.textarea_autosize
|
16
|
-
#
|
17
10
|
# -----------------------------------------------------------------------------
|
18
11
|
class @InputText extends InputString
|
19
|
-
|
20
|
-
# PRIVATE ===============================================
|
12
|
+
# PRIVATE ===================================================================
|
21
13
|
|
22
14
|
_add_input: ->
|
23
15
|
@$input =$ "<textarea class='autosize' name='#{ @name }' rows=1>#{ @_safe_value() }</textarea>"
|
@@ -25,8 +17,7 @@ class @InputText extends InputString
|
|
25
17
|
@$input.on 'keyup', (e) => @$input.trigger('change')
|
26
18
|
@$el.append @$input
|
27
19
|
|
28
|
-
|
29
|
-
# PUBLIC ================================================
|
20
|
+
# PUBLIC ====================================================================
|
30
21
|
|
31
22
|
initialize: ->
|
32
23
|
@config.beforeInitialize?(this)
|
@@ -35,10 +26,8 @@ class @InputText extends InputString
|
|
35
26
|
|
36
27
|
@config.onInitialize?(this)
|
37
28
|
|
38
|
-
|
39
29
|
updateValue: (@value) ->
|
40
30
|
@$input.val(@value)
|
41
31
|
@$input.trigger 'keyup'
|
42
32
|
|
43
|
-
|
44
33
|
chr.formInputs['text'] = InputText
|
@@ -1,11 +1,6 @@
|
|
1
1
|
# -----------------------------------------------------------------------------
|
2
2
|
# Author: Alexander Kravets <alex@slatestudio.com>,
|
3
3
|
# Slate Studio (http://www.slatestudio.com)
|
4
|
-
#
|
5
|
-
# Coding Guide:
|
6
|
-
# https://github.com/thoughtbot/guides/tree/master/style/coffeescript
|
7
|
-
# -----------------------------------------------------------------------------
|
8
|
-
|
9
4
|
# -----------------------------------------------------------------------------
|
10
5
|
# INPUT URL
|
11
6
|
# - depends on Loft character plugin for assets management
|
@@ -14,24 +9,20 @@ class @InputUrl extends InputString
|
|
14
9
|
|
15
10
|
_add_choose_button: ->
|
16
11
|
@$actions =$ "<span class='input-actions'></span>"
|
17
|
-
@$
|
12
|
+
@$el.append @$actions
|
18
13
|
|
19
|
-
@$chooseBtn =$ "<
|
14
|
+
@$chooseBtn =$ "<button>Pick a file</button>"
|
20
15
|
@$actions.append @$chooseBtn
|
21
16
|
|
22
17
|
@$chooseBtn.on 'click', (e) =>
|
23
|
-
e.preventDefault()
|
24
|
-
|
25
18
|
chr.modules.loft.showModal 'all', false, (objects) =>
|
26
19
|
url = objects[0].file.url
|
27
20
|
@updateValue(url)
|
28
21
|
|
29
|
-
|
30
|
-
# PUBLIC ================================================
|
22
|
+
# PUBLIC ====================================================================
|
31
23
|
|
32
24
|
initialize: ->
|
33
25
|
@_add_choose_button()
|
34
26
|
@config.onInitialize?(this)
|
35
27
|
|
36
|
-
|
37
28
|
chr.formInputs['url'] = InputUrl
|
@@ -1,4 +1,20 @@
|
|
1
1
|
// Form (generic components) ------------------------------ */
|
2
|
+
.form {
|
3
|
+
button {
|
4
|
+
line-height: 1.4em;
|
5
|
+
border-radius: 4px;
|
6
|
+
padding: .25em .75em;
|
7
|
+
border: 1px solid $formagic-positive-color;
|
8
|
+
color: $formagic-positive-color;
|
9
|
+
background-color: $white-color;
|
10
|
+
|
11
|
+
&:hover {
|
12
|
+
background-color: $formagic-positive-color;
|
13
|
+
border-color: $formagic-positive-color;
|
14
|
+
color: $white-color;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
2
18
|
|
3
19
|
// General
|
4
20
|
.form-input {
|
@@ -61,27 +77,3 @@
|
|
61
77
|
margin : 1em 1em 0;
|
62
78
|
padding : 1em;
|
63
79
|
}
|
64
|
-
|
65
|
-
// Input Actions used to the right from label
|
66
|
-
.input-actions {
|
67
|
-
font-size : .8em;
|
68
|
-
float : right;
|
69
|
-
|
70
|
-
a {
|
71
|
-
border-radius : 4px;
|
72
|
-
padding : .25em .75em;
|
73
|
-
margin : 0 0 0 .75em;
|
74
|
-
border : 1px solid $formagic-positive-color;
|
75
|
-
color : $formagic-positive-color;
|
76
|
-
}
|
77
|
-
|
78
|
-
a:hover {
|
79
|
-
background-color : $formagic-positive-color;
|
80
|
-
border-color : $formagic-positive-color;
|
81
|
-
color : white;
|
82
|
-
}
|
83
|
-
}
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
@@ -42,18 +42,12 @@
|
|
42
42
|
}
|
43
43
|
|
44
44
|
.nested-form-new {
|
45
|
-
margin-top
|
46
|
-
font-size
|
47
|
-
display : inline-block;
|
48
|
-
color : $formagic-positive-color;
|
49
|
-
|
50
|
-
&:hover {
|
51
|
-
opacity : .5;
|
52
|
-
}
|
45
|
+
margin-top: 1.4em;
|
46
|
+
font-size: 0.9em;
|
53
47
|
}
|
54
48
|
|
55
49
|
.nested-forms ul:empty + .nested-form-new {
|
56
|
-
margin-top
|
50
|
+
margin-top: 0;
|
57
51
|
}
|
58
52
|
|
59
53
|
.nested-form-delete {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// Select & Select 2 Inputs
|
1
|
+
// Select & Select 2 Inputs ---------------------------------------------------
|
2
2
|
|
3
3
|
@import "vendor/select2";
|
4
4
|
|
@@ -92,10 +92,6 @@
|
|
92
92
|
margin : 0 -1px;
|
93
93
|
}
|
94
94
|
|
95
|
-
.select2-container .select2-search--inline {
|
96
|
-
padding-left : .5em;
|
97
|
-
}
|
98
|
-
|
99
95
|
.select2-container--default .select2-selection--multiple {
|
100
96
|
border-radius : 0;
|
101
97
|
}
|
@@ -109,7 +105,30 @@
|
|
109
105
|
margin-top : 3px;
|
110
106
|
}
|
111
107
|
|
108
|
+
// Select Multiple ------------------------------------------------------------
|
109
|
+
|
110
|
+
.input-select2.input-stacked.input-sorted_categories {
|
111
|
+
padding-bottom: .5em;
|
112
|
+
}
|
113
|
+
|
114
|
+
.select2-container--default .select2-selection--multiple {
|
115
|
+
border: none;
|
116
|
+
}
|
112
117
|
|
118
|
+
.select2-container--default.select2-container--focus .select2-selection--multiple {
|
119
|
+
border: none;
|
120
|
+
}
|
113
121
|
|
122
|
+
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
123
|
+
background-color: #fff;
|
124
|
+
border: none;
|
125
|
+
}
|
114
126
|
|
127
|
+
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
|
128
|
+
top: -1px;
|
129
|
+
position: relative;
|
130
|
+
}
|
115
131
|
|
132
|
+
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
|
133
|
+
padding-left: 0;
|
134
|
+
}
|
data/lib/formagic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formagic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Kravets
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bourbon
|
@@ -114,6 +114,8 @@ files:
|
|
114
114
|
- app/assets/javascripts/formagic/inputs/redactor_images.coffee
|
115
115
|
- app/assets/javascripts/formagic/inputs/select.coffee
|
116
116
|
- app/assets/javascripts/formagic/inputs/select2.coffee
|
117
|
+
- app/assets/javascripts/formagic/inputs/select2_multiple.coffee
|
118
|
+
- app/assets/javascripts/formagic/inputs/select2_single.coffee
|
117
119
|
- app/assets/javascripts/formagic/inputs/string.coffee
|
118
120
|
- app/assets/javascripts/formagic/inputs/text.coffee
|
119
121
|
- app/assets/javascripts/formagic/inputs/time.coffee
|
@@ -131,6 +133,7 @@ files:
|
|
131
133
|
- app/assets/javascripts/vendor/redactor.table.js
|
132
134
|
- app/assets/javascripts/vendor/select2.js
|
133
135
|
- app/assets/stylesheets/formagic.scss
|
136
|
+
- app/assets/stylesheets/formagic/actions.scss
|
134
137
|
- app/assets/stylesheets/formagic/array.scss
|
135
138
|
- app/assets/stylesheets/formagic/checkbox.scss
|
136
139
|
- app/assets/stylesheets/formagic/color.scss
|
@@ -146,6 +149,7 @@ files:
|
|
146
149
|
- app/assets/stylesheets/formagic/string.scss
|
147
150
|
- app/assets/stylesheets/formagic/switch.scss
|
148
151
|
- app/assets/stylesheets/formagic/text.scss
|
152
|
+
- app/assets/stylesheets/formagic/url.scss
|
149
153
|
- app/assets/stylesheets/vendor/datedropper.scss
|
150
154
|
- app/assets/stylesheets/vendor/select2.scss
|
151
155
|
- formagic.gemspec
|