User:Thespaceface/ImperialFirst.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
This user script seems to have a documentation page at User:Thespaceface/ImperialFirst. |
for(var i = 0;i < 100; i++){
var b = document.getElementById("collapseButton" + i);
if(b === null || b === undefined){
break;
}
b.click();
}
var txt = document.getElementById('mw-content-text' );
var h = txt.innerHTML.replace(/([0-9.,]+) kilometres \(([0-9.,]+) mi\)/g,'$2 miles ($1 km)');
h = h.replace(/([0-9.,]+–[0-9.,]+) kilometres \(([0-9.,]+–[0-9.,]+) mi\)/g,'$2 miles ($1 km)');
h = h.replace(/([0-9.,]+–[0-9.,]+) metres \(([0-9.,]+–[0-9.,]+) ft\)/g,'$2 feet ($1 m)');
h = h.replace(/([0-9.,]+–[0-9.,]+) millimetres \(([0-9.,]+–[0-9.,]+) in\)/g,'$2 inches ($1 mm)');
h = h.replace(/([0-9.,]+)-kilometre \(([0-9.,]+) mi\)/g,'$2-mile ($1 km)');
h = h.replace(/([0-9.,]+)-kilometre \(([0-9.,]+)-mi\)/g,'$2-mile ($1-km)');
h = h.replace(/([0-9.,]+)-metre \(([0-9.,]+) ft\)/g,'$2-foot ($1 m)');
h = h.replace(/([0-9,.]+)-kilometre-long \(([0-9,.]+) mi\)/g,'$2-mile-long ($1 km)');
h = h.replace(/([0-9,.]+) metres \(([0-9.,]+) ft\)/g,'$2 feet ($1 m)');
h = h.replace(/([0-9,.]+ m) \(([0-9,.]+ ft)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+)-square-metre \(([0-9,.]+) sq ft\)/g,'$2-square-feet ($1 m<sup>2</sup>)');
h = h.replace(/([0-9,.]+ m<sup>2<\/sup>) \(([0-9,.]+ sq ft)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+ sq ft) \(([0-9,.]+ m<sup>2<\/sup>)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+) per square kilometre \(([0-9,.]+)\/sq mi\)/g,'$2 per square mile ($1/km<sup>2</sup>)');
h = h.replace(/([0-9,.]+) people per square kilometre \(([0-9,.]+)\/sq mi\)/g,'$2 people per square mile ($1/km<sup>2</sup>)');
h = h.replace(/([0-9,.−-]+ °C) \(([0-9,.−-]+ °F)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.−-]+ °C) \(([0-9,.−-]+ °F)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.−-]+ C) \(([0-9,.−-]+ F)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.−-]+ C) \(([0-9,.−-]+ F)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+ km) \(([0-9,.]+ mi)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+ km<sup>2<\/sup>) \(([0-9,.]+ sq mi)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+) square kilometres \(([0-9,.]+) sq mi\)/g,'$2 square miles ($1 km<sup>2</sup>)');
h = h.replace(/([0-9,.]+) square kilometres \(([0-9,.]+) sq mi\)/g,'$2 square miles ($1 km<sup>2</sup>)');
h = h.replace(/([0-9,.]+ km²) \(([0-9,.]+ sq mi)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+ km) \(([0-9,.]+ mi)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+) kilograms \(([0-9,.]+) lb\)/g,'$2 pounds ($1 kg)');
h = h.replace(/([0-9,.]+) kg \(([0-9,.]+) lb\)/g,'$2 lb ($1 kg)');
h = h.replace(/([0-9,.]+ cm) \(([0-9,.]+ in)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+) centimetres \(([0-9,.]+) in\)/g,'$2 inches ($1 cm)');
h = h.replace(/([0-9,.]+ cm) \(([0-9,.]+ in)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+) centimetres \(([0-9,.]+) in\)/g,'$2 inches ($1 cm)');
h = h.replace(/([0-9,.]+ mm) \(([0-9,.]+ in)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+) millimetres \(([0-9,.]+) in\)/g,'$2 inches ($1 mm)');
h = h.replace(/([0-9,.]+ mm) \(([0-9,.]+ in)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+) millimetres \(([0-9,.]+) mm\)/g,'$2 inches ($1 mm)');
h = h.replace(/([0-9,.]+ m) \(([0-9,.]+ ft)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+\/km<sup>2<\/sup>) \(([0-9,.]+\/ sq mi)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+\/km²) \(([0-9,.]+\/ sq mi)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+ km)(<sup.*<\/sup>) \(([0-9.,]+ mi)\)/g,'$3$2 ($1)');
h = h.replace(/([0-9,.]+)-metre-wide \(([0-9.,]+) ft\)/g,'$2-foot-wide ($1 m)');
h = h.replace(/([0-9,.]+) kilometres per hour \(([0-9.,]+) mph\)/g,'$2 miles per hour ($1 km/h)');
h = h.replace(/([0-9,.]+) kilometres per hour \(([0-9.,]+) miles per hour\)/g,'$2 miles per hour ($1 kilometres per hour)');
h = h.replace(/([0-9,.]+) km\/h \(([0-9.,]+) mph\)/g,'$2 mph ($1 km/h)');
h = h.replace(/([0-9,.]+) km\/h \(([0-9.,]+) mph\)/g,'$2 mph ($1 km/h)');
h = h.replace(/([0-9,.]+) km\/h \(([0-9.,]+) mph\)/g,'$2 mph ($1 km/h)');
txt.innerHTML = h;