From 5ef4e7f83743605f730b77a64d424518daf14b0f Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Tue, 3 Apr 2012 14:39:26 -0400 Subject: [PATCH] Added ..sse method for server-sent events --- docs/files.html | 2 +- docs/index.html | 2 +- docs/symbols/$_.dom.html | 2 +- docs/symbols/$_.event.html | 2 +- docs/symbols/$_.html | 2 +- docs/symbols/$_.indexedDB.html | 2 +- docs/symbols/$_.store.html | 2 +- docs/symbols/$_.util.html | 2 +- docs/symbols/_global_.html | 2 +- .../src/kis-js_src_modules_ajax.js.html | 32 +++++++++++++- kis-all.js | 30 +++++++++++++ kis-lite-dom-min.js | 30 +++++++++++++ kis-lite-dom.js | 30 +++++++++++++ kis-lite-min.js | 16 +++---- kis-lite.js | 30 +++++++++++++ kis-min.js | 44 +++++++++---------- src/modules/ajax.js | 30 +++++++++++++ 17 files changed, 220 insertions(+), 40 deletions(-) diff --git a/docs/files.html b/docs/files.html index 75a04fe..ab0a978 100755 --- 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)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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/event.js
ajax.js../kis-js/src/modules/event.js
DOM.js../kis-js/src/modules/event.js
event.js../kis-js/src/modules/event.js
indexedDB.js../kis-js/src/modules/event.js
store.js../kis-js/src/modules/event.js
util.js../kis-js/src/modules/event.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)
sse(string, function, int)
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)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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/event.js
ajax.js../kis-js/src/modules/event.js
DOM.js../kis-js/src/modules/event.js
event.js../kis-js/src/modules/event.js
indexedDB.js../kis-js/src/modules/event.js
store.js../kis-js/src/modules/event.js
util.js../kis-js/src/modules/event.js
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index d65257f..965cc32 100755 --- 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)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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)
sse(string, function, int)
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)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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 7fc77aa..a0c69b9 100755 --- 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)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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 +JsDoc Reference - $_.dom
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
sse(string, function, int)
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)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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 51fe451..27a0503 100755 --- 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)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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)
sse(string, function, int)
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)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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 b52968e..30f34b7 100755 --- 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)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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.
indexedDBModule for simplifying Indexed DB access
utilString and object manipulation utilities
eventEvent Listener module
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.

$_.indexedDB
Module for simplifying Indexed DB access

Defined in: indexedDB.js.

$_.util
String and object manipulation utilities

Defined in: util.js.

$_.event
Event Listener module

Defined in: event.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)
sse(string, function, int)
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)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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.
indexedDBModule for simplifying Indexed DB access
utilString and object manipulation utilities
eventEvent Listener module
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
sse(string, function, int)Watches for server-sent events, or falls back to ajax polling - defaults to 30 second intervals
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.

$_.indexedDB
Module for simplifying Indexed DB access

Defined in: indexedDB.js.

$_.util
String and object manipulation utilities

Defined in: util.js.

$_.event
Event Listener module

Defined in: event.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
$_.sse(string, function, int)
Watches for server-sent events, or falls back to ajax polling - defaults to 30 second intervals

Defined in: ajax.js.

Parameters:
string url
function callback
int?, Default: 30000
\ No newline at end of file diff --git a/docs/symbols/$_.indexedDB.html b/docs/symbols/$_.indexedDB.html index d38f61e..cfd638f 100755 --- a/docs/symbols/$_.indexedDB.html +++ b/docs/symbols/$_.indexedDB.html @@ -1 +1 @@ -JsDoc Reference - $_.indexedDB
 
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)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Module $_.indexedDB

Defined in: indexedDB.js.

Method Summary
connect(string, int, function)Connects to an indexedDB database
create_store(string, string, bool)Helper function to create a new object store
delete_store(string)Delete an object store
Method Detail
$_.indexedDB.connect(string, int, function)
Connects to an indexedDB database
Parameters:
string dbname
int?, Default: version
function?, Default: onupgradeneeded
$_.indexedDB.create_store(string, string, bool)
Helper function to create a new object store
Parameters:
string name
string?, Default: key
bool?, Default: generator
Returns:
IDBDataStore object
$_.indexedDB.delete_store(string)
Delete an object store
Parameters:
string name
\ No newline at end of file +JsDoc Reference - $_.indexedDB
 
Project Outline
 
$_
$(string, object)
ext(string, object)
each(function)
type(mixed)
get(string, object, function)
post(string, object, function)
sse(string, function, int)
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)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
object_keys(object)
array_combine(array/object, array/object)
object_merge(object)
str_trans(string, mixed, string)
«
Kis JS Docs

Module $_.indexedDB

Defined in: indexedDB.js.

