diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2016-11-04 14:34:21 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2016-11-04 14:34:21 +0000 |
| commit | e4326891a13a1bf445635ffbe30fae4e7462b458 (patch) | |
| tree | 7a9fef1e99eb7785467967894b55e9da2a86e3c5 /views/admin/form/upload.phtml | |
| parent | ae89a04884f3870b78f6fa1ea93d14ea8d27aedf (diff) | |
- Arbeiten V4
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5896 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/admin/form/upload.phtml')
| -rw-r--r-- | views/admin/form/upload.phtml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/views/admin/form/upload.phtml b/views/admin/form/upload.phtml index dd0591b..8e3c47e 100644 --- a/views/admin/form/upload.phtml +++ b/views/admin/form/upload.phtml @@ -28,6 +28,37 @@ </div>
+ <?php if (wpsg_isTrue($this->view['field_config']['ajax_upload'])) { ?>
+ <script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ jQuery('#<?php echo $this->view['field_id']; ?>').on('change', function() {
+
+ var data = new FormData();
+ data.append('file', this.files[0]);
+
+ jQuery.ajax( {
+ url: '<?php echo $this->view['field_config']['ajax_upload_url']; ?>',
+ data: data,
+ type: 'POST',
+ processData: false,
+ contentType: false,
+ success: function(data) {
+
+ <?php if (wpsg_isSizedString($this->view['field_config']['ajax_success'])) { ?>
+ <?php echo $this->view['field_config']['ajax_success']; ?>(data);
+ <?php } ?>
+
+ }
+ } );
+ } );
+
+ } );
+
+ /* ]]> */</script>
+ <?php } ?>
+
<div class="clearfix wpsg_clear"></div>
</div>
|
