RegisterRegister    SearchSearch   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AJAX upload progress bar

File sharing script

File mirror script

Newsletter script
Integration with jQuery framework

 
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XUpload
View previous topic :: View next topic  
Author Message
philwareham



Joined: 05 Jun 2007
Posts: 9

PostPosted: Nov 17, 2008 10:21 am    Post subject: Integration with jQuery framework Reply with quote

Hi there,

I have a working installation of XUpload, but I want to incorporate the jQuery javascript framework on my page. However there is a conflict with the xupload.js, I think it is because I use the following jQuery recommended method to activate jQuery elements...

$(document).ready(function(){ *my jquery code here* }

Is there a way of modifying the xupload.js file so they play nice together?
Back to top
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 2106
Location: UFO Lab

PostPosted: Nov 17, 2008 10:31 am    Post subject: Reply with quote

Try to comment $ function in xupload.js
Back to top
View user's profile Send private message Visit poster's website
philwareham



Joined: 05 Jun 2007
Posts: 9

PostPosted: Nov 17, 2008 10:59 am    Post subject: Reply with quote

If I comment out...

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


At the start of the xupload.js, then my jQuery scripts all start to work as expected and the files upload to my server OK, but the upload progress box does not refresh/update at all.
Back to top
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 2106
Location: UFO Lab

PostPosted: Nov 17, 2008 12:11 pm    Post subject: Reply with quote

Check for JS errors. PM me your URL if possible.
Back to top
View user's profile Send private message Visit poster's website
philwareham



Joined: 05 Jun 2007
Posts: 9

PostPosted: Nov 17, 2008 1:59 pm    Post subject: Solved! Reply with quote

OK, PilgrimX182 found a solution for this conflict as follows...

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

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


Then automatically replace all $ in xupload.js with $gget and it will be all right.
Back to top
View user's profile Send private message
Buyaphoto



Joined: 01 Jul 2008
Posts: 7

PostPosted: Feb 16, 2009 4:33 pm    Post subject: same problem with mootools Reply with quote

has anyone had any luck integrating with mootools?
Back to top
View user's profile Send private message
Ugly Mau



Joined: 30 Aug 2007
Posts: 12

PostPosted: May 05, 2009 10:53 am    Post subject: Reply with quote

Hello,
The solution proposed by philwareham is correct?
We can use it as "official"?

Thanks
Back to top
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 2106
Location: UFO Lab

PostPosted: May 05, 2009 1:08 pm    Post subject: Reply with quote

This is a 'hack', but it will work for you.
Back to top
View user's profile Send private message Visit poster's website
Ugly Mau



Joined: 30 Aug 2007
Posts: 12

PostPosted: May 05, 2009 2:29 pm    Post subject: Reply with quote

Ok, just to understand if this change causing other problems ...

I have the version 2.6 pro, in the version 3.0 this conflict is resolved?
Back to top
View user's profile Send private message
wfrohwein



Joined: 07 Nov 2009
Posts: 1

PostPosted: Nov 07, 2009 9:25 am    Post subject: Re: Solved! Reply with quote

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

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

Code:
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:
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
Back to top
View user's profile Send private message
INTERNOZEROUNO



Joined: 23 Mar 2011
Posts: 8

PostPosted: May 04, 2011 9:21 am    Post subject: Re: Solved! Reply with quote

wfrohwein wrote:
I renamed the xupload.js $ function to $$. I also had to modify upload.cgi.

Thank you! That works great!
Back to top
View user's profile Send private message
ssanders



Joined: 06 Mar 2012
Posts: 5
Location: Ashland, OH, USA

PostPosted: Mar 06, 2012 9:15 pm    Post subject: Fix the source? Reply with quote

While I adore open source so I can fix things myself...

jQuery is mad popular -- why not replace all the $() to $$() in an official release, especially for us who purchased Pro?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XUpload All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group