Skip to content

Commit

Permalink
unique rendering function name
Browse files Browse the repository at this point in the history
- and experimentally increase timeout to hopefully avoid #57
  • Loading branch information
foxriver76 committed Dec 4, 2020
1 parent 259c6ae commit 2fcd4c1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ For every shopping list a channel with the following states will be created:
*Read only json string, which contains a dictionary to translate the swiss item names to the list language.*

## Changelog
### 1.7.5 (2020-12-04)
* (foxriver76) we now use a unique name for widget rendering function to avoid conflicts

### 1.7.4 (2020-12-04)
* (foxriver76) we now render the widget immediately

Expand Down
14 changes: 13 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"common": {
"name": "bring",
"version": "1.7.4",
"version": "1.7.5",
"news": {
"1.7.5": {
"en": "we now use a unique name for widget rendering function to avoid conflicts",
"de": "Wir verwenden jetzt einen eindeutigen Namen für die Widget-Rendering-Funktion, um Konflikte zu vermeiden",
"ru": "теперь мы используем уникальное имя для функции рендеринга виджета, чтобы избежать конфликтов",
"pt": "agora usamos um nome único para a função de renderização do widget para evitar conflitos",
"nl": "we gebruiken nu een unieke naam voor de weergavefunctie van widgets om conflicten te vermijden",
"fr": "nous utilisons maintenant un nom unique pour la fonction de rendu du widget afin d'éviter les conflits",
"it": "ora usiamo un nome univoco per la funzione di rendering dei widget per evitare conflitti",
"es": "ahora usamos un nombre único para la función de representación de widgets para evitar conflictos",
"pl": "używamy teraz unikalnej nazwy dla funkcji renderowania widgetów, aby uniknąć konfliktów",
"zh-cn": "我们现在为窗口小部件呈现功能使用唯一的名称以避免冲突"
},
"1.7.4": {
"en": "we now render the widget immediately",
"de": "Wir rendern das Widget jetzt sofort",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.bring",
"version": "1.7.4",
"version": "1.7.5",
"engines": {
"node": ">=8.0.0"
},
Expand Down
28 changes: 14 additions & 14 deletions widgets/bring.html
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@
/*
* Render page and do init
**/
function renderPage(wid) {
function renderBringWidget(wid) {
var listNamespace = vis.widgets[wid].data['oid-list'];

console.log(new Date().toLocaleTimeString() + ' Bring[' + wid + ']: Render Widget');
Expand Down Expand Up @@ -566,18 +566,18 @@
data-vis-update-style="true"
data-vis-name="bring-shopping-list">
<div class="vis-widget <%== this.data.attr('class') %>" style="width:230px; height:210px; min-width:145px;" id="<%= this.data.attr('wid'); %>" >
<div style="height: 45px; margin-bottom: 10px; padding-right: 10px;">
<input type="text" placeholder="<%= this.data['text-for-adding'] %>" id="<%= this.data.attr('wid') %>-save" class="addArticleText" name="addArticle">
<input type="image" src="widgets/bring/img/add.svg" id="<%= this.data.attr('wid') %>-addButton" class="addButton"/>
<div style="height: 45px; margin-bottom: 10px; padding-right: 10px;">
<input type="text" placeholder="<%= this.data['text-for-adding'] %>" id="<%= this.data.attr('wid') %>-save" class="addArticleText" name="addArticle">
<input type="image" src="widgets/bring/img/add.svg" id="<%= this.data.attr('wid') %>-addButton" class="addButton"/>
</div>
<div class="template-class vis-widget-body <%== this.data.attr('class') %>">
<div id="<%= this.data.attr('wid') %>-shoppinglist" style="min-width: 100%; padding: 2px;">
</div>
<div style="clear: both;"></div>
<hr style="margin-top: 5px; margin-bottom: 5px; width: 70%; text-align: center;">
<div id="<%= this.data.attr('wid') %>-recentlist" style="min-width: 100%; padding: 2px; max-height: auto; overflow: hidden;">
</div>
</div>
</div>
<div class="template-class vis-widget-body <%== this.data.attr('class') %>">
<div id="<%= this.data.attr('wid') %>-shoppinglist" style="min-width: 100%; padding: 2px;">
</div>
<div style="clear: both;"></div>
<hr style="margin-top: 5px; margin-bottom:5px;width:70%;text-align:center;">
<div id="<%= this.data.attr('wid') %>-recentlist" style="min-width: 100%; padding: 2px; max-height: auto; overflow: hidden;">
</div>
</div>
</div>
<% renderPage(this.data.attr('wid')); %>
<% setTimeout(renderBringWidget, 1500, this.data.attr('wid')); %>
</script>

0 comments on commit 2fcd4c1

Please sign in to comment.