How can I use FancyUpload (with mootools) side by side with prototype.js? - mootools

I have a site that I am using prototype and scriptaculous on. One one page of my site, I would like to use Digitarald's FancyUploader (I have not found anything else that is as elegant, and offers multiple file selection). Is it possible to use the two on the same page? If so, how would I do it?

There is no way to run a Mootools script with prototype.
While Mootools provide a dollar-safe mode, that mode only provided compatibility with frameworks that provides a $() function.
The reason why Mootools and prototype are incompatible is that they both extend native JavaScript natives with their own methods. Unfortunately, there is no way of overriding this behavior.
SWFUpload is an alternative solution which is compatible with pretty much all JavaScript frameworks. It is pretty much functionally equivalent to FancyUpload. You might want to consider it as an alternative solution. If not, you'll have to make a choice between Mootools and prototype.

Related

Polymer and Google Closure Compiler

Will Polymer support Google Closure Compiler? What are the reasons why Polymer did not support Google Closure Compiler from the very beginning?
Well I can't answer why there wasn't support for the compiler from the beginning because I don't work on Polymer itself, but I do know that there are people working to make Polymer work better with the compiler now. In the short term, we're looking to add externs like these:
https://github.com/Polymer/paper-checkbox/tree/master/externs
for existing elements and are looking into adding an externs generator so that we don't have to manage these manually. Longer term, we are hoping to have full support for compiling Polymer elements and ensuring that they work well with other compiled code. Would externs address your use case in the short term? Maybe we can try to prioritize certain elements or at least give you some idea of when they'll be done.
A polymer-aware compiler pass looks like it's in the works: https://github.com/google/closure-compiler/wiki/Polymer-Pass

html5 swipe events

I am pretty new to HTML5. Coming from Flash background, I can call the swipe events easily from Actionscript API. But for HTML5, I believe I have to code this myself by listening to touchstart, touchmove, and touchend. Is there a simpler way to do this? And also I am looking for a website that contains complete HTML5 references
Your best bet for handling touch events is to look at some JavaScript libraries that can handle them: JQuery Mobile, Sencha Touch and jQT (formerly jQTouch) are the big ones.
If you're not already using JQuery, I would highly recommend it.
As far as HTML references, the (highly verbose and technical) specification document might be too much, so I would suggest starting with w3schools. (A tip: Keep in mind that HTML5 is still a work in progress and browser/client support varies.)
If you need help figuring out how to manipulate the DOM (i.e. how to use JavaScript to make things happen), the JQuery documentation is also be a good reference point.

HTML5 framework

I know very little HTML or web dev, but I would like to write an
HTML5 app with a fairly complex UI. Is there a framework that stands
out among the rest for this type of job? Do I need a framework; or can
I just do everything in straight HTML+CSS+JS? And what about GWT?
Thanks!
As a general HTML5 starting template, Boilerplate is always a good choice.
It will optimize and chain all your scripts and CSS files, as well as your HTML code and images, it also comes with useful tools like Modernizr.
If you are looking for JavaScript libraries, YUI is a very good library when it comes to UI, though maybe a little more complicated than jQuery or jQuery UI at first. I found it better than jQuery UI, and can work together with jQuery anyway.
EDIT
You may also be interested in Ext JS. Looking at the demo it provides, seems really like a powerful library with many ready to use UI widgets. Never used it though, and looks like it only offers a commercial license.
I suggest you to use Html5-boilerplate.
Download from github
Video Tutorials from author :
http://www.youtube.com/watch?v=qyM37XKkmKQ
http://www.youtube.com/watch?v=OXpCB3U_4Ig
GWT is a good way to go for a complex web application, particularly if you're familiar with java but not javascript. GWT now provides support for HTML5 features such as offline storage, canvas, audio, and video, although it's possible to use any HTML5 features whether GWT provides specific Java classes to support them or not (I implemented the offline storage feature in one of my apps before it was part of GWT). Using GWT will mitigate many of the browser compatibility problems you will encounter with straight HTML+CSS+JS. Although you write in Java, it's still important to be familiar with HTML, CSS and JS, since the java is compiled to js.

