card-mod-script 0.13.3 → 0.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/script/decko/components.js.coffee +3 -0
- data/assets/script/decko/decko.js.coffee +0 -15
- data/assets/script/decko/editor.js.coffee +3 -1
- data/assets/script/decko/filter.js.coffee +13 -6
- data/assets/script/decko/mod.js.coffee +2 -8
- data/assets/script/{script_pointer_config.js.coffee → decko/pointer_config.js.coffee} +1 -2
- data/assets/script/{script_pointer_list_editor.js.coffee → decko/pointer_list_editor.js.coffee} +0 -0
- data/assets/script/decko/slot.js.coffee +2 -2
- data/assets/script/decko/slot_ready.js.coffee +1 -0
- data/assets/script/decko/slotter.js.coffee +23 -31
- data/assets/script/decko/type_editor.js.coffee +21 -0
- data/assets/script/decko/upload.js.coffee +12 -5
- data/assets/script/manifest.yml +15 -2
- data/set/abstract/00_script.rb +30 -31
- data/set/abstract/01_asset_script.rb +0 -16
- data/set/abstract/{script_asset_list.rb → script_group.rb} +12 -13
- data/set/all/head_javascript.rb +4 -5
- data/set/right/script.rb +1 -14
- data/set/type/local_script_folder_group.rb +2 -2
- data/set/type/local_script_manifest_group.rb +1 -1
- data/set/type_plus_right/mod/script.rb +56 -0
- data/set/type_plus_right/set/script.rb +7 -0
- data/vendor/jquery_file_upload/LICENSE.txt +11 -12
- data/vendor/jquery_file_upload/README.md +189 -72
- data/vendor/jquery_file_upload/SECURITY.md +227 -0
- data/vendor/jquery_file_upload/VULNERABILITIES.md +118 -0
- data/vendor/jquery_file_upload/cors/postmessage.html +68 -58
- data/vendor/jquery_file_upload/cors/result.html +12 -10
- data/vendor/jquery_file_upload/css/jquery.fileupload-ui.css +24 -13
- data/vendor/jquery_file_upload/css/jquery.fileupload.css +3 -4
- data/vendor/jquery_file_upload/docker-compose.yml +55 -0
- data/vendor/jquery_file_upload/index.html +332 -230
- data/vendor/jquery_file_upload/js/cors/jquery.postmessage-transport.js +109 -109
- data/vendor/jquery_file_upload/js/cors/jquery.xdr-transport.js +81 -73
- data/vendor/jquery_file_upload/js/demo.js +75 -0
- data/vendor/jquery_file_upload/js/jquery.fileupload-audio.js +82 -94
- data/vendor/jquery_file_upload/js/jquery.fileupload-image.js +321 -300
- data/vendor/jquery_file_upload/js/jquery.fileupload-process.js +138 -146
- data/vendor/jquery_file_upload/js/jquery.fileupload-ui.js +737 -692
- data/vendor/jquery_file_upload/js/jquery.fileupload-validate.js +91 -97
- data/vendor/jquery_file_upload/js/jquery.fileupload-video.js +82 -94
- data/vendor/jquery_file_upload/js/jquery.fileupload.js +1569 -1451
- data/vendor/jquery_file_upload/js/jquery.iframe-transport.js +208 -205
- data/vendor/jquery_file_upload/js/vendor/jquery.ui.widget.js +397 -340
- data/vendor/jquery_file_upload/package-lock.json +6853 -0
- data/vendor/jquery_file_upload/package.json +71 -10
- data/vendor/jquery_file_upload/server/gae-python/app.yaml +11 -10
- data/vendor/jquery_file_upload/server/php/Dockerfile +23 -17
- data/vendor/jquery_file_upload/server/php/UploadHandler.php +206 -137
- data/vendor/jquery_file_upload/server/php/php.ini +5 -0
- data/vendor/jquery_file_upload/test/index.html +36 -159
- data/vendor/jquery_file_upload/test/unit.js +989 -0
- data/vendor/jquery_file_upload/test/vendor/chai.js +10854 -0
- data/vendor/jquery_file_upload/test/vendor/mocha.css +325 -0
- data/vendor/jquery_file_upload/test/vendor/mocha.js +18178 -0
- data/vendor/jquery_file_upload/wdio/LICENSE.txt +20 -0
- data/vendor/jquery_file_upload/wdio/assets/black+white-3x2.jpg +0 -0
- data/vendor/jquery_file_upload/wdio/assets/black+white-60x40.gif +0 -0
- data/vendor/jquery_file_upload/wdio/conf/chrome.js +40 -0
- data/vendor/jquery_file_upload/wdio/conf/firefox.js +25 -0
- data/vendor/jquery_file_upload/wdio/hooks/index.js +36 -0
- data/vendor/jquery_file_upload/wdio/test/pages/file-upload.js +79 -0
- data/vendor/jquery_file_upload/wdio/test/specs/01-file-upload.js +25 -0
- data/vendor/jquery_file_upload/wdio/wdio.conf.js +4 -0
- metadata +34 -52
- data/file/mod_script_script_decko_machine_output/file.js +0 -2685
- data/file/mod_script_script_jquery_machine_output/file.js +0 -12924
- data/lib/javascript/script_html5shiv_printshiv.js +0 -1
- data/set/self/script_html5shiv_printshiv.rb +0 -11
- data/set/self/script_mods.rb +0 -1
- data/set/type/mod_script_assets.rb +0 -21
- data/vendor/jquery_file_upload/CONTRIBUTING.md +0 -15
- data/vendor/jquery_file_upload/angularjs.html +0 -211
- data/vendor/jquery_file_upload/basic-plus.html +0 -226
- data/vendor/jquery_file_upload/basic.html +0 -136
- data/vendor/jquery_file_upload/bower-version-update.js +0 -16
- data/vendor/jquery_file_upload/bower.json +0 -64
- data/vendor/jquery_file_upload/css/jquery-ui-demo-ie8.css +0 -21
- data/vendor/jquery_file_upload/css/jquery-ui-demo.css +0 -67
- data/vendor/jquery_file_upload/css/style.css +0 -15
- data/vendor/jquery_file_upload/jquery-ui.html +0 -252
- data/vendor/jquery_file_upload/js/app.js +0 -101
- data/vendor/jquery_file_upload/js/jquery.fileupload-angular.js +0 -437
- data/vendor/jquery_file_upload/js/jquery.fileupload-jquery-ui.js +0 -161
- data/vendor/jquery_file_upload/js/main.js +0 -75
- data/vendor/jquery_file_upload/server/gae-go/app/main.go +0 -361
- data/vendor/jquery_file_upload/server/gae-go/app.yaml +0 -12
- data/vendor/jquery_file_upload/server/gae-go/static/favicon.ico +0 -0
- data/vendor/jquery_file_upload/server/gae-go/static/robots.txt +0 -2
- data/vendor/jquery_file_upload/server/php/docker-compose.yml +0 -9
- data/vendor/jquery_file_upload/test/test.js +0 -1292
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7923354578f4f18092c900b26fec2db7bde9e2fe6c258c07d12b77a612e6229d
|
4
|
+
data.tar.gz: 00c930bbca21ec39dc8d536c2caadf1018f001e5a93fdbe42a9ebbaac7400630
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 388aeb2a60d30464c3f0b4378a181aa7e9d546f492d643f2f3909cf350b3d18bc0a532a846a74e367acb1ebfb8b311d36524b4fe3dc1194a8d5a0ebce2ae8dfa
|
7
|
+
data.tar.gz: 499e0a9190faa15e20e0b8451cbff6fcd818ca15a7933f3fd48c38b66ae8927f95aa6f03ab684c7d1f340d3c7b878e919ff2fe9504f446d8534074f0a61af0c5
|
@@ -45,16 +45,6 @@ $(window).ready ->
|
|
45
45
|
$('body').on 'click', 'button.redirecter', ->
|
46
46
|
window.location = $(this).attr('href')
|
47
47
|
|
48
|
-
$('body').on "change", '.live-type-field', ->
|
49
|
-
$this = $(this)
|
50
|
-
|
51
|
-
setSlotMode($this)
|
52
|
-
$this.data 'params', $(this).closest('form').serialize()
|
53
|
-
$this.data 'url', $(this).attr 'href'
|
54
|
-
|
55
|
-
$('body').on 'change', '.edit-type-field', ->
|
56
|
-
$(this).closest('form').submit()
|
57
|
-
|
58
48
|
$('body').on 'mouseenter', '[hover_content]', ->
|
59
49
|
$(this).attr 'hover_restore', $(this).html()
|
60
50
|
$(this).html $(this).attr( 'hover_content' )
|
@@ -83,11 +73,6 @@ decko.slotReady (slot) ->
|
|
83
73
|
# #ajaxEnabled: false
|
84
74
|
# }
|
85
75
|
|
86
|
-
setSlotMode = ($el, mode=null) ->
|
87
|
-
$slotter = $el.closest(".slotter")
|
88
|
-
if $slotter.length && $slotter.attr('data-slotter-mode')
|
89
|
-
$slotter.attr 'data-original-slotter-mode', $slotter.attr('slotter-mode')
|
90
|
-
$slotter.attr 'data-slotter-mode', mode
|
91
76
|
|
92
77
|
|
93
78
|
warn = (stuff) -> console.log stuff if console?
|
@@ -28,8 +28,10 @@ jQuery.fn.extend
|
|
28
28
|
setContentFields: (selector, fn) ->
|
29
29
|
$.each @find(selector), ->
|
30
30
|
$(this).setContentField(fn)
|
31
|
+
contentField: ->
|
32
|
+
@closest('.card-editor').find '.d0-card-content'
|
31
33
|
setContentField: (fn) ->
|
32
|
-
field = @
|
34
|
+
field = @contentField()
|
33
35
|
init_val = field.val() # tinymce-jquery overrides val();
|
34
36
|
# that's why we're not using it.
|
35
37
|
new_val = fn.call this
|
@@ -9,11 +9,19 @@ decko.filter = (el) ->
|
|
9
9
|
else
|
10
10
|
$(el).closest("._filtered-content").find "._filter-widget"
|
11
11
|
|
12
|
+
|
13
|
+
# the filter form includes the below
|
14
|
+
@form = @widget.find "._filter-form"
|
15
|
+
|
16
|
+
# one-click filter links
|
17
|
+
@quickFilter = @widget.find "._quick-filter"
|
18
|
+
|
19
|
+
# include filters field, more-fields dropdown, and reset button
|
12
20
|
@activeContainer = @widget.find "._filter-container"
|
21
|
+
|
22
|
+
# the "More Filters" Dropdown
|
13
23
|
@dropdown = @widget.find "._add-filter-dropdown"
|
14
24
|
@dropdownItems = @widget.find "._filter-category-select"
|
15
|
-
@form = @widget.find "._filter-form"
|
16
|
-
@quickFilter = @widget.find "._quick-filter"
|
17
25
|
|
18
26
|
@showWithStatus = (status) ->
|
19
27
|
f = this
|
@@ -23,11 +31,10 @@ decko.filter = (el) ->
|
|
23
31
|
f.activate item.data("category")
|
24
32
|
|
25
33
|
@reset = () ->
|
26
|
-
# @clear()
|
27
|
-
@dropdownItems.show()
|
28
34
|
@restrict @form.find("._reset-filter").data("reset")
|
29
35
|
|
30
36
|
@clear = () ->
|
37
|
+
@dropdownItems.show()
|
31
38
|
@activeContainer.find(".input-group").remove()
|
32
39
|
|
33
40
|
@activate = (category, value) ->
|
@@ -83,11 +90,10 @@ decko.filter = (el) ->
|
|
83
90
|
# only has effect if there is a data-options-card value
|
84
91
|
|
85
92
|
@initSelectField = (field) ->
|
86
|
-
field.find("select").select2
|
93
|
+
field.find("select").select2
|
87
94
|
containerCssClass: ":all:"
|
88
95
|
width: "auto"
|
89
96
|
dropdownAutoWidth: "true"
|
90
|
-
)
|
91
97
|
|
92
98
|
@activeField = (category) ->
|
93
99
|
@activeContainer.find("._filter-input-#{category}")
|
@@ -95,6 +101,7 @@ decko.filter = (el) ->
|
|
95
101
|
@isActive = (category) ->
|
96
102
|
@activeField(category).length
|
97
103
|
|
104
|
+
# clear filter and use restrictions in data
|
98
105
|
@restrict = (data) ->
|
99
106
|
@clear()
|
100
107
|
for key of data
|
@@ -17,10 +17,10 @@ window.decko ||= {} #needed to run w/o *head. eg. jasmine
|
|
17
17
|
# initfunc()
|
18
18
|
|
19
19
|
$(window).ready ->
|
20
|
-
$(
|
20
|
+
$(document).on 'click', '._stop_propagation', (event)->
|
21
21
|
event.stopPropagation()
|
22
22
|
|
23
|
-
$(
|
23
|
+
$(document).on 'click', '._prevent_default', (event)->
|
24
24
|
event.preventDefault()
|
25
25
|
|
26
26
|
$('body').on 'mouseenter', 'a[data-hover-text]', ->
|
@@ -77,9 +77,3 @@ $.extend decko,
|
|
77
77
|
toggleShade: (shadeSlot) ->
|
78
78
|
shadeSlot.find('.shade-content').slideToggle 1000
|
79
79
|
shadeSlot.find('.glyphicon').toggleClass 'glyphicon-triangle-right glpyphicon-triangle-bottom'
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
@@ -45,8 +45,7 @@ $.extend decko,
|
|
45
45
|
input.autocomplete { source: decko.slotPath(path) }
|
46
46
|
|
47
47
|
pointerContent: (vals) ->
|
48
|
-
|
49
|
-
$.makeArray(list).join "\n"
|
48
|
+
$.makeArray(vals).join "\n"
|
50
49
|
|
51
50
|
linkListContent: (input_groups) ->
|
52
51
|
vals = input_groups.map( ->
|
data/assets/script/{script_pointer_list_editor.js.coffee → decko/pointer_list_editor.js.coffee}
RENAMED
File without changes
|
@@ -148,8 +148,8 @@ jQuery.fn.extend
|
|
148
148
|
slotMark: ->
|
149
149
|
if @data('cardId') then "~#{@data('cardId')}" else @data("cardName")
|
150
150
|
|
151
|
-
setSlotContent: (
|
152
|
-
v = $(
|
151
|
+
setSlotContent: (newContent, mode, $slotter) ->
|
152
|
+
v = $(newContent)[0] && $(newContent) || newContent
|
153
153
|
|
154
154
|
if typeof(v) == "string"
|
155
155
|
# Needed to support "TEXT: result" pattern in success (eg deleting nested cards)
|
@@ -63,7 +63,7 @@
|
|
63
63
|
#
|
64
64
|
#
|
65
65
|
$(window).ready ->
|
66
|
-
$('body').on 'ajax:success', '.slotter', (event, data
|
66
|
+
$('body').on 'ajax:success', '.slotter', (event, data) ->
|
67
67
|
$(this).slotterSuccess event, data
|
68
68
|
|
69
69
|
$('body').on 'ajax:error', '.slotter', (event, xhr) ->
|
@@ -114,27 +114,15 @@ jQuery.fn.extend
|
|
114
114
|
form.append input
|
115
115
|
input.val value
|
116
116
|
|
117
|
-
slotterSuccess: (event,
|
117
|
+
slotterSuccess: (event, responseData) ->
|
118
|
+
debugger
|
118
119
|
unless @hasClass("slotter")
|
119
120
|
console.log "warning: slotterSuccess called on non-slotter element #{this}"
|
120
121
|
return
|
121
122
|
|
122
123
|
return if event.slotSuccessful
|
123
124
|
|
124
|
-
|
125
|
-
window.location.reload(true)
|
126
|
-
|
127
|
-
if @data("update-modal-origin")
|
128
|
-
@updateModalOrigin()
|
129
|
-
|
130
|
-
if @data("update-origin")
|
131
|
-
@updateOrigin()
|
132
|
-
|
133
|
-
if @data('original-slotter-mode')
|
134
|
-
@attr 'data-slotter-mode', @data('original-slotter-mode')
|
135
|
-
|
136
|
-
mode = @data("slotter-mode")
|
137
|
-
@showSuccessResponse data, mode
|
125
|
+
@showSuccessResponse responseData, @data("slotter-mode")
|
138
126
|
|
139
127
|
if @hasClass "_close-overlay"
|
140
128
|
@removeOverlay()
|
@@ -150,21 +138,24 @@ jQuery.fn.extend
|
|
150
138
|
reload_url = @data("update-foreign-slot-url")
|
151
139
|
$slot.reloadSlot reload_url
|
152
140
|
|
141
|
+
if @data('original-slotter-mode')
|
142
|
+
@attr 'data-slotter-mode', @data('original-slotter-mode')
|
143
|
+
if @data('original-slot-selector')
|
144
|
+
@attr 'data-slot-selector', @data('original-slot-selector')
|
145
|
+
|
153
146
|
event.slotSuccessful = true
|
154
147
|
|
155
|
-
showSuccessResponse: (
|
156
|
-
if
|
157
|
-
|
158
|
-
else if
|
159
|
-
@updateModalOrigin()
|
160
|
-
else if mode == "update-origin"
|
161
|
-
@updateOrigin()
|
162
|
-
else if data.redirect
|
163
|
-
window.location = data.redirect
|
164
|
-
else if data.reload
|
148
|
+
showSuccessResponse: (responseData, mode) ->
|
149
|
+
if responseData.redirect
|
150
|
+
window.location = responseData.redirect
|
151
|
+
else if responseData.reload
|
165
152
|
window.location.reload(true)
|
166
153
|
else
|
167
|
-
|
154
|
+
switch mode
|
155
|
+
when "silent-success" then return
|
156
|
+
when "update-modal-origin" then @updateModalOrigin()
|
157
|
+
when "update-origin" then @updateOrigin()
|
158
|
+
else @updateSlot responseData, mode
|
168
159
|
|
169
160
|
showErrorResponse: (status, result) ->
|
170
161
|
if status == 403 #permission denied
|
@@ -200,12 +191,13 @@ jQuery.fn.extend
|
|
200
191
|
|
201
192
|
registerAsOrigin: (type, slot) ->
|
202
193
|
if slot.hasClass("_modal-slot")
|
203
|
-
slot = slot.find(".modal-body
|
194
|
+
slot = slot.find(".modal-body") # put the origin slot id on the modal-body instead
|
195
|
+
# of on the slot, so that it survives slot reloads
|
204
196
|
slot.attr("data-#{type}-origin-slot-id", @closest(".card-slot").data("slot-id"))
|
205
197
|
|
206
|
-
updateSlot: (
|
198
|
+
updateSlot: (newContent, mode) ->
|
207
199
|
mode ||= "replace"
|
208
|
-
@setSlotContent
|
200
|
+
@setSlotContent newContent, mode, $(this)
|
209
201
|
|
210
202
|
# close modal or overlay
|
211
203
|
closeOnSuccess: (type) ->
|
@@ -236,7 +228,7 @@ jQuery.fn.extend
|
|
236
228
|
)
|
237
229
|
return false
|
238
230
|
|
239
|
-
widget = input.data '
|
231
|
+
widget = input.data 'wblueimpFileupload' #jQuery UI widget
|
240
232
|
|
241
233
|
# browsers that can't do ajax uploads use iframe
|
242
234
|
unless widget._isXHRUpload(widget.options)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
$(window).ready ->
|
2
|
+
$('body').on "change", '._live-type-field', ->
|
3
|
+
$this = $(this)
|
4
|
+
|
5
|
+
setSlotMode($this)
|
6
|
+
debugger
|
7
|
+
$this.data 'params', $this.closest('form').serialize()
|
8
|
+
$this.data 'url', $this.attr 'href'
|
9
|
+
|
10
|
+
$('body').on 'change', '.edit-type-field', ->
|
11
|
+
$(this).closest('form').submit()
|
12
|
+
|
13
|
+
setSlotMode = ($el, mode=null) ->
|
14
|
+
$slotter = $el.closest(".slotter")
|
15
|
+
if $slotter.length
|
16
|
+
if $slotter.attr('data-slotter-mode')
|
17
|
+
$slotter.attr 'data-original-slotter-mode', $slotter.attr('data-slotter-mode')
|
18
|
+
$slotter.attr 'data-slotter-mode', mode
|
19
|
+
if $slotter.attr('data-slot-selector')
|
20
|
+
$slotter.attr 'data-original-slot-selector', $slotter.attr('data-slot-selector')
|
21
|
+
$slotter.removeAttr 'data-slot-selector'
|
@@ -1,10 +1,10 @@
|
|
1
1
|
$.extend decko,
|
2
2
|
upload_file: (fileupload) ->
|
3
|
-
# for file as a subcard in a form,
|
4
|
-
# excess parameters are included in the request which cause errors.
|
5
|
-
# only the file, type_id and attachment_card_name are needed
|
6
|
-
# attachment_card_name is the original card name,
|
7
|
-
# ex: card[subcards][+logo][image], card[file]
|
3
|
+
# for file as a subcard in a form,
|
4
|
+
# excess parameters are included in the request which cause errors.
|
5
|
+
# only the file, type_id and attachment_card_name are needed
|
6
|
+
# attachment_card_name is the original card name,
|
7
|
+
# ex: card[subcards][+logo][image], card[file]
|
8
8
|
$(fileupload).on 'fileuploadsubmit', (e,data) ->
|
9
9
|
$_this = $(this)
|
10
10
|
card_name = $_this.siblings(".attachment_card_name:first").attr("name")
|
@@ -36,6 +36,7 @@ $.extend decko,
|
|
36
36
|
'value="preview_editor" name="view">'
|
37
37
|
data.submit()
|
38
38
|
editor.find('.choose-file').hide()
|
39
|
+
# editor.find(".file-upload").prop "disabled", true
|
39
40
|
editor.find('.extra_upload_param').remove()
|
40
41
|
|
41
42
|
progressallFile: (e, data) ->
|
@@ -51,7 +52,13 @@ $(window).ready ->
|
|
51
52
|
$('body').on 'click', '.cancel-upload', ->
|
52
53
|
editor = $(this).closest '.card-editor'
|
53
54
|
editor.find('.choose-file').show()
|
55
|
+
# editor.find(".file-upload").prop "disabled", false
|
54
56
|
editor.find('.chosen-file').empty()
|
55
57
|
editor.find('.progress').show()
|
56
58
|
editor.find('#progress .progress-bar').css('width', '0%')
|
57
59
|
editor.find('#progress').hide()
|
60
|
+
|
61
|
+
$('body').on "submit", "form", ->
|
62
|
+
uploader = $(this).find ".file-upload[type=file]"
|
63
|
+
if uploader[0]
|
64
|
+
uploader.prop "disabled", true
|
data/assets/script/manifest.yml
CHANGED
@@ -1,7 +1,17 @@
|
|
1
|
+
remote:
|
2
|
+
items:
|
3
|
+
- src: https://code.jquery.com/jquery-3.6.0.min.js
|
4
|
+
integrity: sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=
|
5
|
+
crossorigin: anonymous
|
6
|
+
- src: https://cdnjs.cloudflare.com/ajax/libs/jquery-ujs/1.2.0/rails.min.js
|
7
|
+
integrity: sha512-7JCF1tm2gqb7ddeKwz64uEhSx9f/Eu+90/LQ26ymVJlkrrOI7C1JR0KUHLi4FASyVwkuAekBNsMfCWJm1l9bHQ==
|
8
|
+
crossorigin: anonymous
|
9
|
+
referrerpolicy: no-referrer
|
10
|
+
|
1
11
|
jquery:
|
2
12
|
items:
|
3
|
-
- ../../vendor/jquery_rails/vendor/assets/javascripts/jquery3.js
|
4
|
-
- ../../vendor/jquery_rails/vendor/assets/javascripts/jquery_ujs.js
|
13
|
+
# - ../../vendor/jquery_rails/vendor/assets/javascripts/jquery3.js
|
14
|
+
# - ../../vendor/jquery_rails/vendor/assets/javascripts/jquery_ujs.js
|
5
15
|
# jquery-ui includes all interaction components, the dialog and the autocomplete widget
|
6
16
|
# and all dependencies for those
|
7
17
|
# decko depends on autocomplete, sortable, jquery.autosize and jquery.fileupload
|
@@ -24,6 +34,7 @@ decko:
|
|
24
34
|
- decko/upload.js.coffee
|
25
35
|
- decko/slot.js.coffee
|
26
36
|
- decko/decko.js.coffee
|
37
|
+
- decko/type_editor.js.coffee
|
27
38
|
- decko/modal.js.coffee
|
28
39
|
- decko/overlay.js.coffee
|
29
40
|
- decko/recaptcha.js.coffee
|
@@ -38,6 +49,8 @@ decko:
|
|
38
49
|
- decko/follow.js.coffee
|
39
50
|
- decko/card_menu.js.coffee
|
40
51
|
- decko/slot_ready.js.coffee
|
52
|
+
- decko/pointer_config.js.coffee
|
53
|
+
- decko/pointer_list_editor.js.coffee
|
41
54
|
- decko/filter.js.coffee
|
42
55
|
- decko/filter_links.js.coffee
|
43
56
|
- decko/filter_items.js.coffee
|
data/set/abstract/00_script.rb
CHANGED
@@ -3,44 +3,43 @@
|
|
3
3
|
require "coderay"
|
4
4
|
require "uglifier"
|
5
5
|
|
6
|
-
|
7
|
-
host_class.include_set Abstract::Machine
|
8
|
-
host_class.include_set Abstract::MachineInput
|
6
|
+
include_set Abstract::AssetInputter, input_format: :js, input_view: :compressed
|
9
7
|
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
format :js do
|
9
|
+
view :compressed do
|
10
|
+
js = compress(_render_core)
|
11
|
+
comment_with_source js
|
12
|
+
end
|
13
13
|
|
14
|
-
def
|
15
|
-
|
16
|
-
|
17
|
-
comment_with_source js
|
18
|
-
end
|
14
|
+
def comment_with_source js
|
15
|
+
"// #{card.name}\n#{js}"
|
16
|
+
end
|
19
17
|
|
20
|
-
def
|
21
|
-
|
22
|
-
end
|
18
|
+
def compress input
|
19
|
+
compress? ? try_compress(input) : input
|
20
|
+
end
|
23
21
|
|
24
|
-
def
|
25
|
-
|
26
|
-
rescue StandardError => e
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
22
|
+
def try_compress input
|
23
|
+
Uglifier.compile(input)
|
24
|
+
rescue StandardError => e
|
25
|
+
# CoffeeScript is compiled in a view
|
26
|
+
# If there is a CoffeeScript syntax error we get the rescued view here
|
27
|
+
# and the error that the rescued view is no valid Javascript
|
28
|
+
# To get the original error we have to refer to Card::Error.current
|
29
|
+
raise Card::Error, compression_error_message(e)
|
30
|
+
end
|
33
31
|
|
34
|
-
def compression_error_message e
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
def compression_error_message e
|
33
|
+
if Card::Error.current
|
34
|
+
Card::Error.current.message
|
35
|
+
else
|
36
|
+
"JavaScript::SyntaxError (#{name}): #{e.message}"
|
37
|
+
end
|
39
38
|
end
|
40
|
-
end
|
41
39
|
|
42
|
-
def compress?
|
43
|
-
|
40
|
+
def compress?
|
41
|
+
Cardio.config.compress_assets
|
42
|
+
end
|
44
43
|
end
|
45
44
|
|
46
45
|
def clean_html?
|
@@ -7,19 +7,3 @@ include_set Abstract::AssetFile
|
|
7
7
|
def compress?
|
8
8
|
@minimize
|
9
9
|
end
|
10
|
-
|
11
|
-
format :js do
|
12
|
-
view :source do
|
13
|
-
if @local
|
14
|
-
card.machine_output_url
|
15
|
-
else
|
16
|
-
source
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
format :html do
|
22
|
-
view :javascript_include_tag do
|
23
|
-
javascript_include_tag card.machine_output_url
|
24
|
-
end
|
25
|
-
end
|
@@ -1,9 +1,14 @@
|
|
1
|
-
include_set Abstract::
|
2
|
-
include_set Abstract::MachineInput
|
3
|
-
include_set Abstract::AssetList
|
1
|
+
include_set Abstract::AssetGroup
|
4
2
|
|
5
|
-
|
6
|
-
|
3
|
+
def asset_input_content
|
4
|
+
format(:js).render_core
|
5
|
+
end
|
6
|
+
|
7
|
+
format :js do
|
8
|
+
view :core do
|
9
|
+
card.render_items_and_compress :js
|
10
|
+
end
|
11
|
+
end
|
7
12
|
|
8
13
|
def new_asset_constants path
|
9
14
|
if path.ends_with? ".js.coffee"
|
@@ -21,12 +26,6 @@ def javascript_constants
|
|
21
26
|
{ type_id: JavaScriptID, set_module: Abstract::AssetJavaScript }
|
22
27
|
end
|
23
28
|
|
24
|
-
def
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
format :html do
|
29
|
-
view :javascript_include_tag do
|
30
|
-
javascript_include_tag card.machine_output_url
|
31
|
-
end
|
29
|
+
def valid_file_extensions
|
30
|
+
%w[js coffee]
|
32
31
|
end
|
data/set/all/head_javascript.rb
CHANGED
@@ -8,7 +8,6 @@ format :html do
|
|
8
8
|
super + %w[
|
9
9
|
decko_script_variables
|
10
10
|
head_javascript
|
11
|
-
html5shiv_tag
|
12
11
|
script_config_and_initiation
|
13
12
|
]
|
14
13
|
end
|
@@ -25,10 +24,6 @@ format :html do
|
|
25
24
|
Array.wrap(head_javascript_paths).reject(&:empty?).join("\n")
|
26
25
|
end
|
27
26
|
|
28
|
-
view :html5shiv_tag, unknown: true, perms: :none do
|
29
|
-
nest :script_html5shiv_printshiv, view: :script_tag
|
30
|
-
end
|
31
|
-
|
32
27
|
view :script_config_and_initiation, unknown: true, perms: :none do
|
33
28
|
javascript_tag do
|
34
29
|
(script_configs << trigger_slot_ready).join "\n\n"
|
@@ -77,4 +72,8 @@ format :html do
|
|
77
72
|
"decko.#{js_decko_function}('#{config_json}')"
|
78
73
|
end
|
79
74
|
end
|
75
|
+
|
76
|
+
def javascript_include_tag *args
|
77
|
+
"\n<!-- #{card.name} -->#{super}"
|
78
|
+
end
|
80
79
|
end
|
data/set/right/script.rb
CHANGED
@@ -1,22 +1,9 @@
|
|
1
|
-
include_set
|
1
|
+
include_set Type::List
|
2
2
|
|
3
3
|
def ok_to_read
|
4
4
|
true
|
5
5
|
end
|
6
6
|
|
7
|
-
def refresh_output force: false
|
8
|
-
item_cards.each do |item_card|
|
9
|
-
# puts "refreshing #{item_card.name}".yellow
|
10
|
-
item_card.try :refresh_output, force: force
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def regenerate_machine_output
|
15
|
-
item_cards.each do |item_card|
|
16
|
-
item_card.try :regenerate_machine_output
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
7
|
format :html do
|
21
8
|
view :javascript_include_tag do
|
22
9
|
card.item_cards.map do |script|
|
@@ -1,2 +1,2 @@
|
|
1
|
-
include_set Abstract::
|
2
|
-
include_set Abstract::
|
1
|
+
include_set Abstract::FolderGroup
|
2
|
+
include_set Abstract::ScriptGroup
|
@@ -1,2 +1,2 @@
|
|
1
1
|
include_set Abstract::LocalManifestGroup
|
2
|
-
include_set Abstract::
|
2
|
+
include_set Abstract::ScriptGroup
|
@@ -0,0 +1,56 @@
|
|
1
|
+
include_set Abstract::AssetOutputter, output_format: :js
|
2
|
+
include_set Abstract::ModAssets
|
3
|
+
|
4
|
+
def make_asset_output_coded
|
5
|
+
super mod_name
|
6
|
+
end
|
7
|
+
|
8
|
+
def subpath
|
9
|
+
"script"
|
10
|
+
end
|
11
|
+
|
12
|
+
def folder_group_type_id
|
13
|
+
::Card::LocalScriptFolderGroupID
|
14
|
+
end
|
15
|
+
|
16
|
+
def local_manifest_group_type_id
|
17
|
+
::Card::LocalScriptManifestGroupID
|
18
|
+
end
|
19
|
+
|
20
|
+
def refresh_asset
|
21
|
+
update_asset_output if asset_output_needs_refresh?
|
22
|
+
end
|
23
|
+
|
24
|
+
def asset_output_needs_refresh?
|
25
|
+
!asset_output_updated_at || source_changed?(since: asset_output_updated_at)
|
26
|
+
end
|
27
|
+
|
28
|
+
def asset_output_updated_at
|
29
|
+
asset_output_card&.file_updated_at
|
30
|
+
end
|
31
|
+
|
32
|
+
format :html do
|
33
|
+
view :javascript_include_tag do
|
34
|
+
[remote_include_tags, local_include_tag].flatten.compact.join "\n"
|
35
|
+
end
|
36
|
+
|
37
|
+
def local_include_tag
|
38
|
+
return unless local_url
|
39
|
+
|
40
|
+
javascript_include_tag local_url
|
41
|
+
end
|
42
|
+
|
43
|
+
def remote_include_tags
|
44
|
+
remote_items = card.manifest_group_items "remote"
|
45
|
+
return unless remote_items
|
46
|
+
|
47
|
+
remote_items.map do |args|
|
48
|
+
tag_args = args.clone
|
49
|
+
javascript_include_tag tag_args.delete("src"), tag_args
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def local_url
|
54
|
+
card.asset_output_url
|
55
|
+
end
|
56
|
+
end
|
@@ -2,20 +2,19 @@ MIT License
|
|
2
2
|
|
3
3
|
Copyright © 2010 Sebastian Tschan, https://blueimp.net
|
4
4
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
11
|
|
12
12
|
The above copyright notice and this permission notice shall be included in all
|
13
13
|
copies or substantial portions of the Software.
|
14
14
|
|
15
15
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
SOFTWARE.
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|