Hello, I’ve been using wpalchemy for a while and appreciate it very much. I often use the media uploader in particular. One thing I am having difficulty doing is to show the image I’ve just uploaded immediately rather than saving and refreshing the page. I think I could write something to do this, but before I go an make a mess I was wondering if a relatively simple solution already exists.
Anybody do this?
thank you!
I did something similar recently using & also attached a shadowbox
I hid the input field and used a change event to see when it had been updated
jQuery(function($) {
Shadowbox.init({
overlayOpacity: 0.8
});
$.wpalchemy.bind('wpa_copy', function(the_clone) {
imageAdded();
});
function imageAdded() {
$('.wpa_group-projectimage').each(function(e) {
var par = $('p', this);
$('input:text', this).css('display','none');
$('input:text', this).bind('change', function(event) {
Shadowbox.init({
skipSetup:true
});
par.html(' ');
});
});
}
imageAdded();
$('a.shadowlink').live('click',function(event){
Shadowbox.setup($('.shadowlink'));
Shadowbox.open(this);
event.preventDefault();
});
});
Also in MediaAccess.php change this line
wpalchemy_mediafield.val(url);
to
wpalchemy_mediafield.val(url).change();
Or I have just seen this, might be more useful than my hack job!
https://github.com/farinspace/wpalchemy/pull/42
Cheers
Andy
Recent Comments