38 lines
2.1 KiB
Python
38 lines
2.1 KiB
Python
#!/usr/bin/env python3
|
|
path = "/var/www/html/weval-technology-platform.html"
|
|
with open(path, "rb") as f:
|
|
raw = f.read()
|
|
|
|
if b"v80-toggle-inline" in raw:
|
|
print("ALREADY_MOVED")
|
|
exit(0)
|
|
|
|
# STEP 1: Inject new inline button in topbar BEFORE notifications icon (or actually next to Help)
|
|
# Position: just before <div class="wtp-user"> so it sits immediately left of Yacine
|
|
topbar_marker = b'<div class="wtp-user">\n <div class="wtp-avatar">YM</div>'
|
|
topbar_inject = b'''<button id="v80-toggle-inline" onclick="v80Open()" title="Navigation Archi Unifiee - toutes les portes" style="background:linear-gradient(135deg,#6366f1,#8b5cf6);color:#fff;border:none;padding:8px 14px;border-radius:18px;cursor:pointer;font-size:12px;font-weight:700;letter-spacing:.3px;display:flex;align-items:center;gap:6px;transition:all .2s;box-shadow:0 4px 12px rgba(99,102,241,.3)" onmouseover="this.style.transform='translateY(-1px)';this.style.boxShadow='0 6px 18px rgba(99,102,241,.5)'" onmouseout="this.style.transform='translateY(0)';this.style.boxShadow='0 4px 12px rgba(99,102,241,.3)'"><span style="font-size:14px">\xf0\x9f\xa7\xad</span>Archi complete</button>
|
|
<div class="wtp-user">\n <div class="wtp-avatar">YM</div>'''
|
|
|
|
if topbar_marker not in raw:
|
|
print("TOPBAR_MARKER_NOT_FOUND")
|
|
idx = raw.find(b"wtp-user")
|
|
print("context:", raw[idx-10:idx+200])
|
|
exit(1)
|
|
|
|
new_raw = raw.replace(topbar_marker, topbar_inject, 1)
|
|
|
|
# STEP 2: Hide original floating bottom-left button via CSS override
|
|
# Inject before </style> or at end of CSS block - find the CSS rule for v80-toggle
|
|
css_marker = b"#v80-toggle{position:fixed;bottom:20px;left:20px;"
|
|
if css_marker in new_raw:
|
|
# Override: hide the original
|
|
css_override = b"#v80-toggle{display:none !important;" # disable original
|
|
new_raw = new_raw.replace(css_marker, css_override, 1)
|
|
|
|
with open(path, "wb") as f:
|
|
f.write(new_raw)
|
|
|
|
print(f"MOVED {len(raw)} -> {len(new_raw)} (+{len(new_raw)-len(raw)}B)")
|
|
print(f"v80-toggle-inline count: {new_raw.count(b'v80-toggle-inline')}")
|
|
print(f"original v80-toggle display:none: {b'#v80-toggle{display:none' in new_raw}")
|