User:Firilacroco/modern.js

From translatewiki.net
Jump to: navigation, search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
// Sometimes at various zoom settings there is a +1 difference var doChange = (Math.abs(normalText.offsetWidth - diacriticsText.offsetWidth) > 1); // Pocket Internet Explorer on Windows Mobile 6.5 returns 0 if (normalText.offsetWidth == 0 && diacriticsText.offsetWidth == 0) { doChange = true; } /* alert("doChange: " + doChange + "\n" + normalText.offsetWidth + " vs " + diacriticsText.offsetWidth + "\n" + "fontFamily: " + diacriticsGetStyle(diacriticsText, "font-family")); */ document.body.removeChild(normalText); document.body.removeChild(diacriticsText); if(doChange) { showOldDiacritics(); } } /**Partea 3: Folosirea funcțiilor de mai sus */ addOnloadHook(saveNewDiacritics); addOnloadHook(diacriticsOnOlderOperatingSystems);
var diacriticsText = document.createElement("div"); diacriticsConfigureTextElement(diacriticsText, "șȘțȚ"); document.body.insertBefore(normalText, document.body.firstChild); document.body.insertBefore(diacriticsText, document.body.firstChild);
Retrieved from "https://translatewiki.net/w/i.php?title=User:Firilacroco/modern.js&oldid=3594189"