iobroker.mywebui 1.37.83 → 1.37.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "mywebui",
4
- "version": "1.37.83",
4
+ "version": "1.37.85",
5
5
  "titleLang": {
6
6
  "en": "mywebui",
7
7
  "de": "mywebui",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.mywebui",
3
- "version": "1.37.83",
3
+ "version": "1.37.85",
4
4
  "description": "ioBroker mywebui - Custom edited mywebui by gokturk413",
5
5
  "type": "module",
6
6
  "main": "dist/backend/main.js",
@@ -49,6 +49,7 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
49
49
  npmState;
50
50
  scriptSystem;
51
51
  bindingsHelper;
52
+ _editorAnimationsEnabled = false;
52
53
  static style = css `
53
54
  :host {
54
55
  display: block;
@@ -707,10 +708,17 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
707
708
  panel.id = 'anim-panel-container';
708
709
  panel.style.cssText = 'padding:12px;';
709
710
  panel.innerHTML = `
711
+ <label id="editor-anim-label" style="display:flex;align-items:center;gap:6px;margin-bottom:10px;font-size:12px;cursor:pointer;user-select:none;border-bottom:1px solid #ddd;padding-bottom:8px;">
712
+ <input type="checkbox" id="editor-anim-cb" ${this._editorAnimationsEnabled ? 'checked' : ''}>
713
+ disable in editor mode
714
+ </label>
710
715
  <h3 style="margin:0 0 12px 0;font-size:14px;font-weight:bold;color:#333;">🎬 Animation</h3>
711
716
  <div id="anim-panel-content" style="font-size:12px;"><p style="color:#999;font-style:italic;">Select an element...</p></div>
712
717
  `;
713
718
  dock.appendChild(panel);
719
+ panel.querySelector('#editor-anim-cb').addEventListener('change', (e) => {
720
+ this._setEditorAnimationsEnabled(e.target.checked);
721
+ });
714
722
 
715
723
  let lastEl = null;
716
724
  const poll = () => {
@@ -1062,10 +1070,17 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
1062
1070
  panel.id = 'effects-panel-container';
1063
1071
  panel.style.cssText = 'padding:12px;';
1064
1072
  panel.innerHTML = `
1073
+ <label id="editor-fx-label" style="display:flex;align-items:center;gap:6px;margin-bottom:10px;font-size:12px;cursor:pointer;user-select:none;border-bottom:1px solid #ddd;padding-bottom:8px;">
1074
+ <input type="checkbox" id="editor-fx-cb" ${this._editorAnimationsEnabled ? 'checked' : ''}>
1075
+ disable in editor mode
1076
+ </label>
1065
1077
  <h3 style="margin:0 0 12px 0;font-size:14px;font-weight:bold;color:#333;">✨ Effect</h3>
1066
1078
  <div id="effects-panel-content" style="font-size:12px;"><p style="color:#999;font-style:italic;">Select an element...</p></div>
1067
1079
  `;
1068
1080
  dock.appendChild(panel);
1081
+ panel.querySelector('#editor-fx-cb').addEventListener('change', (e) => {
1082
+ this._setEditorAnimationsEnabled(e.target.checked);
1083
+ });
1069
1084
 
1070
1085
  let lastEl = null;
1071
1086
  const poll = () => {
@@ -1078,6 +1093,20 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
1078
1093
  setInterval(poll, 500);
1079
1094
  }
1080
1095
 
1096
+ _setEditorAnimationsEnabled(value) {
1097
+ this._editorAnimationsEnabled = value;
1098
+ // Sync both checkboxes
1099
+ const animCb = this._getDomElement('animationsDock')?.querySelector('#editor-anim-cb');
1100
+ const fxCb = this._getDomElement('effectsDock')?.querySelector('#editor-fx-cb');
1101
+ if (animCb) animCb.checked = value;
1102
+ if (fxCb) fxCb.checked = value;
1103
+ // Apply to all open screen editors
1104
+ for (const ed of this._dock.querySelectorAll('iobroker-webui-screen-editor')) {
1105
+ const canvas = ed.documentContainer?.designerView?.designerCanvas;
1106
+ if (canvas) canvas.pauseAnimations = !value;
1107
+ }
1108
+ }
1109
+
1081
1110
  _updateEffectsPanel() {
1082
1111
  const dock = this._getDomElement('effectsDock');
1083
1112
  if (!dock) return;
@@ -627,6 +627,9 @@ export class IobrokerWebuiScreenEditor extends BaseCustomWebComponentConstructor
627
627
  this._settingsChanged = window.appShell.settingsEditor.propertyChanged.on(() => {
628
628
  this.handlePropertyChanges();
629
629
  });
630
+ // Apply current editor animations state (set by the checkbox in Animations/Effects panels)
631
+ const canvas = this.documentContainer.designerView.designerCanvas;
632
+ if (canvas) canvas.pauseAnimations = !window.appShell._editorAnimationsEnabled;
630
633
  }
631
634
  _controlDefaultWidth = '800px';
632
635
  _controlDefaultHeight = '600px';
@@ -675,6 +678,8 @@ export class IobrokerWebuiScreenEditor extends BaseCustomWebComponentConstructor
675
678
  if (scriptObj?.default && !scriptObj?.connectedCallback)
676
679
  scriptObj = scriptObj.default;
677
680
  this._designerScriptObject = scriptObj;
681
+ if (scriptObj?.init)
682
+ scriptObj.init(rootEl, shadowRoot);
678
683
  if (scriptObj?.connectedCallback)
679
684
  scriptObj.connectedCallback(rootEl, shadowRoot);
680
685
  } catch (err) {