src/js/libs/spiritual-edb.js
function(elm) {
			var index = -1;
			var parts = [];
			function hasid(elm) {
				if (elm.id) {
					try {
						gui.DOMPlugin.q(elm.parentNode, elm.id);
						return true;
					} catch (malformedexception) {}
				}
				return false;
			}
			while (elm && elm.nodeType === Node.ELEMENT_NODE) {
				if (hasid(elm)) {
					parts.push("#" + elm.id);
					elm = null;
				} else {
					if (elm.localName === "body") {
						parts.push("body");
						elm = null;
					} else {
						index = gui.DOMPlugin.ordinal(elm) + 1;
						parts.push(">" + elm.localName + ":nth-child(" + index + ")");
						elm = elm.parentNode;
					}
				}
			}
			return parts.reverse().join("");
		}
function(elm) {
			var index = -1;
			var parts = [];
			function hasid(elm) {
				if (elm.id) {
					try {
						gui.DOMPlugin.q(elm.parentNode, elm.id);
						return true;
					} catch (malformedexception) {}
				}
				return false;
			}
			while (elm && elm.nodeType === Node.ELEMENT_NODE) {
				if (hasid(elm)) {
					parts.push("#" + elm.id);
					elm = null;
				} else {
					if (elm.localName === "body") {
						parts.push("body");
						elm = null;
					} else {
						index = gui.DOMPlugin.ordinal(elm) + 1;
						parts.push(">" + elm.localName + ":nth-child(" + index + ")");
						elm = elm.parentNode;
					}
				}
			}
			return parts.reverse().join("");
		}
function ( elm ) { var index = - 1 ; var parts = [ ] ; function hasid ( elm ) { if ( elm . id ) { try { gui . DOMPlugin . q ( elm . parentNode , elm . id ) ; return true ; } catch ( malformedexception ) { } } return false ; } while ( elm && elm . nodeType === Node . ELEMENT_NODE ) { if ( hasid ( elm ) ) { parts . push ( "#" + elm . id ) ; elm = null ; } else { if ( elm . localName === "body" ) { parts . push ( "body" ) ; elm = null ; } else { index = gui . DOMPlugin . ordinal ( elm ) + 1 ; parts . push ( ">" + elm . localName + ":nth-child(" + index + ")" ) ; elm = elm . parentNode ; } } } return parts . reverse ( ) . join ( "" ) ; }
Compute selector for form field. We scope it to
nearest element ID or fallback to document body.
@param {Element} element
@returns {string}
Compute selector for form field . We scope it to nearest element ID or fallback to document body .