Subversion Repositories wpShopGermany4

Rev

Rev 7147 | Rev 7560 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7147 Rev 7156
Line 14... Line 14...
14
		<?php } ?>
14
		<?php } ?>
15
	</div>
15
	</div>
16
 
16
 
17
</div>
17
</div>
18
 
18
 
-
 
19
<script>
-
 
20
 
-
 
21
    var uploadData = {};
-
 
22
    
-
 
23
</script>
-
 
24
 
19
<div class="wpsg_admin_content form-horizontal">
25
<div class="wpsg_admin_content form-horizontal">
20
	<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'); ?>">
26
	<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'); ?>">
21
 
27
 
22
		<?php echo wpsg_drawForm_AdminboxStart('Allgemeine Einstellungen', 'wpsg'); ?>
28
		<?php echo wpsg_drawForm_AdminboxStart('Allgemeine Einstellungen', 'wpsg'); ?>
23
		<?php $logoPath = wpsg_getUploadDir('wpsg_mailconf').'wpsg_email_logo.jpg'; ?>
29
		<?php $logoPath = wpsg_getUploadDir('wpsg_mailconf').'wpsg_email_logo.jpg'; ?>
Line 152... Line 158...
152
		} );
158
		} );
153
 
159
 
154
		jQuery.cookie('wpsg_mail', wpsg_mail_open.join(','));
160
		jQuery.cookie('wpsg_mail', wpsg_mail_open.join(','));
155
 
161
 
156
	} // function wpsg_mail_save_cookie()
162
	} // function wpsg_mail_save_cookie()
157
 
163
    
-
 
164
    function wpsg_removeAttachemnt(a) {
-
 
165
	     
-
 
166
	    var id = parseInt(a.getAttribute('data-id'));
-
 
167
	    var key = a.getAttribute('data-key');
-
 
168
 
-
 
169
        uploadData[key].forEach(function(item, index, object) {
-
 
170
 
-
 
171
            if (parseInt(item.id) === id) {
-
 
172
 
-
 
173
                object.splice(index, 1);
-
 
174
                
-
 
175
            }
-
 
176
            
-
 
177
        } ); 
-
 
178
                
-
 
179
        return false;
-
 
180
	    
-
 
181
    }
-
 
182
    
-
 
183
    var wpframe;
-
 
184
	
158
	jQuery(document).ready(function() {
185
	jQuery(document).ready(function() {
-
 
186
	    
-
 
187
        jQuery(".btnAddAttachment").click(function(event) {
-
 
188
 
-
 
189
            var source = event.target || event.srcElement;
-
 
190
            var key = jQuery(source).attr("data-key");
-
 
191
            
-
 
192
            event.preventDefault();
-
 
193
 
-
 
194
            if (wpframe) { wpframe.open(); return; }
-
 
195
 
-
 
196
            wpframe = wp.media.frames.file_frame = wp.media({
-
 
197
                title: "<?php echo __('Auswählen oder Hochladen von Medien', 'wpsg'); ?>",
-
 
198
                button: { text: "<?php echo __('Medien benutzen', 'wpsg'); ?>" },
-
 
199
                multiple: true  
-
 
200
            });
-
 
201
 
-
 
202
            wpframe.on('select', function() {
-
 
203
 
-
 
204
                var attachments = wpframe.state().get('selection').map( function(attachment) {
-
 
205
 
-
 
206
                    attachment.toJSON();
-
 
207
 
-
 
208
                    var bDrin = false;
-
 
209
                
-
 
210
                    for (var i in uploadData[key]) {
-
 
211
                        
-
 
212
                        if (uploadData[key][i].id === attachment.id) {
-
 
213
                            
-
 
214
                            bDrin = true;
-
 
215
                            
-
 
216
                            break;
-
 
217
                            
-
 
218
                        }
-
 
219
                        
-
 
220
                    }
-
 
221
                    
-
 
222
                    if (!bDrin) {
-
 
223
                    
-
 
224
                        uploadData[key].push( {
-
 
225
                            id: attachment.id, 
-
 
226
                            filename: attachment.attributes.filename,
-
 
227
                            url: attachment.attributes.url
-
 
228
                        } );
-
 
229
                        
-
 
230
                    }
-
 
231
                    
-
 
232
                    return attachment;
-
 
233
                    
-
 
234
                } ); 
-
 
235
                
-
 
236
            } );
-
 
237
 
-
 
238
            wpframe.open();
159
 
239
 
-
 
240
        } );
-
 
241
	    
160
		jQuery('.wpsg_email_box .panel-heading').bind('click', function() {
242
		jQuery('.wpsg_email_box .panel-heading').bind('click', function() {
161
 
243
 
162
			jQuery(this).next().toggle();
244
			jQuery(this).next().toggle();
163
 
245
 
164
			wpsg_mail_save_cookie();
246
			wpsg_mail_save_cookie();