UNPKG

iobroker.energiefluss-erweitert

Version:

This ioBroker adapter is the next Version of the energiefluss with the attribute 'erweitert' and allows to display an energyflow animation inside an iframe or HTML DIV.

1 lines 1.36 kB
"use strict";var systemLang="en",systemDictionary={};function translateWord(t,a,r){if(!t)return"";if(a=a||systemLang,(r=r||systemDictionary)[t=t.toString()]){var e=r[t][a];if(e||"en"!==a&&(e=r[t].en))return e}return t}function translateAll(t,a,r){a=a||systemLang,r=r||systemDictionary,t||(t="body");var e=$(t);e.find(".translate").each(function(t){var e=$(this).attr("data-lang");e||(e=$(this).html(),$(this).attr("data-lang",e));var n=translateWord(e,a,r);n&&$(this).html(n)}),e.find(".translateV").each(function(t){var e=$(this).attr("data-lang-value");e||(e=$(this).attr("value"),$(this).attr("data-lang-value",e));var n=translateWord(e,a,r);n&&$(this).attr("value",n)}),e.find(".translateT").each(function(t){var e=$(this).attr("data-lang-title");e||(e=$(this).attr("title"),$(this).attr("data-lang-title",e));var n=translateWord(e,a,r);n&&$(this).attr("title",n)}),e.find(".translateP").each(function(t){var e=$(this).attr("data-lang-placeholder");e||(e=$(this).attr("placeholder"),$(this).attr("data-lang-placeholder",e));var n=translateWord(e,a,r);n&&$(this).attr("placeholder",n)})}function translateName(t){return t&&"object"==typeof t?t[systemLang]||t.en:t}var _=function(t,a,r,e){var n=(t=translateWord(t)).indexOf("%s");return -1===n||-1===(n=(t=t.replace("%s",a)).indexOf("%s"))||-1!==(n=(t=t.replace("%s",r)).indexOf("%s"))&&(t=t.replace("%s",e)),t};