Page 4 of 5

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

Posted: Thu May 15, 2014 9:14 am
by Kateryna Grynko

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


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

Posted: Thu May 15, 2014 12:35 pm
by Christopher Lowman

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.


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

Posted: Sun May 18, 2014 10:12 pm
by Yurii Orishchuk

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.


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

Posted: Tue May 20, 2014 12:26 pm
by Christopher Lowman

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


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

Posted: Wed May 21, 2014 2:42 am
by Yurii Orishchuk

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.


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

Posted: Wed May 21, 2014 5:59 pm
by Christopher Lowman

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


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

Posted: Thu May 22, 2014 6:47 pm
by Kateryna Grynko

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


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

Posted: Mon May 26, 2014 12:05 pm
by Christopher Lowman

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


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

Posted: Mon May 26, 2014 2:40 pm
by Maryna Brodina

Hello!

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


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

Posted: Mon May 26, 2014 2:54 pm
by Christopher Lowman

It's not working on the phone itself.