Archive for the 'JavaScript' Category

How to Drag Out Files Like Gmail

Ryan Seddon, aka the CSS Ninja, has a nice blog post up where he reverse engineers the new feature in Gmail where you can drag attachments from an email on to your desktop.

Note that the feature only currently works in Chrome.
Ryan begins with the following code:
PLAIN TEXT
JAVASCRIPT:

var file = document.getElementById(”dragout”);
file.addEventListener(”dragstart”,function(evt){
  evt.dataTransfer.setData(”DownloadURL”,fileDetails);
},false);
 

Describing the code Ryan says:
From [...]

An Implausibly Illustrated Introduction to HTML5 Web Workers

Been hearing about HTML5 Web Workers but can’t wrap your brain around them? Mark Pilgrim is here to help with an (implausibly) illustrated tongue-in-cheek guide. A small visual snippet:

Yet another snippet:

[Disclosure: Mark Pilgrim owes me money; just kidding]

How to Become a JavaScript Bad… Shut Yo Mouth!

[Image CC-A by Terry Johnston]
A fun post for a Tuesday morning, Aaron Newton shares his path to becoming a JavaScript ninja, and how you can too. Some of his tips (I encourage you to read the whole article):

Study design and designers. I’m not saying you have to have the talent to be an awesome graphic [...]

What Can You Build in 1k of JS?

Here’s a fun way to end the week. Peter van der Zee has cranked up a cool contest where you’ll be judged on what you can build using just 1k of JavaScript. The rules are simple:

Create a fancy pancy Javascript demo
Submissions may be up to 1k. (And not crash)
Externals are strictly forbidden, unlike “some” contests. [...]

Canto.js: An Improved Canvas API

Javascript author extraordinaire David Flanagan released Canto.js recently, a lightweight wrapper API for canvas, introduced here and documented at the top of the source code. Example:
PLAIN TEXT
JAVASCRIPT:

canto(”canvas_id”).moveTo(100,100).lineTo(200,200,100,200).closePath().stroke();
 

Notice three things:

canto() returns an abstraction of the canvas - a “Canto” object.

As with jQuery and similar libraries, there’s method chaining; each method called on a Canto [...]

Improving client-side development in Visual Studio

For several years now, I have been consistently impressed with how Microsoft’s developer division gathers feedback and proactively responds. Nearly every time that I’ve participated in a survey or otherwise provided feedback (solicited or not), someone has followed up with me about my specific concerns. In my experience with how other large companies gather feedback, [...]


You’ve been reading Improving client-side development in Visual Studio, originally posted at Encosia. I hope you enjoyed it, and thanks for reading.

Related posts:

  1. Using an iPhone with the Visual Studio development server
  2. Automatically minify and combine JavaScript in Visual Studio
  3. Use jQuery and ASP.NET AJAX to build a client side Repeater

YUI 3.2.0 preview release 1 – touch events support, transitions and browser-specific loading

Over at the the YUI blog the team just announced the preview release of YUI 3.2.0. YUI3 now has some interesting new features that the team wants you to try and tell them if they work out for you. The changes to the already very powerful library are quite ambitious:

Touch event support for mobile interfaces [...]

Looking at JS emulator core for GameBoy

JavaScript as a general-purpose “Turing-complete language” is illustrated – the example discussed in the first part of a series:  How a CPU can be emulated through JS, and how one might start building an emulation core for the GameBoy console. Looking forward:  How a game image can be loaded into the emulator over the Web. [...]

Synthetic Event Library Syn Aims to Make Testing Easier

The team at Jupiter IT have release Syn, a library which allows you to create synthetic events for use in testing. This standalone library is meant to assist in testing complex UI behavior by simulating user actions such as typing, clicking, dragging the mouse.
Testing rich, dynamic web applications sucks. At Jupiter, we’ve tried almost every [...]

An alternative way to addEventListener

I can’t believe none of us knew DOM2
This is how a tweet from @SubtleGradient, re-tweeted by @jdalton, has been able to steal my rest tonight … and this post is the consequence …
What’s new in a nutshell
There is a W3C Recommendation about addEventListener behavior, which clearly specify the second argument as an EventListener.
The new part [...]