diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2018-09-19 05:52:43 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2018-09-19 05:52:43 +0000 |
| commit | ffe2c578ed26485e4869762e88c97e90b181bab3 (patch) | |
| tree | ec3851761cea04578400de82272a35648a2e5c11 /views/admin/emailconf.phtml | |
| parent | b1cd3f800d12677ffe4b73ab893d02aad20506b0 (diff) | |
- Email Anhang universell in E-Mail Konfiguration
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7156 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/admin/emailconf.phtml')
| -rw-r--r-- | views/admin/emailconf.phtml | 84 |
1 files changed, 83 insertions, 1 deletions
diff --git a/views/admin/emailconf.phtml b/views/admin/emailconf.phtml index 2f86c8c..97e0c3d 100644 --- a/views/admin/emailconf.phtml +++ b/views/admin/emailconf.phtml @@ -16,6 +16,12 @@ </div>
+<script>
+
+ var uploadData = {};
+
+</script>
+
<div class="wpsg_admin_content form-horizontal">
<form name="form1" method="post" enctype="multipart/form-data" action="<?php echo wpsg_hspc(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf&noheader=1'); ?>">
@@ -154,9 +160,85 @@ jQuery.cookie('wpsg_mail', wpsg_mail_open.join(','));
} // function wpsg_mail_save_cookie()
-
+
+ function wpsg_removeAttachemnt(a) {
+
+ var id = parseInt(a.getAttribute('data-id'));
+ var key = a.getAttribute('data-key');
+
+ uploadData[key].forEach(function(item, index, object) {
+
+ if (parseInt(item.id) === id) {
+
+ object.splice(index, 1);
+
+ }
+
+ } );
+
+ return false;
+
+ }
+
+ var wpframe;
+
jQuery(document).ready(function() {
+
+ jQuery(".btnAddAttachment").click(function(event) {
+
+ var source = event.target || event.srcElement;
+ var key = jQuery(source).attr("data-key");
+
+ event.preventDefault();
+
+ if (wpframe) { wpframe.open(); return; }
+
+ wpframe = wp.media.frames.file_frame = wp.media({
+ title: "<?php echo __('Auswählen oder Hochladen von Medien', 'wpsg'); ?>",
+ button: { text: "<?php echo __('Medien benutzen', 'wpsg'); ?>" },
+ multiple: true
+ });
+
+ wpframe.on('select', function() {
+
+ var attachments = wpframe.state().get('selection').map( function(attachment) {
+
+ attachment.toJSON();
+
+ var bDrin = false;
+
+ for (var i in uploadData[key]) {
+
+ if (uploadData[key][i].id === attachment.id) {
+
+ bDrin = true;
+
+ break;
+
+ }
+
+ }
+
+ if (!bDrin) {
+
+ uploadData[key].push( {
+ id: attachment.id,
+ filename: attachment.attributes.filename,
+ url: attachment.attributes.url
+ } );
+
+ }
+
+ return attachment;
+
+ } );
+
+ } );
+
+ wpframe.open();
+ } );
+
jQuery('.wpsg_email_box .panel-heading').bind('click', function() {
jQuery(this).next().toggle();
|
