Hi Christopher,
Sure you can remove. Choose component 'html_15', click Edit HTML and delete this code from layout:precode<p style="text-align: left;"><span style="color: #800000;"><!doctype html>Stopwatch</span></p>/code/pre
Hi Christopher,
Sure you can remove. Choose component 'html_15', click Edit HTML and delete this code from layout:precode<p style="text-align: left;"><span style="color: #800000;"><!doctype html>Stopwatch</span></p>/code/pre
Katya,
That removed the words I wanted gone. The problem still remains that the timer doesn't start or stop. Yurri posted a picture of it working on his computer, but I have tried it on my computer and cellphone to no avail.
Hi Christopher.
I would like to ask you to clear browser cache. And try another browser(FireFox or Chrome).
Cause of i've tested it again on all my browsers and your "start" and "stop" buttons works correctly.
Also if you still have a problem it could be an testcase issue.(you and me test this functionality with diffrent usecases).
So you need to describe all steps to reproduce you problem. And screen shots are welcome.
Thanks & Regards.
Hello Yurii,
Actually, I had my brother download the app to his phone to see if there was a problem with my phone. The stopwatch still didn't work. Is there something different in the properties?
Thank you,
Chris
Hi Christopher.
I've get your code and found some async mistakes.
Fixed it and currently code is:
precode
var clsStopwatch = function() {
Code: Select all
// Private vars
var startAt = 0; // Time of last start / resume. (0 if not running)
var lapTime = 0; // Time on the clock when last stopped in milliseconds
var now = function() {
return (new Date()).getTime();
};
// Public methods
// Start or resume
this.start = function() {
startAt = startAt ? startAt : now();
};
// Stop or pause
this.stop = function() {
// If running, update elapsed time otherwise keep it
lapTime = startAt ? lapTime + now() - startAt : lapTime;
startAt = 0; // Paused
};
// Reset
this.reset = function() {
lapTime = startAt = 0;
};
// Duration
this.time = function() {
return lapTime + (startAt ? now() - startAt : 0);
};
};
var x = new clsStopwatch();
var $time;
var clocktimer;
var onPageShow = function() {
show();
};
jQuery(document).bind("pageshow", onPageShow);
function pad(num, size) {
Code: Select all
var s = "0000" + num;
return s.substr(s.length - size);
}
function formatTime(time) {
Code: Select all
var h = m = s = ms = 0;
var newTime = '';
h = Math.floor(time / (60 * 60 * 1000));
time = time % (60 * 60 * 1000);
m = Math.floor(time / (60 * 1000));
time = time % (60 * 1000);
s = Math.floor(time / 1000);
ms = time % 1000;
newTime = pad(h, 2) + ':' + pad(m, 2) + ':' + pad(s, 2) + ':' + pad(ms, 3);
return newTime;
}
function show() {
$time = document.getElementById('time');
Code: Select all
if ($time) update();
}
function update() {
$time.innerHTML = formatTime(x.time());
}
var clocktimer;
function start() {
show();
Code: Select all
clocktimer = setInterval(update, 100);
x.start();
}
function stop() {
x.stop();
Code: Select all
clearInterval(clocktimer);
}
function reset() {
stop();
Code: Select all
x.reset();
update();
}
/code/pre
Please replace your with given abouve.
And try to test again.
Regards.
Hello Yurii,
I just replaced the source code, and it worked in the test screen. I will update the app tonight to make sure it functions on a phone.
Do you have any idea if there is a source code that will allow the app to connect to a phones music library? Thus enabling the created app to stream the users music through the app.
Thank you for all your help. You are the man.
Chris
Hi Chris,
Here is an only plug-in we found on the Internet, that is pretty old. You could try it: https://github.com/hutley/HelloPhoneG... (for iOS5).
It seems that the timer "reset" button does not reset the timer.
Hello!
Sorry, do you mean "Refresh manually" button? Works for me, please try again.
It's not working on the phone itself.