Skip to content

Commit

Permalink
refs #41707, add confirm box when user choose file to replace pcp mai…
Browse files Browse the repository at this point in the history
…n img
  • Loading branch information
jimyhuang committed Oct 18, 2024
1 parent 6800f5f commit b1a8b44
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
6 changes: 5 additions & 1 deletion l10n/pot/civicrm.pot
Original file line number Diff line number Diff line change
Expand Up @@ -49562,4 +49562,8 @@ msgstr ""

#: templates/CRM/Contribute/Form/Contribution/Main.tpl
msgid "Your message will be displayed on the contribution page, allowing others to see why you support this contribution."
msgstr ""
msgstr ""

#: templats/CRM/Contribute/Form/PCP/Campaign.tpl
msgid "Are you sure you want to replace your current image?"
msgstr ""
Binary file modified l10n/zh_TW/LC_MESSAGES/civicrm.mo
Binary file not shown.
6 changes: 5 additions & 1 deletion l10n/zh_TW/civicrm.po
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: netiCRM\n"
"PO-Revision-Date: 2013-07-25 09:19+0000\n"
"Last-Translator: CC Chu <poliphilonet@gmail.com>, 2020-2024\n"
"Last-Translator: jimyhuang <jimmy@netivism.com.tw>, 2013,2015-2024\n"
"Language-Team: Chinese (Taiwan) (http://app.transifex.com/netivism-tw/neticrm/language/zh_TW/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -50124,3 +50124,7 @@ msgid ""
"Your message will be displayed on the contribution page, allowing others to "
"see why you support this contribution."
msgstr "您的留言將會顯示於募款頁中,讓大家可以看到你支持募款的緣由。"

#: templats/CRM/Contribute/Form/PCP/Campaign.tpl
msgid "Are you sure you want to replace your current image?"
msgstr "你確定要取代現有的圖片嗎?"
15 changes: 15 additions & 0 deletions templates/CRM/Contribute/Form/PCP/Campaign.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,21 @@ cj(document).ready(function($){
return false;
}
});
$("#attachFile_").change(function(e){
let hasImg = $('td.current-attachments img');
if (hasImg.length > 0 && e.target.files.length > 0) {
let confirmed = confirm("{/literal}{ts}Are you sure you want to replace your current image?{/ts} {ts}This operation cannot be undone.{/ts}{literal}");
if (confirmed) {
$('#is_delete_attachment').prop('checked', true);
hasImg.css({"opacity":".3", "max-width":"5%"});
}
else {
$(this).val('');
hasImg.css({"opacity":"1", "max-width":"18%"});
}
}
});
});
{/literal}</script>
Expand Down

0 comments on commit b1a8b44

Please sign in to comment.