This was asked before ages ago, try a search of the group might find some half decent info in the thread.
--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.
This was asked before ages ago, try a search of the group might find some half decent info in the thread.
On Mon, 2 Feb 2015 23:06 Richard Wallace <richiew...@googlemail.com> wrote:
Is it possible to create a clock in a scene, that updates (obviously!)
The way I can think is to have a wait of 60 seconds in a task?
But would this drain battery?
--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
I would love to really help you, and return the favor for what I've soaked up from reading some of your posts. I'm not an expert on html or Javascript, but i gave myself a crash course recently while working on a project...so I hesitate because I don't want to steer you wrong.
Here's a link to a source that i found very helpful and a good example of what I think you're trying to do:
http://www.w3schools.com/js/default.asp
http://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_style
<!DOCTYPE html>
<html>
<body>
<h1>What Can JavaScript Do?</h1>
<p id="demo">JavaScript can change the style of an HTML element.</p>
<script>
function myFunction() {
var x = document.getElementById("demo");
x.style.fontSize = "25px";
x.style.color = "red";
}
</script>
<button type="button" onclick="myFunction()">Click Me!</button>
</body>
</html>
Here's a description of a scene I use a Web View element to have JavaScript process a bunch of calculations for me:
Scene: Sun_and_moon
P:480x720 L:1x1
Orientation: System
Background Colour: #00FFFFFF
Action Bar Style: System
Title: Sun_and_moon
Subtitle:
Icon: null
Tab Labels:
Element: WebView1/WebView
Geometry:
P:0,0 1x1 L:1,1 1x1
Content:
Mode: URI
Source: file://%path%query
Allow Phone Access: On
Self Handle Links: Off
App Cache API: Off
DB API: Off
Events:
PageLoaded: 272
And here's an example of how I use it in a task:
A13: Variable Set [ Name:%path To:/storage/emulated/0/HuntingTimes/sun_moon.html Do Maths:Off Append:Off ]
A14: Variable Set [ Name:%query To:?Place='%city'&Lat=%lat&Long=%long&TZ=-5&TZname='EST'&Year=%year&Month=%month&Day=%day Do Maths:Off Append:Off ]
A15: Show Scene [ Name:Sun_and_moon Display As:Overlay Horizontal Position:0 Vertical Position:0 Animation:System Show Exit Button:Off Continue Task Immediately:On ]
A16: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A17: Destroy Scene [ Name:Sun_and_moon ]
A18: Return [ Value:%srise|%sset|%mnrise|%mnset|%mnphasedegstart|%mnphasepctstart|%mnphasedegend|%mnphasepctend Stop:On ]
<html>
<style type="text/css">
.otto {
font: bold 70px Roboto;
margin: 0;
padding: 0px;
color: #5f6062 ;
vertical-align: middle;
text-align: center;
}
.text{
font-family: "Roboto Condensed";
font-weight: 300;
font-size: 70px;
line-height: 30px;
text-align: center;
vertical-align: middle;
color: #5f6062;
padding: 10px;
}
</style>
<script type="text/javascript">
function GetClock(){
var d=new Date();
var nhour=d.getHours(),nmin=d.getMinutes();
if(nmin<=9) nmin="0"+nmin
document.getElementById('clockbox').innerHTML=""+nhour+":"+nmin+"";
}
window.onload=function(){
GetClock();
setInterval(GetClock,1000);
}
</script>
<body>
<div id="clockbox" class="text"></div>
<hr width="60%">
</body>
</html>