Skip to content

Commit

Permalink
Scheduler UI improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
genemars committed Jun 7, 2020
1 parent 582cb9c commit ebdd155
Show file tree
Hide file tree
Showing 8 changed files with 250 additions and 178 deletions.
22 changes: 5 additions & 17 deletions BaseFiles/Common/html/css/my.css
Original file line number Diff line number Diff line change
Expand Up @@ -192,22 +192,6 @@ div[data-ui-field="wallpaper"] {
margin-left: 4px;
}

.cronwiz-container .CodeMirror-code span {
font-family: Courier New, Courier, monospace !important;
font-size: 10pt !important;
white-space: pre;
line-height: 11pt;
}

.cronwiz-container .CodeMirror-linenumber {
font-size: 9pt;
font-family: Courier New, Courier, monospace !important;
}

.cronwiz-container .CodeMirror-scroll {
overflow-x: auto;
}

#systemsettings_browserepo div[data-ui-field="description_text"] pre {
margin-left: 8px;
border-left: solid 2px gray;
Expand Down Expand Up @@ -698,7 +682,6 @@ div.ui-page-theme-a div.ui-body-inherit img.auto-invert, div.ui-bar-inherit img.
}

.hg-scheduler-table-row {
margin-left: -20px;
}

#module_programs_featurelist {
Expand Down Expand Up @@ -817,6 +800,11 @@ div.ui-page-theme-a .ui-icon-microphone:after {
display: none;
}

/*** jQuery Mobile overrides ***/
.ui-header .ui-title, .ui-footer .ui-title {
margin: 0 2%;
}

/**** media queries ****/

/** Small Mobile **/
Expand Down
48 changes: 24 additions & 24 deletions BaseFiles/Common/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
<script src="js/codemirror-4.03/addon/hint/xml-hint.js"></script>
<script src="js/codemirror-4.03/addon/hint/html-hint.js"></script>
<script src="js/codemirror-4.03/addon/edit/closebrackets.js"></script>
<script src="js/codemirror-4.03/addon/edit/matchbrackets.js"></script>
<script src="js/codemirror-4.03/addon/edit/matchtags.js"></script>
<script src="js/codemirror-4.03/addon/edit/matchbrackets.js"></script>
<script src="js/codemirror-4.03/addon/edit/matchtags.js"></script>
<script src="js/codemirror-4.03/addon/fold/foldcode.js"></script>
<script src="js/codemirror-4.03/addon/fold/foldgutter.js"></script>
<script src="js/codemirror-4.03/addon/fold/brace-fold.js"></script>
Expand All @@ -77,7 +77,7 @@
<script src="js/codemirror-4.03/addon/search/searchcursor.js"></script>
<script src="js/codemirror-4.03/addon/search/search.js"></script>
<script src="js/codemirror-4.03/addon/search/match-highlighter.js"></script>

<!-- other js frameworks and utils -->
<script src="js/error-stack-parser.min.js"></script>
<script src="js/stackframe.min.js"></script>
Expand All @@ -97,15 +97,15 @@
<script src="js/jqm-datebox.lang.utf8.min.js"></script>

<!-- HomeGenie Javascript includes -->
<script src="js/homegenie.api.js?version=v1.3-stable.8"></script>
<script src="js/homegenie.webapp.js?version=v1.3-stable.8"></script>
<script src="js/homegenie.api.js?version=v1.3-stable.10"></script>
<script src="js/homegenie.webapp.js?version=v1.3-stable.10"></script>

<!-- custom javascript --><!-- TODO: check wheter this can be deprecated/moved -->
<script src="js/my.js?version=v1.2-beta.40"></script>
<script src="js/my.js?version=v1.3-stable.10"></script>

<!-- local css definitions and overrides -->
<link rel="stylesheet" href="css/my.css?version=v1.2-beta.40" />
<link rel="stylesheet" href="css/fonts/hg-fonts.css?version=v1.2-beta.40" />
<link rel="stylesheet" href="css/my.css?version=v1.3-stable.10" />
<link rel="stylesheet" href="css/fonts/hg-fonts.css?version=v1.3-stable.10" />

<script type="text/javascript">

Expand Down Expand Up @@ -243,31 +243,31 @@ <h1>#{title}</h1>
<p>#{text}</p>
</div>
</div>

<!-- BEGIN Global Popups -->


