David Janes' Code Weblog

November 9, 2008

Adding MapField to inputEx

demo,genx,html / javascript,ideas,inputex,maps · David Janes · 7:20 am ·

InputEx is a neat Javascript library by Eric Abouaf and other contributors to dynamically create forms. It’s best shown by example, so:

I’m working on a project called GenX that allows people to dynamically lookup, edit and create data in editors (such as in WordPress). One of the features I want is the ability to add maps so after a week of research, I’ve created a MapField for inputEx:

Notes

  • this is just a preliminary version; there’s probably some code style and idiom issues that need to be worked out
  • I’m going to ask the InputEx group to pick this up; I reserve no rights
  • it’s not fully integrated into the Builder example yet
  • it works with Google Maps, Yahoo Maps and Microsoft’s Virtual Earth. You will need a key for your domain for Google Maps, see the example above about how to insert your key
  • it introduces a concept of a Globals for MapField, as there are certain settings (i.e. your mapping keys) that really belong at “class” level rather than instantiated object level
  • Mapping APIs are dynamically loaded
  • Zoom levels are returned in native format and “universal format
  • I’ve done all my testing of FF3, so there may be browser issues I need to look at

Code changes

  • the only files needed are
    • examples/map_field.html
    • js/fields/MapField.js

Where this is going

  • I’ve spent the last week working on maps; I need to get back to using this code rather than improving and documenting it
  • I want to add a geocoder
  • I want the geocoder to be able to be sensitive to other form fields, so for example if you’re entering an address it can actually use those as an input

One final mod to inputEx

I’ve modified the builder to make the pencil icon more obviously become the close button when you’ve opened a subpanel. You can see the demo here. Here’s the change set:

In images:

curl --location http://www.famfamfam.com/lab/icons/silk/icons/pencil_delete.png \
 > pencil_delete.png

In inputex/inputExBuilder/css/inputExBuilder.css add:

div.inputEx-TypeField-EditButton.opened {
   background-image: url(../../images/pencil_delete.png);
}

In inputex/js/fields/TypeField.js replace onTogglePropertiesPanel with:

   onTogglePropertiesPanel: function() {
      if (this.propertyPanel.style.display == 'none') {
         this.propertyPanel.style.display = '';
         YAHOO.util.Dom.addClass(this.button, "opened");
      } else {
         this.propertyPanel.style.display = 'none';
         YAHOO.util.Dom.removeClass(this.button, "opened");
      }
   },

October 30, 2008

GenX – first public demonstration

genx,ideas,pyecs · David Janes · 2:37 pm ·

This is a post using my next project, called GenX which I’ll be describing in the next few weeks. Here’s a some information about a band called U2. I just bought a reissued CD/DVD combo of Under a Blood Red Sky, so it seems appropriate. (Note: post updated)

poster

U2

U2 are a rock band from Dublin, Ireland. The band consists of Paul David Hewson (vocals and guitar), The Edge (guitar, keyboards, and vocals), Adam Clayton (bass guitar) and Larry Mullen, Jr. (drums and percussion)….

poster

Paul David Hewson

Paul David Hewson (born 10 May 1960 in Glasnevin, Dublin, Ireland), also known by his stage name Bono, is the main vocalist of the Irish rock band U2. Bono was born and raised in Dublin, Ireland, and attended…

poster

The Edge

David Howell Evans (born 8 August 1961 in Barking, East London, UK), more widely known by his moniker The Edge, is a musician known best as the guitarist, keyboardist, and main backing vocalist for the…

poster

Adam Clayton

Adam Charles Clayton (born 13 March 1960 in Chinnor, Oxfordshire, UK), is the bassist of the rock band U2. A British citizen, Clayton has resided in County Dublin since the time his family moved to Malahide…

poster

Larry Mullen, Jr.

Lawrence Joseph “Larry” Mullen, Jr. (born 31 October 1961 in Artane, Dublin, Ireland) is the drummer for the Irish rock band U2. He is the founder of U2, which was originally known as “The Larry Mullen…

poster

Under a Blood Red Sky – Deluxe Edition CD/DVDU2 [2008-07-10]

A Deluxe Edition version featuring the Under a Blood Red Sky CD (Disc 1) and the Live at Red Rocks DVD (Disc 2). The remastered Under a Blood Red Sky album was originally released in November 1983, and consists of live recordings from three shows on the band’s War Tour through Europe and America. Recorded at the Red Rocks Amphitheatre in Colorado on 5th June 1983, Live at Red Rocks will be available for the first time on DVD, and will include 5 previously unreleased songs, a director’s commentary, digitally re-graded pictures and a 5.1 mix. This is the fourth CD as part of the Amazon.com-exclusive U2 deluxe edition box set and fits into the open slot within the packaging.

Powered by WordPress

Switch to our mobile site