0.0.60 • Published 8 years ago

the-book-of-hermes v0.0.60

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

The Book Of Hermes

Lightweight Javascript DOM manipulation library

The Hermetic documentation can be veiwed below. Anyone is welcome to fork and extend this library, or if you have any feature requests just submit an issue!

To add this sacred book to your library simply clone this REPO or you can use Bower (recommended) or NPM (also recommended):

bower install the-book-of-hermes

npm install the-book-of-hermes

DOM selector

h('#myID'); //gets selector

For Loop

Hermes.ouroboros(myArray, function(cb){

console.log(cb);

});

Event listener

Hermes can listen to any type of Event - "mouseover", "click", "mouseout", "mousemove"

h('.selector').listen(eventName, function(e){console.log(e)})

GET Call

Hermes.theft(url, function(data){

console.log(data);

});

POST JSON Data

Hermes.give = function(url, data, cb) {

console.log(cb)

}

Effects

This will fade your element in, just pass in your element as a paramater.

Basic DOM manipulation:

Hide your element

h('.selector').conceal();

Show your element

h('.selector').reveal();

Show & Hide your element

h('.selector').switch();

Remove element from DOM

h('.selector').vanquish();

Add multiple child elements to DOM

var html = [{

 "node": "div",

 "class": "row-Dyad",

"text": "I'm a child node"

}, {

 "node": "div",

"class": "col-Dyad tetrad-four",

"text": "I'm a child node of a child node"

}]

h('.selector').multiply(html);

Add a class to your element

h('.selector').addClass('class2add');

Read the text of your element

h('.selector').readText();

Erase the text of your element

h('.selector').eraseText();

Add an element with a class

h('.selector').add(elementType, elementClass);

Inject HTML to DOM

h('.selector').manifestAll('< div >Hermetic Dyanmic Element< /div >')

Check if your element has a particular class

h('.selector').hasClass('classNameToTest');

Get CSS value of element, won't return inline styles

h('.selector').setCSS('inlineCSSstring');

Hermes has access to cookies

Set a Cookie

Hermes.stealCookie(cookieName, cookieValue, daysTillExp);

Get a Cookie

Hermes.getCookieJar(cookieName);

Check for a Cookie

Hermes.checkCookieJar(checkForCookie);

Delete a cookie

Hermes.eatCookie(cookieToDelete);

Hermes also has access to Local Storage

Set Local Storage

Hermes.meetsYourBrowser(name, value);

Get Local Storage

Hermes.remembersYou(localstorageKeyName);

Delete Local Storage Key

Hermes.forgotYou(localStorageName);

0.0.60

8 years ago

0.0.50

8 years ago

0.0.30

8 years ago

0.0.25

8 years ago

0.0.24

8 years ago

0.0.23

8 years ago

0.0.22

8 years ago

0.0.21

9 years ago

0.0.20

9 years ago

0.0.19

9 years ago

0.0.18

9 years ago

0.0.17

9 years ago

0.0.16

9 years ago

0.0.15

9 years ago

0.0.14

9 years ago

0.0.13

9 years ago

0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago