Skip to content

Commit 92da39d

Browse files
committed
Added config test page for loading message
1 parent e37c7e9 commit 92da39d

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

docs/config/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ <h3>loadingMessage - false</h3>
6161
<p>Set the text that appears when a page is loading. If set to false, the message will not appear at all.</p>
6262
</a>
6363
</li>
64+
<li>
65+
<a href="loadingMessageTextVisible.html" data-ajax="false">
66+
<h3>loadingMessageTextVisible - true</h3>
67+
<p>Show text in the page loader. This page also demonstrates options for ad hoc message generation.</p>
68+
</a>
69+
</li>
6470
<li>
6571
<a href="pageLoadErrorMessage.html" data-ajax="false">
6672
<h3>pageLoadErrorMessage - "Yikes, we broke the internet!"</h3>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<!DOCTYPE html>
2+
<html class="ui-mobile-rendering">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>jQuery Mobile Docs - Configuration</title>
7+
<link rel="stylesheet" href="../../css/themes/default/jquery.mobile.css" />
8+
<link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
9+
10+
11+
<script src="../../external/requirejs/require.js"></script>
12+
<script src="../../js/jquery.js"></script>
13+
<script>
14+
$(document).bind("mobileinit", function(){
15+
$.mobile.loadingMessageTextVisible = true;
16+
});
17+
</script>
18+
<script>
19+
require( {
20+
baseUrl: "../../js"
21+
}) ( [ "jquery.mobile.docs" ] )
22+
</script>
23+
</head>
24+
<body>
25+
26+
<div data-role="page">
27+
<script>
28+
$(document).on("click", ".show-page-loading-msg", function() {
29+
var $this = $( this ),
30+
theme = $this.jqmData("theme") || $.mobile.loadingMessageTheme,
31+
msgText = $this.jqmData("msgtext") || $.mobile.loadingMessage,
32+
textonly = !!$this.jqmData("textonly");
33+
$.mobile.showPageLoadingMsg(theme, msgText, textonly);
34+
})
35+
.on("click", ".hide-page-loading-msg", function() {
36+
$.mobile.hidePageLoadingMsg();
37+
});
38+
</script>
39+
40+
<div data-role="header" data-theme="f">
41+
<h1>Config applied</h1>
42+
<a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
43+
</div><!-- /header -->
44+
45+
<div data-role="content">
46+
47+
<h2>loadingMessage text is now visible</h2>
48+
<p>To test, hit the button below and browse the docs. Note that if a link causes a refresh, this setting will be lost and the default settings will be seen.</p>
49+
<a href="../../index.html" data-role="button" data-icon="arrow-r" data-iconpos="right">Browse docs</a>
50+
51+
<p>To display the loading message on demand:</p>
52+
<pre><code>$.mobile.showPageLoadingMsg();</code></pre>
53+
<p>Click the buttons below to show and hide the loading message with the default options.</p>
54+
<div data-role="controlgroup">
55+
<button class="show-page-loading-msg" data-inline="false" data-icon="arrow-r" data-iconpos="right">Show</button>
56+
<button class="hide-page-loading-msg" data-inline="false" data-icon="delete" data-iconpos="right">Hide</button>
57+
</div>
58+
59+
<h2>Theming the loading message</h2>
60+
<p>To display the loading message with a different theme and message:</p>
61+
<pre><code>$.mobile.showPageLoadingMsg(<strong>"a", "Loading theme a..."</strong>);</code></pre>
62+
<p>The theme and message can be changed on the fly by calling the method again. Click the buttons below to see the loading message with the indicated theme.</p>
63+
<div data-role="controlgroup">
64+
<button class="show-page-loading-msg" data-theme="a" data-icon="arrow-r" data-iconpos="right" data-msgtext="Loading theme a...">Theme a</button>
65+
<button class="show-page-loading-msg" data-theme="b" data-icon="arrow-r" data-iconpos="right" data-msgtext="Loading theme b...">Theme b</button>
66+
<button class="show-page-loading-msg" data-theme="c" data-icon="arrow-r" data-iconpos="right" data-msgtext="Loading theme c...">Theme c</button>
67+
<button class="show-page-loading-msg" data-theme="d" data-icon="arrow-r" data-iconpos="right" data-msgtext="Loading theme d...">Theme d</button>
68+
<button class="show-page-loading-msg" data-theme="e" data-icon="arrow-r" data-iconpos="right" data-msgtext="Loading theme e...">Theme e</button>
69+
<button class="hide-page-loading-msg" data-icon="delete" data-iconpos="right">Hide</button>
70+
</div>
71+
72+
<h2>Text only messages</h2>
73+
<p>To display the loading message with no spinner:</p>
74+
<pre><code>$.mobile.showPageLoadingMsg("a", "No spinner", <strong>true</strong>);</code></pre>
75+
<p>Click the button below to see the loading message with no spinner.</p>
76+
<div data-role="controlgroup">
77+
<button class="show-page-loading-msg" data-textonly="true" data-msgtext="Look Ma, no spinner!" data-icon="arrow-r" data-iconpos="right">Show</button>
78+
<button class="hide-page-loading-msg" data-inline="false" data-icon="delete" data-iconpos="right">Hide</button>
79+
</div>
80+
81+
82+
</div><!-- /ui-body wrapper -->
83+
</div><!-- /page -->
84+
85+
</body>
86+
</html>

0 commit comments

Comments
 (0)