Reply To: We heard you like RegEX

Home Forums General Chat We heard you like RegEX Reply To: We heard you like RegEX

#20326
Joaco
Participant

The other day I was cloning jquery for learning purposes, so I decided to do another type of library. A more “high level” language-based library. You could give it instructions like “hide ELEMENT”, “move element to dis position”, “do this, do that,” etc.
Example: “get ELEMENT” would return the DOMElement. To differentiate between tags, classes and elements you should precede it with a #, . and nothing, for id, class and tag name, respectively.
“hide ELEMENT” would change element(s)’s display to :none
“move ELEMENT to left,top” checks if it already has the type of position defined, (relative, absolute, fixed), if not, it sets it to relative (which is the default..?) and moves the element to the desired position.
“do “action” in x sec|ms” will do the action in x sec(or ms). The action can’t be javascript, it is parsed by _( ).
“change element’s contents to ‘newContent'” change element’s contents to the specified new content.
“when EVENT on ELEMENT do STUFF” pretty much. Adds an event listener. doesn’t work yet.

Also, instead of doing this:
_(“move #header to 20,10”)
_(“change #header’s contents to ‘‘”)
you can do this in one call:
_(” move #header to 20,10 also change #header’s contents to ‘‘”)

and I will edit the contents now 😛