Your search results

Posted by admin on September 3, 2026
0 Comments
from pathlib import Path import re, subprocess, textwrap, json, os src = Path(“/mnt/data/Home_Buyer_360_CurrencySelector_AdditionalBuyersFixed_v2.html”) text = src.read_text(encoding=”utf-8″) # —————————– # 1) Reverse dual-currency order # USD first in black; client/local second in green. # —————————– currency_order_css = r”’ /* ===== USD FIRST / CLIENT CURRENCY SECOND ===== */ .money-usd{ color:#102640!important; font-weight:900!important; font-size:1em!important; } .money-usd::before{ content:”USD “; color:#102640!important; font-weight:900!important; font-size:1em!important; } .money-local{ color:#16834f!important; font-weight:900!important; font-size:.78em!important; } .money-conversion .usd-preview{ color:#102640!important; font-weight:900!important; } .money-conversion .local-preview{ color:#16834f!important; font-weight:900!important; } .converter-usd-money{ color:#102640!important; } .converter-client-money{ color:#16834f!important; } ”’ text = text.replace(““, currency_order_css + “\n“, 1) # Force display mode to USD + local in every relevant selector. text = text.replace( ‘‘, ‘‘ ) text = text.replace( ‘‘, ‘‘ ) # Make default/fallback mode usd-local in JS. text = text.replace(“?.value||’local-usd'”, “?.value||’usd-local'”) text = text.replace(‘?.value||”local-usd”‘, ‘?.value||”usd-local”‘) # Patch dualMoneyHTML logic so first USD is black, local second green. old_dual = “””if(mode===’usd-local’){ return `${usdFormat(usd)}${localFormat(local)}`; } return `${localFormat(local)}${usdFormat(usd)}`;””” new_dual = “””if(mode===’local-usd’){ return `${localFormat(local)}${usdFormat(usd)}`; } return `${usdFormat(usd)}${localFormat(local)}`;””” text = text.replace(old_dual, new_dual, 1) # Update ribbon wording. text = text.replace( ‘Currency display: USD local amounts with USD equivalent in green. Change this in the Currency Center.’, ‘Currency display: USD first in black, followed by USD client currency in green.’ ) # —————————– # 2) Add top language selector # —————————– if ‘id=”languageSelector”‘ not in text: lang_bar = r”’
Language: The page labels and navigation change automatically.
”’ # Put just before top currency selector idx = text.find(‘
‘) if idx != -1: text = text[:idx] + lang_bar + text[idx:] lang_css = r”’ /* ===== LANGUAGE SELECTOR ===== */ .language-bar{ display:flex; align-items:center; gap:8px; padding:7px 12px; margin:6px 8px 0; border:1px solid #d7dee8; border-radius:9px; background:#f8fafc; } .language-bar b{color:#102640} .language-bar select{width:170px;min-height:34px} .language-note{font-size:11px;color:#64748b} @media(max-width:760px){ .language-bar{flex-wrap:wrap} .language-bar select{width:100%} } ”’ text = text.replace(““, lang_css + “\n“, 1) # —————————– # 3) Rebuild Additional Buyer UI # —————————– # Replace the buyer count selector with clearly labeled control + manual Add Buyer button. text = text.replace( ‘‘, ”’”’, 1 ) # Replace status area with buttons if not already. status_pattern = re.compile( r’
\s*Additional Buyer / Co-Borrower Sections.*?
\s*
\s*
‘, re.S ) new_status = r”’
Additional Buyers / Co-Borrowers
Choose the total number of buyers above or use the buttons below.
1 buyer selected.
”’ text, replaced_status = status_pattern.subn(new_status, text, count=1) # Replace or override refreshCoBuyers with an isolated engine added at very end. additional_buyer_script = r”’ ”’ text = text.replace(““, additional_buyer_script + “\n“, 1) # Patch totalIncome / totalDebts to use independent engines if possible. # replace their function bodies text = re.sub( r’function totalIncome\(\)\{\s*return .*?\n\}’, ”’function totalIncome(){ return n(incEmployment.value)+n(incBusiness.value)+n(incRental.value)+n(incInvestment.value)+n(incOther.value)+n(incCo.value) +(typeof window.getAdditionalBuyerIncome===”function”?window.getAdditionalBuyerIncome():0) }”’, text, count=1, flags=re.S ) text = re.sub( r’function totalDebts\(\)\{\s*return .*?\n\}’, ”’function totalDebts(){ return […document.querySelectorAll(“.monthlyDebt”)].reduce((a,e)=>a+n(e.value),0) +(typeof window.getAdditionalBuyerDebt===”function”?window.getAdditionalBuyerDebt():0) }”’, text, count=1, flags=re.S ) # —————————– # 4) Language auto-translation # —————————– language_script = r”’ ”’ text = text.replace(““, language_script + “\n“, 1) # —————————– # 5) Top currency wording and converter results order # —————————– text = text.replace( ‘Client Currency Result‘, ‘Client Currency Result — shown in green‘ ) text = text.replace( ‘United States Currency‘, ‘United States Currency — primary amount‘ ) # Currency converter results: USD should be black, client green. # CSS already overrides classes. # Save out = Path(“/mnt/data/Home_Buyer_360_USD_First_Language_AdditionalBuyerFixed.html”) out.write_text(text, encoding=”utf-8″) # Basic diagnostics print(“Created:”, out) print(“Size:”, f”{out.stat().st_size:,} bytes”) print(“Language selector:”, ‘id=”languageSelector”‘ in text) print(“Add buyer button:”, ‘id=”addBuyerButton”‘ in text) print(“Independent buyer engine:”, ‘additional-buyer-engine-v4’ in text) print(“USD-first CSS:”, “USD FIRST / CLIENT CURRENCY SECOND” in text)

Leave a Reply

Your email address will not be published.

  • Advanced Search

Compare Listings