card-mod-tinymce_editor 0.15.5 → 0.15.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/assets/script/nest_editor.js.coffee +76 -63
  3. data/assets/script/script_tinymce.js +2 -2
  4. data/assets/script/tinymce_config.js.coffee +6 -0
  5. data/data/files/mod_tinymce_editor_script_asset_output/file.js +15 -17
  6. data/public/icons/default/icons.min.js +1 -0
  7. data/public/jquery.tinymce.min.js +40 -41
  8. data/public/langs/{readme.md → README.md} +0 -0
  9. data/public/license.txt +0 -0
  10. data/public/plugins/advlist/plugin.min.js +2 -2
  11. data/public/plugins/anchor/plugin.min.js +2 -2
  12. data/public/plugins/autolink/plugin.min.js +2 -2
  13. data/public/plugins/autoresize/plugin.min.js +2 -2
  14. data/public/plugins/autosave/plugin.min.js +2 -2
  15. data/public/plugins/bbcode/plugin.min.js +2 -2
  16. data/public/plugins/charmap/plugin.min.js +2 -2
  17. data/public/plugins/code/plugin.min.js +2 -2
  18. data/public/plugins/codesample/plugin.min.js +2 -2
  19. data/public/plugins/colorpicker/plugin.min.js +2 -2
  20. data/public/plugins/contextmenu/plugin.min.js +2 -2
  21. data/public/plugins/directionality/plugin.min.js +2 -2
  22. data/public/plugins/emoticons/js/emojiimages.js +9424 -0
  23. data/public/plugins/emoticons/js/emojiimages.min.js +3 -0
  24. data/public/plugins/emoticons/js/emojis.js +1916 -1508
  25. data/public/plugins/emoticons/js/emojis.min.js +2 -2
  26. data/public/plugins/emoticons/plugin.min.js +2 -2
  27. data/public/plugins/fullpage/plugin.min.js +2 -2
  28. data/public/plugins/fullscreen/plugin.min.js +2 -2
  29. data/public/plugins/help/plugin.min.js +2 -2
  30. data/public/plugins/hr/plugin.min.js +2 -2
  31. data/public/plugins/image/plugin.min.js +2 -2
  32. data/public/plugins/imagetools/plugin.min.js +2 -2
  33. data/public/plugins/importcss/plugin.min.js +2 -2
  34. data/public/plugins/insertdatetime/plugin.min.js +2 -2
  35. data/public/plugins/legacyoutput/plugin.min.js +2 -2
  36. data/public/plugins/link/plugin.min.js +2 -2
  37. data/public/plugins/lists/plugin.min.js +2 -2
  38. data/public/plugins/media/plugin.min.js +2 -2
  39. data/public/plugins/nonbreaking/plugin.min.js +2 -2
  40. data/public/plugins/noneditable/plugin.min.js +2 -2
  41. data/public/plugins/pagebreak/plugin.min.js +2 -2
  42. data/public/plugins/paste/plugin.min.js +2 -2
  43. data/public/plugins/preview/plugin.min.js +2 -2
  44. data/public/plugins/print/plugin.min.js +2 -2
  45. data/public/plugins/quickbars/plugin.min.js +2 -2
  46. data/public/plugins/save/plugin.min.js +2 -2
  47. data/public/plugins/searchreplace/plugin.min.js +2 -2
  48. data/public/plugins/spellchecker/plugin.min.js +2 -2
  49. data/public/plugins/tabfocus/plugin.min.js +2 -2
  50. data/public/plugins/table/plugin.min.js +2 -2
  51. data/public/plugins/template/plugin.min.js +2 -2
  52. data/public/plugins/textcolor/plugin.min.js +2 -2
  53. data/public/plugins/textpattern/plugin.min.js +2 -2
  54. data/public/plugins/toc/plugin.min.js +2 -2
  55. data/public/plugins/visualblocks/plugin.min.js +2 -2
  56. data/public/plugins/visualchars/plugin.min.js +2 -2
  57. data/public/plugins/wordcount/plugin.min.js +2 -2
  58. data/public/skins/content/dark/content.min.css +7 -0
  59. data/public/skins/content/default/content.min.css +1 -1
  60. data/public/skins/content/document/content.min.css +1 -1
  61. data/public/skins/content/writer/content.min.css +1 -1
  62. data/public/skins/ui/oxide/content.inline.min.css +1 -1
  63. data/public/skins/ui/oxide/content.min.css +1 -1
  64. data/public/skins/ui/oxide/content.mobile.min.css +0 -0
  65. data/public/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
  66. data/public/skins/ui/oxide/skin.min.css +1 -1
  67. data/public/skins/ui/oxide/skin.mobile.min.css +1 -1
  68. data/public/skins/ui/oxide/skin.shadowdom.min.css +7 -0
  69. data/public/skins/ui/oxide-dark/content.inline.min.css +1 -1
  70. data/public/skins/ui/oxide-dark/content.min.css +1 -1
  71. data/public/skins/ui/oxide-dark/content.mobile.min.css +0 -0
  72. data/public/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
  73. data/public/skins/ui/oxide-dark/skin.min.css +1 -1
  74. data/public/skins/ui/oxide-dark/skin.mobile.min.css +1 -1
  75. data/public/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -0
  76. data/public/themes/mobile/theme.min.js +2 -2
  77. data/public/themes/silver/theme.min.js +2 -2
  78. data/public/tinymce.d.ts +3039 -0
  79. data/public/tinymce.min.js +2 -2
  80. data/set/all/reference_editor/link_editor.rb +1 -1
  81. metadata +15 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db002d89dffcadd201260f568b948ce16cc1640ed427ca45e9bb195be0249844
