Skip to content

Commit

Permalink
v1.1-beta.523
Browse files Browse the repository at this point in the history
  • Loading branch information
genemars committed Jun 20, 2016
1 parent f67915d commit 8b20257
Show file tree
Hide file tree
Showing 25 changed files with 903 additions and 246 deletions.
3 changes: 3 additions & 0 deletions BaseFiles/Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3363,6 +3363,9 @@
<Link>lib\shared\Innovative.Geometry.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="html\pages\configure\scheduler\templates\program.say.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Compile Include="dummy.cs" />
Expand Down
Binary file modified BaseFiles/Common/homegenie_factory_config.zip
Binary file not shown.
57 changes: 35 additions & 22 deletions BaseFiles/Common/html/pages/configure/scheduler/_scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
$$.GetItemMarkup = function (schedule) {
var displayName = schedule.Name;
if (displayName.indexOf('.') > 0)
displayName = displayName.substring(displayName.lastIndexOf('.') + 1);
displayName = displayName.substring(displayName.indexOf('.') + 1);
var item = '<li data-icon="false" data-schedule-name="' + schedule.Name + '" data-schedule-index="' + i + '">';
item += '<a href="#" data-ui-ref="edit-btn">';
//item += ' <p class="ui-li-aside ui-li-desc"><strong>&nbsp;' + schedule.ProgramId + '</strong><br><font style="opacity:0.5">' + 'Last: ' + schedule.LastOccurrence + '<br>' + 'Next: ' + schedule.NextOccurrence + '</font></p>';
Expand Down Expand Up @@ -111,18 +111,15 @@
var d = new Date(); d.setSeconds(0);
var occurrences = [];
var currentGroup = '';
schedules.sort(function(a,b){
return (a.Name.toUpperCase() > b.Name.toUpperCase() || a.Name.indexOf('.') >= 0);
});
$.each(schedules, function(k,v){
var n = v.Name;
if (n.indexOf('.') > 0) {
var scheduleGroup = n.substring(0, n.lastIndexOf('.'));
var scheduleGroup = n.substring(0, n.indexOf('.'));
if (scheduleGroup != currentGroup) {
occurrences.push({ title: scheduleGroup.replace(/\./g, ' / '), separator: true });
currentGroup = scheduleGroup;
}
n = n.substring(n.lastIndexOf('.')+1);
n = n.substring(n.indexOf('.')+1);
}
var entry = { name: v.Name, title: n, occurs: [] };
$.each($$._ScheduleList, function(sk,sv){
Expand Down Expand Up @@ -188,8 +185,8 @@
vv.from -= sd.getTime();
vv.to -= sd.getTime();
var sx1 = Math.round(vv.from/(1440*60000)*w), sx2 = Math.round(vv.to/(1440*60000)*w)-sx1;
timeBar.rect(sx1, 0, sx2+4, h+1).attr({
fill: "rgba(255, 255, 70, 75)",
timeBar.rect(sx1-1, 0, sx2+1, h+1).attr({
fill: "rgba(255, 255, 70, 85)",
stroke: "rgba(255,255,255, 70)",
"stroke-width": 1
});
Expand All @@ -204,13 +201,29 @@
});
}

d = new Date(); d.setSeconds(0);

// build basic tooltip data
var desc = '';
if (typeof v.description != 'undefined' && v.description != null && v.description.trim() != '')
desc += v.description;
desc += '<br/>';
desc += '<p align="center"><strong>';
desc += moment($$._CurrentDate).format('LL');
desc += '</strong></p>';

// tooltip: previous/next occurrence text
if (v.prevOccurrence > 0 || v.nextOccurrence > 0) {
if (v.prevOccurrence > 0) {
desc += 'Last &nbsp;&nbsp;&nbsp;';
desc += '<strong>'+moment(v.prevOccurrence).format('LT')+'</strong>&nbsp;&nbsp;('+moment(v.prevOccurrence).from(new Date())+')';
desc += '<br/>';
}
if (v.nextOccurrence > 0) {
desc += 'Next &nbsp;&nbsp;&nbsp;';
desc += '<strong>'+moment(v.nextOccurrence).format('LT')+'</strong>&nbsp;&nbsp;('+moment(v.nextOccurrence).from(new Date())+')';
}
}

d = new Date(); d.setSeconds(0);
var isToday = d.toDateString() == $$._CurrentDate.toDateString();
if (isToday) {
d = d.getTime();
Expand All @@ -227,17 +240,6 @@
stroke: "rgba(0,0,0, 70)",
"stroke-width": 0.5
});
// tooltip: previous/next occurrence text
if (v.prevOccurrence > 0 || v.nextOccurrence > 0) {
if (v.prevOccurrence > 0) {
desc += '<br/><strong>Today last</strong><br/>&nbsp;&nbsp;&nbsp;';
desc += moment(v.prevOccurrence).format('LT')+'&nbsp;&nbsp;('+moment(v.prevOccurrence).from(new Date())+')';
}
if (v.nextOccurrence > 0) {
desc += '<br/><strong>Today next</strong><br/>&nbsp;&nbsp;&nbsp;';
desc += moment(v.nextOccurrence).format('LT')+'&nbsp;&nbsp;('+moment(v.nextOccurrence).from(new Date())+')';
}
}
} else {
var d2 = new Date(); d2.setHours(0,0,0,0);
if ($$._CurrentDate.getTime() > d2.getTime()) {
Expand All @@ -249,6 +251,17 @@
}
}

timeBarDiv.on('mousemove',function(e,d){
if ($(e.target).is('rect')) {

var md = new Date($$._CurrentDate.getTime());
md.setHours(0,0,0,0);
md = new Date(md.getTime()+(e.offsetX / w * 1440 * 60000)-60000);
$$._CurrentDate = md;

}
});

// attach tooltip
timeBarDiv.qtip({
content: {
Expand Down Expand Up @@ -307,7 +320,7 @@
for (i = 0; i < $$._ScheduleList.length; i++) {
var schedule = $$._ScheduleList[i];
if (schedule.Name.indexOf('.') > 0) {
var scheduleGroup = schedule.Name.substring(0, schedule.Name.lastIndexOf('.'));
var scheduleGroup = schedule.Name.substring(0, schedule.Name.indexOf('.'));
var item = $$.GetItemMarkup(schedule);
if (scheduleGroup != currentGroup) {
$('#configure_schedulerservice_list').append('<li data-role="list-divider">' + scheduleGroup.replace(/\./g, ' / ') + '</li>');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// level is a decimal value between 0 and 1 (eg. 0.5 = 50%)
$$.boundModules
.level = 0.5;
level = 0.5;
// set the level
$$.boundModules.level = level;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// set the mode of all selected thermostat modules to 'Heat'
$$.boundModules
.command('Thermostat.ModeSet')
.set('Heat');
// Heat, HeatEconomy, Cool, CoolEconomy, Auto, Off
mode = 'Heat';
// set the mode of all selected thermostat modules to 'Heat'
$$.boundModules.command('Thermostat.ModeSet')
.set(mode);
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// switch off all the selected thermostat modules
$$.boundModules
.command('Thermostat.ModeSet')
$$.boundModules.command('Thermostat.ModeSet')
.set('Off');
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
// turn off all selected modules
$$.boundModules
.off();
$$.boundModules.off();
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
// turn on all selected modules
$$.boundModules
.on();
$$.boundModules.on();
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
},
{
"name": {
"en": "Thermostat Mode Heat",
"it": "Modalità termostato 'Caldo'"
"en": "Thermostat Mode",
"it": "Modalità termostato"
},
"script": "command.therm-heat.js"
},
Expand All @@ -40,5 +40,12 @@
"it": "Spegni termostato"
},
"script": "command.therm-off.js"
},
{
"name": {
"en": "Say",
"it": "Parla"
},
"script": "program.say.js"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$$.program.say('Hello World!');
2 changes: 1 addition & 1 deletion BaseFiles/Common/html/ui/core/popup.cronwizard.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="ui-corner-all cronwiz-container" style="width:720px;position:relative" data-theme="a" data-overlay-theme="b" data-position-to="window" data-transition="pop">
<div class="ui-corner-all cronwiz-container" style="width:720px;position:relative" data-dismissible="false" data-theme="a" data-overlay-theme="b" data-position-to="window" data-transition="pop">

<div class="ui-corner-top" data-role="header">
<h2 data-locale-id="cronwizard_title">Cron event Wizard</h2>
Expand Down
Loading

0 comments on commit 8b20257

Please sign in to comment.