Universeorange.com/Docs/
Priya is a
javascript
library which introduces some nicejavascript
functions.Some of
javascript
build-in functions are wrapped to easily remember functions.
There are functions to bind
certain things to certain elements. Priya binds
itself to the element.
Then you can adjust the element to your needs and even make a request which then is handled by R3m or another request handler.
The request is handled as json, any other format will be displayed as
debug
.
There is also a namespace function: _('namespace')
where you can group multiple functions for a certain job, more on that in the examples.
In the global space of javascript, the following methods are available:
When Priya is loaded you can attach priya to an element with the attach()
method.
To select an element using select, you are using the querySelectorAll()
method internally.
Priya is then attached on the result or resultset.
require()
is used to load javascript sources and wait for it to load and then do some stuff with it, or something else.
request()
is used to update a page, element or elements on the page. Also form submission can be handled with it.
On the element side for example are these functions available:
- closest
element.closest()
- children
element.children()
- previous
element.previous()
- next
element.next()
- addClass
element.addClass()
- removeClass
element.removeClass()
- toggleClass
element.toggleClass()
- css
element.css()
- html
element.html()
- attribute
element.attribute()
- data
element.data()
- collection
element.collection()
- on
element.on()
- trigger
element.trigger()
A bootstrap.json
file is used to bootstrap all the different functions. You can extend it to your needs.
Be aware when updating: don't forget to update
bootstrap.json
with your own required files.
Last modified: 2021-06-07
© 2021 universeorange.com