src/js/libs/spiritual-gui.js
function(elm) {
		var res = null;
		if (elm.nodeType === Node.ELEMENT_NODE) {
			var doc = elm.ownerDocument;
			var win = doc.defaultView;
			if (win.gui) {
				if (win.gui.attributes.every(function(fix) {
					res = this._evaluateinline(elm, win, fix);
					return res === null;
				}, this)) {
					if (gui.hasChannels()) {
						win.gui._channels.every(function(def) {
							var select = def[0];
							var spirit = def[1];
							if (gui.CSSPlugin.matches(elm, select)) {
								res = spirit;
							}
							return res === null;
						}, this);
					}
				}
			}
		}
		return res;
	}
function(elm) {
		var res = null;
		if (elm.nodeType === Node.ELEMENT_NODE) {
			var doc = elm.ownerDocument;
			var win = doc.defaultView;
			if (win.gui) {
				if (win.gui.attributes.every(function(fix) {
					res = this._evaluateinline(elm, win, fix);
					return res === null;
				}, this)) {
					if (gui.hasChannels()) {
						win.gui._channels.every(function(def) {
							var select = def[0];
							var spirit = def[1];
							if (gui.CSSPlugin.matches(elm, select)) {
								res = spirit;
							}
							return res === null;
						}, this);
					}
				}
			}
		}
		return res;
	}
function ( elm ) { var res = null ; if ( elm . nodeType === Node . ELEMENT_NODE ) { var doc = elm . ownerDocument ; var win = doc . defaultView ; if ( win . gui ) { if ( win . gui . attributes . every ( function ( fix ) { res = this . _evaluateinline ( elm , win , fix ) ; return res === null ; } , this ) ) { if ( gui . hasChannels ( ) ) { win . gui . _channels . every ( function ( def ) { var select = def [ 0 ] ; var spirit = def [ 1 ] ; if ( gui . CSSPlugin . matches ( elm , select ) ) { res = spirit ; } return res === null ; } , this ) ; } } } } return res ; }
Get Spirit constructor for element.

1. Test for element `gui` attribute(s)
2. Test if element matches selectors
@param {Element} element
@returns {function} Spirit constructor
Get Spirit constructor for element .