/demos/navigation1.html

https://github.com/abstractmatter/kaiten · HTML · 84 lines · 82 code · 2 blank · 0 comment · 0 complexity · f14c6ec9b85483ff778abd2da605a3a6 MD5 · raw file

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>Kaiten</title>
  6. <meta name="apple-mobile-web-app-capable" content="yes"/>
  7. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  9. <link rel="icon" type="image/png" href="../images/kaiten-boxed-favicon.png" sizes="16x16" />
  10. <link rel="stylesheet" type="text/css" href="../css/kaiten.min.css" />
  11. <script type="text/javascript" src="../js/jquery.min.js">&#160;</script>
  12. <script type="text/javascript" src="../js/jquery-ui.custom.min.js">&#160;</script>
  13. <script type="text/javascript" src="../js/kaiten.min.js">&#160;</script>
  14. <script type="text/javascript" src="../js/jquery.ba-resize.min.js">&#160;</script>
  15. </head>
  16. <body>
  17. <div id="container"></div>
  18. <div id="custom-options-text" class="hidden">
  19. You can add your custom options here.<br /><br />
  20. For more information and documentation, please visit our website :<br /><br />
  21. <a href="http://www.nectil.com/kaiten" target="_blank">http://www.nectil.com/kaiten</a>
  22. </div>
  23. <script type="text/javascript">
  24. (function($){
  25. // keep a reference to Kaiten's container
  26. $K = $('#container');
  27. // initialize Kaiten
  28. $K.kaiten({
  29. // 3 panels max. on the screen
  30. columnWidth : '33%',
  31. optionsSelector : '#custom-options-text',
  32. startup : function(dataFromURL){
  33. // handle URL parameters sent when opening a panel in a new tab
  34. if (dataFromURL && dataFromURL.kConnector) // checking kConnector allows the home panel to be opened in a new tab
  35. {
  36. this.kaiten('load', dataFromURL);
  37. }
  38. else
  39. {
  40. // create the home panel HTML...
  41. var $navBlock = kTemplater.jQuery('block.navigation');
  42. $navBlock.append(kTemplater.jQuery('line.summary', {
  43. label : 'A basic navigation example',
  44. info : 'Click on any navigation item...<br /><br />'+
  45. 'You can also ctrl-click to open the target panel in a new tab',
  46. iconURL : 'images/navigation-32.png'
  47. }));
  48. // ...add navigation to a page on our server...
  49. $navBlock.append(kTemplater.jQuery('line.navigation', {
  50. label : 'Load content from panel1.html',
  51. data : { kConnector:"html.page", url:"sample-navigation/panel1.html", kTitle:"Panel 1" },
  52. iconURL : 'sample-navigation/images/star-16.png'
  53. }));
  54. // ...add navigation to a page on our server...
  55. $navBlock.append(kTemplater.jQuery('line.navigation', {
  56. label : 'Load content from panel2.html',
  57. data : { kConnector:"html.page", url:"sample-navigation/panel2.html", kTitle:"Panel 2" },
  58. iconURL : 'sample-navigation/images/star-16.png'
  59. }));
  60. // ...add navigation to a page on our server...
  61. $navBlock.append(kTemplater.jQuery('line.navigation', {
  62. label : 'Load content from panel3.html',
  63. data : { kConnector:"html.page", url:"sample-navigation/panel3.html", kTitle:"Panel 3" },
  64. iconURL : 'sample-navigation/images/star-16.png'
  65. }));
  66. // ...add navigation to a page outside our server
  67. $navBlock.append(kTemplater.jQuery('line.navigation', {
  68. label : 'Load external content from www.nectil.com/kaiten',
  69. data : { kConnector:"iframe", url:"http://www.nectil.com/kaiten" },
  70. iconURL : 'sample-navigation/images/earth-16.png'
  71. }));
  72. this.kaiten('load', function(data, $panel, $kaiten){
  73. $panel.kpanel('setTitle', 'Basic navigation');
  74. return kTemplater.jQuery('panel.body', { content : $navBlock });
  75. });
  76. }
  77. }
  78. });
  79. })(jQuery);
  80. </script>
  81. </body>
  82. </html>