| author | gibus |
| Thu, 28 Nov 2013 09:11:51 +0100 | |
| changeset 565 | 95a5c06c4008 |
| parent 480 | b9b802261109 |
| permissions | -rw-r--r-- |
|
66
7842b011403a
FIX : added edit.js for better pre-edit messages translations
reno
parents:
diff
changeset
|
1 |
function check_save(){ |
|
565
95a5c06c4008
With JQuery > 1.6 replace .attr() by .prop() or .val(), see http://api.jquery.com/prop/
gibus
parents:
480
diff
changeset
|
2 |
var newVersion = $('#id_new_version').prop('checked') ; |
|
95a5c06c4008
With JQuery > 1.6 replace .attr() by .prop() or .val(), see http://api.jquery.com/prop/
gibus
parents:
480
diff
changeset
|
3 |
var commentsKept = $('#id_keep_comments').prop('checked') ; |
| 106 | 4 |
|
|
480
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
5 |
if (commentsKept) { |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
6 |
submit_edit_form(); |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
7 |
} |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
8 |
else { |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
9 |
if (!newVersion) { |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
10 |
var message = gettext("You chose not to create a new version all comments will be deleted") ; |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
11 |
message += '<br />' ; |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
12 |
message += gettext( 'Do you want to continue?') ; |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
13 |
$('#confirm_all_removed_dlg').html(message) ; |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
14 |
$('#confirm_all_removed_dlg').dialog('open') ; |
|
66
7842b011403a
FIX : added edit.js for better pre-edit messages translations
reno
parents:
diff
changeset
|
15 |
} |
|
7842b011403a
FIX : added edit.js for better pre-edit messages translations
reno
parents:
diff
changeset
|
16 |
else { |
|
480
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
17 |
submit_edit_form() ; |
|
66
7842b011403a
FIX : added edit.js for better pre-edit messages translations
reno
parents:
diff
changeset
|
18 |
} |
|
480
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
19 |
} |
|
66
7842b011403a
FIX : added edit.js for better pre-edit messages translations
reno
parents:
diff
changeset
|
20 |
} |
|
7842b011403a
FIX : added edit.js for better pre-edit messages translations
reno
parents:
diff
changeset
|
21 |
|
|
183
f1c6f8fadfef
(re) edit : prevent tab change on cancel message + confirm_all_removed_dlg renamed (bug fix)
rbernard
parents:
174
diff
changeset
|
22 |
function submit_edit_form() { |
| 341 | 23 |
needToConfirm = false; |
|
183
f1c6f8fadfef
(re) edit : prevent tab change on cancel message + confirm_all_removed_dlg renamed (bug fix)
rbernard
parents:
174
diff
changeset
|
24 |
$('#edit_form').submit(); |
|
f1c6f8fadfef
(re) edit : prevent tab change on cancel message + confirm_all_removed_dlg renamed (bug fix)
rbernard
parents:
174
diff
changeset
|
25 |
} |
|
f1c6f8fadfef
(re) edit : prevent tab change on cancel message + confirm_all_removed_dlg renamed (bug fix)
rbernard
parents:
174
diff
changeset
|
26 |
|
|
66
7842b011403a
FIX : added edit.js for better pre-edit messages translations
reno
parents:
diff
changeset
|
27 |
$(function() { |
| 341 | 28 |
var buttons = {}; |
29 |
buttons[gettext('No')] = function() { |
|
30 |
$(this).dialog('close'); |
|
31 |
} ; |
|
32 |
buttons[gettext('Yes')] = function() { |
|
33 |
$(this).dialog('close');submit_edit_form(); |
|
34 |
} ; |
|
|
66
7842b011403a
FIX : added edit.js for better pre-edit messages translations
reno
parents:
diff
changeset
|
35 |
|
|
480
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
36 |
$('#confirm_all_removed_dlg').dialog({ |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
37 |
bgiframe: true, |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
38 |
autoOpen: false, |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
39 |
title :gettext('Warning'), |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
40 |
modal: true, |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
41 |
buttons:buttons |
|
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
42 |
}) ; |
| 103 | 43 |
|
|
480
b9b802261109
Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once).
gibus
parents:
341
diff
changeset
|
44 |
$("#save").click(function() { check_save() ;}) ; |
|
66
7842b011403a
FIX : added edit.js for better pre-edit messages translations
reno
parents:
diff
changeset
|
45 |
}) ; |