effective_ckeditor 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b22b0341285f50bf1bba6fa6e07a04339cb7140f
|
4
|
+
data.tar.gz: feb17db6574f8451258e88fcfe0b8e70391a61a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3fb6b41d9162903d27458077136d2b151684703f0fb961eb5bbeac4678a9276b90c838a3d62f4e3a16bca88f8c24e38ea33d9c02ba8ce11bf004ce454971540
|
7
|
+
data.tar.gz: f05e9bab1af03913bb47e799652f147f9b434b0145e238de360f185c38a49ec642382e7ec8bf502d805c1899a994a1f4ece8472110128cd2aef21a6d1803cfbb
|
@@ -19,7 +19,8 @@ init = ->
|
|
19
19
|
if ckeditors.length
|
20
20
|
$('body').prepend("<div id='effective-ckeditor-top'></div>").addClass('effective-ckeditor-editting')
|
21
21
|
|
22
|
-
$(window).on 'beforeunload', (event) ->
|
22
|
+
$(window).on 'beforeunload', (event) -> promptToSaveIfDirtyWindow(event)
|
23
|
+
$(document).on 'click', 'a', (event) -> promptToSaveIfDirtyLink(event)
|
23
24
|
$(window).on 'unload', (event) -> $.cookie('effective_regions_editting', '', {path: '/', expires: -1})
|
24
25
|
|
25
26
|
ckeditors.each ->
|
@@ -120,7 +121,7 @@ initTemplates = ->
|
|
120
121
|
imagesPath: CKEDITOR.getUrl( window.location.protocol + '//' + window.location.host + '/assets/effective/templates/' ),
|
121
122
|
templates: template for template in templates
|
122
123
|
|
123
|
-
|
124
|
+
promptToSaveIfDirtyWindow = (event) ->
|
124
125
|
dirty = false
|
125
126
|
|
126
127
|
for name, instance of CKEDITOR.instances
|
@@ -133,6 +134,17 @@ promptToSaveIfDirty = (event) ->
|
|
133
134
|
else
|
134
135
|
event.stopPropagation()
|
135
136
|
|
137
|
+
promptToSaveIfDirtyLink = (event) ->
|
138
|
+
dirty = false
|
139
|
+
|
140
|
+
for name, instance of CKEDITOR.instances
|
141
|
+
if instance.checkDirty()
|
142
|
+
dirty = true
|
143
|
+
break
|
144
|
+
|
145
|
+
if dirty && !confirm('You have unsaved changes. Really leave page?')
|
146
|
+
event.preventDefault()
|
147
|
+
|
136
148
|
affixBootstrapMenu = (editor_div) ->
|
137
149
|
dropdown_menu = editor_div.closest('.dropdown-menu')
|
138
150
|
|