siesta-lite
Version:
Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers
85 lines (66 loc) • 2.54 kB
HTML
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
<style type="text/css">
.highlight { display: block; background-color: #ddd; }
</style>
<script type="text/javascript">
function highlight() {
document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
}
</script>
</head>
<body onload="prettyPrint(); highlight();">
<pre class="prettyprint lang-js">/*
Siesta 5.6.1
Copyright(c) 2009-2022 Bryntum AB
https://bryntum.com/contact
https://bryntum.com/products/siesta/license
*/
Role('Ariadne.ExtJSComponentQueryFinder.Role.ExtJSComponentHelper', {
does : Ariadne.DomQueryFinder.Role.DomHelper,
has : {
},
methods : {
getComponentXType : function (cmp) {
var xtype = this.getComponentOwnXType(cmp)
if (xtype) return xtype
xtype = cmp.getXTypes && cmp.getXTypes()
if (!xtype) return null
xtype = xtype.split('/')
return xtype[ xtype.length - 1 ]
},
// might be not available if component does not define the "alias" property in "widget" namespace
getComponentOwnXType : function (cmp) {
return (cmp.getXType && cmp.getXType()) || cmp.xtype || cmp.xtypes[ 0 ]
},
escapeCQSelector : function (selector) {
return this.escapeDomSelector(selector)
},
// Ext4 breaks when xtype contains dot, even if it is properly escaped
// however [xtype=value\.with\.dots] is supported
// this is why we need this method
getExt4ProofXtype : function (cmp, Ext) {
var xtype = this.getComponentXType(cmp)
var escaped = this.escapeCQSelector(xtype)
var extVersion = Ext.getVersion('ext')
if (extVersion && extVersion.major == 4 && xtype != escaped)
return {
query : '[xtype=' + escaped + ']',
leading : false
}
else
return {
query : escaped,
leading : true
}
}
}
});
</pre>
</body>
</html>