4
- data.tar.gz: 3a328298b8b9af6cd81b04ee87f35f8daa54be4e0cbe7d9d83eb7f78c8786526
3
+ metadata.gz: 708613820dafeb278efa869b8e42daee27cd6f5e014989e4792969fbac842e1b
4
+ data.tar.gz: da9250927c82acb529da91ad86eed224c67cbd086612576e650d67d854be208a
5
5
  SHA512:
6
- metadata.gz: fa393ccb2c99e55d63a18edfeec894d59e257dde369ef475cc9c60d7ea9658eefc144d957895b995c983a2463ab1e3afcb582ee5a9a14137029180f76d76c5e4
7
- data.tar.gz: 325651eb24c03952f48ec14356db8332ecd1973f0a44aa690ffb90cb263f73d38729c30fa1fb4a05d9efb958eec59f9f69e7214af8e28214e177eb39dfb63a20
6
+ metadata.gz: 74974be44f291b4a252bb1b21381b6591c8ef42516600917f891ce9e63a2d16b31232b8fde99c0572dc7f8759d460dec90abaa9458dc46ea01c1cb9c4a7ce36b
7
+ data.tar.gz: 34abc21fa55a4fc1c6e1329cbd0a50589862fc0b62879271ffce66804107d91308b98eafe55a5ca5e3ad99e3af0785deec67f6c2c3236a5e95135084ab3a05ef
@@ -10,7 +10,7 @@ $(document).ready ->
10
10
 
11
11
  $('body').on 'click', 'button._change-create-to-update', () ->
12
12
  tm_id = $(this).closest("form").find("#success_tinymce_id").val()
13
- nest.changeCreateToUpdate(tm_id)
13
+ changeCreateToUpdate(tm_id)
14
14
 
15
15
  $('body').on 'click', 'button._open-nest-editor', () ->
16
16
  form = $(this).closest("._nest-form")
@@ -32,8 +32,8 @@ $.extend nest,
32
32
  this.openEditorForTm(tm, params, "nest_editor", "modal_nest_editor")
33
33
 
34
34
  openNestEditorForSlot: (slot, slotter, params) ->
35
- card = if slot[0] then $(slot[0]).attr('data-card-name') else ":update"
36
- nest.request(card, "nest_editor", "modal_nest_editor", slotter, params)
35
+ card = cardFromSlotOrDefault(slot[0])
36
+ request(card, "nest_editor", "modal_nest_editor", slotter, params)
37
37
 
