From cdda99fbed9b2149201dab4651f4da4c3d54f487 Mon Sep 17 00:00:00 2001 From: Generoso Martello Date: Sun, 5 Jun 2016 14:13:33 +0200 Subject: [PATCH] v1.1-beta.522 --- BaseFiles/Common/html/js/homegenie.api.min.js | 2 +- .../Common/html/js/homegenie.webapp.min.js | 12 +- BaseFiles/Common/html/locales/de.json | 42 + BaseFiles/Common/html/locales/en.json | 42 + BaseFiles/Common/html/locales/es.json | 42 + BaseFiles/Common/html/locales/fr.json | 42 + BaseFiles/Common/html/locales/it.json | 42 + BaseFiles/Common/html/locales/nl.json | 42 + BaseFiles/Common/html/locales/ru.json | 42 + BaseFiles/Common/html/locales/sv.json | 1720 +++++++++-------- .../pages/configure/maintenance/main.html | 8 +- .../Common/html/ui/core/popup.cronwizard.html | 30 +- .../Common/html/ui/core/popup.cronwizard.js | 24 +- BaseFiles/Common/html/ui/widgets/cron.text.js | 3 + HISTORY.TXT | 9 + .../Scheduler/SchedulerScriptingEngine.cs | 16 +- .../Automation/Scheduler/SchedulerService.cs | 22 + .../Automation/Scripting/SchedulerHelper.cs | 29 + HomeGenie/Service/Handlers/Automation.cs | 37 +- HomeGenie/Service/Handlers/Statistics.cs | 55 +- HomeGenie/Service/Utility.cs | 22 + HomeGenie/release_info.xml | 7 +- HomeGenie_Linux/Packager/DEBIAN/md5sums | 142 +- HomeGenie_Linux/Packager/builddeb.sh | 2 +- HomeGenie_Windows/Packager/setup.iss | 8 +- 25 files changed, 1428 insertions(+), 1014 deletions(-) diff --git a/BaseFiles/Common/html/js/homegenie.api.min.js b/BaseFiles/Common/html/js/homegenie.api.min.js index 44e89d0e6..3e74a005f 100644 --- a/BaseFiles/Common/html/js/homegenie.api.min.js +++ b/BaseFiles/Common/html/js/homegenie.api.min.js @@ -1 +1 @@ -var HG=HG||{};HG.Automation=HG.Automation||{},HG.Automation.Macro=HG.Automation.Macro||new function(){var e=this;e.Record=function(){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Macro.Record/",type:"GET"})},e.Save=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Macro.Save/"+e+"/",type:"GET",dataType:"text",success:function(e){t(e)}})},e.Discard=function(){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Macro.Discard/",type:"GET"})},e.SetDelay=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Macro.SetDelay/"+e+"/"+t,type:"GET"})},e.GetDelay=function(e){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Macro.GetDelay/",type:"GET",success:function(t){e(t)},error:function(t){console.log("HG.Automation.Macro.GetDelay ERROR: "+t.status+":"+t.statusText),e()}})}},HG.Automation.Programs=HG.Automation.Programs||new function(){var $$=this;$$.List=function(callback){$.get("/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.List/",function(data){HG.WebApp.Data.Programs=eval(arguments[2].responseText),callback()})},$$.AddProgram=function(e,t,a){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Add/"+e+"/",type:"POST",data:t,success:function(e){"undefined"!=typeof e.ResponseValue&&(e=e.ResponseValue),a(e)},error:function(){alert("A problem ocurred")}})},$$.DeleteProgram=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Delete/"+e+"/",type:"GET",success:function(){t()},error:function(){alert("A problem ocurred")}})},$$.Run=function(e,t,a){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Run/"+e+"/"+t,type:"GET",success:function(e){"undefined"!=typeof a&&a(e)},error:function(){"undefined"!=typeof a&&a(null)}})},$$.Toggle=function(e,t,a){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Toggle/"+e+"/"+t,type:"GET",success:function(e){"undefined"!=typeof a&&a(e)},error:function(){"undefined"!=typeof a&&a(null)}})},$$.ArduinoFileLoad=function(e,t,a){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Arduino.FileLoad/"+e+"/"+t,type:"GET",success:function(e){"undefined"!=typeof e.ResponseValue&&(e=e.ResponseValue),"undefined"!=typeof a&&a(unescape(e))},error:function(){"undefined"!=typeof a&&a(null)}})},$$.ArduinoFileAdd=function(e,t,a){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Arduino.FileAdd/"+e+"/"+t,type:"GET",success:function(e){"undefined"!=typeof e.ResponseValue&&(e=e.ResponseValue),"undefined"!=typeof a&&a(unescape(e))},error:function(){"undefined"!=typeof a&&a(null)}})},$$.ArduinoFileDelete=function(e,t,a){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Arduino.FileDelete/"+e+"/"+t,type:"GET",success:function(e){"undefined"!=typeof e.ResponseValue&&(e=e.ResponseValue),"undefined"!=typeof a&&a(unescape(e))},error:function(){"undefined"!=typeof a&&a(null)}})},$$.ArduinoFileSave=function(e,t,a,n){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Arduino.FileSave/"+e+"/"+t,type:"POST",data:a,success:function(e){"undefined"!=typeof e.ResponseValue&&(e=e.ResponseValue),"undefined"!=typeof n&&n(unescape(e))},error:function(){"undefined"!=typeof n&&n(null)}})},$$.ArduinoFileList=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Arduino.FileList/"+e,type:"GET",success:function(e){"undefined"!=typeof t&&t(e)},error:function(){"undefined"!=typeof t&&t(null)}})}},HG.Automation.Scheduling=HG.Automation.Scheduling||new function(){var e=this;e.Update=function(e,t,a,n){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Scheduling.Update/"+e+"/"+t.replace(/\//g,"|")+"/"+a,type:"GET",dataType:"text",success:function(e){"undefined"!=typeof n&&n(e)}})},e.Delete=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Scheduling.Delete/"+e,type:"GET",dataType:"text",success:function(e){"undefined"!=typeof t&&t(e)}})},e.Enable=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Scheduling.Enable/"+e,type:"GET",dataType:"text",success:function(e){"undefined"!=typeof t&&t(e)}})},e.Disable=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Scheduling.Disable/"+e,type:"GET",dataType:"text",success:function(e){"undefined"!=typeof t&&t(e)}})},e.List=function(e){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Scheduling.List/",type:"GET",success:function(t){"undefined"!=typeof e&&e(t)}})}},HG.Configure=HG.Configure||new function(){var $$=this;$$.LoadData=function(callback){$$.Modules.List(function(data){try{HG.WebApp.Data.Modules=eval(data)}catch(e){}HG.Automation.Programs.List(function(){$$.Groups.List("Control",function(){null!=callback&&callback()})})})}},HG.Configure.Groups=HG.Configure.Groups||new function(){var $$=this;$$.ModulesList=function(e,t){$.get("/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.ModulesList/"+e+"/",function(e){t(e)})},$$.List=function(e,t){$.get("/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.List/"+e+"/",function(a){"Automation"==e?HG.WebApp.Data.AutomationGroups=a:HG.WebApp.Data.Groups=a,t()})},$$.Sort=function(e,t,a){$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.Sort/"+e+"/",data:t,success:function(e){a(e)},error:function(){alert("A problem ocurred")}})},$$.SortModules=function(e,t,a,n){$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.SortModules/"+e+"/"+t+"/",data:a,success:function(e){n(e)},error:function(){alert("A problem ocurred")}})},$$.RenameGroup=function(e,t,a,n){$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.Rename/"+e+"/"+t+"/",data:a,success:function(e){n(e)},error:function(){alert("Error.\nThere is aready a group with this name.")}})},$$.AddGroup=function(e,t,a){$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.Add/"+e+"/",data:t,success:function(){a()},error:function(){alert("A problem ocurred")}})},$$.DeleteGroup=function(e,t,a){$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.Delete/"+e+"/",data:t,success:function(){a()},error:function(){alert("A problem ocurred")}})},$$.GetGroupModules=function(e){var t={Index:0,Name:e,Modules:Array()},a=$$.GetGroupByName(e);t.Index=a.Index;for(var n=0;n");context.parent.append(widgetWrapper);var options=[];fieldType.indexOf(":")>0&&(options=fieldType.split(":"),fieldType=options[0],options.shift());var cached=!1;return $.each($$._widgetCache,function(k,v){if(v.widget==fieldType){var element=$(v.html),handler=eval(v.json)[0];return element.one("create",function(){handler.element=element,handler.context=context,setTimeout(function(){callback(handler)},200),handler.init&&handler.init(options),handler.bind&&handler.bind(),widgetWrapper.show()}),widgetWrapper.hide(),widgetWrapper.append(element),element.trigger("create"),cached=!0,!1}}),cached?widgetWrapper:(0==$$._widgetQueueCount++&&$.mobile.loading("show"),$.ajax({url:"ui/"+fieldType+".html",type:"GET",success:function(htmlData){var element=$(htmlData);$.ajax({url:"ui/"+fieldType+".js",type:"GET",success:function(jsonData){$$._widgetCache.push({widget:fieldType,html:htmlData,json:jsonData});var handler=null;try{handler=eval(jsonData)[0]}catch(e){return console.log(e),void callback(null)}element.one("create",function(){handler.element=element,handler.context=context,callback(handler),handler.init&&handler.init(options),handler.bind&&handler.bind(),widgetWrapper.show()}),widgetWrapper.hide(),widgetWrapper.append(element),element.trigger("create"),0==--$$._widgetQueueCount&&$.mobile.loading("hide")},error:function(){null!=callback&&callback(null)}})},error:function(){null!=callback&&callback(null)}}),widgetWrapper)},$$.GetModuleIcon=function(e,t,a){var n="pages/control/widgets/homegenie/generic/images/unknown.png";if(null!=e&&e.DeviceType&&""!=e.DeviceType&&"undefined"!=e.DeviceType){var o=HG.WebApp.Utility.GetModulePropertyByName(e,ParameterType.Widget_DisplayIcon),i=HG.WebApp.Utility.GetModulePropertyByName(e,ParameterType.Widget_DisplayModule);if(i=null!=i&&""!=i.Value?i.Value:"homegenie/generic/"+e.DeviceType.toLowerCase(),null!=o&&""!=o.Value)n=o.Value;else{if(!e.WidgetInstance||null==e.WidgetInstance||"undefined"==e.WidgetInstance)return HG.WebApp.WidgetsList.GetWidgetIcon(i,a,t),n;n="undefined"!=typeof e.WidgetInstance.widget&&"undefined"!=typeof e.WidgetInstance.widget.icon?e.WidgetInstance.widget.icon:e.WidgetInstance.IconImage}}return null!=t&&t(n,a),n},$$.GetModuleDisplayName=function(e){var t=e.Domain+" "+e.Address;try{t=e.Name,t+=" ("+e.Domain.substring(e.Domain.lastIndexOf(".")+1)+" "+e.Address+")",t=t.trim()}catch(a){}return t},$$.SwitchPopup=function(e,t,a){var n=function(){1==a?setTimeout(function(){$(t).popup("open")},10):setTimeout(function(){$(t).popup("open",{transition:"pop"})},100)};$(e).one("popupafterclose",n),$(e).popup("close")},$$.BlinkAnim=function(e,t){var a="undefined"!=typeof t?2*t:8,n=function(){e.animate({opacity:"toggle"},{duration:250,specialEasing:{width:"easeInOutExpo",height:"easeOutBounce"},complete:function(){--a>0&&n()}})};e.clearQueue(),e.finish(),n()},$$.ScrollTo=function(e,t){$("html, body").animate({scrollTop:$(e).offset().top},t)},$$.SetTheme=function(e){HG.WebApp.Store.set("UI.Theme",e),$(document).find(".ui-page").removeClass("ui-page-theme-a ui-page-theme-b ui-page-theme-c ui-page-theme-d ui-page-theme-e ui-page-theme-f ui-page-theme-g ui-page-theme-h").addClass("ui-page-theme-"+e),$(document).find(".ui-mobile-viewport").removeClass("ui-overlay-a ui-overlay-b ui-overlay-c ui-overlay-d ui-overlay-e ui-overlay-f ui-overlay-g ui-overlay-h").addClass("ui-overlay-"+e),$(document).find(".ui-popup").removeClass("ui-body-a ui-body-b ui-body-c ui-body-d ui-body-e ui-body-f ui-body-g ui-body-h").addClass("ui-body-"+e),$(document).find(".ui-loader").removeClass("ui-body-a ui-body-b ui-body-c ui-body-d ui-body-e ui-body-f ui-body-g ui-body-h").addClass("ui-body-"+e)},$$.EditModule=function(e){HG.WebApp.Control.EditModule(e)},$$.GetParameterContext=function(e,t,a){var n="",o=0,i="",r=!1,u=!1,c=!1,s=!1;try{switch(t){case ParameterType.Status_Level:case ParameterType.Sensor_Generic:case ParameterType.Status_DoorLock:case ParameterType.Sensor_DoorWindow:case ParameterType.Sensor_MotionDetect:c=!0,t==ParameterType.Sensor_MotionDetect||t!=ParameterType.Sensor_DoorWindow&&t!=ParameterType.Status_DoorLock&&(null==e||""==e.DeviceType||e.DeviceType!=ModuleType.DoorWindow&&e.DeviceType!=ModuleType.DoorLock)?0==Module.getDoubleValue(a)?(o="images/indicators/level.png",i="Off"):(o="images/indicators/level.png",i="On",u=!0):0==Module.getDoubleValue(a)?(o="images/indicators/door.png",i="Closed"):(o="images/indicators/door.png",i="Open",u=!0);break;case ParameterType.Sensor_Tamper:case ParameterType.Sensor_Alarm:"0"==a||""==a?(o="images/indicators/alarm.png",i="Normal"):(o="images/indicators/alarm.png",i="Tampered");break;case ParameterType.Status_Battery:var p=parseInt(a);i=p+"%",5>=p?o="pages/control/widgets/homegenie/generic/images/battery_level_0.png":p>5&&10>=p?o="pages/control/widgets/homegenie/generic/images/battery_level_10.png":p>10&&20>=p?o="pages/control/widgets/homegenie/generic/images/battery_level_20.png":p>20&&40>=p?o="pages/control/widgets/homegenie/generic/images/battery_level_40.png":p>40&&60>=p?o="pages/control/widgets/homegenie/generic/images/battery_level_60.png":p>60&&80>=p?o="pages/control/widgets/homegenie/generic/images/battery_level_80.png":p>80&&(o="pages/control/widgets/homegenie/generic/images/battery_level_100.png"),r=!0;break;case ParameterType.Meter_Watts:case ParameterType.Meter_KwHour:case ParameterType.Meter_KvaHour:case ParameterType.Meter_Pulses:case ParameterType.Meter_AcVoltage:case ParameterType.Meter_AcCurrent:case ParameterType.Sensor_Power:i=Module.getFormattedNumber(a),o="images/indicators/energy.png";break;case ParameterType.Sensor_Temperature:if("Fahrenheit"==HG.WebApp.Locales.GetTemperatureUnit()){var l=Module.getDoubleValue(a);l=1.8*l+32,i=Module.getFormattedNumber(l)}else i=Module.getFormattedNumber(a);i+="°",o="images/indicators/temperature.png";break;case ParameterType.Sensor_Luminance:i=Module.getFormattedNumber(a),o="images/indicators/luminance.png";break;case ParameterType.Sensor_Humidity:i=Module.getFormattedNumber(a),o="images/indicators/humidity.png";break;case ParameterType.Sensor_Flood:i=Module.getFormattedNumber(a),o="images/indicators/flood.png";break;case ParameterType.Sensor_CarbonMonoxide:case ParameterType.Sensor_CarbonDioxide:case ParameterType.Sensor_Smoke:case ParameterType.Sensor_Heat:i=Module.getFormattedNumber(a),o="images/indicators/smoke.png";break;case ParameterType.Sensor_Key:case ParameterType.Receiver_RawData:case ParameterType.Receiver_Status:i=a,o="images/indicators/generic.png";break;case ParameterType.Status_Error:r=!0,i=$.isNumeric(a)?Module.getFormattedNumber(a):a,o="images/indicators/alarm.png";break;default:i=$.isNumeric(a)?Module.getFormattedNumber(a):a,o="images/indicators/generic.png",s=!0}}catch(d){console.log(d)}var f={displayName:t.indexOf(".")>0&&t.length>1&&""==n?t.substring(t.indexOf(".")+1):n,iconImage:o,valueText:i,isStatusParameter:c,hasActiveStatus:u,canBeHidden:r,isUnknown:s};return f}},HG.Ui.Popup=HG.Ui.Popup||{},eval("hg = {}; hg.ui = HG.Ui;"),HG.Ui.CreatePage=function(e,t){var a=e;a._fieldCache=[],a.PageId=a.pageId=t,a.getContainer=function(){return"undefined"==typeof a.container&&(a.container=$("#"+a.pageId)),a.container},a.field=function(e,t){var n=t?"@"+e:e,o=null;return"undefined"==typeof a._fieldCache[n]?(o=t?$(e):a.container.find("[data-ui-field="+e+"]"),o.length&&(a._fieldCache[n]=o)):o=a._fieldCache[n],o},a.clearCache=function(){var e=a._fieldCache;for(var t in e)e.hasOwnProperty(t)&&delete e[t];a._fieldCache=[]}};var recognition=null,final_transcript="";HG.VoiceControl=HG.VoiceControl||new function(){var e=this;e.CurrentInput="",e.LingoData=[],e.Initialize=function(){var t=HG.WebApp.Locales.GetUserLanguage();e.Localize("./locales/"+t.toLowerCase().substring(0,2)+".lingo.json",function(t){t?e.Setup():e.Localize("./locales/en.lingo.json",function(){e.Setup()})})},e.Setup=function(){"webkitSpeechRecognition"in window?(recognition=new webkitSpeechRecognition,recognition.continuous=!1,recognition.interimResults=!1,recognition.onstart=function(){$("#voicerecognition_button").addClass("ui-disabled")},recognition.onresult=function(e){var t="";if("undefined"==typeof e.results)return $("#speechinput").hide(),recognition.onend=null,void recognition.stop();for(var a=e.resultIndex;a=i.Words.length&&(u.StartIndex-1&&t.Words.length>0&&(e.CurrentInput=e.CurrentInput.substring(0,t.StartIndex)+" "+e.CurrentInput.substring(t.StartIndex+t.Words.length-1))},e.FindMatchingInput=function(t){if(t&&""!=t&&"undefined"!=t){t=" "+t.toLowerCase()+" ";var a=(" "+e.CurrentInput.toLowerCase()+" ").indexOf(t);if(a>=0){var n={Words:t,StartIndex:a};return n}}return{Words:t,StartIndex:-1}}}; \ No newline at end of file +var HG=HG||{};HG.Automation=HG.Automation||{},HG.Automation.Macro=HG.Automation.Macro||new function(){var e=this;e.Record=function(){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Macro.Record/",type:"GET"})},e.Save=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Macro.Save/"+e+"/",type:"GET",dataType:"text",success:function(e){t(e)}})},e.Discard=function(){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Macro.Discard/",type:"GET"})},e.SetDelay=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Macro.SetDelay/"+e+"/"+t,type:"GET"})},e.GetDelay=function(e){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Macro.GetDelay/",type:"GET",success:function(t){e(t)},error:function(t){console.log("HG.Automation.Macro.GetDelay ERROR: "+t.status+":"+t.statusText),e()}})}},HG.Automation.Programs=HG.Automation.Programs||new function(){var $$=this;$$.List=function(callback){$.get("/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.List/",function(data){HG.WebApp.Data.Programs=eval(arguments[2].responseText),callback()})},$$.AddProgram=function(e,t,a){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Add/"+e+"/",type:"POST",data:t,success:function(e){"undefined"!=typeof e.ResponseValue&&(e=e.ResponseValue),a(e)},error:function(){alert("A problem ocurred")}})},$$.DeleteProgram=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Delete/"+e+"/",type:"GET",success:function(){t()},error:function(){alert("A problem ocurred")}})},$$.Run=function(e,t,a){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Run/"+e+"/"+t,type:"GET",success:function(e){"undefined"!=typeof a&&a(e)},error:function(){"undefined"!=typeof a&&a(null)}})},$$.Toggle=function(e,t,a){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Toggle/"+e+"/"+t,type:"GET",success:function(e){"undefined"!=typeof a&&a(e)},error:function(){"undefined"!=typeof a&&a(null)}})},$$.ArduinoFileLoad=function(e,t,a){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Arduino.FileLoad/"+e+"/"+t,type:"GET",success:function(e){"undefined"!=typeof e.ResponseValue&&(e=e.ResponseValue),"undefined"!=typeof a&&a(unescape(e))},error:function(){"undefined"!=typeof a&&a(null)}})},$$.ArduinoFileAdd=function(e,t,a){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Arduino.FileAdd/"+e+"/"+t,type:"GET",success:function(e){"undefined"!=typeof e.ResponseValue&&(e=e.ResponseValue),"undefined"!=typeof a&&a(unescape(e))},error:function(){"undefined"!=typeof a&&a(null)}})},$$.ArduinoFileDelete=function(e,t,a){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Arduino.FileDelete/"+e+"/"+t,type:"GET",success:function(e){"undefined"!=typeof e.ResponseValue&&(e=e.ResponseValue),"undefined"!=typeof a&&a(unescape(e))},error:function(){"undefined"!=typeof a&&a(null)}})},$$.ArduinoFileSave=function(e,t,a,n){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Arduino.FileSave/"+e+"/"+t,type:"POST",data:a,success:function(e){"undefined"!=typeof e.ResponseValue&&(e=e.ResponseValue),"undefined"!=typeof n&&n(unescape(e))},error:function(){"undefined"!=typeof n&&n(null)}})},$$.ArduinoFileList=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Arduino.FileList/"+e,type:"GET",success:function(e){"undefined"!=typeof t&&t(e)},error:function(){"undefined"!=typeof t&&t(null)}})}},HG.Automation.Scheduling=HG.Automation.Scheduling||new function(){var e=this;e.Get=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Scheduling.Get/"+encodeURIComponent(e),type:"GET",success:function(e){"undefined"!=typeof t&&t(e)}})},e.Update=function(e,t,a,n,o,i){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Scheduling.Update/"+encodeURIComponent(e),type:"POST",dataType:"text",data:JSON.stringify({Name:e,CronExpression:t,Data:a,Description:n,Script:o}),success:function(e){"undefined"!=typeof i&&i(e)}})},e.Delete=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Scheduling.Delete/"+encodeURIComponent(e),type:"GET",dataType:"text",success:function(e){"undefined"!=typeof t&&t(e)}})},e.Enable=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Scheduling.Enable/"+encodeURIComponent(e),type:"GET",dataType:"text",success:function(e){"undefined"!=typeof t&&t(e)}})},e.Disable=function(e,t){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Scheduling.Disable/"+encodeURIComponent(e),type:"GET",dataType:"text",success:function(e){"undefined"!=typeof t&&t(e)}})},e.List=function(e){$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Scheduling.List/",type:"GET",success:function(t){"undefined"!=typeof e&&e(t)}})}},HG.Configure=HG.Configure||new function(){var e=this;e.LoadData=function(t){e.Modules.List(function(a){try{HG.WebApp.Data.Modules=a}catch(n){console.log(n)}HG.Automation.Programs.List(function(){e.Groups.List("Control",function(){null!=t&&t()})})})}},HG.Configure.Groups=HG.Configure.Groups||new function(){var $$=this;$$.ModulesList=function(e,t){$.get("/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.ModulesList/"+e+"/",function(e){t(e)})},$$.List=function(e,t){$.get("/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.List/"+e+"/",function(a){"Automation"==e?HG.WebApp.Data.AutomationGroups=a:HG.WebApp.Data.Groups=a,t()})},$$.Sort=function(e,t,a){$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.Sort/"+e+"/",data:t,success:function(e){a(e)},error:function(){alert("A problem ocurred")}})},$$.SortModules=function(e,t,a,n){$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.SortModules/"+e+"/"+t+"/",data:a,success:function(e){n(e)},error:function(){alert("A problem ocurred")}})},$$.RenameGroup=function(e,t,a,n){$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.Rename/"+e+"/"+t+"/",data:a,success:function(e){n(e)},error:function(){alert("Error.\nThere is aready a group with this name.")}})},$$.AddGroup=function(e,t,a){$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.Add/"+e+"/",data:t,success:function(){a()},error:function(){alert("A problem ocurred")}})},$$.DeleteGroup=function(e,t,a){$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.Delete/"+e+"/",data:t,success:function(){a()},error:function(){alert("A problem ocurred")}})},$$.GetGroupModules=function(e){var t={Index:0,Name:e,Modules:Array()},a=$$.GetGroupByName(e);t.Index=a.Index;for(var n=0;n");context.parent.append(widgetWrapper);var options=[];fieldType.indexOf(":")>0&&(options=fieldType.split(":"),fieldType=options[0],options.shift());var cached=!1;return $.each($$._widgetCache,function(k,v){if(v.widget==fieldType){var element=$(v.html),handler=v.json.startsWith("[")?eval(v.json)[0]:eval("new function(){ var $$ = this; "+v.json+" };");return element.one("create",function(){handler.element=element,handler.context=context,setTimeout(function(){callback(handler)},200),handler.init&&handler.init(options),handler.bind&&handler.bind(),widgetWrapper.show()}),widgetWrapper.hide(),widgetWrapper.append(element),element.trigger("create"),cached=!0,!1}}),cached?widgetWrapper:(0==$$._widgetQueueCount++&&$.mobile.loading("show"),$.ajax({url:"ui/"+fieldType+".html",dataType:"text",type:"GET",success:function(htmlData){var element=$(htmlData);$.ajax({url:"ui/"+fieldType+".js",dataType:"text",type:"GET",success:function(jsonData){$$._widgetCache.push({widget:fieldType,html:htmlData,json:jsonData});var handler=null;try{handler=jsonData.startsWith("[")?eval(jsonData)[0]:eval("new function(){ var $$ = this; "+jsonData+" };")}catch(e){return console.log(e),void callback(null)}element.one("create",function(){handler.element=element,handler.context=context,callback(handler),handler.init&&handler.init(options),handler.bind&&handler.bind(),widgetWrapper.show()}),widgetWrapper.hide(),widgetWrapper.append(element),element.trigger("create"),0==--$$._widgetQueueCount&&$.mobile.loading("hide")},error:function(e){console.log(e),null!=callback&&callback(null)}})},error:function(){null!=callback&&callback(null)}}),widgetWrapper)},$$.GetModuleIcon=function(e,t,a){var n="pages/control/widgets/homegenie/generic/images/unknown.png";if(null!=e&&e.DeviceType&&""!=e.DeviceType&&"undefined"!=e.DeviceType){var o=HG.WebApp.Utility.GetModulePropertyByName(e,ParameterType.Widget_DisplayIcon),i=HG.WebApp.Utility.GetModulePropertyByName(e,ParameterType.Widget_DisplayModule);if(i=null!=i&&""!=i.Value?i.Value:"homegenie/generic/"+e.DeviceType.toLowerCase(),null!=o&&""!=o.Value)n=o.Value;else{if(!e.WidgetInstance||null==e.WidgetInstance||"undefined"==e.WidgetInstance)return HG.WebApp.WidgetsList.GetWidgetIcon(i,a,t),n;n="undefined"!=typeof e.WidgetInstance.widget&&"undefined"!=typeof e.WidgetInstance.widget.icon?e.WidgetInstance.widget.icon:e.WidgetInstance.IconImage}}return null!=t&&t(n,a),n},$$.GetModuleDisplayName=function(e){var t=e.Domain+" "+e.Address;try{t=e.Name,t+=" ("+e.Domain.substring(e.Domain.lastIndexOf(".")+1)+" "+e.Address+")",t=t.trim()}catch(a){}return t},$$.SwitchPopup=function(e,t,a){var n=function(){1==a?setTimeout(function(){$(t).popup("open")},10):setTimeout(function(){$(t).popup("open",{transition:"pop"})},100)};$(e).one("popupafterclose",n),$(e).popup("close")},$$.BlinkAnim=function(e,t){var a="undefined"!=typeof t?2*t:8,n=function(){e.animate({opacity:"toggle"},{duration:250,specialEasing:{width:"easeInOutExpo",height:"easeOutBounce"},complete:function(){--a>0&&n()}})};e.clearQueue(),e.finish(),n()},$$.ScrollTo=function(e,t){$("html, body").animate({scrollTop:$(e).offset().top},t)},$$.SetTheme=function(e){HG.WebApp.Store.set("UI.Theme",e),$(document).find(".ui-page").removeClass("ui-page-theme-a ui-page-theme-b ui-page-theme-c ui-page-theme-d ui-page-theme-e ui-page-theme-f ui-page-theme-g ui-page-theme-h").addClass("ui-page-theme-"+e),$(document).find(".ui-mobile-viewport").removeClass("ui-overlay-a ui-overlay-b ui-overlay-c ui-overlay-d ui-overlay-e ui-overlay-f ui-overlay-g ui-overlay-h").addClass("ui-overlay-"+e),$(document).find(".ui-popup").removeClass("ui-body-a ui-body-b ui-body-c ui-body-d ui-body-e ui-body-f ui-body-g ui-body-h").addClass("ui-body-"+e),$(document).find(".ui-loader").removeClass("ui-body-a ui-body-b ui-body-c ui-body-d ui-body-e ui-body-f ui-body-g ui-body-h").addClass("ui-body-"+e)},$$.EditModule=function(e){HG.WebApp.Control.EditModule(e)},$$.GetParameterContext=function(e,t,a){var n="",o=0,i="",r=!1,u=!1,c=!1,s=!1;try{switch(t){case ParameterType.Status_Level:case ParameterType.Sensor_Generic:case ParameterType.Status_DoorLock:case ParameterType.Sensor_DoorWindow:case ParameterType.Sensor_MotionDetect:c=!0,t==ParameterType.Sensor_MotionDetect||t!=ParameterType.Sensor_DoorWindow&&t!=ParameterType.Status_DoorLock&&(null==e||""==e.DeviceType||e.DeviceType!=ModuleType.DoorWindow&&e.DeviceType!=ModuleType.DoorLock)?0==Module.getDoubleValue(a)?(o="images/indicators/level.png",i="Off"):(o="images/indicators/level.png",i="On",u=!0):0==Module.getDoubleValue(a)?(o="images/indicators/door.png",i="Closed"):(o="images/indicators/door.png",i="Open",u=!0);break;case ParameterType.Sensor_Tamper:case ParameterType.Sensor_Alarm:"0"==a||""==a?(o="images/indicators/alarm.png",i="Normal"):(o="images/indicators/alarm.png",i="Tampered");break;case ParameterType.Status_Battery:var p=parseInt(a);i=p+"%",5>=p?o="pages/control/widgets/homegenie/generic/images/battery_level_0.png":p>5&&10>=p?o="pages/control/widgets/homegenie/generic/images/battery_level_10.png":p>10&&20>=p?o="pages/control/widgets/homegenie/generic/images/battery_level_20.png":p>20&&40>=p?o="pages/control/widgets/homegenie/generic/images/battery_level_40.png":p>40&&60>=p?o="pages/control/widgets/homegenie/generic/images/battery_level_60.png":p>60&&80>=p?o="pages/control/widgets/homegenie/generic/images/battery_level_80.png":p>80&&(o="pages/control/widgets/homegenie/generic/images/battery_level_100.png"),r=!0;break;case ParameterType.Meter_Watts:case ParameterType.Meter_KwHour:case ParameterType.Meter_KvaHour:case ParameterType.Meter_Pulses:case ParameterType.Meter_AcVoltage:case ParameterType.Meter_AcCurrent:case ParameterType.Sensor_Power:i=Module.getFormattedNumber(a),o="images/indicators/energy.png";break;case ParameterType.Sensor_Temperature:if("Fahrenheit"==HG.WebApp.Locales.GetTemperatureUnit()){var l=Module.getDoubleValue(a);l=1.8*l+32,i=Module.getFormattedNumber(l)}else i=Module.getFormattedNumber(a);i+="°",o="images/indicators/temperature.png";break;case ParameterType.Sensor_Luminance:i=Module.getFormattedNumber(a),o="images/indicators/luminance.png";break;case ParameterType.Sensor_Humidity:i=Module.getFormattedNumber(a),o="images/indicators/humidity.png";break;case ParameterType.Sensor_Flood:i=Module.getFormattedNumber(a),o="images/indicators/flood.png";break;case ParameterType.Sensor_CarbonMonoxide:case ParameterType.Sensor_CarbonDioxide:case ParameterType.Sensor_Smoke:case ParameterType.Sensor_Heat:i=Module.getFormattedNumber(a),o="images/indicators/smoke.png";break;case ParameterType.Sensor_Key:case ParameterType.Receiver_RawData:case ParameterType.Receiver_Status:i=a,o="images/indicators/generic.png";break;case ParameterType.Status_Error:r=!0,i=$.isNumeric(a)?Module.getFormattedNumber(a):a,o="images/indicators/alarm.png";break;default:i=$.isNumeric(a)?Module.getFormattedNumber(a):a,o="images/indicators/generic.png",s=!0}}catch(d){console.log(d)}var f={displayName:t.indexOf(".")>0&&t.length>1&&""==n?t.substring(t.indexOf(".")+1):n,iconImage:o,valueText:i,isStatusParameter:c,hasActiveStatus:u,canBeHidden:r,isUnknown:s};return f}},HG.Ui.Popup=HG.Ui.Popup||{},eval("hg = {}; hg.ui = HG.Ui;"),HG.Ui.CreatePage=function(e,t){var a=e;a._fieldCache=[],a.PageId=a.pageId=t,a.getContainer=function(){return"undefined"==typeof a.container&&(a.container=$("#"+a.pageId)),a.container},a.field=function(e,t){var n=t?"@"+e:e,o=null;return"undefined"==typeof a._fieldCache[n]?(o=t?$(e):a.container.find("[data-ui-field="+e+"]"),o.length&&(a._fieldCache[n]=o)):o=a._fieldCache[n],o},a.clearCache=function(){var e=a._fieldCache;for(var t in e)e.hasOwnProperty(t)&&delete e[t];a._fieldCache=[]}};var recognition=null,final_transcript="";HG.VoiceControl=HG.VoiceControl||new function(){var e=this;e.CurrentInput="",e.LingoData=[],e.Initialize=function(){var t=HG.WebApp.Locales.GetUserLanguage();e.Localize("./locales/"+t.toLowerCase().substring(0,2)+".lingo.json",function(t){t?e.Setup():e.Localize("./locales/en.lingo.json",function(){e.Setup()})})},e.Setup=function(){"webkitSpeechRecognition"in window?(recognition=new webkitSpeechRecognition,recognition.continuous=!1,recognition.interimResults=!1,recognition.onstart=function(){$("#voicerecognition_button").addClass("ui-disabled")},recognition.onresult=function(e){var t="";if("undefined"==typeof e.results)return $("#speechinput").hide(),recognition.onend=null,void recognition.stop();for(var a=e.resultIndex;a=i.Words.length&&(u.StartIndex-1&&t.Words.length>0&&(e.CurrentInput=e.CurrentInput.substring(0,t.StartIndex)+" "+e.CurrentInput.substring(t.StartIndex+t.Words.length-1))},e.FindMatchingInput=function(t){if(t&&""!=t&&"undefined"!=t){t=" "+t.toLowerCase()+" ";var a=(" "+e.CurrentInput.toLowerCase()+" ").indexOf(t);if(a>=0){var n={Words:t,StartIndex:a};return n}}return{Words:t,StartIndex:-1}}}; \ No newline at end of file diff --git a/BaseFiles/Common/html/js/homegenie.webapp.min.js b/BaseFiles/Common/html/js/homegenie.webapp.min.js index e305d5a8b..ef92eb26d 100644 --- a/BaseFiles/Common/html/js/homegenie.webapp.min.js +++ b/BaseFiles/Common/html/js/homegenie.webapp.min.js @@ -1,6 +1,6 @@ -HG.WebApp=HG.WebApp||new function(){var $$=this;$$.Data={ServiceKey:"api",ServiceDomain:"HomeAutomation.HomeGenie",Modules:[],Groups:[],AutomationGroups:[],Programs:[],Interfaces:[],Events:[]},$$.Store=$.jStorage,$$.Initialize=function(){var theme=$$.Store.get("UI.Theme");(null==theme||"a">theme||theme>"g")&&$$.Store.set("UI.Theme","a"),$.mobile.ajaxFormsEnabled=!1,HG.Configure.LoadData(function(){setTimeout($$.Control.RenderMenu,2e3)}),$$.Home.UpdateHeaderStatus(),window.setInterval("HG.WebApp.Home.UpdateHeaderStatus();",1e4),$("[data-role=page]").on("pagebeforeshow",function(event){HG.Ui.SetTheme($$.Store.get("UI.Theme")),"page_analyze"==this.id?$$.Statistics.InitConfiguration():"page_configure_maintenance"==this.id?$$.Maintenance.LoadSettings():"page_configure_groups"==this.id?HG.Configure.Modules.List(function(data){try{$$.Data.Modules=eval(data)}catch(e){}HG.Automation.Programs.List(function(){$$.GroupsList.LoadGroups()})}):"page_configure_schedulerservice"==this.id&&$$.Scheduler.LoadScheduling()}),$("[data-role=page]").on("pagehide",function(){"page_analyze"==this.id&&$$.Statistics.SetAutoRefresh(!1)}),setTimeout(function(){var e=$$.Locales.GetUserLanguage();$$.Locales.Load("./locales/"+e.toLowerCase().substring(0,2)+".json",function(){$$.Locales.Load("./locales/"+e.toLowerCase().substring(0,2)+".programs.json",function(){$$.Locales.Localize(document),$("#homegenie_overlay").fadeOut(200),$$.Store.get("UI.AboutPopupShown")||($$.Store.set("UI.AboutPopupShown",!0),setTimeout($$.Home.About,3e3))})}),HG.VoiceControl.Initialize(),HG.Ui.SetTheme($$.Store.get("UI.Theme")),$$.Store.get("UI.EventsHistory")&&$("#btn_eventshistory_led").show(),HG.System.GetVersion(function(e){$("#systemversion").html(e.Version)}),setTimeout(function(){$("head").append('')},5e3)},100),$("#content").notify({speed:500,expires:5e3,stack:"below"}),Raphael.fn.ball=function(e,t,o,a){return this.set(this.ellipse(e,t+o-o/5,o,o/2).attr({fill:"rhsb("+a.h+", 1, .25)-hsb("+a.h+", 1, .25)",stroke:"none",opacity:0}),this.ellipse(e,t,o,o).attr({fill:"r(.5,.9)hsb("+a.h+", "+a.s+", .75)-hsb("+a.h+", "+a.s+", "+a.b+")",stroke:"none",opacity:.8}),this.ellipse(e,t,o-o/5,o-o/20).attr({stroke:"none",fill:"r(.5,.1)#ccc-#ccc",opacity:0}))},$("#automation_group_module_edit").enhanceWithin().popup(),$("#page_configure_groupmodules_propspopup").enhanceWithin().popup(),$("#page_configure_groupmodules_propspopup").on("popupbeforeposition",function(){$("#automation_group_module_params").scrollTop(0),$$.GroupModules.LoadModuleParameters()}),$("#module_options_button").on("click",function(){$$.GroupModules.ShowModuleOptions($$.GroupModules.CurrentModule.Domain,$$.GroupModules.CurrentModule.Address)}),$("#module_update_button").bind("click",function(){$$.GroupModules.CurrentModule.Name=$$.GroupModules.EditModule.Name,$$.GroupModules.CurrentModule.DeviceType=$$.GroupModules.EditModule.DeviceType,$$.Utility.SetModulePropertyByName($$.GroupModules.CurrentModule,"VirtualMeter.Watts",$$.GroupModules.EditModule.WMWatts),$$.Utility.SetModulePropertyByName($$.GroupModules.EditModule,"VirtualMeter.Watts",$$.GroupModules.EditModule.WMWatts);for(var e=0;e<$$.GroupModules.EditModule.Properties.length;e++){var t=$$.GroupModules.EditModule.Properties[e];$$.Utility.SetModulePropertyByName($$.GroupModules.CurrentModule,t.Name,t.Value),t=$$.Utility.GetModulePropertyByName($$.GroupModules.CurrentModule,t.Name),t.NeedsUpdate="true"}$$.GroupModules.UpdateModule($$.GroupModules.CurrentModule,function(){$$.GroupModules.ModuleUpdatedCallback()})}),$("#automationprograms_program_options").enhanceWithin().popup(),$("#configure_popupsettings_edit").enhanceWithin().popup(),$("#configure_popupsettings_edit").on("popupbeforeposition",function(){$$.Events.PopupRefreshIgnore()}),$("#actionconfirm_popup").enhanceWithin().popup();var menuPanel=$('body>[data-role="panel"]');menuPanel.panel().on("panelopen",function(){$("#homegenie_overlay").fadeIn(150)}).on("panelbeforeopen",function(){$("#homegenie_overlay").fadeIn(250)}).on("panelbeforeclose",function(){$("#homegenie_overlay").fadeOut(250)}).children().first().trigger("create"),menuPanel.on("click",function(){$(this).panel("close")}),$(document).on("swipeleft swiperight","div[data-role=page]",function(e){$("[data-ui-field=homegenie_panel_button]").hasClass("ui-disabled")||0==$(".ui-page-active .ui-popup-active").length&&($(e.target).is("span")||$(e.target).is("pre")||$(e.target).is("p")||$(e.target).is(":input")||"page_automation_editprogram"!=$(e.target).attr("id")&&0==$("#page_automation_editprogram").children().find($(e.target)).length&&"page_widgeteditor_editwidget"!=$(e.target).attr("id")&&0==$("#page_widgeteditor_editwidget").children().find($(e.target)).length&&"open"!==$.mobile.activePage.jqmData("panel")&&("swipeleft"===e.type?$(menuPanel.get(0)).panel("open"):"swiperight"===e.type&&$(menuPanel.get(1)).panel("open")))}),HG.Ui.GenerateWidget("core/popup.cronwizard",{parent:$(document).find("body")},function(e){var t=e.element;t.enhanceWithin().popup(),HG.Ui.Popup.CronWizard=e}),$("#homegenie_about").enhanceWithin().popup(),$("#about_popup_updatebutton").on("click",function(){HG.System.UpdateManager.UpdateCheck(),$("#homegenie_about").popup("close")})}},HG.WebApp.Data._DefaultLocale={},HG.WebApp.Data._CurrentLocale={},HG.WebApp.Locales=HG.WebApp.Locales||new function(){var $$=this;$$.GetUserLanguage=function(){var e=navigator.languages?navigator.languages[0]:navigator.language||navigator.userLanguage;return e.length>2&&(e=e.substring(0,2)),e},$$.GetDateEndianType=function(){var e="L",t=new Date(983268e5),o=t.toLocaleDateString().replace(/[\u200E]/g,"").split("/");return"2"==o[0]&&(e="M"),e},$$.GetTemperatureUnit=function(){var e=HG.WebApp.Store.get("UI.TemperatureUnit");return"C"==e||"F"!=e&&"M"!=$$.GetDateEndianType()?"Celsius":"Fahrenheit"},$$.GetDefault=function(e){$.ajax({url:"./locales/en.json",type:"GET",success:function(t){HG.WebApp.Data._DefaultLocale=$.parseJSON(t),e(),$.ajax({url:"./locales/en.programs.json",type:"GET",success:function(e){HG.WebApp.Data._DefaultLocale=$.extend(HG.WebApp.Data._DefaultLocale,$.parseJSON(e))}})}})},$$.Load=function(e,t){$$.GetDefault(function(){$.ajax({url:e,type:"GET",success:function(e){HG.WebApp.Data._CurrentLocale=$.extend(HG.WebApp.Data._CurrentLocale,$.parseJSON(e)),"function"==typeof t&&t(!0)},error:function(o){console.log('WARNING (Locales.Load): "'+e+'" '+o.status+" "+o.statusText),"function"==typeof t&&t(!1)}})})},$$.Localize=function(e){$(e).find("[data-locale-id]").each(function(){var e=$(this).attr("data-locale-id"),t=$$.GetLocaleString(e);null!=t&&($this=$(this),$this.is("a")&&$("span.ui-btn-text",$this).is("span")?$("span.ui-btn-text",$this).text(t):$this.is("input")?$this.attr("placeholder",t):$(this).html(t))})},$$.LocalizeElement=function(e,t){$(e).find("[data-locale-id]").each(function(){var e=$(this).attr("data-locale-id"),o=$$.GetLocaleString(e,!1,t);null!=o&&($this=$(this),$this.is("a")&&$("span.ui-btn-text",$this).is("span")?$("span.ui-btn-text",$this).text(o):$this.is("input")?$this.attr("placeholder",o):$(this).html(o))})},$$.GetLocaleString=function(e,t,o){var a=null;return o&&$.each(o,function(t,o){return t==e?(a=o,!1):void 0}),null==a&&$.each(HG.WebApp.Data._CurrentLocale,function(t,o){return t==e?(a=o,!1):void 0}),null==a&&$.each(HG.WebApp.Data._DefaultLocale,function(t,o){return t==e?(a=o,!1):void 0}),null==a&&console.log('WARNING (Locales.GetLocaleString): "'+e+'" is undefined.'),null==a&&t?t:a},$$.LocalizeWidget=function(e,t,o){var a=$$.GetUserLanguage();e=e.substring(0,e.lastIndexOf("/"));var i="#"+t,r="pages/control/widgets/"+e+"/locales/"+a.toLowerCase().substring(0,2)+".json";$.ajax({url:r,type:"GET",success:function(e){var t=$.parseJSON(e);$(i).find("[data-ui-field=widget]").data("Locale",t),$(i).find("[data-locale-id]").each(function(){var e=$(this).attr("data-locale-id"),o=$$.GetLocaleString(e,!1,t);null!=o&&($this=$(this),$this.is("a")&&$("span.ui-btn-text",$this).is("span")?$("span.ui-btn-text",$this).text(o):$this.is("input")?$this.attr("placeholder",o):$(this).html(o))}),$(i).find("[data-localizable]").each(function(){var e=$(this).text(),o=$$.GetLocaleString(e,!1,t);null!=o&&$(this).text(o)});var a=$(i).find("[data-ui-field=widget]").data("ControlPopUp");a&&a.each(function(){var e=$(this);$(e).find("[data-locale-id]").each(function(){var e=$(this).attr("data-locale-id"),o=$$.GetLocaleString(e,!1,t);null!=o&&($this=$(this),$this.is("a")&&$("span.ui-btn-text",$this).is("span")?$("span.ui-btn-text",$this).text(o):$this.is("input")?$this.attr("placeholder",o):$(this).html(o))})}),"function"==typeof o&&o()},error:function(e){console.log('WARNING (Locales.LocalizeWidget): "'+r+'" '+e.status+" "+e.statusText),"function"==typeof o&&o()}})},$$.GetWidgetLocaleString=function(e,t,o){var a=null;return null==e||"undefined"==typeof e||"undefined"==typeof e.data("Locale")?o?o:null:(a=$$.GetLocaleString(t,!1,e.data("Locale")),null==a&&o?o:a)},$$.GetProgramLocaleString=function(programAddress,stringId,defaultValue){var response=defaultValue,plocale,hasLocale=eval("(HG.WebApp.Data._CurrentLocale.Programs && HG.WebApp.Data._CurrentLocale.Programs["+programAddress+"])");return hasLocale?plocale=eval("HG.WebApp.Data._CurrentLocale.Programs["+programAddress+"]"):(hasLocale=eval("(HG.WebApp.Data._DefaultLocale.Programs && HG.WebApp.Data._DefaultLocale.Programs["+programAddress+"])"),hasLocale&&(plocale=eval("HG.WebApp.Data._DefaultLocale.Programs["+programAddress+"]"))),"undefined"!=typeof plocale&&(response=$$.GetLocaleString(stringId,defaultValue,plocale)),response},$$.GenerateTemplate=function(){var e="";$(document).find("[data-locale-id]").each(function(){var t=$(this).attr("data-locale-id"),o=$(this).html().trim();e.indexOf('"'+t+'"')<0&&(e+=' "'+t+'": \n "'+o+'",\n')}),console.log(e)}},HG.WebApp.Utility=HG.WebApp.Utility||new function(){var e=this;e._cmFsEditor=null,e.EditorPopup=function(t,o,a,i,r){null==e._cmFsEditor&&(e._cmFsEditor=CodeMirror.fromTextArea(document.getElementById("fullscreen_edit_text"),{lineNumbers:!0,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-Q":function(e){e.foldCode(e.getCursor())},"Ctrl-Space":"autocomplete"},foldGutter:!0,gutters:["CodeMirror-lint-markers-4","CodeMirror-linenumbers","CodeMirror-foldgutter"],highlightSelectionMatches:{showToken:/\w/},mode:{name:"javascript",globalVars:!0},theme:"ambiance"}));var n=$("#fullscreen_edit_box");n.find("[data-ui-field=title]").html(o),n.find("[data-ui-field=subtitle]").html(a);var s=n.find("[data-ui-field=namelabel]").html(t),l=n.find("[data-ui-field=nameinput]"),d=l.find("input").val(t),p=n.find("[data-ui-field=confirm]"),u=n.find("[data-ui-field=cancel]");null==t||""==t?(s.hide(),l.show()):(s.show(),l.hide()),u.on("click",function(){var t={name:d.val(),text:e._cmFsEditor.getValue(),isCanceled:!0};u.off("click"),p.off("click"),$("#fullscreen_edit_box").hide(150),r(t)}),p.on("click",function(){var t={name:d.val(),text:e._cmFsEditor.getValue(),isCanceled:!1};""==d.val()?d.qtip({content:{text:HG.WebApp.Locales.GetLocaleString("fullscreen_editor_entervalidname","Enter a valid name.")},show:{event:!1,ready:!0,delay:200},hide:{event:!1,inactive:2e3},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{my:"bottom center",at:"top center"}}).parent().stop().animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250).animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250):(u.off("click"),p.off("click"),$("#fullscreen_edit_box").hide(150),r(t))}),e._cmFsEditor.setValue(i),setTimeout(function(){e._cmFsEditor.refresh(),e._cmFsEditor.focus(),e._cmFsEditor.setCursor({line:0,ch:0})},500),$("#fullscreen_edit_box").show(150)},e.ConfirmPopup=function(e,t,o){var a=$("#actionconfirm_popup");a.buttonProceed=$("#actionconfirm_confirm_button"),a.buttonCancel=$("#actionconfirm_cancel_button"),a.find("h3").html(e),a.find("p").html(t),a.buttonCancel.focus();var i=function(){o(!1)},r=function(){o(!0)};a.buttonCancel.on("click",i),a.buttonProceed.on("click",r),a.on("popupafterclose",function(){a.buttonCancel.off("click",i),a.buttonProceed.off("click",r)}),setTimeout(function(){a.popup("open",{transition:"pop"})},250)},e.GetElapsedTimeText=function(e){var t="";if(e=(new Date-e)/1e3,e>0){var o=Math.floor(e/86400),a=Math.floor((e-86400*o)/3600),i=Math.floor((e-86400*o-3600*a)/60),r=Math.floor(e-86400*o-3600*a-60*i);o>0&&(t+=o+"d "),a>0&&(t+=a+"h "),i>0?t+=i+"m ":r>0&&(t+=r+"s")}return t},e.ParseModuleDomainAddress=function(e){var t=null;return e.indexOf(":")>0&&(t={Domain:e.substring(0,e.lastIndexOf(":")),Address:e.substring(e.lastIndexOf(":")+1)}),t},e.GetModuleByDomainAddress=function(e,t){for(var o=null,a=0;a=12?"PM":"AM";i%=12,i=i?i:12,a=i+":"+r+(0==t.indexOf("s")?":"+n+("sm"==t?"."+e.getMilliseconds():""):"")+" "+s}return a},e.SwitchPopup=HG.Ui.SwitchPopup,e.JScrollToElement=HG.Ui.ScrollTo},HG.WebApp.Data._CurrentGroup=null,HG.WebApp.Data._CurrentGroupIndex=0,HG.WebApp.Home=HG.WebApp.Home||new function(){var $$=this;$$.About=function(){$("#homegenie_about").popup("open")},$$.UpdateHeaderStatus=function(){$$.UpdateInterfacesStatus()},$$.UpdateInterfacesStatus=function(){var ifaceurl="/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Interfaces.List/";$.ajax({url:ifaceurl,type:"GET",success:function(data){var interfaces=HG.WebApp.Data.Interfaces=eval(data),status="",isupdateavailable=!1;if(interfaces&&"undefined"!=interfaces)for(i=0;i':isupdateavailable=!0}isupdateavailable&&(status+=''),$("#interfaces_status").html(status)}})}},HG.WebApp.Events=HG.WebApp.Events||new function(){var $$=this;$$._eventQueueCapacity=200,$$._ledOffTimeout=null,$$._popupHideTimeout=null,$$._listeners=[],$$.InitializePage=function(){var e=$$.getContainer();e.on("pagebeforeshow",function(){$$.Refresh()}),$$.field("property-txt").change(function(){$$.Refresh()}),$$.field("source-txt").change(function(){$$.Refresh()}),$$.field("domain-txt").change(function(){$$.Refresh()}),setTimeout(function(){$$.Setup()},2e3)},$$.AddListener=function(e){e._eventListenerId=$$._listeners.length+1,$$._listeners.push(e)},$$.RemoveListener=function(e){for(var t=0;t<$$._listeners.length;t++)if($$._listeners[t]._eventListenerId==e._eventListenerId){$$._listeners.splice(t,1);break}},$$.Setup=function(){var e=new EventSource("/events");e.onopen=function(){$$.ShowEventPopup({icon:"images/genie.png",title:"HomeGenie
Event Stream
CONNECTED!",text:"",timestamp:""})},e.onerror=function(){$$.ShowEventPopup({icon:"images/genie.png",title:"HomeGenie
EventStream
DISCONNECTED!",text:"",timestamp:""}),e.close(),setTimeout($$.Setup,1e3)},e.onmessage=function(e){var t=JSON&&JSON.parse(e.data)||$.parseJSON(e.data);t.Value=t.Value.toString();var o=null;0==("HomeGenie.System"==t.Domain&&"Console.Output"==t.Property)&&(o=HG.WebApp.Utility.GetModuleByDomainAddress(t.Domain,t.Source),null!=o&&(HG.WebApp.Utility.SetModulePropertyByName(o,t.Property,t.Value,t.Timestamp),HG.WebApp.Control.RefreshGroupIndicators()),$$.SendEventToUi(o,t)),"MIGService.Interfaces"==t.Domain&&HG.WebApp.Home.UpdateInterfacesStatus(),HG.WebApp.Store.get("UI.EventsHistory")&&(HG.WebApp.Data.Events.push(t),HG.WebApp.Data.Events.length>$$._eventQueueCapacity&&HG.WebApp.Data.Events.shift(),null!=$$._ledOffTimeout&&clearTimeout($$._ledOffTimeout),$$.field("#event_status_off",!0).hide(),$$.field("#event_status_on",!0).show(),$$._ledOffTimeout=setTimeout(function(){$$._ledOffTimeout=null,$$.field("#event_status_on",!0).hide(),$$.field("#event_status_off",!0).show()},500),$.mobile.activePage.attr("id")==$$.PageId&&$$.Refresh());for(var a=0;a<$$._listeners.length;a++)$$._listeners[a].parameterEventCallback(o,t)}},$$.Refresh=function(){for(var e=($("#"+$$.PageId),""),t=HG.WebApp.Data.Events.length-1;t>=0;t--){var o=HG.WebApp.Data.Events[t],a=$$.field("property-txt").val(),i=$$.field("source-txt").val(),r=$$.field("domain-txt").val();if(!(""!=r&&o.Domain.indexOf(r)<0||""!=i&&o.Source.indexOf(i)<0||""!=a&&o.Property.indexOf(a)<0)){var n=new Date(o.UnixTimestamp),s=HG.WebApp.Utility.FormatDate(n)+" "+HG.WebApp.Utility.FormatDateTime(n);e+="",e+=''+HG.WebApp.Utility.FormatDateTime(n,"sm")+"",e+=""+o.Property+"",e+=""+o.Value+"",e+=""+o.Source+"",e+=""+o.Domain+"",e+=""}}var l=$$.field("events-tbl");l.find("tbody").html(e),l.table().table("refresh")},$$.SendEventToUi=function(module,eventLog){null!=module&&(HG.WebApp.Control.UpdateModuleWidget(eventLog.Domain,eventLog.Source,eventLog.Property,eventLog.Value),$.mobile.activePage.attr("id")==HG.WebApp.WidgetEditor.PageId&&HG.WebApp.WidgetEditor.RenderView(eventLog),("HomeAutomation.HomeGenie.Automation"==module.Domain&&"Program.Status"!=eventLog.Property||"Program.UiRefresh"==eventLog.Property)&&HG.Configure.Modules.Get(module.Domain,module.Address,function(data){try{var mod=eval("["+data+"]")[0],idx=HG.WebApp.Utility.GetModuleIndexByDomainAddress(mod.Domain,mod.Address);HG.WebApp.Data.Modules[idx]=mod,HG.WebApp.Control.UpdateModuleWidget(mod.Domain,mod.Address)}catch(e){}}));var logdate=new Date(eventLog.UnixTimestamp),date=HG.WebApp.Utility.FormatDateTime(logdate),popupdata=null;switch(eventLog.Domain){case"HomeGenie.System":"STARTED"!=eventLog.Value&&"UPDATED"!=eventLog.Value||($$.field("#configure_system_updateinstall_status",!0).html("Update install complete. HomeGenie ready."),setTimeout(function(){document.location.href="/"},3e3));case"HomeGenie.UpdateChecker":if("InstallProgress.Message"==eventLog.Property)$$.field("#configure_system_updateinstall_log",!0).prepend("* "+eventLog.Value+"
");else{$$.field("#configure_system_updateinstall_log",!0).prepend("* "+eventLog.Property+"
  "+eventLog.Value+"
");var iconImage="images/genie.png";popupdata={icon:iconImage,title:eventLog.Property+"
"+eventLog.Value,text:"",timestamp:date}}break;case"HomeGenie.PackageInstaller":var log=$$.field("#systemsettings_browserepo",!0).find("[data-ui-field=install_text]"),restore_log=$$.field("#systemsettings_backuprestores1",!0).find("[data-ui-field=restore_log]");if("InstallProgress.Message"==eventLog.Property)log.append("* "+eventLog.Value+"
"),restore_log.append("* "+eventLog.Value+"
");else{log.append("* "+eventLog.Property+"
  "+eventLog.Value+"
"),restore_log.append("* "+eventLog.Property+"
  "+eventLog.Value+"
");var iconImage="images/genie.png";popupdata={icon:iconImage,title:eventLog.Property+"
"+eventLog.Value,text:"",timestamp:date}}var height=log.parent()[0].scrollHeight;log.parent().scrollTop(height),height=restore_log[0].scrollHeight,restore_log.scrollTop(height);break;case"HomeGenie.BackupRestore":var restore_log=$$.field("#systemsettings_backuprestores1",!0).find("[data-ui-field=restore_log]");restore_log.append("* "+eventLog.Value+"
");var height=restore_log[0].scrollHeight;restore_log.scrollTop(height);break;case"HomeAutomation.HomeGenie.Automation":var iconImage=HG.Ui.GetModuleIcon(module,null);if("Runtime.Error"==eventLog.Property)null!=module&&""!=eventLog.Value?(popupdata={icon:iconImage,title:'Program '+module.Address+"
"+eventLog.Value+"",text:"Runtime
Error",timestamp:date},"page_automation_editprogram"==$.mobile.activePage.attr("id")&&HG.WebApp.ProgramEdit.RefreshProgramOptions()):null!=module&&HG.WebApp.ProgramEdit._CurrentProgram.Address==module.Address&&(HG.WebApp.ProgramEdit._CurrentProgram.ScriptErrors="",HG.WebApp.ProgramEdit.RefreshProgramEditorTitle());else if("Program.Status"==eventLog.Property)null!=module&&HG.WebApp.ProgramEdit._CurrentProgram.Address==module.Address&&HG.WebApp.ProgramEdit.RefreshProgramEditorTitle();else if("Program.Notification"==eventLog.Property){var notification=JSON.parse(eventLog.Value);popupdata={icon:iconImage,title:''+notification.Title+"
"+notification.Message,text:"",timestamp:date}}else $$.IsBlacklisted(eventLog.Property)||(popupdata={icon:iconImage,title:''+eventLog.Property+"
"+eventLog.Value,text:"",timestamp:date});break;case"Protocols.UPnP":case"HomeAutomation.ZWave":if("1"==eventLog.Source){var domain=eventLog.Domain.substr(eventLog.Domain.lastIndexOf(".")+1);popupdata={icon:"images/genie.png",title:''+domain+" "+eventLog.Property+"
"+eventLog.Value,text:"",timestamp:date};break}default:if(null!=module&&!$$.IsBlacklisted(eventLog.Property)){var iconImage=HG.Ui.GetModuleIcon(module,null);if("RF"!=module.Address&&"IR"!=module.Address||""==eventLog.Value){if("Sensor."==eventLog.Property.substring(0,7)){var group=HG.WebApp.GroupsList.GetModuleGroup(module);null!=group&&(group=group.Name);var name=module.Domain.substring(module.Domain.indexOf(".")+1)+" "+module.Address,propname=eventLog.Property.substring(eventLog.Property.indexOf(".")+1);switch(propname){case"Temperature":iconImage="pages/control/widgets/homegenie/generic/images/temperature.png";var temperature=eventLog.Value.replace(",",".");eventLog.Value=HG.WebApp.Utility.FormatTemperature(temperature);break;case"Luminance":iconImage="pages/control/widgets/homegenie/generic/images/luminance.png";break;default:iconImage="pages/control/widgets/homegenie/generic/images/sensor.png"}""!=module.Name&&(name=module.Name),null==group&&(group=""),popupdata={icon:iconImage,title:''+group+"
"+name+"
"+propname,text:parseFloat(eventLog.Value.replace(",",".")).toFixed(2),timestamp:date}}else if("Status."==eventLog.Property.substring(0,7)){var group=HG.WebApp.GroupsList.GetModuleGroup(module);null!=group&&(group=group.Name);var name=module.Domain.substring(module.Domain.indexOf(".")+1)+" "+module.Address,propname=eventLog.Property.substring(eventLog.Property.indexOf(".")+1),value=eventLog.Value;isNaN(eventLog.Value.replace(",","."))||(value=parseFloat(eventLog.Value.replace(",",".")).toFixed(2)),""!=module.Name&&(name=module.Name),null==group&&(group=""),popupdata={icon:iconImage,title:''+group+"
"+name+"",text:propname+"
"+value,timestamp:date}}}else iconImage="images/remote.png",popupdata={icon:iconImage,title:''+module.Domain.substring(module.Domain.indexOf(".")+1)+"
"+eventLog.Value,text:module.Address,timestamp:date};if(HG.WebApp.ProgramEdit._IsCapturingConditions&&""!=eventLog.Value){var conditionobj={Domain:module.Domain,Target:module.Address,Property:eventLog.Property,ComparisonOperator:"Equals",ComparisonValue:eventLog.Value};HG.WebApp.ProgramEdit._CurrentProgram.Conditions.push(conditionobj),automationpage_ConditionsRefresh()}else if(HG.WebApp.ProgramEdit._IsCapturingCommands&&""!=eventLog.Value){var command=HG.WebApp.Utility.GetCommandFromEvent(module,eventLog);null!=command&&(HG.WebApp.ProgramEdit._CurrentProgram.Commands.push(command),automationpage_CommandsRefresh())}}}null!=popupdata&&!$$.PopupHasIgnore(eventLog.Domain,eventLog.Source,eventLog.Property)&&eventLog.Description.indexOf(":nopopup:")<0&&!$$.IsBlacklisted(eventLog.Property)&&$$.ShowEventPopup(popupdata,eventLog)},$$.IsBlacklisted=function(e){return!("Meter.Watts"!=e&&!e.startsWith("ConfigureOptions.")&&"Program.UiRefresh"!=e)},$$.PopupRefreshIgnore=function(){var e=HG.WebApp.Store.get("UI.EventPopupIgnore");if(null!=e){$$.field("#popupsettings_ignorelist",!0).find("li:gt(0)").remove();for(var t=0;t',o+='
'+e[t].Domain+"
",o+='
'+e[t].Address+"
",o+='
'+e[t].Property+"
",o+=" ",o+="",$$.field("#popupsettings_ignorelist",!0).append(o)}$$.field("#popupsettings_ignorelist",!0).listview().trigger("create"),$$.field("#popupsettings_ignorelist",!0).listview("refresh")}},$$.PopupHasIgnore=function(e,t,o){var a=HG.WebApp.Store.get("UI.EventPopupIgnore");if(null==a)return!1;for(var i=!1,r=0;r',o+='',o+=e.title,o+=''+e.text+"",o+=''+e.timestamp+"",t&&(o+='Block popup from this source'),o+="",o+="";var a=$$.field("#statuspopup",!0);a.html(o),null!=$$._popupHideTimeout?clearTimeout($$._popupHideTimeout):(a.css("display",""),a.animate({opacity:"0"},0,function(){a.animate({right:"5px",opacity:"0.90"},300)})),$$._popupHideTimeout=setTimeout(function(){"none"!=a.css("display")&&a.animate({right:"-300px",opacity:"0.0"},300,function(){a.css("display","none")}),$$._popupHideTimeout=null},5e3)}},HG.Ui.CreatePage(HG.WebApp.Events,"page_events"),HG.WebApp.Control=HG.WebApp.Control||new function(){var $$=this;$$._widgetConfiguration=[],$$._widgetList=[],$$._renderModuleDelay=null,$$._renderModuleBusy=!1,$$.InitializePage=function(){var page=$$.getContainer();page.on("pageinit",function(e){$$.toolbarMacroRecord=$("#toolbar_macrorecord"),$$.toolbarMacroRecord.hide(),$$.toolbarControl=$("#toolbar_control"),$$.toolbarControl.show(),$$.recordDelayNone=$("#macrorecord_delay_none"),$$.recordDelayMimic=$("#macrorecord_delay_mimic"),$$.recordDelayFixed=$("#macrorecord_delay_fixed"),$("#control_macrorecord_optionspopup").bind("popupafterclose",function(){$$.recordDelayNone.prop("checked")?HG.Automation.Macro.SetDelay("None",""):$$.recordDelayMimic.prop("checked")?HG.Automation.Macro.SetDelay("Mimic",""):$$.recordDelayFixed.prop("checked")&&HG.Automation.Macro.SetDelay("Fixed",$$.field("#macrorecord_delay_seconds",!0).val())}),$$.controlGroupSelect=$("#control_groupselect"),$$.controlGroupSelect.change(function(){var e=$$.controlGroupSelect.val();$$.ShowGroup(e)}),$.ajax({url:"pages/control/widgets/configuration.json",type:"GET",success:function(data){$$._widgetConfiguration=eval(data)},error:function(){alert("error loading widgets configuration")}})}),page.on("pagehide",function(){widgetsloadtimer&&clearTimeout(widgetsloadtimer),null!=$$._renderModuleDelay&&clearTimeout($$._renderModuleDelay),$$._renderModuleBusy=!1,widgetsloadqueue=[],$$.field('div[data-ui-field="wallpaper"]',!0).hide()}),page.on("pagebeforeshow",function(){$$.clearCache(),$.mobile.loading("show"),HG.Configure.Groups.List("Control",function(){0==$$.field("#control_groupslist",!0).children().length&&$$.RenderGroups(),$$.UpdateModules()}),HG.Automation.Macro.GetDelay(function(e){$$.recordDelayNone.prop("checked",!1).checkboxradio("refresh"),$$.recordDelayMimic.prop("checked",!1).checkboxradio("refresh"),$$.recordDelayFixed.prop("checked",!1).checkboxradio("refresh"),$$.field("#macrorecord_delay_"+e.DelayType.toLowerCase(),!0).prop("checked",!0).checkboxradio("refresh"),$$.field("#macrorecord_delay_seconds",!0).val(e.DelayOptions)})}),$$.field("#control_bottombar_voice_button",!0).on("click",function(){var e=$(this),t=$$.field("#speechinput",!0);"none"==t.css("display")?(e.removeClass("ui-icon-carat-u"),e.addClass("ui-icon-carat-d"),t.show(150),t.find("input").focus()):(e.removeClass("ui-icon-carat-d"),e.addClass("ui-icon-carat-u"),t.hide(150),t.find("input").blur()),setTimeout(function(){e.removeClass("ui-btn-active")},200)}),$$.field("#voicerecognition_text",!0).on("change",function(){HG.VoiceControl.InterpretInput($(this).val())}).on("keyup",function(e){13==e.keyCode&&HG.VoiceControl.InterpretInput($(this).val())}),$$.field("#groups_panel",!0).panel().trigger("create"), -$$.field("#groups_panel",!0).on("beforeopen",function(){setTimeout($$.RenderMenu,1e3)})},$$.ShowGroup=function(e){$.mobile.loading("show"),HG.WebApp.Data._CurrentGroup=HG.WebApp.GroupModules.CurrentGroup=HG.WebApp.Data.Groups[e].Name,HG.WebApp.Data._CurrentGroupIndex=e,$$.field('div[data-ui-field="wallpaper"]',!0).show(),$$.field('div[data-ui-field="wallpaper"]',!0).css("background-image","url(images/wallpapers/"+HG.WebApp.Data.Groups[e].Wallpaper+")"),$$.RefreshGroupIndicators(),$$.field("#control_groupcontent",!0).children("div").hide(),$$.field("#groupdiv_modules_"+HG.WebApp.Data._CurrentGroupIndex,!0).show(),setTimeout(function(){$$.RenderGroupModules(e)},100)},$$.UpdateModules=function(){$.mobile.loading("show"),HG.Configure.Modules.List(function(data){try{HG.WebApp.Data.Modules=eval(data)}catch(e){}HG.Automation.Programs.List(function(){$.mobile.loading("hide"),$$.ShowGroup(HG.WebApp.Data._CurrentGroupIndex)})})},$$.ConfigureGroup=function(){HG.WebApp.GroupsList.ConfigureGroup(HG.WebApp.Data._CurrentGroupIndex)},$$.RecordMacroStart=function(){$$.field("#control_actionmenu",!0).popup("close"),HG.Automation.Macro.Record(),$$.toolbarControl.hide("slidedown"),setTimeout(function(){$$.toolbarMacroRecord.show("slideup")},500),$$.field("#btn_control_macrorecord",!0).qtip({content:{title:HG.WebApp.Locales.GetLocaleString("control_macrorecord_recording"),text:HG.WebApp.Locales.GetLocaleString("control_macrorecord_description"),button:HG.WebApp.Locales.GetLocaleString("control_macrorecord_close")},show:{event:!1,ready:!0,delay:1500},events:{hide:function(){$(this).qtip("destroy")}},hide:{event:!1,inactive:5e3},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{my:"bottom center",at:"top center"}})},$$.RecordMacroSave=function(e){$.mobile.loading("show"),HG.Automation.Macro.Save(e,function(e){HG.Automation.Programs.List(function(){HG.WebApp.AutomationGroupsList._CurrentGroup="",HG.WebApp.ProgramEdit._CurrentProgram.Address=e,HG.Configure.Groups.List("Automation",function(){HG.WebApp.ProgramsList.EditProgram(),$.mobile.changePage($$.field("#page_automation_editprogram",!0),{transition:"fade",changeHash:!0}),$.mobile.loading("hide")})})}),$$.toolbarControl.show("slideup"),$$.toolbarMacroRecord.hide("slidedown")},$$.RecordMacroDiscard=function(){HG.Automation.Macro.Discard(),$$.toolbarControl.show("slideup"),$$.toolbarMacroRecord.hide("slidedown")},$$.RenderMenu=function(){for($$.field("#control_groupsmenu",!0).find("li:gt(0)").remove(),i=0;i',t=$('
  • '+HG.WebApp.Data.Groups[i].Name+""+e+"
  • ");t.on("click",function(){var e=$(this).attr("data-context-idx");$$.ShowGroup(e),$.mobile.pageContainer.pagecontainer("change","#page_control",{transition:"none"})}),$$.field("#control_groupsmenu",!0).append(t)}$$.field("#control_groupsmenu",!0).listview().listview("refresh")},$$.RenderGroups=function(){for($.each($$.field("#control_groupcontent",!0).find("div[class=isotope]"),function(){$(this).isotope("destroy")}),$$.field("#control_groupcontent",!0).empty(),i=0;i')},$$.GetWidget=function(e,t){for(var o=!1,a=0;a<$$._widgetList.length;a++)if($$._widgetList[a].Widget==e){if(o=!0,"function"==typeof t){var i=$$._widgetList[a],r=HG.WebApp.WidgetEditor.GetInstance(i.Json);t({Widget:i.Widget,Instance:r,Json:i.Json,Model:i.Model})}break}""==e||o?o||"function"==typeof t&&t(null):$.ajax({url:"pages/control/widgets/"+e+".js",type:"GET",dataType:"text",success:function(o){var a=null,i=o;$.get("pages/control/widgets/"+e+".html",function(o){var r={Widget:e,Instance:null,Json:i,Model:o};$$._widgetList.push(r);try{a=HG.WebApp.WidgetEditor.GetInstance(i)}catch(n){alert(e+" Loading Error:\n"+n)}"function"==typeof t&&t({Widget:e,Instance:a,Json:i,Model:o})})},error:function(e){console.log(e),"function"==typeof t&&t(null)}})};var widgetsloadqueue=[],widgetsloadtimer=null;$$.RenderModule=function(){if(clearTimeout(widgetsloadtimer),widgetsloadqueue.length>0){var t=widgetsloadqueue.splice(0,1)[0],o=$$.field("#"+t.ElementId,!0).data("homegenie.widget");if(null!=o&&"undefined"!=o)HG.WebApp.WidgetEditor.RenderWidget("#"+t.ElementId,o,o.module),widgetsloadtimer=setTimeout(function(){$$.RenderModule()},10);else{var a='
    ",t.GroupElement.append(a),t.GroupElement.trigger("create"),null!=o.Json){var i=HG.WebApp.WidgetEditor.GetInstance(o.Json);$$.field("#"+t.ElementId,!0).data("homegenie.widget",i),t.Module.WidgetInstance=i,HG.WebApp.Locales.LocalizeWidget(t.Module.Widget,t.ElementId,function(){$$.field("#"+t.ElementId,!0).show();var e=t.Module;HG.WebApp.WidgetEditor.RenderWidget("#"+t.ElementId,e.WidgetInstance,e),widgetsloadtimer=setTimeout(function(){$$.RenderModule()},0)})}else alert(t.Module.Widget+" Widget Instance Error:\n"+e),widgetsloadtimer=setTimeout(function(){$$.RenderModule()},0);else console.log(t.Module.Widget+" Widget Error."),widgetsloadtimer=setTimeout(function(){$$.RenderModule()},0)})}}else $$._renderModuleBusy=!1,$$.field("#groupdiv_modules_"+HG.WebApp.Data._CurrentGroupIndex,!0).isotope({itemSelector:".freewall",layoutMode:"fitRows"}).isotope().addClass("isotope"),$$.UpdateActionsMenu(),$.mobile.loading("hide")},$$.EditModule=function(e){HG.WebApp.GroupModules.CurrentGroup=HG.WebApp.Data._CurrentGroup,HG.WebApp.GroupModules.CurrentModule=e;var t=e.DeviceType;HG.WebApp.GroupModules.ModuleEdit(function(){if(t!=e.DeviceType){var o=$$.field("#groupdiv_modules_"+HG.WebApp.Data._CurrentGroupIndex,!0);o.empty(),$$.ShowGroup(HG.WebApp.Data._CurrentGroupIndex)}else $$.UpdateModuleWidget(e.Domain,e.Address)})},$$.EditModuleParams=function(e){HG.WebApp.GroupModules.CurrentGroup=HG.WebApp.Data._CurrentGroup,HG.WebApp.GroupModules.CurrentModule=e,$$.field("#page_configure_groupmodules_propspopup",!0).popup("open",{transition:"pop",positionTo:"window"})},$$.GetModuleUid=function(e){var t=e.Domain.substring(e.Domain.lastIndexOf(".")+1).replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~() ]/g,"_"),o=e.Address.replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~() ]/g,"_"),a=t+"_"+o;return a},$$.UpdateActionsMenu=function(){$$.field("#control_custom_actionmenu",!0).empty();for(var e=0;e"+HG.WebApp.Locales.GetProgramLocaleString(a.Address,"Title",a.Name)+"")}$$.field("#control_custom_actionmenu",!0).listview("refresh")},$$.UpdateModuleWidget=function(e,t,o,a){for(var i=0;i0||$$._renderModuleBusy)return null!=$$._renderModuleDelay&&clearTimeout($$._renderModuleDelay),void($$._renderModuleDelay=setTimeout(function(){$$.RenderGroupModules(e)},500));$$._renderModuleBusy=!0,$$._renderModuleDelay=null;for(var t=HG.Configure.Groups.GetGroupModules(HG.WebApp.Data.Groups[e].Name),o=$$.field("#groupdiv_modules_"+t.Index,!0),a=0;a0&&(b+=''+(1e3*o).toFixed(1)+""),i>0&&(b+=''+i+""),a>0&&(b+=''+a+""),null!=r&&(displayvalue=HG.WebApp.Utility.FormatTemperature(r),b+=''+displayvalue+""),null!=s&&(b+=''+(1*s).toFixed(0)+""),null!=n&&(b+=''+(1*n).toFixed(0)+""),$$.field("#control_groupindicators_"+e,!0).html(b),e==HG.WebApp.Data._CurrentGroupIndex&&($$.field("#control_groupmenutitle",!0).html(HG.WebApp.Data.Groups[e].Name),$$.field("#control_groupindicators",!0).html(b))}},$$.LoadGroups=function(){$.mobile.loading("show"),HG.Configure.Groups.List("Control",function(){$$.RenderGroups()})}},HG.Ui.CreatePage(HG.WebApp.Control,"page_control"),HG.WebApp.Statistics=HG.WebApp.Statistics||new function(){var $$=this;$$._CurrentTab=1,$$._InitDateFromTo=4,$$._CurrentModule="",$$._CurrentParameter="Meter.Watts",$$._CurrentGraphType="bars",$$._CurrentType="hours",$$._RefreshIntervalObject=null,$$._RefreshInterval=3e5,$$._SelItemObject=!1,$$._ItemObject="",$$.GetDateBoxLocale=function(){var e="default",t=jQuery.mobile.datebox.prototype.options.lang,o=HG.WebApp.Locales.GetUserLanguage();return t&&(t[o]?e=o:2===o.length&&$.each(t,function(t){return t.substring(0,2)===o?(e=t,!1):void 0})),e},$$.InitializePage=function(){$("#page_analyze_source").on("change",function(){var e=$(this).find("option:selected"),t=e.attr("data-context-domain")+":"+e.attr("data-context-address");":"==t&&(t=""),$$.RefreshParameters(t)}),$("#page_analyze_param").on("change",function(){$$.RefreshModules()}),$("#page_analyze_renderbutton").bind("click",function(){var e=$("#page_analyze_source").find("option:selected");$$._CurrentModule=e.attr("data-context-domain")+":"+e.attr("data-context-address"),":"==$$._CurrentModule&&($$._CurrentModule=""),$$._CurrentParameter=$("#page_analyze_param").val(),$$._CurrentType=$("#page_analyze_type").val(),"Meter."==$$._CurrentParameter.substring(0,6)||"PowerMonitor."==$$._CurrentParameter.substring(0,13)?$("#statistics_tab3_button").show():$("#statistics_tab3_button").hide(),$$.SetTab(1),$("#page_analyze_title").html($("#page_analyze_source").find("option:selected").text()+" - "+$("#page_analyze_param").find("option:selected").text()),$("#page_analyze_title2").html($("#page_analyze_title").val()),$("#analyze_stats_options").popup("close")}),$("#page_analyze_costperunit").on("change",function(){var e=$("#page_analyze_costperunit").val()*$("#page_analyze_totalunits").val();$("#page_analyze_totalcost").val(e.toFixed(2)),HG.WebApp.Store.set("UI.Statistics.CostPerUnit",$("#page_analyze_costperunit").val())}),$("#analyze_stats_options").on("popupbeforeposition",function(){$$.RefreshModules(),$$.RefreshParameters()}),$("#page_analyze_datefrom").val(""),$("#page_analyze_datefrom").on("change",function(){0==$$._InitDateFromTo?$$.Refresh():$$._InitDateFromTo-=1}),$("#page_analyze_dateto").val(""),$("#page_analyze_dateto").on("change",function(){0==$$._InitDateFromTo?$$.Refresh():$$._InitDateFromTo-=1}),$("#statshour").qtip({id:"flot",prerender:!0,content:" ",position:{target:"mouse",viewport:$("#flot"),adjust:{x:5}},show:!1,hide:{event:!1,fixed:!0}}),$("#statshour").bind("plothover",function(e,t,o){var a,i=$(this),r=i.qtip();if(!o)return r.cache.point=!1,r.hide(o);if(a=r.cache.point,a!==o.dataIndex){var n=60*(new Date).getTimezoneOffset()*1e3;r.cache.point=o.dataIndex,r.set("content.text",o.series.label+" at "+new Date(o.datapoint[0]+n).toLocaleTimeString()+" = "+o.datapoint[1].toFixed(2)),"days"==$$._CurrentType?0==$$._SelItemObject&&($("#page_delete_stat").html("Delete Value : "+o.datapoint[1]),$$._ItemObject=o.datapoint[0]+"/"+o.datapoint[1],r.elements.tooltip.stop(1,1),r.show(o)):(r.elements.tooltip.stop(1,1),r.show(o))}}),$("#statscounter").qtip({id:"flot",prerender:!0,content:" ",position:{target:"mouse",viewport:$("#flot"),adjust:{x:5}},show:!1,hide:{event:!1,fixed:!0}}),$("#statscounter").bind("plothover",function(e,t,o){var a,i=$(this),r=i.qtip();if(!o)return r.cache.point=!1,r.hide(o);if(a=r.cache.point,a!==o.dataIndex){var n=60*(new Date).getTimezoneOffset()*1e3;r.cache.point=o.dataIndex,r.set("content.text",o.series.label+" at "+new Date(o.datapoint[0]+n).toLocaleTimeString()+" = "+o.datapoint[1].toFixed(2)),r.elements.tooltip.stop(1,1),r.show(o)}}),$("#page_delete_stat").on("click",function(){1==$$._SelItemObject&&($.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Statistics/Parameter.StatDelete/"+$$._ItemObject,type:"GET",success:function(data){var stats=eval(data);$.mobile.loading("hide")},error:function(e){console.log("STATISTICS ERROR: "+e.status+":"+e.statusText),$.mobile.loading("hide")}}),$$._ItemObject=""),$$._SelItemObject=!1,$("#page_delete_stat").hide()}),$("#statshour").on("click",function(){0==$$._SelItemObject?""!=$$._ItemObject&&($$._SelItemObject=!0,$("#page_delete_stat").show()):($$._ItemObject="",$$._SelItemObject=!1,$("#page_delete_stat").hide())})},$$.SetTab=function(e){$$._CurrentTab=e,$("#statistics_tab1").hide(),$("#statistics_tab2").hide(),$("#statistics_tab1_button").removeClass("ui-btn-active"),$("#statistics_tab2_button").removeClass("ui-btn-active"),$("#statistics_tab"+e).show(),$("#statistics_tab"+e+"_button").addClass("ui-btn-active"),$$.Refresh()},$$.SetAutoRefresh=function(e){null!=$$._RefreshIntervalObject&&clearInterval($$._RefreshIntervalObject),$$._RefreshIntervalObject=null,e&&($$._RefreshIntervalObject=setInterval("HG.WebApp.Statistics.Refresh();",$$._RefreshInterval))},$$.InitConfiguration=function(){$("#page_analyze_costperunit").val(HG.WebApp.Store.get("UI.Statistics.CostPerUnit")?HG.WebApp.Store.get("UI.Statistics.CostPerUnit"):22e-5),HG.Statistics.ServiceCall("Configuration.Get","","",function(e){var t=1*e.StatisticsUIRefreshSeconds;$$._RefreshInterval=1e3*t,$$.SetAutoRefresh(!0),$$.SetTab(1)})},$$.RefreshParameters=function(e){var t=$("#page_analyze_param").val();""==t&&(t="Meter.Watts"),$("#page_analyze_param").empty(),HG.Statistics.ServiceCall("Parameter.List",e,"",function(e){for(var o=0;o0&&(a=a.substring(a.indexOf(".")+1)),$("#page_analyze_param").append('")}$("#page_analyze_param").selectmenu("refresh")})},$$.RefreshModules=function(){var e=$("#page_analyze_source").find("option:selected"),t=e.attr("data-context-domain"),o=e.attr("data-context-address");$("#page_analyze_source").empty(),$("#page_analyze_source").append('');var a="All"==t;$("#page_analyze_source").append('");for(var i="",r=0;r"+c+"";break}}""!=l&&(i+='',i+=l,i+="")}$("#page_analyze_source").append(i),$("#page_analyze_source").selectmenu("refresh")},$$.Refresh=function(){$.mobile.loading("show");var showsplines="splines"==$$._CurrentGraphType,showlines="lines"==$$._CurrentGraphType,showbars="bars"==$$._CurrentGraphType,showtype="hours"==$$._CurrentType;if(1==$$._CurrentTab)0==$$._SelItemObject&&$("#page_delete_stat").hide(),HG.Statistics.ServiceCall("Global.TimeRange","","",function(trange){var start=new Date(parseFloat(trange.StartTime)),end=new Date(parseFloat(trange.EndTime)),today=new Date,minDays=Math.ceil((today-start)/864e5);$("#page_analyze_datefrom").datebox("option",{minDays:minDays,maxDays:0,useLang:$$.GetDateBoxLocale()}).datebox("refresh"),$("#page_analyze_dateto").datebox("option",{minDays:minDays,maxDays:0,useLang:$$.GetDateBoxLocale()}).datebox("refresh"),""==$("#page_analyze_datefrom").val()&&($("#page_analyze_datefrom").datebox("setTheDate",today),$("#page_analyze_datefrom").trigger("datebox",{method:"doset"})),""==$("#page_analyze_dateto").val()&&($("#page_analyze_dateto").datebox("setTheDate",today),$("#page_analyze_dateto").trigger("datebox",{method:"doset"}));var dfrom=new Date($("#page_analyze_datefrom").datebox("getTheDate").getTime()),dto=new Date($("#page_analyze_dateto").datebox("getTheDate").getTime());if(dfrom.setHours(0,0,0,0),dto.setHours(23,59,59,0),"All:"!=$$._CurrentModule)1==showtype?$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Statistics/Parameter.StatsHour/"+$$._CurrentParameter+"/"+$$._CurrentModule+"/"+dfrom.getTime()+"/"+dto.getTime(),type:"GET",success:function(data){var stats=eval(data);try{if("Sensor.Temperature"==$$._CurrentParameter)for(var sx=0;sx";for(i=0;i',t+=''+o.Name+"",t+=''+a+"",t+='
    ',t+=""}e.groupList.append(t),e.groupList.listview().listview("refresh"),e.groupList.sortable({handle:".handle",axis:"y",scrollSpeed:10}).sortable("refresh"),e.groupList.on("sortstop",function(){e.SortGroups()}),e.groupList.find("li").bind("click",function(){e.ConfigureGroup($(this).attr("data-group-index"))})},e.ConfigureGroup=function(t){e.groupList.attr("selected-group-name",HG.WebApp.Data.Groups[t].Name),e.groupList.attr("selected-group-index",t),$.mobile.changePage($("#page_configure_groupmodules"),{transition:"fade",changeHash:!0})},e.GetModuleGroup=function(e){for(var t=null,o=0;o=0&&(t+=e+";",$(this).attr("data-module-index",o),o++)}),e.groupList.empty(),$.mobile.loading("show"),HG.Configure.Groups.Sort("Control",t,function(){$.mobile.loading("hide"),e.LoadGroups()})},e.SaveGroups=function(t){$.mobile.loading("show"),$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.Save/",data:JSON.stringify(HG.WebApp.Data.Groups),success:function(){e.groupList.empty(),HG.WebApp.GroupModules.LoadGroupModules(),$.mobile.loading("hide"),null!=t&&t()},error:function(){$.mobile.loading("hide")}})}},HG.WebApp.GroupModules=HG.WebApp.GroupModules||new function(){var $$=this;$$.CurrentGroup="(none)",$$.CurrentModule=null,$$.CurrentModuleProperty=null,$$.EditModule=[],$$.SeparatorItemDomain="HomeGenie.UI.Separator",$$.InitializePage=function(){var page=$$.getContainer();page.on("pageinit",function(e){$$.field("#module_add_button",!0).on("click",function(){var e=$$.field("#automation_group_moduleadd",!0).find(":selected"),t=e.attr("data-context-domain"),o=e.attr("data-context-value");$$.AddGroupModule($$.CurrentGroup,t,o,function(){var e=$$.field("#page_configure_groupmodules_list",!0).find("ul"),t=e.find("li").last();e.parent().animate({scrollTop:t.position().top})})}),$$.field("#group_delete_button",!0).on("click",function(){$$.DeleteGroup($$.CurrentGroup)}),$$.field("#btn_configure_group_deletegroup",!0).on("click",function(){HG.Ui.SwitchPopup("#listmodules_actionmenu","#automation_group_delete")}),$$.field("#btn_configure_group_addmodule",!0).on("click",function(){HG.Ui.SwitchPopup("#listmodules_actionmenu","#automation_group_modulechoose")}),$$.field("#btn_configure_group_addseparator",!0).on("click",function(){$$.EditModule.Domain="",$$.EditModule.Address="",HG.Ui.SwitchPopup("#listmodules_actionmenu","#automation_group_separator_edit")}),$$.field("#btn_configure_group_editseparatoradd",!0).on("click",function(){var e=$$.field("#automation_group_separatorlabel",!0).val().trim();""!=e&&$$.AddGroupModule($$.CurrentGroup,$$.SeparatorItemDomain,e,function(){var e=$$.field("#page_configure_groupmodules_list",!0).find("ul li").last();$$.field("#page_configure_groupmodules_list",!0).find("ul").parent().animate({scrollTop:e.position().top},"slow")})}),$$.field("#automation_group_separator_edit",!0).on("popupbeforeposition",function(){""!=$$.EditModule.Address?($$.field("#automation_group_separatorlabel",!0).val($$.EditModule.Address),$$.field("#automation_group_separatorlabel",!0).addClass("ui-disabled"),$$.field("#btn_configure_group_editseparatoradd",!0).hide()):($$.field("#automation_group_separatorlabel",!0).val(""),$$.field("#automation_group_separatorlabel",!0).removeClass("ui-disabled"),$$.field("#btn_configure_group_editseparatoradd",!0).show())}),$$.field("#automation_group_modulechoose",!0).on("popupbeforeposition",function(){var e=$("#automation_group_moduleadd");e.empty(),e.append($$.GetModulesListViewItems($$.CurrentGroup)),e.selectmenu("refresh")}),$$.field("#automation_group_module_propdelete",!0).on("click",function(){null!=$$.CurrentModuleProperty&&($$.ModulePropertyDelete($$.CurrentModuleProperty.find("input[type=text]").first().val()),$$.CurrentModuleProperty.remove(),$$.CurrentModuleProperty=null)});var groupName=$$.field("#groupmodules_groupname",!0);groupName.change(function(){HG.Configure.Groups.RenameGroup("Control",$$.CurrentGroup,groupName.val(),function(res){$$.CurrentGroup=groupName.val(),$$.field("#configure_groupslist",!0).attr("selected-group-name",groupName.val()),$.mobile.loading("show"),HG.Configure.Modules.List(function(data){try{HG.WebApp.Data.Modules=eval(data)}catch(e){}HG.Automation.Programs.List(function(){HG.WebApp.GroupsList.LoadGroups(),$.mobile.loading("hide")})})})}),$$.field("#groupmodules_groupwall",!0).on("change",function(){""==$(this).val()?$$.field("#configure_group_wallpaper",!0).css("background-image",""):$$.field("#configure_group_wallpaper",!0).css("background-image","url(images/wallpapers/"+$(this).val()+")"),HG.Configure.Groups.WallpaperSet($$.CurrentGroup,$(this).val(),function(){})}),$$.field("#groupmodules_group_deletebtn",!0).on("click",function(){$.mobile.loading("show"),HG.Configure.Groups.WallpaperDelete($$.field("#groupmodules_groupwall",!0).val(),function(){ -var e=HG.Configure.Groups.GetGroupByName($$.CurrentGroup);e.Wallpaper="",$$.RefreshWallpaper(),$.mobile.loading("hide")})}),$$.field("#groupmodules_group_uploadbtn",!0).on("click",function(){$$.field("#groupmodules_group_uploadfile",!0).click()}),$$.wallpaper=$$.field("#configure_group_wallpaper",!0)}),page.on("pagebeforeshow",function(){$$.field("#page_configure_groupmodules_list",!0).find("ul").parent().animate({scrollTop:0}),$$.LoadGroupModules(),$.mobile.loading("show"),$$.RefreshWallpaper()}),$$.field("#groupmodules_group_uploadfile",!0).fileupload({url:"/api/HomeAutomation.HomeGenie/Config/Groups.WallpaperAdd",dropZone:$("[data-upload-dropzone=wallpaper]"),progressall:function(e,t){var o=parseInt(t.loaded/t.total*100,10);$.mobile.loading("show",{text:"Saving background... "+o+"%",textVisible:!0,theme:"a",html:""})},start:function(){$.mobile.loading("show",{text:"Saving background...",textVisible:!0,theme:"a",html:""})},fail:function(){$.mobile.loading("hide")},done:function(e,t){var o=t.result.ResponseValue;$$.field("#configure_group_wallpaper",!0).css("background-image","url(images/wallpapers/"+o+")"),HG.Configure.Groups.WallpaperSet($$.CurrentGroup,o,function(){var e=HG.Configure.Groups.GetGroupByName($$.CurrentGroup);e.Wallpaper=o,"page_control"==$.mobile.activePage.attr("id")?$$.field('div[data-ui-field="wallpaper"]',!0).css("background-image","url(images/wallpapers/"+o+")"):$$.RefreshWallpaper(),$.mobile.loading("hide")})}})},$$.RefreshWallpaper=function(){var e=HG.Configure.Groups.GetGroupByName($$.CurrentGroup);$$.wallpaper.css("background-image","url(images/wallpapers/"+e.Wallpaper+")"),$$.wallpaper.css("background-size","164px 92px"),$$.field("#groupmodules_groupwall",!0).find("option:gt(0)").remove(),HG.Configure.Groups.WallpaperList(function(t){$.each(t,function(t,o){var a=e.Wallpaper==o?" selected":"";$$.field("#groupmodules_groupwall",!0).append('")}),$$.field("#groupmodules_groupwall",!0).selectmenu("refresh"),$.mobile.loading("hide")})},$$.SetModuleIcon=function(e){var t=$(e).attr("src");$$.field("#module_icon",!0).attr("src",t),HG.WebApp.Utility.SetModulePropertyByName($$.EditModule,"Widget.DisplayIcon",t);var o=HG.WebApp.Utility.GetModulePropertyByName($$.EditModule,"Widget.DisplayIcon");o.NeedsUpdate="true",$$.field("#configure_module_iconslist",!0).hide(200)},$$.ModuleIconsToggle=function(){"program"!=$$.EditModule.DeviceType.toLowerCase()&&("none"!=$$.field("#configure_module_iconslist",!0).css("display")?$$.field("#configure_module_iconslist",!0).hide(200):$$.field("#configure_module_iconslist",!0).show(200))},$$.SortModules=function(){var e="";$$.field("#page_configure_groupmodules_list",!0).find("ul").children("li").each(function(){var t=$(this).attr("data-module-index");t>=0&&(e+=t+";")}),$.mobile.loading("show"),HG.Configure.Groups.SortModules("Control",$$.CurrentGroup,e,function(){HG.Configure.Groups.List("Control",function(){$$.LoadGroupModules(),$.mobile.loading("hide")})})},$$.ModulePropertyDelete=function(e){for(var t=$$.CurrentModule,o=0;o',a+='
    ',a+=" ",a+=" ",$$.field("#automation_group_module_params",!0).append(a)}e.trigger("create"),e.listview().listview("refresh"),e.find("input").focus(function(){var e=$(this).closest("div").parent().parent().parent();"#E6E6FA"!=e.css("background")&&($(this).attr("originalbackground",e.css("background")),e.css("background","#E6E6FA"),setTimeout("$('#automation_group_module_propdelete').removeClass('ui-disabled')",500),$$.CurrentModuleProperty=e)}),$$.field("#automation_group_module_params input",!0).blur(function(){$(this).closest("div").parent().parent().parent().css("background",$(this).attr("originalbackground")),setTimeout("$('#automation_group_module_propdelete').addClass('ui-disabled')",250)})},$$.GetModulesListViewItems=function(e){var t=HG.Configure.Groups.GetGroupModules(e),o="",a="";if(HG.WebApp.Data.Modules&&HG.WebApp.Data.Modules.length)for(m=0;m');var c=""!=i.Name?i.Name:""!=i.Description?i.Description:i.DeviceType;c+=" ("+i.Address+")",o+='"}}return o},$$.AddGroupModule=function(e,t,o,a){var r=!1,n=-1;for(i=0;i',t+=' '+e.Modules[o].Address+"",t+='",t+="";else{var i="module_icon_image_"+o,r="pages/control/widgets/homegenie/generic/images/unknown.png";t+='
  • ',t+="",t+='',t+='",t+='",t+="
    '+e.Modules[o].Name+"
    '+a+" "+e.Modules[o].Address+"
    ",t+="
    ",t+='",t+="
  • "}}$$.field("#page_configure_groupmodules_list",!0).find("ul").append(t),$$.field("#page_configure_groupmodules_list",!0).find("ul").listview().listview("refresh"),$$.field("#page_configure_groupmodules_list",!0).find("ul").sortable({handle:".handle",axis:"y",scrollSpeed:10}),$$.field("#page_configure_groupmodules_list",!0).find("ul").on("sortstop",function(){$$.SortModules()});for(var o=0;o0?$$.EditModule.WMWatts:"0"),$$.UpdateFeatures(),$$.field("#automation_group_module_edit",!0).popup("open",{transition:"pop",positionTo:"window"})},$$.ShowFeatures=function(e){$$.field("#module_programs_features",!0).empty();var t=HG.WebApp.Locales.GetProgramLocaleString(HG.WebApp.Data.Programs[e].Address,"Description",HG.WebApp.Data.Programs[e].Description);$$.field("#module_programs_featuredesc",!0).html(t);for(var o=null,a=0;a<$$.EditModule.Properties.length;a++){var i=$$.EditModule.Properties[a];if(i.ProgramIndex==e){i.Index=a;var r={parent:$$.field("#module_programs_features",!0),program:HG.WebApp.Data.Programs[e],module:$$.EditModule,parameter:i};HG.Ui.GenerateWidget("widgets/"+i.FieldType,r,function(e){e.onChange=function(t){$$.FeatureUpdate(e.context,t)},$$.field("#automation_group_module_edit",!0).popup("reposition",{positionTo:"window"}),null!=o&&clearTimeout(o),o=setTimeout(function(){$$.field("#automation_group_module_edit",!0).popup("reposition",{positionTo:"window"})},300)})}}},$$.MatchValues=function(e,t){var o=[e];e.indexOf(",")>0?o=e.split(","):e.indexOf("|")>0&&(o=e.split("|"));var a=[];$.each(o,function(e,t){return 0==t.trim().indexOf("!")?(o.splice(e,1),a.push(t.trim().substring(1))):""==t.trim()&&o.splice(e,1),!0});var i=0==o.length;return $.each(o,function(e,o){return o.trim()==t.trim()?(i=!0,!1):!0}),$.each(a,function(e,o){return o.trim()==t.trim()?(i=!1,!1):!0}),i},$$.UpdateFeatures=function(){$$.EditModule.Properties=Array(),$$.field("#module_options_features",!0).hide(),$$.field("#module_programs_featureset",!0).empty(),$$.field("#module_programs_features",!0).empty();for(var e="",t=-1,o=0;o0)for(var r=0;ra){var d=HG.WebApp.Data.Programs[o].Address,p=HG.WebApp.Data.Programs[o].Name;""==p&&(p=d),p=HG.WebApp.Locales.GetProgramLocaleString(d,"Title",p),e+='",a=o,0>t&&(t=o)}}}}}""!=e&&($$.field("#module_programs_featureset",!0).append(e),$$.field("#module_programs_featureset",!0).selectmenu("refresh",!0),$$.field("#module_options_features",!0).show(),-1!=t&&$$.ShowFeatures(t)),$$.field("#automation_group_module_edit",!0).popup("reposition",{positionTo:"window"})},$$.FeatureUpdate=function(e,t){var o=(e.program,e.module),a=e.parameter.Name;HG.WebApp.Utility.GetModulePropertyByName(o,a);HG.WebApp.Utility.SetModulePropertyByName(o,a,t)},$$.ShowModuleOptions=function(e,t){var o=HG.WebApp.Utility.GetModuleByDomainAddress(e,t);if(null!=o)switch(o.Domain){case"HomeAutomation.ZWave":HG.Ext.ZWave.NodeSetup.Show(o),$.mobile.changePage($$.field("#configurepage_OptionZWave",!0),{transition:"fade",changeHash:!0});break;default:alert("No options page available for this module.")}}},HG.Ui.CreatePage(HG.WebApp.GroupModules,"page_configure_groupmodules"),HG.WebApp.SystemSettings=HG.WebApp.SystemSettings||new function(){var e=this;e.PageId="page_configure_interfaces",e.Interfaces=e.Interfaces||{},e.InitializePage=function(){var t=$("#"+e.PageId),o=t.find("[data-ui-field=import-popup]"),a=t.find("[data-ui-field=interface_install]"),i=t.find("[data-ui-field=import-form]"),r=t.find("[data-ui-field=download-btn]"),n=t.find("[data-ui-field=download-url]"),s=t.find("[data-ui-field=upload-btn]"),l=t.find("[data-ui-field=upload-file]"),d=t.find("[data-ui-field=upload-frame]");t.on("pageinit",function(){o.popup()}),t.on("pagebeforeshow",function(){HG.Automation.Programs.List(function(){HG.Configure.Groups.List("Automation",function(){e.ListInterfaces()})})}),t.on("pageshow",function(){t.find("[data-locale-id=configure_program_bbaractions]").qtip({content:{text:HG.WebApp.Locales.GetLocaleString("configure_system_installtip_description","Go to the Package Manager to install additional features.")},show:{event:!1,ready:!0,delay:1e3},events:{hide:function(){$(this).qtip("destroy")}},hide:{event:!1,inactive:3e3},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{my:"bottom center",at:"top center"}})}),o.on("popupafteropen",function(){a.removeClass("ui-btn-active")}),a.on("click",function(){setTimeout(function(){o.popup("open")},500)}),r.on("click",function(){""==n.val()?(alert("Insert add-on package URL"),n.parent().stop().animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250).animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250)):(o.popup("close"),setTimeout(function(){$.mobile.loading("show",{text:"Downloading, please wait...",textVisible:!0,html:""}),$.get("/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Interface.Import/"+encodeURIComponent(n.val()),function(){$.mobile.loading("hide"),n.val("");var t=$.parseJSON(arguments[2].responseText);e.AddonInstall(t.ResponseValue)})},1e3))}),s.on("click",function(){""==l.val()?(alert("Select a file to import first"),l.parent().stop().animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250).animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250)):(o.popup("close"),$.mobile.loading("show",{text:"Uploading, please wait...",textVisible:!0,html:""}),i.submit())}),d.bind("load",function(){$.mobile.loading("hide"),l.val("");var t=d[0].contentWindow.document.body;if("undefined"!=typeof t&&""!=t&&(t.textContent||t.innerText))try{t=$.parseJSON(t.textContent||t.innerText),e.AddonInstall(t.ResponseValue)}catch(o){}})},e.AddonInstall=function(t){var o=/(https?:\/\/[^\s]+)/g;t=t.replace(o,'$1'),HG.WebApp.Utility.ConfirmPopup(HG.WebApp.Locales.GetLocaleString("systemsettings_addonsinstall_title","Install add-on?"),"
    "+t+"
    ",function(t){t&&($.mobile.loading("show",{text:"Installing, please wait...",textVisible:!0,html:""}),$.get("/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Interface.Install",function(){e.ListInterfaces(),$.mobile.loading("hide")}))})},e.ListInterfaces=function(){var t=$("#"+e.PageId),o=t.find("[data-ui-field=interface_list]");HG.Configure.Interfaces.ListConfig(function(t){o.empty(),o.append("

    Interfaces (MIG)

    "),$.each(t,function(t,a){var i=a.Domain,r=i.substring(i.lastIndexOf(".")+1),n=$('
    '),s=$('

    '+r+'

    ');n.append(s);var l=$("

    ");n.append(l),l.load("pages/configure/interfaces/configlet/"+r.toLowerCase()+".html",function(){var t=r;e.Interfaces[i].Localize&&(e.Interfaces[i].Localize(),t=HG.WebApp.Locales.GetLocaleString("title",r,e.Interfaces[i].Locale)),s.find("[data-ui-field=title]").html(t),s.attr("description",a.Description),null!=a.Description&&""!=a.Description.trim()&&s.qtip({content:{text:a.Description},show:{event:"mouseover",ready:!1,delay:500},hide:{event:"mouseout"},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{my:"bottom center",at:"top center"}}),l.trigger("create"),e.Interfaces[i].Initialize()}),o.append(n)}),o.append("

    Automation Program Plugins

    "),$.each(HG.WebApp.Data.AutomationGroups,function(e,t){var a=!0;$.each(HG.WebApp.Data.Programs,function(e,i){if(i.IsEnabled&&i.Group==t.Name){var r=HG.WebApp.Utility.GetModuleByDomainAddress("HomeAutomation.HomeGenie.Automation",i.Address);if(null!=r){for(var n=!1,s=0;s"+t.Name+""),a=!1);var l=HG.WebApp.Locales.GetProgramLocaleString(i.Address,"Title",i.Name),d="undefined"!=i.Description&&null!=i.Description?i.Description:"";d=HG.WebApp.Locales.GetProgramLocaleString(i.Address,"Description",d).replace(/\n/g,"
    ");var p=$('
    '),u=$('

    '+l+"

    ");p.append(u);var c='",p.append(c),p.find('[data-ui-field="options_button"]').on("click",function(){HG.WebApp.ProgramEdit._CurrentProgram.Domain=r.Domain,HG.WebApp.ProgramEdit._CurrentProgram.Address=r.Address,HG.WebApp.ProgramsList.UpdateOptionsPopup()}),o.append(p)}}}})}),o.trigger("create")})},e.GetInterface=function(e){var t=null,o=HG.WebApp.Data.Interfaces;if(o&&"undefined"!=o)for(i=0;iChecking for updates..."),$.mobile.loading("show"),HG.System.UpdateManager.UpdateCheck(function(){$.mobile.loading("hide"),e.LoadUpdateCheckSettings()})}),$("#configure_system_updatemanager_manualbutton").on("click",function(){""==$("#updatemanager_updatefile_uploadfile").val()?(alert("Select a .tgz release file to install first"),$("#updatemanager_updatefile_uploadfile").parent().stop().animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250).animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250)):($.mobile.loading("show"),$("#configure_system_updatemanager_manualbutton").addClass("ui-disabled"),$.mobile.loading("show",{text:"Processing release file, please wait...",textVisible:!0,theme:"a",html:""}),$("#configure_system_updateinstall_log").html(),$("#systemsettings_updateinstall_popup").popup("open"),$("#updatemanager_updatefile_form").submit())}),$("#updatemanager_updatefile_uploadframe").bind("load",function(){""!=$("#updatemanager_updatefile_uploadfile").val()&&($("#configure_system_updatemanager_manualbutton").removeClass("ui-disabled"),$.mobile.loading("hide"),$("#systemsettings_updateinstall_popup").popup("close"))}),$("#configure_system_updateinstall_button").bind("click",function(){$("#configure_system_updateinstall_button").addClass("ui-disabled"),$("#configure_system_updatemanager_info").html("Installing updates..."),$("#configure_system_updateinstall_status").html("Installing files..."),$.mobile.loading("show",{text:"Please wait...",textVisible:!0,html:""}),HG.System.UpdateManager.InstallUpdate(function(t){"OK"==t.ResponseValue?($("#configure_system_updateinstall_status").html("Update install complete."),setTimeout(function(){window.location.replace("/")},3e3)):"RESTART"==t.ResponseValue?$("#configure_system_updateinstall_status").html("Installing files... (HomeGenie service stopped)"):"ERROR"==t.ResponseValue&&($("#configure_system_updateinstall_status").html("Error during installation progress."),$.mobile.loading("hide"),e.LoadUpdateCheckSettings())})}),$("#configure_system_updatemanager_proceedbutton").bind("click",function(){$("#configure_system_updateinstall_button").addClass("ui-disabled"),$("#configure_system_updatemanager_info").html("Downloading files..."),$("#configure_system_updateinstall_log").empty(),HG.Ui.SwitchPopup("#systemsettings_updatewarning_popup","#systemsettings_updateinstall_popup",!0),$("#configure_system_updateinstall_status").html("Downloading files..."),$.mobile.loading("show",{text:"Please wait...",textVisible:!0,html:""}),HG.System.UpdateManager.DownloadUpdate(function(t){$.mobile.loading("hide"),e.LoadUpdateCheckSettings(),"OK"==t.ResponseValue?($("#configure_system_updateinstall_status").html("Update files ready."),$("#configure_system_updateinstall_button").removeClass("ui-disabled")):"RESTART"==t.ResponseValue?($("#configure_system_updateinstall_status").html("Update files ready. HomeGenie will be restarted after updating."),$("#configure_system_updateinstall_button").removeClass("ui-disabled")):"ERROR"==t.ResponseValue&&($("#configure_system_updateinstall_status").html("Error while downloading update files."),$("#configure_system_updateinstall_button").addClass("ui-disabled"))})}),$("#securitysettings_password_change").bind("click",function(){var t=$("#securitysettings_user_password").val();$.mobile.loading("show"),HG.System.SetPassword(t,function(){$.mobile.loading("hide"),setTimeout(function(){e.LoadHttpSettings()},1e3)})}),$("#securitysettings_password_clear").bind("click",function(){$.mobile.loading("show"),HG.System.ClearPassword(function(){$.mobile.loading("hide"),e.LoadHttpSettings()})}),$("#btn_configuresystem_downloadtday").bind("click",function(){window.open("/api/HomeAutomation.HomeGenie/Config/System.Configure/SystemLogging.DownloadCsv/0")}),$("#btn_configuresystem_downloadyday").bind("click",function(){window.open("/api/HomeAutomation.HomeGenie/Config/System.Configure/SystemLogging.DownloadCsv/1")}),$("#maintenance_configuration_restartproceedbutton").bind("click",function(){$("#maintenance_configuration_restartbutton").addClass("ui-disabled"),$.mobile.loading("show",{text:"Restarting service, please wait...",textVisible:!0,theme:"a",html:""}),HG.Configure.System.ServiceCall("Service.Restart",function(){})}),$("#maintenance_configuration_backupbutton").bind("click",function(){}),$("#maintenance_configuration_restorebutton").bind("click",function(){""==$("#restore_configuration_uploadfile").val()?(alert("Select a file to restore first"),$("#restore_configuration_uploadfile").parent().stop().animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250).animate({borderColor:"#FF5050"},250).animate({ -borderColor:"#FFFFFF"},250)):($("#systemsettings_backuprestores1cancelbutton").removeClass("ui-disabled"),$("#systemsettings_backuprestores1confirmbutton").removeClass("ui-disabled"),$.mobile.loading("show",{text:"Restoring backup, please wait...",textVisible:!0,theme:"a",html:""}),$("#restore_configuration_form").submit())}),$("#maintenance_configuration_factoryresetbutton").bind("click",function(){$.mobile.loading("show",{text:"Resetting to factory defaults, please wait...",textVisible:!0,theme:"a",html:""}),HG.Configure.System.ServiceCall("System.ConfigurationReset",function(){setTimeout(function(){$.mobile.loading("hide"),window.location.replace("/")},3e3)})}),$("#systemsettings_backuprestores1selectallbtn").bind("click",function(){""!=e.RestoreProgramList?(e.RestoreProgramList="",$("#systemsettings_backuprestores1plist div").attr("data-checked","false").find("i").addClass("fa-square-o").removeClass("fa-check-square")):(e.RestoreProgramList="",$("#systemsettings_backuprestores1plist div").each(function(){$(this).attr("data-checked","true").find("i").removeClass("fa-square-o").addClass("fa-check-square"),e.RestoreProgramList+=","+$(this).attr("data-program")+","}))}),$("#maintenance_configuration_backupbutton").bind("click",function(){window.open(location.protocol+"../../api/HomeAutomation.HomeGenie/Config/System.Configure/System.ConfigurationBackup")}),$("#restore_configuration_uploadframe").bind("load",function(){""!=$("#restore_configuration_uploadfile").val()&&(HG.Configure.System.ServiceCall("System.ConfigurationRestoreS1",function(t){$.mobile.loading("hide"),$("#systemsettings_backuprestores1plist").empty();var o=t;if(0==o.length)$("#systemsettings_backuprestores1plist").append("

    No user's program found in this backup.

    "),$("#systemsettings_backuprestores1selectallbtn").addClass("ui-disabled");else{for(var a=0;a '+o[a].Address+" "+o[a].Name+"");i.on("click",function(){"true"==$(this).attr("data-checked")?($(this).find("i").addClass("fa-square-o"),$(this).find("i").removeClass("fa-check-square"),$(this).attr("data-checked","false"),e.RestoreProgramList=e.RestoreProgramList.replace(","+$(this).attr("data-program")+",","")):($(this).find("i").removeClass("fa-square-o"),$(this).find("i").addClass("fa-check-square"),$(this).attr("data-checked","true"),e.RestoreProgramList+=","+$(this).attr("data-program")+",")}),$("#systemsettings_backuprestores1plist").append(i)}$("#systemsettings_backuprestores1selectallbtn").removeClass("ui-disabled")}$("#systemsettings_backuprestores1plist").scrollTop(0),$("#systemsettings_backuprestores1").find("[data-ui-field=restore_log]").empty(),$("#systemsettings_backuprestores1").find("[data-ui-field=restore_log]").hide(),$("#systemsettings_backuprestores1").find("[data-ui-field=user-programs]").show(),$("#systemsettings_backuprestores1").popup("open")}),$("#systemsettings_backuprestores1confirmbutton").bind("click",function(){$("#systemsettings_backuprestores1cancelbutton").addClass("ui-disabled"),$("#systemsettings_backuprestores1confirmbutton").addClass("ui-disabled"),$("#systemsettings_backuprestores1").find("[data-ui-field=restore_log]").show(),$("#systemsettings_backuprestores1").find("[data-ui-field=user-programs]").hide(),$.mobile.loading("show",{text:"Please be patient, this may take some time...",textVisible:!0,theme:"a",html:""}),HG.Configure.System.ServiceCall("System.ConfigurationRestoreS2/"+e.RestoreProgramList,function(){$.mobile.loading("hide"),window.location.replace("/")})}))}),$("#systemsettings_modulesdelete").on("popupbeforeposition",function(){e.RefreshModulesList()}),$("#configure_interfaces_modules_list").on("click","li",function(){$.mobile.loading("show");var t=$(this).attr("data-context-domain"),o=$(this).attr("data-context-address");HG.Configure.Modules.Delete(t,o,function(){for(var a=-1,i=0;i500&&(a.parent().parent().css("width",o),a.parent().parent().css("max-width",o)),a.css("height",e/2),a.css("max-height",e/2);var i=t.find("[data-ui-field=browser_text]");i.css("height",e/2),i.css("max-height",e/2)}).on("popupafteropen",function(){e.BrowseRoot()}),t.find("[data-ui-field=parent_folder]").on("click",function(){var t=e.BrowseRepository,o=e._BrowserHistory;o.length>1&&(o.pop(),t(o.pop()))}),t.find("[data-ui-field=install_package]").on("click",function(){t.find("[data-ui-field=install_text]").empty(),t.find("[data-ui-field=install_package]").addClass("ui-disabled"),$.mobile.loading("show"),$.get("/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Package.Install/"+encodeURIComponent(e._BrowserPackage),function(){t.find("[data-ui-field=install_package]").removeClass("ui-disabled"),$.mobile.loading("hide")})}),t.find("[data-ui-field=repository_browse]").on("click",function(){e.BrowseRoot()})})},e._BrowserHistory=[],e._BrowserPackage="",e.BrowseRoot=function(){e._BrowserHistory=[];var t=$("#"+e.PageId);e.BrowseRepository({url:t.find("[data-ui-field=repository_url]").val()+"/packages",name:""})},e.BrowseRepository=function(t){var o=$("#"+e.PageId),a=o.find("[data-ui-field=repository_files]"),i=o.find("[data-ui-field=description_text]"),r=o.find("[data-ui-field=package_info]"),n=o.find("[id=systemsettings_browserepo]"),s=e.BrowseRepository,l=e._BrowserHistory;l.push(t),l.length>1?o.find("[data-ui-field=parent_folder]").show():o.find("[data-ui-field=parent_folder]").hide(),o.find("[data-ui-field=install_package]").hide(),o.find("[data-ui-field=install_text]").empty(),i.html(""),r.hide();var d="";$.each(l,function(e,t){d+=""+t.name+" / "}),o.find("[data-ui-field=browser_path]").html(d),a.empty(),$.mobile.loading("show"),$.get(t.url,function(t){$.each(t,function(t,n){if("dir"==n.type){var l=$('
  • '+n.name+"
  • ");a.append(l),l.on("click",function(){s({url:n.url,name:n.name})})}else"package.json"==n.name.toLowerCase()?(e._BrowserPackage=n.download_url.substring(0,n.download_url.lastIndexOf("/")),$.get(n.download_url,function(t){t=$.parseJSON(t);var i=""+t.title+"";i+="
    Version: "+t.version,i+="
    Author: "+t.author,i+="
    Files: ",i+=t.programs.length+" automation programs, ",i+=t.widgets.length+" ui widgets, ",i+=t.interfaces.length+" mig interfaces",i+="
    Published: "+t.published,"undefined"!=typeof t.sourcecode&&""!=t.sourcecode&&(i+='
    Source Code'),"undefined"!=typeof t.homepage&&""!=t.homepage&&(i+='
    Forum Thread'),r.html(i+"
    "),r.show(),o.find("[data-ui-field=browser_text]").scrollTop(0),$.get("/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Package.Get/"+encodeURIComponent(e._BrowserPackage),function(e){"undefined"!=typeof e.install_date&&r.append("
    Installed: "+e.install_date)}),$.each(t.programs,function(e,t){var o=$('
  • '+t.description+" ("+t.file+")
  • ");a.append(o)}),$.each(t.widgets,function(e,t){var o=$('
  • '+t.description+" ("+t.file+")
  • ");a.append(o)}),$.each(t.interfaces,function(e,t){var o=$('
  • '+t.description+" ("+t.file+")
  • ");a.append(o)})}),o.find("[data-ui-field=install_package]").show()):n.name.toLowerCase().endsWith(".md")?$.get(n.download_url,function(e){i.html(marked(e)),o.find("[data-ui-field=browser_text]").scrollTop(0)}):"file"==n.type}),a.listview().listview("refresh"),setTimeout(function(){n.popup().popup("reposition",{positionTo:"window"}),$.mobile.loading("hide")},300)})},e.LoadSettings=function(){$.mobile.loading("show"),e.LoadUpdateCheckSettings(),HG.System.LoggingIsEnabled(function(e){$("#configure_system_flip_logging").val(e).slider("refresh"),$.mobile.loading("hide")}),e.LoadHttpSettings(),e.LoadStatisticsSettings(),$("#configure_system_flip_eventshistory").val(HG.WebApp.Store.get("UI.EventsHistory")?"1":"0").slider("refresh");var t=HG.WebApp.Store.get("UI.TemperatureUnit");$("#tempunit-celsius").prop("checked",!1),$("#tempunit-fahrenheit").prop("checked",!1),"F"!=t?$("#tempunit-celsius").prop("checked",!0):$("#tempunit-fahrenheit").prop("checked",!0),$("input[name='tempunit-choice']").checkboxradio("refresh");var o=HG.WebApp.Store.get("UI.DateFormat");$("#dateformat-dmy").prop("checked",!1),$("#dateformat-mdy").prop("checked",!1),"MDY12"!=o?$("#dateformat-dmy").prop("checked",!0):$("#dateformat-mdy").prop("checked",!0),$("input[name='dateformat-choice']").checkboxradio("refresh")},e.LoadUpdateCheckSettings=function(){$.mobile.loading("show"),$("#configure_system_updateinstall_button").addClass("ui-disabled"),HG.System.UpdateManager.GetUpdateList(function(e){if(0==e.length)$("#configure_system_updatemanager_info").html(HG.WebApp.Locales.GetLocaleString("configure_system_updatemanager_no_updates")),$("#configure_system_updatemanager_detailsscroll").hide(),$("#configure_system_updatemanager_installbutton").hide();else{$("#configure_system_updatemanager_info").html(HG.WebApp.Locales.GetLocaleString("configure_system_updatemanager_updates_available"));for(var t="
    ",o=0;o"+a.Name+" "+a.Version+"\n",t+="   "+a.ReleaseNote+"\n"}t+="
    ",$("#configure_system_updatemanager_details").html(t),$("#configure_system_updatemanager_detailsscroll").show(),$("#configure_system_updatemanager_installbutton").show()}$.mobile.loading("hide")})},e.LoadHttpSettings=function(){$.mobile.loading("show"),HG.System.HasPassword(function(e){var t="1"==e.ResponseValue?"on":"off";$("#securitysettings_password_image").attr("src","images/protection-"+t+".png"),HG.System.WebCacheIsEnabled(function(e){$("#configure_system_flip_httpcache").val("true"==e?"1":"0").slider("refresh"),$.mobile.loading("hide")}),HG.Configure.System.ServiceCall("HttpService.GetPort",function(e){$("#http_service_port").val(e),$("#systemsettings_httpport_text").html(e),$.mobile.loading("hide")}),HG.Configure.System.ServiceCall("HttpService.GetHostHeader",function(e){$("#http_host_header").val(e),$("#systemsettings_hostheader_text").html(e),$.mobile.loading("hide")})})},e.LoadStatisticsSettings=function(){$.mobile.loading("show"),HG.Configure.System.ServiceCall("Statistics.GetStatisticsDatabaseMaximumSize",function(e){$("#systemsettings_databasemaxsizechange_size").val(e),$("#systemsettings_databasemaxsize_text").html(e),$.mobile.loading("hide")})},e.RefreshModulesList=function(){$("#configure_interfaces_modules_list").empty();for(var e="",t=0;t",{"data-role":"list-divider"}).append(o.Domain)),e=o.Domain),$("#configure_interfaces_modules_list").append($("
  • ",{"data-icon":"minus","data-context-domain":o.Domain,"data-context-address":o.Address}).append($("",{text:o.Address+" "+o.Name}))))}e="";for(var t=0;t",{"data-role":"list-divider"}).append(o.Domain)),e=o.Domain),$("#configure_interfaces_modules_list").append($("
  • ",{"data-icon":"minus","data-context-domain":o.Domain,"data-context-address":o.Address}).append($("",{text:o.Address+" "+o.Name}))))}$("#configure_interfaces_modules_list").listview("refresh")}},HG.WebApp.AutomationGroupsList=HG.WebApp.AutomationGroupsList||new function(){var e=this;e.PageId="page_configure_automationgroups",e._CurrentGroup="",e.InitializePage=function(){var t=$("#"+e.PageId),o=t.find("[data-ui-field=widgeteditor-btn]");e.groupList=$("#configure_automationgroupslist"),t.on("pageinit",function(){t.find("[id=automationgroup_add]").on("popupbeforeposition",function(){t.find("[id=automationgroup_new_name]").val("")}),t.find("[id=automationgroup_new_button]").bind("click",function(){e.GroupsAdd($("#automationgroup_new_name").val())}),o.bind("click",function(){$.mobile.pageContainer.pagecontainer("change","#"+HG.WebApp.WidgetsList.PageId,{transition:"slide"})}),$.mobile.loading("show"),HG.Configure.Groups.List("Automation",function(){e.GetGroupsListViewItems(),$.mobile.loading("hide")})}),t.on("pagebeforeshow",function(){HG.Automation.Programs.List(function(){e.LoadGroups()})})},e.LoadGroups=function(){$.mobile.loading("show"),HG.Configure.Groups.List("Automation",function(){e.GetGroupsListViewItems(),$.mobile.loading("hide")})},e.GetGroupsListViewItems=function(){e.groupList.hasClass("ui-sortable")&&(e.groupList.sortable("destroy"),e.groupList.off("sortstop")),e.groupList.empty();for(var t=HG.WebApp.SystemSettings.GetInterface("HomeAutomation.ZWave"),o=HG.WebApp.SystemSettings.GetInterface("HomeAutomation.Insteon"),a=HG.WebApp.SystemSettings.GetInterface("HomeAutomation.X10"),i=HG.WebApp.SystemSettings.GetInterface("HomeAutomation.W800RF"),r=0,n=' style="display:none"',s='
  • '+HG.WebApp.Locales.GetLocaleString("configure_grouplist")+"
  • ";r',s+=''+l+"",s+=''+u+"",s+='
    ',s+=""}for(u=0,p=0;p0&&(s+='
  • Ungrouped'+u+"
  • "),e.groupList.append(s),e.groupList.listview().listview("refresh"),e.groupList.sortable({handle:".handle",axis:"y",scrollSpeed:10}).sortable("refresh"),e.groupList.on("sortstop",function(){e.SortGroups()}),e.groupList.find("li").on("click",function(){e._CurrentGroup=$(this).attr("data-group-name"),e.groupList.attr("selected-group-name",$(this).attr("data-group-name")),e.groupList.attr("selected-group-index",$(this).attr("data-group-index"))})},e.GetGroupModules=function(e){for(var t={Index:0,Name:e,Modules:Array()},o=0;o=0&&(t+=e+";")}),HG.Configure.Groups.Sort("Automation",t,function(){e.LoadGroups()})},e.SaveGroups=function(){$.mobile.loading("show"),$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.Save/Automation/",data:JSON.stringify(HG.WebApp.Data.AutomationGroups),success:function(){$("#control_automationgroupslist").empty(),$.mobile.loading("hide")},error:function(){$.mobile.loading("hide")}})}};var editor1=null,editor2=null,editor3=null;HG.WebApp.ProgramsList=HG.WebApp.ProgramsList||new function(){var $$=this;$$.PageId="page_automation_programs",$$.InitializePage=function(){var e=$("#"+$$.PageId);e.on("pageinit",function(){$("#automation_program_add").on("popupbeforeposition",function(){$("#program_new_name").val("")}),$("#btn_automationprograms_group_delete").bind("click",function(){HG.Ui.SwitchPopup("#listprograms_actionmenu","#automationprograms_group_delete")}),$("#btn_automation_program_import").bind("click",function(){HG.Ui.SwitchPopup("#listprograms_actionmenu","#automation_program_import")}),$("#btn_automation_program_add").bind("click",function(){HG.Ui.SwitchPopup("#listprograms_actionmenu","#automation_program_add")}),$("#btn_automation_program_refresh").bind("click",function(){$("#listprograms_actionmenu").popup("close"),$$.LoadPrograms(null)}),$("#automationprograms_delete_button").bind("click",function(){$$.DeleteGroup(HG.WebApp.AutomationGroupsList._CurrentGroup)}),$("#program_new_button").bind("click",function(){$$.AddProgram($("#program_new_name").val())}),$("#program_switchtypecancel_button").bind("click",function(){$("#automation_programtype").val(HG.WebApp.ProgramEdit._CurrentProgram.Type),$("#automation_programtype").selectmenu("refresh")}),$("#program_switchtype_button").bind("click",function(){HG.WebApp.ProgramEdit._CurrentProgram.Type=$("#automation_programtype").select().val(),$$.SetProgramType()}),$("#automationprograms_program_edit").bind("click",function(){$$.EditProgram()}),$("#automationprograms_program_delete_button").bind("click",function(){$$.DeleteProgram(HG.WebApp.ProgramEdit._CurrentProgram.Address)}),$("#program_import_button").bind("click",function(){""==$("#program_import_uploadfile").val()?(alert("Select a file to import first"),$("#program_import_uploadfile").parent().stop().animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250).animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250)):($("#automation_program_import").popup("close"),$.mobile.loading("show",{text:"Importing, please wait...",textVisible:!0,html:""}),$("#program_import_form").attr("action","/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Import/"+HG.WebApp.AutomationGroupsList._CurrentGroup),$("#program_import_form").submit())}),$("#program_import_uploadframe").bind("load",function(){$("#program_import_uploadfile").val(""),$.mobile.loading("hide"),$$.LoadPrograms(null)})}),e.on("pagebeforeshow",function(){$$.LoadPrograms()})},$$._CurrentOptionsTab=0,$$.SetOptionsTab=function(e){$$._CurrentOptionsTab=e,$("#automationprograms_program_options_tab0 a").removeClass("ui-btn-active"),$("#automationprograms_program_options_tab0 a").trigger("create"),$("#automationprograms_program_options_tab1 a").removeClass("ui-btn-active"),$("#automationprograms_program_options_tab1 a").trigger("create"),0==e?($$.RefreshProgramOptions(),$("#automationprograms_program_details").hide(),$("#automationprograms_program_parameters").show()):($$.RefreshProgramDetails(),$("#automationprograms_program_parameters").hide(),$("#automationprograms_program_details").show()),setTimeout(function(){$("#automationprograms_program_options_tab"+e+" a").addClass("ui-btn-active"),$("#automationprograms_program_options_tab"+e+" a").trigger("create"),setTimeout(function(){$("#automationprograms_program_options").popup("reposition",{positionTo:"window"})},200)},200)},$$.RefreshProgramDetails=function(){var e=$("#automationprograms_program_details");e.empty(),e.trigger("create");var t=HG.WebApp.Utility.GetProgramByAddress(HG.WebApp.ProgramEdit._CurrentProgram.Address);if(null!=t){for(var o="",a=t.Features,i=0;i

    '+a[i].Property+" : ",o+=""+HG.WebApp.Locales.GetProgramLocaleString(t.Address,a[i].Property,a[i].Description)+"
    ";var r=a[i].ForDomains;""==r&&(r="Any");var n=a[i].ForTypes;""==n&&(n="Any"),o+='Applies to:     Domain'+r+"     Type"+n+"

    "}""!=o&&(o='
    • '+HG.WebApp.Locales.GetLocaleString("configure_program_details_implemfeatures")+"
    • "+o+"

    ",e.append(o))}var s=HG.WebApp.Utility.GetModuleByDomainAddress(HG.WebApp.ProgramEdit._CurrentProgram.Domain,HG.WebApp.ProgramEdit._CurrentProgram.Address);if(null!=s){o="";for(var l=0;l=0&&(d="password");var u=s.Properties[l].UpdateTime;u=u.replace(" ","T");var c=new Date(u);o+='
  • '+s.Properties[l].Name.substring(17)+" = ",o+='"'+("password"==d?"*****":s.Properties[l].Value)+'"
    ',o+=''+c+"

  • "}""!=o&&(o='
    • '+HG.WebApp.Locales.GetLocaleString("configure_program_details_configoptions")+"
    • "+o+"

    ",e.append(o))}if(null!=s){for(var o="",l=0;l = ",o+='"'+s.Properties[l].Value+'"
    ',o+=''+c+"

    "}""!=o&&(o='
    • '+HG.WebApp.Locales.GetLocaleString("configure_program_details_moduleparams")+"
    • "+o+"

    ",e.append(o));HG.WebApp.Utility.GetModulePropertyByName(s,"Widget.DisplayModule")}var o="";if(HG.WebApp.Data.Modules&&HG.WebApp.Data.Modules.length)for(m=0;m

    '+g.Domain+" "+g.Address+"",o+="
    ",o+=' ',o+="Type"+g.DeviceType+"    ",""!=g.Name&&(o+="Name"+g.Name+"    "),o+="

    ")}""!=o&&(o='
    • Virtual Modules
    • '+o+"

    ",e.append(o)),e.trigger("create")},$$.RefreshProgramOptions=function(){var e=$("#automationprograms_program_parameters");e.empty(),e.trigger("create");var t=HG.WebApp.Utility.GetProgramByAddress(HG.WebApp.ProgramEdit._CurrentProgram.Address);if(null!=t){$("#automationprograms_program_title").html(HG.WebApp.Locales.GetProgramLocaleString(t.Address,"Title",t.Name));var o="undefined"!=t.Description&&null!=t.Description?t.Description:"";o=HG.WebApp.Locales.GetProgramLocaleString(t.Address,"Description",o),$("#automationprograms_program_description").html(o.replace(/\n/g,"
    "))}var a=HG.WebApp.Utility.GetModuleByDomainAddress(HG.WebApp.ProgramEdit._CurrentProgram.Domain,HG.WebApp.ProgramEdit._CurrentProgram.Address);if(null!=a){for(var i=Array(),r=0;re?-1:e>t?1:0});for(var r=0;r=0&&(n="password");var s=$('

    '+HG.WebApp.Locales.GetProgramLocaleString(t.Address,i[r].Name,o)+"

    "),l=$('');l.val(i[r].Value),s.append(l),e.append(s)}}e.trigger("create")},$$.UpdateProgramParameter=function(e){for(var t=e.attr("data-parameter-name"),o=HG.WebApp.Utility.GetModuleByDomainAddress(HG.WebApp.ProgramEdit._CurrentProgram.Domain,HG.WebApp.ProgramEdit._CurrentProgram.Address),a=0;a'+e+"
    "+HG.WebApp.AutomationGroupsList._CurrentGroup),$("#configure_programslist").empty(),$("#configure_programslist").append('
  • '+HG.WebApp.Locales.GetLocaleString("configure_programslist_listtitle")+"
  • "),i=0;i';r+='';var n=$$.GetProgramStatusColor(t),s="";if(null!=t.TriggerTime){var l=moment(t.TriggerTime);s=l.format("L LT")}var d=null!=t.Description?t.Description:"";d=HG.WebApp.Locales.GetProgramLocaleString(t.Address,"Description",d),r+='

    '+t.Type+"    PID: "+t.Address+'
    '+s+"

    ",r+='

    '+a+"

    ",r+='

    '+d+"  

    ",r+="
    ",r+=""+(t.IsEnabled?HG.WebApp.Locales.GetLocaleString("configure_programslist_tap_disable"):HG.WebApp.Locales.GetLocaleString("configure_programslist_tap_enable"))+"",r+="",$("#configure_programslist").append(r)}}$("#configure_programslist").listview(),$("#configure_programslist").listview("refresh"),$("#configure_programslist li a").bind("click",function(){HG.WebApp.ProgramEdit._CurrentProgram.Domain=$(this).attr("data-program-domain"),HG.WebApp.ProgramEdit._CurrentProgram.Address=$(this).attr("data-program-address"),$$.UpdateOptionsPopup()})},$$.UpdateOptionsPopup=function(){HG.WebApp.ProgramEdit._CurrentProgram.Domain&&HG.WebApp.ProgramEdit._CurrentProgram.Address&&($.mobile.activePage.attr("id")!=$$.PageId?($("#automationprograms_program_edit").hide(),$("#automationprograms_program_btn_delete").hide()):($("#automationprograms_program_edit").show(),$("#automationprograms_program_btn_delete").show()),$.mobile.loading("show",{text:HG.WebApp.Locales.GetLocaleString("update_options_popup_loading"),textVisible:!0,theme:"a",html:""}),HG.Automation.Programs.List(function(){HG.Configure.Modules.List(function(data){try{HG.WebApp.Data.Modules=eval(data)}catch(e){}$$.RefreshProgramOptions(),$$.RefreshProgramDetails();var hasdetails=!0;""==$("#automationprograms_program_details").text().trim()?($("#automationprograms_program_options_tab1").css("visibility","hidden"),hasdetails=!1):$("#automationprograms_program_options_tab1").css("visibility",""),""==$("#automationprograms_program_parameters").text().trim()?($("#automationprograms_program_options_tab0").css("visibility","hidden"),hasdetails?$$.SetOptionsTab(1):($("#automationprograms_program_parameters").hide(),$("#automationprograms_program_details").hide())):($("#automationprograms_program_options_tab0").css("visibility",""),$$.SetOptionsTab(0)),$("#automationprograms_program_details").scrollTop(0),$("#automationprograms_program_parameters").scrollTop(0),$("#automationprograms_program_options").popup("open",{transition:"slidedown"}),$.mobile.loading("hide")})}))},$$.GetProgramByAddress=function(e){var t=null;for(i=0;i(select program group)');for(var e=0;e'+HG.WebApp.Data.AutomationGroups[e].Name+"");for($("#automation_programgroup").trigger("create"),e=0;e'+i+"")}}$("#automation_conditiontarget").listview("refresh")}),$("#automation_condition_value_domain").on("popupbeforeposition",function(){$("#automation_conditionvalue_domain").empty();for(var e=Array(),t=0;t'+i+"")}}$("#automation_conditionvalue_domain").listview("refresh")}),$("#automation_command_domain_popup").on("popupbeforeposition",function(){$("#automation_commandtarget li:gt(1)").remove();for(var e=Array(),t=0;t'+i+"")}}$("#automation_commandtarget").listview("refresh")}),$("#automation_program_listfiles").on("popupbeforeposition",function(){$$.SketchFileList()}),$("#automation_program_sketchfiles_add").bind("click",function(){$("#programfile_new_name").val(""),HG.Ui.SwitchPopup("#automation_program_listfiles","#automation_program_fileadd",!0)}),$("#programfile_new_button").bind("click",function(){$("#automation_program_fileadd").popup("close");var e=$("#programfile_new_name").val();$.mobile.loading("show",{text:"Adding file "+e,textVisible:!0,theme:"a",html:""}),HG.Automation.Programs.ArduinoFileAdd($$._CurrentProgram.Address,e,function(t){"EXISTS"==t?($.mobile.loading("show",{text:'A file named "'+e+'" already exists',textVisible:!0,theme:"a",html:""}),setTimeout(function(){$.mobile.loading("hide")},3e3)):"INVALID_NAME"==t?($.mobile.loading("show",{text:'Invalid file name "'+e+'". Must ends with .c, .cpp, .h or have no extension.',textVisible:!0,theme:"a",html:""}),setTimeout(function(){$.mobile.loading("hide")},3e3)):($.mobile.loading("hide"),$$.SketchFileOpen(e))})}),$("#automation_program_sketchfiles_edit").bind("click",function(){$("#automation_program_listfiles").popup("close");var e=$("#automation_program_sketchfiles li a.ui-btn-active").attr("data-context-value");$$.SketchFileOpen(e)}),$("#automation_program_sketchfiles_delete").bind("click",function(){var e=$("#automation_program_sketchfiles li a.ui-btn-active").attr("data-context-value");$.mobile.loading("show",{text:"Deleting file "+e,textVisible:!0,theme:"a",html:""}),HG.Automation.Programs.ArduinoFileDelete($$._CurrentProgram.Address,e,function(){$$.SketchFileList(),e==$$._CurrentSketchFile&&$$.SketchFileOpen("main"),$.mobile.loading("hide")})})})},$$.CheckIsClean=function(e){$$.IsClean()?e():($$._SavePromptCallback=function(){e()},$("#automation_program_notsaved").popup("open"))},$$.IsClean=function(){var e=$$._CurrentProgram.Group==$("#automation_programgroup").val();return e=e&&$$._CurrentProgram.Name==$("#automation_programname").val(),e=e&&$$._CurrentProgram.Description==$("#automation_programdescription").val(),e=e&&$$._CurrentProgram.ConditionType==$("#automation_conditiontype").val(),e=e&&editor1.isClean()&&editor2.isClean()&&editor3.isClean()},$$.GetDomainControllableModules=function(e,t){var o=Array();if(HG.WebApp.Data.Modules&&HG.WebApp.Data.Modules.length)for(m=0;m0||t)&&o.push(HG.WebApp.Data.Modules[m]);return o},$$.GetModuleComparableProperties=function(e){for(var t=Array(),o=0;o ';$("#page_automation_program_title").html('PROGRAM EDITOR ('+e+")
    "+a+$$._CurrentProgram.Address+" "+$$._CurrentProgram.Name)},$$.GetProgramStatusColor=function(e){var t="black",o="",a="undefined"!=typeof e.Type&&"wizard"!=e.Type.toLowerCase()&&"undefined"!=typeof e.ScriptErrors&&""!=e.ScriptErrors.trim()&&"[]"!=e.ScriptErrors.trim(),i=HG.WebApp.Utility.GetModuleByDomainAddress("HomeAutomation.HomeGenie.Automation",e.Address);if(null!=i){var r=HG.WebApp.Utility.GetModulePropertyByName(i,"Program.Status");null!=r&&(o=r.Value)}return"Running"==o?t="green":"Background"==o?t="blue":e.IsEnabled?t=a?"red":"yellow":a&&(t="brown"),t},$$.RefreshProgramOptions=function(){$("[id=editprograms_actionmenu_run]").each(function(){$(this).show()}),$("[id=editprograms_actionmenu_break]").each(function(){$(this).hide()}),$("[id=editprograms_actionmenu_run]").each(function(){$(this).addClass("ui-disabled")}),$("[id=editprograms_actionmenu_compile]").each(function(){$(this).addClass("ui-disabled")}),setTimeout(function(){HG.Automation.Programs.List(function(){$("[id=editprograms_actionmenu_compile]").each(function(){$(this).removeClass("ui-disabled")}),$("[id=editprograms_actionmenu_run]").each(function(){$(this).removeClass("ui-disabled")}),$("[id=editprograms_actionmenu_run]").each(function(){$(this).hide()});var e=HG.WebApp.Utility.GetProgramByAddress($$._CurrentProgram.Address);null!=e&&(e.IsRunning?$("[id=editprograms_actionmenu_break]").each(function(){$(this).show()}):$("[id=editprograms_actionmenu_run]").each(function(){$(this).show()}),""!=e.ScriptErrors.trim()&&"[]"!=e.ScriptErrors.trim()?$$._CurrentProgram.ScriptErrors=e.ScriptErrors:$$._CurrentProgram.ScriptErrors="",$$.RefreshProgramEditorTitle())})},500)},$$.ProgramEnable=function(e,t){var o=t?"Enable":"Disable",a=t?"Enabling":"Disabling";$.mobile.loading("show",{text:a+" program",textVisible:!0,theme:"a",html:""}),$("#control_groupslist").empty(),$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs."+o+"/"+e+"/",type:"GET",success:function(){$.mobile.loading("hide")},error:function(){$.mobile.loading("hide")}})},$$.UpdateProgram=function(programblock,compile,callback){$("#configure_program_editorcompilecode").addClass("ui-disabled"),$("#configure_program_editorcompilecode2").addClass("ui-disabled"),$.mobile.loading("show",{text:HG.WebApp.Locales.GetLocaleString("configure_editprogram_saving"),textVisible:!0,theme:"a",html:""}),$("#control_groupslist").empty(),$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs."+(compile?"Compile":"Update")+"/",dataType:"text",data:JSON.stringify(programblock),success:function(response){$.mobile.loading("hide"),editor1.markClean(),editor2.markClean(),$("#configure_program_editorcompilecode").removeClass("ui-disabled"),$("#configure_program_editorcompilecode2").removeClass("ui-disabled"),""!=response.trim()&&"[]"!=response.trim()?($.mobile.loading("show",{text:HG.WebApp.Locales.GetLocaleString("configure_editprogram_error_updating"),textVisible:!0}),$$.ShowProgramErrors(response)):($.mobile.loading("show",{text:HG.WebApp.Locales.GetLocaleString("configure_editprogram_saving_succeed"),textVisible:!0}),$$.RefreshProgramEditorTitle()),setTimeout(function(){$.mobile.loading("hide"),null!=callback&&"undefined"!=typeof callback&&callback()},2e3),setTimeout(function(){HG.Configure.Modules.List(function(data){try{HG.WebApp.Data.Modules=eval(data)}catch(e){}})},3e3)},error:function(){$.mobile.loading("hide"),$("#configure_program_editorcompilecode").removeClass("ui-disabled"),$("#configure_program_editorcompilecode2").removeClass("ui-disabled"),$.mobile.loading("show",{text:"An error occurred!",textVisible:!0}),setTimeout(function(){$.mobile.loading("hide")},5e3)}})},$$.JumpToLine=function(e,t){var o="TC"==e?editor1:editor2;"TC"==e?$$.SetTab(3):($$.SketchFileOpen("main"),$$.SetTab(2)),window.setTimeout(function(){o.setCursor(t);var e=o.getScrollInfo().clientHeight,a=o.charCoords(t,"local");o.scrollTo(null,(a.top+a.bottom-e)/2),o.focus()},500)},$$.ShowProgramErrors=function(message){if($$._CurrentErrors=[],editor1.clearGutter("CodeMirror-lint-markers-1"),editor2.clearGutter("CodeMirror-lint-markers-2"),editor3.clearGutter("CodeMirror-lint-markers-3"),$$._CurrentProgram.ScriptErrors=message,""!=message){for(i=0;i0&&(currentLine==err.Line&¤tBlock==err.CodeBlock||(null!=marker&&($(marker).qtip({content:{title:"Error",text:message,button:"Close"},show:{event:"mouseover",solo:!0},hide:"mouseout",style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"}}),message=""),marker=document.createElement("div"),marker.className="CodeMirror-lint-marker-error","TC"==err.CodeBlock?editor1.setGutterMarker(err.Line-1,"CodeMirror-lint-markers-1",marker):editor2.setGutterMarker(err.Line-1,"CodeMirror-lint-markers-2",marker),currentLine=err.Line,currentBlock=err.CodeBlock),message+="("+err.Line+","+err.Column+"): "+err.ErrorMessage+"
    ",popupMessage+="Line '+err.Line+", Column "+err.Column+' (Trigger':'lime">Code')+"):
    "),popupMessage+="    "+err.ErrorMessage.replace(/\n/g,"
        ")+"


    "}null!=marker&&$(marker).qtip({content:{title:"Error",text:message,button:"Close"},show:{event:"mouseover",solo:!0},hide:"mouseout",style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"}}),$$.ShowExternalErrors(),""!=popupMessage?($("#program_error_button").show(),$("#program_error_button2").show(),$("#program_error_button").qtip({content:{title:"Error",text:popupMessage,button:"Close"},show:{event:"mouseover",ready:2==$$._CurrentTab,delay:500},hide:{event:!1,inactive:5e3},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{adjust:{screen:!0},my:"top center",at:"bottom center"}}),$("#program_error_button2").qtip({content:{title:"Error",text:popupMessage,button:"Close"},show:{event:"mouseover",ready:3==$$._CurrentTab,delay:500},hide:{event:!1,inactive:5e3},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{adjust:{screen:!0},my:"top center",at:"bottom center"}})):($("#program_error_button").hide(),$("#program_error_button2").hide())}else $$._CurrentErrors=[];$$.RefreshCodeMirror()}},$$.ShowExternalErrors=function(){editor3.clearGutter("CodeMirror-lint-markers-3");for(var e=0,t="",o=null,a="",i=0;i<$$._CurrentErrors.length;i++)for(var r=$$._CurrentErrors[i].ErrorMessage.split("\n"),n=0;n3&&l[0]==$$._CurrentSketchFile&&$.isNumeric(l[1])&&$.isNumeric(l[2])&&(e==l[1]&&t==s.CodeBlock||(null!=o&&($(o).qtip({content:{title:"Error",text:a,button:"Close"},show:{event:"mouseover",solo:!0},hide:"mouseout",style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"}}),a=""),o=document.createElement("div"),o.className="CodeMirror-lint-marker-error",editor3.setGutterMarker(l[1]-1,"CodeMirror-lint-markers-3",o),e=l[1],t=s.CodeBlock),a+=s+"
    ")}null!=o&&$(o).qtip({content:{title:"Error",text:a,button:"Close"},show:{event:"mouseover",solo:!0},hide:"mouseout",style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"}})},$$.HideProgramErrors=function(){$$._CurrentErrors=[],null!=editor1&&editor1.clearGutter("CodeMirror-lint-markers-1"),null!=editor2&&editor2.clearGutter("CodeMirror-lint-markers-2"),null!=editor3&&editor3.clearGutter("CodeMirror-lint-markers-3"),$("#program_error_button").hide(),$("#program_error_button2").hide(),$(".qtip").hide(),$$.RefreshCodeMirror()},$$.RefreshCodeMirror=function(){setTimeout(function(){null!=editor1&&editor1.refresh(),null!=editor2&&editor2.refresh(),null!=editor3&&editor3.refresh()},500)},$$.CompileProgram=function(){$$.HideProgramErrors();var e=$$.SetProgramData();"arduino"==$$._CurrentProgram.Type.toLowerCase()?$$.SketchFileSave(function(){$$.UpdateProgram(e,!0)}):$$.UpdateProgram(e,!0)},$$.SaveProgram=function(e){$("#program_error_button").hide(),$("#program_error_button2").hide();var t=$$.SetProgramData();"arduino"==$$._CurrentProgram.Type.toLowerCase()?$$.SketchFileSave(function(){$$.UpdateProgram(t,!1,e)}):$$.UpdateProgram(t,!0,e)},$$.SetProgramData=function(){HG.WebApp.AutomationGroupsList._CurrentGroup=$("#automation_programgroup").val(),$$._CurrentProgram.Group=$("#automation_programgroup").val(),$$._CurrentProgram.Name=$("#automation_programname").val(),$$._CurrentProgram.Description=$("#automation_programdescription").val(),$$._CurrentProgram.ScriptCondition=editor1.getValue(),$$._CurrentProgram.ScriptSource=editor2.getValue(),$$._CurrentProgram.ScriptErrors="",$$._CurrentProgram.ConditionType=$("#automation_conditiontype").val();var e={Address:$$._CurrentProgram.Address,Type:$$._CurrentProgram.Type,Group:$$._CurrentProgram.Group,Name:$$._CurrentProgram.Name,Description:$$._CurrentProgram.Description,IsEnabled:$$._CurrentProgram.IsEnabled,ScriptCondition:$$._CurrentProgram.ScriptCondition,ScriptSource:$$._CurrentProgram.ScriptSource,ConditionType:$$._CurrentProgram.ConditionType,Conditions:$$._CurrentProgram.Conditions,Commands:$$._CurrentProgram.Commands};return e},$$.CheckAndRunProgram=function(e){$$._CurrentProgram.ScriptCondition=editor1.getValue(),$$._CurrentProgram.ScriptSource=editor2.getValue(),$$._CurrentProgram.ConditionType=$("#automation_conditiontype").val(),$$.IsClean()?$$.RunProgram(e.Address,null):$$.SaveProgram(function(){$$.RunProgram(e.Address,null)})},$$.BreakProgram=function(e){$.mobile.loading("show",{text:"Stopping program",textVisible:!0,theme:"a",html:""}),$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Break/"+e+"/",type:"GET",success:function(){$$.RefreshProgramOptions(),$.mobile.loading("hide")},error:function(){$.mobile.loading("hide")}})},$$.RunProgram=function(e,t){$$._CurrentProgram.ScriptCondition=editor1.getValue(),$$._CurrentProgram.ScriptSource=editor2.getValue(),$$._CurrentProgram.ConditionType=$("#automation_conditiontype").val(),$.mobile.loading("show",{text:"Running program",textVisible:!0,theme:"a",html:""}),HG.Automation.Programs.Run(e,t,function(e){null!=e&&$$.RefreshProgramOptions(),$.mobile.loading("hide")})},$$.DeleteProgram=function(e){$.mobile.loading("show",{text:"Deleting program",textVisible:!0,theme:"a",html:""}),HG.Automation.Programs.DeleteProgram(e,function(){$.mobile.loading("hide"),setTimeout(function(){$.mobile.changePage($("#page_automation_programs"),{transition:"fade",changeHash:!0})},200)})},$$.SetTab=function(e){$$._CurrentTab=e,$("#program_edit_tab1").hide(),$("#program_edit_tab2").hide(),$("#program_edit_tab3").hide(),$("#program_edit_tab1_button").removeClass("ui-btn-active"),$("#program_edit_tab2_button").removeClass("ui-btn-active"),$("#program_edit_tab3_button").removeClass("ui-btn-active"),$("#program_edit_tab"+e).show(),$("#program_edit_tab"+e+"_button").addClass("ui-btn-active"),$$.RefreshCodeMirror()},$$.SketchFileSelect=function(e){$("#automation_program_sketchfiles li a").removeClass("ui-btn-active"),$(e).addClass("ui-btn-active"),$("#automation_program_sketchfiles_edit").removeClass("ui-disabled"),$("#automation_program_sketchfiles_delete").addClass("ui-disabled"),"main"!=$(e).attr("data-context-value")&&$("#automation_program_sketchfiles_delete").removeClass("ui-disabled")},$$.SketchFileOpen=function(e){$$.SketchFileSave(function(){$.mobile.loading("show",{text:"Opening file "+e, -textVisible:!0,theme:"a",html:""}),null==e||"undefined"==typeof e||""==e||"main"==e?($$._CurrentSketchFile="",$("#configure_program_editorfilename").html(e),$(editor3.getWrapperElement()).hide(),$(editor2.getWrapperElement()).show(),editor2.clearHistory(),editor2.markClean(),editor2.refresh(),$.mobile.loading("hide")):($(editor2.getWrapperElement()).hide(),$(editor3.getWrapperElement()).show(),HG.Automation.Programs.ArduinoFileLoad($$._CurrentProgram.Address,e,function(t){$$._CurrentSketchFile=e,$("#configure_program_editorfilename").html(e),editor3.setValue(t),editor3.clearHistory(),editor3.markClean(),editor3.refresh(),$$.ShowExternalErrors(),$.mobile.loading("hide")}))})},$$.SketchFileSave=function(e){if(""==$$._CurrentSketchFile)return void(null!=e&&e());$.mobile.loading("show",{text:"Saving file "+$$._CurrentSketchFile,textVisible:!0,theme:"a",html:""});var t=editor3.getValue();HG.Automation.Programs.ArduinoFileSave($$._CurrentProgram.Address,$$._CurrentSketchFile,t,function(){$.mobile.loading("hide"),null!=e&&e()})},$$.SketchFileList=function(){$("#automation_program_sketchfiles_edit").addClass("ui-disabled"),$("#automation_program_sketchfiles_delete").addClass("ui-disabled"),HG.Automation.Programs.ArduinoFileList($$._CurrentProgram.Address,function(e){if($("#automation_program_sketchfiles").empty(),$("#automation_program_sketchfiles").append('
  • Main Sketch Code
  • '),"undefined"!=typeof e&&null!=e)for(var t=0;t"+e[t]+"");$("#automation_program_sketchfiles").listview("refresh")})}},HG.WebApp.WidgetsList=HG.WebApp.WidgetsList||new function(){var $$=this;$$.PageId="page_configure_widgetlist",$$._currentWidget="",$$.InitializePage=function(){var page=$("#"+$$.PageId),importPopup=page.find("[data-ui-field=import-popup]"),importButton=page.find("[data-ui-field=import-btn]"),importForm=page.find("[data-ui-field=import-form]"),uploadButton=page.find("[data-ui-field=upload-btn]"),uploadFile=page.find("[data-ui-field=upload-file]"),uploadFrame=page.find("[data-ui-field=upload-frame]"),addConfirmButton=page.find("[data-ui-field=addconfirm-btn]"),addNewButton=page.find("[data-ui-field=addnew-btn]"),addNewPopup=page.find("[data-ui-field=widgetadd-popup]"),newBrandText=page.find("[data-ui-field=widgetbrand-txt]"),newCategoryText=page.find("[data-ui-field=widgetcategory-txt]"),newNameText=page.find("[data-ui-field=widgetname-txt]");page.on("pageinit",function(){importPopup.popup(),addNewPopup.popup()}),page.on("pagebeforeshow",function(e){HG.Configure.Modules.List(function(data){try{HG.WebApp.Data.Modules=eval(data)}catch(e){}}),$$.LoadWidgets()}),addNewButton.bind("click",function(){newBrandText.val(""),newCategoryText.val(""),newNameText.val(""),HG.Ui.SwitchPopup("#widgetlist_actionmenu",addNewPopup)}),addConfirmButton.bind("click",function(){var e=newBrandText.val()+"/"+newCategoryText.val()+"/"+newNameText.val();return HG.Configure.Widgets.Add(e,function(t){"Ok"==t.Status?($$._currentWidget=e,$.mobile.pageContainer.pagecontainer("change","#"+HG.WebApp.WidgetEditor.PageId)):alert("Error adding widget")}),!1}),importButton.bind("click",function(){HG.Ui.SwitchPopup("#widgetlist_actionmenu",importPopup)}),newBrandText.bind("keyup blur",function(){newBrandText.val(newBrandText.val().replace(/[^a-z,A-Z]/g,"").toLowerCase())}),newCategoryText.bind("keyup blur",function(){newCategoryText.val(newCategoryText.val().replace(/[^a-z,A-Z]/g,"").toLowerCase())}),newNameText.bind("keyup blur",function(){newNameText.val(newNameText.val().replace(/[^a-z,A-Z]/g,"").toLowerCase())}),uploadButton.bind("click",function(){""==uploadFile.val()?(alert("Select a file to import first"),uploadFile.parent().stop().animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250).animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250)):(importButton.removeClass("ui-btn-active"),importPopup.popup("close"),$.mobile.loading("show",{text:"Importing, please wait...",textVisible:!0,html:""}),importForm.submit())}),uploadFrame.bind("load",function(){$.mobile.loading("hide"),""!=uploadFile.val()&&(uploadFile.val(""),$$.LoadWidgets())})},$$.LoadWidgets=function(){$.mobile.loading("show"),HG.Configure.Widgets.List(function(e){$$.RefreshList(e),$.mobile.loading("hide")})},$$.RefreshList=function(e){var t=$("#"+$$.PageId),o=t.find("[data-ui-field=group-list]");o.empty(),o.append('
  • '+HG.WebApp.Locales.GetLocaleString("configure_widgetlist_list","Widget List")+"
  • ");for(var a=0;a'+e[a]+"");o.listview(),o.listview("refresh");for(var a=0;a'+HG.WebApp.Locales.GetLocaleString("configure_widgeteditor_title",!1,this.Locale)+"
    "+HG.WebApp.WidgetsList._currentWidget),e.find(".CodeMirror").css("bottom",$$._previewHeight+5+"px"),p.height($$._previewHeight),$.ajax({url:"/hg/html/pages/control/widgets/"+HG.WebApp.WidgetsList._currentWidget+".html",type:"GET",dataType:"text",success:function(e){$$._editorHtml.setValue(e),$$._editorHtml.clearHistory(),$$._editorHtml.markClean(),$.ajax({url:"/hg/html/pages/control/widgets/"+HG.WebApp.WidgetsList._currentWidget+".js",type:"GET",dataType:"text",success:function(e){$$._editorJscript.setValue(e),$$._editorJscript.clearHistory(),$$._editorJscript.markClean(),$$.RefreshCodeMirror()}})}}),e.find("[data-ui-field=preview-div]").empty(),$$._hasError=!0;var t=e.find("[data-ui-field=bindmodule-sel]");t.empty(),t.append('");for(var o="",a=0;a'+l+"")}t.trigger("create"),t.val(o),t.selectmenu("refresh"),$$.SetTab(1),""!=o||"0"==o?setTimeout(function(){$$.Run()},1e3):t.qtip({content:{title:HG.WebApp.Locales.GetLocaleString("configure_widgeteditor_nobindmodule_title","Select a module"),text:HG.WebApp.Locales.GetLocaleString("configure_widgeteditor_nobindmodule_text","No valid bind-module has been found, please select one."),button:HG.WebApp.Locales.GetLocaleString("configure_widgeteditor_nobindmodule_close","Close")},show:{event:!1,ready:!0,delay:1e3},events:{hide:function(){$(this).qtip("destroy")}},hide:{event:!1,inactive:3e3},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{my:"bottom center",at:"top center"}})}),r.bind("click",function(){$("#editwidget_actionmenu").popup("close"),$$.SaveWidget(function(){$$._editorHtml.markClean(),$$._editorJscript.markClean()})}),n.bind("click",function(){$("#editwidget_actionmenu").popup("close"),window.open(location.protocol+"../../api/HomeAutomation.HomeGenie/Config/Widgets.Export/"+encodeURIComponent(HG.WebApp.WidgetsList._currentWidget)+"/")}),s.bind("click",function(){HG.Ui.SwitchPopup("#editwidget_actionmenu",d)}),l.bind("click",function(){return $.mobile.loading("show",{text:"Deleting Widget...",textVisible:!0,theme:"a",html:""}),HG.Configure.Widgets.Delete(HG.WebApp.WidgetsList._currentWidget,function(){$.mobile.loading("hide"),$.mobile.pageContainer.pagecontainer("change","#"+HG.WebApp.WidgetsList.PageId)}),!1}),c.bind("click",function(){return $$.CheckIsClean(function(){$.mobile.pageContainer.pagecontainer("change","#"+HG.WebApp.WidgetsList.PageId)}),!1}),m.bind("click",function(){return $$.CheckIsClean(function(){$.mobile.pageContainer.pagecontainer("change","#page_control")}),!1}),b.bind("click",function(){return $$._savePromptCallback(),!1}),f.bind("click",function(){return $$.SaveWidget(function(){$$._savePromptCallback()}),!1}),t.bind("click",function(){$$.Run()}),o.on("change",function(){""==$(this).val()?a.addClass("ui-disabled"):a.removeClass("ui-disabled"),$$.RenderView()}),a.on("click",function(){if(""!=o.val()){var e=HG.WebApp.Data.Modules[o.val()];HG.WebApp.Control.EditModuleParams(e)}}),i.hide(),u.mousedown(function(t){$$._splitDragStartY=t.pageY,$(window).mousemove(function(t){var o=$$._splitDragStartY-t.pageY,a=e.height()/2,i=p.height()+o;i>=5&&a>=i?(p.height(p.height()+o),e.find(".CodeMirror").css("bottom",p.height()+5+"px"),$$._splitDragStartY=t.pageY):($(window).unbind("mousemove"),$$._editorHtml.refresh(),$$._editorJscript.refresh())})}).mouseup(function(){$(window).unbind("mousemove"),$$._editorHtml.refresh(),$$._editorJscript.refresh()}),window.onerror=function(e,t,o,a,i){if(!(t.indexOf("#"+$$.PageId)>0))throw i;$$.ShowError(i)}},$$.SetTab=function(e){var t=$("#"+$$.PageId);t.find("[data-ui-field=tab1-div]").hide(),t.find("[data-ui-field=tab2-div]").hide(),t.find("[data-ui-field=tab3-div]").hide(),t.find("[data-ui-field=tab1-btn]").removeClass("ui-btn-active"),t.find("[data-ui-field=tab2-btn]").removeClass("ui-btn-active"),t.find("[data-ui-field=tab3-btn]").removeClass("ui-btn-active"),t.find("[data-ui-field=tab"+e+"-div]").show(),t.find("[data-ui-field=tab"+e+"-btn]").addClass("ui-btn-active"),$$.RefreshCodeMirror()},$$.CheckIsClean=function(e){if($$._editorHtml.isClean()&&$$._editorJscript.isClean())e();else{var t=$("#"+$$.PageId);$$._savePromptCallback=function(){e()},t.find("[data-ui-field=notsaved-popup]").popup("open")}},$$.SaveWidget=function(e){$$.SaveWidgetHtml(function(){$$.SaveWidgetJavascript(function(){$$.Run(),e&&e()})})},$$.SaveWidgetHtml=function(e){$.mobile.loading("show",{text:HG.WebApp.Locales.GetLocaleString("configure_widgeteditor_savinghtml",!1,this.Locale),textVisible:!0,theme:"a",html:""}),HG.Configure.Widgets.Save(HG.WebApp.WidgetsList._currentWidget,"html",$$._editorHtml.getValue(),function(){$.mobile.loading("hide"),e&&e()})},$$.SaveWidgetJavascript=function(e){$.mobile.loading("show",{text:HG.WebApp.Locales.GetLocaleString("configure_widgeteditor_savingjavascript",!1,this.Locale),textVisible:!0,theme:"a",html:""}),HG.Configure.Widgets.Save(HG.WebApp.WidgetsList._currentWidget,"js",$$._editorJscript.getValue(),function(){$.mobile.loading("hide"),e&&e()})},$$.RefreshCodeMirror=function(){setTimeout(function(){$$._editorHtml.refresh(),$$._editorJscript.refresh()},500)},$$.Render=function(){var e=$("#"+$$.PageId),t=(e.find("[data-ui-field=bindmodule-sel]"),e.find("[data-ui-field=errors-btn]"));t.hide();var o='
    ';o+=$$._editorHtml.getValue(),o+="
    ",e.find("[data-ui-field=preview-div]").html(o),e.find("[data-ui-field=preview-wrapper-div]").trigger("create")},$$.RenderView=function(e){if(!$$._hasError){var t=$("#"+$$.PageId),o=t.find("[data-ui-field=bindmodule-sel]"),a=HG.WebApp.Data.Modules[o.val()];(null==e||e.Domain==a.Domain&&e.Source==a.Address)&&$$.RenderWidget("#widget_preview_instance",$$._widgetInstance,a,e)}},$$.RenderWidget=function(e,t,o,a){try{t.v2?("function"==typeof t._bind?(t._bind(e,o),t._bind=null):t.setModule(o),"function"!=typeof t.onStart||t._started||(t.onStart(),t._started=!0,"function"==typeof t.onRefresh&&t.onRefresh()),"undefined"!=typeof a&&"undefined"!=typeof a.Property&&"function"==typeof t.onUpdate?t.onUpdate(a.Property,a.Value):"function"==typeof t.onRefresh&&t.onRefresh()):t.RenderView(e,o)}catch(i){console.log(i),$$._hasError=!0,$$.ShowError(i)}},$$.GetInstance=function(javascriptCode){if(javascriptCode.trim().startsWith("["))return eval(javascriptCode)[0];var commonJs="";return commonJs+=" var $$ = this;",commonJs+=" $$._fieldCache = [];",commonJs+=" $$.v2 = true;",commonJs+=" $$.apiCall = HG.Control.Modules.ServiceCall;",commonJs+=" $$.util = HG.WebApp.Utility;",commonJs+=" $$.ui = HG.Ui;",commonJs+=" $$.signalActity = function(fieldName) {",commonJs+=" if (typeof fieldName != 'undefined' && fieldName != '')",commonJs+=" $$.ui.BlinkAnim($$.field(fieldName));",commonJs+=" if ($$.field('led').length) {",commonJs+=" $$.field('led').attr('src', 'images/common/led_green.png');",commonJs+=" setTimeout(function() {",commonJs+=" $$.field('led').attr('src', 'images/common/led_black.png');",commonJs+=" }, 100);",commonJs+=" }",commonJs+=" };",commonJs+=" $$.field = function(field, globalSearch){",commonJs+=" var f = globalSearch ? '@'+field : field;",commonJs+=" var el = null;",commonJs+=" if (typeof $$._fieldCache[f] == 'undefined') {",commonJs+=" el = globalSearch ? $(field) : $$._widget.find('[data-ui-field='+field+']');",commonJs+=" if (el.length)",commonJs+=" $$._fieldCache[f] = el;",commonJs+=" } else {",commonJs+=" el = $$._fieldCache[f];",commonJs+=" }",commonJs+=" return el",commonJs+=" };",commonJs+=" $$.clearCache = function() {",commonJs+=" $$._fieldCache.length = 0;",commonJs+=" };",commonJs+=" $$.setModule = function(module) {",commonJs+=" $$.module = module;",commonJs+=" $$.module.prop = function(propName, value) {",commonJs+=" var p = HG.WebApp.Utility.GetModulePropertyByName(this, propName);",commonJs+=" if (typeof value != 'undefined')",commonJs+=" p.Value = value;",commonJs+=" return p;",commonJs+=" };",commonJs+=" $$.module.command = function(cmd, opt, callback) {",commonJs+=" HG.Control.Modules.ServiceCall(cmd, this.Domain, this.Address, opt, function (response) { ",commonJs+=" if (typeof callback == 'function')",commonJs+=" callback(response);",commonJs+=" });",commonJs+=" };",commonJs+=" };",commonJs+=" $$._bind = function(cuid, module) {",commonJs+=" $$.setModule(module);",commonJs+=" $$.container = $(cuid);",commonJs+=" $$.popup = $$.container.find('[data-ui-field=controlpopup]');",commonJs+=" $$.popup.popup();",commonJs+=" $$.popup.trigger('create');",commonJs+=" $$.popup.field = function(f){ return $$.popup.find('[data-ui-field='+f+']'); };",commonJs+=" $$._widget = $$.container.find('[data-ui-field=widget]');",commonJs+=" $$._widget.data('ControlPopUp', $$.popup);",commonJs+=" };",commonJs=commonJs.replace(/(\r\n|\n|\r)/gm,""),javascriptCode="new function(){"+commonJs+javascriptCode+"}",eval(javascriptCode)},$$.Run=function(){$$._hasError=!1,$$._editorJscript.clearGutter("CodeMirror-lint-markers-5");var e=$$._editorJscript.getValue();$.mobile.loading("show",{text:"Checking Javascript code...",textVisible:!0,theme:"a",html:""}),HG.Configure.Widgets.Parse(e,function(t){if($.mobile.loading("hide"),"OK"!=t.ResponseValue){var o=t.ResponseValue,a=o.substr(o.indexOf("(")+1);a=a.substr(0,a.indexOf(")")).split(","),o=o.substr(o.indexOf(":")+2),o=o+'
    Line '+a[0]+", Column "+a[1]+"",$$.ShowErrorTip(o,a[0])}else try{$$._widgetInstance=$$.GetInstance(e),$$.Render(),$$.RenderView()}catch(i){$$._hasError=!0,$$.ShowError(i)}})},$$.ShowError=function(e){var t=ErrorStackParser.parse(e);navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&(t[0]=e);var o=e+'
    Line '+t[0].lineNumber+", Column "+t[0].columnNumber+"";$$.ShowErrorTip(o,t[0].lineNumber),console.log(o),console.log(t)},$$.ShowErrorTip=function(e,t){if(null!=$$._editorJscript){var o=$("#"+$$.PageId),a=o.find("[data-ui-field=errors-btn]"),i=document.createElement("div");$$.SetTab(2),$$._editorJscript.clearGutter("CodeMirror-lint-markers-5"),i.className="CodeMirror-lint-marker-error",$$._editorJscript.setGutterMarker(t-1,"CodeMirror-lint-markers-5",i),$(i).qtip({content:{title:"Error",text:e,button:"Close"},show:{event:"mouseover",solo:!0},hide:"mouseout",style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"}}),a.show(),a.qtip({content:{title:"Error",text:e,button:"Close"},show:{event:"mouseover",ready:!0,delay:500},hide:{event:!1,inactive:5e3},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{adjust:{screen:!0},my:"top center",at:"bottom center"}})}},$$.JumpToLine=function(e){window.setTimeout(function(){$$._editorJscript.setCursor(e);var t=$$._editorJscript.getScrollInfo().clientHeight,o=$$._editorJscript.charCoords(e,"local");$$._editorJscript.scrollTo(null,(o.top+o.bottom-t)/2),$$._editorJscript.focus()},500)}},HG.WebApp.Scheduler=HG.WebApp.Scheduler||new function(){var e=this;e._ScheduleList={},e._CurrentEventName="",e._CurrentEventIndex=-1,e.InitializePage=function(){$("#schedulerservice_item_edit").on("popupbeforeposition",function(){e.RefreshEventDetails()}),$("#schedulerservice_item_cronwizard").on("click",function(){$("#schedulerservice_item_edit").one("popupafterclose",function(){HG.Ui.Popup.CronWizard.element.one("popupafterclose",function(){$("#schedulerservice_item_edit").popup("open")}),HG.Ui.Popup.CronWizard.open(),HG.Ui.Popup.CronWizard.onChange=function(e){setTimeout(function(){$("#schedulerservice_item_cronexp").val(e)},500)}}),$("#schedulerservice_item_edit").popup("close")}),$("#scheduleritem_update_button").on("click",function(){var t=$("#schedulerservice_item_name").val(),o=$("#schedulerservice_item_cronexp").val(),a=$("#schedulerservice_item_programid").val();HG.Automation.Scheduling.Update(t,o,a,function(){e.LoadScheduling()})}),$("#scheduleritem_delete_button").on("click",function(){var t=$("#schedulerservice_item_name").val();HG.Automation.Scheduling.Delete(t,function(){e.LoadScheduling()}),e._CurrentEventName="",e._CurrentEventIndex=-1}),$("#scheduleritem_add_button").on("click",function(){$("#schedulerservice_item_name").val(""),e._CurrentEventName="",e._CurrentEventIndex=-1})},e.GetItemMarkup=function(e){var t=e.Name;t.indexOf(".")>0&&(t=t.substring(t.indexOf(".")+1));var o='
  • ';return o+='',o+='

     '+e.ProgramId+'
    Last: '+e.LastOccurrence+"
    Next: "+e.NextOccurrence+"

    ",o+='

    '+t+"

    ",o+='

    '+e.CronExpression+"    "+e.Description+"

    ",o+="
    ",o+=""+(e.IsEnabled?"Tap to DISABLE item":"Tap to ENABLE item")+"",o+="
  • "},e.LoadScheduling=function(t){$.mobile.loading("show"),HG.Automation.Scheduling.List(function(o){for(e._ScheduleList=o,$.mobile.loading("hide"),$("#configure_schedulerservice_list").empty(),$("#configure_schedulerservice_list").append('
  • '+HG.WebApp.Locales.GetLocaleString("configure_scheduler_events")+"
  • "),i=0;i0){var s=a.Name.substring(0,a.Name.indexOf(".")),r=e.GetItemMarkup(a);s!=n&&($("#configure_schedulerservice_list").append('
  • '+s+"
  • "),n=s),$("#configure_schedulerservice_list").append(r)}}$("#configure_schedulerservice_list").listview(),$("#configure_schedulerservice_list").listview("refresh"),$("#configure_schedulerservice_list li").bind("click",function(){e._CurrentEventName=$(this).attr("data-schedule-name"),e._CurrentEventIndex=$(this).attr("data-schedule-index")}),t&&t()})},e.RefreshEventDetails=function(){var t=null,o="",a="",i="";-1!=e._CurrentEventIndex?(t=e._ScheduleList[e._CurrentEventIndex],o=t.Name,a=t.CronExpression,i=t.ProgramId,$("#schedulerservice_item_name").addClass("ui-disabled"),$("#schedulerservice_item_name").val(o)):$("#schedulerservice_item_name").removeClass("ui-disabled"),$("#schedulerservice_item_cronexp").val(a),$("#schedulerservice_item_programid").val(i)},e.ToggleScheduleIsEnabled=function(t){var o=e._ScheduleList[t];$.mobile.loading("show"),o.IsEnabled?HG.Automation.Scheduling.Disable(o.Name,function(){e.LoadScheduling()}):HG.Automation.Scheduling.Enable(o.Name,function(){e.LoadScheduling()})}},HG.WebApp.Apps=Array(),HG.WebApp.Apps.NetPlay=Array(),HG.WebApp.Apps.NetPlay.SlideShow=Array(),HG.WebApp.Apps.NetPlay.SlideShow.DisplayImage=function(e){$.mobile.changePage("#page_apps_netplay",{transition:"flow"});var t="#bgapp_netplay_image1";$("#bgapp_netplay_image1").is(":visible")?($("#bgapp_netplay_image1").animate({top:0,left:-4e3},2e3,function(){$("#bgapp_netplay_image1").hide()}),t="#bgapp_netplay_image2"):($("#bgapp_netplay_image2").animate({top:0,left:-4e3},2e3,function(){$("#bgapp_netplay_image2").hide()}),t="#bgapp_netplay_image1"),setTimeout(function(){""==e&&(e="0"),$(t).html(''),$(t).show(),$(t).animate({top:0,left:0},2e3)})}; \ No newline at end of file +HG.WebApp=HG.WebApp||new function(){var $$=this;$$.Data={ServiceKey:"api",ServiceDomain:"HomeAutomation.HomeGenie",Modules:[],Groups:[],AutomationGroups:[],Programs:[],Interfaces:[],Events:[]},$$.Store=$.jStorage,$$.Initialize=function(){var theme=$$.Store.get("UI.Theme");(null==theme||"a">theme||theme>"g")&&$$.Store.set("UI.Theme","a"),$.mobile.ajaxFormsEnabled=!1,HG.Configure.LoadData(function(){setTimeout($$.Control.RenderMenu,2e3)}),$$.Home.UpdateHeaderStatus(),window.setInterval("HG.WebApp.Home.UpdateHeaderStatus();",1e4),$("[data-role=page]").on("pagebeforeshow",function(event){HG.Ui.SetTheme($$.Store.get("UI.Theme")),"page_analyze"==this.id?$$.Statistics.InitConfiguration():"page_configure_maintenance"==this.id?$$.Maintenance.LoadSettings():"page_configure_groups"==this.id?HG.Configure.Modules.List(function(data){try{$$.Data.Modules=eval(data)}catch(e){}HG.Automation.Programs.List(function(){$$.GroupsList.LoadGroups()})}):"page_configure_schedulerservice"==this.id&&$$.Scheduler.LoadScheduling()}),$("[data-role=page]").on("pagehide",function(){"page_analyze"==this.id&&$$.Statistics.SetAutoRefresh(!1)}),setTimeout(function(){var e=$$.Locales.GetUserLanguage();$$.Locales.Load("./locales/"+e.toLowerCase().substring(0,2)+".json",function(){$$.Locales.Load("./locales/"+e.toLowerCase().substring(0,2)+".programs.json",function(){$$.Locales.Localize(document),$("#homegenie_overlay").fadeOut(200),$$.Store.get("UI.AboutPopupShown")||($$.Store.set("UI.AboutPopupShown",!0),setTimeout($$.Home.About,3e3))})}),HG.VoiceControl.Initialize(),HG.Ui.SetTheme($$.Store.get("UI.Theme")),$$.Store.get("UI.EventsHistory")&&$("#btn_eventshistory_led").show(),HG.System.GetVersion(function(e){$("#systemversion").html(e.Version)}),setTimeout(function(){$("head").append('')},5e3)},100),$("#content").notify({speed:500,expires:5e3,stack:"below"}),Raphael.fn.ball=function(e,t,o,a){return this.set(this.ellipse(e,t+o-o/5,o,o/2).attr({fill:"rhsb("+a.h+", 1, .25)-hsb("+a.h+", 1, .25)",stroke:"none",opacity:0}),this.ellipse(e,t,o,o).attr({fill:"r(.5,.9)hsb("+a.h+", "+a.s+", .75)-hsb("+a.h+", "+a.s+", "+a.b+")",stroke:"none",opacity:.8}),this.ellipse(e,t,o-o/5,o-o/20).attr({stroke:"none",fill:"r(.5,.1)#ccc-#ccc",opacity:0}))},$("#automation_group_module_edit").enhanceWithin().popup(),$("#page_configure_groupmodules_propspopup").enhanceWithin().popup(),$("#page_configure_groupmodules_propspopup").on("popupbeforeposition",function(){$("#automation_group_module_params").scrollTop(0),$$.GroupModules.LoadModuleParameters()}),$("#module_options_button").on("click",function(){$$.GroupModules.ShowModuleOptions($$.GroupModules.CurrentModule.Domain,$$.GroupModules.CurrentModule.Address)}),$("#module_update_button").bind("click",function(){$$.GroupModules.CurrentModule.Name=$$.GroupModules.EditModule.Name,$$.GroupModules.CurrentModule.DeviceType=$$.GroupModules.EditModule.DeviceType,$$.Utility.SetModulePropertyByName($$.GroupModules.CurrentModule,"VirtualMeter.Watts",$$.GroupModules.EditModule.WMWatts),$$.Utility.SetModulePropertyByName($$.GroupModules.EditModule,"VirtualMeter.Watts",$$.GroupModules.EditModule.WMWatts);for(var e=0;e<$$.GroupModules.EditModule.Properties.length;e++){var t=$$.GroupModules.EditModule.Properties[e];$$.Utility.SetModulePropertyByName($$.GroupModules.CurrentModule,t.Name,t.Value),t=$$.Utility.GetModulePropertyByName($$.GroupModules.CurrentModule,t.Name),t.NeedsUpdate="true"}$$.GroupModules.UpdateModule($$.GroupModules.CurrentModule,function(){$$.GroupModules.ModuleUpdatedCallback()})}),$("#automationprograms_program_options").enhanceWithin().popup(),$("#configure_popupsettings_edit").enhanceWithin().popup(),$("#configure_popupsettings_edit").on("popupbeforeposition",function(){$$.Events.PopupRefreshIgnore()}),$("#actionconfirm_popup").enhanceWithin().popup();var menuPanel=$('body>[data-role="panel"]');menuPanel.panel().on("panelopen",function(){$("#homegenie_overlay").fadeIn(150)}).on("panelbeforeopen",function(){$("#homegenie_overlay").fadeIn(250)}).on("panelbeforeclose",function(){$("#homegenie_overlay").fadeOut(250)}).children().first().trigger("create"),menuPanel.on("click",function(){$(this).panel("close")}),$(document).on("swipeleft swiperight","div[data-role=page]",function(e){$("[data-ui-field=homegenie_panel_button]").hasClass("ui-disabled")||0==$(".ui-page-active .ui-popup-active").length&&($(e.target).is("span")||$(e.target).is("pre")||$(e.target).is("p")||$(e.target).is(":input")||"page_automation_editprogram"!=$(e.target).attr("id")&&0==$("#page_automation_editprogram").children().find($(e.target)).length&&"page_widgeteditor_editwidget"!=$(e.target).attr("id")&&0==$("#page_widgeteditor_editwidget").children().find($(e.target)).length&&"open"!==$.mobile.activePage.jqmData("panel")&&("swipeleft"===e.type?$(menuPanel.get(0)).panel("open"):"swiperight"===e.type&&$(menuPanel.get(1)).panel("open")))}),HG.Ui.GenerateWidget("core/popup.cronwizard",{parent:$(document).find("body")},function(e){var t=e.element;t.enhanceWithin().popup(),HG.Ui.Popup.CronWizard=e}),$("#homegenie_about").enhanceWithin().popup(),$("#about_popup_updatebutton").on("click",function(){HG.System.UpdateManager.UpdateCheck(),$("#homegenie_about").popup("close")}),$$.lastSleepCheck=(new Date).getTime(),setInterval($$.sleepCheck,1e3)},$$.lastSleepCheck=0,$$.sleepCheck=function(){var e=(new Date).getTime(),t=e-$$.lastSleepCheck;t>5e3&&(null==HG.WebApp.Events._eventSource||2==HG.WebApp.Events._eventSource.readyState)&&(console.log("sleepCheck -> device resume"),HG.WebApp.Events.Setup()),$$.lastSleepCheck=e}},HG.WebApp.Data._DefaultLocale={},HG.WebApp.Data._CurrentLocale={},HG.WebApp.Locales=HG.WebApp.Locales||new function(){var $$=this;$$.GetUserLanguage=function(){var e=navigator.languages?navigator.languages[0]:navigator.language||navigator.userLanguage;return e.length>2&&(e=e.substring(0,2)),e},moment.locale($$.GetUserLanguage()),$$.GetDateEndianType=function(){var e="L",t=new Date(983268e5),o=t.toLocaleDateString().replace(/[\u200E]/g,"").split("/");return"2"==o[0]&&(e="M"),e},$$.GetTemperatureUnit=function(){var e=HG.WebApp.Store.get("UI.TemperatureUnit");return"C"==e||"F"!=e&&"M"!=$$.GetDateEndianType()?"Celsius":"Fahrenheit"},$$.GetDefault=function(e){$.ajax({url:"./locales/en.json",type:"GET",success:function(t){HG.WebApp.Data._DefaultLocale=$.parseJSON(t),e(),$.ajax({url:"./locales/en.programs.json",type:"GET",success:function(e){HG.WebApp.Data._DefaultLocale=$.extend(HG.WebApp.Data._DefaultLocale,$.parseJSON(e))}})}})},$$.Load=function(e,t){$$.GetDefault(function(){$.ajax({url:e,type:"GET",success:function(e){HG.WebApp.Data._CurrentLocale=$.extend(HG.WebApp.Data._CurrentLocale,$.parseJSON(e)),"function"==typeof t&&t(!0)},error:function(o){console.log('WARNING (Locales.Load): "'+e+'" '+o.status+" "+o.statusText),"function"==typeof t&&t(!1)}})})},$$.Localize=function(e){$(e).find("[data-locale-id]").each(function(){var e=$(this).attr("data-locale-id"),t=$$.GetLocaleString(e);null!=t&&($this=$(this),$this.is("a")&&$("span.ui-btn-text",$this).is("span")?$("span.ui-btn-text",$this).text(t):$this.is("input")?$this.attr("placeholder",t):$(this).html(t))})},$$.LocalizeElement=function(e,t){$(e).find("[data-locale-id]").each(function(){var e=$(this).attr("data-locale-id"),o=$$.GetLocaleString(e,!1,t);null!=o&&($this=$(this),$this.is("a")&&$("span.ui-btn-text",$this).is("span")?$("span.ui-btn-text",$this).text(o):$this.is("input")?$this.attr("placeholder",o):$(this).html(o))})},$$.GetLocaleString=function(e,t,o){var a=null;return o&&$.each(o,function(t,o){return t==e?(a=o,!1):void 0}),null==a&&$.each(HG.WebApp.Data._CurrentLocale,function(t,o){return t==e?(a=o,!1):void 0}),null==a&&$.each(HG.WebApp.Data._DefaultLocale,function(t,o){return t==e?(a=o,!1):void 0}),null==a&&console.log('WARNING (Locales.GetLocaleString): "'+e+'" is undefined.'),null==a&&t?t:a},$$.LocalizeWidget=function(e,t,o){var a=$$.GetUserLanguage();e=e.substring(0,e.lastIndexOf("/"));var i="#"+t,r="pages/control/widgets/"+e+"/locales/"+a.toLowerCase().substring(0,2)+".json";$.ajax({url:r,type:"GET",success:function(e){var t=$.parseJSON(e);$(i).find("[data-ui-field=widget]").data("Locale",t),$(i).find("[data-locale-id]").each(function(){var e=$(this).attr("data-locale-id"),o=$$.GetLocaleString(e,!1,t);null!=o&&($this=$(this),$this.is("a")&&$("span.ui-btn-text",$this).is("span")?$("span.ui-btn-text",$this).text(o):$this.is("input")?$this.attr("placeholder",o):$(this).html(o))}),$(i).find("[data-localizable]").each(function(){var e=$(this).text(),o=$$.GetLocaleString(e,!1,t);null!=o&&$(this).text(o)});var a=$(i).find("[data-ui-field=widget]").data("ControlPopUp");a&&a.each(function(){var e=$(this);$(e).find("[data-locale-id]").each(function(){var e=$(this).attr("data-locale-id"),o=$$.GetLocaleString(e,!1,t);null!=o&&($this=$(this),$this.is("a")&&$("span.ui-btn-text",$this).is("span")?$("span.ui-btn-text",$this).text(o):$this.is("input")?$this.attr("placeholder",o):$(this).html(o))})}),"function"==typeof o&&o()},error:function(e){console.log('WARNING (Locales.LocalizeWidget): "'+r+'" '+e.status+" "+e.statusText),"function"==typeof o&&o()}})},$$.GetWidgetLocaleString=function(e,t,o){var a=null;return null==e||"undefined"==typeof e||"undefined"==typeof e.data("Locale")?o?o:null:(a=$$.GetLocaleString(t,!1,e.data("Locale")),null==a&&o?o:a)},$$.GetProgramLocaleString=function(programAddress,stringId,defaultValue){var response=defaultValue,plocale,hasLocale=eval("(HG.WebApp.Data._CurrentLocale.Programs && HG.WebApp.Data._CurrentLocale.Programs["+programAddress+"])");return hasLocale?plocale=eval("HG.WebApp.Data._CurrentLocale.Programs["+programAddress+"]"):(hasLocale=eval("(HG.WebApp.Data._DefaultLocale.Programs && HG.WebApp.Data._DefaultLocale.Programs["+programAddress+"])"),hasLocale&&(plocale=eval("HG.WebApp.Data._DefaultLocale.Programs["+programAddress+"]"))),"undefined"!=typeof plocale&&(response=$$.GetLocaleString(stringId,defaultValue,plocale)),response},$$.GenerateTemplate=function(){var e="";$(document).find("[data-locale-id]").each(function(){var t=$(this).attr("data-locale-id"),o=$(this).html().trim();e.indexOf('"'+t+'"')<0&&(e+=' "'+t+'": \n "'+o+'",\n')}),console.log(e)}},HG.WebApp.Utility=HG.WebApp.Utility||new function(){var e=this;e._cmFsEditor=null,e.EditorPopup=function(t,o,a,i,r){null==e._cmFsEditor&&(e._cmFsEditor=CodeMirror.fromTextArea(document.getElementById("fullscreen_edit_text"),{lineNumbers:!0,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-Q":function(e){e.foldCode(e.getCursor())},"Ctrl-Space":"autocomplete"},foldGutter:!0,gutters:["CodeMirror-lint-markers-4","CodeMirror-linenumbers","CodeMirror-foldgutter"],highlightSelectionMatches:{showToken:/\w/},mode:{name:"javascript",globalVars:!0},theme:"ambiance"}));var n=$("#fullscreen_edit_box");n.find("[data-ui-field=title]").html(o),n.find("[data-ui-field=subtitle]").html(a);var s=n.find("[data-ui-field=namelabel]").html(t),l=n.find("[data-ui-field=nameinput]"),d=l.find("input").val(t),p=n.find("[data-ui-field=confirm]"),u=n.find("[data-ui-field=cancel]");null==t||""==t?(s.hide(),l.show()):(s.show(),l.hide()),u.on("click",function(){var t={name:d.val(),text:e._cmFsEditor.getValue(),isCanceled:!0};u.off("click"),p.off("click"),$("#fullscreen_edit_box").hide(150),r(t)}),p.on("click",function(){var t={name:d.val(),text:e._cmFsEditor.getValue(),isCanceled:!1};""==d.val()?d.qtip({content:{text:HG.WebApp.Locales.GetLocaleString("fullscreen_editor_entervalidname","Enter a valid name.")},show:{event:!1,ready:!0,delay:200},hide:{event:!1,inactive:2e3},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{my:"bottom center",at:"top center"}}).parent().stop().animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250).animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250):(u.off("click"),p.off("click"),$("#fullscreen_edit_box").hide(150),r(t))}),e._cmFsEditor.setValue(i),setTimeout(function(){e._cmFsEditor.refresh(),e._cmFsEditor.focus(),e._cmFsEditor.setCursor({line:0,ch:0})},500),$("#fullscreen_edit_box").show(150)},e.ConfirmPopup=function(e,t,o){var a=$("#actionconfirm_popup");a.buttonProceed=$("#actionconfirm_confirm_button"),a.buttonCancel=$("#actionconfirm_cancel_button"),a.find("h3").html(e),a.find("p").html(t),a.buttonCancel.focus();var i=function(){o(!1)},r=function(){o(!0)};a.buttonCancel.on("click",i),a.buttonProceed.on("click",r),a.on("popupafterclose",function(){a.buttonCancel.off("click",i),a.buttonProceed.off("click",r)}),setTimeout(function(){a.popup("open",{transition:"pop"})},250)},e.GetElapsedTimeText=function(e){var t="";if(e=(new Date-e)/1e3,e>0){var o=Math.floor(e/86400),a=Math.floor((e-86400*o)/3600),i=Math.floor((e-86400*o-3600*a)/60),r=Math.floor(e-86400*o-3600*a-60*i);o>0&&(t+=o+"d "),a>0&&(t+=a+"h "),i>0?t+=i+"m ":r>0&&(t+=r+"s")}return t},e.ParseModuleDomainAddress=function(e){var t=null;return e.indexOf(":")>0&&(t={Domain:e.substring(0,e.lastIndexOf(":")),Address:e.substring(e.lastIndexOf(":")+1)}),t},e.GetModuleByDomainAddress=function(e,t){for(var o=null,a=0;a=12?"PM":"AM";i%=12,i=i?i:12,a=i+":"+r+(0==t.indexOf("s")?":"+n+("sm"==t?"."+e.getMilliseconds():""):"")+" "+s}return a},e.GetDateBoxLocale=function(){var e="default",t=jQuery.jtsage.datebox.prototype.options.lang,o=HG.WebApp.Locales.GetUserLanguage();return t&&(t[o]?e=o:2===o.length&&$.each(t,function(t){return t.substring(0,2)===o?(e=t,!1):void 0})),e},e.SwitchPopup=HG.Ui.SwitchPopup,e.JScrollToElement=HG.Ui.ScrollTo},HG.WebApp.Data._CurrentGroup=null,HG.WebApp.Data._CurrentGroupIndex=0,HG.WebApp.Home=HG.WebApp.Home||new function(){var $$=this;$$.About=function(){$("#homegenie_about").popup("open")},$$.UpdateHeaderStatus=function(){$$.UpdateInterfacesStatus()},$$.UpdateInterfacesStatus=function(){var ifaceurl="/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Interfaces.List/";$.ajax({url:ifaceurl,type:"GET",success:function(data){var interfaces=HG.WebApp.Data.Interfaces=eval(data),status="",isupdateavailable=!1;if(interfaces&&"undefined"!=interfaces)for(i=0;i':isupdateavailable=!0}isupdateavailable&&(status+=''),$("#interfaces_status").html(status)}})}},HG.WebApp.Events=HG.WebApp.Events||new function(){var $$=this;$$._eventQueueCapacity=200,$$._ledOffTimeout=null,$$._popupHideTimeout=null,$$._listeners=[],$$.InitializePage=function(){var e=$$.getContainer();e.on("pagebeforeshow",function(){$$.Refresh()}),$$.field("property-txt").change(function(){$$.Refresh()}),$$.field("source-txt").change(function(){$$.Refresh()}),$$.field("domain-txt").change(function(){$$.Refresh()}),setTimeout(function(){$$.Setup()},2e3)},$$.AddListener=function(e){e._eventListenerId=$$._listeners.length+1,$$._listeners.push(e)},$$.RemoveListener=function(e){for(var t=0;t<$$._listeners.length;t++)if($$._listeners[t]._eventListenerId==e._eventListenerId){$$._listeners.splice(t,1);break}},$$._eventSource=null,$$.Setup=function(){var e=$$._eventSource;if(null==e)e=$$._eventSource=new EventSource("/events");else{try{e.close(),e=$$._eventSource=null}catch(t){}setTimeout($$.Setup,1e3),$$.ShowEventPopup({icon:"images/genie.png",title:"HomeGenie
    Event Stream
    Reconnecting...",text:"",timestamp:""})}e.onopen=function(){$$.ShowEventPopup({icon:"images/genie.png",title:"HomeGenie
    Event Stream
    Connected.",text:"",timestamp:""})},e.onerror=function(){$$.ShowEventPopup({icon:"images/genie.png",title:"HomeGenie
    EventStream
    Disconnected!",text:"",timestamp:""}),e.close(),e=$$._eventSource=null,setTimeout($$.Setup,1e3)},e.onmessage=function(e){var t=JSON&&JSON.parse(e.data)||$.parseJSON(e.data);t.Value=t.Value.toString();var o=null;0==("HomeGenie.System"==t.Domain&&"Console.Output"==t.Property)&&(o=HG.WebApp.Utility.GetModuleByDomainAddress(t.Domain,t.Source),null!=o&&(HG.WebApp.Utility.SetModulePropertyByName(o,t.Property,t.Value,t.Timestamp),HG.WebApp.Control.RefreshGroupIndicators()),$$.SendEventToUi(o,t)),"MIGService.Interfaces"==t.Domain&&HG.WebApp.Home.UpdateInterfacesStatus(),HG.WebApp.Store.get("UI.EventsHistory")&&(HG.WebApp.Data.Events.push(t),HG.WebApp.Data.Events.length>$$._eventQueueCapacity&&HG.WebApp.Data.Events.shift(),null!=$$._ledOffTimeout&&clearTimeout($$._ledOffTimeout),$$.field("#event_status_off",!0).hide(),$$.field("#event_status_on",!0).show(),$$._ledOffTimeout=setTimeout(function(){$$._ledOffTimeout=null,$$.field("#event_status_on",!0).hide(),$$.field("#event_status_off",!0).show()},500),$.mobile.activePage.attr("id")==$$.PageId&&$$.Refresh());for(var a=0;a<$$._listeners.length;a++)$$._listeners[a].parameterEventCallback(o,t)}},$$.Refresh=function(){for(var e=($("#"+$$.PageId),""),t=HG.WebApp.Data.Events.length-1;t>=0;t--){var o=HG.WebApp.Data.Events[t],a=$$.field("property-txt").val(),i=$$.field("source-txt").val(),r=$$.field("domain-txt").val();if(!(""!=r&&o.Domain.indexOf(r)<0||""!=i&&o.Source.indexOf(i)<0||""!=a&&o.Property.indexOf(a)<0)){var n=new Date(o.UnixTimestamp),s=HG.WebApp.Utility.FormatDate(n)+" "+HG.WebApp.Utility.FormatDateTime(n);e+="",e+=''+HG.WebApp.Utility.FormatDateTime(n,"sm")+"",e+=""+o.Property+"",e+=""+o.Value+"",e+=""+o.Source+"",e+=""+o.Domain+"",e+=""}}var l=$$.field("events-tbl");l.find("tbody").html(e),l.table().table("refresh")},$$.SendEventToUi=function(module,eventLog){null!=module&&(HG.WebApp.Control.UpdateModuleWidget(eventLog.Domain,eventLog.Source,eventLog.Property,eventLog.Value),$.mobile.activePage.attr("id")==HG.WebApp.WidgetEditor.PageId&&HG.WebApp.WidgetEditor.RenderView(eventLog),("HomeAutomation.HomeGenie.Automation"==module.Domain&&"Program.Status"!=eventLog.Property||"Program.UiRefresh"==eventLog.Property)&&HG.Configure.Modules.Get(module.Domain,module.Address,function(data){try{var mod=eval("["+data+"]")[0],idx=HG.WebApp.Utility.GetModuleIndexByDomainAddress(mod.Domain,mod.Address);HG.WebApp.Data.Modules[idx]=mod,HG.WebApp.Control.UpdateModuleWidget(mod.Domain,mod.Address)}catch(e){}}));var logdate=new Date(eventLog.UnixTimestamp),date=HG.WebApp.Utility.FormatDateTime(logdate),popupdata=null;switch(eventLog.Domain){case"HomeGenie.System":"STARTED"!=eventLog.Value&&"UPDATED"!=eventLog.Value||($$.field("#configure_system_updateinstall_status",!0).html("Update install complete. HomeGenie ready."),setTimeout(function(){document.location.href="/"},3e3));case"HomeGenie.UpdateChecker":if("InstallProgress.Message"==eventLog.Property)$$.field("#configure_system_updateinstall_log",!0).prepend("* "+eventLog.Value+"
    ");else{$$.field("#configure_system_updateinstall_log",!0).prepend("* "+eventLog.Property+"
      "+eventLog.Value+"
    ");var iconImage="images/genie.png";popupdata={icon:iconImage,title:eventLog.Property+"
    "+eventLog.Value,text:"",timestamp:date}}break;case"HomeGenie.PackageInstaller":var log=$$.field("#systemsettings_browserepo",!0).find("[data-ui-field=install_text]"),restore_log=$$.field("#systemsettings_backuprestores1",!0).find("[data-ui-field=restore_log]");if("InstallProgress.Message"==eventLog.Property)log.append("* "+eventLog.Value+"
    "),restore_log.append("* "+eventLog.Value+"
    ");else{log.append("* "+eventLog.Property+"
      "+eventLog.Value+"
    "),restore_log.append("* "+eventLog.Property+"
      "+eventLog.Value+"
    ");var iconImage="images/genie.png";popupdata={icon:iconImage,title:eventLog.Property+"
    "+eventLog.Value,text:"",timestamp:date}}var height=log.parent()[0].scrollHeight;log.parent().scrollTop(height),height=restore_log[0].scrollHeight,restore_log.scrollTop(height);break;case"HomeGenie.BackupRestore":var restore_log=$$.field("#systemsettings_backuprestores1",!0).find("[data-ui-field=restore_log]");restore_log.append("* "+eventLog.Value+"
    ");var height=restore_log[0].scrollHeight;restore_log.scrollTop(height);break;case"HomeAutomation.HomeGenie.Automation":var iconImage=HG.Ui.GetModuleIcon(module,null);if("Runtime.Error"==eventLog.Property)null!=module&&""!=eventLog.Value?(popupdata={icon:iconImage,title:'Program '+module.Address+"
    "+eventLog.Value+"",text:"Runtime
    Error",timestamp:date},"page_automation_editprogram"==$.mobile.activePage.attr("id")&&HG.WebApp.ProgramEdit.RefreshProgramOptions()):null!=module&&HG.WebApp.ProgramEdit._CurrentProgram.Address==module.Address&&(HG.WebApp.ProgramEdit._CurrentProgram.ScriptErrors="",HG.WebApp.ProgramEdit.RefreshProgramEditorTitle());else if("Program.Status"==eventLog.Property)null!=module&&HG.WebApp.ProgramEdit._CurrentProgram.Address==module.Address&&HG.WebApp.ProgramEdit.RefreshProgramEditorTitle();else if("Program.Notification"==eventLog.Property){var notification=JSON.parse(eventLog.Value);popupdata={icon:iconImage,title:''+notification.Title+"
    "+notification.Message,text:"",timestamp:date}}else $$.IsBlacklisted(eventLog.Property)||(popupdata={icon:iconImage,title:''+eventLog.Property+"
    "+eventLog.Value,text:"",timestamp:date});break;case"Protocols.UPnP":case"HomeAutomation.ZWave":if("1"==eventLog.Source){var domain=eventLog.Domain.substr(eventLog.Domain.lastIndexOf(".")+1);popupdata={icon:"images/genie.png",title:''+domain+" "+eventLog.Property+"
    "+eventLog.Value,text:"",timestamp:date};break}default:if(null!=module&&!$$.IsBlacklisted(eventLog.Property)){var iconImage=HG.Ui.GetModuleIcon(module,null);if("RF"!=module.Address&&"IR"!=module.Address||""==eventLog.Value){if("Sensor."==eventLog.Property.substring(0,7)){var group=HG.WebApp.GroupsList.GetModuleGroup(module);null!=group&&(group=group.Name);var name=module.Domain.substring(module.Domain.indexOf(".")+1)+" "+module.Address,propname=eventLog.Property.substring(eventLog.Property.indexOf(".")+1);switch(propname){case"Temperature":iconImage="pages/control/widgets/homegenie/generic/images/temperature.png";var temperature=eventLog.Value.replace(",",".");eventLog.Value=HG.WebApp.Utility.FormatTemperature(temperature);break;case"Luminance":iconImage="pages/control/widgets/homegenie/generic/images/luminance.png";break;default:iconImage="pages/control/widgets/homegenie/generic/images/sensor.png"}""!=module.Name&&(name=module.Name),null==group&&(group=""),popupdata={icon:iconImage,title:''+group+"
    "+name+"
    "+propname,text:parseFloat(eventLog.Value.replace(",",".")).toFixed(2),timestamp:date}}else if("Status."==eventLog.Property.substring(0,7)){var group=HG.WebApp.GroupsList.GetModuleGroup(module);null!=group&&(group=group.Name);var name=module.Domain.substring(module.Domain.indexOf(".")+1)+" "+module.Address,propname=eventLog.Property.substring(eventLog.Property.indexOf(".")+1),value=eventLog.Value;isNaN(eventLog.Value.replace(",","."))||(value=parseFloat(eventLog.Value.replace(",",".")).toFixed(2)),""!=module.Name&&(name=module.Name),null==group&&(group=""),popupdata={icon:iconImage,title:''+group+"
    "+name+"",text:propname+"
    "+value,timestamp:date}}}else iconImage="images/remote.png",popupdata={icon:iconImage,title:''+module.Domain.substring(module.Domain.indexOf(".")+1)+"
    "+eventLog.Value,text:module.Address,timestamp:date};if(HG.WebApp.ProgramEdit._IsCapturingConditions&&""!=eventLog.Value){var conditionobj={Domain:module.Domain,Target:module.Address,Property:eventLog.Property,ComparisonOperator:"Equals",ComparisonValue:eventLog.Value};HG.WebApp.ProgramEdit._CurrentProgram.Conditions.push(conditionobj),automationpage_ConditionsRefresh()}else if(HG.WebApp.ProgramEdit._IsCapturingCommands&&""!=eventLog.Value){var command=HG.WebApp.Utility.GetCommandFromEvent(module,eventLog);null!=command&&(HG.WebApp.ProgramEdit._CurrentProgram.Commands.push(command),automationpage_CommandsRefresh())}}}null!=popupdata&&!$$.PopupHasIgnore(eventLog.Domain,eventLog.Source,eventLog.Property)&&eventLog.Description.indexOf(":nopopup:")<0&&!$$.IsBlacklisted(eventLog.Property)&&$$.ShowEventPopup(popupdata,eventLog)},$$.IsBlacklisted=function(e){return!("Meter.Watts"!=e&&!e.startsWith("ConfigureOptions.")&&"Program.UiRefresh"!=e)},$$.PopupRefreshIgnore=function(){var e=HG.WebApp.Store.get("UI.EventPopupIgnore");if(null!=e){$$.field("#popupsettings_ignorelist",!0).find("li:gt(0)").remove();for(var t=0;t',o+='
    '+e[t].Domain+"
    ",o+='
    '+e[t].Address+"
    ",o+='
    '+e[t].Property+"
    ",o+=" ",o+="",$$.field("#popupsettings_ignorelist",!0).append(o)}$$.field("#popupsettings_ignorelist",!0).listview().trigger("create"),$$.field("#popupsettings_ignorelist",!0).listview("refresh")}},$$.PopupHasIgnore=function(e,t,o){var a=HG.WebApp.Store.get("UI.EventPopupIgnore");if(null==a)return!1;for(var i=!1,r=0;r',o+='',o+=e.title,o+=''+e.text+"",o+=''+e.timestamp+"",t&&(o+='Block popup from this source'),o+="",o+="";var a=$$.field("#statuspopup",!0);a.html(o),null!=$$._popupHideTimeout?clearTimeout($$._popupHideTimeout):(a.css("display",""),a.animate({opacity:"0"},0,function(){a.animate({right:"5px",opacity:"0.90"},300)})),$$._popupHideTimeout=setTimeout(function(){"none"!=a.css("display")&&a.animate({right:"-300px",opacity:"0.0"},300,function(){a.css("display","none")}),$$._popupHideTimeout=null},5e3)}},HG.Ui.CreatePage(HG.WebApp.Events,"page_events"),HG.WebApp.Control=HG.WebApp.Control||new function(){var $$=this;$$._widgetConfiguration=[],$$._widgetList=[],$$._renderModuleDelay=null,$$._renderModuleBusy=!1,$$.InitializePage=function(){var page=$$.getContainer();page.on("pageinit",function(e){$$.toolbarMacroRecord=$("#toolbar_macrorecord"),$$.toolbarMacroRecord.hide(),$$.toolbarControl=$("#toolbar_control"),$$.toolbarControl.show(),$$.recordDelayNone=$("#macrorecord_delay_none"),$$.recordDelayMimic=$("#macrorecord_delay_mimic"),$$.recordDelayFixed=$("#macrorecord_delay_fixed"),$("#control_macrorecord_optionspopup").bind("popupafterclose",function(){$$.recordDelayNone.prop("checked")?HG.Automation.Macro.SetDelay("None",""):$$.recordDelayMimic.prop("checked")?HG.Automation.Macro.SetDelay("Mimic",""):$$.recordDelayFixed.prop("checked")&&HG.Automation.Macro.SetDelay("Fixed",$$.field("#macrorecord_delay_seconds",!0).val())}),$$.controlGroupSelect=$("#control_groupselect"),$$.controlGroupSelect.change(function(){var e=$$.controlGroupSelect.val();$$.ShowGroup(e)}),$.ajax({url:"pages/control/widgets/configuration.json",type:"GET",success:function(data){$$._widgetConfiguration=eval(data)},error:function(){alert("error loading widgets configuration")}})}),page.on("pagehide",function(){widgetsloadtimer&&clearTimeout(widgetsloadtimer),null!=$$._renderModuleDelay&&clearTimeout($$._renderModuleDelay),$$._renderModuleBusy=!1,widgetsloadqueue=[],$$.field('div[data-ui-field="wallpaper"]',!0).hide()}),page.on("pagebeforeshow",function(){$$.clearCache(),$.mobile.loading("show"),HG.Configure.Groups.List("Control",function(){0==$$.field("#control_groupslist",!0).children().length&&$$.RenderGroups(),$$.UpdateModules()}),HG.Automation.Macro.GetDelay(function(e){$$.recordDelayNone.prop("checked",!1).checkboxradio("refresh"),$$.recordDelayMimic.prop("checked",!1).checkboxradio("refresh"), +$$.recordDelayFixed.prop("checked",!1).checkboxradio("refresh"),$$.field("#macrorecord_delay_"+e.DelayType.toLowerCase(),!0).prop("checked",!0).checkboxradio("refresh"),$$.field("#macrorecord_delay_seconds",!0).val(e.DelayOptions)})}),$$.field("#control_bottombar_voice_button",!0).on("click",function(){var e=$(this),t=$$.field("#speechinput",!0);"none"==t.css("display")?(e.removeClass("ui-icon-carat-u"),e.addClass("ui-icon-carat-d"),t.show(150),t.find("input").focus()):(e.removeClass("ui-icon-carat-d"),e.addClass("ui-icon-carat-u"),t.hide(150),t.find("input").blur()),setTimeout(function(){e.removeClass("ui-btn-active")},200)}),$$.field("#voicerecognition_text",!0).on("change",function(){HG.VoiceControl.InterpretInput($(this).val())}).on("keyup",function(e){13==e.keyCode&&HG.VoiceControl.InterpretInput($(this).val())}),$$.field("#groups_panel",!0).panel().trigger("create"),$$.field("#groups_panel",!0).on("beforeopen",function(){setTimeout($$.RenderMenu,1e3)})},$$.ShowGroup=function(e){$.mobile.loading("show"),HG.WebApp.Data._CurrentGroup=HG.WebApp.GroupModules.CurrentGroup=HG.WebApp.Data.Groups[e].Name,HG.WebApp.Data._CurrentGroupIndex=e,$$.field('div[data-ui-field="wallpaper"]',!0).show(),$$.field('div[data-ui-field="wallpaper"]',!0).css("background-image","url(images/wallpapers/"+HG.WebApp.Data.Groups[e].Wallpaper+")"),$$.RefreshGroupIndicators(),$$.field("#control_groupcontent",!0).children("div").hide(),$$.field("#groupdiv_modules_"+HG.WebApp.Data._CurrentGroupIndex,!0).show(),setTimeout(function(){$$.RenderGroupModules(e)},100)},$$.UpdateModules=function(){$.mobile.loading("show"),HG.Configure.Modules.List(function(e){try{HG.WebApp.Data.Modules=e}catch(t){}HG.Automation.Programs.List(function(){$.mobile.loading("hide"),$$.ShowGroup(HG.WebApp.Data._CurrentGroupIndex)})})},$$.ConfigureGroup=function(){HG.WebApp.GroupsList.ConfigureGroup(HG.WebApp.Data._CurrentGroupIndex)},$$.RecordMacroStart=function(){$$.field("#control_actionmenu",!0).popup("close"),HG.Automation.Macro.Record(),$$.toolbarControl.hide("slidedown"),setTimeout(function(){$$.toolbarMacroRecord.show("slideup")},500),$$.field("#btn_control_macrorecord",!0).qtip({content:{title:HG.WebApp.Locales.GetLocaleString("control_macrorecord_recording"),text:HG.WebApp.Locales.GetLocaleString("control_macrorecord_description"),button:HG.WebApp.Locales.GetLocaleString("control_macrorecord_close")},show:{event:!1,ready:!0,delay:1500},events:{hide:function(){$(this).qtip("destroy")}},hide:{event:!1,inactive:5e3},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{my:"bottom center",at:"top center"}})},$$.RecordMacroSave=function(e){$.mobile.loading("show"),HG.Automation.Macro.Save(e,function(e){HG.Automation.Programs.List(function(){HG.WebApp.AutomationGroupsList._CurrentGroup="",HG.WebApp.ProgramEdit._CurrentProgram.Address=e,HG.Configure.Groups.List("Automation",function(){HG.WebApp.ProgramsList.EditProgram(),$.mobile.changePage($$.field("#page_automation_editprogram",!0),{transition:"fade",changeHash:!0}),$.mobile.loading("hide")})})}),$$.toolbarControl.show("slideup"),$$.toolbarMacroRecord.hide("slidedown")},$$.RecordMacroDiscard=function(){HG.Automation.Macro.Discard(),$$.toolbarControl.show("slideup"),$$.toolbarMacroRecord.hide("slidedown")},$$.RenderMenu=function(){for($$.field("#control_groupsmenu",!0).find("li:gt(0)").remove(),i=0;i
    ',t=$('
  • '+HG.WebApp.Data.Groups[i].Name+""+e+"
  • ");t.on("click",function(){var e=$(this).attr("data-context-idx");$$.ShowGroup(e),$.mobile.pageContainer.pagecontainer("change","#page_control",{transition:"none"})}),$$.field("#control_groupsmenu",!0).append(t)}$$.field("#control_groupsmenu",!0).listview().listview("refresh")},$$.RenderGroups=function(){for($.each($$.field("#control_groupcontent",!0).find("div[class=isotope]"),function(){$(this).isotope("destroy")}),$$.field("#control_groupcontent",!0).empty(),i=0;i')},$$.GetWidget=function(e,t){for(var o=!1,a=0;a<$$._widgetList.length;a++)if($$._widgetList[a].Widget==e){if(o=!0,"function"==typeof t){var i=$$._widgetList[a],r=HG.WebApp.WidgetEditor.GetInstance(i.Json);t({Widget:i.Widget,Instance:r,Json:i.Json,Model:i.Model})}break}""==e||o?o||"function"==typeof t&&t(null):$.ajax({url:"pages/control/widgets/"+e+".js",type:"GET",dataType:"text",success:function(o){var a=null,i=o;$.get("pages/control/widgets/"+e+".html",function(o){var r={Widget:e,Instance:null,Json:i,Model:o};$$._widgetList.push(r);try{a=HG.WebApp.WidgetEditor.GetInstance(i)}catch(n){alert(e+" Loading Error:\n"+n)}"function"==typeof t&&t({Widget:e,Instance:a,Json:i,Model:o})})},error:function(e){console.log(e),"function"==typeof t&&t(null)}})};var widgetsloadqueue=[],widgetsloadtimer=null;$$.RenderModule=function(){if(clearTimeout(widgetsloadtimer),widgetsloadqueue.length>0){var t=widgetsloadqueue.splice(0,1)[0],o=$$.field("#"+t.ElementId,!0).data("homegenie.widget");if(null!=o&&"undefined"!=o)HG.WebApp.WidgetEditor.RenderWidget("#"+t.ElementId,o,o.module),widgetsloadtimer=setTimeout(function(){$$.RenderModule()},10);else{var a='
    ",t.GroupElement.append(a),t.GroupElement.trigger("create"),null!=o.Json){var i=HG.WebApp.WidgetEditor.GetInstance(o.Json);$$.field("#"+t.ElementId,!0).data("homegenie.widget",i),t.Module.WidgetInstance=i,HG.WebApp.Locales.LocalizeWidget(t.Module.Widget,t.ElementId,function(){$$.field("#"+t.ElementId,!0).show();var e=t.Module;HG.WebApp.WidgetEditor.RenderWidget("#"+t.ElementId,e.WidgetInstance,e),widgetsloadtimer=setTimeout(function(){$$.RenderModule()},0)})}else alert(t.Module.Widget+" Widget Instance Error:\n"+e),widgetsloadtimer=setTimeout(function(){$$.RenderModule()},0);else console.log(t.Module.Widget+" Widget Error."),widgetsloadtimer=setTimeout(function(){$$.RenderModule()},0)})}}else $$._renderModuleBusy=!1,$$.field("#groupdiv_modules_"+HG.WebApp.Data._CurrentGroupIndex,!0).isotope({itemSelector:".freewall",layoutMode:"fitRows"}).isotope().addClass("isotope"),$$.UpdateActionsMenu(),$.mobile.loading("hide")},$$.EditModule=function(e){HG.WebApp.GroupModules.CurrentGroup=HG.WebApp.Data._CurrentGroup,HG.WebApp.GroupModules.CurrentModule=e;var t=e.DeviceType;HG.WebApp.GroupModules.ModuleEdit(function(){if(t!=e.DeviceType){var o=$$.field("#groupdiv_modules_"+HG.WebApp.Data._CurrentGroupIndex,!0);o.empty(),$$.ShowGroup(HG.WebApp.Data._CurrentGroupIndex)}else $$.UpdateModuleWidget(e.Domain,e.Address)})},$$.EditModuleParams=function(e){HG.WebApp.GroupModules.CurrentGroup=HG.WebApp.Data._CurrentGroup,HG.WebApp.GroupModules.CurrentModule=e,$$.field("#page_configure_groupmodules_propspopup",!0).popup("open",{transition:"pop",positionTo:"window"})},$$.GetModuleUid=function(e){var t=e.Domain.substring(e.Domain.lastIndexOf(".")+1).replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~() ]/g,"_"),o=e.Address.replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~() ]/g,"_"),a=t+"_"+o;return a},$$.UpdateActionsMenu=function(){$$.field("#control_custom_actionmenu",!0).empty();for(var e=0;e"+HG.WebApp.Locales.GetProgramLocaleString(a.Address,"Title",a.Name)+"")}$$.field("#control_custom_actionmenu",!0).listview("refresh")},$$.UpdateModuleWidget=function(e,t,o,a){for(var i=0;i0||$$._renderModuleBusy)return null!=$$._renderModuleDelay&&clearTimeout($$._renderModuleDelay),void($$._renderModuleDelay=setTimeout(function(){$$.RenderGroupModules(e)},500));$$._renderModuleBusy=!0,$$._renderModuleDelay=null;for(var t=HG.Configure.Groups.GetGroupModules(HG.WebApp.Data.Groups[e].Name),o=$$.field("#groupdiv_modules_"+t.Index,!0),a=0;a0&&(b+=''+(1e3*o).toFixed(1)+""),i>0&&(b+=''+i+""),a>0&&(b+=''+a+""),null!=r&&(displayvalue=HG.WebApp.Utility.FormatTemperature(r),b+=''+displayvalue+""),null!=s&&(b+=''+(1*s).toFixed(0)+""),null!=n&&(b+=''+(1*n).toFixed(0)+""),$$.field("#control_groupindicators_"+e,!0).html(b),e==HG.WebApp.Data._CurrentGroupIndex&&($$.field("#control_groupmenutitle",!0).html(HG.WebApp.Data.Groups[e].Name),$$.field("#control_groupindicators",!0).html(b))}},$$.LoadGroups=function(){$.mobile.loading("show"),HG.Configure.Groups.List("Control",function(){$$.RenderGroups()})}},HG.Ui.CreatePage(HG.WebApp.Control,"page_control"),HG.WebApp.Statistics=HG.WebApp.Statistics||new function(){var $$=this;$$._CurrentTab=1,$$._InitDateFromTo=4,$$._CurrentModule="",$$._CurrentParameter="Meter.Watts",$$._CurrentGraphType="bars",$$._CurrentType="hours",$$._RefreshIntervalObject=null,$$._RefreshInterval=3e5,$$._SelItemObject=!1,$$._ItemObject="",$$.InitializePage=function(){$("#page_analyze_source").on("change",function(){var e=$(this).find("option:selected"),t=e.attr("data-context-domain")+":"+e.attr("data-context-address");":"==t&&(t=""),$$.RefreshParameters(t)}),$("#page_analyze_param").on("change",function(){$$.RefreshModules()}),$("#page_analyze_renderbutton").bind("click",function(){var e=$("#page_analyze_source").find("option:selected");$$._CurrentModule=e.attr("data-context-domain")+":"+e.attr("data-context-address"),":"==$$._CurrentModule&&($$._CurrentModule=""),$$._CurrentParameter=$("#page_analyze_param").val(),$$._CurrentType=$("#page_analyze_type").val(),"Meter."==$$._CurrentParameter.substring(0,6)||"PowerMonitor."==$$._CurrentParameter.substring(0,13)?$("#statistics_tab3_button").show():$("#statistics_tab3_button").hide(),$$.SetTab(1),$("#page_analyze_title").html($("#page_analyze_source").find("option:selected").text()+" - "+$("#page_analyze_param").find("option:selected").text()),$("#page_analyze_title2").html($("#page_analyze_title").val()),$("#analyze_stats_options").popup("close")}),$("#page_analyze_costperunit").on("change",function(){var e=$("#page_analyze_costperunit").val()*$("#page_analyze_totalunits").val();$("#page_analyze_totalcost").val(e.toFixed(2)),HG.WebApp.Store.set("UI.Statistics.CostPerUnit",$("#page_analyze_costperunit").val())}),$("#analyze_stats_options").on("popupbeforeposition",function(){$$.RefreshModules(),$$.RefreshParameters()}),$("#page_analyze_datefrom").val(""),$("#page_analyze_datefrom").on("change",function(){0==$$._InitDateFromTo?$$.Refresh():$$._InitDateFromTo-=1}),$("#page_analyze_dateto").val(""),$("#page_analyze_dateto").on("change",function(){0==$$._InitDateFromTo?$$.Refresh():$$._InitDateFromTo-=1}),$("#statshour").qtip({id:"flot",prerender:!0,content:" ",position:{target:"mouse",viewport:$("#flot"),adjust:{x:5}},show:!1,hide:{event:!1,fixed:!0}}),$("#statshour").bind("plothover",function(e,t,o){var a,i=$(this),r=i.qtip();if(!o)return r.cache.point=!1,r.hide(o);if(a=r.cache.point,a!==o.dataIndex){var n=60*(new Date).getTimezoneOffset()*1e3;r.cache.point=o.dataIndex,r.set("content.text",o.series.label+" at "+new Date(o.datapoint[0]+n).toLocaleTimeString()+" = "+o.datapoint[1].toFixed(2)),"days"==$$._CurrentType?0==$$._SelItemObject&&($("#page_delete_stat").html("Delete Value : "+o.datapoint[1]),$$._ItemObject=o.datapoint[0]+"/"+o.datapoint[1],r.elements.tooltip.stop(1,1),r.show(o)):(r.elements.tooltip.stop(1,1),r.show(o))}}),$("#statscounter").qtip({id:"flot",prerender:!0,content:" ",position:{target:"mouse",viewport:$("#flot"),adjust:{x:5}},show:!1,hide:{event:!1,fixed:!0}}),$("#statscounter").bind("plothover",function(e,t,o){var a,i=$(this),r=i.qtip();if(!o)return r.cache.point=!1,r.hide(o);if(a=r.cache.point,a!==o.dataIndex){var n=60*(new Date).getTimezoneOffset()*1e3;r.cache.point=o.dataIndex,r.set("content.text",o.series.label+" at "+new Date(o.datapoint[0]+n).toLocaleTimeString()+" = "+o.datapoint[1].toFixed(2)),r.elements.tooltip.stop(1,1),r.show(o)}}),$("#page_delete_stat").on("click",function(){1==$$._SelItemObject&&($.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Statistics/Parameter.StatDelete/"+$$._ItemObject,type:"GET",success:function(data){var stats=eval(data);$.mobile.loading("hide")},error:function(e){console.log("STATISTICS ERROR: "+e.status+":"+e.statusText),$.mobile.loading("hide")}}),$$._ItemObject=""),$$._SelItemObject=!1,$("#page_delete_stat").hide()}),$("#statshour").on("click",function(){0==$$._SelItemObject?""!=$$._ItemObject&&($$._SelItemObject=!0,$("#page_delete_stat").show()):($$._ItemObject="",$$._SelItemObject=!1,$("#page_delete_stat").hide())})},$$.SetTab=function(e){$$._CurrentTab=e,$("#statistics_tab1").hide(),$("#statistics_tab2").hide(),$("#statistics_tab1_button").removeClass("ui-btn-active"),$("#statistics_tab2_button").removeClass("ui-btn-active"),$("#statistics_tab"+e).show(),$("#statistics_tab"+e+"_button").addClass("ui-btn-active"),$$.Refresh()},$$.SetAutoRefresh=function(e){null!=$$._RefreshIntervalObject&&clearInterval($$._RefreshIntervalObject),$$._RefreshIntervalObject=null,e&&($$._RefreshIntervalObject=setInterval("HG.WebApp.Statistics.Refresh();",$$._RefreshInterval))},$$.InitConfiguration=function(){$("#page_analyze_costperunit").val(HG.WebApp.Store.get("UI.Statistics.CostPerUnit")?HG.WebApp.Store.get("UI.Statistics.CostPerUnit"):22e-5),HG.Statistics.ServiceCall("Configuration.Get","","",function(e){var t=1*e.StatisticsUIRefreshSeconds;$$._RefreshInterval=1e3*t,$$.SetAutoRefresh(!0),$$.SetTab(1)})},$$.RefreshParameters=function(e){var t=$("#page_analyze_param").val();""==t&&(t="Meter.Watts"),$("#page_analyze_param").empty(),HG.Statistics.ServiceCall("Parameter.List",e,"",function(e){for(var o=0;o0&&(a=a.substring(a.indexOf(".")+1)),$("#page_analyze_param").append('")}$("#page_analyze_param").selectmenu("refresh")})},$$.RefreshModules=function(){var e=$("#page_analyze_source").find("option:selected"),t=e.attr("data-context-domain"),o=e.attr("data-context-address");$("#page_analyze_source").empty(),$("#page_analyze_source").append('');var a="All"==t;$("#page_analyze_source").append('");for(var i="",r=0;r"+c+"";break}}""!=l&&(i+='',i+=l,i+="")}$("#page_analyze_source").append(i),$("#page_analyze_source").selectmenu("refresh")},$$.Refresh=function(){$.mobile.loading("show");var showsplines="splines"==$$._CurrentGraphType,showlines="lines"==$$._CurrentGraphType,showbars="bars"==$$._CurrentGraphType,showtype="hours"==$$._CurrentType;if(1==$$._CurrentTab)0==$$._SelItemObject&&$("#page_delete_stat").hide(),HG.Statistics.ServiceCall("Global.TimeRange","","",function(trange){var start=new Date(parseFloat(trange.StartTime)),end=new Date(parseFloat(trange.EndTime)),today=new Date,minDays=Math.ceil((today-start)/864e5);$("#page_analyze_datefrom").datebox("option",{minDays:minDays,maxDays:0,useLang:HG.WebApp.Utility.GetDateBoxLocale()}).datebox("refresh"),$("#page_analyze_dateto").datebox("option",{minDays:minDays,maxDays:0,useLang:HG.WebApp.Utility.GetDateBoxLocale()}).datebox("refresh"),""==$("#page_analyze_datefrom").val()&&($("#page_analyze_datefrom").datebox("setTheDate",today),$("#page_analyze_datefrom").trigger("datebox",{method:"doset"})),""==$("#page_analyze_dateto").val()&&($("#page_analyze_dateto").datebox("setTheDate",today),$("#page_analyze_dateto").trigger("datebox",{method:"doset"}));var dfrom=new Date($("#page_analyze_datefrom").datebox("getTheDate").getTime()),dto=new Date($("#page_analyze_dateto").datebox("getTheDate").getTime());if(dfrom.setHours(0,0,0,0),dto.setHours(23,59,59,0),"All:"!=$$._CurrentModule)1==showtype?$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Statistics/Parameter.StatsHour/"+$$._CurrentParameter+"/"+$$._CurrentModule+"/"+dfrom.getTime()+"/"+dto.getTime(),type:"GET",success:function(data){var stats=eval(data);try{if("Sensor.Temperature"==$$._CurrentParameter)for(var sx=0;sx";for(i=0;i',t+=''+o.Name+"",t+=''+a+"",t+='
    ',t+=""}e.groupList.append(t),e.groupList.listview().listview("refresh"),e.groupList.sortable({handle:".handle",axis:"y",scrollSpeed:10}).sortable("refresh"),e.groupList.on("sortstop",function(){e.SortGroups()}),e.groupList.find("li").bind("click",function(){e.ConfigureGroup($(this).attr("data-group-index"))})},e.ConfigureGroup=function(t){e.groupList.attr("selected-group-name",HG.WebApp.Data.Groups[t].Name),e.groupList.attr("selected-group-index",t),$.mobile.changePage($("#page_configure_groupmodules"),{transition:"fade",changeHash:!0})},e.GetModuleGroup=function(e){for(var t=null,o=0;o=0&&(t+=e+";",$(this).attr("data-module-index",o),o++)}),e.groupList.empty(),$.mobile.loading("show"),HG.Configure.Groups.Sort("Control",t,function(){$.mobile.loading("hide"),e.LoadGroups()})},e.SaveGroups=function(t){$.mobile.loading("show"),$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.Save/",data:JSON.stringify(HG.WebApp.Data.Groups),success:function(){e.groupList.empty(),HG.WebApp.GroupModules.LoadGroupModules(),$.mobile.loading("hide"),null!=t&&t()},error:function(){$.mobile.loading("hide")}})}},HG.WebApp.GroupModules=HG.WebApp.GroupModules||new function(){var e=this;e.CurrentGroup="(none)",e.CurrentModule=null,e.CurrentModuleProperty=null,e.EditModule=[],e.SeparatorItemDomain="HomeGenie.UI.Separator",e.InitializePage=function(){var t=e.getContainer();t.on("pageinit",function(){e.field("#module_add_button",!0).on("click",function(){var t=e.field("#automation_group_moduleadd",!0).find(":selected"),o=t.attr("data-context-domain"),a=t.attr("data-context-value");e.AddGroupModule(e.CurrentGroup,o,a,function(){var t=e.field("#page_configure_groupmodules_list",!0).find("ul"),o=t.find("li").last();t.parent().animate({scrollTop:o.position().top})})}),e.field("#group_delete_button",!0).on("click",function(){e.DeleteGroup(e.CurrentGroup)}),e.field("#btn_configure_group_deletegroup",!0).on("click",function(){HG.Ui.SwitchPopup("#listmodules_actionmenu","#automation_group_delete")}),e.field("#btn_configure_group_addmodule",!0).on("click",function(){HG.Ui.SwitchPopup("#listmodules_actionmenu","#automation_group_modulechoose")}),e.field("#btn_configure_group_addseparator",!0).on("click",function(){e.EditModule.Domain="",e.EditModule.Address="",HG.Ui.SwitchPopup("#listmodules_actionmenu","#automation_group_separator_edit")}),e.field("#btn_configure_group_editseparatoradd",!0).on("click",function(){var t=e.field("#automation_group_separatorlabel",!0).val().trim();""!=t&&e.AddGroupModule(e.CurrentGroup,e.SeparatorItemDomain,t,function(){var t=e.field("#page_configure_groupmodules_list",!0).find("ul li").last();e.field("#page_configure_groupmodules_list",!0).find("ul").parent().animate({scrollTop:t.position().top},"slow")})}),e.field("#automation_group_separator_edit",!0).on("popupbeforeposition",function(){""!=e.EditModule.Address?(e.field("#automation_group_separatorlabel",!0).val(e.EditModule.Address),e.field("#automation_group_separatorlabel",!0).addClass("ui-disabled"),e.field("#btn_configure_group_editseparatoradd",!0).hide()):(e.field("#automation_group_separatorlabel",!0).val(""),e.field("#automation_group_separatorlabel",!0).removeClass("ui-disabled"),e.field("#btn_configure_group_editseparatoradd",!0).show())}),e.field("#automation_group_modulechoose",!0).on("popupbeforeposition",function(){var t=$("#automation_group_moduleadd");t.empty(),t.append(e.GetModulesListViewItems(e.CurrentGroup)),t.selectmenu("refresh")}),e.field("#automation_group_module_propdelete",!0).on("click",function(){null!=e.CurrentModuleProperty&&(e.ModulePropertyDelete(e.CurrentModuleProperty.find("input[type=text]").first().val()),e.CurrentModuleProperty.remove(),e.CurrentModuleProperty=null)});var t=e.field("#groupmodules_groupname",!0);t.change(function(){HG.Configure.Groups.RenameGroup("Control",e.CurrentGroup,t.val(),function(){e.CurrentGroup=t.val(),e.field("#configure_groupslist",!0).attr("selected-group-name",t.val()),$.mobile.loading("show"),HG.Configure.Modules.List(function(e){try{HG.WebApp.Data.Modules=e; +}catch(t){}HG.Automation.Programs.List(function(){HG.WebApp.GroupsList.LoadGroups(),$.mobile.loading("hide")})})})}),e.field("#groupmodules_groupwall",!0).on("change",function(){""==$(this).val()?e.field("#configure_group_wallpaper",!0).css("background-image",""):e.field("#configure_group_wallpaper",!0).css("background-image","url(images/wallpapers/"+$(this).val()+")"),HG.Configure.Groups.WallpaperSet(e.CurrentGroup,$(this).val(),function(){})}),e.field("#groupmodules_group_deletebtn",!0).on("click",function(){$.mobile.loading("show"),HG.Configure.Groups.WallpaperDelete(e.field("#groupmodules_groupwall",!0).val(),function(){var t=HG.Configure.Groups.GetGroupByName(e.CurrentGroup);t.Wallpaper="",e.RefreshWallpaper(),$.mobile.loading("hide")})}),e.field("#groupmodules_group_uploadbtn",!0).on("click",function(){e.field("#groupmodules_group_uploadfile",!0).click()}),e.wallpaper=e.field("#configure_group_wallpaper",!0)}),t.on("pagebeforeshow",function(){e.field("#page_configure_groupmodules_list",!0).find("ul").parent().animate({scrollTop:0}),e.LoadGroupModules(),$.mobile.loading("show"),e.RefreshWallpaper()}),e.field("#groupmodules_group_uploadfile",!0).fileupload({url:"/api/HomeAutomation.HomeGenie/Config/Groups.WallpaperAdd",replaceFileInput:!1,dropZone:$("[data-upload-dropzone=wallpaper]"),progressall:function(e,t){var o=parseInt(t.loaded/t.total*100,10);$.mobile.loading("show",{text:"Saving background... "+o+"%",textVisible:!0,theme:"a",html:""})},start:function(){$.mobile.loading("show",{text:"Saving background...",textVisible:!0,theme:"a",html:""})},fail:function(){$.mobile.loading("hide")},done:function(t,o){var a=o.result.ResponseValue;e.field("#configure_group_wallpaper",!0).css("background-image","url(images/wallpapers/"+a+")"),HG.Configure.Groups.WallpaperSet(e.CurrentGroup,a,function(){var t=HG.Configure.Groups.GetGroupByName(e.CurrentGroup);t.Wallpaper=a,"page_control"==$.mobile.activePage.attr("id")?e.field('div[data-ui-field="wallpaper"]',!0).css("background-image","url(images/wallpapers/"+a+")"):e.RefreshWallpaper(),$.mobile.loading("hide")})}})},e.RefreshWallpaper=function(){var t=HG.Configure.Groups.GetGroupByName(e.CurrentGroup);e.wallpaper.css("background-image","url(images/wallpapers/"+t.Wallpaper+")"),e.wallpaper.css("background-size","164px 92px"),e.field("#groupmodules_groupwall",!0).find("option:gt(0)").remove(),HG.Configure.Groups.WallpaperList(function(o){$.each(o,function(o,a){var i=t.Wallpaper==a?" selected":"";e.field("#groupmodules_groupwall",!0).append('")}),e.field("#groupmodules_groupwall",!0).selectmenu("refresh"),$.mobile.loading("hide")})},e.SetModuleIcon=function(t){var o=$(t).attr("src");e.field("#module_icon",!0).attr("src",o),HG.WebApp.Utility.SetModulePropertyByName(e.EditModule,"Widget.DisplayIcon",o);var a=HG.WebApp.Utility.GetModulePropertyByName(e.EditModule,"Widget.DisplayIcon");a.NeedsUpdate="true",e.field("#configure_module_iconslist",!0).hide(200)},e.ModuleIconsToggle=function(){"program"!=e.EditModule.DeviceType.toLowerCase()&&("none"!=e.field("#configure_module_iconslist",!0).css("display")?e.field("#configure_module_iconslist",!0).hide(200):e.field("#configure_module_iconslist",!0).show(200))},e.SortModules=function(){var t="";e.field("#page_configure_groupmodules_list",!0).find("ul").children("li").each(function(){var e=$(this).attr("data-module-index");e>=0&&(t+=e+";")}),$.mobile.loading("show"),HG.Configure.Groups.SortModules("Control",e.CurrentGroup,t,function(){HG.Configure.Groups.List("Control",function(){e.LoadGroupModules(),$.mobile.loading("hide")})})},e.ModulePropertyDelete=function(t){for(var o=e.CurrentModule,a=0;a
    ',i+='
    ',i+=" ",i+=" ",e.field("#automation_group_module_params",!0).append(i)}t.trigger("create"),t.listview().listview("refresh"),t.find("input").focus(function(){var t=$(this).closest("div").parent().parent().parent();"#E6E6FA"!=t.css("background")&&($(this).attr("originalbackground",t.css("background")),t.css("background","#E6E6FA"),setTimeout("$('#automation_group_module_propdelete').removeClass('ui-disabled')",500),e.CurrentModuleProperty=t)}),e.field("#automation_group_module_params input",!0).blur(function(){$(this).closest("div").parent().parent().parent().css("background",$(this).attr("originalbackground")),setTimeout("$('#automation_group_module_propdelete').addClass('ui-disabled')",250)})},e.GetModulesListViewItems=function(e){var t=HG.Configure.Groups.GetGroupModules(e),o="",a="";if(HG.WebApp.Data.Modules&&HG.WebApp.Data.Modules.length)for(m=0;m');var c=""!=i.Name?i.Name:""!=i.Description?i.Description:i.DeviceType;c+=" ("+i.Address+")",o+='"}}return o},e.AddGroupModule=function(e,t,o,a){var r=!1,n=-1;for(i=0;i',o+=' '+t.Modules[a].Address+"",o+='",o+="";else{var r="module_icon_image_"+a,n="pages/control/widgets/homegenie/generic/images/unknown.png";o+='
  • ',o+="",o+='',o+='",o+='",o+="
    '+t.Modules[a].Name+"
    '+i+" "+t.Modules[a].Address+"
    ",o+="
    ",o+='",o+="
  • "}}e.field("#page_configure_groupmodules_list",!0).find("ul").append(o),e.field("#page_configure_groupmodules_list",!0).find("ul").listview().listview("refresh"),e.field("#page_configure_groupmodules_list",!0).find("ul").sortable({handle:".handle",axis:"y",scrollSpeed:10}),e.field("#page_configure_groupmodules_list",!0).find("ul").on("sortstop",function(){e.SortModules()});for(var a=0;a0?e.EditModule.WMWatts:"0"),e.UpdateFeatures(),e.field("#automation_group_module_edit",!0).popup("open",{transition:"pop",positionTo:"window"})},e.ShowFeatures=function(t){e.field("#module_programs_features",!0).empty();var o=HG.WebApp.Locales.GetProgramLocaleString(HG.WebApp.Data.Programs[t].Address,"Description",HG.WebApp.Data.Programs[t].Description);e.field("#module_programs_featuredesc",!0).html(o);for(var a=null,i=0;i0?o=e.split(","):e.indexOf("|")>0&&(o=e.split("|"));var a=[];$.each(o,function(e,t){return 0==t.trim().indexOf("!")?(o.splice(e,1),a.push(t.trim().substring(1))):""==t.trim()&&o.splice(e,1),!0});var i=0==o.length;return $.each(o,function(e,o){return o.trim()==t.trim()?(i=!0,!1):!0}),$.each(a,function(e,o){return o.trim()==t.trim()?(i=!1,!1):!0}),i},e.UpdateFeatures=function(){e.EditModule.Properties=Array(),e.field("#module_options_features",!0).hide(),e.field("#module_programs_featureset",!0).empty(),e.field("#module_programs_features",!0).empty();for(var t="",o=-1,a=0;a0)for(var n=0;ni){var u=HG.WebApp.Data.Programs[a].Address,c=HG.WebApp.Data.Programs[a].Name;""==c&&(c=u),c=HG.WebApp.Locales.GetProgramLocaleString(u,"Title",c),t+='",i=a,0>o&&(o=a)}}}}}""!=t&&(e.field("#module_programs_featureset",!0).append(t),e.field("#module_programs_featureset",!0).selectmenu("refresh",!0),e.field("#module_options_features",!0).show(),-1!=o&&e.ShowFeatures(o)),e.field("#automation_group_module_edit",!0).popup("reposition",{positionTo:"window"})},e.FeatureUpdate=function(e,t){var o=(e.program,e.module),a=e.parameter.Name;HG.WebApp.Utility.GetModulePropertyByName(o,a);HG.WebApp.Utility.SetModulePropertyByName(o,a,t)},e.ShowModuleOptions=function(t,o){var a=HG.WebApp.Utility.GetModuleByDomainAddress(t,o);if(null!=a)switch(a.Domain){case"HomeAutomation.ZWave":HG.Ext.ZWave.NodeSetup.Show(a),$.mobile.changePage(e.field("#configurepage_OptionZWave",!0),{transition:"fade",changeHash:!0});break;default:alert("No options page available for this module.")}}},HG.Ui.CreatePage(HG.WebApp.GroupModules,"page_configure_groupmodules"),HG.WebApp.SystemSettings=HG.WebApp.SystemSettings||new function(){var e=this;e.PageId="page_configure_interfaces",e.Interfaces=e.Interfaces||{},e.InitializePage=function(){var t=$("#"+e.PageId),o=t.find("[data-ui-field=import-popup]"),a=t.find("[data-ui-field=interface_install]"),i=t.find("[data-ui-field=import-form]"),r=t.find("[data-ui-field=download-btn]"),n=t.find("[data-ui-field=download-url]"),s=t.find("[data-ui-field=upload-btn]"),l=t.find("[data-ui-field=upload-file]"),d=t.find("[data-ui-field=upload-frame]");t.on("pageinit",function(){o.popup()}),t.on("pagebeforeshow",function(){HG.Automation.Programs.List(function(){HG.Configure.Groups.List("Automation",function(){e.ListInterfaces()})})}),t.on("pageshow",function(){t.find("[data-locale-id=configure_program_bbaractions]").qtip({content:{text:HG.WebApp.Locales.GetLocaleString("configure_system_installtip_description","Go to the Package Manager to install additional features.")},show:{event:!1,ready:!0,delay:1e3},events:{hide:function(){$(this).qtip("destroy")}},hide:{event:!1,inactive:3e3},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{my:"bottom center",at:"top center"}})}),o.on("popupafteropen",function(){a.removeClass("ui-btn-active")}),a.on("click",function(){setTimeout(function(){o.popup("open")},500)}),r.on("click",function(){""==n.val()?(alert("Insert add-on package URL"),n.parent().stop().animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250).animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250)):(o.popup("close"),setTimeout(function(){$.mobile.loading("show",{text:"Downloading, please wait...",textVisible:!0,html:""}),$.get("/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Interface.Import/"+encodeURIComponent(n.val()),function(){$.mobile.loading("hide"),n.val("");var t=$.parseJSON(arguments[2].responseText);e.AddonInstall(t.ResponseValue)})},1e3))}),s.on("click",function(){""==l.val()?(alert("Select a file to import first"),l.parent().stop().animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250).animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250)):(o.popup("close"),$.mobile.loading("show",{text:"Uploading, please wait...",textVisible:!0,html:""}),i.submit())}),d.bind("load",function(){$.mobile.loading("hide"),l.val("");var t=d[0].contentWindow.document.body;if("undefined"!=typeof t&&""!=t&&(t.textContent||t.innerText))try{t=$.parseJSON(t.textContent||t.innerText),e.AddonInstall(t.ResponseValue)}catch(o){}})},e.AddonInstall=function(t){var o=/(https?:\/\/[^\s]+)/g;t=t.replace(o,'$1'),HG.WebApp.Utility.ConfirmPopup(HG.WebApp.Locales.GetLocaleString("systemsettings_addonsinstall_title","Install add-on?"),"
    "+t+"
    ",function(t){t&&($.mobile.loading("show",{text:"Installing, please wait...",textVisible:!0,html:""}),$.get("/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Interface.Install",function(){e.ListInterfaces(),$.mobile.loading("hide")}))})},e.ListInterfaces=function(){var t=$("#"+e.PageId),o=t.find("[data-ui-field=interface_list]");HG.Configure.Interfaces.ListConfig(function(t){o.empty(),o.append("

    Interfaces (MIG)

    "),$.each(t,function(t,a){var i=a.Domain,r=i.substring(i.lastIndexOf(".")+1),n=$('
    '),s=$('

    '+r+'

    ');n.append(s);var l=$("

    ");n.append(l),l.load("pages/configure/interfaces/configlet/"+r.toLowerCase()+".html",function(){var t=r;e.Interfaces[i].Localize&&(e.Interfaces[i].Localize(),t=HG.WebApp.Locales.GetLocaleString("title",r,e.Interfaces[i].Locale)),s.find("[data-ui-field=title]").html(t),s.attr("description",a.Description),null!=a.Description&&""!=a.Description.trim()&&s.qtip({content:{text:a.Description},show:{event:"mouseover",ready:!1,delay:500},hide:{event:"mouseout"},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{my:"bottom center",at:"top center"}}),l.trigger("create"),e.Interfaces[i].Initialize()}),o.append(n)}),o.append("

    Automation Program Plugins

    "),$.each(HG.WebApp.Data.AutomationGroups,function(e,t){var a=!0;$.each(HG.WebApp.Data.Programs,function(e,i){if(i.IsEnabled&&i.Group==t.Name){var r=HG.WebApp.Utility.GetModuleByDomainAddress("HomeAutomation.HomeGenie.Automation",i.Address);if(null!=r){for(var n=!1,s=0;s"+t.Name+""),a=!1);var l=HG.WebApp.Locales.GetProgramLocaleString(i.Address,"Title",i.Name),d="undefined"!=i.Description&&null!=i.Description?i.Description:"";d=HG.WebApp.Locales.GetProgramLocaleString(i.Address,"Description",d).replace(/\n/g,"
    ");var p=$('
    '),u=$('

    '+l+"

    ");p.append(u);var c='",p.append(c),p.find('[data-ui-field="options_button"]').on("click",function(){HG.WebApp.ProgramEdit._CurrentProgram.Domain=r.Domain,HG.WebApp.ProgramEdit._CurrentProgram.Address=r.Address,HG.WebApp.ProgramsList.UpdateOptionsPopup()}),o.append(p)}}}})}),o.trigger("create")})},e.GetInterface=function(e){var t=null,o=HG.WebApp.Data.Interfaces;if(o&&"undefined"!=o)for(i=0;iChecking for updates..."),$.mobile.loading("show"),HG.System.UpdateManager.UpdateCheck(function(){$.mobile.loading("hide"),e.LoadUpdateCheckSettings()})}),$("#configure_system_updatemanager_manualbutton").on("click",function(){""==$("#updatemanager_updatefile_uploadfile").val()?(alert("Select a .tgz release file to install first"),$("#updatemanager_updatefile_uploadfile").parent().stop().animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250).animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250)):($.mobile.loading("show"),$("#configure_system_updatemanager_manualbutton").addClass("ui-disabled"),$.mobile.loading("show",{text:"Processing release file, please wait...",textVisible:!0,theme:"a",html:""}),$("#configure_system_updateinstall_log").html(),$("#systemsettings_updateinstall_popup").popup("open"),$("#updatemanager_updatefile_form").submit())}),$("#updatemanager_updatefile_uploadframe").bind("load",function(){""!=$("#updatemanager_updatefile_uploadfile").val()&&($("#configure_system_updatemanager_manualbutton").removeClass("ui-disabled"),$.mobile.loading("hide"),$("#systemsettings_updateinstall_popup").popup("close"))}),$("#configure_system_updateinstall_button").bind("click",function(){$("#configure_system_updateinstall_button").addClass("ui-disabled"),$("#configure_system_updatemanager_info").html("Installing updates..."),$("#configure_system_updateinstall_status").html("Installing files..."),$.mobile.loading("show",{text:"Please wait...",textVisible:!0,html:""}),HG.System.UpdateManager.InstallUpdate(function(t){"OK"==t.ResponseValue?($("#configure_system_updateinstall_status").html("Update install complete."),setTimeout(function(){window.location.replace("/")},3e3)):"RESTART"==t.ResponseValue?$("#configure_system_updateinstall_status").html("Installing files... (HomeGenie service stopped)"):"ERROR"==t.ResponseValue&&($("#configure_system_updateinstall_status").html("Error during installation progress."),$.mobile.loading("hide"),e.LoadUpdateCheckSettings())})}),$("#configure_system_updatemanager_proceedbutton").bind("click",function(){$("#configure_system_updateinstall_button").addClass("ui-disabled"),$("#configure_system_updatemanager_info").html("Downloading files..."),$("#configure_system_updateinstall_log").empty(),HG.Ui.SwitchPopup("#systemsettings_updatewarning_popup","#systemsettings_updateinstall_popup",!0),$("#configure_system_updateinstall_status").html("Downloading files..."),$.mobile.loading("show",{text:"Please wait...",textVisible:!0,html:""}),HG.System.UpdateManager.DownloadUpdate(function(t){$.mobile.loading("hide"),e.LoadUpdateCheckSettings(),"OK"==t.ResponseValue?($("#configure_system_updateinstall_status").html("Update files ready."),$("#configure_system_updateinstall_button").removeClass("ui-disabled")):"RESTART"==t.ResponseValue?($("#configure_system_updateinstall_status").html("Update files ready. HomeGenie will be restarted after updating."),$("#configure_system_updateinstall_button").removeClass("ui-disabled")):"ERROR"==t.ResponseValue&&($("#configure_system_updateinstall_status").html("Error while downloading update files."),$("#configure_system_updateinstall_button").addClass("ui-disabled"))})}),$("#securitysettings_password_change").bind("click",function(){var t=$("#securitysettings_user_password").val();$.mobile.loading("show"),HG.System.SetPassword(t,function(){$.mobile.loading("hide"),setTimeout(function(){e.LoadHttpSettings()},1e3)})}),$("#securitysettings_password_clear").bind("click",function(){$.mobile.loading("show"),HG.System.ClearPassword(function(){$.mobile.loading("hide"),e.LoadHttpSettings()})}),$("#btn_configuresystem_downloadtday").bind("click",function(){window.open("/api/HomeAutomation.HomeGenie/Config/System.Configure/SystemLogging.DownloadCsv/0")}),$("#btn_configuresystem_downloadyday").bind("click",function(){window.open("/api/HomeAutomation.HomeGenie/Config/System.Configure/SystemLogging.DownloadCsv/1")}),$("#maintenance_configuration_restartproceedbutton").bind("click",function(){$("#maintenance_configuration_restartbutton").addClass("ui-disabled"), +$.mobile.loading("show",{text:"Restarting service, please wait...",textVisible:!0,theme:"a",html:""}),HG.Configure.System.ServiceCall("Service.Restart",function(){})}),$("#maintenance_configuration_backupbutton").bind("click",function(){}),$("#maintenance_configuration_restorebutton").bind("click",function(){""==$("#restore_configuration_uploadfile").val()?(alert("Select a file to restore first"),$("#restore_configuration_uploadfile").parent().stop().animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250).animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250)):($("#systemsettings_backuprestores1cancelbutton").removeClass("ui-disabled"),$("#systemsettings_backuprestores1confirmbutton").removeClass("ui-disabled"),$.mobile.loading("show",{text:"Restoring backup, please wait...",textVisible:!0,theme:"a",html:""}),$("#restore_configuration_form").submit())}),$("#maintenance_configuration_factoryresetbutton").bind("click",function(){$.mobile.loading("show",{text:"Resetting to factory defaults, please wait...",textVisible:!0,theme:"a",html:""}),HG.Configure.System.ServiceCall("System.ConfigurationReset",function(){setTimeout(function(){$.mobile.loading("hide"),window.location.replace("/")},3e3)})}),$("#systemsettings_backuprestores1selectallbtn").bind("click",function(){""!=e.RestoreProgramList?(e.RestoreProgramList="",$("#systemsettings_backuprestores1plist div").attr("data-checked","false").find("i").addClass("fa-square-o").removeClass("fa-check-square")):(e.RestoreProgramList="",$("#systemsettings_backuprestores1plist div").each(function(){$(this).attr("data-checked","true").find("i").removeClass("fa-square-o").addClass("fa-check-square"),e.RestoreProgramList+=","+$(this).attr("data-program")+","}))}),$("#maintenance_configuration_backupbutton").bind("click",function(){window.open(location.protocol+"../../api/HomeAutomation.HomeGenie/Config/System.Configure/System.ConfigurationBackup")}),$("#restore_configuration_uploadframe").bind("load",function(){""!=$("#restore_configuration_uploadfile").val()&&(HG.Configure.System.ServiceCall("System.ConfigurationRestoreS1",function(t){$.mobile.loading("hide"),$("#systemsettings_backuprestores1plist").empty();var o=t;if(0==o.length)$("#systemsettings_backuprestores1plist").append("

    No user's program found in this backup.

    "),$("#systemsettings_backuprestores1selectallbtn").addClass("ui-disabled");else{for(var a=0;a '+o[a].Address+" "+o[a].Name+"");i.on("click",function(){"true"==$(this).attr("data-checked")?($(this).find("i").addClass("fa-square-o"),$(this).find("i").removeClass("fa-check-square"),$(this).attr("data-checked","false"),e.RestoreProgramList=e.RestoreProgramList.replace(","+$(this).attr("data-program")+",","")):($(this).find("i").removeClass("fa-square-o"),$(this).find("i").addClass("fa-check-square"),$(this).attr("data-checked","true"),e.RestoreProgramList+=","+$(this).attr("data-program")+",")}),$("#systemsettings_backuprestores1plist").append(i)}$("#systemsettings_backuprestores1selectallbtn").removeClass("ui-disabled")}$("#systemsettings_backuprestores1plist").scrollTop(0),$("#systemsettings_backuprestores1").find("[data-ui-field=restore_log]").empty(),$("#systemsettings_backuprestores1").find("[data-ui-field=restore_log]").hide(),$("#systemsettings_backuprestores1").find("[data-ui-field=user-programs]").show(),$("#systemsettings_backuprestores1").popup("open")}),$("#systemsettings_backuprestores1confirmbutton").bind("click",function(){$("#systemsettings_backuprestores1cancelbutton").addClass("ui-disabled"),$("#systemsettings_backuprestores1confirmbutton").addClass("ui-disabled"),$("#systemsettings_backuprestores1").find("[data-ui-field=restore_log]").show(),$("#systemsettings_backuprestores1").find("[data-ui-field=user-programs]").hide(),$.mobile.loading("show",{text:"Please be patient, this may take some time...",textVisible:!0,theme:"a",html:""}),HG.Configure.System.ServiceCall("System.ConfigurationRestoreS2/"+e.RestoreProgramList,function(){$.mobile.loading("hide"),window.location.replace("/")})}))}),$("#systemsettings_modulesdelete").on("popupbeforeposition",function(){e.RefreshModulesList()}),$("#configure_interfaces_modules_list").on("click","li",function(){$.mobile.loading("show");var t=$(this).attr("data-context-domain"),o=$(this).attr("data-context-address");HG.Configure.Modules.Delete(t,o,function(){for(var a=-1,i=0;i500&&(a.parent().parent().css("width",o),a.parent().parent().css("max-width",o)),a.css("height",e/2),a.css("max-height",e/2);var i=t.find("[data-ui-field=browser_text]");i.css("height",e/2),i.css("max-height",e/2)}).on("popupafteropen",function(){e.BrowseRoot()}),t.find("[data-ui-field=parent_folder]").on("click",function(){var t=e.BrowseRepository,o=e._BrowserHistory;o.length>1&&(o.pop(),t(o.pop()))}),t.find("[data-ui-field=install_package]").on("click",function(){t.find("[data-ui-field=install_text]").empty(),t.find("[data-ui-field=install_package]").addClass("ui-disabled"),$.mobile.loading("show"),$.get("/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Package.Install/"+encodeURIComponent(e._BrowserPackage),function(){t.find("[data-ui-field=install_package]").removeClass("ui-disabled"),$.mobile.loading("hide")})}),t.find("[data-ui-field=repository_browse]").on("click",function(){e.BrowseRoot()})})},e._BrowserHistory=[],e._BrowserPackage="",e.BrowseRoot=function(){e._BrowserHistory=[];var t=$("#"+e.PageId);e.BrowseRepository({url:t.find("[data-ui-field=repository_url]").val()+"/packages",name:""})},e.BrowseRepository=function(t){var o=$("#"+e.PageId),a=o.find("[data-ui-field=repository_files]"),i=o.find("[data-ui-field=description_text]"),r=o.find("[data-ui-field=package_info]"),n=o.find("[id=systemsettings_browserepo]"),s=e.BrowseRepository,l=e._BrowserHistory;l.push(t),l.length>1?o.find("[data-ui-field=parent_folder]").show():o.find("[data-ui-field=parent_folder]").hide(),o.find("[data-ui-field=install_package]").hide(),o.find("[data-ui-field=install_text]").empty(),i.html(""),r.hide();var d="";$.each(l,function(e,t){d+=""+t.name+" / "}),o.find("[data-ui-field=browser_path]").html(d),a.empty(),$.mobile.loading("show"),$.get(t.url,function(t){$.each(t,function(t,n){if("dir"==n.type){var l=$('
  • '+n.name+"
  • ");a.append(l),l.on("click",function(){s({url:n.url,name:n.name})})}else"package.json"==n.name.toLowerCase()?(e._BrowserPackage=n.download_url.substring(0,n.download_url.lastIndexOf("/")),$.get(n.download_url,function(t){t=$.parseJSON(t);var i=""+t.title+"";i+="
    Version: "+t.version,i+="
    Author: "+t.author,i+="
    Files: ",i+=t.programs.length+" automation programs, ",i+=t.widgets.length+" ui widgets, ",i+=t.interfaces.length+" mig interfaces",i+="
    Published: "+t.published,"undefined"!=typeof t.sourcecode&&""!=t.sourcecode&&(i+='
    Source Code'),"undefined"!=typeof t.homepage&&""!=t.homepage&&(i+='
    Forum Thread'),r.html(i+"
    "),r.show(),o.find("[data-ui-field=browser_text]").scrollTop(0),$.get("/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Package.Get/"+encodeURIComponent(e._BrowserPackage),function(e){"undefined"!=typeof e.install_date&&r.append("
    Installed: "+e.install_date)}),$.each(t.programs,function(e,t){var o=$('
  • '+t.description+" ("+t.file+")
  • ");a.append(o)}),$.each(t.widgets,function(e,t){var o=$('
  • '+t.description+" ("+t.file+")
  • ");a.append(o)}),$.each(t.interfaces,function(e,t){var o=$('
  • '+t.description+" ("+t.file+")
  • ");a.append(o)})}),o.find("[data-ui-field=install_package]").show()):n.name.toLowerCase().endsWith(".md")?$.get(n.download_url,function(e){i.html(marked(e)),o.find("[data-ui-field=browser_text]").scrollTop(0)}):"file"==n.type}),a.listview().listview("refresh"),setTimeout(function(){n.popup().popup("reposition",{positionTo:"window"}),$.mobile.loading("hide")},300)})},e.LoadSettings=function(){$.mobile.loading("show"),e.LoadUpdateCheckSettings(),HG.System.LoggingIsEnabled(function(e){$("#configure_system_flip_logging").val(e).slider("refresh"),$.mobile.loading("hide")}),e.LoadHttpSettings(),e.LoadStatisticsSettings(),$("#configure_system_flip_eventshistory").val(HG.WebApp.Store.get("UI.EventsHistory")?"1":"0").slider("refresh");var t=HG.WebApp.Store.get("UI.TemperatureUnit");$("#tempunit-celsius").prop("checked",!1),$("#tempunit-fahrenheit").prop("checked",!1),"F"!=t?$("#tempunit-celsius").prop("checked",!0):$("#tempunit-fahrenheit").prop("checked",!0),$("input[name='tempunit-choice']").checkboxradio("refresh");var o=HG.WebApp.Store.get("UI.DateFormat");$("#dateformat-dmy").prop("checked",!1),$("#dateformat-mdy").prop("checked",!1),"MDY12"!=o?$("#dateformat-dmy").prop("checked",!0):$("#dateformat-mdy").prop("checked",!0),$("input[name='dateformat-choice']").checkboxradio("refresh")},e.LoadUpdateCheckSettings=function(){$.mobile.loading("show"),$("#configure_system_updateinstall_button").addClass("ui-disabled"),HG.System.UpdateManager.GetUpdateList(function(e){if(0==e.length)$("#configure_system_updatemanager_info").html(HG.WebApp.Locales.GetLocaleString("configure_system_updatemanager_no_updates")),$("#configure_system_updatemanager_detailsscroll").hide(),$("#configure_system_updatemanager_installbutton").hide();else{$("#configure_system_updatemanager_info").html(HG.WebApp.Locales.GetLocaleString("configure_system_updatemanager_updates_available"));for(var t="
    ",o=0;o"+a.Name+" "+a.Version+"\n",t+="   "+a.ReleaseNote+"\n"}t+="
    ",$("#configure_system_updatemanager_details").html(t),$("#configure_system_updatemanager_detailsscroll").show(),$("#configure_system_updatemanager_installbutton").show()}$.mobile.loading("hide")})},e.LoadHttpSettings=function(){$.mobile.loading("show"),HG.System.HasPassword(function(e){var t="1"==e.ResponseValue?"on":"off";$("#securitysettings_password_image").attr("src","images/protection-"+t+".png"),HG.System.WebCacheIsEnabled(function(e){$("#configure_system_flip_httpcache").val("true"==e?"1":"0").slider("refresh"),$.mobile.loading("hide")}),HG.Configure.System.ServiceCall("HttpService.GetPort",function(e){$("#http_service_port").val(e),$("#systemsettings_httpport_text").html(e),$.mobile.loading("hide")}),HG.Configure.System.ServiceCall("HttpService.GetHostHeader",function(e){$("#http_host_header").val(e),$("#systemsettings_hostheader_text").html(e),$.mobile.loading("hide")})})},e.LoadStatisticsSettings=function(){$.mobile.loading("show"),HG.Configure.System.ServiceCall("Statistics.GetStatisticsDatabaseMaximumSize",function(e){$("#systemsettings_databasemaxsizechange_size").val(e),$("#systemsettings_databasemaxsize_text").html(e),$.mobile.loading("hide")})},e.RefreshModulesList=function(){$("#configure_interfaces_modules_list").empty();for(var e="",t=0;t",{"data-role":"list-divider"}).append(o.Domain)),e=o.Domain),$("#configure_interfaces_modules_list").append($("
  • ",{"data-icon":"minus","data-context-domain":o.Domain,"data-context-address":o.Address}).append($("",{text:o.Address+" "+o.Name}))))}e="";for(var t=0;t",{"data-role":"list-divider"}).append(o.Domain)),e=o.Domain),$("#configure_interfaces_modules_list").append($("
  • ",{"data-icon":"minus","data-context-domain":o.Domain,"data-context-address":o.Address}).append($("",{text:o.Address+" "+o.Name}))))}$("#configure_interfaces_modules_list").listview("refresh")}},HG.WebApp.AutomationGroupsList=HG.WebApp.AutomationGroupsList||new function(){var e=this;e.PageId="page_configure_automationgroups",e._CurrentGroup="",e.InitializePage=function(){var t=$("#"+e.PageId),o=t.find("[data-ui-field=widgeteditor-btn]");e.groupList=$("#configure_automationgroupslist"),t.on("pageinit",function(){t.find("[id=automationgroup_add]").on("popupbeforeposition",function(){t.find("[id=automationgroup_new_name]").val("")}),t.find("[id=automationgroup_new_button]").bind("click",function(){e.GroupsAdd($("#automationgroup_new_name").val())}),o.bind("click",function(){$.mobile.pageContainer.pagecontainer("change","#"+HG.WebApp.WidgetsList.PageId,{transition:"slide"})}),$.mobile.loading("show"),HG.Configure.Groups.List("Automation",function(){e.GetGroupsListViewItems(),$.mobile.loading("hide")})}),t.on("pagebeforeshow",function(){HG.Automation.Programs.List(function(){e.LoadGroups()})})},e.LoadGroups=function(){$.mobile.loading("show"),HG.Configure.Groups.List("Automation",function(){e.GetGroupsListViewItems(),$.mobile.loading("hide")})},e.GetGroupsListViewItems=function(){e.groupList.hasClass("ui-sortable")&&(e.groupList.sortable("destroy"),e.groupList.off("sortstop")),e.groupList.empty();for(var t=HG.WebApp.SystemSettings.GetInterface("HomeAutomation.ZWave"),o=HG.WebApp.SystemSettings.GetInterface("HomeAutomation.Insteon"),a=HG.WebApp.SystemSettings.GetInterface("HomeAutomation.X10"),i=HG.WebApp.SystemSettings.GetInterface("HomeAutomation.W800RF"),r=0,n=' style="display:none"',s='
  • '+HG.WebApp.Locales.GetLocaleString("configure_grouplist")+"
  • ";r',s+=''+l+"",s+=''+u+"",s+='
    ',s+=""}for(u=0,p=0;p0&&(s+='
  • Ungrouped'+u+"
  • "),e.groupList.append(s),e.groupList.listview().listview("refresh"),e.groupList.sortable({handle:".handle",axis:"y",scrollSpeed:10}).sortable("refresh"),e.groupList.on("sortstop",function(){e.SortGroups()}),e.groupList.find("li").on("click",function(){e._CurrentGroup=$(this).attr("data-group-name"),e.groupList.attr("selected-group-name",$(this).attr("data-group-name")),e.groupList.attr("selected-group-index",$(this).attr("data-group-index"))})},e.GetGroupModules=function(e){for(var t={Index:0,Name:e,Modules:Array()},o=0;o=0&&(t+=e+";")}),HG.Configure.Groups.Sort("Automation",t,function(){e.LoadGroups()})},e.SaveGroups=function(){$.mobile.loading("show"),$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Config/Groups.Save/Automation/",data:JSON.stringify(HG.WebApp.Data.AutomationGroups),success:function(){$("#control_automationgroupslist").empty(),$.mobile.loading("hide")},error:function(){$.mobile.loading("hide")}})}};var editor1=null,editor2=null,editor3=null;HG.WebApp.ProgramsList=HG.WebApp.ProgramsList||new function(){var e=this;e.PageId="page_automation_programs",e.InitializePage=function(){var t=$("#"+e.PageId);t.on("pageinit",function(){$("#automation_program_add").on("popupbeforeposition",function(){$("#program_new_name").val("")}),$("#btn_automationprograms_group_delete").bind("click",function(){HG.Ui.SwitchPopup("#listprograms_actionmenu","#automationprograms_group_delete")}),$("#btn_automation_program_import").bind("click",function(){HG.Ui.SwitchPopup("#listprograms_actionmenu","#automation_program_import")}),$("#btn_automation_program_add").bind("click",function(){HG.Ui.SwitchPopup("#listprograms_actionmenu","#automation_program_add")}),$("#btn_automation_program_refresh").bind("click",function(){$("#listprograms_actionmenu").popup("close"),e.LoadPrograms(null)}),$("#automationprograms_delete_button").bind("click",function(){e.DeleteGroup(HG.WebApp.AutomationGroupsList._CurrentGroup)}),$("#program_new_button").bind("click",function(){e.AddProgram($("#program_new_name").val())}),$("#program_switchtypecancel_button").bind("click",function(){$("#automation_programtype").val(HG.WebApp.ProgramEdit._CurrentProgram.Type),$("#automation_programtype").selectmenu("refresh")}),$("#program_switchtype_button").bind("click",function(){HG.WebApp.ProgramEdit._CurrentProgram.Type=$("#automation_programtype").select().val(),e.SetProgramType()}),$("#automationprograms_program_edit").bind("click",function(){e.EditProgram()}),$("#automationprograms_program_delete_button").bind("click",function(){e.DeleteProgram(HG.WebApp.ProgramEdit._CurrentProgram.Address)}),$("#program_import_button").bind("click",function(){""==$("#program_import_uploadfile").val()?(alert("Select a file to import first"),$("#program_import_uploadfile").parent().stop().animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250).animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250)):($("#automation_program_import").popup("close"),$.mobile.loading("show",{text:"Importing, please wait...",textVisible:!0,html:""}),$("#program_import_form").attr("action","/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Import/"+HG.WebApp.AutomationGroupsList._CurrentGroup),$("#program_import_form").submit())}),$("#program_import_uploadframe").bind("load",function(){$("#program_import_uploadfile").val(""),$.mobile.loading("hide"),e.LoadPrograms(null)})}),t.on("pagebeforeshow",function(){e.LoadPrograms()})},e._CurrentOptionsTab=0,e.SetOptionsTab=function(t){e._CurrentOptionsTab=t,$("#automationprograms_program_options_tab0 a").removeClass("ui-btn-active"),$("#automationprograms_program_options_tab0 a").trigger("create"),$("#automationprograms_program_options_tab1 a").removeClass("ui-btn-active"),$("#automationprograms_program_options_tab1 a").trigger("create"),0==t?(e.RefreshProgramOptions(),$("#automationprograms_program_details").hide(),$("#automationprograms_program_parameters").show()):(e.RefreshProgramDetails(),$("#automationprograms_program_parameters").hide(),$("#automationprograms_program_details").show()),setTimeout(function(){$("#automationprograms_program_options_tab"+t+" a").addClass("ui-btn-active"),$("#automationprograms_program_options_tab"+t+" a").trigger("create"),setTimeout(function(){$("#automationprograms_program_options").popup("reposition",{positionTo:"window"})},200)},200)},e.RefreshProgramDetails=function(){var e=$("#automationprograms_program_details");e.empty(),e.trigger("create");var t=HG.WebApp.Utility.GetProgramByAddress(HG.WebApp.ProgramEdit._CurrentProgram.Address);if(null!=t){for(var o="",a=t.Features,i=0;i

    '+a[i].Property+" : ",o+=""+HG.WebApp.Locales.GetProgramLocaleString(t.Address,a[i].Property,a[i].Description)+"
    ";var r=a[i].ForDomains;""==r&&(r="Any");var n=a[i].ForTypes;""==n&&(n="Any"),o+='Applies to:     Domain'+r+"     Type"+n+"

    "}""!=o&&(o='
    • '+HG.WebApp.Locales.GetLocaleString("configure_program_details_implemfeatures")+"
    • "+o+"

    ",e.append(o))}var s=HG.WebApp.Utility.GetModuleByDomainAddress(HG.WebApp.ProgramEdit._CurrentProgram.Domain,HG.WebApp.ProgramEdit._CurrentProgram.Address);if(null!=s){o="";for(var l=0;l=0&&(d="password");var u=s.Properties[l].UpdateTime;u=u.replace(" ","T");var c=new Date(u);o+='
  • '+s.Properties[l].Name.substring(17)+" = ",o+='"'+("password"==d?"*****":s.Properties[l].Value)+'"
    ',o+=''+c+"

  • "}""!=o&&(o='
    • '+HG.WebApp.Locales.GetLocaleString("configure_program_details_configoptions")+"
    • "+o+"

    ",e.append(o))}if(null!=s){for(var o="",l=0;l = ",o+='"'+s.Properties[l].Value+'"
    ',o+=''+c+"

    "}""!=o&&(o='
    • '+HG.WebApp.Locales.GetLocaleString("configure_program_details_moduleparams")+"
    • "+o+"

    ",e.append(o));HG.WebApp.Utility.GetModulePropertyByName(s,"Widget.DisplayModule")}var o="";if(HG.WebApp.Data.Modules&&HG.WebApp.Data.Modules.length)for(m=0;m

    '+g.Domain+" "+g.Address+"",o+="
    ",o+=' ',o+="Type"+g.DeviceType+"    ",""!=g.Name&&(o+="Name"+g.Name+"    "),o+="

    ")}""!=o&&(o='
    • Virtual Modules
    • '+o+"

    ",e.append(o)),e.trigger("create")},e.RefreshProgramOptions=function(){var e=$("#automationprograms_program_parameters");e.empty(),e.trigger("create");var t=HG.WebApp.Utility.GetProgramByAddress(HG.WebApp.ProgramEdit._CurrentProgram.Address);if(null!=t){$("#automationprograms_program_title").html(HG.WebApp.Locales.GetProgramLocaleString(t.Address,"Title",t.Name));var o="undefined"!=t.Description&&null!=t.Description?t.Description:"";o=HG.WebApp.Locales.GetProgramLocaleString(t.Address,"Description",o),$("#automationprograms_program_description").html(o.replace(/\n/g,"
    "))}var a=HG.WebApp.Utility.GetModuleByDomainAddress(HG.WebApp.ProgramEdit._CurrentProgram.Domain,HG.WebApp.ProgramEdit._CurrentProgram.Address);if(null!=a){for(var i=Array(),r=0;re?-1:e>t?1:0});for(var r=0;r=0&&(n="password");var s=$('

    '+HG.WebApp.Locales.GetProgramLocaleString(t.Address,i[r].Name,o)+"

    "),l=$('');l.val(i[r].Value),s.append(l),e.append(s)}}e.trigger("create")},e.UpdateProgramParameter=function(e){for(var t=e.attr("data-parameter-name"),o=HG.WebApp.Utility.GetModuleByDomainAddress(HG.WebApp.ProgramEdit._CurrentProgram.Domain,HG.WebApp.ProgramEdit._CurrentProgram.Address),a=0;a'+t+"
    "+HG.WebApp.AutomationGroupsList._CurrentGroup),$("#configure_programslist").empty(),$("#configure_programslist").append('
  • '+HG.WebApp.Locales.GetLocaleString("configure_programslist_listtitle")+"
  • "),i=0;i';n+='';var s=e.GetProgramStatusColor(o),l="";if(null!=o.TriggerTime){var d=moment(o.TriggerTime);l=d.format("L LT")}var p=null!=o.Description?o.Description:"";p=HG.WebApp.Locales.GetProgramLocaleString(o.Address,"Description",p),n+='

    '+o.Type+"    PID: "+o.Address+'
    '+l+"

    ",n+='

    '+r+"

    ",n+='

    '+p+"  

    ",n+="
    ",n+=""+(o.IsEnabled?HG.WebApp.Locales.GetLocaleString("configure_programslist_tap_disable"):HG.WebApp.Locales.GetLocaleString("configure_programslist_tap_enable"))+"",n+="",$("#configure_programslist").append(n)}}$("#configure_programslist").listview(),$("#configure_programslist").listview("refresh"),$("#configure_programslist li a").bind("click",function(){HG.WebApp.ProgramEdit._CurrentProgram.Domain=$(this).attr("data-program-domain"),HG.WebApp.ProgramEdit._CurrentProgram.Address=$(this).attr("data-program-address"),e.UpdateOptionsPopup()})},e.UpdateOptionsPopup=function(){HG.WebApp.ProgramEdit._CurrentProgram.Domain&&HG.WebApp.ProgramEdit._CurrentProgram.Address&&($.mobile.activePage.attr("id")!=e.PageId?($("#automationprograms_program_edit").hide(),$("#automationprograms_program_btn_delete").hide()):($("#automationprograms_program_edit").show(),$("#automationprograms_program_btn_delete").show()),$.mobile.loading("show",{text:HG.WebApp.Locales.GetLocaleString("update_options_popup_loading"),textVisible:!0,theme:"a",html:""}),HG.Automation.Programs.List(function(){HG.Configure.Modules.List(function(t){try{HG.WebApp.Data.Modules=t}catch(o){}e.RefreshProgramOptions(),e.RefreshProgramDetails();var a=!0;""==$("#automationprograms_program_details").text().trim()?($("#automationprograms_program_options_tab1").css("visibility","hidden"),a=!1):$("#automationprograms_program_options_tab1").css("visibility",""),""==$("#automationprograms_program_parameters").text().trim()?($("#automationprograms_program_options_tab0").css("visibility","hidden"),a?e.SetOptionsTab(1):($("#automationprograms_program_parameters").hide(),$("#automationprograms_program_details").hide())):($("#automationprograms_program_options_tab0").css("visibility",""),e.SetOptionsTab(0)),$("#automationprograms_program_details").scrollTop(0),$("#automationprograms_program_parameters").scrollTop(0),$("#automationprograms_program_options").popup("open",{transition:"slidedown"}),$.mobile.loading("hide")})}))},e.GetProgramByAddress=function(e){var t=null;for(i=0;i(select program group)');for(var t=0;t'+HG.WebApp.Data.AutomationGroups[t].Name+"");for($("#automation_programgroup").trigger("create"),t=0;t'+i+"")}}$("#automation_conditiontarget").listview("refresh")}),$("#automation_condition_value_domain").on("popupbeforeposition",function(){$("#automation_conditionvalue_domain").empty();for(var e=Array(),t=0;t'+i+"")}}$("#automation_conditionvalue_domain").listview("refresh")}),$("#automation_command_domain_popup").on("popupbeforeposition",function(){$("#automation_commandtarget li:gt(1)").remove();for(var e=Array(),t=0;t'+i+"")}}$("#automation_commandtarget").listview("refresh")}),$("#automation_program_listfiles").on("popupbeforeposition",function(){$$.SketchFileList()}),$("#automation_program_sketchfiles_add").bind("click",function(){$("#programfile_new_name").val(""),HG.Ui.SwitchPopup("#automation_program_listfiles","#automation_program_fileadd",!0)}),$("#programfile_new_button").bind("click",function(){$("#automation_program_fileadd").popup("close");var e=$("#programfile_new_name").val();$.mobile.loading("show",{text:"Adding file "+e,textVisible:!0,theme:"a",html:""}),HG.Automation.Programs.ArduinoFileAdd($$._CurrentProgram.Address,e,function(t){"EXISTS"==t?($.mobile.loading("show",{text:'A file named "'+e+'" already exists',textVisible:!0,theme:"a",html:""}),setTimeout(function(){$.mobile.loading("hide")},3e3)):"INVALID_NAME"==t?($.mobile.loading("show",{text:'Invalid file name "'+e+'". Must ends with .c, .cpp, .h or have no extension.',textVisible:!0,theme:"a",html:""}),setTimeout(function(){$.mobile.loading("hide")},3e3)):($.mobile.loading("hide"),$$.SketchFileOpen(e))})}),$("#automation_program_sketchfiles_edit").bind("click",function(){$("#automation_program_listfiles").popup("close");var e=$("#automation_program_sketchfiles li a.ui-btn-active").attr("data-context-value");$$.SketchFileOpen(e)}),$("#automation_program_sketchfiles_delete").bind("click",function(){var e=$("#automation_program_sketchfiles li a.ui-btn-active").attr("data-context-value");$.mobile.loading("show",{text:"Deleting file "+e,textVisible:!0,theme:"a",html:""}),HG.Automation.Programs.ArduinoFileDelete($$._CurrentProgram.Address,e,function(){$$.SketchFileList(),e==$$._CurrentSketchFile&&$$.SketchFileOpen("main"),$.mobile.loading("hide")})})})},$$.CheckIsClean=function(e){$$.IsClean()?e():($$._SavePromptCallback=function(){e()},$("#automation_program_notsaved").popup("open"))},$$.IsClean=function(){var e=$$._CurrentProgram.Group==$("#automation_programgroup").val();return e=e&&$$._CurrentProgram.Name==$("#automation_programname").val(),e=e&&$$._CurrentProgram.Description==$("#automation_programdescription").val(),e=e&&$$._CurrentProgram.ConditionType==$("#automation_conditiontype").val(),e=e&&editor1.isClean()&&editor2.isClean()&&editor3.isClean()},$$.GetDomainControllableModules=function(e,t){var o=Array();if(HG.WebApp.Data.Modules&&HG.WebApp.Data.Modules.length)for(m=0;m0||t)&&o.push(HG.WebApp.Data.Modules[m]);return o},$$.GetModuleComparableProperties=function(e){for(var t=Array(),o=0;o ';$("#page_automation_program_title").html('PROGRAM EDITOR ('+e+")
    "+a+$$._CurrentProgram.Address+" "+$$._CurrentProgram.Name)},$$.GetProgramStatusColor=function(e){var t="black",o="",a="undefined"!=typeof e.Type&&"wizard"!=e.Type.toLowerCase()&&"undefined"!=typeof e.ScriptErrors&&""!=e.ScriptErrors.trim()&&"[]"!=e.ScriptErrors.trim(),i=HG.WebApp.Utility.GetModuleByDomainAddress("HomeAutomation.HomeGenie.Automation",e.Address);if(null!=i){var r=HG.WebApp.Utility.GetModulePropertyByName(i,"Program.Status");null!=r&&(o=r.Value)}return"Running"==o?t="green":"Background"==o?t="blue":e.IsEnabled?t=a?"red":"yellow":a&&(t="brown"),t},$$.RefreshProgramOptions=function(){$("[id=editprograms_actionmenu_run]").each(function(){$(this).show()}),$("[id=editprograms_actionmenu_break]").each(function(){$(this).hide()}),$("[id=editprograms_actionmenu_run]").each(function(){$(this).addClass("ui-disabled")}),$("[id=editprograms_actionmenu_compile]").each(function(){$(this).addClass("ui-disabled")}),setTimeout(function(){HG.Automation.Programs.List(function(){$("[id=editprograms_actionmenu_compile]").each(function(){$(this).removeClass("ui-disabled")}),$("[id=editprograms_actionmenu_run]").each(function(){$(this).removeClass("ui-disabled")}),$("[id=editprograms_actionmenu_run]").each(function(){$(this).hide()});var e=HG.WebApp.Utility.GetProgramByAddress($$._CurrentProgram.Address);null!=e&&(e.IsRunning?$("[id=editprograms_actionmenu_break]").each(function(){$(this).show()}):$("[id=editprograms_actionmenu_run]").each(function(){$(this).show()}),""!=e.ScriptErrors.trim()&&"[]"!=e.ScriptErrors.trim()?$$._CurrentProgram.ScriptErrors=e.ScriptErrors:$$._CurrentProgram.ScriptErrors="",$$.RefreshProgramEditorTitle())})},500)},$$.ProgramEnable=function(e,t){var o=t?"Enable":"Disable",a=t?"Enabling":"Disabling";$.mobile.loading("show",{text:a+" program",textVisible:!0,theme:"a",html:""}),$("#control_groupslist").empty(),$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs."+o+"/"+e+"/",type:"GET",success:function(){$.mobile.loading("hide")},error:function(){$.mobile.loading("hide")}})},$$.UpdateProgram=function(e,t,o){$("#configure_program_editorcompilecode").addClass("ui-disabled"),$("#configure_program_editorcompilecode2").addClass("ui-disabled"),$.mobile.loading("show",{text:HG.WebApp.Locales.GetLocaleString("configure_editprogram_saving"),textVisible:!0,theme:"a",html:""}),$("#control_groupslist").empty(),$.ajax({type:"POST",url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs."+(t?"Compile":"Update")+"/",dataType:"text",data:JSON.stringify(e),success:function(e){$.mobile.loading("hide"),editor1.markClean(),editor2.markClean(),$("#configure_program_editorcompilecode").removeClass("ui-disabled"),$("#configure_program_editorcompilecode2").removeClass("ui-disabled"),""!=e.trim()&&"[]"!=e.trim()?($.mobile.loading("show",{text:HG.WebApp.Locales.GetLocaleString("configure_editprogram_error_updating"),textVisible:!0}),$$.ShowProgramErrors(e)):($.mobile.loading("show",{text:HG.WebApp.Locales.GetLocaleString("configure_editprogram_saving_succeed"),textVisible:!0}),$$.RefreshProgramEditorTitle()),setTimeout(function(){$.mobile.loading("hide"),null!=o&&"undefined"!=typeof o&&o()},2e3),setTimeout(function(){HG.Configure.Modules.List(function(e){try{HG.WebApp.Data.Modules=e}catch(t){}})},3e3)},error:function(){$.mobile.loading("hide"),$("#configure_program_editorcompilecode").removeClass("ui-disabled"),$("#configure_program_editorcompilecode2").removeClass("ui-disabled"),$.mobile.loading("show",{text:"An error occurred!",textVisible:!0}),setTimeout(function(){$.mobile.loading("hide")},5e3)}})},$$.JumpToLine=function(e,t){var o="TC"==e?editor1:editor2;"TC"==e?$$.SetTab(3):($$.SketchFileOpen("main"),$$.SetTab(2)),window.setTimeout(function(){o.setCursor(t);var e=o.getScrollInfo().clientHeight,a=o.charCoords(t,"local");o.scrollTo(null,(a.top+a.bottom-e)/2),o.focus()},500)},$$.ShowProgramErrors=function(message){if($$._CurrentErrors=[],editor1.clearGutter("CodeMirror-lint-markers-1"),editor2.clearGutter("CodeMirror-lint-markers-2"),editor3.clearGutter("CodeMirror-lint-markers-3"),$$._CurrentProgram.ScriptErrors=message,""!=message){for(i=0;i0&&(currentLine==err.Line&¤tBlock==err.CodeBlock||(null!=marker&&($(marker).qtip({content:{title:"Error",text:message,button:"Close"},show:{event:"mouseover",solo:!0},hide:"mouseout",style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"}}),message=""),marker=document.createElement("div"),marker.className="CodeMirror-lint-marker-error","TC"==err.CodeBlock?editor1.setGutterMarker(err.Line-1,"CodeMirror-lint-markers-1",marker):editor2.setGutterMarker(err.Line-1,"CodeMirror-lint-markers-2",marker),currentLine=err.Line,currentBlock=err.CodeBlock),message+="("+err.Line+","+err.Column+"): "+err.ErrorMessage+"
    ",popupMessage+="Line '+err.Line+", Column "+err.Column+' (Trigger':'lime">Code')+"):
    "),popupMessage+="    "+err.ErrorMessage.replace(/\n/g,"
        ")+"


    "}null!=marker&&$(marker).qtip({content:{title:"Error",text:message,button:"Close"},show:{event:"mouseover",solo:!0},hide:"mouseout",style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"}}),$$.ShowExternalErrors(),""!=popupMessage?($("#program_error_button").show(),$("#program_error_button2").show(),$("#program_error_button").qtip({content:{title:"Error",text:popupMessage,button:"Close"},show:{event:"mouseover",ready:2==$$._CurrentTab,delay:500},hide:{event:!1,inactive:5e3},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{adjust:{screen:!0},my:"top center",at:"bottom center"}}),$("#program_error_button2").qtip({content:{title:"Error",text:popupMessage,button:"Close"},show:{event:"mouseover",ready:3==$$._CurrentTab,delay:500},hide:{event:!1,inactive:5e3},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{adjust:{screen:!0},my:"top center",at:"bottom center"}})):($("#program_error_button").hide(),$("#program_error_button2").hide())}else $$._CurrentErrors=[];$$.RefreshCodeMirror()}},$$.ShowExternalErrors=function(){editor3.clearGutter("CodeMirror-lint-markers-3");for(var e=0,t="",o=null,a="",i=0;i<$$._CurrentErrors.length;i++)for(var r=$$._CurrentErrors[i].ErrorMessage.split("\n"),n=0;n3&&l[0]==$$._CurrentSketchFile&&$.isNumeric(l[1])&&$.isNumeric(l[2])&&(e==l[1]&&t==s.CodeBlock||(null!=o&&($(o).qtip({content:{title:"Error",text:a,button:"Close"},show:{event:"mouseover",solo:!0},hide:"mouseout",style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"}}),a=""),o=document.createElement("div"),o.className="CodeMirror-lint-marker-error",editor3.setGutterMarker(l[1]-1,"CodeMirror-lint-markers-3",o),e=l[1],t=s.CodeBlock),a+=s+"
    ")}null!=o&&$(o).qtip({content:{title:"Error",text:a,button:"Close"},show:{event:"mouseover",solo:!0},hide:"mouseout",style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"}})},$$.HideProgramErrors=function(){$$._CurrentErrors=[],null!=editor1&&editor1.clearGutter("CodeMirror-lint-markers-1"),null!=editor2&&editor2.clearGutter("CodeMirror-lint-markers-2"),null!=editor3&&editor3.clearGutter("CodeMirror-lint-markers-3"),$("#program_error_button").hide(),$("#program_error_button2").hide(),$(".qtip").hide(),$$.RefreshCodeMirror()},$$.RefreshCodeMirror=function(){setTimeout(function(){null!=editor1&&editor1.refresh(),null!=editor2&&editor2.refresh(),null!=editor3&&editor3.refresh()},500)},$$.CompileProgram=function(){$$.HideProgramErrors();var e=$$.SetProgramData();"arduino"==$$._CurrentProgram.Type.toLowerCase()?$$.SketchFileSave(function(){$$.UpdateProgram(e,!0)}):$$.UpdateProgram(e,!0)},$$.SaveProgram=function(e){$("#program_error_button").hide(),$("#program_error_button2").hide();var t=$$.SetProgramData();"arduino"==$$._CurrentProgram.Type.toLowerCase()?$$.SketchFileSave(function(){$$.UpdateProgram(t,!1,e)}):$$.UpdateProgram(t,!0,e)},$$.SetProgramData=function(){HG.WebApp.AutomationGroupsList._CurrentGroup=$("#automation_programgroup").val(),$$._CurrentProgram.Group=$("#automation_programgroup").val(),$$._CurrentProgram.Name=$("#automation_programname").val(),$$._CurrentProgram.Description=$("#automation_programdescription").val(),$$._CurrentProgram.ScriptCondition=editor1.getValue(),$$._CurrentProgram.ScriptSource=editor2.getValue(),$$._CurrentProgram.ScriptErrors="",$$._CurrentProgram.ConditionType=$("#automation_conditiontype").val();var e={Address:$$._CurrentProgram.Address,Type:$$._CurrentProgram.Type,Group:$$._CurrentProgram.Group,Name:$$._CurrentProgram.Name,Description:$$._CurrentProgram.Description,IsEnabled:$$._CurrentProgram.IsEnabled,ScriptCondition:$$._CurrentProgram.ScriptCondition,ScriptSource:$$._CurrentProgram.ScriptSource,ConditionType:$$._CurrentProgram.ConditionType,Conditions:$$._CurrentProgram.Conditions,Commands:$$._CurrentProgram.Commands};return e},$$.CheckAndRunProgram=function(e){$$._CurrentProgram.ScriptCondition=editor1.getValue(),$$._CurrentProgram.ScriptSource=editor2.getValue(),$$._CurrentProgram.ConditionType=$("#automation_conditiontype").val(),$$.IsClean()?$$.RunProgram(e.Address,null):$$.SaveProgram(function(){$$.RunProgram(e.Address,null)})},$$.BreakProgram=function(e){$.mobile.loading("show",{text:"Stopping program",textVisible:!0,theme:"a",html:""}),$.ajax({url:"/"+HG.WebApp.Data.ServiceKey+"/"+HG.WebApp.Data.ServiceDomain+"/Automation/Programs.Break/"+e+"/",type:"GET",success:function(){$$.RefreshProgramOptions(),$.mobile.loading("hide")},error:function(){$.mobile.loading("hide")}})},$$.RunProgram=function(e,t){$$._CurrentProgram.ScriptCondition=editor1.getValue(),$$._CurrentProgram.ScriptSource=editor2.getValue(),$$._CurrentProgram.ConditionType=$("#automation_conditiontype").val(),$.mobile.loading("show",{text:"Running program",textVisible:!0,theme:"a",html:""}),HG.Automation.Programs.Run(e,t,function(e){null!=e&&$$.RefreshProgramOptions(),$.mobile.loading("hide")})},$$.DeleteProgram=function(e){$.mobile.loading("show",{text:"Deleting program",textVisible:!0,theme:"a",html:""}),HG.Automation.Programs.DeleteProgram(e,function(){$.mobile.loading("hide"),setTimeout(function(){$.mobile.changePage($("#page_automation_programs"),{transition:"fade",changeHash:!0})},200)})},$$.SetTab=function(e){$$._CurrentTab=e,$("#program_edit_tab1").hide(),$("#program_edit_tab2").hide(),$("#program_edit_tab3").hide(),$("#program_edit_tab1_button").removeClass("ui-btn-active"),$("#program_edit_tab2_button").removeClass("ui-btn-active"),$("#program_edit_tab3_button").removeClass("ui-btn-active"),$("#program_edit_tab"+e).show(),$("#program_edit_tab"+e+"_button").addClass("ui-btn-active"),$$.RefreshCodeMirror()},$$.SketchFileSelect=function(e){$("#automation_program_sketchfiles li a").removeClass("ui-btn-active"), +$(e).addClass("ui-btn-active"),$("#automation_program_sketchfiles_edit").removeClass("ui-disabled"),$("#automation_program_sketchfiles_delete").addClass("ui-disabled"),"main"!=$(e).attr("data-context-value")&&$("#automation_program_sketchfiles_delete").removeClass("ui-disabled")},$$.SketchFileOpen=function(e){$$.SketchFileSave(function(){$.mobile.loading("show",{text:"Opening file "+e,textVisible:!0,theme:"a",html:""}),null==e||"undefined"==typeof e||""==e||"main"==e?($$._CurrentSketchFile="",$("#configure_program_editorfilename").html(e),$(editor3.getWrapperElement()).hide(),$(editor2.getWrapperElement()).show(),editor2.clearHistory(),editor2.markClean(),editor2.refresh(),$.mobile.loading("hide")):($(editor2.getWrapperElement()).hide(),$(editor3.getWrapperElement()).show(),HG.Automation.Programs.ArduinoFileLoad($$._CurrentProgram.Address,e,function(t){$$._CurrentSketchFile=e,$("#configure_program_editorfilename").html(e),editor3.setValue(t),editor3.clearHistory(),editor3.markClean(),editor3.refresh(),$$.ShowExternalErrors(),$.mobile.loading("hide")}))})},$$.SketchFileSave=function(e){if(""==$$._CurrentSketchFile)return void(null!=e&&e());$.mobile.loading("show",{text:"Saving file "+$$._CurrentSketchFile,textVisible:!0,theme:"a",html:""});var t=editor3.getValue();HG.Automation.Programs.ArduinoFileSave($$._CurrentProgram.Address,$$._CurrentSketchFile,t,function(){$.mobile.loading("hide"),null!=e&&e()})},$$.SketchFileList=function(){$("#automation_program_sketchfiles_edit").addClass("ui-disabled"),$("#automation_program_sketchfiles_delete").addClass("ui-disabled"),HG.Automation.Programs.ArduinoFileList($$._CurrentProgram.Address,function(e){if($("#automation_program_sketchfiles").empty(),$("#automation_program_sketchfiles").append('
  • Main Sketch Code
  • '),"undefined"!=typeof e&&null!=e)for(var t=0;t"+e[t]+"");$("#automation_program_sketchfiles").listview("refresh")})}},HG.WebApp.WidgetsList=HG.WebApp.WidgetsList||new function(){var e=this;e.PageId="page_configure_widgetlist",e._currentWidget="",e.InitializePage=function(){var t=$("#"+e.PageId),o=t.find("[data-ui-field=import-popup]"),a=t.find("[data-ui-field=import-btn]"),i=t.find("[data-ui-field=import-form]"),r=t.find("[data-ui-field=upload-btn]"),n=t.find("[data-ui-field=upload-file]"),s=t.find("[data-ui-field=upload-frame]"),l=t.find("[data-ui-field=addconfirm-btn]"),d=t.find("[data-ui-field=addnew-btn]"),p=t.find("[data-ui-field=widgetadd-popup]"),u=t.find("[data-ui-field=widgetbrand-txt]"),c=t.find("[data-ui-field=widgetcategory-txt]"),m=t.find("[data-ui-field=widgetname-txt]");t.on("pageinit",function(){o.popup(),p.popup()}),t.on("pagebeforeshow",function(){HG.Configure.Modules.List(function(e){try{HG.WebApp.Data.Modules=e}catch(t){}}),e.LoadWidgets()}),d.bind("click",function(){u.val(""),c.val(""),m.val(""),HG.Ui.SwitchPopup("#widgetlist_actionmenu",p)}),l.bind("click",function(){var t=u.val()+"/"+c.val()+"/"+m.val();return HG.Configure.Widgets.Add(t,function(o){"Ok"==o.Status?(e._currentWidget=t,$.mobile.pageContainer.pagecontainer("change","#"+HG.WebApp.WidgetEditor.PageId)):alert("Error adding widget")}),!1}),a.bind("click",function(){HG.Ui.SwitchPopup("#widgetlist_actionmenu",o)}),u.bind("keyup blur",function(){u.val(u.val().replace(/[^a-z,A-Z]/g,"").toLowerCase())}),c.bind("keyup blur",function(){c.val(c.val().replace(/[^a-z,A-Z]/g,"").toLowerCase())}),m.bind("keyup blur",function(){m.val(m.val().replace(/[^a-z,A-Z]/g,"").toLowerCase())}),r.bind("click",function(){""==n.val()?(alert("Select a file to import first"),n.parent().stop().animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250).animate({borderColor:"#FF5050"},250).animate({borderColor:"#FFFFFF"},250)):(a.removeClass("ui-btn-active"),o.popup("close"),$.mobile.loading("show",{text:"Importing, please wait...",textVisible:!0,html:""}),i.submit())}),s.bind("load",function(){$.mobile.loading("hide"),""!=n.val()&&(n.val(""),e.LoadWidgets())})},e.LoadWidgets=function(){$.mobile.loading("show"),HG.Configure.Widgets.List(function(t){e.RefreshList(t),$.mobile.loading("hide")})},e.RefreshList=function(t){var o=$("#"+e.PageId),a=o.find("[data-ui-field=group-list]");a.empty(),a.append('
  • '+HG.WebApp.Locales.GetLocaleString("configure_widgetlist_list","Widget List")+"
  • ");for(var i=0;i'+t[i]+"");a.listview(),a.listview("refresh");for(var i=0;i'+HG.WebApp.Locales.GetLocaleString("configure_widgeteditor_title",!1,this.Locale)+"
    "+HG.WebApp.WidgetsList._currentWidget),e.find(".CodeMirror").css("right",$$.previewWidth+5),u.css("right",$$.previewWidth),p.width($$.previewWidth),$.ajax({url:"/hg/html/pages/control/widgets/"+HG.WebApp.WidgetsList._currentWidget+".html",type:"GET",dataType:"text",success:function(e){$$._editorHtml.setValue(e),$$._editorHtml.clearHistory(),$$._editorHtml.markClean(),$.ajax({url:"/hg/html/pages/control/widgets/"+HG.WebApp.WidgetsList._currentWidget+".js",type:"GET",dataType:"text",success:function(e){$$._editorJscript.setValue(e),$$._editorJscript.clearHistory(),$$._editorJscript.markClean(),$$.RefreshCodeMirror()}})}}),e.find("[data-ui-field=preview-div]").empty(),$$._hasError=!0;var t=e.find("[data-ui-field=bindmodule-sel]");t.empty(),t.append('");for(var o="",a=0;a'+l+"")}t.trigger("create"),t.val(o),t.selectmenu("refresh"),$$.SetTab(1),""!=o||"0"==o?setTimeout(function(){$$.Run()},1e3):t.qtip({content:{title:HG.WebApp.Locales.GetLocaleString("configure_widgeteditor_nobindmodule_title","Select a module"),text:HG.WebApp.Locales.GetLocaleString("configure_widgeteditor_nobindmodule_text","No valid bind-module has been found, please select one."),button:HG.WebApp.Locales.GetLocaleString("configure_widgeteditor_nobindmodule_close","Close")},show:{event:!1,ready:!0,delay:1e3},events:{hide:function(){$(this).qtip("destroy")}},hide:{event:!1,inactive:3e3},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{my:"bottom center",at:"top center"}})}),r.bind("click",function(){$("#editwidget_actionmenu").popup("close"),$$.SaveWidget(function(){$$._editorHtml.markClean(),$$._editorJscript.markClean()})}),n.bind("click",function(){$("#editwidget_actionmenu").popup("close"),window.open(location.protocol+"../../api/HomeAutomation.HomeGenie/Config/Widgets.Export/"+encodeURIComponent(HG.WebApp.WidgetsList._currentWidget)+"/")}),s.bind("click",function(){HG.Ui.SwitchPopup("#editwidget_actionmenu",d)}),l.bind("click",function(){return $.mobile.loading("show",{text:"Deleting Widget...",textVisible:!0,theme:"a",html:""}),HG.Configure.Widgets.Delete(HG.WebApp.WidgetsList._currentWidget,function(){$.mobile.loading("hide"),$.mobile.pageContainer.pagecontainer("change","#"+HG.WebApp.WidgetsList.PageId)}),!1}),c.bind("click",function(){return $$.CheckIsClean(function(){$.mobile.pageContainer.pagecontainer("change","#"+HG.WebApp.WidgetsList.PageId)}),!1}),m.bind("click",function(){return $$.CheckIsClean(function(){$.mobile.pageContainer.pagecontainer("change","#page_control")}),!1}),b.bind("click",function(){return $$._savePromptCallback(),!1}),f.bind("click",function(){return $$.SaveWidget(function(){$$._savePromptCallback()}),!1}),t.bind("click",function(){$$.Run()}),o.on("change",function(){""==$(this).val()?a.addClass("ui-disabled"):a.removeClass("ui-disabled"),$$.RenderView()}),a.on("click",function(){if(""!=o.val()){var e=HG.WebApp.Data.Modules[o.val()];HG.WebApp.Control.EditModuleParams(e)}}),i.hide(),u.mousedown(function(t){$$._splitDragStartX=t.pageX,$(window).mousemove(function(t){var o=$$._splitDragStartX-t.pageX,a=e.width()/2,i=p.width()+o;i>=5&&a>=i?(p.width(p.width()+o),e.find(".CodeMirror").css("right",p.width()+5),u.css("right",p.width()),$$._splitDragStartX=t.pageX):($(window).unbind("mousemove"),$$._editorHtml.refresh(),$$._editorJscript.refresh())})}).mouseup(function(){$(window).unbind("mousemove"),$$._editorHtml.refresh(),$$._editorJscript.refresh()}),window.onerror=function(e,t,o,a,i){if(!(t.indexOf("#"+$$.PageId)>0))throw i;$$.ShowError(i)}},$$.SetTab=function(e){var t=$("#"+$$.PageId);t.find("[data-ui-field=tab1-div]").hide(),t.find("[data-ui-field=tab2-div]").hide(),t.find("[data-ui-field=tab3-div]").hide(),t.find("[data-ui-field=tab1-btn]").removeClass("ui-btn-active"),t.find("[data-ui-field=tab2-btn]").removeClass("ui-btn-active"),t.find("[data-ui-field=tab3-btn]").removeClass("ui-btn-active"),t.find("[data-ui-field=tab"+e+"-div]").show(),t.find("[data-ui-field=tab"+e+"-btn]").addClass("ui-btn-active"),$$.RefreshCodeMirror()},$$.CheckIsClean=function(e){if($$._editorHtml.isClean()&&$$._editorJscript.isClean())e();else{var t=$("#"+$$.PageId);$$._savePromptCallback=function(){e()},t.find("[data-ui-field=notsaved-popup]").popup("open")}},$$.SaveWidget=function(e){$$.SaveWidgetHtml(function(){$$.SaveWidgetJavascript(function(){$$.Run(),e&&e()})})},$$.SaveWidgetHtml=function(e){$.mobile.loading("show",{text:HG.WebApp.Locales.GetLocaleString("configure_widgeteditor_savinghtml",!1,this.Locale),textVisible:!0,theme:"a",html:""}),HG.Configure.Widgets.Save(HG.WebApp.WidgetsList._currentWidget,"html",$$._editorHtml.getValue(),function(){$.mobile.loading("hide"),e&&e()})},$$.SaveWidgetJavascript=function(e){$.mobile.loading("show",{text:HG.WebApp.Locales.GetLocaleString("configure_widgeteditor_savingjavascript",!1,this.Locale),textVisible:!0,theme:"a",html:""}),HG.Configure.Widgets.Save(HG.WebApp.WidgetsList._currentWidget,"js",$$._editorJscript.getValue(),function(){$.mobile.loading("hide"),e&&e()})},$$.RefreshCodeMirror=function(){setTimeout(function(){$$._editorHtml.refresh(),$$._editorJscript.refresh()},500)},$$.Render=function(){var e=$("#"+$$.PageId),t=(e.find("[data-ui-field=bindmodule-sel]"),e.find("[data-ui-field=errors-btn]"));t.hide();var o='
    ';o+=$$._editorHtml.getValue(),o+="
    ",e.find("[data-ui-field=preview-div]").html(o),e.find("[data-ui-field=preview-wrapper-div]").trigger("create")},$$.RenderView=function(e){if(!$$._hasError){var t=$("#"+$$.PageId),o=t.find("[data-ui-field=bindmodule-sel]"),a=HG.WebApp.Data.Modules[o.val()];(null==e||e.Domain==a.Domain&&e.Source==a.Address)&&$$.RenderWidget("#widget_preview_instance",$$._widgetInstance,a,e)}},$$.RenderWidget=function(e,t,o,a){try{t.v2?("function"==typeof t._bind?(t._bind(e,o),t._bind=null):t.setModule(o),"function"!=typeof t.onStart||t._started||(t.onStart(),t._started=!0,"function"==typeof t.onRefresh&&t.onRefresh()),"undefined"!=typeof a&&"undefined"!=typeof a.Property&&"function"==typeof t.onUpdate?t.onUpdate(a.Property,a.Value):"function"==typeof t.onRefresh&&t.onRefresh()):t.RenderView(e,o)}catch(i){console.log(i),$$._hasError=!0,$$.ShowError(i)}},$$.GetInstance=function(javascriptCode){if(javascriptCode.trim().startsWith("["))return eval(javascriptCode)[0];var commonJs="";return commonJs+=" var $$ = this;",commonJs+=" $$._fieldCache = [];",commonJs+=" $$.v2 = true;",commonJs+=" $$.apiCall = HG.Control.Modules.ServiceCall;",commonJs+=" $$.util = HG.WebApp.Utility;",commonJs+=" $$.ui = HG.Ui;",commonJs+=" $$.signalActity = function(fieldName) {",commonJs+=" if (typeof fieldName != 'undefined' && fieldName != '')",commonJs+=" $$.ui.BlinkAnim($$.field(fieldName));",commonJs+=" if ($$.field('led').length) {",commonJs+=" $$.field('led').attr('src', 'images/common/led_green.png');",commonJs+=" setTimeout(function() {",commonJs+=" $$.field('led').attr('src', 'images/common/led_black.png');",commonJs+=" }, 100);",commonJs+=" }",commonJs+=" };",commonJs+=" $$.field = function(field, globalSearch){",commonJs+=" var f = globalSearch ? '@'+field : field;",commonJs+=" var el = null;",commonJs+=" if (typeof $$._fieldCache[f] == 'undefined') {",commonJs+=" el = globalSearch ? $(field) : $$._widget.find('[data-ui-field='+field+']');",commonJs+=" if (el.length)",commonJs+=" $$._fieldCache[f] = el;",commonJs+=" } else {",commonJs+=" el = $$._fieldCache[f];",commonJs+=" }",commonJs+=" return el",commonJs+=" };",commonJs+=" $$.clearCache = function() {",commonJs+=" $$._fieldCache.length = 0;",commonJs+=" };",commonJs+=" $$.setModule = function(module) {",commonJs+=" $$.module = module;",commonJs+=" $$.module.prop = function(propName, value) {",commonJs+=" var p = HG.WebApp.Utility.GetModulePropertyByName(this, propName);",commonJs+=" if (typeof value != 'undefined')",commonJs+=" p.Value = value;",commonJs+=" return p;",commonJs+=" };",commonJs+=" $$.module.command = function(cmd, opt, callback) {",commonJs+=" HG.Control.Modules.ServiceCall(cmd, this.Domain, this.Address, opt, function (response) { ",commonJs+=" if (typeof callback == 'function')",commonJs+=" callback(response);",commonJs+=" });",commonJs+=" };",commonJs+=" };",commonJs+=" $$._bind = function(cuid, module) {",commonJs+=" $$.setModule(module);",commonJs+=" $$.container = $(cuid);",commonJs+=" $$.popup = $$.container.find('[data-ui-field=controlpopup]');",commonJs+=" $$.popup.popup();",commonJs+=" $$.popup.trigger('create');",commonJs+=" $$.popup.field = function(f){ return $$.popup.find('[data-ui-field='+f+']'); };",commonJs+=" $$._widget = $$.container.find('[data-ui-field=widget]');",commonJs+=" $$._widget.data('ControlPopUp', $$.popup);",commonJs+=" };",commonJs=commonJs.replace(/(\r\n|\n|\r)/gm,""),javascriptCode="new function(){"+commonJs+javascriptCode+"}",eval(javascriptCode)},$$.Run=function(){$$._hasError=!1,$$._editorJscript.clearGutter("CodeMirror-lint-markers-5");var e=$$._editorJscript.getValue();$.mobile.loading("show",{text:"Checking Javascript code...",textVisible:!0,theme:"a",html:""}),HG.Configure.Widgets.Parse(e,function(t){if($.mobile.loading("hide"),"OK"!=t.ResponseValue){var o=t.ResponseValue,a=o.substr(o.indexOf("(")+1);a=a.substr(0,a.indexOf(")")).split(","),o=o.substr(o.indexOf(":")+2),o=o+'
    Line '+a[0]+", Column "+a[1]+"",$$.ShowErrorTip(o,a[0])}else try{$$._widgetInstance=$$.GetInstance(e),$$.Render(),$$.RenderView()}catch(i){$$._hasError=!0,$$.ShowError(i)}})},$$.ShowError=function(e){var t=ErrorStackParser.parse(e);navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&(t[0]=e);var o=e+'
    Line '+t[0].lineNumber+", Column "+t[0].columnNumber+"";$$.ShowErrorTip(o,t[0].lineNumber),console.log(o),console.log(t)},$$.ShowErrorTip=function(e,t){if(null!=$$._editorJscript){var o=$("#"+$$.PageId),a=o.find("[data-ui-field=errors-btn]"),i=document.createElement("div");$$.SetTab(2),$$._editorJscript.clearGutter("CodeMirror-lint-markers-5"),i.className="CodeMirror-lint-marker-error",$$._editorJscript.setGutterMarker(t-1,"CodeMirror-lint-markers-5",i),$(i).qtip({content:{title:"Error",text:e,button:"Close"},show:{event:"mouseover",solo:!0},hide:"mouseout",style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"}}),a.show(),a.qtip({content:{title:"Error",text:e,button:"Close"},show:{event:"mouseover",ready:!0,delay:500},hide:{event:!1,inactive:5e3},style:{classes:"qtip-red qtip-shadow qtip-rounded qtip-bootstrap"},position:{adjust:{screen:!0},my:"top center",at:"bottom center"}})}},$$.JumpToLine=function(e){window.setTimeout(function(){$$._editorJscript.setCursor(e);var t=$$._editorJscript.getScrollInfo().clientHeight,o=$$._editorJscript.charCoords(e,"local");$$._editorJscript.scrollTo(null,(o.top+o.bottom-t)/2),$$._editorJscript.focus()},500)}},HG.WebApp.Scheduler=HG.WebApp.Scheduler||new function(){var e=this;e._ScheduleList={},e._CurrentEventName="",e._CurrentEventIndex=-1,e.InitializePage=function(){$("#scheduleritem_add_button").on("click",function(){e._CurrentEventName="",e._CurrentEventIndex=-1,e.EditCurrentItem(),setTimeout(function(){$("#scheduleritem_add_button").removeClass("ui-btn-active")},200)})},e.GetItemMarkup=function(e){var t=e.Name;t.indexOf(".")>0&&(t=t.substring(t.indexOf(".")+1));var o='
  • ';return o+='',o+='

    '+t+"

    ",o+='

    '+(null!=e.Description?e.Description:"")+' ('+e.CronExpression+")

    ",o+="
    ",o+='",o+="
  • "},e.LoadScheduling=function(t){$.mobile.loading("show"),HG.Automation.Scheduling.List(function(o){for(e._ScheduleList=o,$.mobile.loading("hide"),$("#configure_schedulerservice_list").empty(),$("#configure_schedulerservice_list").append('
  • '+HG.WebApp.Locales.GetLocaleString("configure_scheduler_events")+"
  • "),i=0;i0){var s=a.Name.substring(0,a.Name.indexOf(".")),r=e.GetItemMarkup(a);s!=n&&($("#configure_schedulerservice_list").append('
  • '+s+"
  • "),n=s),$("#configure_schedulerservice_list").append(r)}}$("#configure_schedulerservice_list").listview(),$("#configure_schedulerservice_list").find("li").each(function(){var t=$(this);t.find("[data-ui-field=btn_delete]").on("click",function(){var t=$(this);HG.WebApp.Utility.ConfirmPopup("Delete item","This action cannot be undone!",function(o){if(o){var a=t.parent().parent().parent().attr("data-schedule-name");HG.Automation.Scheduling.Delete(a,function(){e.LoadScheduling()}),e._CurrentEventName="",e._CurrentEventIndex=-1}})}),t.find("[data-ui-field=btn_toggle]").on("click",function(){e.ToggleScheduleIsEnabled($(this).parent().parent().parent().attr("data-schedule-index"))})}),$("#configure_schedulerservice_list").listview("refresh"),$('#configure_schedulerservice_list li a[data-ui-ref="edit-btn"]').bind("click",function(){e._CurrentEventName=$(this).parent().attr("data-schedule-name"),e._CurrentEventIndex=$(this).parent().attr("data-schedule-index"),e.EditCurrentItem()}),t&&t()})},e.EditCurrentItem=function(){HG.Ui.Popup.CronWizard.open(e._CurrentEventName),HG.Ui.Popup.CronWizard.onChange=function(t){HG.Automation.Scheduling.Update(t.Name,t.CronExpression,t.Data,t.Description,t.Script,function(){e.LoadScheduling()})}},e.ToggleScheduleIsEnabled=function(t){var o=e._ScheduleList[t];$.mobile.loading("show"),o.IsEnabled?HG.Automation.Scheduling.Disable(o.Name,function(){e.LoadScheduling()}):HG.Automation.Scheduling.Enable(o.Name,function(){e.LoadScheduling()})}},HG.WebApp.Apps=Array(),HG.WebApp.Apps.NetPlay=Array(),HG.WebApp.Apps.NetPlay.SlideShow=Array(),HG.WebApp.Apps.NetPlay.SlideShow.DisplayImage=function(e){$.mobile.changePage("#page_apps_netplay",{transition:"flow"});var t="#bgapp_netplay_image1";$("#bgapp_netplay_image1").is(":visible")?($("#bgapp_netplay_image1").animate({top:0,left:-4e3},2e3,function(){$("#bgapp_netplay_image1").hide()}),t="#bgapp_netplay_image2"):($("#bgapp_netplay_image2").animate({top:0,left:-4e3},2e3,function(){$("#bgapp_netplay_image2").hide()}),t="#bgapp_netplay_image1"),setTimeout(function(){""==e&&(e="0"),$(t).html(''),$(t).show(),$(t).animate({top:0,left:0},2e3)})}; \ No newline at end of file diff --git a/BaseFiles/Common/html/locales/de.json b/BaseFiles/Common/html/locales/de.json index 8b11383e2..aca1b271c 100644 --- a/BaseFiles/Common/html/locales/de.json +++ b/BaseFiles/Common/html/locales/de.json @@ -731,6 +731,48 @@ "jeden Tag der Woche", "cronwizard_dayowselect_eachselected": "jeweils ausgewhlt Tag in der Woche", + "cronwizard_event_name": + "Event name", + "cronwizard_typeselect_days": + "days", + "cronwizard_typeselect_period": + "date period", + "cronwizard_typeselect_custom": + "custom cron expression", + "cronwizard_event_description": + "Description", + "cronwizard_date_from": + "from", + "cronwizard_date_to": + "to", + "cronwizard_time_exact": + "at exact time", + "cronwizard_time_range": + "during a time range", + "cronwizard_time_start": + "start", + "cronwizard_time_end": + "end", + "cronwizard_time_at": + "at", + "cronwizard_event_occurrence": + "Occurrence", + "cronwizard_event_cronexpr": + "Cron expression", + "cronwizard_event_runscript": + "Run script on event occurrence", + "cronwizard_description_from": + "from", + "cronwizard_description_to": + "to", + "cronwizard_description_on": + "on", + "cronwizard_description_starting": + "starting at", + "cronwizard_description_ending": + "ending at", + "cronwizard_description_at": + "at", "no_device_found_for_manufacturerId": "No device info was found for manufacturer ID", "##": diff --git a/BaseFiles/Common/html/locales/en.json b/BaseFiles/Common/html/locales/en.json index 94fe71d6b..7c79dfc25 100644 --- a/BaseFiles/Common/html/locales/en.json +++ b/BaseFiles/Common/html/locales/en.json @@ -733,6 +733,48 @@ "every day of week", "cronwizard_dayowselect_eachselected": "each selected day of week", + "cronwizard_event_name": + "Event name", + "cronwizard_typeselect_days": + "days", + "cronwizard_typeselect_period": + "date period", + "cronwizard_typeselect_custom": + "custom cron expression", + "cronwizard_event_description": + "Description", + "cronwizard_date_from": + "from", + "cronwizard_date_to": + "to", + "cronwizard_time_exact": + "at exact time", + "cronwizard_time_range": + "during a time range", + "cronwizard_time_start": + "start", + "cronwizard_time_end": + "end", + "cronwizard_time_at": + "at", + "cronwizard_event_occurrence": + "Occurrence", + "cronwizard_event_cronexpr": + "Cron expression", + "cronwizard_event_runscript": + "Run script on event occurrence", + "cronwizard_description_from": + "from", + "cronwizard_description_to": + "to", + "cronwizard_description_on": + "on", + "cronwizard_description_starting": + "starting at", + "cronwizard_description_ending": + "ending at", + "cronwizard_description_at": + "at", "no_device_found_for_manufacturerId": "No device info was found for manufacturer ID", "##": diff --git a/BaseFiles/Common/html/locales/es.json b/BaseFiles/Common/html/locales/es.json index f910bc2a7..c6d62bed8 100644 --- a/BaseFiles/Common/html/locales/es.json +++ b/BaseFiles/Common/html/locales/es.json @@ -733,6 +733,48 @@ "todos los días de la semana", "cronwizard_dayowselect_eachselected": "cada día seleccionado de la semana", + "cronwizard_event_name": + "Event name", + "cronwizard_typeselect_days": + "days", + "cronwizard_typeselect_period": + "date period", + "cronwizard_typeselect_custom": + "custom cron expression", + "cronwizard_event_description": + "Description", + "cronwizard_date_from": + "from", + "cronwizard_date_to": + "to", + "cronwizard_time_exact": + "at exact time", + "cronwizard_time_range": + "during a time range", + "cronwizard_time_start": + "start", + "cronwizard_time_end": + "end", + "cronwizard_time_at": + "at", + "cronwizard_event_occurrence": + "Occurrence", + "cronwizard_event_cronexpr": + "Cron expression", + "cronwizard_event_runscript": + "Run script on event occurrence", + "cronwizard_description_from": + "from", + "cronwizard_description_to": + "to", + "cronwizard_description_on": + "on", + "cronwizard_description_starting": + "starting at", + "cronwizard_description_ending": + "ending at", + "cronwizard_description_at": + "at", "no_device_found_for_manufacturerId": "No device info was found for manufacturer ID", "##": diff --git a/BaseFiles/Common/html/locales/fr.json b/BaseFiles/Common/html/locales/fr.json index 02e703f9f..eed87ebee 100644 --- a/BaseFiles/Common/html/locales/fr.json +++ b/BaseFiles/Common/html/locales/fr.json @@ -731,6 +731,48 @@ "Chaque jour de la semaine", "cronwizard_dayowselect_eachselected": "Jours de semaine sélectionnés", + "cronwizard_event_name": + "Event name", + "cronwizard_typeselect_days": + "days", + "cronwizard_typeselect_period": + "date period", + "cronwizard_typeselect_custom": + "custom cron expression", + "cronwizard_event_description": + "Description", + "cronwizard_date_from": + "from", + "cronwizard_date_to": + "to", + "cronwizard_time_exact": + "at exact time", + "cronwizard_time_range": + "during a time range", + "cronwizard_time_start": + "start", + "cronwizard_time_end": + "end", + "cronwizard_time_at": + "at", + "cronwizard_event_occurrence": + "Occurrence", + "cronwizard_event_cronexpr": + "Cron expression", + "cronwizard_event_runscript": + "Run script on event occurrence", + "cronwizard_description_from": + "from", + "cronwizard_description_to": + "to", + "cronwizard_description_on": + "on", + "cronwizard_description_starting": + "starting at", + "cronwizard_description_ending": + "ending at", + "cronwizard_description_at": + "at", "no_device_found_for_manufacturerId": "No device info was found for manufacturer ID", "##": diff --git a/BaseFiles/Common/html/locales/it.json b/BaseFiles/Common/html/locales/it.json index cd94912fc..c7dfa893c 100644 --- a/BaseFiles/Common/html/locales/it.json +++ b/BaseFiles/Common/html/locales/it.json @@ -731,6 +731,48 @@ "ogni giorno della settimana", "cronwizard_dayowselect_eachselected": "nei giorni della settimana selezionati", + "cronwizard_event_name": + "Nome evento", + "cronwizard_typeselect_days": + "giorni", + "cronwizard_typeselect_period": + "periodo", + "cronwizard_typeselect_custom": + "espressione cron presonalizzata", + "cronwizard_event_description": + "Descrizione", + "cronwizard_date_from": + "dal", + "cronwizard_date_to": + "al", + "cronwizard_time_exact": + "ora esatta", + "cronwizard_time_range": + "fascia oraria", + "cronwizard_time_start": + "inizio", + "cronwizard_time_end": + "fine", + "cronwizard_time_at": + "alle", + "cronwizard_event_occurrence": + "Occorrenza", + "cronwizard_event_cronexpr": + "Espressione cron", + "cronwizard_event_runscript": + "Esegui script ad ogni occorrenza dell'evento", + "cronwizard_description_from": + "dal", + "cronwizard_description_to": + "al", + "cronwizard_description_on": + "il", + "cronwizard_description_starting": + "a partire dalle", + "cronwizard_description_ending": + "fino alle", + "cronwizard_description_at": + "alle", "no_device_found_for_manufacturerId": "Nessuna informazione trovata su questo dispositivo", "##": diff --git a/BaseFiles/Common/html/locales/nl.json b/BaseFiles/Common/html/locales/nl.json index 86d2e5f32..83d8b1206 100644 --- a/BaseFiles/Common/html/locales/nl.json +++ b/BaseFiles/Common/html/locales/nl.json @@ -731,6 +731,48 @@ "iedere dag van de week", "cronwizard_dayowselect_eachselected": "alle geselecteerde dagen van de week", + "cronwizard_event_name": + "Event name", + "cronwizard_typeselect_days": + "days", + "cronwizard_typeselect_period": + "date period", + "cronwizard_typeselect_custom": + "custom cron expression", + "cronwizard_event_description": + "Description", + "cronwizard_date_from": + "from", + "cronwizard_date_to": + "to", + "cronwizard_time_exact": + "at exact time", + "cronwizard_time_range": + "during a time range", + "cronwizard_time_start": + "start", + "cronwizard_time_end": + "end", + "cronwizard_time_at": + "at", + "cronwizard_event_occurrence": + "Occurrence", + "cronwizard_event_cronexpr": + "Cron expression", + "cronwizard_event_runscript": + "Run script on event occurrence", + "cronwizard_description_from": + "from", + "cronwizard_description_to": + "to", + "cronwizard_description_on": + "on", + "cronwizard_description_starting": + "starting at", + "cronwizard_description_ending": + "ending at", + "cronwizard_description_at": + "at", "no_device_found_for_manufacturerId": "No device info was found for manufacturer ID", "common_month_jan": diff --git a/BaseFiles/Common/html/locales/ru.json b/BaseFiles/Common/html/locales/ru.json index 90380ee50..cc7ce031c 100644 --- a/BaseFiles/Common/html/locales/ru.json +++ b/BaseFiles/Common/html/locales/ru.json @@ -735,6 +735,48 @@ "каждый день недели", "cronwizard_dayowselect_eachselected": "каждый выбранный день недели", + "cronwizard_event_name": + "Event name", + "cronwizard_typeselect_days": + "days", + "cronwizard_typeselect_period": + "date period", + "cronwizard_typeselect_custom": + "custom cron expression", + "cronwizard_event_description": + "Description", + "cronwizard_date_from": + "from", + "cronwizard_date_to": + "to", + "cronwizard_time_exact": + "at exact time", + "cronwizard_time_range": + "during a time range", + "cronwizard_time_start": + "start", + "cronwizard_time_end": + "end", + "cronwizard_time_at": + "at", + "cronwizard_event_occurrence": + "Occurrence", + "cronwizard_event_cronexpr": + "Cron expression", + "cronwizard_event_runscript": + "Run script on event occurrence", + "cronwizard_description_from": + "from", + "cronwizard_description_to": + "to", + "cronwizard_description_on": + "on", + "cronwizard_description_starting": + "starting at", + "cronwizard_description_ending": + "ending at", + "cronwizard_description_at": + "at", "no_device_found_for_manufacturerId": "В базе данных нет информации об устройстве с manufacturer ID", "##": diff --git a/BaseFiles/Common/html/locales/sv.json b/BaseFiles/Common/html/locales/sv.json index 5c7af8113..df6fe15fc 100644 --- a/BaseFiles/Common/html/locales/sv.json +++ b/BaseFiles/Common/html/locales/sv.json @@ -1,840 +1,882 @@ -{ - "home_menu_title": - "Startmeny", - "home_menu_control": - "Kontroll", - "home_menu_analyze": - "Analyser", - "home_menu_configure": - "Konfigurera", - "homegenie_about_title": - "Om", - "control_groups_and_modules": - "Kontrollera Grupper
    och Moduler", - "bottombar_button_home": - "Hem", - "configure_program_bbaractions": - "Val", - "control_macrorecord_discard": - "Kassera", - "control_macrorecord_save": - "Spara", - "analyze_statistics": - "Analys
    Statistik", - "analyze_total_watts_hourly": - "total förbrukning av watt per timme", - "analyze_load_peak_last": - "max förbrukning de senaste fyra timmarna", - "configure_menu_title": - "Konfigurera", - "configure_menu_heading": - "Konfigurationsmeny", - "configure_groups_heading": - "Grupper
    och Moduler", - "configure_menu_groups_modules": - "Grupper och Moduler", - "configure_menu_automation": - "Automation och Program", - "configure_menu_system": - "Inställningar", - "configure_menu_maintenance": - "Underhåll och Uppdateringar", - "configure_automation_heading": - "Program
    Grupper", - "configure_group_newgroup": - "Ny Grupp", - "configure_group_entergroupname": - "Nytt gruppnamn:", - "configure_group_newgroupcancel": - "Avbryt", - "bottombar_button_back": - "Tillbaka", - "configure_group_bottombar_group_add": - "Lägg Till Grupp", - "configure_group_group": - "Grupp", - "configure_group_groupname": - "Namn", - "configure_group_groupwallpaper": - "Bakgrund", - "configure_group_modulelist": - "Modullista", - "configure_group_deletegroup": - "Ta Bort Grupp?", - "configure_group_deleteprompt": - "Är du säker på att du vill ta bort denna grupp?", - "configure_group_deletewarning": - "Denna åtgärd kan inte ångras.", - "configure_group_deletecancel": - "Avbryt", - "configure_group_deleteconfirm": - "Ta Bort", - "configure_module_newmoduleadd": - "Lägg Till Ny Modul", - "configure_module_newmodulecancel": - "Avbryt", - "configure_module_newmoduleconfirm": - "Lägg Till", - "configure_module_propname": - "Namn", - "configure_module_typelight": - "Belysning", - "configure_module_typedimmer": - "Dimmer", - "configure_module_typeswitch": - "Strömbrytare", - "configure_module_typesensor": - "Givare", - "configure_module_typetemperature": - "Temperatur", - "configure_module_typesiren": - "Siren", - "configure_module_typefan": - "Fläkt", - "configure_module_typethermostat": - "Termostat", - "configure_module_typeshutter": - "Mörkläggning", - "configure_module_typedoorwindow": - "Dörr/Fönster", - "configure_module_options": - "Inställningar", - "configure_module_optupdate": - "Uppdatera modul", - "configure_module_optremove": - "Ta bort från grupp", - "configure_group_bottombar_deletemodule": - "Ta bort grupp", - "configure_group_bottombar_addmodule": - "Lägg Till Modul", - "configure_program_automationtitle": - "Programlista", - "configure_program_newprogram": - "Nytt Program", - "configure_program_enterprogramname": - "Nya programmets namn:", - "configure_program_newprogramcancel": - "Avbryt", - "configure_program_newprogramconfirm": - "Ok", - "configure_program_deletetitle": - "Ta Bort Program?", - "configure_program_deleteprompt": - "Är du säker på att du vill ta bort detta program?", - "configure_program_deleteadvice": - "Denna åtgärd kan inte ångras.", - "configure_program_deletecancel": - "Avbryt", - "configure_program_deleteconfirm": - "Ta Bort", - "configure_program_options": - "Inställningar", - "configure_program_options_edit": - "Redigera", - "configure_program_options_export": - "Exportera", - "configure_program_options_delete": - "Ta bort", - "configure_program_programgroup": - "Programgrupp", - "configure_program_programname": - "Programnamn", - "configure_program_programdescription": - "Programbeskrivning", - "configure_program_programtype": - "Programtyp", - "configure_program_trigger": - "Programtrigger", - "configure_program_conditionswitchestrue": - "när villkoret växlar till 'true/sant'", - "configure_program_conditionswitchesfalse": - "när villkoret växlar till 'false/falskt'", - "configure_program_runonceconditiontrue": - "kör en gång, när villkoret returnerar 'true/sant'", - "configure_program_conditionistrue": - "när villkoret returnerar 'true/sant'", - "configure_program_conditionisfalse": - "när villkoret returnerar 'false/falskt'", - "configure_program_programconditions": - "Programvillkor", - "configure_program_conditionadd": - "Lägg Till Villkor", - "configure_program_selectconditioncontext": - "Välj Villkorsgrupp", - "configure_program_wizardback": - "tillbaka", - "configure_program_selectoperator": - "Välj jämförelseoperator", - "configure_program_operatorless": - "Mindre Än", - "configure_program_operatorequal": - "Lika Med", - "configure_program_operatorgreaterthan": - "Större Än", - "configure_program_selectvalue": - "Välj jämförelsevärde", - "configure_program_wizarddone": - "klar", - "configure_program_deleteconditiontitle": - "Radera villkor?", - "configure_program_deleteconditionprompt": - "Är du säker på att du vill radera detta villkor?", - "configure_program_deleteconditionadvice": - "Denna åtgärd kan inte ångras.", - "configure_program_instructions": - "Programinstruktioner", - "configure_program_instructionadd": - "Lägg Till Instruktion", - "configure_program_selectcommandcontext": - "Välj Kommandogrupp", - "configure_program_commandarguments": - "Kommandoargument", - "configure_program_deleteinstructiontitle": - "Ta Bort Instruktion?", - "configure_program_deleteinstructionprompt": - "Är du säker på att du vill ta bort denna instruktion?", - "configure_program_csharpprogram": - "C# Program", - "configure_program_savingtitle": - "Sparar Program", - "configure_program_savingwait": - "Var vänlig vänta...", - "configure_program_switchtypetitle": - "Ändra Typ?", - "configure_program_switchtypeprompt": - "Är du säker på att du vill ändra programtyp?", - "configure_program_switchtypeadvice": - "Aktuella programmets data kommer att raderas.", - "configure_program_switchtypecancel": - "Avbryt", - "configure_program_switchtypeconfirm": - "Ändra", - "configure_program_options_run": - "Kör", - "configure_program_options_break": - "Bryt", - "configure_program_options_save": - "Spara", - "configure_program_errorstitle": - "Fel", - "configure_program_bbar_programeditruncode": - "Redigera Triggerkod", - "configure_automationgroup_newgroup": - "Ny Grupp", - "configure_automationgroup_entergroupname": - "Nytt gruppnamn:", - "configure_automationgroup_newgroupcancel": - "Avbryt", - "configure_automationgroup_bottombar_group_add": - "Lägg Till Grupp", - "configure_interfaces_heading": - "Inställningar", - "configure_interfaces_optdisable": - "Inaktiverad", - "configure_interfaces_optenable": - "Aktiverad", - "configure_maintenance_heading": - "Underhåll", - "configure_system_installpackage": - "Installera Paket", - "configure_system_packagemanager": - "Pakethanterare", - "configure_system_theme": - "Tema", - "configure_system_options": - "Systemalternativ", - "configure_system_serviceportis": - "Http-service porten är", - "configure_system_serviceportchange": - "Ändra Port", - "configure_security_passwordprotectedaccess": - "Lösenordskyddad Åtkomst", - "configure_system_configanddata": - "Konfiguration och Data", - "configure_maintenance_configuration": - "Konfiguration", - "configure_system_statistics": - "Statistik", - "configure_system_databasereset": - "Rensa Databas", - "systemsettings_backuprestores1heading": - "Återställ Konfiguration", - "configure_system_backuprestores1note": - "Välj Automationsprogram att återställa:", - "systemsettings_backuprestores1cancel": - "Avbryt", - "systemsettings_backuprestores1confirm": - "Återställ", - "configure_system_serviceportheading": - "Http Service-Port", - "configure_system_serviceportchangenote": - "Notera: efter byte av port så måste HomeGenie starta om för att använda de nya inställningarna!", - "configure_system_serviceportcancel": - "Avbryt", - "securitysettings_password_adminpassword": - "admin användarlösenord", - "securitysettings_password_changecancel": - "Avbryt", - "securitysettings_password_changecommit": - "Sätt", - "maintenance_configuration_factoryreset": - "Fabriksåterställning?", - "configure_maintenance_resetprompt": - "Är du säker på att du vill fabriksåterställa systemet?", - "configure_maintenance_resetwarning": - "", - "configure_maintenance_resetproceed": - "Fortsätt", - "configure_maintenance_resetcancel": - "Avbryt", - "home_voicerecognition_text_placeholder": - "Klicka på knappen för röststyrning eller skriv en mening...", - "home_voicerecognition_voice": - "Röst", - "configure_menu_scheduler": - "Schemaläggare", - "configure_grouplist": - "Grupplista", - "configure_schedulerservice_title": - "Schemaläggning", - "configure_scheduler_events": - "Schemaläggningar", - "configure_schedulerservice_bottombar_event_add": - "Lägg Till Händelse", - "configure_schedulerservice_schedulerevent": - "Schemaläggarhändelse", - "configure_schedulerservice_itemname": - "Namn", - "configure_schedulerservice_itemcronexp": - "Cron-uttryck", - "configure_schedulerservice_itemprogramid": - "Program-Id eller Namn (valbart)", - "configure_schedulerservice_cancelitem": - "Avbryt", - "configure_schedulerservice_deleteitem": - "Ta bort", - "configure_schedulerservice_updateitem": - "Uppdatera", - "configure_system_updatemanager": - "Uppdateringar", - "configure_system_updatemanager_updatecheck": - "Sök uppdatering", - "configure_system_updatemanager_installupdate": - "Installera Uppdatering", - "configure_system_updatemanager_no_updates": - "Inga nya uppdateringar tillgängliga.", - "configure_system_updatemanager_updates_available": - "Följande uppdateringar finns tillgängliga:", - "configure_system_restart_service": - "Starta om service", - "configure_system_restart": - "Starta om", - "configure_system_loganddebug": - "Log-fil", - "configure_system_logdownload": - "Ladda ner", - "configure_system_logdownloadtoday": - "I dag", - "configure_system_logdownloadyesterday": - "I går", - "configure_system_httpsettings": - "HTTP-inställningar", - "configure_security_passwordprotectedaccess_set": - "Sätt lösenord", - "configure_security_passwordprotectedaccess_clear": - "Rensa", - "configure_system_httpcache": - "Http-servicecache", - "configure_maintenance_configuration_info": - "Notis: innan du återställer en backup behöver du sätta samma systemlösenord som när backupen togs.", - "configure_maintenance_configuration_backup": - "Backup", - "configure_maintenance_configuration_restore": - "Återställ Backup", - "configure_maintenance_configuration_factory_reset": - "Fabriksåterställ", - "configure_system_modulescleanup": - "Rensa moduler", - "configure_system_modulesselect": - "Välj moduler", - "configure_system_remotemodules": - "Fjärrmoduler kopplingar", - "configure_system_modsroutingreset": - "Återställ", - "configure_system_userinterface": - "Användargränssnitt", - "configure_system_eventshistory": - "Händelsehistorik", - "home_about_version": - "version", - "home_about_codename": - "kodnamn", - "home_about_motto": - "måtto", - "home_about_concept": - "Koncept, design, idéer och kodning
    av G-Labs", - "home_about_license": - "licens", - "home_about_site": - "Hemsida och Hjälp", - "home_about_site_docs": - "Dokumentation", - "actions_menu": - "val", - "control_group_configure": - "konfigurera Grupp", - "control_macrorecord_record_macro": - "Spela in Macro", - "control_macrorecord_recording": - "Spelar in...", - "control_macrorecord_description": - "Alla kommandon spelas nu in till ett Wissardscript.
    Tryck på Spara-knappen när du är klar.", - "control_macrorecord_close": - "Stäng", - "control_macrorecord_options": - "Val", - "control_macrorecord_options_pause": - "Pausa mellan kommandon", - "control_macrorecord_options_none": - "Ingen", - "control_macrorecord_options_mimic": - "Ursprunglig", - "control_macrorecord_options_fixed": - "Sätt", - "control_macrorecord_options_pauseduration": - "Förvald paus (sekunder)", - "update_options_popup_loading": - "Laddar programdata", - "control_widget_notconfigured_title": - "Widgeten är inte konfigurerad", - "control_widget_notconfigured_text": - "Klicka här för att ändra konfiguration.", - "control_widget_notconfigured_button": - "Stäng", - "configure_program_options_details": - "Detaljer", - "configure_program_options_restart": - "Starta om", - "configure_program_details_implemfeatures": - "Implementerade funktioner", - "configure_program_details_configoptions": - "Konfigurationsval", - "configure_program_details_moduleparams": - "Modulvärden", - "configure_group_actionmenu_deletegroup": - "Ta bort Grupp", - "configure_group_actionmenu_addseparatorlabel": - "Lägg till avdelare", - "configure_group_actionmenu_addmodule": - "Lägg till Modul", - "configure_separator_edit": - "Namnge avdelare", - "configure_separator_label": - "Namn", - "configure_separator_placeholder": - "skriv namn", - "configure_module_optaddseparator": - "Uppdatera", - "configure_module_parameters": - "Ändra modulvärden", - "configure_module_parameters_delete": - "Ta bort", - "configure_module_parameters_save": - "Spara", - "configure_module_parameters_linktitle": - "Modulvärden", - "configure_automationgroup_add": - "Lägg till", - "configure_programslist_listtitle": - "Programlista", - "configure_programslist_tap_disable": - "Tryck för att INAKTIVERA programmet", - "configure_programslist_tap_enable": - "Tryck för att AKTIVERA programmet", - "configure_programslist_deletegroup": - "Ta Bort Grupp", - "configure_programslist_importprogram": - "Importera program", - "configure_programslist_addnewprogram": - "Lägg till program", - "configure_programslist_refreshlist": - "Uppdatera lista", - "configure_programslist_import": - "Importera", - "configure_program_summary": - "Summering", - "configure_program_programcode": - "Programkod", - "configure_program_sketchcode": - "Sketch-kod", - "configure_program_triggercode": - "Triggerkod", - "configure_program_makefile": - "Makefile", - "configure-editprogram-addcommand": - "Lägg till Kommando", - "configure-editprogram-addcondition": - "Lägg till villkor", - "configure-editprogram-capture": - "Spela in", - "configure-editprogram-help": - "Hjälp", - "configure_program_triggertype": - "Triggas", - "configure_editprogram_options_delete": - "Ta Bort Program", - "configure_editprogram_saving_succeed": - "Sparar..", - "configure_editprogram_saving": - "Uppdaterar programdata", - "configure_editprogram_error_updating": - "Fel vid uppdatering av program!", - "configure_editprogram_compile": - "Kompilera", - "systemsettings_selectport_title": - "Notis", - "systemsettings_selectport_placeholder": - "(välj port...)", - "systemsettings_selectport_text": - "Välj vilken port som enheten använder", - "systemsettings_selectport_button": - "Stäng", - "configure_group_newgroupconfirm": - "Ok", - "configure_module_optremoveseparator": - "Ta bort", - "configure_program_selectcommandtarget": - "Välj målenhet", - "configure_program_selectcommandtoperform": - "Välj kommando att utföra", - "configure_program_commandcustom": - "Eget API-kommando", - "configure_program_wizardproceed": - "Fortsätt", - "configure_program_commandcapturetitle": - "Spelar in kommandon", - "configure_program_waitingnewcommand": - "Väntar på nya kommandon...", - "configure_program_waitingnewcommandadvice": - "", - "configure_program_capturestop": - "Stoppa inspelning", - "configure_program_wizard_editline_title": - "Ändra rad", - "configure_program_wizard_editcmdline_prompt": - "Flytta eller ta bort rad ", - "configure_program_wizard_editconline_prompt": - "Flytta eller ta bort rad ", - "configure_program_wizard_editline_number": - "Nytt radnummer", - "configure_program_wizard_editline_delete": - "Ta bort", - "configure_program_wizard_editline_change": - "Flytta", - "configure_program_selectconditionsubject": - "Välj Villkorsundergrupp", - "configure_program_selectconditionproperty": - "Välj Villkorsegenskap", - "configure_program_conditioncapturetitle": - "Spelar in händelser", - "configure_program_waitingnewcondition": - "Väntar på nya händelser...", - "configure_program_waitingnewconditionadvice": - "", - "configure_program_options_update": - "Uppdatera", - "configure_system_updateinstall": - "Uppdatera Installation", - "configure_system_deletemodule": - "Ta Bort Modul", - "systemsettings_backuprestores1selectallnone": - "Välj alla / inga", - "securitysettings_password_setpassword": - "Ändra lösenord", - "securitysettings_password_enterpassword": - "Skriv in lösenord för 'admin'", - "maintenance_configuration_servicerestart": - "Starta Om Tjänst?", - "configure_maintenance_restartprompt": - "Är du säker på att du vill starta om tjänsten?", - "configure_maintenance_restartwarning": - "", - "configure_module_typemediareceiver": - "Mediamottagare", - "configure_module_typemediatransmitter": - "Mediasändare", - "configure_module_featuresoptions": - "Verktyg/Inställningar", - "configure_editprogram_files": - "Filer", - "configure_program_newfile": - "Lägg till fil", - "configure_program_filename": - "Filnamn", - "configure_program_fileslist": - "Fillista", - "configure_program_fileslist_exit": - "Gå ur", - "configure_program_fileslist_delete": - "Ta bort", - "configure_program_fileslist_edit": - "Ändra", - "configure_program_fileslist_add": - "Lägg till", - "configure_program_hasmodification": - "Programet har ändrats!", - "configure_program_savechangesprompt": - "Vill du spara förändringar?", - "configure_program_changeswillbelost": - "", - "configure_program_dontsave": - "Nej", - "configure_program_saveconfirm": - "Spara", - "statistics_dataanalysis": - "Dataanalys", - "statistics_counterexpense": - "Räknare och kostnad", - "analyze_statistics_datefrom": - "Från", - "analyze_statistics_dateto": - "Till", - "analyze_statistics_costperunit": - "Kostnad per enhet", - "analyze_statistics_overallcounter": - "Totalräknare", - "analyze_statistics_totalexpense": - "Totalkostnad", - "configure_program_oroperator": - "Eller operator", - "configure_system_statistics_clear": - "Rensa all statistik", - "configure_system_statistics_databasemaxsize": - "Max databasstorlek", - "configure_system_statistics_changedatabasemaxsize": - "Ändra", - "configure_system_statistics_databasemaxsizechange": - "Max storlek (MB)", - "configure_system_statistics_databasemaxsizechange_cancel": - "Avbryt", - "configure_system_statistics_databasemaxsizechange_commit": - "Ändra", - "configure_popupfilter_title": - "Händelsepopupfilter", - "configure_popupfilter_optclose": - "Stäng", - "configure_system_blockedpopups": - "Blockerade popups", - "configure_system_blockedpopups_edit": - "Ändra", - "configure_system_updateinstall_warning": - "Det är starkt rekommenderat att ta en backup av konfigurationen innan man kör en uppdatering.", - "configure_automationgroup_widgeteditor": - "Widgethanterare", - "configure_widgetlist_heading": - "Widgetar
    List", - "configure_widgetlist_importwidget": - "Importera Widget", - "configure_widgetlist_import": - "Importera", - "configure_widgetlist_add_popuptitle": - "Ny Widget", - "configure_widgetlist_add_widgetbrand": - "Märke", - "configure_widgetlist_add_widgetcategory": - "Kategori", - "configure_widgetlist_add_widgetname": - "Namn", - "configure_widgetlist_newwidgetconfirm": - "Lägg till", - "configure_widgetlist_action_import": - "Importera", - "configure_widgetlist_action_addwidget": - "Lägg till Widget", - "configure_widgeteditor_html": - "HTML", - "configure_widgeteditor_javascript": - "Javascript", - "configure_widgeteditor_previewupdate": - "Kör / Förhandsgranska", - "configure_widgeteditor_hasmodification": - "Widgeten har ändrats!", - "configure_widgeteditor_deletetitle": - "Ta Bort Widget?", - "configure_widgeteditor_deleteprompt": - "Är du säker på att du vill ta bort widgeten?", - "configure_widgetlist_list": - "Widgetlista", - "configure_widgeteditor_nobindmodule_title": - "Välj en modul", - "configure_widgeteditor_nobindmodule_text": - "Ingen giltig modul har hittats för datakoppling. Välj en.", - "configure_widgeteditor_nobindmodule_close": - "Stäng", - "configure_widgeteditor_bindtomodule": - "bind till modul", - "configure_widgeteditor_selectmodule_placeholder": - "(välj modul)", - "configure_widgeteditor_title": - "Widgethanteraren", - "configure_widgeteditor_savinghtml": - "Sparar HTML...", - "configure_widgeteditor_savingjavascript": - "Sparar Javascript...", - "configure_interfaces_importdriver": - "Installera Interface", - "configure_interfaces_download": - "Ladda ner och installera", - "configure_interfaces_upload": - "Ladda upp och installera", - "configure_interfaces_install": - "Installera Interface", - "configure_interfaces_downloadfromurl": - "Ladda ner paket från URL", - "configure_interfaces_uploadpackage": - "Ladda upp paket från fil", - "cronwizard_title": - "Cron-Guide", - "cronwizard_tab_minute": - "Minut", - "cronwizard_tab_hour": - "Timme", - "cronwizard_tab_dayofmonth": - "Dag i månaden", - "cronwizard_tab_month": - "Månad", - "cronwizard_tab_dayofweek": - "Dag i veckan", - "cronwizard_event_willoccur": - "Den här händelsen kommer ske", - "cronwizard_minuteselect_everyminute": - "varje minut", - "cronwizard_minuteselect_everysomeminute": - "varje <n> minut", - "cronwizard_minuteselect_eachselected": - "varje vald minut", - "cronwizard_hourselect_everyhour": - "varje timme", - "cronwizard_hourselect_everysomehour": - "varje <n> timme", - "cronwizard_hourselect_eachselected": - "varje vald timme", - "cronwizard_dayselect_everyday": - "varje dag", - "cronwizard_dayselect_eachselected": - "varje vald dag", - "cronwizard_monthselect_everymonth": - "varje månad", - "cronwizard_monthselect_eachselected": - "varje vald månad", - "cronwizard_dayowselect_everydayow": - "alla dagar i veckan", - "cronwizard_dayowselect_eachselected": - "varje vald dag i veckan", - "no_device_found_for_manufacturerId": - "Ingen enhetsinfo för tillverkarens ID", - "common_month_jan": - "Jan", - "common_month_feb": - "Feb", - "common_month_mar": - "Mar", - "common_month_apr": - "Apr", - "common_month_may": - "Maj", - "common_month_jun": - "Jun", - "common_month_jul": - "Jul", - "common_month_aug": - "Aug", - "common_month_sep": - "Sep", - "common_month_oct": - "Okt", - "common_month_nov": - "Nov", - "common_month_dec": - "Dec", - "common_dayofweek_sun": - "Sön", - "common_dayofweek_mon": - "Mån", - "common_dayofweek_tue": - "Tis", - "common_dayofweek_wed": - "Ons", - "common_dayofweek_thu": - "Tor", - "common_dayofweek_fri": - "Fre", - "common_dayofweek_sat": - "Lör", - "common_command_cancel": - "Avbryt", - "common_command_ok": - "Ok", - "common_command_proceed": - "Fortsätt", - "common_command_save": - "Spara", - "common_status_notset": - "Ej satt", - "common_voice_control": - "Röststyrning", - "common_command_delete": - "Ta bort", - "common_command_upload": - "Ladda upp", - "common_select_none": - "Ingen", - "common_command_exit": - "Gå ur", - "common_command_close": - "Stäng", - "common_command_module": - "Modul", - "common_command_modules": - "Moduler", -"##": -"## SIDE MENU LOCALES", -"##": -"##", - "home_menu_home": - "Hem", - "home_menu_groups": - "Grupper", - "home_menu_statistics": - "Statistik", - "home_menu_automation": - "Automatik", - "home_menu_programeditor": - "Program", - "home_menu_widgeteditor": - "Widgetar", - "home_menu_scheduler": - "Schemaläggare", - "home_menu_system": - "System", - "home_menu_settings": - "Inställningar", - "home_menu_maintenance": - "Underhåll", - "home_menu_about": - "Om", - "home_menu_about_homegenie": - "Om HomeGenie", - "home_menu_about_version": - "Version", - "home_menu_about_whatshot": - "Hett just nu!", - "home_menu_about_userguide": - "Manual", - "home_menu_about_programming": - "Programmeringsguide", - "home_menu_about_forum": - "Användarforum", - "home_menu_about_support": - "Stöd HomeGenie" +{ + "home_menu_title": + "Startmeny", + "home_menu_control": + "Kontroll", + "home_menu_analyze": + "Analyser", + "home_menu_configure": + "Konfigurera", + "homegenie_about_title": + "Om", + "control_groups_and_modules": + "Kontrollera Grupper
    och Moduler", + "bottombar_button_home": + "Hem", + "configure_program_bbaractions": + "Val", + "control_macrorecord_discard": + "Kassera", + "control_macrorecord_save": + "Spara", + "analyze_statistics": + "Analys
    Statistik", + "analyze_total_watts_hourly": + "total förbrukning av watt per timme", + "analyze_load_peak_last": + "max förbrukning de senaste fyra timmarna", + "configure_menu_title": + "Konfigurera", + "configure_menu_heading": + "Konfigurationsmeny", + "configure_groups_heading": + "Grupper
    och Moduler", + "configure_menu_groups_modules": + "Grupper och Moduler", + "configure_menu_automation": + "Automation och Program", + "configure_menu_system": + "Inställningar", + "configure_menu_maintenance": + "Underhåll och Uppdateringar", + "configure_automation_heading": + "Program
    Grupper", + "configure_group_newgroup": + "Ny Grupp", + "configure_group_entergroupname": + "Nytt gruppnamn:", + "configure_group_newgroupcancel": + "Avbryt", + "bottombar_button_back": + "Tillbaka", + "configure_group_bottombar_group_add": + "Lägg Till Grupp", + "configure_group_group": + "Grupp", + "configure_group_groupname": + "Namn", + "configure_group_groupwallpaper": + "Bakgrund", + "configure_group_modulelist": + "Modullista", + "configure_group_deletegroup": + "Ta Bort Grupp?", + "configure_group_deleteprompt": + "Är du säker på att du vill ta bort denna grupp?", + "configure_group_deletewarning": + "Denna åtgärd kan inte ångras.", + "configure_group_deletecancel": + "Avbryt", + "configure_group_deleteconfirm": + "Ta Bort", + "configure_module_newmoduleadd": + "Lägg Till Ny Modul", + "configure_module_newmodulecancel": + "Avbryt", + "configure_module_newmoduleconfirm": + "Lägg Till", + "configure_module_propname": + "Namn", + "configure_module_typelight": + "Belysning", + "configure_module_typedimmer": + "Dimmer", + "configure_module_typeswitch": + "Strömbrytare", + "configure_module_typesensor": + "Givare", + "configure_module_typetemperature": + "Temperatur", + "configure_module_typesiren": + "Siren", + "configure_module_typefan": + "Fläkt", + "configure_module_typethermostat": + "Termostat", + "configure_module_typeshutter": + "Mörkläggning", + "configure_module_typedoorwindow": + "Dörr/Fönster", + "configure_module_options": + "Inställningar", + "configure_module_optupdate": + "Uppdatera modul", + "configure_module_optremove": + "Ta bort från grupp", + "configure_group_bottombar_deletemodule": + "Ta bort grupp", + "configure_group_bottombar_addmodule": + "Lägg Till Modul", + "configure_program_automationtitle": + "Programlista", + "configure_program_newprogram": + "Nytt Program", + "configure_program_enterprogramname": + "Nya programmets namn:", + "configure_program_newprogramcancel": + "Avbryt", + "configure_program_newprogramconfirm": + "Ok", + "configure_program_deletetitle": + "Ta Bort Program?", + "configure_program_deleteprompt": + "Är du säker på att du vill ta bort detta program?", + "configure_program_deleteadvice": + "Denna åtgärd kan inte ångras.", + "configure_program_deletecancel": + "Avbryt", + "configure_program_deleteconfirm": + "Ta Bort", + "configure_program_options": + "Inställningar", + "configure_program_options_edit": + "Redigera", + "configure_program_options_export": + "Exportera", + "configure_program_options_delete": + "Ta bort", + "configure_program_programgroup": + "Programgrupp", + "configure_program_programname": + "Programnamn", + "configure_program_programdescription": + "Programbeskrivning", + "configure_program_programtype": + "Programtyp", + "configure_program_trigger": + "Programtrigger", + "configure_program_conditionswitchestrue": + "när villkoret växlar till 'true/sant'", + "configure_program_conditionswitchesfalse": + "när villkoret växlar till 'false/falskt'", + "configure_program_runonceconditiontrue": + "kör en gång, när villkoret returnerar 'true/sant'", + "configure_program_conditionistrue": + "när villkoret returnerar 'true/sant'", + "configure_program_conditionisfalse": + "när villkoret returnerar 'false/falskt'", + "configure_program_programconditions": + "Programvillkor", + "configure_program_conditionadd": + "Lägg Till Villkor", + "configure_program_selectconditioncontext": + "Välj Villkorsgrupp", + "configure_program_wizardback": + "tillbaka", + "configure_program_selectoperator": + "Välj jämförelseoperator", + "configure_program_operatorless": + "Mindre Än", + "configure_program_operatorequal": + "Lika Med", + "configure_program_operatorgreaterthan": + "Större Än", + "configure_program_selectvalue": + "Välj jämförelsevärde", + "configure_program_wizarddone": + "klar", + "configure_program_deleteconditiontitle": + "Radera villkor?", + "configure_program_deleteconditionprompt": + "Är du säker på att du vill radera detta villkor?", + "configure_program_deleteconditionadvice": + "Denna åtgärd kan inte ångras.", + "configure_program_instructions": + "Programinstruktioner", + "configure_program_instructionadd": + "Lägg Till Instruktion", + "configure_program_selectcommandcontext": + "Välj Kommandogrupp", + "configure_program_commandarguments": + "Kommandoargument", + "configure_program_deleteinstructiontitle": + "Ta Bort Instruktion?", + "configure_program_deleteinstructionprompt": + "Är du säker på att du vill ta bort denna instruktion?", + "configure_program_csharpprogram": + "C# Program", + "configure_program_savingtitle": + "Sparar Program", + "configure_program_savingwait": + "Var vänlig vänta...", + "configure_program_switchtypetitle": + "Ändra Typ?", + "configure_program_switchtypeprompt": + "Är du säker på att du vill ändra programtyp?", + "configure_program_switchtypeadvice": + "Aktuella programmets data kommer att raderas.", + "configure_program_switchtypecancel": + "Avbryt", + "configure_program_switchtypeconfirm": + "Ändra", + "configure_program_options_run": + "Kör", + "configure_program_options_break": + "Bryt", + "configure_program_options_save": + "Spara", + "configure_program_errorstitle": + "Fel", + "configure_program_bbar_programeditruncode": + "Redigera Triggerkod", + "configure_automationgroup_newgroup": + "Ny Grupp", + "configure_automationgroup_entergroupname": + "Nytt gruppnamn:", + "configure_automationgroup_newgroupcancel": + "Avbryt", + "configure_automationgroup_bottombar_group_add": + "Lägg Till Grupp", + "configure_interfaces_heading": + "Inställningar", + "configure_interfaces_optdisable": + "Inaktiverad", + "configure_interfaces_optenable": + "Aktiverad", + "configure_maintenance_heading": + "Underhåll", + "configure_system_installpackage": + "Installera Paket", + "configure_system_packagemanager": + "Pakethanterare", + "configure_system_theme": + "Tema", + "configure_system_options": + "Systemalternativ", + "configure_system_serviceportis": + "Http-service porten är", + "configure_system_serviceportchange": + "Ändra Port", + "configure_security_passwordprotectedaccess": + "Lösenordskyddad Åtkomst", + "configure_system_configanddata": + "Konfiguration och Data", + "configure_maintenance_configuration": + "Konfiguration", + "configure_system_statistics": + "Statistik", + "configure_system_databasereset": + "Rensa Databas", + "systemsettings_backuprestores1heading": + "Återställ Konfiguration", + "configure_system_backuprestores1note": + "Välj Automationsprogram att återställa:", + "systemsettings_backuprestores1cancel": + "Avbryt", + "systemsettings_backuprestores1confirm": + "Återställ", + "configure_system_serviceportheading": + "Http Service-Port", + "configure_system_serviceportchangenote": + "Notera: efter byte av port så måste HomeGenie starta om för att använda de nya inställningarna!", + "configure_system_serviceportcancel": + "Avbryt", + "securitysettings_password_adminpassword": + "admin användarlösenord", + "securitysettings_password_changecancel": + "Avbryt", + "securitysettings_password_changecommit": + "Sätt", + "maintenance_configuration_factoryreset": + "Fabriksåterställning?", + "configure_maintenance_resetprompt": + "Är du säker på att du vill fabriksåterställa systemet?", + "configure_maintenance_resetwarning": + "", + "configure_maintenance_resetproceed": + "Fortsätt", + "configure_maintenance_resetcancel": + "Avbryt", + "home_voicerecognition_text_placeholder": + "Klicka på knappen för röststyrning eller skriv en mening...", + "home_voicerecognition_voice": + "Röst", + "configure_menu_scheduler": + "Schemaläggare", + "configure_grouplist": + "Grupplista", + "configure_schedulerservice_title": + "Schemaläggning", + "configure_scheduler_events": + "Schemaläggningar", + "configure_schedulerservice_bottombar_event_add": + "Lägg Till Händelse", + "configure_schedulerservice_schedulerevent": + "Schemaläggarhändelse", + "configure_schedulerservice_itemname": + "Namn", + "configure_schedulerservice_itemcronexp": + "Cron-uttryck", + "configure_schedulerservice_itemprogramid": + "Program-Id eller Namn (valbart)", + "configure_schedulerservice_cancelitem": + "Avbryt", + "configure_schedulerservice_deleteitem": + "Ta bort", + "configure_schedulerservice_updateitem": + "Uppdatera", + "configure_system_updatemanager": + "Uppdateringar", + "configure_system_updatemanager_updatecheck": + "Sök uppdatering", + "configure_system_updatemanager_installupdate": + "Installera Uppdatering", + "configure_system_updatemanager_no_updates": + "Inga nya uppdateringar tillgängliga.", + "configure_system_updatemanager_updates_available": + "Följande uppdateringar finns tillgängliga:", + "configure_system_restart_service": + "Starta om service", + "configure_system_restart": + "Starta om", + "configure_system_loganddebug": + "Log-fil", + "configure_system_logdownload": + "Ladda ner", + "configure_system_logdownloadtoday": + "I dag", + "configure_system_logdownloadyesterday": + "I går", + "configure_system_httpsettings": + "HTTP-inställningar", + "configure_security_passwordprotectedaccess_set": + "Sätt lösenord", + "configure_security_passwordprotectedaccess_clear": + "Rensa", + "configure_system_httpcache": + "Http-servicecache", + "configure_maintenance_configuration_info": + "Notis: innan du återställer en backup behöver du sätta samma systemlösenord som när backupen togs.", + "configure_maintenance_configuration_backup": + "Backup", + "configure_maintenance_configuration_restore": + "Återställ Backup", + "configure_maintenance_configuration_factory_reset": + "Fabriksåterställ", + "configure_system_modulescleanup": + "Rensa moduler", + "configure_system_modulesselect": + "Välj moduler", + "configure_system_remotemodules": + "Fjärrmoduler kopplingar", + "configure_system_modsroutingreset": + "Återställ", + "configure_system_userinterface": + "Användargränssnitt", + "configure_system_eventshistory": + "Händelsehistorik", + "home_about_version": + "version", + "home_about_codename": + "kodnamn", + "home_about_motto": + "måtto", + "home_about_concept": + "Koncept, design, idéer och kodning
    av G-Labs", + "home_about_license": + "licens", + "home_about_site": + "Hemsida och Hjälp", + "home_about_site_docs": + "Dokumentation", + "actions_menu": + "val", + "control_group_configure": + "konfigurera Grupp", + "control_macrorecord_record_macro": + "Spela in Macro", + "control_macrorecord_recording": + "Spelar in...", + "control_macrorecord_description": + "Alla kommandon spelas nu in till ett Wissardscript.
    Tryck på Spara-knappen när du är klar.", + "control_macrorecord_close": + "Stäng", + "control_macrorecord_options": + "Val", + "control_macrorecord_options_pause": + "Pausa mellan kommandon", + "control_macrorecord_options_none": + "Ingen", + "control_macrorecord_options_mimic": + "Ursprunglig", + "control_macrorecord_options_fixed": + "Sätt", + "control_macrorecord_options_pauseduration": + "Förvald paus (sekunder)", + "update_options_popup_loading": + "Laddar programdata", + "control_widget_notconfigured_title": + "Widgeten är inte konfigurerad", + "control_widget_notconfigured_text": + "Klicka här för att ändra konfiguration.", + "control_widget_notconfigured_button": + "Stäng", + "configure_program_options_details": + "Detaljer", + "configure_program_options_restart": + "Starta om", + "configure_program_details_implemfeatures": + "Implementerade funktioner", + "configure_program_details_configoptions": + "Konfigurationsval", + "configure_program_details_moduleparams": + "Modulvärden", + "configure_group_actionmenu_deletegroup": + "Ta bort Grupp", + "configure_group_actionmenu_addseparatorlabel": + "Lägg till avdelare", + "configure_group_actionmenu_addmodule": + "Lägg till Modul", + "configure_separator_edit": + "Namnge avdelare", + "configure_separator_label": + "Namn", + "configure_separator_placeholder": + "skriv namn", + "configure_module_optaddseparator": + "Uppdatera", + "configure_module_parameters": + "Ändra modulvärden", + "configure_module_parameters_delete": + "Ta bort", + "configure_module_parameters_save": + "Spara", + "configure_module_parameters_linktitle": + "Modulvärden", + "configure_automationgroup_add": + "Lägg till", + "configure_programslist_listtitle": + "Programlista", + "configure_programslist_tap_disable": + "Tryck för att INAKTIVERA programmet", + "configure_programslist_tap_enable": + "Tryck för att AKTIVERA programmet", + "configure_programslist_deletegroup": + "Ta Bort Grupp", + "configure_programslist_importprogram": + "Importera program", + "configure_programslist_addnewprogram": + "Lägg till program", + "configure_programslist_refreshlist": + "Uppdatera lista", + "configure_programslist_import": + "Importera", + "configure_program_summary": + "Summering", + "configure_program_programcode": + "Programkod", + "configure_program_sketchcode": + "Sketch-kod", + "configure_program_triggercode": + "Triggerkod", + "configure_program_makefile": + "Makefile", + "configure-editprogram-addcommand": + "Lägg till Kommando", + "configure-editprogram-addcondition": + "Lägg till villkor", + "configure-editprogram-capture": + "Spela in", + "configure-editprogram-help": + "Hjälp", + "configure_program_triggertype": + "Triggas", + "configure_editprogram_options_delete": + "Ta Bort Program", + "configure_editprogram_saving_succeed": + "Sparar..", + "configure_editprogram_saving": + "Uppdaterar programdata", + "configure_editprogram_error_updating": + "Fel vid uppdatering av program!", + "configure_editprogram_compile": + "Kompilera", + "systemsettings_selectport_title": + "Notis", + "systemsettings_selectport_placeholder": + "(välj port...)", + "systemsettings_selectport_text": + "Välj vilken port som enheten använder", + "systemsettings_selectport_button": + "Stäng", + "configure_group_newgroupconfirm": + "Ok", + "configure_module_optremoveseparator": + "Ta bort", + "configure_program_selectcommandtarget": + "Välj målenhet", + "configure_program_selectcommandtoperform": + "Välj kommando att utföra", + "configure_program_commandcustom": + "Eget API-kommando", + "configure_program_wizardproceed": + "Fortsätt", + "configure_program_commandcapturetitle": + "Spelar in kommandon", + "configure_program_waitingnewcommand": + "Väntar på nya kommandon...", + "configure_program_waitingnewcommandadvice": + "", + "configure_program_capturestop": + "Stoppa inspelning", + "configure_program_wizard_editline_title": + "Ändra rad", + "configure_program_wizard_editcmdline_prompt": + "Flytta eller ta bort rad ", + "configure_program_wizard_editconline_prompt": + "Flytta eller ta bort rad ", + "configure_program_wizard_editline_number": + "Nytt radnummer", + "configure_program_wizard_editline_delete": + "Ta bort", + "configure_program_wizard_editline_change": + "Flytta", + "configure_program_selectconditionsubject": + "Välj Villkorsundergrupp", + "configure_program_selectconditionproperty": + "Välj Villkorsegenskap", + "configure_program_conditioncapturetitle": + "Spelar in händelser", + "configure_program_waitingnewcondition": + "Väntar på nya händelser...", + "configure_program_waitingnewconditionadvice": + "", + "configure_program_options_update": + "Uppdatera", + "configure_system_updateinstall": + "Uppdatera Installation", + "configure_system_deletemodule": + "Ta Bort Modul", + "systemsettings_backuprestores1selectallnone": + "Välj alla / inga", + "securitysettings_password_setpassword": + "Ändra lösenord", + "securitysettings_password_enterpassword": + "Skriv in lösenord för 'admin'", + "maintenance_configuration_servicerestart": + "Starta Om Tjänst?", + "configure_maintenance_restartprompt": + "Är du säker på att du vill starta om tjänsten?", + "configure_maintenance_restartwarning": + "", + "configure_module_typemediareceiver": + "Mediamottagare", + "configure_module_typemediatransmitter": + "Mediasändare", + "configure_module_featuresoptions": + "Verktyg/Inställningar", + "configure_editprogram_files": + "Filer", + "configure_program_newfile": + "Lägg till fil", + "configure_program_filename": + "Filnamn", + "configure_program_fileslist": + "Fillista", + "configure_program_fileslist_exit": + "Gå ur", + "configure_program_fileslist_delete": + "Ta bort", + "configure_program_fileslist_edit": + "Ändra", + "configure_program_fileslist_add": + "Lägg till", + "configure_program_hasmodification": + "Programet har ändrats!", + "configure_program_savechangesprompt": + "Vill du spara förändringar?", + "configure_program_changeswillbelost": + "", + "configure_program_dontsave": + "Nej", + "configure_program_saveconfirm": + "Spara", + "statistics_dataanalysis": + "Dataanalys", + "statistics_counterexpense": + "Räknare och kostnad", + "analyze_statistics_datefrom": + "Från", + "analyze_statistics_dateto": + "Till", + "analyze_statistics_costperunit": + "Kostnad per enhet", + "analyze_statistics_overallcounter": + "Totalräknare", + "analyze_statistics_totalexpense": + "Totalkostnad", + "configure_program_oroperator": + "Eller operator", + "configure_system_statistics_clear": + "Rensa all statistik", + "configure_system_statistics_databasemaxsize": + "Max databasstorlek", + "configure_system_statistics_changedatabasemaxsize": + "Ändra", + "configure_system_statistics_databasemaxsizechange": + "Max storlek (MB)", + "configure_system_statistics_databasemaxsizechange_cancel": + "Avbryt", + "configure_system_statistics_databasemaxsizechange_commit": + "Ändra", + "configure_popupfilter_title": + "Händelsepopupfilter", + "configure_popupfilter_optclose": + "Stäng", + "configure_system_blockedpopups": + "Blockerade popups", + "configure_system_blockedpopups_edit": + "Ändra", + "configure_system_updateinstall_warning": + "Det är starkt rekommenderat att ta en backup av konfigurationen innan man kör en uppdatering.", + "configure_automationgroup_widgeteditor": + "Widgethanterare", + "configure_widgetlist_heading": + "Widgetar
    List", + "configure_widgetlist_importwidget": + "Importera Widget", + "configure_widgetlist_import": + "Importera", + "configure_widgetlist_add_popuptitle": + "Ny Widget", + "configure_widgetlist_add_widgetbrand": + "Märke", + "configure_widgetlist_add_widgetcategory": + "Kategori", + "configure_widgetlist_add_widgetname": + "Namn", + "configure_widgetlist_newwidgetconfirm": + "Lägg till", + "configure_widgetlist_action_import": + "Importera", + "configure_widgetlist_action_addwidget": + "Lägg till Widget", + "configure_widgeteditor_html": + "HTML", + "configure_widgeteditor_javascript": + "Javascript", + "configure_widgeteditor_previewupdate": + "Kör / Förhandsgranska", + "configure_widgeteditor_hasmodification": + "Widgeten har ändrats!", + "configure_widgeteditor_deletetitle": + "Ta Bort Widget?", + "configure_widgeteditor_deleteprompt": + "Är du säker på att du vill ta bort widgeten?", + "configure_widgetlist_list": + "Widgetlista", + "configure_widgeteditor_nobindmodule_title": + "Välj en modul", + "configure_widgeteditor_nobindmodule_text": + "Ingen giltig modul har hittats för datakoppling. Välj en.", + "configure_widgeteditor_nobindmodule_close": + "Stäng", + "configure_widgeteditor_bindtomodule": + "bind till modul", + "configure_widgeteditor_selectmodule_placeholder": + "(välj modul)", + "configure_widgeteditor_title": + "Widgethanteraren", + "configure_widgeteditor_savinghtml": + "Sparar HTML...", + "configure_widgeteditor_savingjavascript": + "Sparar Javascript...", + "configure_interfaces_importdriver": + "Installera Interface", + "configure_interfaces_download": + "Ladda ner och installera", + "configure_interfaces_upload": + "Ladda upp och installera", + "configure_interfaces_install": + "Installera Interface", + "configure_interfaces_downloadfromurl": + "Ladda ner paket från URL", + "configure_interfaces_uploadpackage": + "Ladda upp paket från fil", + "cronwizard_title": + "Cron-Guide", + "cronwizard_tab_minute": + "Minut", + "cronwizard_tab_hour": + "Timme", + "cronwizard_tab_dayofmonth": + "Dag i månaden", + "cronwizard_tab_month": + "Månad", + "cronwizard_tab_dayofweek": + "Dag i veckan", + "cronwizard_event_willoccur": + "Den här händelsen kommer ske", + "cronwizard_minuteselect_everyminute": + "varje minut", + "cronwizard_minuteselect_everysomeminute": + "varje <n> minut", + "cronwizard_minuteselect_eachselected": + "varje vald minut", + "cronwizard_hourselect_everyhour": + "varje timme", + "cronwizard_hourselect_everysomehour": + "varje <n> timme", + "cronwizard_hourselect_eachselected": + "varje vald timme", + "cronwizard_dayselect_everyday": + "varje dag", + "cronwizard_dayselect_eachselected": + "varje vald dag", + "cronwizard_monthselect_everymonth": + "varje månad", + "cronwizard_monthselect_eachselected": + "varje vald månad", + "cronwizard_dayowselect_everydayow": + "alla dagar i veckan", + "cronwizard_dayowselect_eachselected": + "varje vald dag i veckan", + "cronwizard_event_name": + "Event name", + "cronwizard_typeselect_days": + "days", + "cronwizard_typeselect_period": + "date period", + "cronwizard_typeselect_custom": + "custom cron expression", + "cronwizard_event_description": + "Description", + "cronwizard_date_from": + "from", + "cronwizard_date_to": + "to", + "cronwizard_time_exact": + "at exact time", + "cronwizard_time_range": + "during a time range", + "cronwizard_time_start": + "start", + "cronwizard_time_end": + "end", + "cronwizard_time_at": + "at", + "cronwizard_event_occurrence": + "Occurrence", + "cronwizard_event_cronexpr": + "Cron expression", + "cronwizard_event_runscript": + "Run script on event occurrence", + "cronwizard_description_from": + "from", + "cronwizard_description_to": + "to", + "cronwizard_description_on": + "on", + "cronwizard_description_starting": + "starting at", + "cronwizard_description_ending": + "ending at", + "cronwizard_description_at": + "at", + "no_device_found_for_manufacturerId": + "Ingen enhetsinfo för tillverkarens ID", + "common_month_jan": + "Jan", + "common_month_feb": + "Feb", + "common_month_mar": + "Mar", + "common_month_apr": + "Apr", + "common_month_may": + "Maj", + "common_month_jun": + "Jun", + "common_month_jul": + "Jul", + "common_month_aug": + "Aug", + "common_month_sep": + "Sep", + "common_month_oct": + "Okt", + "common_month_nov": + "Nov", + "common_month_dec": + "Dec", + "common_dayofweek_sun": + "Sön", + "common_dayofweek_mon": + "Mån", + "common_dayofweek_tue": + "Tis", + "common_dayofweek_wed": + "Ons", + "common_dayofweek_thu": + "Tor", + "common_dayofweek_fri": + "Fre", + "common_dayofweek_sat": + "Lör", + "common_command_cancel": + "Avbryt", + "common_command_ok": + "Ok", + "common_command_proceed": + "Fortsätt", + "common_command_save": + "Spara", + "common_status_notset": + "Ej satt", + "common_voice_control": + "Röststyrning", + "common_command_delete": + "Ta bort", + "common_command_upload": + "Ladda upp", + "common_select_none": + "Ingen", + "common_command_exit": + "Gå ur", + "common_command_close": + "Stäng", + "common_command_module": + "Modul", + "common_command_modules": + "Moduler", +"##": +"## SIDE MENU LOCALES", +"##": +"##", + "home_menu_home": + "Hem", + "home_menu_groups": + "Grupper", + "home_menu_statistics": + "Statistik", + "home_menu_automation": + "Automatik", + "home_menu_programeditor": + "Program", + "home_menu_widgeteditor": + "Widgetar", + "home_menu_scheduler": + "Schemaläggare", + "home_menu_system": + "System", + "home_menu_settings": + "Inställningar", + "home_menu_maintenance": + "Underhåll", + "home_menu_about": + "Om", + "home_menu_about_homegenie": + "Om HomeGenie", + "home_menu_about_version": + "Version", + "home_menu_about_whatshot": + "Hett just nu!", + "home_menu_about_userguide": + "Manual", + "home_menu_about_programming": + "Programmeringsguide", + "home_menu_about_forum": + "Användarforum", + "home_menu_about_support": + "Stöd HomeGenie" } \ No newline at end of file diff --git a/BaseFiles/Common/html/pages/configure/maintenance/main.html b/BaseFiles/Common/html/pages/configure/maintenance/main.html index 808f8cc02..e847c181f 100644 --- a/BaseFiles/Common/html/pages/configure/maintenance/main.html +++ b/BaseFiles/Common/html/pages/configure/maintenance/main.html @@ -340,10 +340,8 @@

    HTTP Service Port

    Note: after changing port HomeGenie must be restarted to make changes effective!

    -

    - - -

    + +
    Cancel @@ -461,7 +459,7 @@

    Maximum S

    -

    diff --git a/BaseFiles/Common/html/ui/core/popup.cronwizard.html b/BaseFiles/Common/html/ui/core/popup.cronwizard.html index 1c9857cc1..5eb63d4b0 100644 --- a/BaseFiles/Common/html/ui/core/popup.cronwizard.html +++ b/BaseFiles/Common/html/ui/core/popup.cronwizard.html @@ -1,22 +1,22 @@ -
    +

    Cron event Wizard

    -
    +
    - Event name
    + Event name
    Type
    - Description
    + Description
    @@ -202,7 +202,7 @@

    Cron event Wizard

    -
    Run script on event occurrence
    +
    Run script on event occurrence
    diff --git a/BaseFiles/Common/html/ui/core/popup.cronwizard.js b/BaseFiles/Common/html/ui/core/popup.cronwizard.js index 83f5cfb90..c88742237 100644 --- a/BaseFiles/Common/html/ui/core/popup.cronwizard.js +++ b/BaseFiles/Common/html/ui/core/popup.cronwizard.js @@ -345,6 +345,11 @@ $$.open = function(name) { item.Data.itemType = 3; } $$.item = item; + // backward compatibility for hg < r522 + if ((typeof $$.item.ProgramId != 'undefined' && $$.item.ProgramId != '') && (typeof $$.item.Script == 'undefined' || $$.item.Script == '')) { + $$.item.ProgramId = ''; + $$.item.Script = "$$.program.run('"+$$.item.ProgramId+"');"; + } $$._init(); $$.element.popup('open'); $.mobile.loading('hide'); @@ -690,20 +695,27 @@ $$._buildCron = function() { // Update the human readable output $.get('/api/HomeAutomation.HomeGenie/Automation/Scheduling.Describe/'+encodeURIComponent(cronOccur), function(res){ + var locales = HG.WebApp.Locales; var desc = ''; + var text_on = locales.GetLocaleString('cronwizard_description_on', 'on'); + var text_from = locales.GetLocaleString('cronwizard_description_from', 'from'); + var text_to = locales.GetLocaleString('cronwizard_description_to', 'to'); if ($$.cronTypeSelect.val() == '2') { if ($$.dateFrom.val() == $$.dateTo.val()) { - desc+= 'on '+moment($$.dateFrom.val()).format('MMMM DD')+ ', '; + desc+= text_on+' '+moment($$.dateFrom.val()).format('MMMM DD')+ ', '; } else { - desc+= 'from '+moment($$.dateFrom.val()).format('MMMM DD'); - desc+= ' to '+moment($$.dateTo.val()).format('MMMM DD')+ ', '; + desc+= text_from+' '+moment($$.dateFrom.val()).format('MMMM DD'); + desc+= ' '+text_to+' '+moment($$.dateTo.val()).format('MMMM DD')+ ', '; } } + var text_starting_at = locales.GetLocaleString('cronwizard_description_starting', 'starting at'); + var text_ending_at = locales.GetLocaleString('cronwizard_description_ending', 'and ending at'); + var text_at = locales.GetLocaleString('cronwizard_description_at', 'at'); if ($$.timeStart.val() == $$.timeEnd.val()) { - desc+= 'at '+moment($$.timeEnd.val(), 'HH:mm').format('LT'); + desc+= text_at+' '+moment($$.timeEnd.val(), 'HH:mm').format('LT'); } else { - desc+= 'starting at '+moment($$.timeStart.val(), 'HH:mm').format('LT'); - desc+= ' and ending at '+moment($$.timeEnd.val(), 'HH:mm').format('LT'); + desc+= text_starting_at+' '+moment($$.timeStart.val(), 'HH:mm').format('LT'); + desc+= ' '+text_ending_at+' '+moment($$.timeEnd.val(), 'HH:mm').format('LT'); } if ($$.timeStart.val() == $$.timeEnd.val()) { if (cronOccur != emptyOccur) diff --git a/BaseFiles/Common/html/ui/widgets/cron.text.js b/BaseFiles/Common/html/ui/widgets/cron.text.js index 9a50332b1..f9d86a950 100644 --- a/BaseFiles/Common/html/ui/widgets/cron.text.js +++ b/BaseFiles/Common/html/ui/widgets/cron.text.js @@ -107,7 +107,10 @@ .text(currentItem); _this.cronSelect.append(entry); } + var prevItem = _this.cronSelect.val(); _this.cronSelect.val(currentItem).selectmenu('refresh'); + if (currentItem != prevItem) + _this.cronSelect.trigger('change'); if (typeof currentItem != 'undefined' || currentItem == '') _this.element.find('[data-ui-field=cronwiz-edit]').addClass('ui-disabled'); diff --git a/HISTORY.TXT b/HISTORY.TXT index efec8eb4e..716b9235c 100644 --- a/HISTORY.TXT +++ b/HISTORY.TXT @@ -1,5 +1,14 @@ RELEASE HISTORY +05/06/2016 v1.1-beta.522 + - Added new API method '/api/HomeAutomation.HomeGenie/Automation/Scheduling.ListOccurrences' + - Added 'SetScript', 'SetData' and 'Get' methods to Scheduler helper + - Added new wallpapers + - Improved MQTT helper class + - Added parity/stop bits options to serial port helper (PR #278) + - Brand new cron event wizard for scheduled events with inline script editor + - Helper class accessor in Javascript automation programs is now "$$" + 15/05/2016 v1.1-beta.521 - Added "Manual Update" option to maintenance page - Updates can now be installed from .tgz release files diff --git a/HomeGenie/Automation/Scheduler/SchedulerScriptingEngine.cs b/HomeGenie/Automation/Scheduler/SchedulerScriptingEngine.cs index d8f227ad8..858d1a32b 100644 --- a/HomeGenie/Automation/Scheduler/SchedulerScriptingEngine.cs +++ b/HomeGenie/Automation/Scheduler/SchedulerScriptingEngine.cs @@ -4,6 +4,7 @@ using System.Threading; using System.Collections.Generic; using HomeGenie.Service.Constants; +using Newtonsoft.Json; namespace HomeGenie.Automation.Scheduler { @@ -74,7 +75,7 @@ public void StartScript() StopScript(); isRunning = true; - homegenie.RaiseEvent(this, Domains.HomeAutomation_HomeGenie, SourceModule.Scheduler, eventItem.Name, "EventScript.Status", "Start"); + homegenie.RaiseEvent(this, Domains.HomeAutomation_HomeGenie, SourceModule.Scheduler, eventItem.Name, "EventScript.Status", eventItem.Name+":Start"); programThread = new Thread(() => { @@ -93,15 +94,8 @@ public void StartScript() programThread = null; isRunning = false; if (result != null && result.Exception != null && !result.Exception.GetType().Equals(typeof(System.Reflection.TargetException))) - { - // runtime error occurred, script is being disabled - // so user can notice and fix it - //List error = new List() { scriptEngine.GetFormattedError(result.Exception, false) }; - //programBlock.ScriptErrors = JsonConvert.SerializeObject(error); - //programBlock.IsEnabled = false; - //homegenie.ProgramManager.RaiseProgramModuleEvent(programBlock, Properties.RuntimeError, "CR: " + result.Exception.Message.Replace('\n', ' ').Replace('\r', ' ')); - } - homegenie.RaiseEvent(this, Domains.HomeAutomation_HomeGenie, SourceModule.Scheduler, eventItem.Name, "EventScript.Status", "End"); + homegenie.RaiseEvent(this, Domains.HomeAutomation_HomeGenie, SourceModule.Scheduler, eventItem.Name, "EventScript.Status", eventItem.Name+":Error ("+result.Exception.Message.Replace('\n', ' ').Replace('\r', ' ')+")"); + homegenie.RaiseEvent(this, Domains.HomeAutomation_HomeGenie, SourceModule.Scheduler, eventItem.Name, "EventScript.Status", eventItem.Name+":End"); //homegenie.RaiseEvent(programBlock, Properties.ProgramStatus, programBlock.IsEnabled ? "Idle" : "Stopped"); } catch (ThreadAbortException) @@ -109,7 +103,7 @@ public void StartScript() programThread = null; isRunning = false; if (homegenie.ProgramManager != null) - homegenie.RaiseEvent(this, Domains.HomeAutomation_HomeGenie, SourceModule.Scheduler, eventItem.Name, "EventScript.Status", "Interrupted"); + homegenie.RaiseEvent(this, Domains.HomeAutomation_HomeGenie, SourceModule.Scheduler, eventItem.Name, "EventScript.Status", eventItem.Name+":Interrupted"); } }); diff --git a/HomeGenie/Automation/Scheduler/SchedulerService.cs b/HomeGenie/Automation/Scheduler/SchedulerService.cs index e4a4560b8..7b026f0e9 100644 --- a/HomeGenie/Automation/Scheduler/SchedulerService.cs +++ b/HomeGenie/Automation/Scheduler/SchedulerService.cs @@ -159,7 +159,18 @@ public SchedulerItem AddOrUpdate(string name, string cronExpression, string data } return eventItem; } + public bool SetData(string name, string jsonData) + { + var eventItem = Get(name); + if (eventItem != null) + { + eventItem.Data = jsonData; + return true; + } + return false; + } + [Obsolete("use 'SetScript' instead")] public bool SetProgram(string name, string pid) { var eventItem = Get(name); @@ -171,6 +182,17 @@ public bool SetProgram(string name, string pid) return false; } + public bool SetScript(string name, string script) + { + var eventItem = Get(name); + if (eventItem != null) + { + eventItem.Script = script; + return true; + } + return false; + } + public bool Enable(string name) { var eventItem = Get(name); diff --git a/HomeGenie/Automation/Scripting/SchedulerHelper.cs b/HomeGenie/Automation/Scripting/SchedulerHelper.cs index 017f22dc8..209e3a749 100644 --- a/HomeGenie/Automation/Scripting/SchedulerHelper.cs +++ b/HomeGenie/Automation/Scripting/SchedulerHelper.cs @@ -56,6 +56,14 @@ public SchedulerHelper WithName(string name) return this; } + /// + /// Get the selected schedule instance. + /// + public SchedulerItem Get() + { + return homegenie.ProgramManager.SchedulerService.Get(scheduleName); + } + /// /// Add/Modify the schedule with the previously selected name. /// @@ -66,16 +74,37 @@ public SchedulerHelper SetSchedule(string cronExpression) return this; } + /// + /// Sets the json data representing this schedule definition. + /// + /// JSON data string. + public SchedulerHelper SetData(string data) + { + homegenie.ProgramManager.SchedulerService.SetData(scheduleName, data); + return this; + } + /// /// Sets the program id to run when the selected schedule occurs. /// /// Program ID. + [Obsolete("use 'SetScript' instead")] public SchedulerHelper SetProgram(string programId) { homegenie.ProgramManager.SchedulerService.SetProgram(scheduleName, programId); return this; } + /// + /// Sets the script (hg javascript) to run when the selected schedule occurs. + /// + /// HomeGenie Javascript code + public SchedulerHelper SetScript(string script) + { + homegenie.ProgramManager.SchedulerService.SetScript(scheduleName, script); + return this; + } + /// /// Determines whether the selected schedule is matching in this very moment. /// diff --git a/HomeGenie/Service/Handlers/Automation.cs b/HomeGenie/Service/Handlers/Automation.cs index b0e93fdfa..953104dd3 100644 --- a/HomeGenie/Service/Handlers/Automation.cs +++ b/HomeGenie/Service/Handlers/Automation.cs @@ -127,29 +127,36 @@ public void ProcessRequest(MigClientRequest request) case "Scheduling.Get": request.ResponseData = homegenie.ProgramManager.SchedulerService.Get(migCommand.GetOption(0)); break; - case "Scheduling.List": - homegenie.ProgramManager.SchedulerService.Items.Sort((SchedulerItem s1, SchedulerItem s2) => + case "Scheduling.ListOccurrences": + int hours = 24; + int.TryParse(migCommand.GetOption(0), out hours); + DateTime dateStart = DateTime.Today.ToUniversalTime(); + string startFrom = migCommand.GetOption(1); + if (!String.IsNullOrWhiteSpace(startFrom)) + dateStart = Utility.JavascriptToDate(long.Parse(startFrom)); + List nextList = new List(); + foreach (var ce in homegenie.ProgramManager.SchedulerService.Items) { - return s1.Name.CompareTo(s2.Name); - }); - /* - var d = DateTime.Today.ToUniversalTime(); - foreach (var ce in homegenie.ProgramManager.SchedulerService.Items) - { - int occurrences = 0; - for (int m = 0; m < 1440; m++) + var evt = new { Name = ce.Name, Description = ce.Description, RunScript = !String.IsNullOrWhiteSpace(ce.Script), Occurrences = new List() }; + var d = dateStart; + for (int m = 0; m < hours * 60; m++) { if (homegenie.ProgramManager.SchedulerService.IsScheduling(d, ce.CronExpression)) { - Console.WriteLine("{0} {1}", d, JsonConvert.SerializeObject(ce)); - occurrences++; - if (occurrences > 10) - break; + evt.Occurrences.Add(Utility.DateToJavascript(d)); } d = d.AddMinutes(1); } + if (evt.Occurrences.Count > 0) + nextList.Add(evt); } - */ + request.ResponseData = nextList; + break; + case "Scheduling.List": + homegenie.ProgramManager.SchedulerService.Items.Sort((SchedulerItem s1, SchedulerItem s2) => + { + return s1.Name.CompareTo(s2.Name); + }); request.ResponseData = homegenie.ProgramManager.SchedulerService.Items; break; case "Scheduling.Describe": diff --git a/HomeGenie/Service/Handlers/Statistics.cs b/HomeGenie/Service/Handlers/Statistics.cs index 0a25dcba2..a96a04daa 100644 --- a/HomeGenie/Service/Handlers/Statistics.cs +++ b/HomeGenie/Service/Handlers/Statistics.cs @@ -60,7 +60,7 @@ public void ProcessRequest(MigClientRequest request) case "Global.TimeRange": var totalRange = homegenie.Statistics.GetDateRange(); - request.ResponseData = "{ \"StartTime\" : \"" + DateToJavascript(totalRange.TimeStart).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "\", \"EndTime\" : \"" + DateToJavascript(totalRange.TimeEnd).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "\" }"; + request.ResponseData = "{ \"StartTime\" : \"" + Utility.DateToJavascript(totalRange.TimeStart).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "\", \"EndTime\" : \"" + Utility.DateToJavascript(totalRange.TimeEnd).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "\" }"; break; case "Database.Reset": @@ -99,8 +99,8 @@ public void ProcessRequest(MigClientRequest request) response += "[ "; // var hoursAverage = new List(); - dateStart = JavascriptToDate(long.Parse(migCommand.GetOption(2))); - dateEnd = JavascriptToDate(long.Parse(migCommand.GetOption(3))); + dateStart = Utility.JavascriptToDate(long.Parse(migCommand.GetOption(2))); + dateEnd = Utility.JavascriptToDate(long.Parse(migCommand.GetOption(3))); hoursAverage = homegenie.Statistics.GetHourlyCounter(domain, address, migCommand.GetOption(0), 3600, dateStart, dateEnd); // for (int h = 0; h < 24; h++) @@ -117,12 +117,12 @@ public void ProcessRequest(MigClientRequest request) sum = (double)(hoursAverage.FindAll(se => se.TimeStart.ToLocalTime().Hour == h).Sum(se => se.Value)); // date is normalized to the current date, time info is preserved from original data entry var date = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " " + h.ToString("00") + ":00:00"); - response += "[" + DateToJavascript(date).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "," + sum.ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "],"; + response += "[" + Utility.DateToJavascript(date).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "," + sum.ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "],"; } else { var date = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " " + h.ToString("00") + ":00:00"); - response += "[" + DateToJavascript(date).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + ",0.000],"; + response += "[" + Utility.DateToJavascript(date).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + ",0.000],"; } } response = response.TrimEnd(','); @@ -141,8 +141,8 @@ public void ProcessRequest(MigClientRequest request) // response = "["; // - dateStart = JavascriptToDate(long.Parse(migCommand.GetOption(2))); - dateEnd = JavascriptToDate(long.Parse(migCommand.GetOption(3))); + dateStart = Utility.JavascriptToDate(long.Parse(migCommand.GetOption(2))); + dateEnd = Utility.JavascriptToDate(long.Parse(migCommand.GetOption(3))); var hoursAverages = new List[5]; hoursAverages[0] = homegenie.Statistics.GetHourlyStats(domain, address, migCommand.GetOption(0), "Min", dateStart, dateEnd); hoursAverages[1] = homegenie.Statistics.GetHourlyStats(domain, address, migCommand.GetOption(0), "Max", dateStart, dateEnd); @@ -216,12 +216,12 @@ public void ProcessRequest(MigClientRequest request) } // date is normalized to the current date, time info is preserved from original data entry var date = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " " + h.ToString("00") + ":00:00"); - response += "[" + DateToJavascript(date).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "," + sum.ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "],"; + response += "[" + Utility.DateToJavascript(date).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "," + sum.ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "],"; } else { var date = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " " + h.ToString("00") + ":00:00"); - response += "[" + DateToJavascript(date).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + ",0.000],"; + response += "[" + Utility.DateToJavascript(date).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + ",0.000],"; } } response = response.TrimEnd(','); @@ -233,7 +233,7 @@ public void ProcessRequest(MigClientRequest request) foreach (var entry in hoursAverages[4]) { var date = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " " + entry.TimeStart.ToLocalTime().ToString("HH:mm:ss.ffffff")); - response += "[" + DateToJavascript(date).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "," + entry.Value.ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "],"; + response += "[" + Utility.DateToJavascript(date).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "," + entry.Value.ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "],"; } response = response.TrimEnd(','); response += " ]"; @@ -251,14 +251,14 @@ public void ProcessRequest(MigClientRequest request) // response = "["; // - dateStart = JavascriptToDate(long.Parse(migCommand.GetOption(2))); - dateEnd = JavascriptToDate(long.Parse(migCommand.GetOption(3))); + dateStart = Utility.JavascriptToDate(long.Parse(migCommand.GetOption(2))); + dateEnd = Utility.JavascriptToDate(long.Parse(migCommand.GetOption(3))); var daysAverages = new List[1]; daysAverages[0] = homegenie.Statistics.GetHourlyStats(domain, address, migCommand.GetOption(0), "", dateStart, dateEnd); response += "[ "; foreach (var entry in daysAverages[0]) { - response += "[" + DateToJavascriptLocal(entry.TimeStart).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "," + entry.Value.ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "],"; + response += "[" + Utility.DateToJavascriptLocal(entry.TimeStart).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "," + entry.Value.ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "],"; } response = response.TrimEnd(','); response += " ]"; @@ -269,8 +269,8 @@ public void ProcessRequest(MigClientRequest request) case "Parameter.StatsMultiple": response = "["; // - dateStart = JavascriptToDate(long.Parse(migCommand.GetOption(2))); - dateEnd = JavascriptToDate(long.Parse(migCommand.GetOption(3))); + dateStart = Utility.JavascriptToDate(long.Parse(migCommand.GetOption(2))); + dateEnd = Utility.JavascriptToDate(long.Parse(migCommand.GetOption(3))); var daysMultiples = new List[1]; daysMultiples[0] = homegenie.Statistics.GetHourlyStats(domain, address, migCommand.GetOption(0), "All", dateStart, dateEnd); response += "[ "; @@ -289,7 +289,7 @@ public void ProcessRequest(MigClientRequest request) response += "[\"" + entry.CustomData + "\"] ],[ "; moduleName = entry.CustomData; } - response += "[" + DateToJavascriptLocal(entry.TimeStart).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "," + entry.Value.ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "],"; + response += "[" + Utility.DateToJavascriptLocal(entry.TimeStart).ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "," + entry.Value.ToString("0.000", System.Globalization.CultureInfo.InvariantCulture) + "],"; } response = response.TrimEnd(','); response += " ]"; @@ -322,7 +322,7 @@ public void ProcessRequest(MigClientRequest request) case "Parameter.StatDelete": response = "["; var dateText = migCommand.GetOption(0).Replace('.', ','); - dateStart = JavascriptToDateUtc(double.Parse(dateText)); + dateStart = Utility.JavascriptToDateUtc(double.Parse(dateText)); var responseDelete = homegenie.Statistics.DeleteStat(dateStart, migCommand.GetOption(1)); response += "[Response," + responseDelete + "]"; response += "]"; @@ -331,26 +331,5 @@ public void ProcessRequest(MigClientRequest request) } } - private DateTime JavascriptToDate(long timestamp) - { - var baseDate = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc); - return (baseDate.AddMilliseconds(timestamp)); - } - - private DateTime JavascriptToDateUtc(double timestamp) - { - var baseDate = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Local); - return (baseDate.AddMilliseconds(timestamp).ToUniversalTime()); - } - - private double DateToJavascript(DateTime date) - { - return ((date.Ticks - 621355968000000000L) / 10000D); - } - - private double DateToJavascriptLocal(DateTime date) - { - return ((date.ToLocalTime().Ticks - 621355968000000000L) / 10000D); - } } } diff --git a/HomeGenie/Service/Utility.cs b/HomeGenie/Service/Utility.cs index 26bac8440..2642906cd 100644 --- a/HomeGenie/Service/Utility.cs +++ b/HomeGenie/Service/Utility.cs @@ -518,6 +518,28 @@ internal static Thread RunAsyncTask(AsyncFunction functionBlock) return asyncTask; } + public static DateTime JavascriptToDate(long timestamp) + { + var baseDate = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc); + return (baseDate.AddMilliseconds(timestamp)); + } + + public static DateTime JavascriptToDateUtc(double timestamp) + { + var baseDate = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Local); + return (baseDate.AddMilliseconds(timestamp).ToUniversalTime()); + } + + public static double DateToJavascript(DateTime date) + { + return ((date.Ticks - 621355968000000000L) / 10000D); + } + + public static double DateToJavascriptLocal(DateTime date) + { + return ((date.ToLocalTime().Ticks - 621355968000000000L) / 10000D); + } + #endregion } diff --git a/HomeGenie/release_info.xml b/HomeGenie/release_info.xml index d8d084d7b..69e450e6d 100644 --- a/HomeGenie/release_info.xml +++ b/HomeGenie/release_info.xml @@ -1,9 +1,8 @@  HomeGenie - 1.1 beta r521 + 1.1 beta r522 Latest public release. - - Added "Manual Update" option to maintenance page - - Updates can now be installed from .tgz release files - 2016-05-15T15:22:18.0000Z + + 2016-06-05T09:08:07.0000Z diff --git a/HomeGenie_Linux/Packager/DEBIAN/md5sums b/HomeGenie_Linux/Packager/DEBIAN/md5sums index 842b36e5c..e00937801 100644 --- a/HomeGenie_Linux/Packager/DEBIAN/md5sums +++ b/HomeGenie_Linux/Packager/DEBIAN/md5sums @@ -3,10 +3,10 @@ 9f96aee193d53a925d18b2769e7958e0 usr/local/bin/homegenie/Ude.dll 1dcf890d5a0ac7fdcd3db320b629a3ca usr/local/bin/homegenie/Raspberry.IO.Components.dll.config b6df33c0bb71432909c278561f6fdb9c usr/local/bin/homegenie/Common.Logging.dll -141c960eb10370052d82d91eb09a1faa usr/local/bin/homegenie/release_info.xml -961ca7869699fdb0913fc0a8d2d3aa0e usr/local/bin/homegenie/Linux.dll.mdb +eeda25cb064ed362e68f682c4fd2cf74 usr/local/bin/homegenie/release_info.xml +d41cdd52800b4bdf9c06e385d16931e3 usr/local/bin/homegenie/Linux.dll.mdb 26aa2c76b7c6a102291cb3df7b06e2db usr/local/bin/homegenie/IronPython.Modules.dll -83b12f6a911fc5645583f16a693e4260 usr/local/bin/homegenie/HomeGenie.exe +d7c78cb006897f3727ed02f67bcad5a0 usr/local/bin/homegenie/HomeGenie.exe 6fa1b7ce01c0bdc927c9f662f74ddf21 usr/local/bin/homegenie/html/css/jquery.qtip.min.css e5d30611614c33d91ca7fe10b2f5ac8f usr/local/bin/homegenie/html/css/jquery.mobile.icons.min.css b5da7fd09901162a9ed353308eb1bf1b usr/local/bin/homegenie/html/css/ui.notify.css @@ -164,11 +164,11 @@ b509d115574691a917f9d541ee719dff usr/local/bin/homegenie/html/css/images/ui-ico 142b8b156da17f0f5bf35f45a84c2fca usr/local/bin/homegenie/html/css/images/ui-bg_gloss-wave_25_333333_500x100.png 0f7a713fb4e67008178841713f263bbf usr/local/bin/homegenie/html/css/homegenie.min.css 42f0b6a6bf3a8318c8c78ad1df18fa24 usr/local/bin/homegenie/html/css/homegenie.css -c7276768010a2a1d7a55c735f5817a2b usr/local/bin/homegenie/html/css/my.css -a532e218300ea049b21bc1f33cb8cf51 usr/local/bin/homegenie/html/css/jqm-datebox.min.css +31edff859c00b3a542ba9686677f092c usr/local/bin/homegenie/html/css/my.css +0f444e7d18eaee2977f1d34f835a256a usr/local/bin/homegenie/html/css/jtsage-datebox.min.css ce07e14186da81596585fb8970aa7d80 usr/local/bin/homegenie/html/ui/widgets/capture.html 80a5664bdf9f8a7b2f42c1412bf157f4 usr/local/bin/homegenie/html/ui/widgets/capture.js -d52e38e489e38ca3a4203f757cdc3faf usr/local/bin/homegenie/html/ui/widgets/cron.text.html +de5530e57da2aca0809dcd66e4321fc0 usr/local/bin/homegenie/html/ui/widgets/cron.text.html b3b7c42b194c185987a8a510548e130a usr/local/bin/homegenie/html/ui/widgets/checkbox.html 5da541e66924a7120ae68c524830f2dd usr/local/bin/homegenie/html/ui/widgets/store.script.html 56cdda468867d38224da2c61f01b5152 usr/local/bin/homegenie/html/ui/widgets/store.script.list.html @@ -176,7 +176,7 @@ fae388069ed7e156c7a7ac1667c4923d usr/local/bin/homegenie/html/ui/widgets/module 10b054cc6514f6f807525242cd51b1d0 usr/local/bin/homegenie/html/ui/widgets/slider.js d55de8eaed546996f4dcc89aa2a7e6f7 usr/local/bin/homegenie/html/ui/widgets/password.html 41b05804e9884e25f5d58262f0080794 usr/local/bin/homegenie/html/ui/widgets/module.text.js -dfe8730405370990a0c1e6b4025ba8ff usr/local/bin/homegenie/html/ui/widgets/cron.text.js +08e0a3652ab63dedeacec6a4948317ba usr/local/bin/homegenie/html/ui/widgets/cron.text.js 1fe774c6c4e793b6ed5d3fdbf81c6348 usr/local/bin/homegenie/html/ui/widgets/store.script.list.js 01fac713fdb1103dc6f0f4624573df7e usr/local/bin/homegenie/html/ui/widgets/store.script.js 58a85b81f4bd82bc87fb8ebb22f9ceb1 usr/local/bin/homegenie/html/ui/widgets/timetable.js @@ -186,31 +186,31 @@ fae388069ed7e156c7a7ac1667c4923d usr/local/bin/homegenie/html/ui/widgets/text.h 996d8cff6c4716156de2f3addf943972 usr/local/bin/homegenie/html/ui/widgets/text.js 996d8cff6c4716156de2f3addf943972 usr/local/bin/homegenie/html/ui/widgets/password.js 990a4636c27f2935d4abd0fa06e5e8f4 usr/local/bin/homegenie/html/ui/widgets/checkbox.js -b8459e32556b6e692fae8f9ff81817c9 usr/local/bin/homegenie/html/ui/core/popup.cronwizard.html -40acf64097f759ba725a1afb6f7075b8 usr/local/bin/homegenie/html/ui/core/popup.cronwizard.js +c540841060888efb6f7dce0ad8741cef usr/local/bin/homegenie/html/ui/core/popup.cronwizard.html +013ebb045a160d4b449d54231d2f7831 usr/local/bin/homegenie/html/ui/core/popup.cronwizard.js 39202efeb92f6dac83a6b7a4ec482f7d usr/local/bin/homegenie/html/locales/ru.programs.json 50048e2a8f01a633a34ef20f30798326 usr/local/bin/homegenie/html/locales/sv.lingo.json aa124fa757aa5d7913cf38b027cc7463 usr/local/bin/homegenie/html/locales/es.programs.json -fe5dee8410ef04eda8f5680b7414b4f0 usr/local/bin/homegenie/html/locales/en.json -a638dbccf845389bfab903d3e038bedd usr/local/bin/homegenie/html/locales/ru.json +196ffd5681b7025e5946b1860887b1b5 usr/local/bin/homegenie/html/locales/en.json +e72cefba92cdfa9381747722c1e9e466 usr/local/bin/homegenie/html/locales/ru.json 24351c73b38c1df5950b5a75ea8fef46 usr/local/bin/homegenie/html/locales/ru.lingo.json f0ab1246c4369e046013d92764a961b1 usr/local/bin/homegenie/html/locales/pl.lingo.json edf7140a95f873d27e69958fb854a750 usr/local/bin/homegenie/html/locales/de.programs.json -1e0a8e38278f5e346552c5fcd728835b usr/local/bin/homegenie/html/locales/fr.json +275b1bbbe1ae79974858a170b47fb142 usr/local/bin/homegenie/html/locales/fr.json c05766eb6d2a9f2f4ad58dd871daf237 usr/local/bin/homegenie/html/locales/nl.lingo.json -7337d4495a90792a6f60be6c81aeaf96 usr/local/bin/homegenie/html/locales/nl.json +fefdc5c4c1d84115d945f2d07ec1eeba usr/local/bin/homegenie/html/locales/nl.json f200b98dbe6ed17b4385010fb0aeebe6 usr/local/bin/homegenie/html/locales/es.lingo.json eef54d1c7ce38c6812ea95e194e2484a usr/local/bin/homegenie/html/locales/en.lingo.json 85cc6dded2ab2be199aa13ad4a05c581 usr/local/bin/homegenie/html/locales/fr.lingo.json -35426cebab5fb5438af2ebf2ca6a95d7 usr/local/bin/homegenie/html/locales/es.json -c92643e19cde0dbf26e1d711a8ba724c usr/local/bin/homegenie/html/locales/it.json +9717accd65ae622773fbb580d9cccf4c usr/local/bin/homegenie/html/locales/es.json +1b7945d604ccf4c4109300f5eff8086c usr/local/bin/homegenie/html/locales/it.json a3661ccef2ce053188574e57816c959f usr/local/bin/homegenie/html/locales/it.programs.json 200dc71ceec659b49b5dd8432c398cc1 usr/local/bin/homegenie/html/locales/it.lingo.json -6863257f11c42e05062d8570bad0eb25 usr/local/bin/homegenie/html/locales/de.json +feff5304cdd6be007b1ad97520aaaa35 usr/local/bin/homegenie/html/locales/de.json 42ae657831fc25ad32a3cd1d49084e92 usr/local/bin/homegenie/html/locales/fr.programs.json c1e5548823bcce89f98f81b8f5eff7ef usr/local/bin/homegenie/html/locales/en.programs.json 82999c6df0484bdad6c1d58c3ae7dc52 usr/local/bin/homegenie/html/locales/de.lingo.json -6a4983c44aa7b5f6f33d451232f0d275 usr/local/bin/homegenie/html/locales/sv.json +29c7baf211a9f5aed9fb1792b6f026f2 usr/local/bin/homegenie/html/locales/sv.json 1953b49b3c059c27c4e12417327a5a59 usr/local/bin/homegenie/html/js/jquery-ui-1.10.3.custom.min.js e2727c8d1313177d4fca63dff5f72a4c usr/local/bin/homegenie/html/js/error-stack-parser.min.js ab3b4239b0a2352f7ae3284d91a77523 usr/local/bin/homegenie/html/js/jquery.snippet.min.js @@ -533,17 +533,16 @@ b835b04bbff5a8020c31ce21714e389b usr/local/bin/homegenie/html/js/jquery.mobile- aeddf44fdbe6765c1feec9186159b05f usr/local/bin/homegenie/html/js/jquery.mobile-1.4.5/jquery.mobile.theme-1.4.5.css e68b5ba5011a20f19c2cf0910bb092fb usr/local/bin/homegenie/html/js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.css f5fd13e975ed9b5bd496aba32a022ccd usr/local/bin/homegenie/html/js/jquery.mobile.splitview.js -0a42f90be8dea7ba67debe5500bd4542 usr/local/bin/homegenie/html/js/jqm-datebox.core.js -4a42eeb5f863c4dc34f75f2bb3fc267a usr/local/bin/homegenie/html/js/homegenie.webapp.min.js +9b029675dc9fc8207257e9243e4ef5ea usr/local/bin/homegenie/html/js/homegenie.webapp.min.js 15d1937f3ea4497313e5255517a99b4b usr/local/bin/homegenie/html/js/jquery-2.0.2.min.js 8a5e1f82b4a0d521a053d48ac124dd40 usr/local/bin/homegenie/html/js/api/homegenie.statistics.js aaf55bea217d1ec35af26d02510b1b28 usr/local/bin/homegenie/html/js/api/homegenie.automation.programs.js -a1c1a56d184f7cfecbeaeb8079281080 usr/local/bin/homegenie/html/js/api/homegenie.automation.scheduling.js +aebd5a057534d76be6759e10193121b1 usr/local/bin/homegenie/html/js/api/homegenie.automation.scheduling.js 26e4a43815fc28044f68feb44c4c1842 usr/local/bin/homegenie/html/js/api/homegenie.configure.stores.js 06a1e550f35b432cb9dd586d0b16d1e1 usr/local/bin/homegenie/html/js/api/homegenie.automation.js -bc022a20badef05a25382138631d9298 usr/local/bin/homegenie/html/js/api/homegenie.configure.js +faa14a9566c25454ddfd47f9895dd022 usr/local/bin/homegenie/html/js/api/homegenie.configure.js 0897c4450960d51391f57a1428cf5646 usr/local/bin/homegenie/html/js/api/homegenie.configure.widgets.js -412f4743a0035a846a144a6448e2d434 usr/local/bin/homegenie/html/js/api/homegenie.ui.js +9bdd783017317ccca6b99db006615499 usr/local/bin/homegenie/html/js/api/homegenie.ui.js 2637b71fd19ae18f6ae6730272f93496 usr/local/bin/homegenie/html/js/api/homegenie.control.js 0fc128a3099fc871e47993e1489d9cff usr/local/bin/homegenie/html/js/api/homegenie.system.updatemanager.js 7f3eef0bda509020eafdc3810aec6da3 usr/local/bin/homegenie/html/js/api/homegenie.configure.mig.js @@ -555,11 +554,11 @@ f72be0194990fb4ae799823f534b2abb usr/local/bin/homegenie/html/js/api/homegenie. 2a85025af3bc885fea38f3f3bc72a381 usr/local/bin/homegenie/html/js/api/homegenie.configure.groups.js 5ba1bf1e440e148ddb1328565956ebe6 usr/local/bin/homegenie/html/js/api/homegenie.configure.interfaces.js 3bcdb189bcefb9afdf06b260ec62f998 usr/local/bin/homegenie/html/js/api/homegenie.configure.modules.js -2741310113e5cac546b33f8f83ac0109 usr/local/bin/homegenie/html/js/homegenie.webapp.js +ff2e8ebd1db4ccb26949fc8fc552909c usr/local/bin/homegenie/html/js/homegenie.webapp.js 2cd76b73c15766f31204345463de91c9 usr/local/bin/homegenie/html/js/packery-mode.pkgd.min.js b04d1d38ca48df703004b6f4a868bca2 usr/local/bin/homegenie/html/js/app/homegenie.webapp.home.js -3effec31fa0b5dcc36f84df1e4c8d80c usr/local/bin/homegenie/html/js/app/homegenie.webapp.utility.js -cac82011e394d521d8f1b642d82f91d6 usr/local/bin/homegenie/html/js/app/homegenie.webapp.locales.js +9c4f5f1f54949173bc620c1bd6b3e52e usr/local/bin/homegenie/html/js/app/homegenie.webapp.utility.js +2425d75e393793bb3cb02c136c311c9c usr/local/bin/homegenie/html/js/app/homegenie.webapp.locales.js 5b014228bf8993709b029ea032756102 usr/local/bin/homegenie/html/js/my.js ddf920002ba22167a9e91276ee853704 usr/local/bin/homegenie/html/js/codemirror-4.03/addon/tern/tern.js 9efc2db8874ce62b6956e7bb9b5649a1 usr/local/bin/homegenie/html/js/codemirror-4.03/addon/tern/tern.css @@ -685,14 +684,16 @@ a0ab03cb257499995a9567ba6f95e951 usr/local/bin/homegenie/html/js/codemirror-4.0 4e6c3c4acaad046fc1b94a7f1c22693a usr/local/bin/homegenie/html/js/codemirror-4.03/keymap/sublime.js fc356e82253486efbcbb25268292e953 usr/local/bin/homegenie/html/js/codemirror-4.03/keymap/vim.js 5dd76136dd50082ee7a16d9f833595a9 usr/local/bin/homegenie/html/js/codemirror-4.03/keymap/emacs.js -840957e0e68a4ff2dd66333fd1d4acfb usr/local/bin/homegenie/html/js/homegenie.api.min.js +5706afbbdd576c2feda89e74ba324597 usr/local/bin/homegenie/html/js/homegenie.api.min.js 5f70aeb99a20be66d18708c7e43290d1 usr/local/bin/homegenie/html/js/jquery.mobile.splitview.css 523871857897f8a572f05df9e2aabf8e usr/local/bin/homegenie/html/js/jquery.knob.js 95def87b93d11289cd2eee1cc3ca7948 usr/local/bin/homegenie/html/js/json2.js a271e7f137052c98f51d37ba3d4c52ee usr/local/bin/homegenie/html/js/jquery.qtip.min.js +effa583a9cd586b12d9c45a4fc25024b usr/local/bin/homegenie/html/js/jtsage-datebox.min.js +819e77c4695272400363e9bd457dca34 usr/local/bin/homegenie/html/js/jtsage-datebox.js.map dd9d2aee0360d5c4a2fb4e8675eb3707 usr/local/bin/homegenie/html/js/raphael-min.js 42562d36ff3a795250386d52d40e33e1 usr/local/bin/homegenie/html/js/marked.min.js -61ec307160a4ccd30118372765399f68 usr/local/bin/homegenie/html/js/jqm-datebox.lang.utf8.min.js +0db1060b3cfdf761066c381b61151de4 usr/local/bin/homegenie/html/js/jqm-datebox.lang.utf8.min.js e7efee9e288db58ae9fcf835cc5a0a2e usr/local/bin/homegenie/html/js/jquery.fileupload.js eb79ebea6322b95f5bab19facbbd1f28 usr/local/bin/homegenie/html/js/jquery.notify.min.js 0541a99b03ee94c76058b1cd6c513dd6 usr/local/bin/homegenie/html/js/jstorage.min.js @@ -701,7 +702,7 @@ b314901465a83bf5fdd08d17409d5fce usr/local/bin/homegenie/html/js/homegenie.api. c6512bc70dcbf5ac8b7c2721cbd52351 usr/local/bin/homegenie/html/js/colorwheel.js 8d4223896ddbb9cd132aceef6882cb04 usr/local/bin/homegenie/html/js/startswith.js c5980a2ab542f1faf296b7cf46520d43 usr/local/bin/homegenie/html/js/eventsource.js -fe2d57df58db51c568969733b0ec0800 usr/local/bin/homegenie/html/pages/events/_events.js +69fbb4310bb963cd74f8e3756daf97a2 usr/local/bin/homegenie/html/pages/events/_events.js d427dfc02f1f6277e41bd22f0462b618 usr/local/bin/homegenie/html/pages/events/main.html 59c62b496ded33ba38f2b2354f792ac3 usr/local/bin/homegenie/html/pages/header.html 110a74cdaba4da7a8dbd471e4e90cc8b usr/local/bin/homegenie/html/pages/apps/netplay/slideshow.html @@ -854,7 +855,7 @@ a5e51ab675defdb4444683ab64714d63 usr/local/bin/homegenie/html/pages/control/wid be1480f70054c68723bf2e697fca09e9 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/camerainput.js 6a2bb36ec695d5c51ef49fac409a1904 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/grouplabel.html 59f75acbb83f9247849ebbb47eb6596a usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/sensor.html -4c6470ecd0cffd79ce7a95c2255519ff usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/colorlight.js +32a87d3d556566fe52b3653aa35cfba3 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/colorlight.js 84c6aba927ad341061091d9124f25858 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/program.js fb90e857ff4d30f17b9f0701cfb413ab usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/doorwindow.html a7b66f6c274401de96a368d888ea9596 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/unknown.js @@ -963,62 +964,62 @@ e74c354cefece23b41fd0ed4ed89138d usr/local/bin/homegenie/html/pages/control/wid bbec5d9010c19ed04b1189c8cef64195 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/images/battery_level_80.png 7d55198b9d9dfc4defc1a325cbc4fbd3 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/images/unknown.png bac553cdffda0607623ca5b553e7e0e5 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/doorlock.js -10b5d6cdfbe4ff26cb0c401aa9a02570 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/generic.js -5d91056794e7b6a5189d073076617aec usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/thermostat.js +5bdf6fa6d16e9fc3fa97fba0556c7779 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/generic.js +948b17217b0f4c5408e66647752ef7e3 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/thermostat.js 57aa59c98ffe503f31a986907fe52dc9 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/siren.html a6722a99e5cd17437a7c180117c5c276 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/link.js 91214805e9bc018067a6fc9ca43ef297 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/grouplabel.js ca26442d9e4ad51fb01215af105fdb99 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/doorwindow.js d2f3540cd3b24fc4044c6c0715d59b31 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/energymonitor.html -6b07b8d18e9d90f37b8e46103575b901 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/dimmer.js +ac1eab828884b8d2290644e9a80886e0 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/dimmer.js 307d665b1fc01eacaf2cd7b7557847bf usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/mediareceiver.html 15bfa35fe64e5d9e6240ec471e8d6bb6 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/siren.js ad577d98cb496274a952c465fb969156 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/securitysystem.js ddab182cf5ad5b4f6c799ed81242f656 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/timetable.js a2bc42f4916149a3cc4d92a8124f3a18 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/dimmer.html -8d19ad40266a8baf74552dbdb371507d usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/thermostat.html +92e22833690f35fe520cbfd204140fd3 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/thermostat.html b30e99dcaf715a4fadda629c5c42dc4a usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/camerainput.html 35a9f0d47eafe7c7331f0d09605a6aa5 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/timetable.html 6cf0b886b47ef59a3ebc158bb549d00e usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/shutter.html 81acc96a8beaa745230135f2207d2009 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/generic.html 1d9ec7635c86602be7e90d364ff91f92 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/program.html 57aa59c98ffe503f31a986907fe52dc9 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/switch.html -9f1bd9acdc9e35da78ec372a944af824 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/sensor.js +a27edfe9eecc391907b0bcb484c9c460 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/sensor.js 8ad63666fd7e1b30940c0606312971c6 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/doorlock.html 57aa59c98ffe503f31a986907fe52dc9 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/light.html 1508cd82ecf907dc249fceff6d29ddbb usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/mediareceiver.js 6ddcf90cc8c332da1113a1116fd111e7 usr/local/bin/homegenie/html/pages/control/widgets/homegenie/generic/unknown.html -a5419ed1e0ea611b5aee4f40e42b31d5 usr/local/bin/homegenie/html/pages/control/_control.js +9e1f820ecbd644f413ee4ccca5672308 usr/local/bin/homegenie/html/pages/control/_control.js 5acfdab557234f8835553e3c0e2dcf0e usr/local/bin/homegenie/html/pages/control/main.html -3703bfc7ea0f4cbfb0e8a2a661741a6a usr/local/bin/homegenie/html/pages/configure/scheduler/_scheduler.js -3318eb56f702788015bc2ee6ee051d05 usr/local/bin/homegenie/html/pages/configure/scheduler/main.html +93beac209335e65c787c360151177583 usr/local/bin/homegenie/html/pages/configure/scheduler/_scheduler.js +85aef1a1a78ef8ef0bd972118acdb5eb usr/local/bin/homegenie/html/pages/configure/scheduler/main.html 3cb020baa27d213b04c2d23f77be875d usr/local/bin/homegenie/html/pages/configure/maintenance/_maintenance.js -04ce53ddc5e4d5e62747f9e3498981a2 usr/local/bin/homegenie/html/pages/configure/maintenance/main.html -35d12ca91ad3e3eb325752e686d92d88 usr/local/bin/homegenie/html/pages/configure/widgeteditor/_widgetslist.js +facad36d329503268cad50868270c92f usr/local/bin/homegenie/html/pages/configure/maintenance/main.html +9e7fec61824d0c27c1b08abca4397d65 usr/local/bin/homegenie/html/pages/configure/widgeteditor/_widgetslist.js a887fa79784e6721029b8158b4a92c4a usr/local/bin/homegenie/html/pages/configure/widgeteditor/listwidgets.html -026bc9e2e6e714c45aa4c689c5402434 usr/local/bin/homegenie/html/pages/configure/widgeteditor/_widgetedit.js -ed1e3cb2970e4af4d43a9de4fdf24b3c usr/local/bin/homegenie/html/pages/configure/widgeteditor/editwidget.html +7330a897b266151dc5a0ebd265619472 usr/local/bin/homegenie/html/pages/configure/widgeteditor/_widgetedit.js +fec4cdb13d3750882aba1bad13307d18 usr/local/bin/homegenie/html/pages/configure/widgeteditor/editwidget.html d4dfeb6fd801d768cf7fc57352008ff9 usr/local/bin/homegenie/html/pages/configure/interfaces/configlet/zwave.html d2ec0dc9bfb03fb7b9fe74ffa6045474 usr/local/bin/homegenie/html/pages/configure/interfaces/configlet/upnp.html a43823f4e8a7626a9d467ee769e8b19a usr/local/bin/homegenie/html/pages/configure/interfaces/configlet/x10.html 63a85dea974b21bc929dc38ca465e599 usr/local/bin/homegenie/html/pages/configure/interfaces/_systemsettings.js 5a19b256726b4f196f2c48dbc01ef28f usr/local/bin/homegenie/html/pages/configure/interfaces/main.html -c9ced9eb3391f08faa57d4a31d7593d2 usr/local/bin/homegenie/html/pages/configure/groups/listmodules.html +0cb348b88989be3dd8a3ea0758117aff usr/local/bin/homegenie/html/pages/configure/groups/listmodules.html 61823179bb78b2328073070c2313e4c6 usr/local/bin/homegenie/html/pages/configure/groups/listgroups.html -995946e606642c9d52715a81db0ac00a usr/local/bin/homegenie/html/pages/configure/groups/_groupmodules.js +96107c6348b8993d78e8730f3478c1eb usr/local/bin/homegenie/html/pages/configure/groups/_groupmodules.js 4961451af708bc430aa2a96dc38839cd usr/local/bin/homegenie/html/pages/configure/groups/_groupslist.js 90944c3bc12b3b1809d07e5a70844349 usr/local/bin/homegenie/html/pages/configure/programengine/listprograms.html 09fe1b2e644d225116a4d84bc87a2adb usr/local/bin/homegenie/html/pages/configure/programengine/commandwizard.html -5778b5cd653f765086313b6a03f612c1 usr/local/bin/homegenie/html/pages/configure/programengine/_programslist.js +fd87f801a9d78a65e772616555d380df usr/local/bin/homegenie/html/pages/configure/programengine/_programslist.js 2fa1d5f194a336f75e37f3b6442c839b usr/local/bin/homegenie/html/pages/configure/programengine/listgroups.html -a923cadf13375d1cd38340a5a6eaf5ea usr/local/bin/homegenie/html/pages/configure/programengine/_programedit.js +f4ced8e7e6ec50d8c131a4a65b7a54f3 usr/local/bin/homegenie/html/pages/configure/programengine/_programedit.js 99919f0d75cd91cb8426fb53c3956be1 usr/local/bin/homegenie/html/pages/configure/programengine/conditionwizard.html 5b873ad8e519c9e38e2e2513b45138b0 usr/local/bin/homegenie/html/pages/configure/programengine/editprogram.html 900de0a69a4ef287ff9100ce767e4571 usr/local/bin/homegenie/html/pages/configure/programengine/_groupslist.js -c7bbbde52a8edcaaf4ab785b8c8085e0 usr/local/bin/homegenie/html/pages/analyze/_statistics.js +71fab78c0b6a9c6225f04b95bcaaaf0a usr/local/bin/homegenie/html/pages/analyze/_statistics.js 3d85e954a150c8a1c3e001af005494b5 usr/local/bin/homegenie/html/pages/analyze/main.html 3e817837aaaa02f72bbb8bd2ca06e0cd usr/local/bin/homegenie/html/ext/zwave/setupnode.html -c7e676bcbbb99dc1c3ce10bae541046d usr/local/bin/homegenie/html/ext/zwave/_nodesetup.js +bc621000bd2bcd80dcb54fcaa6ae9474 usr/local/bin/homegenie/html/ext/zwave/_nodesetup.js 6b905586fc8e2c5ccad703c4d3979f08 usr/local/bin/homegenie/html/images/remote.png ce87383fb841b6b9340049a0bea06be4 usr/local/bin/homegenie/html/images/interfaces.png 60625049681f8beedeaa6a28c93fccaf usr/local/bin/homegenie/html/images/play-icon.png @@ -1081,9 +1082,12 @@ f80afbce0c6805be3b16d1a7e28c21cf usr/local/bin/homegenie/html/images/update.png 578ddcfbf993fca7ff2dfb57cd0f5fac usr/local/bin/homegenie/html/images/analyze.png ebbc0d0bda0c5c7393e8e90925ddba2e usr/local/bin/homegenie/html/images/wallpapers/wallpaper_007.jpg 8adcc22f92f1260b24712e7a38e59656 usr/local/bin/homegenie/html/images/wallpapers/wallpaper_004.jpg +c9ab8455b31e1e4e13b4ae1a1449912c usr/local/bin/homegenie/html/images/wallpapers/wallpaper_008.jpg 114ec2a9a0ac78a5853f70716fc7c88d usr/local/bin/homegenie/html/images/wallpapers/wallpaper_005.jpg 699e3098a7fd94379b936314965d772d usr/local/bin/homegenie/html/images/wallpapers/wallpaper_002.jpg +8719038b02bd0c71cc1fa86855126344 usr/local/bin/homegenie/html/images/wallpapers/wallpaper_009.jpg e56d5872da1b2b29c9c54fc78adab9a8 usr/local/bin/homegenie/html/images/wallpapers/wallpaper_001.jpg +3d0d9374ff3dd3e254c45df5624c990b usr/local/bin/homegenie/html/images/wallpapers/wallpaper_010.jpg ef931ee1323542ee5604a9c43803c4e8 usr/local/bin/homegenie/html/images/wallpapers/wallpaper_003.jpg d12dc3406627dc748561e1930704ec3d usr/local/bin/homegenie/html/images/wallpapers/wallpaper_006.jpg 0a27805bbe6b6d67ef37f760dc991917 usr/local/bin/homegenie/html/images/creativecommon.png @@ -1094,7 +1098,7 @@ d311329f6b7f6588be49094a592492c9 usr/local/bin/homegenie/html/images/genie.png b488b97ca1f19753a9f38d1e0144b115 usr/local/bin/homegenie/html/images/event_on.png 11e6aed03a9856f09de50c12d6f5379c usr/local/bin/homegenie/html/images/configure.png ecaa88f7fa0bf610a5a26cf545dcd3aa usr/local/bin/homegenie/html/blank.html -0f3eaf50be0f5560f446152d37cd9430 usr/local/bin/homegenie/html/index.html +c8e152cd5d0fb2d243acd9433fcca824 usr/local/bin/homegenie/html/index.html 69338ffa66f8af999156761d486f763b usr/local/bin/homegenie/html/README.RestoreP513.md a4e8c938edacd5e8c55c5441054dcf9a usr/local/bin/homegenie/html/icons.html 9e90aad43d8acc5b45729f2296cb5907 usr/local/bin/homegenie/Raspberry.IO.SerialPeripheralInterface.dll @@ -1103,18 +1107,18 @@ ed3022822cd3dc3348bb51dc054f1574 usr/local/bin/homegenie/IronPython.dll 536920e88b28850b8df27484746134f4 usr/local/bin/homegenie/NetClientLib.dll b17e826e40751dac378180d42a6142e5 usr/local/bin/homegenie/UnitsNet.dll a19a8070a77444aafa96d3fbe033c42e usr/local/bin/homegenie/IronRuby.Libraries.dll -d5952f1caab2206e140b8afd42c4e3ff usr/local/bin/homegenie/NetClientLib.dll.mdb +edb4222ca9b4aa24ff7ad7dc5d63ab89 usr/local/bin/homegenie/NetClientLib.dll.mdb 2074c256e8b7a372e28490a436a8e04d usr/local/bin/homegenie/NLog.dll -859c0a044deb1d2e6113693b0f43652f usr/local/bin/homegenie/groups.xml -a29741b144c7af3349dd7ef1897d6073 usr/local/bin/homegenie/SerialPortLib.dll +cf36e1aa6d2d8f05e416d855d8627b4d usr/local/bin/homegenie/groups.xml +80abb66a7330a814591bf3f0dc0b2205 usr/local/bin/homegenie/SerialPortLib.dll cc27215f3e44078c573b0018b7f6d4c5 usr/local/bin/homegenie/homegenie_stats.db c8164876b6f66616d68387443621510c usr/local/bin/homegenie/ICSharpCode.SharpZipLib.dll 5405413fff79b8d9c747aa900f60f082 usr/local/bin/homegenie/sqlite3.dll -c0dbb1e6c51a2cdc5278c6d4d89bae32 usr/local/bin/homegenie/Common.dll.mdb +037a39c0e60471e2ad6a155519aabaf8 usr/local/bin/homegenie/Common.dll.mdb 8b44d53cb2d7afc7ff215bd43df7fc40 usr/local/bin/homegenie/scheduler.xml 3370764d6697cf724c34c76a789dc3fc usr/local/bin/homegenie/UPnP.dll 8742ca673f11373aa5b26f966c03ef49 usr/local/bin/homegenie/LICENCE.TXT -1ebd2d2bfa448e6f6083219bdd684b9d usr/local/bin/homegenie/HomeGenie.exe.mdb +08648f49806ce16b2976e339e872b5d2 usr/local/bin/homegenie/HomeGenie.exe.mdb a8992f211bf62bcd6cb8b66c0df133a1 usr/local/bin/homegenie/HomeGenie.exe.config 4f1bd3233c0472fbdc699f0acc85779a usr/local/bin/homegenie/modules.xml 75618d7a8e25819a16609b0be6cec450 usr/local/bin/homegenie/Raspberry.IO.GeneralPurpose.dll @@ -1156,42 +1160,42 @@ ae7bbf0f4b96d2a0effd97d69befb47e usr/local/bin/homegenie/CommonMark.dll 6e911e0a393f7d7d6f2de035fa4f883b usr/local/bin/homegenie/Microsoft.Scripting.Metadata.dll e33483b8ed739cd267f9a27ea266c87e usr/local/bin/homegenie/Raspberry.IO.dll 3435a8ca2eb89ec7fc13a463590121c0 usr/local/bin/homegenie/README.TXT -6d590d35e80df13181e71f271d88f4cf usr/local/bin/homegenie/HISTORY.TXT +3cdf2d6991fb8efaed4a585b356e6cdb usr/local/bin/homegenie/HISTORY.TXT acbb8de3a6a8f53d69957e2607097992 usr/local/bin/homegenie/DEVELOPERS.TXT 1d9ad3e990e9a228c53c63eb28f70518 usr/local/bin/homegenie/Common.dll 0728e681132f8722dd21b90d88970bd7 usr/local/bin/homegenie/Microsoft.Dynamic.dll -d8b59227a1232b3dd4eb4568b5c5370d usr/local/bin/homegenie/programs.xml +cf3cec9d4e377f444fec977465e08583 usr/local/bin/homegenie/programs.xml 61b0c6d8eb2c756355d52df2ef6170c6 usr/local/bin/homegenie/Microsoft.Scripting.dll 513c0ab6c041976fe0bfc13a0c3f1690 usr/local/bin/homegenie/websocket-sharp.dll 95e24268172c8908f5b2c906b90a92a7 usr/local/bin/homegenie/Newtonsoft.Json.dll -e6f065fff7e134981f1ad8dcf130ce0e usr/local/bin/homegenie/homegenie_factory_config.zip +e8296bed8ce049ecc2c115eccf4ab8e0 usr/local/bin/homegenie/homegenie_factory_config.zip cf846d6c77f76532f9cdab3181b71b6c usr/local/bin/homegenie/Common.Logging.Core.dll 456c7d0d3afb06de913ee487f333aadc usr/local/bin/homegenie/Raspberry.IO.Interop.dll de34fbe308eccd5e099f49ea0f2501aa usr/local/bin/homegenie/Raspberry.System.dll 93675a8ef36065d0c64fe1bf4fb79902 usr/local/bin/homegenie/IronRuby.Libraries.Yaml.dll ae0fde41ac16130b4ec74a277e3ff754 usr/local/bin/homegenie/lib/shared/NCrontab.dll -b3a0e50dfe3bfb988838c3eb8892095f usr/local/bin/homegenie/lib/shared/no/CronExpressionDescriptor.resources.dll +dd178bed779fb11be3af93ad76176adc usr/local/bin/homegenie/lib/shared/no/CronExpressionDescriptor.resources.dll 668d68198a74c818c797bdd5f54560e2 usr/local/bin/homegenie/lib/shared/M2Mqtt.Net.dll 0dd334a75a245d02ed9f8811d87130de usr/local/bin/homegenie/lib/shared/System.Data.SQLite.dll -2e66d6a634f635382e62a014c60d45f6 usr/local/bin/homegenie/lib/shared/CronExpressionDescriptor.dll.mdb -368f8df85d4623a732ea11ae2b6abf05 usr/local/bin/homegenie/lib/shared/CronExpressionDescriptor.dll +51908f49a9281ededae37cfa18cde70d usr/local/bin/homegenie/lib/shared/CronExpressionDescriptor.dll 840ba9adf7531994ad4d26319c80451c usr/local/bin/homegenie/lib/shared/ExpressionEvaluation.dll a10fc9aa97ec8123eb53d6cce5205aad usr/local/bin/homegenie/lib/shared/SoapBox.FluentDwelling.dll 5dfc87df81abacf82441bad9467d10ed usr/local/bin/homegenie/lib/shared/M2Mqtt.Net.dll.mdb -95fedc3b478d5e69834836e4c46d217c usr/local/bin/homegenie/lib/shared/ru/CronExpressionDescriptor.resources.dll +6cec6566bd141219c114cc6ddf6ad6d8 usr/local/bin/homegenie/lib/shared/ru/CronExpressionDescriptor.resources.dll 3370764d6697cf724c34c76a789dc3fc usr/local/bin/homegenie/lib/shared/UPnP.dll 21d173f40025e0eb588f8b4ef6e60b1d usr/local/bin/homegenie/lib/shared/KNXLib.dll +dc855bcd7df286edc345fd7fc4ff1f9d usr/local/bin/homegenie/lib/shared/pt/CronExpressionDescriptor.resources.dll e029eb6f766c06a13c0fe050758cb4c2 usr/local/bin/homegenie/lib/shared/KNXLib.dll.mdb -2d0ebfa31c4cb699f79af53efacee616 usr/local/bin/homegenie/lib/shared/fr/CronExpressionDescriptor.resources.dll -7dddb28083ea3c65c55d26e11fce73ba usr/local/bin/homegenie/lib/shared/es/CronExpressionDescriptor.resources.dll +d4094bc9e1bb3db3e4c4e0b15f023f67 usr/local/bin/homegenie/lib/shared/fr/CronExpressionDescriptor.resources.dll +0c4990d92240e9fde4c871a1ec187ff1 usr/local/bin/homegenie/lib/shared/es/CronExpressionDescriptor.resources.dll 9152e305b5638cacf958dab918e0a5b7 usr/local/bin/homegenie/lib/shared/UPnP.dll.mdb -39b47760286956f36b316f240978abda usr/local/bin/homegenie/lib/shared/it/CronExpressionDescriptor.resources.dll +6a218b28996b4c5829eb8366cf92e845 usr/local/bin/homegenie/lib/shared/it/CronExpressionDescriptor.resources.dll 8f95df35b96a4ff2be7f93b06cd9d484 usr/local/bin/homegenie/lib/shared/NCrontab.pdb -b28c8e3d0dd93543461eb01f2e5a0ee2 usr/local/bin/homegenie/lib/shared/de/CronExpressionDescriptor.resources.dll -38375e91228465d53636ae7047f6f98b usr/local/bin/homegenie/lib/shared/tr/CronExpressionDescriptor.resources.dll -e6d7626e06a8028c8759d354ac0292ef usr/local/bin/homegenie/lib/shared/uk/CronExpressionDescriptor.resources.dll -c3a5224804c251c4a6c628fba0618bbf usr/local/bin/homegenie/lib/shared/zh-CHS/CronExpressionDescriptor.resources.dll -72ec76d4fc36fca61d1a2184a2f3dd22 usr/local/bin/homegenie/lib/shared/nl/CronExpressionDescriptor.resources.dll +b0d0e8478b36f019d79d987dcdaa0da0 usr/local/bin/homegenie/lib/shared/de/CronExpressionDescriptor.resources.dll +8898880f5b1964bc058e3286b396a064 usr/local/bin/homegenie/lib/shared/tr/CronExpressionDescriptor.resources.dll +2497cf08a8cf80bac20744c8494d06a6 usr/local/bin/homegenie/lib/shared/uk/CronExpressionDescriptor.resources.dll +33020a284ae0a770bdbbf88489ac99b8 usr/local/bin/homegenie/lib/shared/zh-CHS/CronExpressionDescriptor.resources.dll +26adfa1a8c782e8ea8e654269827fbe5 usr/local/bin/homegenie/lib/shared/nl/CronExpressionDescriptor.resources.dll cb83c6c764e4cce219adfae1b177b27a usr/local/bin/homegenie/lib/mig/XTenLib.dll 9fa7c1e2979434e4fd3eeb8fa259184c usr/local/bin/homegenie/lib/mig/v4l/raspbian_libCameraCaptureV4L.so 4b2e8cdefcdd848a1e4293864093ff7d usr/local/bin/homegenie/lib/mig/v4l/debian64_libCameraCaptureV4L.so @@ -1199,7 +1203,7 @@ cb83c6c764e4cce219adfae1b177b27a usr/local/bin/homegenie/lib/mig/XTenLib.dll e2f6b564cb161a24fbd82e93352d1c9b usr/local/bin/homegenie/lib/mig/LibUsbDotNet.dll 2033b5196b81337f7affb4a6d1aedd00 usr/local/bin/homegenie/lib/mig/p1db_custom.xml 419c63466303958863e3cb552f2acc91 usr/local/bin/homegenie/lib/mig/MIG.Controllers.dll -1233edbbaaac83d4d14220cc494abcc5 usr/local/bin/homegenie/lib/mig/ZWaveLib.dll +c6dc6a6d961a88ea80e1b2f137bd9ac3 usr/local/bin/homegenie/lib/mig/ZWaveLib.dll fe5b578c445ea0fe273c093c3b14ee6f usr/local/bin/homegenie/lib/mig/MIG.HomeAutomation.dll ca71de7a3c556db84be080f0275a4e6d usr/local/bin/homegenie/lib/mig/MIG.Protocols.dll 4b9a7d5996299f8066ede35cd17a68b2 usr/local/bin/homegenie/lib/mig/MIG.Media.dll diff --git a/HomeGenie_Linux/Packager/builddeb.sh b/HomeGenie_Linux/Packager/builddeb.sh index 5f2f78b5c..29ba9a54c 100755 --- a/HomeGenie_Linux/Packager/builddeb.sh +++ b/HomeGenie_Linux/Packager/builddeb.sh @@ -41,7 +41,7 @@ then echo "- Fixing permissions..." chmod -R 755 "$hg_target_folder/DEBIAN" - chmod +x "$hg_target_folder/usr/local/bin/homegenie/startup.sh" +# chmod +x "$hg_target_folder/usr/local/bin/homegenie/startup.sh" echo "\n- Building deb file...\n" diff --git a/HomeGenie_Windows/Packager/setup.iss b/HomeGenie_Windows/Packager/setup.iss index 78c2ef8df..62a7eb579 100644 --- a/HomeGenie_Windows/Packager/setup.iss +++ b/HomeGenie_Windows/Packager/setup.iss @@ -4,10 +4,10 @@ [Setup] AppName=HomeGenie -AppVerName=HomeGenie 1.1 beta (r521) +AppVerName=HomeGenie 1.1 beta (r522) AppPublisher=GenieLabs AppPublisherURL=http://www.homegenie.it -AppVersion=1.1 beta (r521) +AppVersion=1.1 beta (r522) DefaultDirName={pf}\HomeGenie DefaultGroupName=HomeGenie Compression=lzma @@ -198,8 +198,8 @@ Type: files; Name: "{app}\SQLite.Interop.dll"; ;Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; [Icons] -Name: "{group}\HomeGenie 1.1 beta (r521)"; Filename: "{app}\HomeGenieManager.exe" -Name: "{group}\Uninstall HomeGenie 1.1 beta (r521)"; Filename: "{uninstallexe}" +Name: "{group}\HomeGenie 1.1 beta (r522)"; Filename: "{app}\HomeGenieManager.exe" +Name: "{group}\Uninstall HomeGenie 1.1 beta (r522)"; Filename: "{uninstallexe}" Name: "{commondesktop}\HomeGenie"; Filename: "{app}\HomeGenieManager.exe" [Run]