Web Info & Tutorials

January 9th, 2007

CUSTOM DOM ATTRIBUTES VS. CLASS CSS STYLES

Pete Forde isn't a huge fan of the practical but not pure use of class="noncssmarker" and has written about Attributes > Classes: Custom DOM Attributes for Fun and Profit.

In this article Pete discusses the high level value of attributes, but then goes a lot further and he patches Prototype to make it just as easy to work with as CSS classes:

JAVASCRIPT:
  1.  
  2. function $P(property) {
  3.   return document.getElementsByAttribute(property).pluck(property);
  4. }
  5.  
  6. $P('subtotal') # => ["13488","9534"]
  7. $P('subtotal').sum() # => 23022
  8.  

How does this work?

Custom attributes work in all browsers that support XHTML. You do not have to define a custom DTD or sacrifice any children to use them.

We do have to make some changes to the way Prototype works, though. With the addition of a few functions to our application.js, we suddenly have the same flexibility that we had with Element.classNames.

Of course, if you go this route expect XML nazi's to moan about validation.

January 9th, 2007

PASSPACK AND ASSL

Francesco Sullo's day job is to work on PassPack an online password manager.

PassPack is based on the Host-Proof Hosting Ajax Pattern.

How it works

PassPack uses a double access technique: User ID and Pass give a user access to her Account, while the Packing Key is needed to access the actual passwords. The "Pack" in PassPack comes from the bundle of locked up passwords inside the Account. PassPack checks the User ID and Pass at sign-in without exposing the passwords in the encrypted Pack.

Only the user can encrypt and decrypt the passwords in the browser with her Packing Key. The Packing Key never travels over the Internet. The encrypted Pack gets sent over SSL to the server for storage.

PassPack

aSSL

Francesco works on aSSL in his spare time, and just released another new version with Javascript/ASP server-side component (PHP and others pending).

aSSL now works with the following process:

  • The browser calls the server to start the process.
  • The server returns its RSA modulus (e.g. the public key) and the public exponent (3 or 10001).
  • The browser generates a random exchange 128-bit key, encrypts it using the server public key and passes the encrypted exchange key to the server.
  • The server receives this encrypted 128-bit exchange key, decrypts it with its private key and, if the result is ok, returns the session duration time.
  • The browser receives the session duration time and sets a timeout to maintain alive the connection.

All subsequent client-server exchanges via aSSL are encrypted and decrypted using the AES Rijndael algorithm.

aSSL 1.2 uses Tom Wu's BigIntegers and RSA in JavaScript to negotiate the secret 128-bit key and Chriss Veness's AES Javascript implementation for the next exchanges.

January 9th, 2007

LEAFLETTER: BUILDING MINI EMBEDABLE APPS

Leafletter is a newborn assist that enables users to create picture scheme sites (”Leaflets”) and embed them into ethnic networks, blogs, and another scheme sites.

A Leaflet is a picture Flash® supported scheme place that crapper be displayed anywhere HTML is welcome. For instance, a Leaflet could be diffuse to the About Me country of a MySpace Profile, the embody of a Blog Entry, and in the Portfolio country of a photographer’s Personal Website, every simultaneously.

Leafletter is intermeshed toward professed noesis creators - fictive artists, media professionals, online sellers - users who essay broader danger for their content, who belike already hit a scheme place and/or online portfolio, and who poverty to begin display their content, in a limited way, on ethnic networks and blogs.

Leafletter is unequalled in that it gives the individual rank curb over how his media is ordered out, rhetorical and displayed. It is created using an illogical application supported (WYSIWYG) organisation tool, and features much adjuvant tools as Real Time Layout Changing, whereby a complete tender crapper be viewed in 36 assorted configurations, Build By Blocks, whereby a individual requirement exclusive modify in Blocks to create a tender within a Leaflet, and uncreased Flickr combining for users desire to deal photos and reassert curb of their presentation.

Once a Leaflet has been created it crapper be diffuse using the old impact of Copying and Pasting an Embed Code or address to some positioning where HTML is accepted.

Take a countenance at the demo to wager the antiquity of a leaflet, country by block.

Leadletter