Method Summary
connect(string, int, function)Connects to an indexedDB database
create_store(string, string, bool)Helper function to create a new object store
delete_store(string)Delete an object store
Method Detail
$_.indexedDB.connect(string, int, function)
Connects to an indexedDB database
Parameters:
string dbname
int?, Default: version
function?, Default: onupgradeneeded
$_.indexedDB.create_store(string, string, bool)
Helper function to create a new object store
Parameters:
string name
string?, Default: key
bool?, Default: generator
Returns:
IDBDataStore object
$_.indexedDB.delete_store(string)
Delete an object store
Parameters:
string name
\ No newline at end of file diff --git a/docs/symbols/$_.store.html b/docs/symbols/$_.store.html index d8b4b5a..72ae61a 100755 --- 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)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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)
sse(string, function, int)
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)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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/$_.util.html b/docs/symbols/$_.util.html index d75768d..3e6924a 100755 --- 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)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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)
sse(string, function, int)
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)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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 4f09d9d..d00b041 100755 --- 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)
append(string)
prepend(string)
html(string)
add(string, function)
remove(string, string)
live(string, string, function)
delegate(string, string, function)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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)
sse(string, function, int)
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)
connect(string, int, function)
create_store(string, string, bool)
delete_store(string)
get(string, bool)
set(string, mixed, bool)
remove(string, bool)
getAll(bool)
clear(bool)
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_ajax.js.html b/docs/symbols/src/kis-js_src_modules_ajax.js.html index f704fda..c1fe8b5 100755 --- a/docs/symbols/src/kis-js_src_modules_ajax.js.html +++ b/docs/symbols/src/kis-js_src_modules_ajax.js.html @@ -115,4 +115,34 @@ 108 ajax._do(url, data, callback, true); 109 }); 110 -111 }()); \ No newline at end of file +111 /** +112 * Watches for server-sent events, or falls back to ajax polling +113 * - defaults to 30 second intervals +114 * +115 * @name sse +116 * @function +117 * @memberOf $_ +118 * @param string url +119 * @param function callback +120 * @param [int] 30000 +121 */ +122 $_.ext('sse', function(url, callback, poll_rate){ +123 +124 var source; +125 +126 //Check for server-sent event support +127 if (typeof EventSource !== 'undefined') +128 { +129 source = new EventSource(url); +130 +131 // Apply the callback +132 source.onmessage = callback; +133 } +134 else // Ajax polling fallback +135 { +136 poll_rate = poll_rate || 30000; +137 setInterval($_.get, poll_rate, url, {}, callback); +138 } +139 }); +140 +141 }()); \ No newline at end of file diff --git a/kis-all.js b/kis-all.js index 113210d..4b1d2e4 100755 --- a/kis-all.js +++ b/kis-all.js @@ -919,6 +919,36 @@ if (typeof document !== "undefined" && !("classList" in document.createElement(" ajax._do(url, data, callback, true); }); + /** + * Watches for server-sent events, or falls back to ajax polling + * - defaults to 30 second intervals + * + * @name sse + * @function + * @memberOf $_ + * @param string url + * @param function callback + * @param [int] 30000 + */ + $_.ext('sse', function(url, callback, poll_rate){ + + var source; + + //Check for server-sent event support + if (typeof EventSource !== 'undefined') + { + source = new EventSource(url); + + // Apply the callback + source.onmessage = callback; + } + else // Ajax polling fallback + { + poll_rate = poll_rate || 30000; + setInterval($_.get, poll_rate, url, {}, callback); + } + }); + }()); // -------------------------------------------------------------------------- diff --git a/kis-lite-dom-min.js b/kis-lite-dom-min.js index 68994a3..e19b78b 100755 --- a/kis-lite-dom-min.js +++ b/kis-lite-dom-min.js @@ -376,6 +376,36 @@ ajax._do(url, data, callback, true); }); + /** + * Watches for server-sent events, or falls back to ajax polling + * - defaults to 30 second intervals + * + * @name sse + * @function + * @memberOf $_ + * @param string url + * @param function callback + * @param [int] 30000 + */ + $_.ext('sse', function(url, callback, poll_rate){ + + var source; + + //Check for server-sent event support + if (typeof EventSource !== 'undefined') + { + source = new EventSource(url); + + // Apply the callback + source.onmessage = callback; + } + else // Ajax polling fallback + { + poll_rate = poll_rate || 30000; + setInterval($_.get, poll_rate, url, {}, callback); + } + }); + }()); // -------------------------------------------------------------------------- diff --git a/kis-lite-dom.js b/kis-lite-dom.js index 68994a3..e19b78b 100755 --- a/kis-lite-dom.js +++ b/kis-lite-dom.js @@ -376,6 +376,36 @@ ajax._do(url, data, callback, true); }); + /** + * Watches for server-sent events, or falls back to ajax polling + * - defaults to 30 second intervals + * + * @name sse + * @function + * @memberOf $_ + * @param string url + * @param function callback + * @param [int] 30000 + */ + $_.ext('sse', function(url, callback, poll_rate){ + + var source; + + //Check for server-sent event support + if (typeof EventSource !== 'undefined') + { + source = new EventSource(url); + + // Apply the callback + source.onmessage = callback; + } + else // Ajax polling fallback + { + poll_rate = poll_rate || 30000; + setInterval($_.get, poll_rate, url, {}, callback); + } + }); + }()); // -------------------------------------------------------------------------- diff --git a/kis-lite-min.js b/kis-lite-min.js index 227bc1d..0f1a003 100755 --- a/kis-lite-min.js +++ b/kis-lite-min.js @@ -1,9 +1,9 @@ -(function(){if("undefined"!==typeof document.querySelector){var e,f,d,c;e=function(a){c="undefined"===typeof a?"undefined"!==typeof e.el?e.el:document.documentElement:"object"!==typeof a?f(a):a;e.prototype.el=c;var a=d(e),b;for(b in a)"object"===typeof a[b]&&(a[b].el=c);a.el=c;return a};f=function(a,b){var g;if("string"!=typeof a||"undefined"===typeof a)return a;g=null!=b&&1===b.nodeType?b:document;if(a.match(/^#([\w\-]+$)/))return document.getElementById(a.split("#")[1]);g=g.querySelectorAll(a); -return 1===g.length?g[0]:g};d=function(a){var b;if("undefined"!==typeof a){if("undefined"!==typeof Object.create)return Object.create(a);b=typeof a;if(!("object"!==b&&"function"!==b))return b=function(){},b.prototype=a,new b}};e.ext=function(a,b){b.el=c;e[a]=b};e.ext("each",function(a){if("undefined"!==typeof c.length&&c!==window){var b=c.length;if(0!==b)for(var g,d=0;dd?1:ca?1:bd?1:ca?1:b