Skip to content

Commit fca8b69

Browse files
authored
Update fast-search-card.js
1 parent 3f4851d commit fca8b69

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

β€Ždist/fast-search-card.jsβ€Ž

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4414,7 +4414,7 @@ class FastSearchCard extends HTMLElement {
44144414
transform: translateY(-50%);
44154415
display: flex;
44164416
align-items: center;
4417-
gap: 8px;
4417+
gap: 0px;
44184418
}
44194419

44204420
/* Timer Edit/Delete Button Styles */
@@ -10101,6 +10101,8 @@ class FastSearchCard extends HTMLElement {
1010110101
}
1010210102

1010310103
getPresetIconForAction(action) {
10104+
console.log('πŸ” DEBUG - Action eingegangen:', action);
10105+
1010410106
// Bestimme welche Preset-Funktion und welche Action
1010510107
let presetHTML = '';
1010610108

@@ -10119,24 +10121,44 @@ class FastSearchCard extends HTMLElement {
1011910121
const svgMatch = match[1].match(/<svg[^>]*>.*?<\/svg>/s);
1012010122
return svgMatch ? svgMatch[0].replace('width="24"', 'width="16"').replace('height="24"', 'height="16"') : '';
1012110123
}
10122-
1012310124
} else if (action.includes('30%')) {
10125+
console.log('πŸ” 30% gefunden!');
1012410126
presetHTML = this.getLightTimerPresets();
10127+
console.log('πŸ” PresetHTML LΓ€nge:', presetHTML.length);
10128+
console.log('πŸ” PresetHTML enthΓ€lt dim_30:', presetHTML.includes('data-action="dim_30"'));
10129+
1012510130
const match = presetHTML.match(/data-action="dim_30"[^>]*>\s*(.*?)\s*<span class="timer-preset-label">/s);
10131+
console.log('πŸ” Match gefunden:', !!match);
1012610132
if (match) {
10133+
console.log('πŸ” Match[1]:', match[1]);
1012710134
const svgMatch = match[1].match(/<svg[^>]*>.*?<\/svg>/s);
10128-
return svgMatch ? svgMatch[0].replace('width="24"', 'width="16"').replace('height="24"', 'height="16"') : '';
10135+
console.log('πŸ” SVG Match:', !!svgMatch);
10136+
if (svgMatch) {
10137+
console.log('πŸ” SVG:', svgMatch[0]);
10138+
return svgMatch[0].replace('width="24"', 'width="16"').replace('height="24"', 'height="16"');
10139+
}
1012910140
}
1013010141
} else if (action.includes('50%')) {
10142+
console.log('πŸ” 50% gefunden!');
1013110143
presetHTML = this.getLightTimerPresets();
10144+
console.log('πŸ” PresetHTML LΓ€nge:', presetHTML.length);
10145+
console.log('πŸ” PresetHTML enthΓ€lt dim_50:', presetHTML.includes('data-action="dim_50"'));
10146+
1013210147
const match = presetHTML.match(/data-action="dim_50"[^>]*>\s*(.*?)\s*<span class="timer-preset-label">/s);
10148+
console.log('πŸ” Match gefunden:', !!match);
1013310149
if (match) {
10150+
console.log('πŸ” Match[1]:', match[1]);
1013410151
const svgMatch = match[1].match(/<svg[^>]*>.*?<\/svg>/s);
10135-
return svgMatch ? svgMatch[0].replace('width="24"', 'width="16"').replace('height="24"', 'height="16"') : '';
10152+
console.log('πŸ” SVG Match:', !!svgMatch);
10153+
if (svgMatch) {
10154+
console.log('πŸ” SVG:', svgMatch[0]);
10155+
return svgMatch[0].replace('width="24"', 'width="16"').replace('height="24"', 'height="16"');
10156+
}
1013610157
}
1013710158
}
1013810159

1013910160
// Fallback
10161+
console.log('πŸ” Fallback wird verwendet');
1014010162
return `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><circle cx="12" cy="12" r="10"></circle><polyline points="12,6 12,12 16,14"></polyline></svg>`;
1014110163
}
1014210164

0 commit comments

Comments
Β (0)