diff --git a/docs/files.html b/docs/files.html index 41f948f..3a702c6 100644 --- a/docs/files.html +++ b/docs/files.html @@ -1 +1 @@ -JsDoc Reference - File Index
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

File Index

core.js../kis-js/src/modules/template.js
ajax.js../kis-js/src/modules/template.js
DOM.js../kis-js/src/modules/template.js
event.js../kis-js/src/modules/template.js
store.js../kis-js/src/modules/template.js
template.js../kis-js/src/modules/template.js
util.js../kis-js/src/modules/template.js
\ No newline at end of file +JsDoc Reference - File Index
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

File Index

core.js../kis-js/src/modules/template.js
ajax.js../kis-js/src/modules/template.js
DOM.js../kis-js/src/modules/template.js
event.js../kis-js/src/modules/template.js
store.js../kis-js/src/modules/template.js
template.js../kis-js/src/modules/template.js
util.js../kis-js/src/modules/template.js
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index bfc11f4..f48f044 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -JsDoc Reference - Index
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Class Index

_global_

Global namespace.

\ No newline at end of file +JsDoc Reference - Index
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Class Index

_global_

Global namespace.

\ No newline at end of file diff --git a/docs/symbols/$_.dom.html b/docs/symbols/$_.dom.html index 2161f38..328df77 100644 --- a/docs/symbols/$_.dom.html +++ b/docs/symbols/$_.dom.html @@ -1 +1 @@ -JsDoc Reference - $_.dom
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Module $_.dom

Defined in: DOM.js.

Method Summary
addClass(string)Adds a class to the element(s) specified by the current selector
removeClass(string)Removes a class from the element(s) specified by the current selector
hide()Hides the element(s) specified by the current selector
show(string)Shows the element(s) specified by the current selector.
attr(string, string)Sets attributes on element(s) specified by the current selector, or, if name is not specified, returns the value of the attribute of the element specified by the current selector.
text(string)Sets or retrieves the text content of the element specified by the current selector.
css(string, string)Sets or retrieves a css property of the element specified by the current selector.
html(string)Sets or gets the innerHTML propery of the element(s) passed
Method Detail
$_.dom.addClass(string)
Adds a class to the element(s) specified by the current selector
Parameters:
string class
$_.dom.removeClass(string)
Removes a class from the element(s) specified by the current selector
Parameters:
string class
$_.dom.hide()
Hides the element(s) specified by the current selector
$_.dom.show(string)
Shows the element(s) specified by the current selector. if type is specified, the element will have it's style property set to "display:[your type]". If type is not specified, the element is set to "display:block".
Parameters:
string?, Default: type
$_.dom.attr(string, string): string
Sets attributes on element(s) specified by the current selector, or, if name is not specified, returns the value of the attribute of the element specified by the current selector.
Parameters:
string name
string?, Default: value
Returns:
string
$_.dom.text(string): string
Sets or retrieves the text content of the element specified by the current selector. If a value is passed, it will set that value on the current element, otherwise it will return the value of the current element
Parameters:
string?, Default: value
Returns:
string
$_.dom.css(string, string): string
Sets or retrieves a css property of the element specified by the current selector. If a value is passed, it will set that value on the current element, otherwise it will return the value of the css property on the current element
Parameters:
string property
string?, Default: value
Returns:
string
$_.dom.html(string): string
Sets or gets the innerHTML propery of the element(s) passed
Parameters:
string?, Default: htm
Returns:
string
\ No newline at end of file +JsDoc Reference - $_.dom
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Module $_.dom

Defined in: DOM.js.

