PDA

View Full Version : Cloner - JS class for intelligent cloning of HTML blocks


niebiarz
05-13-2009, 09:40 AM
While working with large and complex forms with lots of dependencies I wrote a JavaScript class that facilitates the cloning process: you just create any number of HTML block patterns you may want to clone, specify their targets and you're all set. The Cloner adds deletion links and incrementation numbers to individual clones, adds nesting suffixes to clones allowing nesting clones within clones to an unlimited depth, adds nesting and incrementation suffixes to specified ID and NAME attributes within clones, makes use of callback functions to supply more arguments for cloning and has a lot of parameters you can adjust.

The class has been released under the GNU LGPL license and can be downloaded at http://cloner.sourceforge.net/ - tutorials included in the ZIP file. I have also placed tutorial pages online - you can have a look at them at http://niebiarz.eu/free/cloner_1_0.php?basics_functions