Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

IOS binary, and features such as a timer and music player.

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

Christopher Lowman
Posts: 0
Joined: Tue Apr 08, 2014 10:42 am

IOS binary, and features such as a timer and music player.

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.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

IOS binary, and features such as a timer and music player.

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.

Christopher Lowman
Posts: 0
Joined: Tue Apr 08, 2014 10:42 am

IOS binary, and features such as a timer and music player.

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

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

IOS binary, and features such as a timer and music player.

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

 &#47;&#47; Private vars 

 var startAt = 0; &#47;&#47; Time of last start / resume&#46; (0 if not running) 

 var lapTime = 0; &#47;&#47; Time on the clock when last stopped in milliseconds 

 var now = function() { 

     return (new Date())&#46;getTime(); 

 }; 

 &#47;&#47; Public methods 

 &#47;&#47; Start or resume 

 this&#46;start = function() { 

     startAt = startAt ? startAt : now(); 

 }; 

 &#47;&#47; Stop or pause 

 this&#46;stop = function() { 

     &#47;&#47; If running, update elapsed time otherwise keep it 

     lapTime = startAt ? lapTime + now() - startAt : lapTime; 

     startAt = 0; &#47;&#47; Paused 

 }; 

 &#47;&#47; Reset 

 this&#46;reset = function() { 

     lapTime = startAt = 0; 

 }; 

 &#47;&#47; Duration 

 this&#46;time = function() { 

     return lapTime + (startAt ? now() - startAt : 0); 

 }; 

};

var x = new clsStopwatch();

var $time;

var clocktimer;

var onPageShow = function() {
show();
};
jQuery(document)&#46;bind("pageshow", onPageShow);

function pad(num, size) {

Code: Select all

 var s = "0000" + num; 

 return s&#46;substr(s&#46;length - size); 

}

function formatTime(time) {

Code: Select all

 var h = m = s = ms = 0; 

 var newTime = ''; 

 h = Math&#46;floor(time / (60 * 60 * 1000)); 

 time = time % (60 * 60 * 1000); 

 m = Math&#46;floor(time / (60 * 1000)); 

 time = time % (60 * 1000); 

 s = Math&#46;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&#46;getElementById('time');

Code: Select all

 if ($time) update(); 

}

function update() {
$time&#46;innerHTML = formatTime(x&#46;time());
}

var clocktimer;

function start() {
show();

Code: Select all

 clocktimer = setInterval(update, 100); 

 x&#46;start(); 

}

function stop() {
x&#46;stop();

Code: Select all

 clearInterval(clocktimer); 

}

function reset() {
stop();

Code: Select all

 x&#46;reset(); 

 update(); 

}

/code/pre

Please replace your with given abouve.

And try to test again.

Regards.

Christopher Lowman
Posts: 0
Joined: Tue Apr 08, 2014 10:42 am

IOS binary, and features such as a timer and music player.

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

IOS binary, and features such as a timer and music player.

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).

Christopher Lowman
Posts: 0
Joined: Tue Apr 08, 2014 10:42 am

IOS binary, and features such as a timer and music player.

It seems that the timer "reset" button does not reset the timer.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

IOS binary, and features such as a timer and music player.

Hello!

Sorry, do you mean "Refresh manually" button? Works for me, please try again.

Christopher Lowman
Posts: 0
Joined: Tue Apr 08, 2014 10:42 am

IOS binary, and features such as a timer and music player.

It's not working on the phone itself.

Return to “Issues”