/build/Debug-iphonesimulator/iOP.app/www/js/index.js
JavaScript | 76 lines | 55 code | 3 blank | 18 comment | 0 complexity | 4b96ddc2a610a1a87a2ee480a99e7a01 MD5 | raw file
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- var iOP = {
- current_page:'LC',
- timers:{},
- swap:'',
- init: function() {
- this.
- },
- liquidC: function() {
- document.getElementById('calflow').value = document.getElementById('volume')/document.getElementById()
- },
- timer: function(element) {
- function uniqid(c,e){
- function d(b,a){b=parseInt(b,10).toString(16);return a<b.length?b.slice(b.length-a):a>b.length?Array(1+(a-b.length)).join("0")+b:b}"undefined"==typeof c&&(c="");var a;this.a||(this.a={});this.a.b||(this.a.b=Math.floor(123456789*Math.random()));this.a.b++;a=c+d(parseInt((new Date).getTime()/1E3,10),8);a+=d(this.a.b,5);e&&(a+=(10*Math.random()).toFixed(8).toString());return a
- }
- function showTimer(timerid) {
- element.value = Date().getTime()-(this.timers[timerid]['time']);
- }
- function startTimer() {
- var _timerid = uniqid();
- this.timers[_timerid] = {'time':Date().getTime(),'last':false};
- this.swap = _timerid;
- return _timerid;
- }
- function stopTimer(timerid) {
- clearInterval(this.timers[timerid]['timer'])
- this.timers[timerid]['last'] = Date().getTime();
- element.value = (this.timers[timerid]['last'])-(this.timers[timerid]['time']);
- element.addEventListener('onclick',function() {
-
- });
- var timer = startTimer(),
- inter = setInterval(showTimer,500),
- timername = this.swap;
- this.timers[timername]['timer'] = inter;
- }
- },
- }
- var app = {
- initialize: function() {
- this.bindEvents();
- },
- bindEvents: function() {
- document.addEventListener('deviceready', this.onDeviceReady, false);
- },
- onDeviceReady: function() {
- app.receivedEvent('deviceready');
- },
- receivedEvent: function(id) {
- var parentElement = document.getElementById(id);
- var listeningElement = parentElement.querySelector('.listening');
- var receivedElement = parentElement.querySelector('.received');
- listeningElement.setAttribute('style', 'display:none;');
- receivedElement.setAttribute('style', 'display:block;');
- console.log('Received Event: ' + id);
- }
- };