Method Summary
addClass(string)Adds a class to the element(s) specified by the current selector
removeClass(string)Removes a class from the element(s) specified by the current selector
hide()Hides the element(s) specified by the current selector
show(string)Shows the element(s) specified by the current selector.
attr(string, string)Sets attributes on element(s) specified by the current selector, or, if name is not specified, returns the value of the attribute of the element specified by the current selector.
text(string)Sets or retrieves the text content of the element specified by the current selector.
css(string, string)Sets or retrieves a css property of the element specified by the current selector.
append(string)Adds to the innerHTML of the current element, after the last child.
prepend(string)Adds to the innerHTML of the selected element, before the current children
html(string)Sets or gets the innerHTML propery of the element(s) passed
Method Detail
$_.dom.addClass(string)
Adds a class to the element(s) specified by the current selector
Parameters:
string class
$_.dom.removeClass(string)
Removes a class from the element(s) specified by the current selector
Parameters:
string class
$_.dom.hide()
Hides the element(s) specified by the current selector
$_.dom.show(string)
Shows the element(s) specified by the current selector. if type is specified, the element will have it's style property set to "display:[your type]". If type is not specified, the element is set to "display:block".
Parameters:
string?, Default: type
$_.dom.attr(string, string): string
Sets attributes on element(s) specified by the current selector, or, if name is not specified, returns the value of the attribute of the element specified by the current selector.
Parameters:
string name
string?, Default: value
Returns:
string
$_.dom.text(string): string
Sets or retrieves the text content of the element specified by the current selector. If a value is passed, it will set that value on the current element, otherwise it will return the value of the current element
Parameters:
string?, Default: value
Returns:
string
$_.dom.css(string, string): string
Sets or retrieves a css property of the element specified by the current selector. If a value is passed, it will set that value on the current element, otherwise it will return the value of the css property on the current element
Parameters:
string property
string?, Default: value
Returns:
string
$_.dom.append(string)
Adds to the innerHTML of the current element, after the last child.
$_("ul").dom.append("<li></li>") adds an li element to the end of the selected ul element
Parameters:
string htm
$_.dom.prepend(string)
Adds to the innerHTML of the selected element, before the current children
Parameters:
string htm
$_.dom.html(string): string
Sets or gets the innerHTML propery of the element(s) passed
Parameters:
string?, Default: htm
Returns:
string
\ No newline at end of file diff --git a/docs/symbols/$_.event.html b/docs/symbols/$_.event.html index dcbb398..b5d8405 100644 --- a/docs/symbols/$_.event.html +++ b/docs/symbols/$_.event.html @@ -1 +1 @@ -JsDoc Reference - $_.event
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Module $_.event

Defined in: event.js.

Method Summary
add(string, function)Adds an event that returns a callback when triggered on the selected event and selector
remove(string, string)Removes an event bound the the specified selector, event type, and callback
live(string, string, function)Binds a persistent event to the document
delegate(string, string, function)Binds an event to a parent object
Method Detail
$_.event.add(string, function)
Adds an event that returns a callback when triggered on the selected event and selector
Eg. $_("#selector").event.add("click", do_something());
Parameters:
string event
function callback
$_.event.remove(string, string)
Removes an event bound the the specified selector, event type, and callback
Eg. $_("#selector").event.remove("click", do_something());
Parameters:
string event
string callback
$_.event.live(string, string, function)
Binds a persistent event to the document
Eg. $_.event.live(".button", "click", do_something());
Parameters:
string target
string event
function callback
$_.event.delegate(string, string, function)
Binds an event to a parent object
Eg. $_("#parent").delegate(".button", "click", do_something());
Parameters:
string target
string event_type
function callback
\ No newline at end of file +JsDoc Reference - $_.event
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Module $_.event

Defined in: event.js.

Method Summary
add(string, function)Adds an event that returns a callback when triggered on the selected event and selector
remove(string, string)Removes an event bound the the specified selector, event type, and callback
live(string, string, function)Binds a persistent event to the document
delegate(string, string, function)Binds an event to a parent object
Method Detail
$_.event.add(string, function)
Adds an event that returns a callback when triggered on the selected event and selector
Eg. $_("#selector").event.add("click", do_something());
Parameters:
string event
function callback
$_.event.remove(string, string)
Removes an event bound the the specified selector, event type, and callback
Eg. $_("#selector").event.remove("click", do_something());
Parameters:
string event
string callback
$_.event.live(string, string, function)
Binds a persistent event to the document
Eg. $_.event.live(".button", "click", do_something());
Parameters:
string target
string event
function callback
$_.event.delegate(string, string, function)
Binds an event to a parent object
Eg. $_("#parent").delegate(".button", "click", do_something());
Parameters:
string target
string event_type
function callback
\ No newline at end of file diff --git a/docs/symbols/$_.html b/docs/symbols/$_.html index 6b00f51..e131a5b 100644 --- a/docs/symbols/$_.html +++ b/docs/symbols/$_.html @@ -1 +1 @@ -JsDoc Reference - $_
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Module $_

Defined in: core.js.

