problem in js/lib_files.js

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

problem in js/lib_files.js

Aditya Patawari
Hi,
I have appended a few lines at the end of the OC_FILES.showbrowser_callback
function just after "contentNode.appendChild(
files);" in js/lib_files.js. The lines are :

    var ubutton=document.createElement('button');
    ubutton.name='ubutton';
    ubutton.setAttribute('type','button');
    ubutton.setAttribute('value','Upload');

ubutton.setAttribute('onclick','OC_FILES.showuploader(\''+dir+'\',\''+td+'\')')
    contentNode.appendChild(ubutton);

I am doing this to get a button which, on clicking, would show an uploader
but this is not happening. Can someone point out my mistake?


--
Aditya Patawari
http://yaps.co.in
http://blog.adityapatawari.com/
https://fedoraproject.org/wiki/User:Adimania
India
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/owncloud/attachments/20100327/6463795e/attachment.htm 

Reply | Threaded
Open this post in threaded view
|

problem in js/lib_files.js

Robin Appelman
On Saturday 27 March 2010 14:08:56 Aditya Patawari wrote:

> Hi,
> I have appended a few lines at the end of the OC_FILES.showbrowser_callback
> function just after "contentNode.appendChild(
> files);" in js/lib_files.js. The lines are :
>
>     var ubutton=document.createElement('button');
>     ubutton.name='ubutton';
>     ubutton.setAttribute('type','button');
>     ubutton.setAttribute('value','Upload');
>
> ubutton.setAttribute('onclick','OC_FILES.showuploader(\''+dir+'\',\''+td+'\
> ')')
> contentNode.appendChild(ubutton);
>
> I am doing this to get a button which, on clicking, would show an uploader
> but this is not happening. Can someone point out my mistake?
I think the problem is that you're casting td to a string here, instead of
passing the variable to showuploader() you're passing the string
representation of td.

the best solution would be placing td in a global variable I guess.


 - Robin Appelman