Profile
Achievement
kouphax's Recent Snippets
- All /
« Prev 1 Next »
Extracts a string paremeter from the url query string. Basic operation wont handle multiples such as radio buttons etc. Just gets the first instance of the name and returns it's value.
1
680
posted 15 years ago by kouphax
Simple function for turning RETURN key presses into TAB key presses. Focuses input element next in the DOM (usually makes sense), unless we are at the end of the form, at which point it focuses the first element in the form for cyclical purposes.
2
2895
posted 15 years ago by kouphax
Use this command to prevent seeing ....68 more type stack trace message in Grails output.
0
612
posted 15 years ago by kouphax
Using Groovy you can extend the Sql, DataSet and GroovyResultSet objects present in the language to do simple object mapping similar to iBatis et al. An example of using the code below
/* POGO used in the mapping */
class BranchFax {...
0
1101
posted 15 years ago by kouphax
Escape all special regex characters (.*+?|()[]{}\) from a string. Useful when dynamically building a Regular Expression object based on input text that could hold regex characters.
2
1223
posted 16 years ago by kouphax
This code, when placed at the end of the body tag will set focus on the first visible enabled element on the screen. It considers visibility as well as all forms on-screen
0
711
posted 16 years ago by kouphax
Based on my Annotations plugin this plugin offers the ability to use Mask annotations to apply input masks over input elements on a page. Very much BETA. See comments for use.
<!--@Mask("##/##/####")-->
0
811
posted 16 years ago by kouphax
Constraints plugin (requires annotation plugin).
This is the second draft version that has been severly refactoed both internally and externally.
0
760
posted 16 years ago by kouphax
The annotaion framework provides access to client side comment based DOM annotations. The framework does not imply any specific usage and is essentially useless on it's own. It merely provides another way to offer metadata for elements.
An annota...
1
1827
posted 16 years ago by kouphax
remove(array) --> array
Array.remove(a) simply removes all the items in the passed in array from the current scope array. Good for bulk operations.
0
776
posted 16 years ago by kouphax
This regular expression matches any trailing whitespace at the end of a line (whitespace and tabs). Replace this with nothing to remove trailing whitespace from files.
1
985
posted 16 years ago by kouphax
jQuery Plugin for returning selected DOM Nodes in DOM order. e.g. $('img.L,img.Y') will not be guaranteed DOM order (usually all the L's then all the Y's).
Currently only works with IE and FF (that's all I needed).
1
865
posted 16 years ago by kouphax
This function will sort an array of DOM elements in order of the DOM position. Useful when using calls such as $$("img.L,img.M") which doesn;t return a sorted element array.
It uses prototype but you can replace the Prototype.Browser stuff with a...
0
1100
posted 16 years ago by kouphax
The only function the Tag Cloud singleton exposes it the process() function which take 3 arguments.
1. Cloud Data - Required. Needs to have a display value property and a count property. The actual property names are configurable but by default...
0
747
posted 16 years ago by kouphax