Field Summary
domDOM Dom manipulation module
storeWrapper for localstorage / sessionstorage data serialization.
utilString and object manipulation utilities
eventEvent Listener module
templateModule for html templating.
Method Summary
$(string, object)Simple DOM selector function
ext(string, object)Adds the property `obj` to the $_ object, calling it `name`
each(function)Iterates over a $_ object, applying a callback to each item
type(mixed)Retrieves the type of the passed variable
get(string, object, function)Sends a GET type ajax request
post(string, object, function)Sends a POST type ajax request
Field Detail
$_.dom
DOM Dom manipulation module

Defined in: DOM.js.

$_.store
Wrapper for localstorage / sessionstorage data serialization. Each method has a boolean parameter, that when set as true switches the method to use sessionStorage rather than the default localStorage.

Defined in: store.js.

$_.util
String and object manipulation utilities

Defined in: util.js.

$_.event
Event Listener module

Defined in: event.js.

$_.template
Module for html templating. Requires ajax module.

Defined in: template.js.

Method Detail
$_.$(string, object): object
Simple DOM selector function
Parameters:
string selector
object context
Returns:
object
$_.ext(string, object)
Adds the property `obj` to the $_ object, calling it `name`
Parameters:
string name
object obj
$_.each(function)
Iterates over a $_ object, applying a callback to each item
Parameters:
function callback
$_.type(mixed): string
Retrieves the type of the passed variable
Parameters:
mixed obj
Returns:
string
$_.get(string, object, function)
Sends a GET type ajax request

Defined in: ajax.js.

Parameters:
string url
object data
function callback
$_.post(string, object, function)
Sends a POST type ajax request

Defined in: ajax.js.

Parameters:
string url
object data
function callback
\ No newline at end of file +JsDoc Reference - $_
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Module $_

Defined in: core.js.

Field Summary
domDOM Dom manipulation module
storeWrapper for localstorage / sessionstorage data serialization.
utilString and object manipulation utilities
eventEvent Listener module
templateModule for html templating.
Method Summary
$(string, object)Simple DOM selector function
ext(string, object)Adds the property `obj` to the $_ object, calling it `name`
each(function)Iterates over a $_ object, applying a callback to each item
type(mixed)Retrieves the type of the passed variable
get(string, object, function)Sends a GET type ajax request
post(string, object, function)Sends a POST type ajax request
Field Detail
$_.dom
DOM Dom manipulation module

Defined in: DOM.js.

$_.store
Wrapper for localstorage / sessionstorage data serialization. Each method has a boolean parameter, that when set as true switches the method to use sessionStorage rather than the default localStorage.

Defined in: store.js.

$_.util
String and object manipulation utilities

Defined in: util.js.

$_.event
Event Listener module

Defined in: event.js.

$_.template
Module for html templating. Requires ajax module.

Defined in: template.js.

Method Detail
$_.$(string, object): object
Simple DOM selector function
Parameters:
string selector
object context
Returns:
object
$_.ext(string, object)
Adds the property `obj` to the $_ object, calling it `name`
Parameters:
string name
object obj
$_.each(function)
Iterates over a $_ object, applying a callback to each item
Parameters:
function callback
$_.type(mixed): string
Retrieves the type of the passed variable
Parameters:
mixed obj
Returns:
string
$_.get(string, object, function)
Sends a GET type ajax request

Defined in: ajax.js.

Parameters:
string url
object data
function callback
$_.post(string, object, function)
Sends a POST type ajax request

Defined in: ajax.js.

Parameters:
string url
object data
function callback
\ No newline at end of file diff --git a/docs/symbols/$_.store.html b/docs/symbols/$_.store.html index 46cafa8..dff5708 100644 --- a/docs/symbols/$_.store.html +++ b/docs/symbols/$_.store.html @@ -1 +1 @@ -JsDoc Reference - $_.store
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Module $_.store

Defined in: store.js.

Method Summary
get(string, bool)Retrieves and deserializes a value from localstorage, based on the specified key
set(string, mixed, bool)Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string
remove(string, bool)Removes the specified item from storage
getAll(bool)Returns an object of all the raw values in storage
clear(bool)Removes all values from the same domain storage
Method Detail
$_.store.get(string, bool): object
Retrieves and deserializes a value from localstorage, based on the specified key
Parameters:
string key
bool session
Returns:
object
$_.store.set(string, mixed, bool)
Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string
Parameters:
string key
mixed value
bool session
$_.store.remove(string, bool)
Removes the specified item from storage
Parameters:
string key
bool session
$_.store.getAll(bool): object
Returns an object of all the raw values in storage
Parameters:
bool session
Returns:
object
$_.store.clear(bool)
Removes all values from the same domain storage
Parameters:
bool session
\ No newline at end of file +JsDoc Reference - $_.store
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Module $_.store