<!-- Confirm Popup -->
<div id="actionconfirm_popup" class="ui-corner-all hg-popup-b" data-role="popup" data-title="Are you sure?" data-overlay-theme="b" data-position-to="window" data-transition="pop">
<div data-role="header" class="ui-corner-top">
<h3>Perform the selected action?</h3>
</div>
</div>
<div class="ui-content ui-corner-bottom">
<p style="padding-left:20px;padding-right:20px;max-height:240px;overflow:hidden;overflow-y:auto;">This operation cannot be undone.</p>
<div class="ui-grid-a">
<div class="ui-block-a"><a data-locale-id="common_command_cancel" id="actionconfirm_cancel_button" class="ui-btn ui-corner-all ui-btn-icon-left ui-icon-delete" data-rel="back">Cancel</a></div>
<div class="ui-block-b" align="right"><a data-locale-id="common_command_proceed" id="actionconfirm_confirm_button" class="ui-btn ui-corner-all ui-btn-icon-left ui-icon-check" data-rel="back">Proceed</a></div>
</div>
</div>
</div>
</div>

<!-- Event Popup Settings -->
<div id="configure_popupsettings_edit" class="ui-corner-all hg-popup-b" data-role="popup" data-theme="a" data-overlay-theme="b" data-position-to="window" data-transition="pop">
<div data-role="header" class="ui-corner-top">
<h1 data-locale-id="configure_popupfilter_title">Event popup filters</h1>
</div>
<div class="ui-content ui-corner-bottom" style="height:280px;max-height:280px;overflow-y:scroll;overflow-x:hidden;">

<ul data-role="listview" id="popupsettings_ignorelist">
<li data-role="list-divider">
<div class="ui-grid-b">
Expand All @@ -277,16 +277,16 @@ <h1 data-locale-id="configure_popupfilter_title">Event popup filters</h1>
</div>
</li>
</ul>

</div>
<div class="ui-grid-a ui-footer ui-bar-inherit" align="center">
<div class="ui-block-a">
<a class="ui-btn ui-corner-all ui-icon-delete ui-btn-icon-left" href="#" data-locale-id="configure_popupfilter_optclose" data-rel="back">Close</a>
</div>
</div>
</div>


<!-- Module Edit Popup -->
<div id="automation_group_module_edit" class="ui-corner-all hg-popup-a" data-role="popup" data-theme="a" data-overlay-theme="b" data-position-to="window" data-transition="pop">
<a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a>
Expand Down Expand Up @@ -342,7 +342,7 @@ <h1 id="module_title">Module Settings</h1>
</div>

<div id="module_programs_featurelist"></div>

<p id="module_programs_featuredesc" style="margin-left:10px;margin-right:10px;font-size:10pt;opacity:0.9"></p>

<fieldset id="module_programs_features" data-role="controlgroup" data-type="vertical" style="border:solid 1px gray;padding:10px;"></fieldset>
Expand Down Expand Up @@ -472,7 +472,7 @@ <h2 id="automationprograms_program_title">Program Options</h2>
<h3 data-ui-field="title" style="margin:5px;margin-top:0px">Fullscreen Editor</h3>
<h4 data-ui-field="subtitle" style="margin:5px">...</h4>
<div class="ui-shadow" style="position:absolute;top:100px;left:30px;right:30px;bottom:100px;"><textarea id="fullscreen_edit_text" style="width:100%;height:100%;border:0;margin:0"></textarea></div>

<div style="position:absolute;left:40px;bottom:20px">
<h4 data-ui-field="namelabel"></h4>
<div data-ui-field="nameinput" class="ui-input-text ui-body-inherit ui-corner-all ui-shadow-inset" style="position:relative;display:none;border-color:#fff">
Expand All @@ -481,7 +481,7 @@ <h4 data-ui-field="namelabel"></h4>
</div>

<a data-ui-field="cancel" href="#" class="ui-btn ui-btn-a ui-corner-all" style="position:absolute;right:140px;bottom:20px">Cancel</a>

<a data-ui-field="confirm" href="#" class="ui-btn ui-btn-a ui-corner-all" style="position:absolute;right:40px;bottom:20px">Ok</a>
</div>

Expand All @@ -504,7 +504,7 @@ <h4 data-ui-field="namelabel"></h4>
</ul>
<br clear="all" />
<div align="center" style="font-size:9pt;position:absolute;left:0;right:0;bottom:0;height:30px">
HomeGenie &copy; 2011-2019
HomeGenie &copy; 2011-2019
<a href="https://github.com/genielabs/HomeGenie" target="_blank">G-Labs</a>
</div>
</div><!-- /panel -->
Expand Down Expand Up @@ -551,18 +551,18 @@ <h2 data-locale-id="home_menu_about">About</h2>
</div>

</div>

<!--- Boot progress overlay -->

<div id="bootprogress_overlay" style="position:fixed;top:0;left:0;right:0;bottom:0;background-color:white;opacity:0.85;z-index:10000">

<div class="centered-text">
<div id="bootprogress_text"></div>
<div id="bootprogress_bar_container">
<div id="bootprogress_bar"></div>
</div>
</div>

