Modules | |
Javascript enum UTY_DIRTYPE | |
Javascript enum UTY_SORT | |
Javascript enum UTY_BROWSER | |
Functions | |
function | uty_trim (str, chars) |
function | uty_ltrim (str, chars) |
function | uty_rtrim (str, chars) |
function | uty_starts (haystack, needle) |
function | uty_ends (haystack, needle) |
function | uty_aindex (array, value) |
function | uty_aremove (array, value, count) |
function | uty_select (input, start, end) |
function | uty_text (element, text) |
function | uty_window_x (elevent) |
function | uty_window_y (elevent) |
function | uty_window_scroll_x () |
function | uty_window_scroll_y () |
function | uty_page_x (elevent) |
function | uty_page_y (elevent) |
function | uty_window_width () |
function | uty_window_height () |
function | uty_center_in_window (element) |
function | uty_window_add_onload (func, code) |
function | uty_document_disable_onselectstart (disable) |
function | uty_post (url, content, callback) |
function | uty_selection_clear () |
function uty_aindex | ( | array, | ||
value | ||||
) |
Return the index of an element in array.
array | (array) the array to search in | |
value | (string) the value to search for |
function uty_aremove | ( | array, | ||
value, | ||||
count | ||||
) |
Removes an element from array.
array | (array) the array to search in | |
value | (var) the value to search for | |
[count] | (int) splice count elements in the array, default=1 |
function uty_center_in_window | ( | element | ) |
Centers the element into the browser window.
element | (domNode) the element to center |
function uty_document_disable_onselectstart | ( | disable | ) |
Disable user selection in Internet Explorer.
disable | (bool) if true store current handler and set it to "return false" else restore old handler (if any) |
function mousedown(){ uty_document_disable_onselectstart(true); ... return false; } function mouseup(){ ... uty_document_disable_onselectstart(true); }
function uty_ends | ( | haystack, | ||
needle | ||||
) |
Check if a string ends with a certain value.
haystack | (string) the string to search in | |
needle | (string) the string to search for |
function uty_ltrim | ( | str, | ||
chars | ||||
) |
Left trim whitespaces.
str | (string) the original string | |
[chars] | (string) the charaters to trim, default="\\s" |
function uty_page_x | ( | elevent | ) |
Return e(lem|v)ent distance from the document body client left.
elevent | (var) domNode or domEvent |
function uty_page_y | ( | elevent | ) |
Return e(lem|v)ent distance from the document body client top.
elevent | (var) domNode or domEvent |
function uty_post | ( | url, | ||
content, | ||||
callback | ||||
) |
Sends async post content to url via XMLHttpRequest. Calls callback on response completed.
url | (string) the url to send request to | |
content | (string) post parameters (&separated) NB: no starting '?' is required in post! | |
callback | (pointer) callback function pointer, MUST have this signature: function(status, statusText, responseText) |
function uty_rtrim | ( | str, | ||
chars | ||||
) |
Right trim whitespaces.
str | (string) the original string | |
[chars] | (string) the charaters to trim, default="\\s" |
function uty_select | ( | input, | ||
start, | ||||
end | ||||
) |
Focus an input element and select a portion of text inside.
input | (domNode) the input element to focus | |
[start] | (int) the text selection start index, default=undefined (no text selection) | |
[end] | (int) the text selection end index, default=undefined (if start!==undefined select all text from start) |
function uty_selection_clear | ( | ) |
clear suser text selection
function uty_starts | ( | haystack, | ||
needle | ||||
) |
Check if a string starts with a certain value.
haystack | (string) the string to search in | |
needle | (string) the string to search for |
function uty_text | ( | element, | ||
text | ||||
) |
get/set the html text content (escape html special chars).
element | (domNode) the element to get/set the text content from/to | |
[text] | (string) if!=undefined the text content will be set before returning |
function uty_trim | ( | str, | ||
chars | ||||
) |
trim whitespaces
str | (string) the original string | |
[chars] | (string) the charaters to trim, default="\\s" |
function uty_window_add_onload | ( | func, | ||
code | ||||
) |
Add a listener to the window onload event.
func | (pointer) event handler function pointer | |
[code] | javascript expression for older browsers, default=undefined |
e.g.: uty_window_add_onload(function(){alert('hello');}, "alert('hello');");
function uty_window_height | ( | ) |
function uty_window_scroll_x | ( | ) |
function uty_window_scroll_y | ( | ) |
function uty_window_width | ( | ) |
function uty_window_x | ( | elevent | ) |
Return e(lem|v)ent distance from the browser window client left.
elevent | (var) domNode or domEvent |
function uty_window_y | ( | elevent | ) |
Return e(lem|v)ent distance from the browser window client top.
elevent | (var) domNode or domEvent |
Copyright © 2010 Attilio Pavone - www.utillyty.eu