Defined in: store.js.

Method Summary
get(string, bool)Retrieves and deserializes a value from localstorage, based on the specified key
set(string, mixed, bool)Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string
remove(string, bool)Removes the specified item from storage
getAll(bool)Returns an object of all the raw values in storage
clear(bool)Removes all values from the same domain storage
Method Detail
$_.store.get(string, bool): object
Retrieves and deserializes a value from localstorage, based on the specified key
Parameters:
string key
bool session
Returns:
object
$_.store.set(string, mixed, bool)
Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string
Parameters:
string key
mixed value
bool session
$_.store.remove(string, bool)
Removes the specified item from storage
Parameters:
string key
bool session
$_.store.getAll(bool): object
Returns an object of all the raw values in storage
Parameters:
bool session
Returns:
object
$_.store.clear(bool)
Removes all values from the same domain storage
Parameters:
bool session
\ No newline at end of file diff --git a/docs/symbols/$_.template.html b/docs/symbols/$_.template.html index a125238..0ae5115 100644 --- a/docs/symbols/$_.template.html +++ b/docs/symbols/$_.template.html @@ -1 +1 @@ -JsDoc Reference - $_.template
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Module $_.template

Defined in: template.js.

Method Summary
get(string)Retrieves a template
parse(string, object)Formats a template
apply(string, string, object)Inserts the formatted template into the page.
Method Detail
$_.template.get(string): string
Retrieves a template
Parameters:
string name
Returns:
string
$_.template.parse(string, object): string
Formats a template
Parameters:
string template_name
object replace_data
Returns:
string
$_.template.apply(string, string, object)
Inserts the formatted template into the page. If the url and data parameters are passed, it will retrieve a template file from the same domain, parse, and insert the template into the page.
Parameters:
string parsed_template/template_name
string?, Default: url
object?, Default: data
\ No newline at end of file +JsDoc Reference - $_.template
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Module $_.template

Defined in: template.js.

Method Summary
get(string)Retrieves a template
parse(string, object)Formats a template
apply(string, string, object)Inserts the formatted template into the page.
Method Detail
$_.template.get(string): string
Retrieves a template
Parameters:
string name
Returns:
string
$_.template.parse(string, object): string
Formats a template
Parameters:
string template_name
object replace_data
Returns:
string
$_.template.apply(string, string, object)
Inserts the formatted template into the page. If the url and data parameters are passed, it will retrieve a template file from the same domain, parse, and insert the template into the page.
Parameters:
string parsed_template/template_name
string?, Default: url
object?, Default: data
\ No newline at end of file diff --git a/docs/symbols/$_.util.html b/docs/symbols/$_.util.html index 9f1d6a6..74bf3a2 100644 --- a/docs/symbols/$_.util.html +++ b/docs/symbols/$_.util.html @@ -1 +1 @@ -JsDoc Reference - $_.util
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Module $_.util

Defined in: util.js.

Method Summary
object_keys(object)Retrieve the keys, or member names of an object
object_values(object)Retrieves the values of an object, and returns them as an array
array_combine(array/object, array/object)Creates an object, with the property names of the first array, and the values of the second.
object_merge(object)Combines two or more objects/arrays.
str_trans(string, mixed, string)Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first.
Method Detail
$_.util.object_keys(object): array
Retrieve the keys, or member names of an object
Parameters:
object
Returns:
array
$_.util.object_values(object): array
Retrieves the values of an object, and returns them as an array
Parameters:
object
Returns:
array
$_.util.array_combine(array/object, array/object): object
Creates an object, with the property names of the first array, and the values of the second. If objects are passed, the values of the object are used. If the arrays or objects passed are not the same size, the function will return false.
Parameters:
array/object keys
array/object vals
Returns:
object
$_.util.object_merge(object): object
Combines two or more objects/arrays. If the keys are numeric, the outputted object will have re-indexed keys. If a key/value pair exists in both objects, indentical values will be droped, but if a key exists with a different value, with the same key, the value in the second array will replace the value in the first
Parameters:
object [as many as you wish to combine]
Returns:
object
$_.util.str_trans(string, mixed, string): string
Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first. Accepts one replace pair as two parameters, or an object, with from => to replacements as key/value pairs
Parameters:
string input_string
mixed from (string)/replace pairs (object)
string?, Default:
Returns:
string
\ No newline at end of file +JsDoc Reference - $_.util
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Module $_.util

Defined in: util.js.

