YUI Uploader 2.6.0 example - yui

I'm trying to simply use some of the examples and instructions regarding the YUI-Uploader, and I'm being frustrated by a number of issues.
The "YUI Library: Uploader" cheat sheet's simple use case doesn't work for me because all the listed methods except addListener() do not exist on the myUploader object.
The example is for version 2.5.1 and includes a method called browse(), which not only was removed in version 2.6.0 but I cannot find any documentation for how to use the 2.5.1 version if I so choose.
I can't find the source FLA to the uploader.swf file so that I could theoretically diagnose all these issues.
Has anyone successfully used the 2.6.0 YUI Uploader, and if so is there some common interfering JavaScript I should avoid, or a better example to follow? Thank you.
Thanks for the replies.
I might note that I finished my "uploader" project before receiving any responses to this.
Part of my problems were due to some of the examples being for v2.5.1 and another part were due to not using an event listener to see when the component was ready. I got the most help from just dissecting what Flickr did.

You can find the source to uploader.swf here at Uploader.as now that the YUI source is available on GitHub.

You've got the wrong link for the simple example, here's the correct one.
YUI Uploader Simple Example
You could also take a look at my implementation if you'd like, it's pretty barebones and works fine using YUI 2.6.0.
Tivac.com YUI Uploader Implementation
It sounds like for #1 that you're trying to call methods on the uploader immediately. You should instead add listeners for all the events it can fire and do any configuration once the "contentReady" event fires. All the YUI examples & mine do that, so you can check there for a code sample.

Related

How to find sources of standard node.js functions

For example, if I'd like to read the source code of the process.chdir JavaScript function, how can I do that?
I can find process.js on github but not sure that's the right file. Is there an easier way to navigate from docs directly to source?
There is not a simple way to navigate directly from the web doc to source. To find the code for a specific function, you have several choices:
Create a small test app that calls the function in question, run node-inspector and step into the function of interest. That will take you right into the source code that your installed version of node.js is running. You can then continue stepping or just examine the local source code shown in the debugger.
Grep your own node.js installation. Since all the .js files are right there and in plain text, you can find it there.
Go to Github like you've done and find the relevant function. This is not always easy to do (as you've discovered) and it doesn't guarantee that you're looking at the source for the exact same version you have installed. If you're a Github wiz, you can always figure out how to see the right version, but that's a bit more work.
If the code you want is actually implemented in native code, then you're going to have to use options 3 or maybe option 2 (if you have native sources locally).

Mako rendering recipe from cherrypy docs does not work. What is wrong?

I have copy-pasted the tool and plugin files from the Mako rendering recipe pointed to by the Cherrypy docs, and it simply does not work out of the box.
I have tried to track the problem and apparently, the response.finalize() method is called before the Mako tool is called, which modifies the response.body dictionary and gives a wrong input to the template. Why is this happening if the tool is configured with the 'before_finalize' option?
Another strange thing is that I need to set the response.status to 200 manually in the normal handler, as opposed to other examples.
I am using Python-3.4.3 and Cherrypy-3.7.0.
After #saaj's help and looking through the Cherrypy source code I have come to the conclusion that the recipe is no longer correct. My guess is that since it's a couple of years old, changes in newer versions might have rendered the recipe unusable. This is based on these facts:
I have observed that the dictionary returned by the exposed handler gets converted into a list (in my basic test) so the renderer does not receive what it should.
The json_out tool uses a different approach, which is actually very similar to what the HandlerWrapperTool does. Its hook point is 'before_handler' instead of 'before_finalize'.
The response.status needs to be set in the exposed handler, as opposed to what happens here.
So in the end, I will use the snippet posted here, but I could also use something simpler, such as this example.

Simplest suggestion box (like google suggestion when you using search) in PHP (without jQuery)

I can't find simple solution for suggestion in php/java script (no jQuery or something) so would like if some have some advice?
It is simple, when people search my site I want they to see suggestions, I made everything for 'feeding' that box, but can't code or find somewhere simple php/java script only solution, so please give me some useful link or code.
Also, forgot to say that I found "XMLHttpRequest" and made implementation which works great, but since I never ever used XMLHttpRequest I am not sure will it work all platforms and browsers? I tested in few (IE,F,Chorme,Safary) and it works on windows platform, but not sure will it work on other (Mobile platform for example) that XMLHttpRequest solution?
Go to the below link to find an awesome auto complete script without using any kind of javascript frameworks like jQuery or Prototype. Probably this might be the thing you are looking for.
http://dhtmlx.com/docs/products/dhtmlxCombo/index.shtml
UPDATE
Giving some extra links below you can find similar auto complete or
auto search without jQuery
http://www.brandspankingnew.net/specials/ajax_autosuggest/ajax_autosuggest_autocomplete.html
http://www.codeproject.com/Articles/8020/Auto-complete-Control
http://mattberseth.com/blog/2007/12/creating_a_google_suggest_styl.html
http://www.devthought.com/2008/01/12/textboxlist-meets-autocompletion/
http://wick.sourceforge.net/

Form validation in addition to YUI

I'm in the process of adding some much needed client side form validation to a website I'm working on. We're currently using YUI. YUI doesn't have any form validation built in as I can see(prove me wrong).
I googled it
http://code.google.com/p/yui-form-validator/
It's not important that it's a YUI-extension as long as it plays along with YUI in a civilized manner.
What should I go for? Anyone out there with experience and an opinion?
There's a module in the gallery: http://yuilibrary.com/gallery/show/form
I haven't used it, but it looks pretty good to me.
Looks like we'll go for http://validatious.org/
Lightweight and standalone. Will not interfere with YUI.

Using YUI and Prototype Together

I want to add a calendar control to a page that already includes Prototype and Scriptaculous. Not happy with any of the Prototype ones I could find, I'm considring using the YUI Calendar widget.
I this likely to cause any problems?
We have worked hard to make sure that YUI is safe to use with any other library. We namespace everything, as HermanD says, under only one required global (YAHOO) and one optional one (YAHOO_config). We don't modify native objects. And even though Protoype does modify native prototypes, we code defensively so that this doesn't break YUI functionality.
If you find any bugs in using the two together, please let us know.
Regards,
Eric
YUI Team
By default everything in YUI is within the YAHOO namespace, so as long as you sensibly apply namespaces to anything you use from YUI, I would have thought you should be ok.
See: http://developer.yahoo.com/yui/yahoo/
I successfully used the YUI tab control in an app I was already using Prototype and Scriptaculous in and had no problem. The weight of all that is a bit much though if you're looking at a publicly available app. I wouldn't care so much about an internal app, say for a company, but you might want to think about how much JavaScript you're making end users download and the number of separate files they're having to download for the page.

Resources