Ask for confirmation before layout reset

This commit is contained in:
Kijin Sung 2024-05-05 15:56:10 +09:00
parent 5daa6636a6
commit ac895d64cb
4 changed files with 12 additions and 1 deletions

View file

@ -85,6 +85,7 @@ $lang->layout_editing_deprecated_p2 = 'Layout editing is supported for a limited
$lang->layout_editing_deprecated_p3 = 'For your information, edited source code is currently stored in the following files.';
$lang->layout_editing_deprecated_p4 = 'The original source code is stored in the following file, as well as any file included/referenced therein.';
$lang->layout_editing_deprecated_p5 = 'Caution: Clicking Reset will roll back the layout source code to the original. You cannot return to this screen afterward.<br />Please back up the edited source code below before clicking Reset.';
$lang->layout_reset_confirmation = 'Do you want to reset the layout source code to the original state?';
$lang->layout_image_repository = 'Layout Repository';
$lang->about_layout_image_repository = 'You can upload image/flash files for the selected layout. They will be included in exports.';
$lang->msg_layout_image_target = 'Only gif, jpg, png, svg, webp files are allowed.';

View file

@ -85,6 +85,7 @@ $lang->layout_editing_deprecated_p2 = '레이아웃 편집 기능은 이미 편
$lang->layout_editing_deprecated_p3 = '편집된 소스 코드는 아래의 경로에 저장되어 있으니 참고하십시오.';
$lang->layout_editing_deprecated_p4 = '원본 소스 코드는 아래의 경로에 있으며, 그곳에서 인클루드 또는 참조된 다른 파일이 더 있을 수 있습니다.';
$lang->layout_editing_deprecated_p5 = '주의: 초기화를 클릭하면 편집된 소스 코드가 원본으로 대체되며, 이 화면으로 다시 돌아올 수 없습니다.<br />초기화하기 전에 편집된 소스 코드를 백업해 두시기 바랍니다.';
$lang->layout_reset_confirmation = '레이아웃 소스를 원본 상태로 초기화하시겠습니까?';
$lang->layout_image_repository = '레이아웃 파일 저장소';
$lang->about_layout_image_repository = '선택한 레이아웃에 사용될 이미지/플래시파일 등을 올릴 수 있습니다. 내보내기에 같이 포함 됩니다.';
$lang->msg_layout_image_target = 'gif, jpg, png, svg, webp 파일만 가능합니다.';

View file

@ -10,3 +10,12 @@ function doPreviewLayoutCode()
$form.removeAttr('target');
$act.val(og_act);
}
$(function() {
$('.reset_layout').on('click', function(e) {
var msg = $(this).data('confirmationMsg');
if (!confirm(msg)) {
e.preventDefault();
}
});
});

View file

@ -99,7 +99,7 @@
<div class="x_clearfix btnArea">
<span class="x_pull-left">
<button type="submit" class="x_btn" name="mode" value="reset">{$lang->cmd_reset}</button>
<button type="submit" class="x_btn reset_layout" name="mode" value="reset" data-confirmation-msg="{$lang->layout_reset_confirmation}">{$lang->cmd_reset}</button>
</span>
<span class="x_pull-right x_btn-group">
<button type="button" class="x_btn" onclick="doPreviewLayoutCode()">{$lang->cmd_preview}</button>