reveal.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. /*!
  2. * reveal.js 1.3
  3. * http://lab.hakim.se/reveal-js
  4. * MIT licensed
  5. *
  6. * Copyright (C) 2011 Hakim El Hattab, http://hakim.se
  7. */
  8. var Reveal = (function(){
  9. var HORIZONTAL_SLIDES_SELECTOR = '#reveal .slides>section',
  10. VERTICAL_SLIDES_SELECTOR = '#reveal .slides>section.present>section',
  11. // The horizontal and verical index of the currently active slide
  12. indexh = 0,
  13. indexv = 0,
  14. // Configurations options, can be overridden at initialization time
  15. config = {
  16. controls: false,
  17. progress: false,
  18. history: false,
  19. transition: 'default',
  20. theme: 'default',
  21. mouseWheel: true,
  22. rollingLinks: true
  23. },
  24. // Slides may hold a data-state attribute which we pick up and apply
  25. // as a class to the body. This list contains the combined state of
  26. // all current slides.
  27. state = [],
  28. // Cached references to DOM elements
  29. dom = {},
  30. // Detect support for CSS 3D transforms
  31. supports3DTransforms = document.body.style['perspectiveProperty'] !== undefined ||
  32. document.body.style['WebkitPerspective'] !== undefined ||
  33. document.body.style['MozPerspective'] !== undefined ||
  34. document.body.style['msPerspective'] !== undefined,
  35. supports2DTransforms = document.body.style['transformProperty'] !== undefined ||
  36. document.body.style['WebkitTransform'] !== undefined ||
  37. document.body.style['MozTransform'] !== undefined ||
  38. document.body.style['msTransform'] !== undefined ||
  39. document.body.style['OTransform'] !== undefined,
  40. // Throttles mouse wheel navigation
  41. mouseWheelTimeout = 0,
  42. // Delays updates to the URL due to a Chrome thumbnailer bug
  43. writeURLTimeout = 0;
  44. /**
  45. * Starts up the slideshow by applying configuration
  46. * options and binding various events.
  47. */
  48. function initialize( options ) {
  49. if( !supports2DTransforms && !supports3DTransforms ) {
  50. document.body.setAttribute( 'class', 'no-transforms' );
  51. // If the browser doesn't support transforms we won't be
  52. // using JavaScript to control the presentation
  53. return;
  54. }
  55. // Cache references to DOM elements
  56. dom.wrapper = document.querySelector( '#reveal' );
  57. dom.progress = document.querySelector( '#reveal .progress' );
  58. dom.progressbar = document.querySelector( '#reveal .progress span' );
  59. dom.controls = document.querySelector( '#reveal .controls' );
  60. dom.controlsLeft = document.querySelector( '#reveal .controls .left' );
  61. dom.controlsRight = document.querySelector( '#reveal .controls .right' );
  62. dom.controlsUp = document.querySelector( '#reveal .controls .up' );
  63. dom.controlsDown = document.querySelector( '#reveal .controls .down' );
  64. // Bind all view events
  65. document.addEventListener('keydown', onDocumentKeyDown, false);
  66. document.addEventListener('touchstart', onDocumentTouchStart, false);
  67. window.addEventListener('hashchange', onWindowHashChange, false);
  68. dom.controlsLeft.addEventListener('click', preventAndForward( navigateLeft ), false);
  69. dom.controlsRight.addEventListener('click', preventAndForward( navigateRight ), false);
  70. dom.controlsUp.addEventListener('click', preventAndForward( navigateUp ), false);
  71. dom.controlsDown.addEventListener('click', preventAndForward( navigateDown ), false);
  72. // Copy options over to our config object
  73. extend( config, options );
  74. // Fall back on the 2D transform theme 'linear'
  75. if( supports3DTransforms === false ) {
  76. config.transition = 'linear';
  77. }
  78. if( config.controls ) {
  79. dom.controls.style.display = 'block';
  80. }
  81. if( config.progress ) {
  82. dom.progress.style.display = 'block';
  83. }
  84. if( config.transition !== 'default' ) {
  85. dom.wrapper.classList.add( config.transition );
  86. }
  87. if( config.theme !== 'default' ) {
  88. dom.wrapper.classList.add( config.theme );
  89. }
  90. if( config.mouseWheel ) {
  91. document.addEventListener('DOMMouseScroll', onDocumentMouseScroll, false); // FF
  92. document.addEventListener('mousewheel', onDocumentMouseScroll, false);
  93. }
  94. if( config.rollingLinks ) {
  95. // Add some 3D magic to our anchors
  96. linkify();
  97. }
  98. // Read the initial hash
  99. readURL();
  100. }
  101. /**
  102. * Extend object a with the properties of object b.
  103. * If there's a conflict, object b takes precedence.
  104. */
  105. function extend( a, b ) {
  106. for( var i in b ) {
  107. a[ i ] = b[ i ];
  108. }
  109. }
  110. /**
  111. * Prevents an events defaults behavior calls the
  112. * specified delegate.
  113. *
  114. * @param {Function} delegate The method to call
  115. * after the wrapper has been executed
  116. */
  117. function preventAndForward( delegate ) {
  118. return function( event ) {
  119. event.preventDefault();
  120. delegate.call();
  121. }
  122. }
  123. /**
  124. * Handler for the document level 'keydown' event.
  125. *
  126. * @param {Object} event
  127. */
  128. function onDocumentKeyDown( event ) {
  129. // FFT: Use document.querySelector( ':focus' ) === null
  130. // instead of checking contentEditable?
  131. if ( event.target.contentEditable != 'inherit' ||
  132. event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return;
  133. var triggered = false;
  134. switch( event.keyCode ) {
  135. case 80: case 33: navigatePrev(); triggered = true; break; // prev for wireless presenter (PgUp)
  136. case 78: case 32: case 34: navigateNext(); triggered = true; break; // next for wireless presenter (PgDn, Space)
  137. case 72: case 37: navigateLeft(); triggered = true; break; // h, left
  138. case 76: case 39: navigateRight(); triggered = true; break; // l, right
  139. case 75: case 38: navigateUp(); triggered = true; break; // k, up
  140. case 74: case 40: navigateDown(); triggered = true; break; // j, down
  141. }
  142. if (triggered) return event.preventDefault()
  143. if ( event.keyCode === 27 && supports3DTransforms ) {
  144. if( overviewIsActive() ) {
  145. deactivateOverview();
  146. }
  147. else {
  148. activateOverview();
  149. }
  150. event.preventDefault();
  151. }
  152. }
  153. /**
  154. * Handler for the document level 'touchstart' event.
  155. *
  156. * This enables very basic tap interaction for touch
  157. * devices. Added mainly for performance testing of 3D
  158. * transforms on iOS but was so happily surprised with
  159. * how smoothly it runs so I left it in here. Apple +1
  160. *
  161. * @param {Object} event
  162. */
  163. function onDocumentTouchStart( event ) {
  164. // We're only interested in one point taps
  165. if (event.touches.length === 1) {
  166. // Never prevent taps on anchors and images
  167. if( event.target.tagName.toLowerCase() === 'a' || event.target.tagName.toLowerCase() === 'img' ) {
  168. return;
  169. }
  170. event.preventDefault();
  171. var point = {
  172. x: event.touches[0].clientX,
  173. y: event.touches[0].clientY
  174. };
  175. // Define the extent of the areas that may be tapped
  176. // to navigate
  177. var wt = window.innerWidth * 0.3;
  178. var ht = window.innerHeight * 0.3;
  179. if( point.x < wt ) {
  180. navigateLeft();
  181. }
  182. else if( point.x > window.innerWidth - wt ) {
  183. navigateRight();
  184. }
  185. else if( point.y < ht ) {
  186. navigateUp();
  187. }
  188. else if( point.y > window.innerHeight - ht ) {
  189. navigateDown();
  190. }
  191. slide();
  192. }
  193. }
  194. /**
  195. * Handles mouse wheel scrolling, throttled to avoid
  196. * skipping multiple slides.
  197. */
  198. function onDocumentMouseScroll( event ){
  199. clearTimeout( mouseWheelTimeout );
  200. mouseWheelTimeout = setTimeout( function() {
  201. var delta = event.detail || -event.wheelDelta;
  202. if( delta > 0 ) {
  203. navigateNext();
  204. }
  205. else {
  206. navigatePrev();
  207. }
  208. }, 100 );
  209. }
  210. /**
  211. * Handler for the window level 'hashchange' event.
  212. *
  213. * @param {Object} event
  214. */
  215. function onWindowHashChange( event ) {
  216. readURL();
  217. }
  218. /**
  219. * Wrap all links in 3D goodness.
  220. */
  221. function linkify() {
  222. if( supports3DTransforms ) {
  223. var nodes = document.querySelectorAll( '#reveal .slides section a:not(.image)' );
  224. for( var i = 0, len = nodes.length; i < len; i++ ) {
  225. var node = nodes[i];
  226. if( node.textContent && !node.querySelector( 'img' ) && ( !node.className || !node.classList.contains( node, 'roll' ) ) ) {
  227. node.classList.add( 'roll' );
  228. node.innerHTML = '<span data-title="'+ node.text +'">' + node.innerHTML + '</span>';
  229. }
  230. };
  231. }
  232. }
  233. /**
  234. * Displays the overview of slides (quick nav) by
  235. * scaling down and arranging all slide elements.
  236. *
  237. * Experimental feature, might be dropped if perf
  238. * can't be improved.
  239. */
  240. function activateOverview() {
  241. dom.wrapper.classList.add( 'overview' );
  242. var horizontalSlides = Array.prototype.slice.call( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
  243. for( var i = 0, len1 = horizontalSlides.length; i < len1; i++ ) {
  244. var hslide = horizontalSlides[i],
  245. htransform = 'translateZ(-2500px) translate(' + ( ( i - indexh ) * 105 ) + '%, 0%)';
  246. hslide.setAttribute( 'data-index-h', i );
  247. hslide.style.display = 'block';
  248. hslide.style.WebkitTransform = htransform;
  249. hslide.style.MozTransform = htransform;
  250. hslide.style.msTransform = htransform;
  251. hslide.style.OTransform = htransform;
  252. hslide.style.transform = htransform;
  253. if( !hslide.classList.contains( 'stack' ) ) {
  254. // Navigate to this slide on click
  255. hslide.addEventListener( 'click', onOverviewSlideClicked, true );
  256. }
  257. var verticalSlides = Array.prototype.slice.call( hslide.querySelectorAll( 'section' ) );
  258. for( var j = 0, len2 = verticalSlides.length; j < len2; j++ ) {
  259. var vslide = verticalSlides[j],
  260. vtransform = 'translate(0%, ' + ( ( j - indexv ) * 105 ) + '%)';
  261. vslide.setAttribute( 'data-index-h', i );
  262. vslide.setAttribute( 'data-index-v', j );
  263. vslide.style.display = 'block';
  264. vslide.style.WebkitTransform = vtransform;
  265. vslide.style.MozTransform = vtransform;
  266. vslide.style.msTransform = vtransform;
  267. vslide.style.OTransform = vtransform;
  268. vslide.style.transform = vtransform;
  269. // Navigate to this slide on click
  270. vslide.addEventListener( 'click', onOverviewSlideClicked, true );
  271. }
  272. }
  273. }
  274. /**
  275. * Exits the slide overview and enters the currently
  276. * active slide.
  277. */
  278. function deactivateOverview() {
  279. dom.wrapper.classList.remove( 'overview' );
  280. var slides = Array.prototype.slice.call( document.querySelectorAll( '#reveal .slides section' ) );
  281. for( var i = 0, len = slides.length; i < len; i++ ) {
  282. var element = slides[i];
  283. // Resets all transforms to use the external styles
  284. element.style.WebkitTransform = '';
  285. element.style.MozTransform = '';
  286. element.style.msTransform = '';
  287. element.style.OTransform = '';
  288. element.style.transform = '';
  289. element.removeEventListener( 'click', onOverviewSlideClicked );
  290. }
  291. slide();
  292. }
  293. /**
  294. * Checks if the overview is currently active.
  295. *
  296. * @return {Boolean} true if the overview is active,
  297. * false otherwise
  298. */
  299. function overviewIsActive() {
  300. return dom.wrapper.classList.contains( 'overview' );
  301. }
  302. /**
  303. * Invoked when a slide is and we're in the overview.
  304. */
  305. function onOverviewSlideClicked( event ) {
  306. // TODO There's a bug here where the event listeners are not
  307. // removed after deactivating the overview.
  308. if( overviewIsActive() ) {
  309. event.preventDefault();
  310. deactivateOverview();
  311. indexh = this.getAttribute( 'data-index-h' );
  312. indexv = this.getAttribute( 'data-index-v' );
  313. slide();
  314. }
  315. }
  316. /**
  317. * Updates one dimension of slides by showing the slide
  318. * with the specified index.
  319. *
  320. * @param {String} selector A CSS selector that will fetch
  321. * the group of slides we are working with
  322. * @param {Number} index The index of the slide that should be
  323. * shown
  324. *
  325. * @return {Number} The index of the slide that is now shown,
  326. * might differ from the passed in index if it was out of
  327. * bounds.
  328. */
  329. function updateSlides( selector, index ) {
  330. // Select all slides and convert the NodeList result to
  331. // an array
  332. var slides = Array.prototype.slice.call( document.querySelectorAll( selector ) );
  333. if( slides.length ) {
  334. // Enforce max and minimum index bounds
  335. index = Math.max(Math.min(index, slides.length - 1), 0);
  336. for( var i = 0; i < slides.length; i++ ) {
  337. var slide = slides[i];
  338. // Optimization; hide all slides that are three or more steps
  339. // away from the present slide
  340. if( overviewIsActive() === false ) {
  341. slide.style.display = Math.abs( index - i ) > 3 ? 'none' : 'block';
  342. }
  343. slides[i].classList.remove( 'past' );
  344. slides[i].classList.remove( 'present' );
  345. slides[i].classList.remove( 'future' );
  346. if( i < index ) {
  347. // Any element previous to index is given the 'past' class
  348. slides[i].classList.add( 'past' );
  349. }
  350. else if( i > index ) {
  351. // Any element subsequent to index is given the 'future' class
  352. slides[i].classList.add( 'future' );
  353. }
  354. // If this element contains vertical slides
  355. if( slide.querySelector( 'section' ) ) {
  356. slides[i].classList.add( 'stack' );
  357. }
  358. }
  359. // Mark the current slide as present
  360. slides[index].classList.add( 'present' );
  361. // If this slide has a state associated with it, add it
  362. // onto the current state of the deck
  363. var slideState = slides[index].dataset.state;
  364. if( slideState ) {
  365. state = state.concat( slideState.split( ' ' ) );
  366. }
  367. }
  368. else {
  369. // Since there are no slides we can't be anywhere beyond the
  370. // zeroth index
  371. index = 0;
  372. }
  373. return index;
  374. }
  375. /**
  376. * Updates the visual slides to represent the currently
  377. * set indices.
  378. */
  379. function slide() {
  380. // Remember the state before this slide
  381. var stateBefore = state.concat();
  382. // Reset the state array
  383. state.length = 0;
  384. // Activate and transition to the new slide
  385. indexh = updateSlides( HORIZONTAL_SLIDES_SELECTOR, indexh );
  386. indexv = updateSlides( VERTICAL_SLIDES_SELECTOR, indexv );
  387. // Apply the new state
  388. stateLoop: for( var i = 0, len = state.length; i < len; i++ ) {
  389. // Check if this state existed on the previous slide. If it
  390. // did, we will avoid adding it repeatedly.
  391. for( var j = 0; j < stateBefore.length; j++ ) {
  392. if( stateBefore[j] === state[i] ) {
  393. stateBefore.splice( j, 1 );
  394. continue stateLoop;
  395. }
  396. }
  397. document.documentElement.classList.add( state[i] );
  398. // Dispatch custom event
  399. var event = document.createEvent( "HTMLEvents" );
  400. event.initEvent( state[i], true, true );
  401. document.dispatchEvent( event );
  402. }
  403. // Clean up the remaints of the previous state
  404. while( stateBefore.length ) {
  405. document.documentElement.classList.remove( stateBefore.pop() );
  406. }
  407. // Update progress if enabled
  408. if( config.progress ) {
  409. dom.progressbar.style.width = ( indexh / ( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ).length - 1 ) ) * window.innerWidth + 'px';
  410. }
  411. // Close the overview if it's active
  412. if( overviewIsActive() ) {
  413. activateOverview();
  414. }
  415. updateControls();
  416. clearTimeout( writeURLTimeout );
  417. writeURLTimeout = setTimeout( writeURL, 1500 );
  418. }
  419. /**
  420. * Updates the state and link pointers of the controls.
  421. */
  422. function updateControls() {
  423. var routes = availableRoutes();
  424. // Remove the 'enabled' class from all directions
  425. [ dom.controlsLeft, dom.controlsRight, dom.controlsUp, dom.controlsDown ].forEach( function( node ) {
  426. node.classList.remove( 'enabled' );
  427. } )
  428. if( routes.left ) dom.controlsLeft.classList.add( 'enabled' );
  429. if( routes.right ) dom.controlsRight.classList.add( 'enabled' );
  430. if( routes.up ) dom.controlsUp.classList.add( 'enabled' );
  431. if( routes.down ) dom.controlsDown.classList.add( 'enabled' );
  432. }
  433. /**
  434. * Determine what available routes there are for navigation.
  435. *
  436. * @return {Object} containing four booleans: left/right/up/down
  437. */
  438. function availableRoutes() {
  439. var horizontalSlides = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR );
  440. var verticalSlides = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR );
  441. return {
  442. left: indexh > 0,
  443. right: indexh < horizontalSlides.length - 1,
  444. up: indexv > 0,
  445. down: indexv < verticalSlides.length - 1
  446. };
  447. }
  448. /**
  449. * Reads the current URL (hash) and navigates accordingly.
  450. */
  451. function readURL() {
  452. // Break the hash down to separate components
  453. var bits = window.location.hash.slice(2).split('/');
  454. // Read the index components of the hash
  455. indexh = parseInt( bits[0] ) || 0 ;
  456. indexv = parseInt( bits[1] ) || 0 ;
  457. navigateTo( indexh, indexv );
  458. }
  459. /**
  460. * Updates the page URL (hash) to reflect the current
  461. * state.
  462. */
  463. function writeURL() {
  464. if( config.history ) {
  465. var url = '/';
  466. // Only include the minimum possible number of components in
  467. // the URL
  468. if( indexh > 0 || indexv > 0 ) url += indexh;
  469. if( indexv > 0 ) url += '/' + indexv;
  470. window.location.hash = url;
  471. }
  472. }
  473. /**
  474. * Navigate to the next slide fragment.
  475. *
  476. * @return {Boolean} true if there was a next fragment,
  477. * false otherwise
  478. */
  479. function nextFragment() {
  480. // Vertical slides:
  481. if( document.querySelector( VERTICAL_SLIDES_SELECTOR + '.present' ) ) {
  482. var verticalFragments = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR + '.present .fragment:not(.visible)' );
  483. if( verticalFragments.length ) {
  484. verticalFragments[0].classList.add( 'visible' );
  485. return true;
  486. }
  487. }
  488. // Horizontal slides:
  489. else {
  490. var horizontalFragments = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.present .fragment:not(.visible)' );
  491. if( horizontalFragments.length ) {
  492. horizontalFragments[0].classList.add( 'visible' );
  493. return true;
  494. }
  495. }
  496. return false;
  497. }
  498. /**
  499. * Navigate to the previous slide fragment.
  500. *
  501. * @return {Boolean} true if there was a previous fragment,
  502. * false otherwise
  503. */
  504. function previousFragment() {
  505. // Vertical slides:
  506. if( document.querySelector( VERTICAL_SLIDES_SELECTOR + '.present' ) ) {
  507. var verticalFragments = document.querySelectorAll( VERTICAL_SLIDES_SELECTOR + '.present .fragment.visible' );
  508. if( verticalFragments.length ) {
  509. verticalFragments[ verticalFragments.length - 1 ].classList.remove( 'visible' );
  510. return true;
  511. }
  512. }
  513. // Horizontal slides:
  514. else {
  515. var horizontalFragments = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.present .fragment.visible' );
  516. if( horizontalFragments.length ) {
  517. horizontalFragments[ horizontalFragments.length - 1 ].classList.remove( 'visible' );
  518. return true;
  519. }
  520. }
  521. return false;
  522. }
  523. /**
  524. * Triggers a navigation to the specified indices.
  525. *
  526. * @param {Number} h The horizontal index of the slide to show
  527. * @param {Number} v The vertical index of the slide to show
  528. */
  529. function navigateTo( h, v ) {
  530. indexh = h === undefined ? indexh : h;
  531. indexv = v === undefined ? indexv : v;
  532. slide();
  533. }
  534. function navigateLeft() {
  535. // Prioritize hiding fragments
  536. if( overviewIsActive() || previousFragment() === false ) {
  537. indexh --;
  538. indexv = 0;
  539. slide();
  540. }
  541. }
  542. function navigateRight() {
  543. // Prioritize revealing fragments
  544. if( overviewIsActive() || nextFragment() === false ) {
  545. indexh ++;
  546. indexv = 0;
  547. slide();
  548. }
  549. }
  550. function navigateUp() {
  551. // Prioritize hiding fragments
  552. if( overviewIsActive() || previousFragment() === false ) {
  553. indexv --;
  554. slide();
  555. }
  556. }
  557. function navigateDown() {
  558. // Prioritize revealing fragments
  559. if( overviewIsActive() || nextFragment() === false ) {
  560. indexv ++;
  561. slide();
  562. }
  563. }
  564. /**
  565. * Navigates backwards, prioritized in the following order:
  566. * 1) Previous fragment
  567. * 2) Previous vertical slide
  568. * 3) Previous horizontal slide
  569. */
  570. function navigatePrev() {
  571. // Prioritize revealing fragments
  572. if( previousFragment() === false ) {
  573. if( availableRoutes().up ) {
  574. navigateUp();
  575. }
  576. else {
  577. // Fetch the previous horizontal slide, if there is one
  578. var previousSlide = document.querySelector( '#reveal .slides>section.past:nth-child(' + indexh + ')' );
  579. if( previousSlide ) {
  580. indexv = ( previousSlide.querySelectorAll('section').length + 1 ) || 0;
  581. indexh --;
  582. slide();
  583. }
  584. }
  585. }
  586. }
  587. /**
  588. * Same as #navigatePrev() but navigates forwards.
  589. */
  590. function navigateNext() {
  591. // Prioritize revealing fragments
  592. if( nextFragment() === false ) {
  593. availableRoutes().down ? navigateDown() : navigateRight();
  594. }
  595. }
  596. // Expose some methods publicly
  597. return {
  598. initialize: initialize,
  599. navigateTo: navigateTo,
  600. navigateLeft: navigateLeft,
  601. navigateRight: navigateRight,
  602. navigateUp: navigateUp,
  603. navigateDown: navigateDown
  604. };
  605. })();