</div>

</body>
Expand Down
38 changes: 22 additions & 16 deletions BaseFiles/Common/html/js/api/homegenie.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ HG.Ui = HG.Ui || new function(){ var $$ = this;
'DoorLock',
Shutter:
'Shutter',
Siren:
Siren:
'Siren',
MediaTransmitter:
'MediaTransmitter',
Expand All @@ -151,8 +151,8 @@ HG.Ui = HG.Ui || new function(){ var $$ = this;
};

$$.GenerateWidget = function(fieldType, context, callback) {
// fieldType:
// widgets/text, widgets/password, widgets/checkbox, widgets/slider,
// fieldType:
// widgets/text, widgets/password, widgets/checkbox, widgets/slider,
// widgets/store.text, widgets/store.password, widgets/store.checkbox,
// widgets/store.list, store.edit
// core/popup.cronwizard
Expand Down Expand Up @@ -233,7 +233,7 @@ HG.Ui = HG.Ui || new function(){ var $$ = this;
if (callback != null) callback(null);
}
});
return widgetWrapper;
return widgetWrapper;
};

$$.GetModuleIcon = function(module, callback, elid) {
Expand All @@ -254,7 +254,7 @@ HG.Ui = HG.Ui || new function(){ var $$ = this;
else // Compatibility fall-back for old widget format
icon = module.WidgetInstance.IconImage;
} else {
// get reference to generic type widget
// get reference to generic type widget
HG.WebApp.WidgetsList.GetWidgetIcon(widget, elid, callback);
return icon;
}
Expand All @@ -263,11 +263,17 @@ HG.Ui = HG.Ui || new function(){ var $$ = this;
return icon;
};

$$.GetModuleDisplayName = function(module) {
$$.GetModuleDisplayName = function(module, short) {
var name = module.Domain + ' ' + module.Address;
try {
name = module.Name;
name += ' ('+module.Domain.substring(module.Domain.lastIndexOf('.')+1)+' '+module.Address+')';
if (module.Name && module.Name.length > 0) {
name = module.Name;
if (!short) {
name += ' ('+module.Domain.substring(module.Domain.lastIndexOf('.')+1)+' '+module.Address+')';
}
} else {
name += module.Domain.substring(module.Domain.lastIndexOf('.')+1)+':'+module.Address;
}
name = name.trim();
} catch(e) { }
return name;
Expand Down Expand Up @@ -343,7 +349,7 @@ HG.Ui = HG.Ui || new function(){ var $$ = this;
$$.ConfigureProgram = function(module) {
HG.WebApp.ProgramEdit._CurrentProgram.Domain = module.Domain;
HG.WebApp.ProgramEdit._CurrentProgram.Address = module.Address;
HG.WebApp.ProgramsList.UpdateOptionsPopup();
HG.WebApp.ProgramsList.UpdateOptionsPopup();
}

$$.GetParameterContext = function(module, parameter, value) {
Expand All @@ -365,7 +371,7 @@ HG.Ui = HG.Ui || new function(){ var $$ = this;
case ParameterType.Sensor_MotionDetect:
isStatusParam = true;
//hideable = true;
if (parameter != ParameterType.Sensor_MotionDetect &&
if (parameter != ParameterType.Sensor_MotionDetect &&
(parameter == ParameterType.Sensor_DoorWindow
|| parameter == ParameterType.Status_DoorLock
|| ((module != null && module.DeviceType != '') && (module.DeviceType == ModuleType.DoorWindow || module.DeviceType == ModuleType.DoorLock)))) {
Expand Down Expand Up @@ -534,27 +540,27 @@ HG.Ui.CreatePage = function(model, cuid) {
var $$ = model;
$$._fieldCache = [];
$$.PageId = $$.pageId = cuid;
$$.getContainer = function() {
$$.getContainer = function() {
if (typeof $$.container == 'undefined')
$$.container = $('#'+$$.pageId);
return $$.container;
$$.container = $('#'+$$.pageId);
return $$.container;
};
$$.field = function(field, globalSearch) {
var f = globalSearch ? '@'+field : field;
var el = null;
if (typeof $$._fieldCache[f] == 'undefined') {
el = globalSearch ? $(field) : $$.container.find('[data-ui-field='+field+']');
if (el.length)
if (el.length)
$$._fieldCache[f] = el;
} else {
el = $$._fieldCache[f];
}
return el;
return el;
};
$$.clearCache = function() {
var obj = $$._fieldCache;
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) { delete obj[prop]; }
if (obj.hasOwnProperty(prop)) { delete obj[prop]; }
}
$$._fieldCache = [];
};
Expand Down
Loading

0 comments on commit ebdd155

Please sign in to comment.