Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 16f1e47

Browse files
committed
Initial checkin of config-props.html, a utility for quickly assessing the support property settings, for a given device/browser, as calculated by jQuery Core and jQuery Mobile.
1 parent c716ab7 commit 16f1e47

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

tools/config-props.html

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<!DOCTYPE HTML>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width">
6+
<title>Configuration Properties</title>
7+
<link rel="stylesheet" href="../css/themes/default/" />
8+
<style>
9+
10+
.prop { float: left; font-weight: bold; }
11+
.val { float: right; margin-left: 2em; }
12+
13+
.ui-li { overflow: hidden; }
14+
15+
</style>
16+
<script src="../js/jquery.js"></script>
17+
<script src="../js/"></script>
18+
<script>
19+
20+
function simpleEntityEncode( str )
21+
{
22+
return ( str + "" ).replace( /&/, "&amp;" ).replace( /</, "&lt;" ).replace( />/, "&gt" );
23+
}
24+
25+
function getObjectPropsAsArray( obj, doSort )
26+
{
27+
var props = [], prop;
28+
for ( prop in obj ) {
29+
props.push( prop );
30+
}
31+
return doSort ? props.sort() : props;
32+
}
33+
34+
function getPropsAsListviewMarkkup( obj )
35+
{
36+
var props = getObjectPropsAsArray( obj || {}, true ),
37+
propStr = "<ul data-role='listview' data-inset='true'>\n",
38+
prop, val, i;
39+
40+
for ( i = 0; i < props.length; i++ ) {
41+
prop = props[ i ];
42+
val = obj[ prop ],
43+
vtype = typeof val;
44+
45+
if ( vtype !== "function" && vtype !== "object" ) {
46+
propStr += "\t<li><span class='prop'>" + simpleEntityEncode( prop ) + ":</span><span class='val'>" + simpleEntityEncode( val ) + "</span></li>\n";
47+
}
48+
}
49+
50+
return propStr + "</ul>\n";
51+
}
52+
53+
$( document ).bind( "pageinit", function( e ) {
54+
var $content = $( e.target ).find( ".ui-content");
55+
56+
$( "<h2>$.mobile</h2>" ).appendTo( $content );
57+
$( getPropsAsListviewMarkkup( $.mobile ) ).appendTo( $content ).listview();
58+
$( "<h2>$.support</h2>" ).appendTo( $content );
59+
$( getPropsAsListviewMarkkup( $.support ) ).appendTo( $content ).listview();
60+
});
61+
62+
</script>
63+
</head>
64+
65+
<body>
66+
<div data-role="page">
67+
<div data-role="header"><h1>Configuration Properties</h1></div>
68+
<div data-role="content">
69+
<p>Below is a dump of the non-function/object properties of the $.mobile and $.support objects. These properties typically control how the jQuery Mobile framework behaves on the various devices/platforms. You can use this page to quickly assess the default support configuration calculated by both jQuery Core and jQuery Mobile.</p>
70+
</div>
71+
</div>
72+
</body>
73+
</html>

0 commit comments

Comments
 (0)