XUpload - Xupload Pro 3.1 & jQuery 1.3.2

XUpload related questions

Moderator: admin

Message
Author
Grumpy
Posts: 1
Joined: Mar 10, 2010 7:37 am

Xupload Pro 3.1 & jQuery 1.3.2

#1 Postby Grumpy » Mar 10, 2010 7:46 am

Hey Hey,

I was wondering if someone could help me out.

I just purchased the Xupload Pro 3.1 and i cant seem to find a way to make it play with jQuery.

On my site i use jQuery 1.3.2 for various different effects .. when i add the Xupload.js script, the upload works, but thats it ... none of the file status popups work or anything.

When i comment out the jquery include line, it seems to work perfect.

I have read http://www.sibsoft.net/forum/integration-with-jquery-framework-t933.html?highlight=jquery .. in there, it says to rename the first line of xupload.js to

Code: Select all

function $gget(elem){return document.getElementById(elem);}


But i gather this is from an older version as the first line of mine is as follows

Code: Select all

if(!window.$){ window.$ = function (elem){return document.getElementById(elem);} }


If someone could give me a hand, that would be great ... Im starting to get a little grumpy.

Cheers,

Waltman
Posts: 7
Joined: Mar 11, 2010 10:56 am

#2 Postby Waltman » Mar 26, 2010 8:10 pm

same problem. Waiting for fix

ChrisSoutham
Posts: 7
Joined: Jun 27, 2008 5:26 pm

#3 Postby ChrisSoutham » Mar 29, 2010 2:32 pm

There's very quick fix, and that's to run jQuery in no conflict mode:
http://docs.jquery.com/Using_jQuery_wit ... _Libraries

jeffshead
Posts: 18
Joined: Apr 21, 2009 3:26 pm

Re: Xupload Pro 3.1 & jQuery 1.3.2

#4 Postby jeffshead » Apr 10, 2013 2:10 am

Grumpy wrote:But i gather this is from an older version as the first line of mine is as follows

Code: Select all

if(!window.$){ window.$ = function (elem){return document.getElementById(elem);} }



Same issue here. can someone please tell me how to fix.

I've tried adding jQuery in no conflict mode but maybe I'm not doing it correctly.

jeffshead
Posts: 18
Joined: Apr 21, 2009 3:26 pm

#5 Postby jeffshead » Apr 10, 2013 3:03 am

wfrohwein wrote:
philwareham wrote:OK, PilgrimX182 found a solution for this conflict as follows...

In the xupload.js file rename function (1st line) to:

Code: Select all

function $gget(elem){return document.getElementById(elem);}


Then automatically replace all $ in xupload.js with $gget and it will be all right.


i got the new xupload pro version and i was trying to integrate with drupal which uses jquery. I renamed the xupload.js $ function to $$. I also had to modify upload.cgi. Instead of naming my function $gget like PilgrimX182 mentioned, i named it $$. So my upload.cgi looks like so:

Code: Select all

if($ENV{QUERY_STRING} =~ /^settings/)
{
   $c->{pass_required} = $c->{upload_password}&&1;
   print"Content-type: text/html\n\n";
   print"$_='$c->{$_}';" for qw(ext_allowed ext_not_allowed max_upload_files max_upload_size enable_file_descr pass_required email_required);
   print qq[if(\$\$('x_max_files'))\$\$('x_max_files').innerHTML = '$c->{max_upload_files}';];
   print qq[if(\$\$('x_max_size'))\$\$('x_max_size').innerHTML='$c->{max_upload_size}';];
   print q[if($$('x_password')){$$('x_password').style.display='block';}] if $c->{pass_required};
   print q[if($$('x_folder')){$$('x_folder').style.display='block';}] if $c->{allow_ext_folder};
   exit;
}


hope that helps anyone that is having the trouble i did


The post above seems to have solved the issue so far. Need to do more testing, though. I'll report back ONLY if these edits have any side effects or don't work fully.


Return to “XUpload”

Who is online

Users browsing this forum: No registered users and 0 guests