Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- index.html
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <meta name="format-detection" content="telephone=no" />
- <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, user-scalable=no">
- <title>Test application</title>
- <script type="text/javascript" src="js/cordova-2.5.0.js"></script>
- <script src="js/jquery-1.9.1.min.js"></script>
- <script src="js/jquery.animate-enhanced.js"></script>
- <script src="js/iscroll.js"></script>
- <script src="js/handlebars.js"></script>
- <script src="js/noClickDelay.js"></script>
- <link rel="stylesheet" href="js/viewnavigator/viewnavigator.css" type="text/css" />
- <script src="js/viewnavigator/viewnavigator.js"></script>
- <link rel="stylesheet" href="css/app.css" />
- <script src="js/app.js"></script>
- </head>
- <body>
- <div id="pageContent"></div>
- <script type="text/x-handlebars-template" id="mainTemplate">
- <div class="wrapper">
- <a href="#">Test 1</a>
- <a href="#">Test 2</a>
- <a href="#">Test 3</a>
- <a href="#">Test 4</a>
- <a href="#">Test 5</a>
- <a href="#">Test 6</a>
- <a href="#">Test 7</a>
- <a href="#">Test 8</a>
- <a href="#">Test 9</a>
- <a href="#">Test 10</a>
- <a href="#">Test 11</a>
- <a href="#">Test 12</a>
- <a href="#">Test 13</a>
- <a href="#">Test 14</a>
- <a href="#">Test 15</a>
- <a href="#">Test 16</a>
- <a href="#">Test 17</a>
- <a href="#">Test 18</a>
- <a href="#">Test 19</a>
- <a href="#">Test 20</a>
- </div>
- </script>
- </body>
- </html>
- app.css
- html {font-size:12px}
- html,body,#pageContent {position:absolute;top:0px;left:0px;right:0px;bottom: 0px;}
- body,.viewNavigator_contentHolder {background:#00a0c0}
- .wrapper {min-width:100%;height:100%}
- a {color:#f5f5f5;display:block;font-size:180%;padding:20px 30px;border-bottom: 1px solid #eaeaea};
- a:hover {color:#eaeaea}
- app.js
- function Controller() {
- if (navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/)) {
- document.addEventListener("deviceready", this.onDeviceReady, false);
- } else {
- this.onDeviceReady();
- }
- }
- Controller.prototype.onDeviceReady = function() {
- $(document).ready(function() {
- $(document).bind( "touchmove", function (e) { e.preventDefault(); return false; } );
- setTimeout( function() {var app = new App();} , 100 );
- });
- }
- var controller = new Controller();
- function App() {
- var obj = this;
- obj.template = null;
- obj.init();
- }
- App.prototype.init = function() {
- var obj = this;
- obj.template = Handlebars.compile($("#mainTemplate").html());
- window.viewNavigator = new ViewNavigator('#pageContent');
- var view = obj.getView( obj.template, "Title", null);
- window.viewNavigator.pushView(view);
- }
- App.prototype.getView = function(view, title, params) {
- var obj = this;
- return {title: title,
- backLabel: null,
- view: view
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement