How to begin working with GwtQuery? - javascript

I've dived into the GWT world a couple of months ago and find it quite interesting.
I'm currently developing a web application which is to be used internally and so we need to resize the browser window, which can only be done by JSNI. After hitting some problems
regarding the JSNI I was advised to look into jquery and I found that it's counterpart in GWT is GwtQuery. I've tried looking on the project page and googling for tutorials but I can't seem to find a clear beginners tutorial on how to use GwtQuery on GWT but I keep find references to how it's very similar to jquery.
I think it's important to state that I'm not a js developer but rather a java developer who likes the idea of GWT and I just need to use GWTQuery in a very small part of my application.
Thanks in advance for any leads or links.
Ittai

GwtQuery also goes by the name GQuery, so maybe you find more if you search for that.
At Google I/O 2009 the creator of GQuery gave a speech about GQuery, you can find the video and slides here, maybe it helps.

Here you have a presentation I gave about gquery.
The getting started guide in the project site could be useful as well.
The gquery mailing list is a good place to ask questions to developers and users.

Here I found good article with small and simple examples:
GWTQuery – jQuery in GWT

Related

Where can I find more docs about looking glass of gnome-shell?

Based on the intrduction at gnome.org , looking glass is really appealing(to me who wants to learn to comstomize my desktop by learning coding)
http://live.gnome.org/GnomeShell/LookingGlass
But as I searched, not much documetations about looking glass were found.. So where can I learn more about this. Or do I need to learn enough about Gjs to understand the looking glass?
You need to know some JavaScript (Gjs), and get familiar with the API you would like to use ( via instrospection). You can check the Gjs wiki page for links.
One way to learn by example is checking the code written for extending GNOME Shell (check extensions.gnome.org.
UPDATE: The documentation is being updated, and you can find demos with explanations in the beginners section. Consider that some are more complete than others because it is a work in progress.

how to make own custom widgets like facebook social plugins?

How do I make my own widget just like facebook? https://developers.facebook.com/docs/guides/web/#plugins
Basically it's a bit of javascript, css and html code, but how to do it?
Any example, tutorials?
I highly recommend Third Party Javascript (Manning) from the guys at Disqus for a great overview of everything. While it won't give you a magic bullet solution for your SDK/widget-making, it will help you bullet-proof things as you go. It's a great reference, if short/concise and the code is definitely not for JavaScript beginners.
As to how Facebook does it, while it's not fully descriptive of their iframe/widget approach, it shows how they do bullet-proof embedding in non-standard webpages: http://calendar.perfplanet.com/2011/the-art-and-craft-of-the-async-snippet/
For extra bonus points, combine that with http://www.phpied.com/non-onload-blocking-async-js/ and it should get rid of the loading spinner in all but iOS 6 if memory serves me well.
For even more advanced iframe fun, see https://github.com/benvinegar/seamless-talk and any other slides/posts at http://benv.ca/. (I think I'd like to meet Ben one day, given how much of his stuff I've been borrowing from lately, and he's a fellow Canadian to boot.)
Note that seamless iframes, as a native browser concept, are webkit-only and buggy at that: https://bugs.webkit.org/show_bug.cgi?id=99289 (On Firefox, dev. is stopped due to an 11-year old bug? https://bugzilla.mozilla.org/show_bug.cgi?id=631218) So for the foreseeable future, iframe customization will require JavaScript. :)
Look here for a tutorial on how to build your own widget using JSONP:
http://alexmarandon.com/articles/web_widget_jquery/
and here on how to make it secure:
http://wordpress.tv/2011/08/31/mike-adams-developing-secure-widgets-secure-iframe-communication-in-a-pre-postmessage-world/
You can do this with the Facebook Javascript SDK (see https://developers.facebook.com/docs/reference/javascript/). You need to understand the Graph API (see https://developers.facebook.com/docs/reference/api/) which you can query from the Javascript SDK. Throughout Facebook's documentation there's tonnes of example code. Have fun!

SharePoint Client JavaScript Documentation

I'm attempting to improve the usability of a client's SharePoint deployment via JQuery; and am hitting a brick wall when trying to find any sort of documentation of what's happening in core.js (aside from painfully digging through and trying to parse any sort of meaning out of it --all 250kb of it!!!!--) Anyone have any pointers, or documentation?
EDIT:
Sorry, to clarify my question, i'm familiar with using JQuery with SharePoint. My question involves hooking JQuery into SharePoint's own client API. My question is inspired by this post http://www.codefornuts.com/2009/09/forcing-sharepoint-into-asynchronous.html# ; where the author is overriding methods such as "SubmitFormPost" and "STSNavigate" in order to make the UI interaction more "AJAXy".
There's no documentation for core.js and it's really a black box. Any "messing" with it would make your installation unsupported. Because of its complexity and how important it is to SharePoint working correctly, I would be very careful before adding this sort of functionality. This is not a comment on your development ability, but IMHO there would need to be a serious business case along the lines of "we don't care if things break occasionally so things look cooler".
If you really want to continue this I think your best bet is to contact Einar! His is the only post I've ever seen that describes how to do AJAXify core.js.
I'm not entirely sure what you are trying to do, but you may want to take a look at Jan Tielen's work with jQuery and SharePoint. He has some interesting posts about calling the SharePoint web services with jQuery/Ajax to build much richer UIs. These are hosted within a SharePoint web part page using a Content Editor Web Part. I've used these techniques in a couple of applications with great results.
Check out this post for an example.

Introductory JavaScript programming task for an expert developer

What would be a good mini-project to get intimate with JavaScript, as an advanced 'introduction' to the language? I want to actually code an application in JS, not hook up bits of it to enhance a web application.
A lot of stuff you could learn by doing an RSS reader on a page. Google shows what can be done. The whole lection concentrates on javascript, network access, security restrictions and medium data mangeling.
If you have the ability to do any sort of backend programming than AJAX is really neat to do. You can get a lot of good effects with less efforts. A good thing to build on up.
I would argue that if you're really an advanced programmer then the exercises above would not really give you any insight into the language as they are just variations on things you probably have already done. Javascript's strongest suit is it's LISP style ability to grow. Write something AI(ish) that creates new functions. Most people don't utilize the language in this way, but, its ability to augment its own classes on the fly is, I would argue, it's most unusual and most powerful feature.
Although not a project, watch the Douglas Crockford videos at YUI theater.
The biggest web based Javascript projects are going to deal with the DOM. Do some nifty stuff with JQuery. Make a table with rows that highlight when you hover. Make them update themselves through AJAX and JSON when you click on them.
If you're really looking for something magical and usefull write a scrollable table with fixed headers and footers for IE8.
If you want to stay away from the WEB use the JDK 1.6 and run Javascript code in that. You could do TONS with that.
Whenever I'm trying to get familiar with a language, I will work on Project Euler problems with it.
I would implement a simple game like sokoban first.
The second application would be an AJAX-based multiuser chat application, first fetching other people's responses by polling, later with AJAX push.
Interesting question.
Really you could do any sort of application. In order to make sure you're using the latest and greatest stuff, I'd try making a simple CRUD style application using DHTML and AJAX. Perhaps a contacts list or calendar. If you're feeling really energetic, you could write the back-end in JavaScript as well.
Unless you want to get really friendly with the DOM and browser compatibility, I'd learn Javascript through the mask of one of the nice frameworks like Jquery or Prototype.
The Holy Grail - a WYSIWYG editor. They wouldn't need to complete it, but just seeing their plan of attack would be interesting. Plays right into patterns and OO.
I suggest you create a Google Gadget. You can create one for free and perhaps make something useful out of it. If you don't have a Google account, sign up for one. Then add the Google Gadget Editor to begin writing your code.
With the gadget, you'll be able to mess with JavaScript, JSON, CSS, etc. Furthermore, you'll be able to store the file on Google's server so you can work on it from any computer.
I created a simple RSS reader and wrote JavaScript to get the feed (using Google's API) then dealing with that JavaScript object because it came back as JSON. I then developed some JavaScript to hide/show div tags.
It was a good starter project for me to learn JavaScript.
Get JavaScript the Good Parts by Douglas Crockford. Also check out his web site: http://www.crockford.com
Key reason: just because JavaScript looks like C/C++/Java/C# doesn't mean it actually is like them. Things are significantly different. I suggest reading his book to get a grasp of those differences.
Otherwise, I would look at the JQuery web site. JavaScript is cool and all, but a good framework will save you from a lot of the pitfalls and make you much more productive faster.
try making an advanced AJAX application like for example try to recreate the google calander.
How about a firefox plugin to monitor StackOverflow? It could use RSS to monitor feeds and let you know when new questions are asked with your tags.
It could also be grown as your js skills progress.
Write yet another javascript framework, but focused specially in something, ie game programming.

How to convince my fellow .NET developers that learning jQuery will be beneficial

I have a few .NET developers who only want to use the MS AJAX Toolkit and think JavaScript (and any JS Library) is evil. I tried to explain that if you treat client-side development like a grown-up language you can build maintainable code ... but I assume that the classic ASP days have left a mark on these guys. Anyone have a suggestion to help convince this type of developer that learning jQuery will actually benefit them in the long run as the industry is trending back to "lets get close to the metal again" w/ MVC for example?
Tell them microsoft endorses jquery and that it's shipping with MVC
If they don't realize that jQuery is the bee's knees - they're living under a rock - tell them about all of the people that are using jQuery (Google, Dell, MLB, Bank of America.....the rest of a good list is in the middle of the jQuery home page) - or just tell them that every time they go to their Netflix account they are using jQuery or if they visit the president's web site (which could backfire I guess.... ;)
Emphasize that learning a 'technology' that is becoming that ubiquitous can only help your career.
Point them to this article by Scott Guthrie.
Quick quote from the article explains all:
I'm excited today to announce that
Microsoft will be shipping jQuery with
Visual Studio going forward. We will
distribute the jQuery JavaScript
library as-is, and will not be forking
or changing the source from the main
jQuery branch. The files will
continue to use and ship under the
existing jQuery MIT license.
Ask if they like server-round-trips. (To make them understand that client-side-stuff is necessary.)
Ask if they want to write code that works in 3 different places at the same time? (To make them understand the need for a library that almost erases browser differences.)
Show them a list of who's using jQuery.
If they fancy elegant code, they will get what you're saying. Otherwise I think they'll be really hard to convince.
Implement something that has value for your organisation/clients using jQuery to prove that it works well in your context - even better if it's something that would be difficult to implement, more complex or take longer in the MS AJAX Toolkit.
Developers often find practical examples of running code in a context that applies to them more persuasive than general endorsements or lists of who else is using it (every practical technology can come up with a good list of users).
And if your developers don't like JavaScript, perhaps you should ask them what they think the AJAX Toolkit is running on the client side. The AJAX Toolkit is a JavaScript library on the client side - just one that's designed to be easily integrated into ASP.NET.
Getting up to speed on the dominant tool in a given area is always a good idea. JQuery is the dominant JS library. For some anecdotal evidence, take a look at the tags here on StackOverflow:
JQuery: 1809 items
asp.net-ajax: 272 items
ajaxtoolkit: 54 items
Tell them they can do more with less - and understanding jQuery/javascript will help them understand AJAX.NET even more. It's a big huge leaky abstraction in my books - since switching to jQuery it made web programming more fun and I could build way cooler apps.

Categories