Welcome to jsbeans
JavaScript Beans collection Library
What
jsbeans
IS:
- It's a collection of (almost) indipendent JavaScript Objects
- Every object, aka
jsbean
, tries to provide uncommon functionalities
- A helper for web developers
What
jsbeans
IS NOT:
- A substitute for other javascript frameworks
- A general purpose framework (e.g. it does not provide a
document.getElementById
alias)
- A nightmare for dependencies
As a choice of design every jsbean
is a standalone JavaScript Object, what's why you don't have to worry about dependencies.
UI (User Interface) widgets are designed to be used without complex HTML or CSS knowledge providing, where possible, a
code-only approach, as much as similar to
eclipse's SWT coding.
- 20160520:
-
jsbeans.version
and jsbeans.build
removed as unuseful.
-
jsbeans.Validator.manageErrors
improved.
-
New methods introduced:
jsbeans.Object.isDefined
(with alias isDef
), jsbeans.Object.isDefinedOrNull
(with alias isDefOrNull
)
- 20151221:
-
Custom html attribute
templatePath
in jsbeans.mvc
has been changed to data-templatePath
following the HTML5 specifications.
- 20151130:
-
Fix on new code for
min
and max
handling in jsbeans.Validator.assertDate
(release 20150821).
- 20151015:
-
jsbeans.Validator.assertRequiredByName
introduced in base validation script to validate group of inputs (e.g. radios) by their name
attribute.
-
jsbeans.Validator.charCount.getCount
and jsbeans.Validator.wordCount.getCount
now return 0
(zero) by default instead of -1
.
-
Fix on
jsbeans.Validator.iban_it
in strict mode to avoid infinite loop
- 20150914:
-
jsbeans.Validator.charCount
introduced to count characters in inputs.
- 20150821:
-
Added new feature to
jsbeans.Validator.assertDate
: now min
and max
options can accept function's name to check against a particular date.
Custom functions have to return a Date object or milliseconds.
-
jsbeans.Request.getHashParameter
introduced to parse hashes as query strings.
- 20150612:
-
New validation extension woth
jsbeans.Validator.length
to validate input's lengths (yes, plural! It checks for one or more length aspected).
-
Now
jsbeans.Validator.iban_it
can check control digits (also known as European CIN), too.
- 20150610:
-
Now
jsbeans.load
can have an optional callback function to fire when the jsbean
has been loaded (with a configurable timeout).
-
Optional
jsbeans.EditInLine
parameter to override default behaviour: onBlur
- 20150527:
-
Improvements for
jsbeans.Validator.wordCount
: now email and web (http and https) addresses are counted as one word following rules about the skip
parameter; numbers (everything pass the parseFloat
function) are always counted as one owrd, in spite of their length.
-
Introducing
jsbeans.Array.parse
to parse strings to arrays.
- 20150331:
-
Introducing
jsbeans.Validator.wordCount
extension to check if a given input's value has less words than aspected according to rules.
-
jsbeans.Validator.getLabelFor
now returns a trimmed string.
-
jsbeans.Validator.file
extension now trims allowed file extensions (e.g. ["file=pdf, txt"]
is now accepted).
- 20140423:
-
A fix on
jsbeans.mvc
for queue handler.
- 20140410:
-
Constructor of
jsbeans.Iterator
has been modified to accept an optional Function as second argument to format elements returned in the next
method invocation.
- 20130818:
-
jsbeans.dom
now comes with a create
method to create DOM Elements on the fly.
- 20130522:
- Loading templates in
jsbeans.mvc
may have troubles for remote templates. To avoid this problem now jsbeans.mvc.view.load
uses a queue with a check every 50 milliseconds.
jsbeans.mvc.view.fetch
method is available to prefetch remote templates and speed up your application!
- Introducing
jsbeans.GMaps
, an utility for Google Maps™ loading.
- For older updates check the change log file.
jsbeans
is release under the LGPL (Lesser GNU Public License), this means you can use this code as you wish, even in commercial products, but this code and every modifications must be leaved under the same license and be public.
In addition to the LGPL License the Software is subject to the following conditions:
- every modification must be public and comunicated to the Author to email address
- every "jsbean" added to this library must be self consistent except for the dependence from core jsbeans.js
- copyright notice and permission notice shall be included in all copies or substantial portions of the Software
A jsbean is an almost-standalone Object, so every fix should be tracked one by one. This can lead to confusion so I decided not to use build and/or version numbers.
jsbeans
can be downloaded at sourceforge.net
here.
jsbeans
, actually every jsbean, is not always an original work. As many other frameworks is based on experiences and code taken from the net.
This section is dedicated to contributors. Any of them is reported on each jsbean for his contribution.
So, many thanks to:
- Antonio Guerra for original inspiration (and starting code) for
jsbeans.SmartInsert
- unknown author for
jsbeans.events.shortcut
(code found on the net)
- Federico Adelman for a fix on
jsbeans.Validator
- Andrea Previati for suggestion about introducing 'onClick', 'onMouseOver' and 'onMouseOut' events in
jsbeans.IntSpinner
- Paolo Biavati for 'forceStrict' implementation of
jsbeans.Validator.fiscalCode
For suggestions, tickets, fixes or whatever and your name will be added in the list!
Demos are full-working examples as documented as possible and they can be a good starting point.
APIs are
here
A demo site is available
here, a Pet Store sample application based
only on
jsbeans
with use of some jsbean as
jsbeans.Layout
,
jsbeans.Array
,
jsbeans.Validator
,
jsbeans.SmartInsert
,
jsbeans.Request
,
jsbeans.Table
,
jsbeans.TagCloud
, ...
It does not use the compressed version and it's only for demo purpose.
A single demo/test page for each
jsbean
is available clicking on buttons below.
Everytime you find this icon
you can check for code snippets by clicking on it. In any cases check page code as demo's functions are all inline!
If you like
jsbeans
, consider making a donation.