| |
Shortcuts
Page history last edited by vozcelik 3 yrs ago
s@rdalya has a bunch of predefined shortcuts to make coding with s@rdalya faster and easier than ever. To use a shortcut, simply preceed the shortcut method with an underscore(_) and a dot(.) like in _.myshortcutmethod(). As a convention, all of our shortcut methods are in lowercase, not camelCase, to save some typing time. You can also define your own shortcuts by editing /** shortcuts ... **/ section in s@rdalya's source. Or you may send it as a feature request to us.
| shorthand notation |
resolves to |
| _.ajax(); | new XHRequest(); | | _.xhr(); | _.ajax(); |
| _.o(elm); | new CBObject(elm).getObject(); | | _.id(elm); | new CBObject(elm).getID(); | | _.gcn(str); | DOMManager.getElementsByClassName(str); | | _.gid(str); | document.getElementById(str); | | _.gtn(str); | document.getElementsByTagName(str); | | _.sweep(elm); | DOMManager.sweep(elm); | _.elm(x); | document.createElement(x); | _.load(d); | DOMManager.quickLoad(d); |
_.child(o,p); | DOMManager.isChild(o,p); |
| _.evto(e); | new EventObject(e); | | _.oevt(e); |
| | _.stop(e) |
| if e is an EventObject | e.cancelDefaultAction(); | | if e is an event reference | new EventObject(e).cancelDefaultAction(); |
| | _.src(e); |
| | _.chain(a,b,c,d); | EventHandler.addEventListener(a,b,c,d); | | _.unchain(a,b,c,d); | EventHandler.removeEventListener(a,b,c,d); |
| _.getclass(elm); | StyleManager.getClass(elm); | | _.setclass(elm,strc); | StyleManager.setClass(elm,strc); | | _.getstyle(obj,str); | StyleManager.getStyle(obj,str); | | _.setstyle(obj,str,val); | StyleManager.setStyle(obj,str,val); | | _.addclass(obj,arClass); | StyleManager.addClass(obj,arClass); | | _.remclass(obj,arClass); | StyleManager.removeClass(obj,arClass); | | _.hasclass(obj,strClass); | StyleManager.hasClassName(obj,strClass); |
| _.l(x); | new LayerObject(x); | | _.dl(e,c1,c2,b); | new DraggableLayer(e,c1,c2,b); | | _.tip(e,i1,i2,l,t); | new ToolTip(e,i1,i2,l,t); | | _.ib(e,s1,s2,i); | return new ImageButton(e,s1,s2,i); | | _.ir(e,s1,s2); | new ImageRollover(e,s1,s2); | | _.wo(); | WindowObject; |
| _.ajaxdom(); | Validator.isDOMEnabled()&&Validator.isAjaxEnabled(); | | _.integer(o); | Validator.isInteger(o); | | _.numeric(o); | Validator.isNumeric(o); | | _.positive(o); | Validator.isPositive(o); | | _.whitespace(o); | Validator.isWhiteSpace(o); | | _.string(o); | Validator.isString(o); | | _.defined(o); | Validator.isDefined(o); | | _.formelm(o); | FormManager.isFormElement(o); | | _.email(o); | Validator.isEmail(o); | | _.url(o); | Validator.isValidURL(o); |
| _.safehtml(v); | TextFormatter.safeHTML(v); | | _.safews(v); | TextFormatter.safeWhiteSpace(v); | | _.qry(s); | TextFormatter.splitQueryString(s); |
| _.scook(t,v,i); | CookieManager.set(t,v,i); | | _.gcook(s); | CookieManager.get(s); |
| _.preparefields(); | FormManager.prepareFormField(); | | _.field(e,s1,s2,s3); | new FormField(e,s1,s2,s3); |
| _.dim(x,y); | new Dimension(x,y); | | _.cns(x,y,z,t); | new Constraint(x,y,z,t); | | _.coord(); | CursorTracker.getCursorPosition(); |
| _.nill() | Constant.NULL; |
| _.GLUE(varargin) | See the DOMCreate example for details. | | _.e(varargin) | See the DOMCreate example for details. |
See Also
None given.
Usage Examples
Shortcuts
|
|
Tip: To turn text into a link, highlight the text, then click on a page or file from the list above.
|
|
|
|
|
Comments (0)
You don't have permission to comment on this page.