Method Summary
object_keys(object)Retrieve the keys, or member names of an object
object_values(object)Retrieves the values of an object, and returns them as an array
array_combine(array/object, array/object)Creates an object, with the property names of the first array, and the values of the second.
object_merge(object)Combines two or more objects/arrays.
str_trans(string, mixed, string)Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first.
Method Detail
$_.util.object_keys(object): array
Retrieve the keys, or member names of an object
Parameters:
object
Returns:
array
$_.util.object_values(object): array
Retrieves the values of an object, and returns them as an array
Parameters:
object
Returns:
array
$_.util.array_combine(array/object, array/object): object
Creates an object, with the property names of the first array, and the values of the second. If objects are passed, the values of the object are used. If the arrays or objects passed are not the same size, the function will return false.
Parameters:
array/object keys
array/object vals
Returns:
object
$_.util.object_merge(object): object
Combines two or more objects/arrays. If the keys are numeric, the outputted object will have re-indexed keys. If a key/value pair exists in both objects, indentical values will be droped, but if a key exists with a different value, with the same key, the value in the second array will replace the value in the first
Parameters:
object [as many as you wish to combine]
Returns:
object
$_.util.str_trans(string, mixed, string): string
Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first. Accepts one replace pair as two parameters, or an object, with from => to replacements as key/value pairs
Parameters:
string input_string
mixed from (string)/replace pairs (object)
string?, Default:
Returns:
string
\ No newline at end of file diff --git a/docs/symbols/_global_.html b/docs/symbols/_global_.html index 8d84853..8085fbd 100644 --- a/docs/symbols/_global_.html +++ b/docs/symbols/_global_.html @@ -1 +1 @@ -JsDoc Reference - _global_
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Built-In Module _global_

\ No newline at end of file +JsDoc Reference - _global_
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
addClass(string)
removeClass(string)
show(string)
attr(string, string)
text(string)
css(string, string)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
get(string)
parse(string, object)
apply(string, string, object)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Built-In Module _global_

