Archive

Posts Tagged ‘java script’

jPolite is an Open Source jQuery & Ajax Based Portal Framewor

May 27th, 2009 No comments

jPolite (jQuery POrtal Lite) is an Open Source jQuery & Ajax Based Portal Framework. This is a lightweight front-end web portal framework based on jQuery.

The focus is easy content integration at the front-end, through an intuitive naming system and conventions plus simple and easy configuration.

 

jPolite

jQuery Portal Framework Features

  • Flexible layout configurations
  • Drag & Drop functionality
  • Beautiful UI controls like Tabs, accordion, etc…
  • RSS Reader

Powerful Javascript Accordion Menu Based on MooTools

May 27th, 2009 No comments

BySlideMenu is a Powerful Javascript Accordion Menu baed on well known Javascript framework, MooTools. This Plugin allows you to easily create beautiful sliding accordion menu on any element you want (ul, li, div,…) using images / text.

powerful_javascript

Javascript Accordion Menu Features

  • Works horizontally or vertically
  • Adjust size automatically
  • Menu is expandable by mouseover or by click, as you want
  • Menu can be pinned or not, by mouseover or click, you choose
  • A default index can be defined.
  • Can be used with any elements (ul/li, div, p…)
  • Overflow support
Categories: Programming Tags: , ,

myPatterns: XPath / RegEx for JS Objects

April 24th, 2009 No comments

myPatterns is a new library adding custom notations for data structures in JS (and also C). It’s really useful for writing elegant programs using general pattern matching.

To explain myPatterns, let’s introduce a standard JavaScript object:

PLAIN TEXT

JavaScript

1
  • (

  • 2 name: { firstname: "John", lastname: "Smith" },
    3 children: [
    4 { firstname: "Eric", gender: "male", born: 1991 },
    5 { firstname: "Deborah", gender: "female", born: 1996 }
    6 ]
    7 }

    Using myPattern, you can write a test to check if this object represents a person whose first child is a boy 18 years old:

    PLAIN TEXT

    JavaScript:

    1
  • (s = match(x, "{name:{lastname: %l}, children:[{gender: ‘male’, born: %b} | %x]}"))

  • 2 && new Date().getFullYear() – s.b == 18

    The website explains the pattern above:

    In the above, the match() statement both checks whether the object has a certain form (e.g. that the children field is an array containing a first element of a given form), and returns a "substitution" object s having the following value: {l: "Smith", b: 1991, x: [ {firstname: "Deborah" , born: 1996} ]}.

    Furthermore, using your own notations, you could write the same condition more concisely, and with your own personal touch, for example:

    PLAIN TEXT

    JavaScript:

    1. s = match(x, "<%first ~ %last: [boy(18) | %rest]>")

    In the above, the object is noted in a more concise way, and the age of the first son is directly specified in the pattern, as if it was stored in the object, taking advantage of active patterns to compute the age on the fly.

    Neat!

    Categories: Programming Tags: