/demos/widgets/loader/index.php

https://bitbucket.org/zachjarvinen/jquery-mobile · PHP · 97 lines · 81 code · 16 blank · 0 comment · 6 complexity · 1ff8dea71f5d1609c108f115666dee81 MD5 · raw file

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>Loader - jQuery Mobile Demos</title>
  7. <link rel="stylesheet" href="../../../css/themes/default/jquery.mobile.css">
  8. <link rel="stylesheet" href="../../_assets/css/jqm-demos.css">
  9. <link rel="shortcut icon" href="../../favicon.ico">
  10. <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,700">
  11. <script src="../../../js/jquery.js"></script>
  12. <script src="../../_assets/js/"></script>
  13. <script src="../../../js/"></script>
  14. <script>
  15. $( document ).on( "click", ".show-page-loading-msg", function() {
  16. var $this = $( this ),
  17. theme = $this.jqmData( "theme" ) || $.mobile.loader.prototype.options.theme,
  18. msgText = $this.jqmData( "msgtext" ) || $.mobile.loader.prototype.options.text,
  19. textVisible = $this.jqmData( "textvisible" ) || $.mobile.loader.prototype.options.textVisible,
  20. textonly = !!$this.jqmData( "textonly" );
  21. html = $this.jqmData( "html" ) || "";
  22. $.mobile.loading( "show", {
  23. text: msgText,
  24. textVisible: textVisible,
  25. theme: theme,
  26. textonly: textonly,
  27. html: html
  28. });
  29. })
  30. .on( "click", ".hide-page-loading-msg", function() {
  31. $.mobile.loading( "hide" );
  32. });
  33. </script>
  34. </head>
  35. <body>
  36. <div data-role="page" class="jqm-demos" data-quicklinks="true">
  37. <div data-role="header" class="jqm-header">
  38. <h1 class="jqm-logo"><a href="../../"><img src="../../_assets/img/jquery-logo.png" alt="jQuery Mobile Framework"></a></h1>
  39. <a href="#" class="jqm-navmenu-link" data-icon="bars" data-iconpos="notext">Navigation</a>
  40. <a href="#" class="jqm-search-link" data-icon="search" data-iconpos="notext">Search</a>
  41. <?php include( '../../search.php' ); ?>
  42. </div><!-- /header -->
  43. <div data-role="content" class="jqm-content">
  44. <h1>Loader <a href="http://api.jquerymobile.com/page-loading/" data-ajax="false" data-role="button" data-inline="true" data-mini="true" data-icon="arrow-r" data-iconpos="right" class="jqm-api-link">API</a></h1>
  45. <p class="jqm-intro">A small loading overlay displayed when jQuery Mobile loads in content via AJAX, or for use in custom notifications.
  46. </p>
  47. <h2>Standard loader</h2>
  48. <p>The loader overlay can be icon only, text only or both. These demos rely on a custom JavaScript, view the source to see how it works.</p>
  49. <div data-demo-html="true" data-demo-js="true">
  50. <button class="show-page-loading-msg" data-theme="d" data-textonly="false" data-textvisible="false" data-msgtext="" data-inline="true">Icon (default)</button>
  51. <button class="show-page-loading-msg" data-theme="d" data-textonly="false" data-textvisible="true" data-msgtext="" data-inline="true">Icon + text</button>
  52. <button class="show-page-loading-msg" data-theme="d" data-textonly="true" data-textvisible="true" data-msgtext="Text only loader" data-inline="true">Text only</button>
  53. <button class="hide-page-loading-msg" data-inline="true" data-icon="delete">Hide</button>
  54. </div><!--/demo-html -->
  55. <h2>Custom HTML</h2>
  56. <p>Any HTML can be added to the loader overlay</p>
  57. <div data-demo-html="true" data-demo-js="true">
  58. <button class="show-page-loading-msg" data-theme="c" data-textonly="true" data-textvisible="true" data-msgtext="Custom Loader" data-inline="true" data-html="<span class='ui-bar ui-shadow ui-overlay-d ui-corner-all'><img src='../../_assets/img/jquery-logo.png' /><h2>is loading for you ...</h2></span>" data-iconpos="right">Custom HTML</button>
  59. <button class="hide-page-loading-msg" data-inline="true" data-icon="delete">Hide</button>
  60. </div><!--/demo-html -->
  61. <h2>Theme</h2>
  62. <p>The theme swatch can be set on the loader overlay. </p>
  63. <div data-demo-html="true" data-demo-js="true">
  64. <button class="show-page-loading-msg" data-theme="a" data-textonly="false" data-textvisible="true" data-msgtext="Loading theme a" data-inline="true">A</button>
  65. <button class="show-page-loading-msg" data-theme="b" data-textonly="false" data-textvisible="true" data-msgtext="Loading theme b" data-inline="true">B</button>
  66. <button class="show-page-loading-msg" data-theme="c" data-textonly="false" data-textvisible="true" data-msgtext="Loading theme c" data-inline="true">C</button>
  67. <button class="show-page-loading-msg" data-theme="d" data-textonly="false" data-textvisible="true" data-msgtext="Loading theme d" data-inline="true">D</button>
  68. <button class="show-page-loading-msg" data-theme="e" data-textonly="false" data-textvisible="true" data-msgtext="Loading theme e" data-inline="true">E</button>
  69. <button class="hide-page-loading-msg" data-inline="true" data-icon="delete">Hide</button>
  70. </div><!--/demo-html -->
  71. <div data-demo-html="true">
  72. </div><!-- /data-demo -->
  73. </div><!-- /content -->
  74. <div data-role="footer" class="jqm-footer">
  75. <p class="jqm-version"></p>
  76. <p>Copyright 2013 The jQuery Foundation</p>
  77. </div><!-- /footer -->
  78. <?php include( '../../global-nav.php' ); ?>
  79. </div><!-- /page -->
  80. </body>
  81. </html>