\ No newline at end of file diff --git a/docs/symbols/src/kis-js_src_modules_DOM.js.html b/docs/symbols/src/kis-js_src_modules_DOM.js.html index 89c3a91..05d7980 100644 --- a/docs/symbols/src/kis-js_src_modules_DOM.js.html +++ b/docs/symbols/src/kis-js_src_modules_DOM.js.html @@ -310,29 +310,54 @@ 303 }); 304 }, 305 /** -306 * Sets or gets the innerHTML propery of the element(s) passed -307 * -308 * @name html -309 * @memberOf $_.dom -310 * @function -311 * @param [string] htm -312 * @return string -313 * @type string -314 */ -315 html: function(htm) -316 { -317 -318 if(typeof htm !== "undefined") -319 { -320 this.el.innerHTML = htm; -321 } -322 -323 //If the parameter is undefined, just return the current value -324 return this.el.innerHTML; -325 } -326 }; -327 -328 $_.ext('dom', d); -329 -330 }()); -331 \ No newline at end of file +306 * Adds to the innerHTML of the current element, after the last child. +307 * +308 * @example $_("ul").dom.append("<li></li>") adds an li element to the end of the selected ul element +309 * @name append +310 * @memberOf $_.dom +311 * @function +312 * @param string htm +313 */ +314 append: function(htm) +315 { +316 this.el.insertAdjacentHTML('beforeend', htm); +317 }, +318 /** +319 * Adds to the innerHTML of the selected element, before the current children +320 * +321 * @name prepend +322 * @memberOf $_.dom +323 * @function +324 * @param string htm +325 */ +326 prepend: function(htm) +327 { +328 this.el.insertAdjacentHTML('afterbegin', htm); +329 }, +330 /** +331 * Sets or gets the innerHTML propery of the element(s) passed +332 * +333 * @name html +334 * @memberOf $_.dom +335 * @function +336 * @param [string] htm +337 * @return string +338 * @type string +339 */ +340 html: function(htm) +341 { +342 +343 if(typeof htm !== "undefined") +344 { +345 this.el.innerHTML = htm; +346 } +347 +348 //If the parameter is undefined, just return the current value +349 return this.el.innerHTML; +350 } +351 }; +352 +353 $_.ext('dom', d); +354 +355 }()); +356 \ No newline at end of file diff --git a/docs/symbols/src/kis-js_src_modules_template.js.html b/docs/symbols/src/kis-js_src_modules_template.js.html index 6a808f8..1e98d0b 100644 --- a/docs/symbols/src/kis-js_src_modules_template.js.html +++ b/docs/symbols/src/kis-js_src_modules_template.js.html @@ -76,165 +76,167 @@ 69 { 70 var tmp = _t[name], 71 pairs = [], - 72 pseudos = [], - 73 num_pairs = 0, - 74 num_pseudos = 0, - 75 i = 0, - 76 j = 0, - 77 var_name = '', - 78 rep_data = {}, - 79 tmp_data = '', - 80 data_len, - 81 frag, - 82 frag_section, - 83 emptys, - 84 x; - 85 - 86 tmp = String(tmp); - 87 - 88 //Remove newlines and tabs from template because - 89 //those whitespace characters are extra bandwidth - 90 tmp = tmp.replace(/\s+/gim, " "); - 91 tmp = tmp.replace(/>\s+</gim, "><"); - 92 tmp = tmp.replace(/>\s+\{/gim, ">{"); - 93 tmp = tmp.replace(/\}\s+</gim, "}<"); - 94 - 95 //Match all the looped sections of content - 96 pairs = tmp.match(/\{([A-Z0-9_\-]+)\}(.*)\{\/\1\}/gim); - 97 - 98 if(pairs != null) - 99 { -100 num_pairs = pairs.length; -101 -102 //Go through the template, and match the pairs -103 for(i=0;i<num_pairs;i++) -104 { -105 //Put the loop in a placeholder -106 tmp = tmp.replace(pairs[i], "{"+i+"}"); -107 -108 //Create a place to store looped data -109 tmp_data = ""; -110 -111 //The replace variable is the name of the tag -112 var_name = String(pairs[i]).match(/^\{([A-Z0-9_\-]+)\}/i); -113 rep_data = data[var_name[1]]; -114 -115 //Make sure there are loops -116 if(rep_data.length > 0) -117 { -118 data_len = rep_data.length; -119 -120 //Get rid of the loop tags -121 pairs[i] = pairs[i].replace(/\{([A-Z0-9_\-]+)\}(.*)\{\/\1\}/gim, "$2"); -122 -123 //Replace psudovariables with data -124 for(j=0;j<data_len;j++) -125 { -126 //Is there a better way to do this, rather than an inline function? -127 tmp_data += pairs[i].replace(/\{([A-Z0-9 _\-]+)\}/gi, function(_, varName){ -128 return (rep_data[j][varName]) ? rep_data[j][varName] : ""; -129 }); -130 } -131 } -132 -133 //Replace the looped content -134 tmp = tmp.replace("{"+i+"}", tmp_data); -135 } -136 } -137 -138 //Replace all the rest of the psudeovariables -139 pseudos = tmp.match(/\{([A-Z0-9_\-]+)\}/gim); -140 -141 if(pseudos != null) -142 { -143 num_pseudos = pseudos.length; -144 -145 for(i=0;i<num_pseudos;i++) -146 { -147 //Remove the {} from the pseudos -148 var_name = pseudos[i].replace('{', ''); -149 var_name = var_name.replace('}', ''); -150 -151 //Replace each pseudovariable with the value of the object -152 //property of the same name -153 tmp = tmp.replace(pseudos[i], data[var_name]); -154 } -155 } -156 -157 //Create an empty fragement -158 frag = document.createDocumentFragment(); -159 -160 //Insert the html -161 frag.appendChild(document.createElement('section')); -162 frag_section = frag.querySelectorAll('section')[0]; -163 frag_section.innerHTML = tmp; -164 -165 //Remove bad elements in the fragment, should be faster than being done live -166 emptys = frag_section.querySelectorAll('[src=""], [href=""]'); -167 -168 for(x in emptys) -169 { -170 if(emptys[x].parentNode) -171 { -172 emptys[x].parentNode.removeChild(emptys[x]); -173 } -174 } -175 -176 //Save the parsed template in an object for later retrieval -177 _p[name] = tmp; -178 -179 return tmp; -180 }, -181 /** -182 * Inserts the formatted template into the page. If the url and data parameters -183 * are passed, it will retrieve a template file from the same domain, parse, -184 * and insert the template into the page. -185 * -186 * @memberOf $_.template -187 * @name apply -188 * @function -189 * @param string parsed_template/template_name -190 * @param [string] url -191 * @param [object] data -192 */ -193 apply: function(name, url, data) -194 { -195 //If the parsed template is supplied, just apply it to the passed selector -196 if(typeof url === "undefined" && typeof data === "undefined") -197 { -198 //If the "name" variable is in the _p object, set that -199 if(typeof _p[name] !== "undefined") -200 { -201 this.el.innerHTML = _p[name]; -202 return; -203 } -204 -205 //Otherwise, set the passed string to the current selector -206 this.el.innerHTML = name; -207 return; -208 } -209 -210 //Otherwise, get the template, parse it, and apply it -211 $_.get(url, {}, function(res){ -212 var parsed; -213 -214 if(res === "") -215 { -216 console.log("Template is empty or can not be found"); -217 return; -218 } -219 -220 //Cache the template in an object for later use -221 _t[name] = res; -222 parsed = this.parse(name, data); -223 _p[name] = parsed; -224 -225 this.el.innerHTML = parsed; -226 }); -227 } -228 }; -229 -230 //Add the module to the library -231 $_.ext('template', t); -232 -233 })(); \ No newline at end of file + 72 pair_reg = /\{([A-Z0-9_\-]+)\}(.*)\{\/\1\}/gim, + 73 var_reg = /\{([A-Z0-9_\-]+)\}/gim, + 74 pseudos = [], + 75 num_pairs = 0, + 76 num_pseudos = 0, + 77 i = 0, + 78 j = 0, + 79 var_name = '', + 80 rep_data = {}, + 81 tmp_data = '', + 82 data_len, + 83 frag, + 84 frag_section, + 85 emptys, + 86 x; + 87 + 88 tmp = String(tmp); + 89 + 90 //Remove newlines and tabs from template because + 91 //those whitespace characters are extra bandwidth + 92 tmp = tmp.replace(/\s+/gim, " "); + 93 tmp = tmp.replace(/>\s+</gim, "><"); + 94 tmp = tmp.replace(/>\s+\{/gim, ">{"); + 95 tmp = tmp.replace(/\}\s+</gim, "}<"); + 96 + 97 //Match all the looped sections of content + 98 pairs = tmp.match(pair_reg); + 99 +100 if(pairs != null) +101 { +102 num_pairs = pairs.length; +103 +104 //Go through the template, and match the pairs +105 for(i=0;i<num_pairs;i++) +106 { +107 //Put the loop in a placeholder +108 tmp = tmp.replace(pairs[i], "{"+i+"}"); +109 +110 //Create a place to store looped data +111 tmp_data = ""; +112 +113 //The replace variable is the name of the tag +114 var_name = String(pairs[i]).match(/^\{([A-Z0-9_\-]+)\}/i); +115 rep_data = data[var_name[1]]; +116 +117 //Make sure there are loops +118 if(rep_data.length > 0) +119 { +120 data_len = rep_data.length; +121 +122 //Get rid of the loop tags +123 pairs[i] = pairs[i].replace(pair_reg, "$2"); +124 +125 //Replace psudovariables with data +126 for(j=0;j<data_len;j++) +127 { +128 //Is there a better way to do this, rather than an inline function? +129 tmp_data += pairs[i].replace(var_reg, function(_, varName){ +130 return (rep_data[j][varName]) ? rep_data[j][varName] : ""; +131 }); +132 } +133 } +134 +135 //Replace the looped content +136 tmp = tmp.replace("{"+i+"}", tmp_data); +137 } +138 } +139 +140 //Replace all the rest of the psudeovariables +141 pseudos = tmp.match(var_reg); +142 +143 if(pseudos != null) +144 { +145 num_pseudos = pseudos.length; +146 +147 for(i=0;i<num_pseudos;i++) +148 { +149 //Remove the {} from the pseudos +150 var_name = pseudos[i].replace('{', ''); +151 var_name = var_name.replace('}', ''); +152 +153 //Replace each pseudovariable with the value of the object +154 //property of the same name +155 tmp = tmp.replace(pseudos[i], data[var_name]); +156 } +157 } +158 +159 //Create an empty fragement +160 frag = document.createDocumentFragment(); +161 +162 //Insert the html +163 frag.appendChild(document.createElement('section')); +164 frag_section = frag.querySelectorAll('section')[0]; +165 frag_section.innerHTML = tmp; +166 +167 //Remove bad elements in the fragment, should be faster than being done live +168 emptys = frag_section.querySelectorAll('[src=""], [href=""]'); +169 +170 for(x in emptys) +171 { +172 if(emptys[x].parentNode) +173 { +174 emptys[x].parentNode.removeChild(emptys[x]); +175 } +176 } +177 +178 //Save the parsed template in an object for later retrieval +179 _p[name] = tmp; +180 +181 return tmp; +182 }, +183 /** +184 * Inserts the formatted template into the page. If the url and data parameters +185 * are passed, it will retrieve a template file from the same domain, parse, +186 * and insert the template into the page. +187 * +188 * @memberOf $_.template +189 * @name apply +190 * @function +191 * @param string parsed_template/template_name +192 * @param [string] url +193 * @param [object] data +194 */ +195 apply: function(name, url, data) +196 { +197 //If the parsed template is supplied, just apply it to the passed selector +198 if(typeof url === "undefined" && typeof data === "undefined") +199 { +200 //If the "name" variable is in the _p object, set that +201 if(typeof _p[name] !== "undefined") +202 { +203 this.el.innerHTML = _p[name]; +204 return; +205 } +206 +207 //Otherwise, set the passed string to the current selector +208 this.el.innerHTML = name; +209 return; +210 } +211 +212 //Otherwise, get the template, parse it, and apply it +213 $_.get(url, {}, function(res){ +214 var parsed; +215 +216 if(res === "") +217 { +218 console.log("Template is empty or can not be found"); +219 return; +220 } +221 +222 //Cache the template in an object for later use +223 _t[name] = res; +224 parsed = this.parse(name, data); +225 _p[name] = parsed; +226 +227 this.el.innerHTML = parsed; +228 }); +229 } +230 }; +231 +232 //Add the module to the library +233 $_.ext('template', t); +234 +235 })(); \ No newline at end of file diff --git a/kis-all.js b/kis-all.js index c872021..048428d 100644 --- a/kis-all.js +++ b/kis-all.js @@ -738,6 +738,31 @@ _css(e, prop, val); }); }, + /** + * Adds to the innerHTML of the current element, after the last child. + * + * @example $_("ul").dom.append("<li></li>") adds an li element to the end of the selected ul element + * @name append + * @memberOf $_.dom + * @function + * @param string htm + */ + append: function(htm) + { + this.el.insertAdjacentHTML('beforeend', htm); + }, + /** + * Adds to the innerHTML of the selected element, before the current children + * + * @name prepend + * @memberOf $_.dom + * @function + * @param string htm + */ + prepend: function(htm) + { + this.el.insertAdjacentHTML('afterbegin', htm); + }, /** * Sets or gets the innerHTML propery of the element(s) passed * @@ -1702,6 +1727,8 @@ { var tmp = _t[name], pairs = [], + pair_reg = /\{([A-Z0-9_\-]+)\}(.*)\{\/\1\}/gim, + var_reg = /\{([A-Z0-9_\-]+)\}/gim, pseudos = [], num_pairs = 0, num_pseudos = 0, @@ -1726,7 +1753,7 @@ tmp = tmp.replace(/\}\s+1&&typeof a==="undefined")console.log(b),console.log("Must be a singular element");else if(b.length>1&&typeof a!== -"undefined")$_.each(function(b){return g(b,c,a)});else return g(b,c,a)},text:function(c){var a,b,e;e=this.el;b=typeof e.innerText!=="undefined"?"innerText":typeof e.textContent!=="undefined"?"textContent":"innerHTML";a=e[b];return typeof c!=="undefined"?e[b]=c:a},css:function(c,a){if(typeof a==="undefined")return d(this.el,c);$_.each(function(b){d(b,c,a)})},html:function(c){if(typeof c!=="undefined")this.el.innerHTML=c;return this.el.innerHTML}})})(); -(function(){if(!(typeof localStorage==="undefined"||typeof JSON==="undefined")){var g=localStorage,h=sessionStorage;$_.ext("store",{get:function(d,c){var a=c?h.getItem(d):g.getItem(d);return JSON.parse(a)},set:function(d,c,a){c=JSON.stringify(c);a?h.setItem(d,c):g.setItem(d,c)},remove:function(d,c){c?h.removeItem(d):g.removeItem(d)},getAll:function(d){var c,a={},b,e;e=d?g:h;c=e.length;for(d=0;de?1:ca?1:b\s+<"),a=a.replace(/>\s+\{/gim,">{"),a=a.replace(/\}\s+0){i=j.length;b[f]=b[f].replace(/\{([A-Z0-9_\-]+)\}(.*)\{\/\1\}/gim,"$2");for(k=0;ke?1:ba?1:c\s+<"),a=a.replace(/>\s+\{/gim,">{"),a=a.replace(/\}\s+