Archive for 'Prototype'
An Interview with Sergio Pereira
May 13, 2008 | Filed under: Prototype
Last week, we launched a Prototype Linkedin group, which, as of this writing, has more than 300 members. This was the occasion to get back in touch with a lot of people from the Prototype community, and to launch a project we’ve had in mind for a long time: regular interviews of developers and designers working with …
Lazily load functionality via Unobtrusive Scripts
May 7, 2008 | Filed under: Prototype
David Kees has written about Using Prototype to Load Javascript Files, which is an implementation of the general technique of loading functionality via scripts based on the availability of DOM elements.
He started using the technique to scratch an itch:
The calendar on this site only appears on pages that show blog-related information. That calendar is enhanced with Javascript allowing you …
Eight Weeks of Prototype: Week 6, Writing JavaScript Classes
May 6, 2008 | Filed under: Prototype
While JavaScript is by design an object oriented language, it hasn’t always been the easiest language to create nicely structured code that is easily maintainable. Prototype helps with this by providing a number of useful features for creating classes, such as the ability to extend classes and to easily group all functions together by using functio
Prototype Linkedin Group
May 6, 2008 | Filed under: Prototype
The Prototype community now has its own group on LinkedIn.
It’s a great opportunity to connect with other developers and designers who are using Prototype in their daily work, get to know them better, and put a face next to the names you see daily in the mailing lists or on IRC.
The group’s been up for a little under 24hrs …
Ajax Pioneer Week on Ajaxian
May 5, 2008 | Filed under: Prototype
Dion Almaer just posted on Ajaxian an interview of Prototype creator Sam Stephenson – the first of a series on Ajax pioneers.
Sam talks about the future of Prototype, shares his thoughts on the current state of browsers, and discusses some of the upcoming tools we’re busy working on (PDoc, Sprockets, etc.).
So, without further ado:
<object type=”application/x-shockwave-flash” height=”377″ data=”http://www.vimeo.com/moogaloop.swf?clip_id=970809&server=www.vimeo.com&fullscreen=1&show_title=1&show_byline=0&show_portrait=0&color=00ADEF” width=”500″> …
Duck Punching JavaScript - Metaprogramming with Prototype JS
May 2, 2008 | Filed under: Prototype
Metaprogramming, or the art of modifying a running program, is a hot topic for programmers using scripting languages like Ruby or Groovy. Here’s a quick example of using metaprogramming in JavaScript with the help of Prototype JS to produce behavior similar to Java’s Aspect Oriented Programming (AOP) .
Twistori: Telling a story with Tweets and Script.aculo.us
April 29, 2008 | Filed under: Prototype
Twistori is a fun little site created by Amy Hoy and Thomas Fuchs. As you would expect, design is a key part of the application, and the Prototype / Script.aculo.us combo pull off the work.
The site pulls in live data on various topics (love, hate, think, believe, feel, wish) via the …
Timeframe: Prototype date range component
April 23, 2008 | Filed under: Prototype
Stephen Celis got tired of wiring together two date pickers for the common use case of grabbing a date range, so he created timeframe, which is “Click-draggable. Range-makeable. A better calendar.”
Based on Prototype, you can whip up some code such as:
PLAIN TEXT
JAVASCRIPT:
new Timeframe(’calendars’, {
startfield: ’start’,
…
Eight Weeks of Prototype: Week 4 Event Handling in Prototype
April 21, 2008 | Filed under: Prototype
One of the most useful and important aspects of JavaScript developments is that of event handling. Prototype simplifies this process by providing a number of helpful methods for doing so. In this, the fourth article of “Eight of Weeks of Prototype”, we will look at how Prototype helps with handling events.
ProtoRPG: Role Playing with Prototype
April 21, 2008 | Filed under: Prototype
Sometimes you want Monday to be a Friday, so we have ProtoRPG, a role playing game written by Pierre Chassaing in JavaScript using Prototype and Script.aculo.us.
Walk around, add to your inventory, and feel like you are playing your first RPG many moons ago, on a Friday.
jQuery and Prototype Benchmarks
April 15, 2008 | Filed under: Prototype
Piotr Solnica did a couple of posts on jQuery and Prototype benchmarks back in the day, and John-David Dalton just found them.
In part one, he runs tests such as:
PLAIN TEXT
JAVASCRIPT:
$(’td.first’).addClass(’marked’); // jQuery
$$(’td.first’).each(function(cell){
cell.addClassName(’marked’);
});
// or
$$(’td.first’).invoke(’addClassName’, ‘marked’);
and concludes:
Executed tests show that Prototype seems to be faster then jQuery, with the exception of the new insertion method, which …
Eight Weeks of Prototype
April 14, 2008 | Filed under: Prototype
Eight Weeks of Prototype is a series of articles covering the most important aspects of JavaScript development with the Prototype framework. Prototype is a JavaScript framework used to help developers easily create powerful web applications that work across all modern web browsers.
Eight Weeks of Prototype: Week 3, Prototype Data Types
April 14, 2008 | Filed under: Prototype
In this the third article in the Eight Weeks of Prototype series I will teach you about the different data types that can be used in Prototype on top of the existing JavaScript data types. We will firstly look at the basic string and number types then look at enumerable types such as arrays and hashes.
Eight Weeks of Prototype: Week 1, Beginning with Prototype
April 13, 2008 | Filed under: Prototype
Prototype is a JavaScript framework used to help with development of cross-browser code that is easy to maintain and extend. In this first article of Eight Weeks of Prototype I will teach you the fundamentals of Prototype which you will hopefully find useful for all JavaScript code you write.
NetBeans now includes JavaScript support
April 10, 2008 | Filed under: Prototype
That looks like some nice, smart completion doesn’t it? Tor Norbye has moved from Ruby to get solid JavaScript support in NetBeans.
There are a ton of features, as you can see in his post. You can even do things like setup browser compatibility (saw this first in VisualStudio):
Great to see IDEs getting better and …
qGallery: Prototype gallery application
April 3, 2008 | Filed under: Prototype
Sebastian Brink has developed a nice looking gallery application called qGallery
It is really simple to use you just have to upload your images in full resolution together with a simple xml file and include the script and a simple div into the webpage. Everything else is done automatically. The gallery is creating …
Lightboxes, Modal Windows and Tooltips for Prototype.js
April 1, 2008 | Filed under: Prototype
By default, Control.Modal creates modal windows and lightboxes from any links/anchors elements on your pages. Since it attaches these behaviors to HTML that already has semantic meaning, it will degrade gracefully for browsers that do not support JavaScript, and is search engine friendly.
Recipe for compressed script.aculo.us
March 28, 2008 | Filed under: Prototype
I was searching for a compressed version of script.aculo.us javascript library in one file.
Where is Firefox on Acid 3? Here.
March 27, 2008 | Filed under: Prototype
Some people have been surprised to not hear much from Mozilla around Acid 3. WebKit and Opera are duking it out, but what about Firefox?
Mike Shaver of Mozilla has posted on his views that Acid 3 is a missed opportunity and is pretty damning of the whole thing:
Ian’s Acid 3, unlike its predecessors, is not about establishing a baseline …
lightboxXL:Publique Imagenes y Videos en su Web
March 18, 2008 | Filed under: Prototype
LightboxXL es un programa en escrito en javaScript que le permite integrar im�genes y videos en su pagina Web. Usted necesita la biblioteca prototype.js para poder utilizar lightboxXL. Este programa es f�cil de utilizar y sin los visitantes de su pagina Web quedaran impresionados.dise�o de paginas internet, imagenes, Javascript, web design.
Subclassing and the prototype chain
March 18, 2008 | Filed under: Prototype
Are you sure you should be subclassing that? is the question that Neil Roberts asks.
He goes on to solve a problem: you just want to change ONE property in this class, but you can’t change it on the actual class because that value would now be used across all instances of that class. So in order to make it …
ProtoSafe Eases Compatibility for Prototype
March 17, 2008 | Filed under: Prototype
With so many new components being developed in a variety of different of JavaScript libraries, it’s a natural expectation that sooner or later, you’re going to want to mix and match these components within your application. Sometimes though, it’s not that easy due to architectural conflicts between different libraries. John David Dalton set out …
Javascript Coverflow Effect!
March 15, 2008 | Filed under: Prototype
ProtoFlow is a coverflow effect written in Javascript. It uses Prototype and Scriptaculous to do bulk of the work and it uses Reflection.js to do all the image reflections stuff!
Prototype + Scriptaculous Window class
March 12, 2008 | Filed under: Prototype
This javascript class allows you to add window in a HTML page.
ProtoFlow: Coverflow for Prototype
March 11, 2008 | Filed under: Prototype
Obaid Ahmed has written a coverflow-like component on top of Prototype and Script.aculo.us called ProtoFlow.
It is simple to use:
PLAIN TEXT
HTML:
<div id=”protoflow”>
<img src=”imgs/DSCN0940_91360.jpg”/>
<img src=”imgs/stimme_von_oben_187192.jpg”/>
<img src=”imgs/Tropfen_1_Kopie_201721.jpg”/>
<img src=”imgs/farbraum_012_147508.jpg”/>
<img src=”imgs/IMG_4906_199357.jpg”/>
<img …
Mozilla Prism update makes it easy to create wrappers
March 10, 2008 | Filed under: Prototype
Mozilla Prism has just released a new version that shows off Firefox integration:
Today we’re releasing a major update to Prism that includes new desktop integration capabilities and simpler installation. With this update, you can now get Prism simply by installing a small extension to Firefox 3. With the new Prism extension for Firefox 3, …
Include: Pack your JavaScript with ease
February 27, 2008 | Filed under: Prototype
Brian Moschel just told us about Include:
It determines which files to compress at runtime and automatically compresses them into one script using Dean Edwards’ Packer.
You can include any JavaScript from any other JavaScript with a relative path:
PLAIN TEXT
JAVASCRIPT:
include(’myscript.js’);
Then turn on compression like this:
PLAIN TEXT
JAVASCRIPT:
include.setup({env: ‘compress’});
include(’javascripts/prototype’, ‘javascripts/myapplication’);
When you reload the page, a …
Lightview 2: Not just images, now on Prototype.Latest
February 19, 2008 | Filed under: Prototype
Nick Stakenburg has released Lightview 2, an update of his lightbox-esque library:
With the first released of Lightview I aimed to make overlaying images as elegant as possible, rethinking what we know as Lightbox. With Lightview 2.0 I’m going a step further, doing the same for
video (Quicktime), swf, Ajax, iframe and inline content.
You can do most of what you …
Self Printing JavaScript Literals
February 18, 2008 | Filed under: Prototype
Are you ever sick of seeing Object get printed out when you try to output a variable to your console.
Oliver Steele talks about Self Printing JavaScript Literals where you can clean that up with a toString:
PLAIN TEXT
JAVASCRIPT:
function makeLiteral(name) {return {toString:function(){return name}}}
var L1 = makeLiteral(”L1″);
var L2 = makeLiteral(”L2″);
L1
//>>> L1
L2
//>>> L2
Kangax takes …
Facebook Style Input Box
February 15, 2008 | Filed under: Prototype
If you used Facebook on a regularly basis, you’ve probably come across their cool autocomplete method of adding multiple recipients to messages. For those that haven’t seen it, here’s a pic:
Guillermo Rauch set out to build something similar and he did a very good job of mimicking this behavior using MooTools v1.2:
While working …
Prototype Deprecation.js: 1.5 to 1.6 made easier
February 13, 2008 | Filed under: Prototype
Tobie Langel has developed a deprecation script to help you move from Prototype 1.5 to 1.6:
When your code calls a method that’s been deprecated, replaced, or modified, the script will log a warning or error to your Firebug console. Clicking its hyperlink will take you to the deprecation script itself, which isn’t all that …
Crazy way to change third party scripts
February 13, 2008 | Filed under: Prototype
Paul Irish posted a crazy method for tweaking third party scripts. His problem was that he was using MultiMap (online Mapping API) and wanted to internationalize the information, but it was hard coded in the JavaScript.
To get around the problem he does this:
PLAIN TEXT
JAVASCRIPT:
// WARNING!! This is such a massive hack. Oh-so-hackalicious
// Problem: Multimap …
Deprecation.js: easing the 1.5 → 1.6 transition
February 12, 2008 | Filed under: Prototype
If you’ve put off the task of upgrading your old code to Prototype 1.6, now you’re out of excuses. Core team member Tobie Langel has developed a script that will warn you of any deprecations or API changes.
The script is meant to be used with Firebug, so it’s Firefox-only — but when you’re done, your code will be ready for …
The parseInt gotcha
February 12, 2008 | Filed under: Prototype
Guyon Morée has posted the old chesnut parseInt gotcha, so I thought I should put it up here as a quick tip:
I was working on some stuff in javascript which involved some date/string parsing when one morning it failed. “That’s weird, yesterday it worked fine!”
After some debugging with FireBug I found parseInt() was failing on me.
It was the …
Namespaced made easy with Prototype
February 4, 2008 | Filed under: Prototype
kangax keeps up his “Prototype by example”-ness by showing a use of Enumerable#inject.
He shows us namespacing made easy:
PLAIN TEXT
JAVASCRIPT:
String.prototype.namespace = function(separator) {
this.split(separator || ‘.’).inject(window, function(parent, child) {
return parent[child] = { };
});
}
And then you can use it via:
PLAIN TEXT
JAVASCRIPT:
// Default separator is ‘.’
‘foo.bar.baz.quux’.namespace();
foo.bar.baz.quux …
Base Page con jquery, script.aculo.us, motools, etc.
February 1, 2008 | Filed under: Prototype
Un requisito para tener una excelente web 2.0 es el framework javascript que uno elije, mi favorito es jquery, pero también hay otros igual de buenos como script.aculo.us, mootols. Agregarlos a todas las páginas del sitio aun cuando no se usan en todas es un mal uso de los recursos y de performance.
Prototype and script.aculo.us: the bungee book reviewed
January 30, 2008 | Filed under: Prototype
Thanks to Ruby on Rails these are two of the best known JavaScript libraries of the last few years, Prototype core developer Christophe Porteneuve takes the reader through how to do all those “Web 2.0″ effects we’re probably already getting sick of.
Prototype: new cheat sheet and in place editor
January 29, 2008 | Filed under: Prototype
The maintainer of scripteka, the Prototype extensions library, has produced a new cheat sheet for the recent 1.6.0.2 release.
He also has his own widgets such as Proto.IPS an unobtrusive in-place-select widget that mimics the Gmail chat ability to drop down and select, or type in your own new content.
Prototype 1.6.0.2 Cheat Sheet
January 28, 2008 | Filed under: Prototype
Loyal Prototype user (and Scripteka maintainer) kangax has released a Prototype cheat sheet in coordination with our recent 1.6.0.2 release.
If in the past you’ve relied on Jonathan Snook’s cheat sheets for previous versions of Prototype, now …
script.aculo.us javascript effects for n00bs
January 27, 2008 | Filed under: Prototype
learn how to create sweet javascript effects. this is very basic - if you know anything about html you can do this. im going to break it down for ya’ll real slow like.
Prototype 1.6.0.2 security and performance improvements
January 25, 2008 | Filed under: Prototype
Sam and the team have released Prototype 1.6.0.2 (and 1.5.1.2):
Prototype 1.6.0.2 is a backwards-compatible, drop-in replacement recommended for all 1.6.0 users. We’ve fixed 28 bugs and made over a dozen improvements to the code base, including performance improvements for CSS selectors in Safari 3 and for the Element#up/#down/#next/#previous and Event#findElement methods in all browsers. We’re also now …
Prototype 1.6.0.2: Bug fixes, performance improvements, and security
January 25, 2008 | Filed under: Prototype
Today we’re releasing Prototype 1.6.0.2 to address several compatibility and performance issues and to protect against a potential security issue for developers using Prototype outside of a web browser environment.
Prototype 1.6.0.2 is a backwards-compatible, drop-in replacement recommended for all 1.6.0 users. We’ve fixed 28 bugs and made over a dozen improvements to the code base, including performance improvements …
Sexy JavaScript?
January 25, 2008 | Filed under: Prototype
How can you not post something called Sexy JavaScript?
PLAIN TEXT
JAVASCRIPT:
// Sexy JavaScript
// runs assertNotNull(iframeElement) in IE, otherwise assertNull(iframeElement)
// taken from test code for http://yura.thinkweb2.com/scripting/contextMenu/
testShimExists: function() { with(this) {
this[Prototype.Browser.IE ? ‘assertNotNull’ : ‘assertNull’](iframeElement);
}},
21 Must-Have Scripts For jQuery / MooTools / Prototype
January 23, 2008 | Filed under: Prototype
A personal collection of the best scripts/hacks for three of the top Javascript libraries. Enjoy.
JavaScript String Functions
January 19, 2008 | Filed under: Prototype
Augmenting the String.prototype that provides with most needed and missing functionality: word capitalization, stripping characters (alpha, numbers, etc…), stripping tags (script, or all html tags), and trimming white spaces.
trim a string from white space by JavaScript function
January 18, 2008 | Filed under: Prototype
Some times we need to trim a string from white space at the front and end,even all in the string.How can we do that elegantly?Add the following string prototype function to your code. You will call it like predefined String member functions like Substring(),charAt() and indexOf().The code below shows the function declaration and how to use it.
Amaltas SVG Drawing Tool
January 18, 2008 | Filed under: Prototype
Amaltas Bohra has created a drawing/editing tool that allows you to create simple shapes and pictures.
The application uses SVG to do its work, and Prototype to handle the Ajaxyness.
A novice’s intro to Prototype and Javascript Libraries
January 16, 2008 | Filed under: Prototype
A good breif intro into prototype from a novice who’s learnt themselves.
Acid 3 and the future of memory leaks
January 14, 2008 | Filed under: Prototype
John Resig has a couple of interesting posts on Acid 3 and memory leaks.
Firstly, with Acid 3 hopefully around the corner (but not yet ready!), John takes a look at the JavaScript side of the equation:
Array Elisions - Making sure that stuff like [,,] doesn’t have a length and [0,,1] has a length of 3.
Array Methods - Doing …
Drinking offline at the Happy Hour while being openly social
January 11, 2008 | Filed under: Prototype
Over in Gears land I met with Chandra Patni, the creator of happyhour:
Open Social Happy Hour is a port of Open Social Container Sample that employs Google Gears for persistence. It allows data coherency of open social widgets across browser windows.
As I said on the Gears blog:
The motivation for the project was speeding up the development cycle of …

