From dcebd712accad14ea5a8574bff05af5e7472b520 Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Mon, 20 Apr 2009 20:50:50 -0300 Subject: [PATCH] ActionItem928: adding file lowpro.js --- public/javascripts/lowpro.js | 338 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 338 insertions(+), 0 deletions(-) create mode 100644 public/javascripts/lowpro.js diff --git a/public/javascripts/lowpro.js b/public/javascripts/lowpro.js new file mode 100644 index 0000000..4ed4443 --- /dev/null +++ b/public/javascripts/lowpro.js @@ -0,0 +1,338 @@ +LowPro = {}; +LowPro.Version = '0.5'; +LowPro.CompatibleWithPrototype = '1.6'; + +if (Prototype.Version.indexOf(LowPro.CompatibleWithPrototype) != 0 && window.console && window.console.warn) + console.warn("This version of Low Pro is tested with Prototype " + LowPro.CompatibleWithPrototype + + " it may not work as expected with this version (" + Prototype.Version + ")"); + +if (!Element.addMethods) + Element.addMethods = function(o) { Object.extend(Element.Methods, o) }; + +// Simple utility methods for working with the DOM +DOM = {}; + +// DOMBuilder for prototype +DOM.Builder = { + tagFunc : function(tag) { + return function() { + var attrs, children; + if (arguments.length>0) { + if (arguments[0].constructor == Object) { + attrs = arguments[0]; + children = Array.prototype.slice.call(arguments, 1); + } else { + children = arguments; + }; + children = $A(children).flatten() + } + return DOM.Builder.create(tag, attrs, children); + }; + }, + create : function(tag, attrs, children) { + attrs = attrs || {}; children = children || []; tag = tag.toLowerCase(); + var el = new Element(tag, attrs); + + for (var i=0; i