123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
- <meta http-equiv="Content-Security-Policy" content="default-src * data: gap: https://ssl.gstatic.com; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">
-
- <script src="components/loader.js"></script>
- <script src="lib/onsenui/js/onsenui.min.js"></script>
- <script src="extra.js"></script>
- <script>
- function onBodyLoad() {
- // ons.notification.alert("onload");
-
- document.addEventListener("deviceready", onDeviceReady, false);
- bindEvents();
-
- doOpenDatabase();
- createStudentTable();
- createButtonsMainScreen();
- }
-
- function onDeviceReady() {
-
- // ons.notification.alert("Cordova is ready");
- // navigator.notification.alert("Cordova is ready!");
- }
- </script>
- <link rel="stylesheet" href="components/loader.css">
- <link rel="stylesheet" href="lib/onsenui/css/onsenui.css">
- <link rel="stylesheet" href="lib/onsenui/css/onsen-css-components.css">
- <link rel="stylesheet" href="css/style.css">
-
- <script
- src="https://code.jquery.com/jquery-3.4.1.js"
- integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
- crossorigin="anonymous"></script>
-
-
- <script>
-
- document.addEventListener('init', function(event) {
- var page = event.target;
- // ons.notification.alert('target:' + page.id);
- if (page.id === 'attendanceSheet') {
- // ons.notification.alert('yup:' + page.id);
- page.querySelector('ons-toolbar .center').innerHTML = page.data.title;
- var studList = page.data.students;
- for (var i = 0; i < studList.length ; i++) {
- $('#studentList').append('<ons-list-item tappable><label class="left"><ons-checkbox value="' + studList[i].id + '" input-id="check-' + studList[i].id + '"></ons-checkbox></label><label for="check-' + studList[i].id + '" class="center">' + studList[i].name + '</label></ons-list-item>');
- }
-
- }
- if (page.id === 'page1') {
- page.querySelector('#push-button').onclick = function() {
- document.querySelector('#myNavigator').pushPage('page2.html', {data: {title: 'Page 2'}});
- };
- } else if (page.id === 'page2') {
- page.querySelector('ons-toolbar .center').innerHTML = page.data.title;
- }
- });
-
- const login = () => {
- const username = document.querySelector('#username').value;
- const password = document.querySelector('#password').value;
-
- if (username === 'user' && password === 'pass') {
- // call the navigator to move to the new page
- const navigator = document.querySelector('#navigator');
- navigator.resetToPage('home.html');
- } else {
- ons.notification.alert('Wrong username/password combination');
- }
- }
-
- function bindEvents () {
- // ons.notification.alert('bind events');
- //document.getElementById('btnReadCheckboxes').addEventListener('click', this.readCheckboxes);
- }
-
-
- </script>
- </head>
- <body onload="onBodyLoad()">
- <ons-navigator id="navigator">
- <ons-page>
- <div style="text-align: center; margin-top: 200px">
-
- <div id="courses"></div>
- <p id="buttonSection">
- <!-- <ons-button onclick="addSection()">Add Course</ons-button>
- <ons-button onclick="readTables()">dbg</ons-button> -->
-
- </p>
- <p id="dbg" style="font-size: 9px;"></p>
- </div>
- <textarea class="textarea" id="txtDebug" style="width: 100%; height: 100px; font-size:10px; font-family: Courier New; "></textarea>
-
- </ons-page>
- <template id="dialog.html">
- <ons-dialog id="my-dialog">
- <div style="text-align: center; padding: 10px;">
- <p>
- Please enter Course-Section
- </p>
- <p>
- <ons-input id="sectionName" modifier="underbar" placeholder="Course-Section" float></ons-input>
-
- </p>
-
- <p>
- <ons-button onclick="hideDialog('my-dialog')">Save</ons-button>
- <ons-button onclick="killDialog('my-dialog')">Cancel</ons-button>
- </p>
-
- <p id="sectionDialogError" style="color:red;"></p>
- </div>
- </ons-dialog>
- </template>
- </body>
- </html>
-
|