38
38
  openEditorForTm: (tm, params, overlay_view, modal_view) ->
39
39
  params += "&tinymce_id=#{tm.id}"
@@ -41,56 +41,29 @@ $.extend nest,
41
41
  editor = $("##{tm.id}").closest(".card-editor")
42
42
  slotter = $("##{tm.id}")
43
43
 
44
- card = (editor[0] and $(editor[0]).attr('card_name')) or
45
- (slot[0] and $(slot[0]).attr('data-card-name')) or ":update"
44
+ card = cardFromEditor(editor[0]) or
45
+ cardFromSlotOrDefault(slot[0])
46
46
  if card.length == 0
47
47
  card = ":update"
48
- nest.request(card, overlay_view, modal_view, slotter, params)
48
+ request(card, overlay_view, modal_view, slotter, params)
49
49
 
50
50
  # called by TinyMCE
51
51
  openImageEditor: (tm) ->
52
52
  params = nest.editParams(tm, "{{", "}}", false) unless params?
53
53
  this.openEditorForTm(tm, params,"nest_image", "modal_nest_image")
54
54
 
55
- changeCreateToUpdate: (tm_id) ->
56
- form = $("##{tm_id}").closest("form")
57
- new_action = form.attr("action").replace("card/create", "card/update")
58
- form.attr("action", new_action)
59
-
60
55
  insertNest: (tm, nest_string) ->
61
56
  tm.insertContent(nest_string)
62
57
  # insertIndex = nest.offsetAfterInsert(tm, nest_string)
63
58
  # params = nest.paramsStr(insertIndex, nest_string)
64
59
  # nest.openNestEditor(etm, params)
65
60
 
66
-
67
- request: (card, overlay_view, modal_view, slotter, params) ->
68
- slot = $(".board-sidebar > ._overlay-container-placeholder > .card-slot")
69
-
70
- if false #slot[0]
71
- view = overlay_view
72
- mode = "overlay"
73
- else
74
- slot = $($(".card-slot")[0])
75
- view = modal_view
76
- mode = "modal"
77
-
78
- nest.sendRequest(slotter, slot, mode, card, view, params)
79
-
80
- sendRequest: (slotter, slot, mode, card, view, params) ->
81
- params = "" unless params?
82
- url = "/#{card}?view=#{view}&#{params}"
83
- $.ajax
84
- url: url
85
- success: (html) ->
86
- slot.slotContent html, mode, slotter
87
-
88
61
  editParams: (tm, prefix="{{", postfix="}}", edit=true) ->
89
62
  sel = tm.selection.getSel()
90
- return nest.paramsStr(0) unless sel? and sel.anchorNode?
63
+ return paramsStr(0) unless sel? and sel.anchorNode?
91
64
 
92
65
  text = sel.anchorNode.data
93
- return nest.paramsStr(sel.anchorOffset) unless text
66
+ return paramsStr(sel.anchorOffset) unless text
94
67
 
95
68
  offset = sel.anchorOffset
96
69
  before = text.substr(0, offset)
@@ -113,24 +86,11 @@ $.extend nest,
113
86
  nest_size = index.after.close + offset + 2 - nest_start
114
87
  name = text.substr(nest_start, nest_size)
115
88
  if edit
116
- nest.paramsStr(nest_start, name)
89
+ paramsStr(nest_start, name)
117
90
  else
118
- nest.paramsStr(nest_start + nest_size)
91
+ paramsStr(nest_start + nest_size)
119
92
  else
120
- nest.paramsStr(offset)
121
-
122
- paramsStr: (start, name) ->
123
- params = ""
124
- if start?
125
- params += "&tm_snippet_start=#{start}"
126
- if name? and name.length > 0
127
- params += "&tm_snippet_raw=#{encodeURIComponent(name)}"
128
-
129
- params
130
-
131
- offsetAfterInsert: (editor, content) ->
132
- offset = editor.selection.getSel().anchorOffset
133
- offset - content.lengthr
93
+ paramsStr(offset)
134
94
 
135
95
  applyNestToTinymceEditor: (tinymce_id, nest_start, nest_size) ->
136
96
  nest.applySnippet("nest", tinymce_id, nest_start, nest_size)
@@ -145,27 +105,80 @@ $.extend nest,
145
105
  content = $("._#{snippet_type}-preview").val()
146
106
  editor = tinymce.get(tinymce_id)
147
107
  if start?
148
- nest.replaceSnippet(editor, start, size, content)
108
+ replaceSnippet(editor, start, size, content)
149
109
  else
150
110
  editor.insertContent content
151
- offset = nest.offsetAfterInsert(editor, content)
111
+ offset = offsetAfterInsert(editor, content)
152
112
  $("button._#{snippet_type}-apply").attr("data-tm-snippet-start", offset)
153
113
 
154
114
  $("button._#{snippet_type}-apply").attr("data-tm-snippet-size", content.length)
155
115
 
156
- replaceSnippet: (editor, start, size, content) ->
157
- sel = editor.selection.getSel()
158
- if sel? and sel.anchorNode? and sel.anchorNode.data?
159
- text = sel.anchorNode.data
160
- size = 0 unless size?
161
- text = "#{text.substr(0, start)}#{content}#{text.substr(start + size)}"
162
- sel.anchorNode.data = text
163
- else
164
- editor.insertContent content
165
-
166
116
  updatePreview: (new_val) ->
167
117
  new_val = "{{ #{nest.name()}|#{nest.options()} }}" unless new_val?
168
118
  preview = $("._nest-preview")
169
119
  preview.val new_val
170
120
  preview.data("nest-options", nest.options())
171
121
  preview.data("reference", nest.name())
122
+
123
+
124
+ # ~~~~~~~~~~~~~~~~~~~~~~~~
125
+ # "private" helper methods
126
+
127
+ cardFromSlotOrDefault = (slot) ->
128
+ if slot then $(slot).attr('data-card-link-name') else ":update"
129
+
130
+ cardFromEditor = (editor) ->
131
+ return unless editor
132
+
133
+ ($(editor).attr('data-card-id') and "~#{$(editor).attr('card-id')}") or
134
+ $(editor).attr('data-card-link-name')
135
+
136
+ changeCreateToUpdate = (tm_id) ->
137
+ form = $("##{tm_id}").closest("form")
138
+ new_action = form.attr("action").replace("card/create", "card/update")
139
+ form.attr("action", new_action)
140
+
141
+ request = (card, overlay_view, modal_view, slotter, params) ->
142
+ slot = $(".board-sidebar > ._overlay-container-placeholder > .card-slot")
143
+
144
+ if false #slot[0]
145
+ view = overlay_view
146
+ mode = "overlay"
147
+ else
148
+ slot = $($(".card-slot")[0])
149
+ view = modal_view
150
+ mode = "modal"
151
+
152
+ sendRequest(slotter, slot, mode, card, view, params)
153
+
154
+ paramsStr = (start, name) ->
155
+ params = ""
156
+ if start?
157
+ params += "&tm_snippet_start=#{start}"
158
+ if name? and name.length > 0
159
+ params += "&tm_snippet_raw=#{encodeURIComponent(name)}"
160
+
161
+ params
162
+
163
+ sendRequest = (slotter, slot, mode, card, view, params) ->
164
+ params = "" unless params?
165
+ url = "/#{card}?view=#{view}&#{params}"
166
+ $.ajax
167
+ url: url
168
+ success: (html) ->
169
+ slot.slotContent html, mode, slotter
170
+
171
+ offsetAfterInsert = (editor, content) ->
172
+ offset = editor.selection.getSel().anchorOffset
173
+ offset - content.length
174
+
175
+
176
+ replaceSnippet = (editor, start, size, content) ->
177
+ sel = editor.selection.getSel()
178
+ if sel? and sel.anchorNode? and sel.anchorNode.data?
179
+ text = sel.anchorNode.data
180
+ size = 0 unless size?
181
+ text = "#{text.substr(0, start)}#{content}#{text.substr(start + size)}"
182
+ sel.anchorNode.data = text
183
+ else
184
+ editor.insertContent content