kiteditor 1.0.20 → 1.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/vendor/assets/javascripts/mercury/modals/insertsnippet.js.coffee +12 -11
- data/vendor/assets/javascripts/mercury/page_editor.js.coffee +5 -0
- data/vendor/assets/javascripts/mercury/region.js.coffee +5 -0
- data/vendor/assets/javascripts/mercury/regions/editable.js.coffee +11 -2
- data/vendor/assets/javascripts/mercury/regions/snippetable.js.coffee +5 -0
- data/vendor/assets/javascripts/mercury/snippet.js.coffee +12 -8
- metadata +36 -68
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 995aa0e2b76b945a1c27e41d7b189747037a9f72
|
4
|
+
data.tar.gz: 70c6ef89f2b7333eaec520e483079d6db77556b9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 42e572d3dea18ec822252ec4b1906f13d08296b15265a8ca9e8d207d83c0a328d6c2f29e63790377123c5623883c8a980d506bb8d8b31c8c20bd044f99aba41a
|
7
|
+
data.tar.gz: 5af6c84db53e8db596fc2b21a147dc7af7e115a203c113c134f734ffb6ce160eef44435dbc7a8233cdc21b5d8a731902a5cb62f3df297d81356241b7cbee18f7
|
@@ -1,12 +1,13 @@
|
|
1
1
|
@Mercury.modalHandlers.insertSnippet = ->
|
2
|
-
|
3
|
-
event.preventDefault()
|
4
|
-
serializedForm = @element.find('form').serializeObject()
|
5
|
-
if Mercury.snippet
|
6
|
-
snippet = Mercury.snippet
|
7
|
-
snippet.setOptions(serializedForm)
|
8
|
-
Mercury.snippet = null
|
9
|
-
else
|
10
|
-
snippet = Mercury.Snippet.create(@options.snippetName, serializedForm)
|
11
|
-
Mercury.trigger('action', {action: 'insertSnippet', value: snippet})
|
12
|
-
|
2
|
+
#@element.find('form').on 'submit', (event) =>
|
3
|
+
#event.preventDefault()
|
4
|
+
#serializedForm = @element.find('form').serializeObject()
|
5
|
+
#if Mercury.snippet
|
6
|
+
#snippet = Mercury.snippet
|
7
|
+
#snippet.setOptions(serializedForm)
|
8
|
+
#Mercury.snippet = null
|
9
|
+
#else
|
10
|
+
#snippet = Mercury.Snippet.create(@options.snippetName, serializedForm)
|
11
|
+
#Mercury.trigger('action', {action: 'insertSnippet', value: snippet})
|
12
|
+
# TODO: Insert block
|
13
|
+
#@hide()
|
@@ -114,6 +114,7 @@ class @Mercury.PageEditor
|
|
114
114
|
action.call(@, options)
|
115
115
|
|
116
116
|
@document.on 'mousedown', (event) ->
|
117
|
+
console.log("HERE")
|
117
118
|
Mercury.trigger('hide:dialogs')
|
118
119
|
if Mercury.region
|
119
120
|
Mercury.trigger('unfocus:regions') unless jQuery(event.target).closest(".#{Mercury.config.regions.className}").get(0) == Mercury.region.element.get(0)
|
@@ -215,6 +216,10 @@ class @Mercury.PageEditor
|
|
215
216
|
|
216
217
|
save: (callback) ->
|
217
218
|
url = @saveUrl ? Mercury.saveURL ? @iframeSrc()
|
219
|
+
|
220
|
+
# TODO
|
221
|
+
set_block_options(true, false)
|
222
|
+
|
218
223
|
data = @serialize()
|
219
224
|
Mercury.log('saving', data)
|
220
225
|
data = jQuery.toJSON(data) unless @options.saveStyle == 'form'
|
@@ -30,6 +30,7 @@ class @Mercury.Region
|
|
30
30
|
Mercury.on 'action', (event, options) =>
|
31
31
|
return if @previewing || Mercury.region != @
|
32
32
|
@execCommand(options.action, options) if options.action
|
33
|
+
|
33
34
|
|
34
35
|
@element.on 'mousemove', (event) =>
|
35
36
|
return if @previewing || Mercury.region != @
|
@@ -86,7 +87,11 @@ class @Mercury.Region
|
|
86
87
|
snippets: ->
|
87
88
|
snippets = {}
|
88
89
|
for element in @element.find('[data-snippet]')
|
90
|
+
console.log(element);
|
91
|
+
|
89
92
|
snippet = Mercury.Snippet.find(jQuery(element).data('snippet'))
|
93
|
+
console.log(snippet);
|
94
|
+
|
90
95
|
snippet.setVersion(jQuery(element).data('version'))
|
91
96
|
snippets[snippet.identity] = snippet.serialize()
|
92
97
|
return snippets
|
@@ -95,8 +95,11 @@ class @Mercury.Regions.Editable extends Mercury.Region
|
|
95
95
|
return if @previewing
|
96
96
|
if snippet = @element.find('img[data-snippet]').get(0)
|
97
97
|
@focus()
|
98
|
-
|
99
|
-
|
98
|
+
|
99
|
+
# TODO: block_options
|
100
|
+
options = block_options_window(jQuery(snippet).data('snippet'), null)
|
101
|
+
|
102
|
+
#@document.execCommand('undo', false, null)
|
100
103
|
|
101
104
|
# custom paste handling: we have to do some hackery to get the pasted content since it's not exposed normally
|
102
105
|
# through a clipboard in firefox (heaven forbid), and to keep the behavior across all browsers, we manually detect
|
@@ -462,6 +465,12 @@ class @Mercury.Regions.Editable extends Mercury.Region
|
|
462
465
|
removeSnippet: ->
|
463
466
|
@snippet.remove() if @snippet
|
464
467
|
Mercury.trigger('hide:toolbar', {type: 'snippet', immediately: true})
|
468
|
+
|
469
|
+
cutSnippet: ->
|
470
|
+
cut_block(@snippet) if @snippet
|
471
|
+
Mercury.trigger('hide:toolbar', {type: 'snippet', immediately: true})
|
472
|
+
|
473
|
+
|
465
474
|
}
|
466
475
|
|
467
476
|
|
@@ -121,4 +121,9 @@ class @Mercury.Regions.Snippetable extends Mercury.Region
|
|
121
121
|
@snippet.remove() if @snippet
|
122
122
|
Mercury.trigger('hide:toolbar', {type: 'snippet', immediately: true})
|
123
123
|
|
124
|
+
cutSnippet: ->
|
125
|
+
cut_block(@snippet)
|
126
|
+
Mercury.trigger('hide:toolbar', {type: 'snippet', immediately: true})
|
127
|
+
|
128
|
+
|
124
129
|
}
|
@@ -33,6 +33,7 @@ class @Mercury.Snippet
|
|
33
33
|
constructor: (@name, @identity, options = {}) ->
|
34
34
|
@version = 0
|
35
35
|
@data = ''
|
36
|
+
@really_save = false
|
36
37
|
@history = new Mercury.HistoryBuffer()
|
37
38
|
@setOptions(options)
|
38
39
|
|
@@ -54,7 +55,13 @@ class @Mercury.Snippet
|
|
54
55
|
# @options_to_save = @options
|
55
56
|
save_data = jQuery.extend({}, @options)
|
56
57
|
save_data['identity'] = @identity
|
57
|
-
|
58
|
+
|
59
|
+
if @really_save
|
60
|
+
base_url = Mercury.config.snippets.storeUrl
|
61
|
+
else
|
62
|
+
base_url = Mercury.config.snippets.previewUrl
|
63
|
+
|
64
|
+
jQuery.ajax base_url.replace(':name', @name), {
|
58
65
|
headers: Mercury.ajaxHeaders()
|
59
66
|
type: Mercury.config.snippets.method
|
60
67
|
data: save_data
|
@@ -69,13 +76,8 @@ class @Mercury.Snippet
|
|
69
76
|
|
70
77
|
displayOptions: ->
|
71
78
|
Mercury.snippet = @
|
72
|
-
|
73
|
-
|
74
|
-
handler: 'insertSnippet',
|
75
|
-
loadType: Mercury.config.snippets.method,
|
76
|
-
loadData: @options
|
77
|
-
}
|
78
|
-
|
79
|
+
# TODO: block_options
|
80
|
+
block_options_window(@name, @identity);
|
79
81
|
|
80
82
|
setOptions: (@options) ->
|
81
83
|
delete(@options['authenticity_token'])
|
@@ -84,6 +86,8 @@ class @Mercury.Snippet
|
|
84
86
|
@history.push(@options)
|
85
87
|
Mercury.log("Set Options: ", @options)
|
86
88
|
|
89
|
+
reallySave: ->
|
90
|
+
@really_save = true
|
87
91
|
|
88
92
|
setVersion: (version = null) ->
|
89
93
|
version = parseInt(version)
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kiteditor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.21
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- DSC OS
|
@@ -15,241 +14,211 @@ dependencies:
|
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: rails
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- -
|
18
|
+
- - '>='
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: 4.0.0
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
|
-
- -
|
25
|
+
- - '>='
|
29
26
|
- !ruby/object:Gem::Version
|
30
27
|
version: 4.0.0
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: paperclip
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- -
|
32
|
+
- - '>='
|
37
33
|
- !ruby/object:Gem::Version
|
38
34
|
version: '0'
|
39
35
|
type: :runtime
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- -
|
39
|
+
- - '>='
|
45
40
|
- !ruby/object:Gem::Version
|
46
41
|
version: '0'
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
43
|
name: coffee-script
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
|
-
- -
|
46
|
+
- - '>='
|
53
47
|
- !ruby/object:Gem::Version
|
54
48
|
version: '0'
|
55
49
|
type: :runtime
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
52
|
requirements:
|
60
|
-
- -
|
53
|
+
- - '>='
|
61
54
|
- !ruby/object:Gem::Version
|
62
55
|
version: '0'
|
63
56
|
- !ruby/object:Gem::Dependency
|
64
57
|
name: rocco
|
65
58
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
59
|
requirements:
|
68
|
-
- -
|
60
|
+
- - '>='
|
69
61
|
- !ruby/object:Gem::Version
|
70
62
|
version: '0'
|
71
63
|
type: :development
|
72
64
|
prerelease: false
|
73
65
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
66
|
requirements:
|
76
|
-
- -
|
67
|
+
- - '>='
|
77
68
|
- !ruby/object:Gem::Version
|
78
69
|
version: '0'
|
79
70
|
- !ruby/object:Gem::Dependency
|
80
71
|
name: uglifier
|
81
72
|
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
73
|
requirements:
|
84
|
-
- -
|
74
|
+
- - '>='
|
85
75
|
- !ruby/object:Gem::Version
|
86
76
|
version: '0'
|
87
77
|
type: :development
|
88
78
|
prerelease: false
|
89
79
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
80
|
requirements:
|
92
|
-
- -
|
81
|
+
- - '>='
|
93
82
|
- !ruby/object:Gem::Version
|
94
83
|
version: '0'
|
95
84
|
- !ruby/object:Gem::Dependency
|
96
85
|
name: jquery-rails
|
97
86
|
requirement: !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
87
|
requirements:
|
100
|
-
- -
|
88
|
+
- - '>='
|
101
89
|
- !ruby/object:Gem::Version
|
102
90
|
version: '0'
|
103
91
|
type: :development
|
104
92
|
prerelease: false
|
105
93
|
version_requirements: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
94
|
requirements:
|
108
|
-
- -
|
95
|
+
- - '>='
|
109
96
|
- !ruby/object:Gem::Version
|
110
97
|
version: '0'
|
111
98
|
- !ruby/object:Gem::Dependency
|
112
99
|
name: sqlite3
|
113
100
|
requirement: !ruby/object:Gem::Requirement
|
114
|
-
none: false
|
115
101
|
requirements:
|
116
|
-
- -
|
102
|
+
- - '>='
|
117
103
|
- !ruby/object:Gem::Version
|
118
104
|
version: '0'
|
119
105
|
type: :development
|
120
106
|
prerelease: false
|
121
107
|
version_requirements: !ruby/object:Gem::Requirement
|
122
|
-
none: false
|
123
108
|
requirements:
|
124
|
-
- -
|
109
|
+
- - '>='
|
125
110
|
- !ruby/object:Gem::Version
|
126
111
|
version: '0'
|
127
112
|
- !ruby/object:Gem::Dependency
|
128
113
|
name: ruby-debug19
|
129
114
|
requirement: !ruby/object:Gem::Requirement
|
130
|
-
none: false
|
131
115
|
requirements:
|
132
|
-
- -
|
116
|
+
- - '>='
|
133
117
|
- !ruby/object:Gem::Version
|
134
118
|
version: '0'
|
135
119
|
type: :development
|
136
120
|
prerelease: false
|
137
121
|
version_requirements: !ruby/object:Gem::Requirement
|
138
|
-
none: false
|
139
122
|
requirements:
|
140
|
-
- -
|
123
|
+
- - '>='
|
141
124
|
- !ruby/object:Gem::Version
|
142
125
|
version: '0'
|
143
126
|
- !ruby/object:Gem::Dependency
|
144
127
|
name: evergreen
|
145
128
|
requirement: !ruby/object:Gem::Requirement
|
146
|
-
none: false
|
147
129
|
requirements:
|
148
|
-
- -
|
130
|
+
- - '>='
|
149
131
|
- !ruby/object:Gem::Version
|
150
132
|
version: '0'
|
151
133
|
type: :development
|
152
134
|
prerelease: false
|
153
135
|
version_requirements: !ruby/object:Gem::Requirement
|
154
|
-
none: false
|
155
136
|
requirements:
|
156
|
-
- -
|
137
|
+
- - '>='
|
157
138
|
- !ruby/object:Gem::Version
|
158
139
|
version: '0'
|
159
140
|
- !ruby/object:Gem::Dependency
|
160
141
|
name: selenium-webdriver
|
161
142
|
requirement: !ruby/object:Gem::Requirement
|
162
|
-
none: false
|
163
143
|
requirements:
|
164
|
-
- -
|
144
|
+
- - '>='
|
165
145
|
- !ruby/object:Gem::Version
|
166
146
|
version: '0'
|
167
147
|
type: :development
|
168
148
|
prerelease: false
|
169
149
|
version_requirements: !ruby/object:Gem::Requirement
|
170
|
-
none: false
|
171
150
|
requirements:
|
172
|
-
- -
|
151
|
+
- - '>='
|
173
152
|
- !ruby/object:Gem::Version
|
174
153
|
version: '0'
|
175
154
|
- !ruby/object:Gem::Dependency
|
176
155
|
name: cucumber-rails
|
177
156
|
requirement: !ruby/object:Gem::Requirement
|
178
|
-
none: false
|
179
157
|
requirements:
|
180
|
-
- -
|
158
|
+
- - '>='
|
181
159
|
- !ruby/object:Gem::Version
|
182
160
|
version: '0'
|
183
161
|
type: :development
|
184
162
|
prerelease: false
|
185
163
|
version_requirements: !ruby/object:Gem::Requirement
|
186
|
-
none: false
|
187
164
|
requirements:
|
188
|
-
- -
|
165
|
+
- - '>='
|
189
166
|
- !ruby/object:Gem::Version
|
190
167
|
version: '0'
|
191
168
|
- !ruby/object:Gem::Dependency
|
192
169
|
name: fuubar-cucumber
|
193
170
|
requirement: !ruby/object:Gem::Requirement
|
194
|
-
none: false
|
195
171
|
requirements:
|
196
|
-
- -
|
172
|
+
- - '>='
|
197
173
|
- !ruby/object:Gem::Version
|
198
174
|
version: '0'
|
199
175
|
type: :development
|
200
176
|
prerelease: false
|
201
177
|
version_requirements: !ruby/object:Gem::Requirement
|
202
|
-
none: false
|
203
178
|
requirements:
|
204
|
-
- -
|
179
|
+
- - '>='
|
205
180
|
- !ruby/object:Gem::Version
|
206
181
|
version: '0'
|
207
182
|
- !ruby/object:Gem::Dependency
|
208
183
|
name: capybara
|
209
184
|
requirement: !ruby/object:Gem::Requirement
|
210
|
-
none: false
|
211
185
|
requirements:
|
212
|
-
- -
|
186
|
+
- - '>='
|
213
187
|
- !ruby/object:Gem::Version
|
214
188
|
version: '0'
|
215
189
|
type: :development
|
216
190
|
prerelease: false
|
217
191
|
version_requirements: !ruby/object:Gem::Requirement
|
218
|
-
none: false
|
219
192
|
requirements:
|
220
|
-
- -
|
193
|
+
- - '>='
|
221
194
|
- !ruby/object:Gem::Version
|
222
195
|
version: '0'
|
223
196
|
- !ruby/object:Gem::Dependency
|
224
197
|
name: capybara-firebug
|
225
198
|
requirement: !ruby/object:Gem::Requirement
|
226
|
-
none: false
|
227
199
|
requirements:
|
228
|
-
- -
|
200
|
+
- - '>='
|
229
201
|
- !ruby/object:Gem::Version
|
230
202
|
version: '0'
|
231
203
|
type: :development
|
232
204
|
prerelease: false
|
233
205
|
version_requirements: !ruby/object:Gem::Requirement
|
234
|
-
none: false
|
235
206
|
requirements:
|
236
|
-
- -
|
207
|
+
- - '>='
|
237
208
|
- !ruby/object:Gem::Version
|
238
209
|
version: '0'
|
239
210
|
- !ruby/object:Gem::Dependency
|
240
211
|
name: database_cleaner
|
241
212
|
requirement: !ruby/object:Gem::Requirement
|
242
|
-
none: false
|
243
213
|
requirements:
|
244
|
-
- -
|
214
|
+
- - '>='
|
245
215
|
- !ruby/object:Gem::Version
|
246
216
|
version: '0'
|
247
217
|
type: :development
|
248
218
|
prerelease: false
|
249
219
|
version_requirements: !ruby/object:Gem::Requirement
|
250
|
-
none: false
|
251
220
|
requirements:
|
252
|
-
- -
|
221
|
+
- - '>='
|
253
222
|
- !ruby/object:Gem::Version
|
254
223
|
version: '0'
|
255
224
|
description: This is a fork of the wonderful Mercury Rails WYSIWYG editor, modified
|
@@ -498,27 +467,26 @@ files:
|
|
498
467
|
homepage: http://github.com/dsc-os/kiteditor
|
499
468
|
licenses:
|
500
469
|
- MIT
|
470
|
+
metadata: {}
|
501
471
|
post_install_message:
|
502
472
|
rdoc_options: []
|
503
473
|
require_paths:
|
504
474
|
- lib
|
505
475
|
required_ruby_version: !ruby/object:Gem::Requirement
|
506
|
-
none: false
|
507
476
|
requirements:
|
508
|
-
- -
|
477
|
+
- - '>='
|
509
478
|
- !ruby/object:Gem::Version
|
510
479
|
version: '0'
|
511
480
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
512
|
-
none: false
|
513
481
|
requirements:
|
514
|
-
- -
|
482
|
+
- - '>='
|
515
483
|
- !ruby/object:Gem::Version
|
516
484
|
version: '0'
|
517
485
|
requirements: []
|
518
486
|
rubyforge_project:
|
519
|
-
rubygems_version:
|
487
|
+
rubygems_version: 2.0.14
|
520
488
|
signing_key:
|
521
|
-
specification_version:
|
489
|
+
specification_version: 4
|
522
490
|
summary: An HTML5 editor for use with DSC's Kit, the CCMS.
|
523
491
|
test_files:
|
524
492
|
- features/loading/loading.feature
|