How best to implement Drag & Drop in MSIE? And what's the oldest MSIE which supports it?

I'm looking to implement drag & drop in MSIE (must be, a bonus for other browsers, but just "nice to have").
I'm looking at a sort of drawing package - let's say flowcharts for example. The user can drag flowchart elements from a palette and position them in the browser. When complete, I will need to know the type and position of each element, probably some other data too.
Can this be done? If so, what's the most powerful technology to do so? HTML 5? Ajax? JS? Something else?
Short version: I would recommend JQuery UI (A javascript framework), this will make your life easier. As for other components, you are free to stack it up from server-side to client-side components depending on your needs and most of the times depending on your preferences.
[update] The long version: Personally, if I would start a useful website with a back-end, I would use Java as my PL of choice since I'm familiar with it, SQL for my persistence, and make it a Web 2.0 site, like what you want to achieve which is a rich internet application (drag and drop, dynamic content, etc). I would normally make use of Java (JSP, Servlets) but use Grails framework (Groovy, GSP, Groovlets), SQL DB (like MySQL, SqlLite, etc), Ajax, HTML, CSS, Javascript (JQuery as my JS framework). Eclipse would be my IDE to program and integrate all of these components.
Some people would prefer to use Python, others PHP, some .NET, Ruby on Rails, etc. Like what I said, it is very subjective. If you already have a field of expertise, then I suggest you stick with it, but if you are starting from scratch, it's basically a choice of the easiest learning curve for you because different Programming Languages can and will satisfy your needs.
For the front-end you have Flash, Applets / JavaFX, Javascript, etc. The problems with Flash, Applets or other embedded media are 1) heavy on resources 2) compatibility, but the clear advantage is that they are more robust because you can do so much more with these technologies in arguably a smaller amount of time. But if you want to use one of these, you have to seriously think about your target audience e.g. for Flash, iPad and iPhones cannot display them at all (except if you installed the unofficial "frash" which supports a bit of flash content).
I believe what you want to do is highly feasible even if you just use Javascript, and again, I will strongly recommend that you use a framework that can readily satisfy your needs (like drag and drop) so that 1) you'd worry less about cross-browser compatibilities, 2) you won't have to reimplement them and 3) fix many unexpected bugs along the way. But this is the general idea if you are developing a software, if the framework or library already exists, use it (just be extra careful with licensing though but this is another topic) :)
disclaimer: rum + coke = awesome
use javascript, that's all you should need to have drag n drop for elements. for example : http://flowchart.com/demo/

Adding Prototip disabled Mootools. How can these two coexist?

Using both libraries will make my life easier. But there seem to be some sort of a problem. Anyone knows the solution to this? Thank you.
I agree with Dimitar, use one framework where you can, it will make life much easier. Mootools has a raft of goodies that you can plug in and get going with. I suggest you have a look at the clientcide site http://www.clientcide.com/ and their download page where you will find Tips.Pointy which will do just what you want.
http://www.clientcide.com/js
So you know Mootools has done alot of work to allow it to run side by side with other frameworks but any plugins written for them have to use these new features for it to all play nice. All of clientcide's code has been re-written to allow it to use these new "play nice" features in Moo.
Enjoy
you can make a non-prototypial library co-exist with mootools or prototype (for example, jquery) but you can't easily get libraries that change / extend the native prototypes to co-exist with each other.
chances are you can get things going if you namespace but any code that you have that depends on the first framework that you load may stop working as expected (prototypes again)
as far as i remember, there were some efforts in the past to get this going - there was a project called SmoothGallery or something.
my advice is - find a tooltip plugin for mootools and drop prototip. forcing two frameworks on your users is a bad practice anyway
good luck :)