Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. new AjaxUpload( 'uploadMarkerDiv',{
  2.         action: '../wp-content/plugins/geoMax/php/geoMax_uploadImage.php',
  3.         name: 'userfile',
  4.         data: {
  5.             cat_id : optie_naam
  6.         },
  7.         autoSubmit: true,
  8.         responseType: false,
  9.         onchange: function(file, extension){},
  10.         onsubmit: function(file, extension) {
  11.         console.log('kaas');
  12.         return true;
  13.         },
  14.         onComplete: function(file, response) {
  15.             //console.log(response);
  16.             var newArray = checkAjaxReturn(response);
  17.             img_array = newArray;
  18.            
  19.             imgSource = '../wp-content/plugins/geoMax/images/markers/uploads/'+newArray[0]['imgSrc'];
  20.            
  21.             $('#markerImgSrc').removeAttr('src');
  22.             $('#markerImgSrc').attr('src', imgSource);
  23.             imgAnker = '../wp-content/plugins/geoMax/images/ankers/'+newArray[0]['anker']+'.png';
  24.            
  25.             $('#afbeeldingAnkerImg').attr('src', imgAnker);
  26.             $('#afbeeldingAnker').val(newArray[0].anker);
  27.         }
  28.     });
  29.  
  30.     $('#cat').change( function() {
  31.         waarde = $('#cat').val();
  32.         optie_naam = '_cat_img_'+waarde;
  33.        
  34.         img_array = getCatArray(optie_naam);
  35.        
  36.         //img_array[0]['cat_img_id'] = optie_naam;
  37.                        
  38.         imgSource = '../wp-content/plugins/geoMax/images/markers/uploads/'+img_array[0].imgSrc;
  39.         imgAnker = '../wp-content/plugins/geoMax/images/ankers/'+img_array[0].anker+'.png';
  40.                
  41.         $('#markerImgSrc').attr('src', imgSource);
  42.         $('#afbeeldingAnkerImg').attr('src', imgAnker);
  43.         $('#afbeeldingAnker').val(img_array[0].anker);
  44.        
  45.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement