header.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?
  2. # Generic XHTML 1.1 header
  3. function printHeader($title) {
  4. print <<<ENDOLA
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  6. "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head>
  9. <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
  10. <title>${title}</title>
  11. ENDOLA;
  12. printJQuery();
  13. echo '</head><body>';
  14. }
  15. # Generic XHTML 1.1 footer
  16. function printFooter() {
  17. print <<<ENDOLA
  18. </body>
  19. </html>
  20. ENDOLA;
  21. }
  22. function printJQuery() {
  23. # Determine our protocol
  24. $protocol = protocolName();
  25. # Print
  26. echo <<<ENDOLA
  27. <!-- Default JQuery -->
  28. <script type="text/javascript" src="${protocol}://code.jquery.com/jquery-1.11.2.min.js"></script>
  29. <!-- Provide # support in JQuery-mobile autodividers -->
  30. <!-- Must be loaded before JQuery-mobile -->
  31. <script type="text/javascript">
  32. $( document ).on( "mobileinit", function() {
  33. $.mobile.listview.prototype.options.autodividersSelector = function( elt ) {
  34. var text = $.trim( elt.text() ) || null;
  35. if ( !text ) {
  36. return null;
  37. }
  38. if ( !isNaN(parseFloat(text)) ) {
  39. return "#";
  40. } else {
  41. text = text.slice( 0, 1 ).toUpperCase();
  42. return text;
  43. }
  44. };
  45. });
  46. </script>
  47. <!-- Default JQuery-mobile -->
  48. <link rel="stylesheet" href="${protocol}://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
  49. <script type="text/javascript" src="${protocol}://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
  50. ENDOLA;
  51. }
  52. ?>