card-mod-script 0.13.1 → 0.13.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/autosave.js.coffee +30 -0
- data/assets/script/decko/bridge.js.coffee +31 -0
- data/assets/script/decko/card_menu.js.coffee +26 -0
- data/assets/script/decko/components.js.coffee +46 -0
- data/assets/script/decko/decko.js.coffee +97 -0
- data/assets/script/decko/doubleclick.js.coffee +30 -0
- data/assets/script/decko/editor.js.coffee +55 -0
- data/assets/script/decko/filter.js.coffee +176 -0
- data/assets/script/decko/filter_items.js.coffee +128 -0
- data/assets/script/decko/filter_links.js.coffee +81 -0
- data/assets/script/decko/follow.js.coffee +22 -0
- data/assets/script/decko/layout.js.coffee +76 -0
- data/assets/script/decko/link_editor.js.coffee +61 -0
- data/assets/script/decko/mod.js.coffee +85 -0
- data/assets/script/decko/modal.js.coffee +113 -0
- data/assets/script/decko/name_editor.js.coffee +58 -0
- data/assets/script/decko/navbox.js.coffee +74 -0
- data/assets/script/decko/nest_editor.js.coffee +166 -0
- data/assets/script/decko/nest_editor_name.js.coffee +102 -0
- data/assets/script/decko/nest_editor_options.js.coffee +93 -0
- data/assets/script/decko/nest_editor_rules.js.coffee +3 -0
- data/assets/script/decko/overlay.js.coffee +57 -0
- data/assets/script/decko/recaptcha.js.coffee +19 -0
- data/assets/script/decko/selectable_filtered_content.js.coffee +12 -0
- data/assets/script/decko/slot.js.coffee +182 -0
- data/assets/script/decko/slot_ready.js.coffee +11 -0
- data/assets/script/decko/slotter.js.coffee +276 -0
- data/assets/script/decko/upload.js.coffee +57 -0
- data/assets/script/jquery-ui.js +10 -0
- data/assets/script/jquery.autosize.js +274 -0
- data/assets/script/manifest.yml +44 -0
- data/assets/script/script_pointer_config.js.coffee +80 -0
- data/assets/script/script_pointer_list_editor.js.coffee +67 -0
- metadata +42 -9
@@ -0,0 +1,67 @@
|
|
1
|
+
$(window).ready ->
|
2
|
+
# add pointer item when clicking on "add another" button
|
3
|
+
$('body').on 'click', '._pointer-item-add', (event)->
|
4
|
+
decko.addPointerItem this
|
5
|
+
event.preventDefault() # Prevent link from following its href
|
6
|
+
|
7
|
+
# add pointer item when you hit enter in an item
|
8
|
+
$('body').on 'keydown', '.pointer-item-text', (event)->
|
9
|
+
if event.key == 'Enter'
|
10
|
+
decko.addPointerItem this
|
11
|
+
event.preventDefault() # was triggering extra item in unrelated pointer
|
12
|
+
|
13
|
+
# enable/disable add
|
14
|
+
$('body').on 'keyup', '.pointer-item-text', (_event)->
|
15
|
+
decko.updateAddItemButton this
|
16
|
+
|
17
|
+
$('body').on 'click', '.pointer-item-delete', ->
|
18
|
+
item = $(this).closest 'li'
|
19
|
+
list = item.closest('ul')
|
20
|
+
if list.find('.pointer-li').length > 1
|
21
|
+
item.remove()
|
22
|
+
else
|
23
|
+
item.find('input').val ''
|
24
|
+
decko.updateAddItemButton(list)
|
25
|
+
|
26
|
+
decko.slotReady (slot) ->
|
27
|
+
slot.find('.pointer-list-editor').each ->
|
28
|
+
decko.updateAddItemButton this
|
29
|
+
|
30
|
+
$.extend decko,
|
31
|
+
addPointerItem: (el) ->
|
32
|
+
slot = $(el).slot()
|
33
|
+
slot.trigger "slotDestroy"
|
34
|
+
# why is this necessary?
|
35
|
+
# this can have a lot of side effects in a multi-card form.
|
36
|
+
|
37
|
+
newInput = decko.nextPointerInput decko.lastPointerItem(el)
|
38
|
+
newInput.val ''
|
39
|
+
|
40
|
+
slot.trigger "slotReady"
|
41
|
+
decko.initializeEditors slot
|
42
|
+
# should be (but is not) handled by slotReady
|
43
|
+
# without this, "add another" was breaking tinymce editors in same slot
|
44
|
+
|
45
|
+
newInput.first().focus()
|
46
|
+
decko.updateAddItemButton el
|
47
|
+
decko.initPointerList newInput
|
48
|
+
|
49
|
+
nextPointerInput: (lastItem)->
|
50
|
+
lastInputs = lastItem.find 'input'
|
51
|
+
all_empty = true
|
52
|
+
for input in lastInputs
|
53
|
+
all_empty = all_empty and $(input).val() == ''
|
54
|
+
return lastInputs if all_empty
|
55
|
+
|
56
|
+
newItem = lastItem.clone()
|
57
|
+
lastItem.after newItem
|
58
|
+
newItem.attr("data-index", parseInt(lastItem.attr("data-index") + 1))
|
59
|
+
newItem.find 'input'
|
60
|
+
|
61
|
+
lastPointerItem: (el)->
|
62
|
+
$(el).closest('.content-editor').find '.pointer-li:last'
|
63
|
+
|
64
|
+
updateAddItemButton: (el)->
|
65
|
+
button = $(el).closest('.content-editor').find '._pointer-item-add'
|
66
|
+
disabled = decko.lastPointerItem(el).find('input').val() == ''
|
67
|
+
button.prop 'disabled', disabled
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-script
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
@@ -18,56 +18,56 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.103.
|
21
|
+
version: 1.103.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.103.
|
28
|
+
version: 1.103.2
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: card-mod-machines
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.13.
|
35
|
+
version: 0.13.2
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.13.
|
42
|
+
version: 0.13.2
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: card-mod-assets
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.13.
|
49
|
+
version: 0.13.2
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - '='
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.13.
|
56
|
+
version: 0.13.2
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: card-mod-list
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - '='
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0.13.
|
63
|
+
version: 0.13.2
|
64
64
|
type: :runtime
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - '='
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0.13.
|
70
|
+
version: 0.13.2
|
71
71
|
description: ''
|
72
72
|
email:
|
73
73
|
- info@decko.org
|
@@ -76,6 +76,39 @@ extensions: []
|
|
76
76
|
extra_rdoc_files: []
|
77
77
|
files:
|
78
78
|
- README.md
|
79
|
+
- assets/script/decko/autosave.js.coffee
|
80
|
+
- assets/script/decko/bridge.js.coffee
|
81
|
+
- assets/script/decko/card_menu.js.coffee
|
82
|
+
- assets/script/decko/components.js.coffee
|
83
|
+
- assets/script/decko/decko.js.coffee
|
84
|
+
- assets/script/decko/doubleclick.js.coffee
|
85
|
+
- assets/script/decko/editor.js.coffee
|
86
|
+
- assets/script/decko/filter.js.coffee
|
87
|
+
- assets/script/decko/filter_items.js.coffee
|
88
|
+
- assets/script/decko/filter_links.js.coffee
|
89
|
+
- assets/script/decko/follow.js.coffee
|
90
|
+
- assets/script/decko/layout.js.coffee
|
91
|
+
- assets/script/decko/link_editor.js.coffee
|
92
|
+
- assets/script/decko/mod.js.coffee
|
93
|
+
- assets/script/decko/modal.js.coffee
|
94
|
+
- assets/script/decko/name_editor.js.coffee
|
95
|
+
- assets/script/decko/navbox.js.coffee
|
96
|
+
- assets/script/decko/nest_editor.js.coffee
|
97
|
+
- assets/script/decko/nest_editor_name.js.coffee
|
98
|
+
- assets/script/decko/nest_editor_options.js.coffee
|
99
|
+
- assets/script/decko/nest_editor_rules.js.coffee
|
100
|
+
- assets/script/decko/overlay.js.coffee
|
101
|
+
- assets/script/decko/recaptcha.js.coffee
|
102
|
+
- assets/script/decko/selectable_filtered_content.js.coffee
|
103
|
+
- assets/script/decko/slot.js.coffee
|
104
|
+
- assets/script/decko/slot_ready.js.coffee
|
105
|
+
- assets/script/decko/slotter.js.coffee
|
106
|
+
- assets/script/decko/upload.js.coffee
|
107
|
+
- assets/script/jquery-ui.js
|
108
|
+
- assets/script/jquery.autosize.js
|
109
|
+
- assets/script/manifest.yml
|
110
|
+
- assets/script/script_pointer_config.js.coffee
|
111
|
+
- assets/script/script_pointer_list_editor.js.coffee
|
79
112
|
- db/migrate_core_cards/20200804112348_add_mod_script_assets_type.rb
|
80
113
|
- file/mod_script_script_decko_machine_output/file.js
|
81
114
|
- file/mod_script_script_jquery_machine_output/file.js
|