formagic 0.3.9 → 0.3.10
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 +1 -1
- data/app/assets/javascripts/formagic.coffee +5 -2
- data/app/assets/javascripts/formagic/form.coffee +4 -1
- data/app/assets/javascripts/formagic/inputs/ace-css.coffee +25 -0
- data/app/assets/javascripts/formagic/inputs/ace-html.coffee +25 -0
- data/app/assets/javascripts/formagic/inputs/ace-js.coffee +25 -0
- data/app/assets/javascripts/formagic/inputs/ace-markdown.coffee +51 -0
- data/app/assets/javascripts/formagic/inputs/{markdown_toolbar.coffee → ace-markdown_toolbar.coffee} +27 -7
- data/app/assets/javascripts/formagic/inputs/{html.coffee → ace.coffee} +27 -29
- data/app/assets/javascripts/formagic/inputs/documents_reorder.coffee +3 -0
- data/app/assets/javascripts/formagic/inputs/list_reorder.coffee +2 -0
- data/app/assets/javascripts/formagic/inputs/url.coffee +1 -1
- data/app/assets/javascripts/vendor/ace.js +264 -123
- data/app/assets/javascripts/vendor/mode-css.js +1008 -0
- data/app/assets/javascripts/vendor/mode-html.js +488 -129
- data/app/assets/javascripts/vendor/mode-javascript.js +1154 -0
- data/app/assets/javascripts/vendor/mode-markdown.js +489 -129
- data/app/assets/javascripts/vendor/slip.js +792 -0
- data/app/assets/stylesheets/formagic.scss +9 -1
- data/app/assets/stylesheets/formagic/{nested-form.scss → documents.scss} +0 -0
- data/app/assets/stylesheets/formagic/markdown.scss +4 -1
- data/app/assets/stylesheets/formagic/switch.scss +1 -1
- data/lib/formagic/version.rb +1 -1
- metadata +12 -6
- data/app/assets/javascripts/formagic/inputs/markdown.coffee +0 -94
@@ -55,6 +55,14 @@ $formagic-bg-color: #fbfbfd !default;
|
|
55
55
|
text-align: center;
|
56
56
|
z-index: 10;
|
57
57
|
cursor: pointer;
|
58
|
+
|
59
|
+
// This is used so we always have parent reorder item clicked event when
|
60
|
+
// user clicks on a child tag
|
61
|
+
&:after {
|
62
|
+
@include position(absolute, 0 0 0 0);
|
63
|
+
content: "";
|
64
|
+
display: block;
|
65
|
+
}
|
58
66
|
}
|
59
67
|
|
60
68
|
@import "formagic/form";
|
@@ -65,7 +73,7 @@ $formagic-bg-color: #fbfbfd !default;
|
|
65
73
|
@import "formagic/group";
|
66
74
|
@import "formagic/image";
|
67
75
|
@import "formagic/list";
|
68
|
-
@import "formagic/
|
76
|
+
@import "formagic/documents";
|
69
77
|
@import "formagic/redactor-character";
|
70
78
|
@import "formagic/select";
|
71
79
|
@import "formagic/string";
|
File without changes
|
@@ -4,14 +4,17 @@
|
|
4
4
|
border-top: 1px solid $formagic-border-color;
|
5
5
|
border-bottom: 1px solid $formagic-border-color;
|
6
6
|
background-color: $white-color;
|
7
|
+
height: 42px;
|
7
8
|
}
|
8
9
|
|
9
10
|
button {
|
11
|
+
background-color: transparent;
|
10
12
|
border: 0;
|
11
13
|
border-radius: 0;
|
12
14
|
color: $formagic-base-color;
|
15
|
+
display: inline-block;
|
13
16
|
font-size: 0.8em;
|
14
|
-
|
17
|
+
height: 40px;
|
15
18
|
padding-left: 1.25em;
|
16
19
|
padding-right: 1.25em;
|
17
20
|
}
|
@@ -9,7 +9,7 @@
|
|
9
9
|
$knob-width : $knob-size;
|
10
10
|
$switch-background : white;
|
11
11
|
$switch-border-background : darken($formagic-border-color, 5%);
|
12
|
-
$switch-shadow
|
12
|
+
$switch-shadow: 0 0px 1px transparentize(black, 0.7);
|
13
13
|
|
14
14
|
border-radius : $switch-radius;
|
15
15
|
position : relative;
|
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.10
|
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-12-
|
11
|
+
date: 2015-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bourbon
|
@@ -91,6 +91,12 @@ files:
|
|
91
91
|
- app/assets/javascripts/formagic.coffee
|
92
92
|
- app/assets/javascripts/formagic/form.coffee
|
93
93
|
- app/assets/javascripts/formagic/group.coffee
|
94
|
+
- app/assets/javascripts/formagic/inputs/ace-css.coffee
|
95
|
+
- app/assets/javascripts/formagic/inputs/ace-html.coffee
|
96
|
+
- app/assets/javascripts/formagic/inputs/ace-js.coffee
|
97
|
+
- app/assets/javascripts/formagic/inputs/ace-markdown.coffee
|
98
|
+
- app/assets/javascripts/formagic/inputs/ace-markdown_toolbar.coffee
|
99
|
+
- app/assets/javascripts/formagic/inputs/ace.coffee
|
94
100
|
- app/assets/javascripts/formagic/inputs/array.coffee
|
95
101
|
- app/assets/javascripts/formagic/inputs/checkbox.coffee
|
96
102
|
- app/assets/javascripts/formagic/inputs/color.coffee
|
@@ -102,13 +108,10 @@ files:
|
|
102
108
|
- app/assets/javascripts/formagic/inputs/file.coffee
|
103
109
|
- app/assets/javascripts/formagic/inputs/hash.coffee
|
104
110
|
- app/assets/javascripts/formagic/inputs/hidden.coffee
|
105
|
-
- app/assets/javascripts/formagic/inputs/html.coffee
|
106
111
|
- app/assets/javascripts/formagic/inputs/image.coffee
|
107
112
|
- app/assets/javascripts/formagic/inputs/list.coffee
|
108
113
|
- app/assets/javascripts/formagic/inputs/list_reorder.coffee
|
109
114
|
- app/assets/javascripts/formagic/inputs/list_typeahead.coffee
|
110
|
-
- app/assets/javascripts/formagic/inputs/markdown.coffee
|
111
|
-
- app/assets/javascripts/formagic/inputs/markdown_toolbar.coffee
|
112
115
|
- app/assets/javascripts/formagic/inputs/password.coffee
|
113
116
|
- app/assets/javascripts/formagic/inputs/redactor.coffee
|
114
117
|
- app/assets/javascripts/formagic/inputs/redactor_character.coffee
|
@@ -128,25 +131,28 @@ files:
|
|
128
131
|
- app/assets/javascripts/vendor/jquery.textarea_autosize.js
|
129
132
|
- app/assets/javascripts/vendor/jquery.typeahead.js
|
130
133
|
- app/assets/javascripts/vendor/marked.js
|
134
|
+
- app/assets/javascripts/vendor/mode-css.js
|
131
135
|
- app/assets/javascripts/vendor/mode-html.js
|
136
|
+
- app/assets/javascripts/vendor/mode-javascript.js
|
132
137
|
- app/assets/javascripts/vendor/mode-markdown.js
|
133
138
|
- app/assets/javascripts/vendor/moment.js
|
134
139
|
- app/assets/javascripts/vendor/redactor.fixedtoolbar.js
|
135
140
|
- app/assets/javascripts/vendor/redactor.table.js
|
136
141
|
- app/assets/javascripts/vendor/select2.js
|
142
|
+
- app/assets/javascripts/vendor/slip.js
|
137
143
|
- app/assets/stylesheets/formagic.scss
|
138
144
|
- app/assets/stylesheets/formagic/actions.scss
|
139
145
|
- app/assets/stylesheets/formagic/array.scss
|
140
146
|
- app/assets/stylesheets/formagic/checkbox.scss
|
141
147
|
- app/assets/stylesheets/formagic/color.scss
|
142
148
|
- app/assets/stylesheets/formagic/date.scss
|
149
|
+
- app/assets/stylesheets/formagic/documents.scss
|
143
150
|
- app/assets/stylesheets/formagic/file.scss
|
144
151
|
- app/assets/stylesheets/formagic/form.scss
|
145
152
|
- app/assets/stylesheets/formagic/group.scss
|
146
153
|
- app/assets/stylesheets/formagic/image.scss
|
147
154
|
- app/assets/stylesheets/formagic/list.scss
|
148
155
|
- app/assets/stylesheets/formagic/markdown.scss
|
149
|
-
- app/assets/stylesheets/formagic/nested-form.scss
|
150
156
|
- app/assets/stylesheets/formagic/redactor-character.scss
|
151
157
|
- app/assets/stylesheets/formagic/select.scss
|
152
158
|
- app/assets/stylesheets/formagic/string.scss
|
@@ -1,94 +0,0 @@
|
|
1
|
-
# -----------------------------------------------------------------------------
|
2
|
-
# Author: Alexander Kravets <alex@slatestudio.com>,
|
3
|
-
# Slate Studio (http://www.slatestudio.com)
|
4
|
-
# -----------------------------------------------------------------------------
|
5
|
-
# INPUT MARKDOWN
|
6
|
-
# -----------------------------------------------------------------------------
|
7
|
-
# Markdown input supports syntax highlighting and optional compilation to html.
|
8
|
-
#
|
9
|
-
# Config options:
|
10
|
-
# label - Input label
|
11
|
-
# aceOptions - Custom options for overriding default ones
|
12
|
-
# htmlFieldName - Input name for generated HTML content
|
13
|
-
# disableToolbar - Do not show shorcuts panel
|
14
|
-
#
|
15
|
-
# Input config example:
|
16
|
-
# body_md: { type: 'markdown', label: 'Article', htmlFieldName: 'body_html' }
|
17
|
-
#
|
18
|
-
# Dependencies:
|
19
|
-
#= require vendor/marked
|
20
|
-
#= require vendor/ace
|
21
|
-
#= require vendor/mode-markdown
|
22
|
-
#= require ./markdown_toolbar
|
23
|
-
# -----------------------------------------------------------------------------
|
24
|
-
class @InputMarkdown extends InputString
|
25
|
-
# PRIVATE ===================================================================
|
26
|
-
|
27
|
-
_add_input: ->
|
28
|
-
if @config.htmlFieldName
|
29
|
-
@$inputHtml =$ "<input type='hidden' name='[#{ @config.htmlFieldName }]' />"
|
30
|
-
if @object
|
31
|
-
@$inputHtml.val(@object[@config.htmlFieldName])
|
32
|
-
@$el.append @$inputHtml
|
33
|
-
|
34
|
-
@$input =$ "<input type='hidden' name='#{ @name }' value='#{ @_safe_value() }' />"
|
35
|
-
@$el.append @$input
|
36
|
-
|
37
|
-
@$editor =$ "<div></div>"
|
38
|
-
@$el.append @$editor
|
39
|
-
|
40
|
-
if ! @config.disableToolbar
|
41
|
-
@_add_toolbar()
|
42
|
-
|
43
|
-
_update_inputs: ->
|
44
|
-
md_source = @session.getValue()
|
45
|
-
@$input.val(md_source)
|
46
|
-
@$input.trigger('change')
|
47
|
-
|
48
|
-
if @$inputHtml
|
49
|
-
html = marked(md_source)
|
50
|
-
@$inputHtml.val(html)
|
51
|
-
@$inputHtml.trigger('change')
|
52
|
-
|
53
|
-
# PUBLIC ====================================================================
|
54
|
-
|
55
|
-
initialize: ->
|
56
|
-
@config.pluginConfig ||= {}
|
57
|
-
@config.beforeInitialize?(this)
|
58
|
-
|
59
|
-
@editor = ace.edit(@$editor.get(0))
|
60
|
-
@editor.$blockScrolling = Infinity
|
61
|
-
|
62
|
-
@session = @editor.getSession()
|
63
|
-
@session.setValue(@$input.val())
|
64
|
-
@session.setUseWrapMode(true)
|
65
|
-
@session.setMode("ace/mode/markdown")
|
66
|
-
|
67
|
-
# options: https://github.com/ajaxorg/ace/wiki/Configuring-Ace
|
68
|
-
aceOptions =
|
69
|
-
autoScrollEditorIntoView: true
|
70
|
-
minLines: 5
|
71
|
-
maxLines: Infinity
|
72
|
-
showLineNumbers: false
|
73
|
-
showGutter: false
|
74
|
-
highlightActiveLine: false
|
75
|
-
showPrintMargin: false
|
76
|
-
$.merge(aceOptions, @config.pluginConfig)
|
77
|
-
|
78
|
-
@editor.setOptions aceOptions
|
79
|
-
@session.on 'change', (e) => @_update_inputs()
|
80
|
-
@_update_inputs()
|
81
|
-
@config.onInitialize?(this)
|
82
|
-
|
83
|
-
updateValue: (@value) ->
|
84
|
-
@session.setValue(@value)
|
85
|
-
@_update_inputs()
|
86
|
-
|
87
|
-
hash: (hash={}) ->
|
88
|
-
hash[@config.htmlFieldName] = @$inputHtml.val()
|
89
|
-
hash[@config.klassName] = @$input.val()
|
90
|
-
return hash
|
91
|
-
|
92
|
-
include(InputMarkdown, inputMarkdownToolbar)
|
93
|
-
|
94
|
-
chr.formInputs['markdown'] = InputMarkdown
|