|
1 |
| -<?php if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) !== 'xmlhttprequest') { ?> |
| 1 | +<?php if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) !== 'xmlhttprequest' || isset( $_GET['source'])) { ?> |
2 | 2 | <!DOCTYPE html>
|
3 | 3 | <html>
|
4 |
| - <head> |
| 4 | +<!-- This is an example of a page equipped to handle the startup of an application. It contains |
| 5 | + a <head> section common to all pages of the application, and its body contains the markup |
| 6 | + for all widgets that will be shared across pages. The body for each page of the application |
| 7 | + contains such markup. --> |
| 8 | +<head> |
| 9 | + |
| 10 | + <!-- The various documents reachable from within your navigation system must all have the |
| 11 | + necessary header information to be able to launch your application. Nevertheless, the |
| 12 | + server only needs to send this header information with the first request by the user. On |
| 13 | + Ajax requests by the application, this information can be discarded server-side in order |
| 14 | + to save bandwidth and to improve the time it takes to display a page. --> |
5 | 15 | <meta charset="utf-8">
|
6 | 16 | <meta name="viewport" content="width=device-width, initial-scale=1">
|
7 | 17 | <title>Ajax optimized persistent toolbars - jQuery Mobile Demos</title>
|
|
12 | 22 | <script src="../../external/jquery/jquery.js"></script>
|
13 | 23 | <script src="../_assets/js/"></script>
|
14 | 24 | <script src="../../js/"></script>
|
15 |
| - <script src="shared-widget-init.js"></script> |
| 25 | + |
| 26 | + <!-- This script contains the code that is shared between all the documents of your |
| 27 | + application. It is responsible for enhancing the shared widgets during your application's |
| 28 | + startup. --> |
| 29 | + <script id="shared-widget-init" src="shared-widget-init.js"></script> |
16 | 30 | </head>
|
17 | 31 | <body>
|
18 | 32 | <!-- The following panel is shared across all pages of the application, and must therefore be
|
19 | 33 | copied to all the documents containing the application's pages. It will only be loaded
|
20 | 34 | once with the first page. On subsequent page loads the existing widget will be reused. -->
|
21 |
| - <div id="shared-panel" data-role="panel" data-theme="a"> |
22 |
| - <form> |
23 |
| - <label for="login-field">Login:</label> |
24 |
| - <input id="login-field" name="login"> |
25 |
| - <label for="password-field">Password:</label> |
26 |
| - <input type="password" id="password-field" name="password"> |
27 |
| - </form> |
| 35 | + <div id="shared-panel" data-role="panel" data-theme="a" data-position="right"> |
| 36 | + <ul id="nav-menu-links" data-role="listview"> |
| 37 | + <li data-icon="lock"><a href="#nav-menu" data-rel="popup">Login</a></li> |
| 38 | + <li><a href="info.php" data-prefetch="true" data-transition="none">Info</a></li> |
| 39 | + <li><a href="page-b.php" data-prefetch="true" data-transition="flip">Friends</a></li> |
| 40 | + <li><a href="page-c.php" data-prefetch="true" data-transition="turn">Albums</a></li> |
| 41 | + <li><a href="page-d.php" data-prefetch="true" data-transition="slide">Emails</a></li> |
| 42 | + </ul> |
28 | 43 | </div>
|
29 |
| - <div data-role="header" data-position="fixed" data-theme="a"> |
| 44 | + <div id="shared-header" data-role="header" data-position="fixed" data-theme="a"> |
| 45 | + <!-- Shared header markup must be added to all documents of the demo to ensure any of them |
| 46 | + can serve as the start page. The server can be instructed to omit sending this portion |
| 47 | + of the data whenever the request for the document is made via Ajax. --> |
30 | 48 | <a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
31 |
| - <a href="#nav-menu" data-rel="popup" class="ui-btn ui-btn-right ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-right ui-icon-navigation">Navigation</a> |
| 49 | + <a href="#shared-panel" data-rel="panel" class="ui-btn ui-btn-right ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-right ui-icon-navigation">Navigation</a> |
32 | 50 | <div data-role="popup" id="nav-menu" data-theme="a">
|
33 |
| - <ul id="nav-menu-links"> |
34 |
| - <li data-icon="lock"><a href="#shared-panel">Login</a></li> |
35 |
| - <li><a href="info.php" data-prefetch="true" data-transition="none">Info</a></li> |
36 |
| - <li><a href="page-b.php" data-prefetch="true" data-transition="flip">Friends</a></li> |
37 |
| - <li><a href="page-c.php" data-prefetch="true" data-transition="turn">Albums</a></li> |
38 |
| - <li><a href="page-d.php" data-prefetch="true" data-transition="slide">Emails</a></li> |
39 |
| - </ul> |
| 51 | + <form class="ui-content"> |
| 52 | + <label for="login-field">Login:</label> |
| 53 | + <input id="login-field" name="login"> |
| 54 | + <label for="password-field">Password:</label> |
| 55 | + <input type="password" id="password-field" name="password"> |
| 56 | + </form> |
40 | 57 | </div>
|
41 | 58 | <h1>Fixed external header</h1>
|
42 | 59 | </div><!-- /header -->
|
43 | 60 | <?php } ?>
|
44 |
| - |
| 61 | + <!-- This is the actual page. It will always be sent to the client. --> |
45 | 62 | <div data-role="page">
|
46 | 63 |
|
47 | 64 | <div class="ui-content" role="main">
|
|
89 | 106 |
|
90 | 107 | </div><!-- /page -->
|
91 | 108 |
|
92 |
| -<?php if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) !== 'xmlhttprequest') { ?> |
93 |
| - <div data-role="footer" data-position="fixed" data-theme="a"> |
| 109 | +<?php if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) !== 'xmlhttprequest' || isset( $_GET['source'])) { ?> |
| 110 | + <div id="shared-navbar" data-role="footer" data-position="fixed" data-theme="a"> |
| 111 | + <!-- Shared navbar markup must be added to all pages of the demo to ensure any of them can |
| 112 | + serve as the start page. The server can be instructed to omit sending this portion of |
| 113 | + the data whenever the request for the document is made via Ajax. --> |
94 | 114 | <div data-role="navbar">
|
95 | 115 | <ul>
|
96 | 116 | <li><a href="info.php" data-prefetch="true" data-transition="none">Info</a></li>
|
|
0 commit comments