Jump to content

User:Thespaceface/ImperialFirst.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
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.,]+)&nbsp;mi\)/g,'$2 miles ($1 km)');
h = h.replace(/([0-9.,]+–[0-9.,]+) kilometres \(([0-9.,]+–[0-9.,]+)&nbsp;mi\)/g,'$2 miles ($1 km)');
h = h.replace(/([0-9.,]+–[0-9.,]+) metres \(([0-9.,]+–[0-9.,]+)&nbsp;ft\)/g,'$2 feet ($1 m)');
h = h.replace(/([0-9.,]+–[0-9.,]+) millimetres \(([0-9.,]+–[0-9.,]+)&nbsp;in\)/g,'$2 inches ($1 mm)');
h = h.replace(/([0-9.,]+)-kilometre \(([0-9.,]+)&nbsp;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.,]+)&nbsp;ft\)/g,'$2-foot ($1 m)');
h = h.replace(/([0-9,.]+)-kilometre-long \(([0-9,.]+)&nbsp;mi\)/g,'$2-mile-long ($1 km)');
h = h.replace(/([0-9,.]+) metres \(([0-9.,]+)&nbsp;ft\)/g,'$2 feet ($1 m)');
h = h.replace(/([0-9,.]+ m) \(([0-9,.]+&nbsp;ft)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+)-square-metre \(([0-9,.]+)&nbsp;sq ft\)/g,'$2-square-feet ($1 m<sup>2</sup>)');
h = h.replace(/([0-9,.]+ m<sup>2<\/sup>) \(([0-9,.]+&nbsp;sq ft)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+&nbsp;sq&nbsp;ft) \(([0-9,.]+&nbsp;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,.−-]+&nbsp;°F)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.−-]+&nbsp;°C) \(([0-9,.−-]+&nbsp;°F)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.−-]+ C) \(([0-9,.−-]+ F)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.−-]+&nbsp;C) \(([0-9,.−-]+&nbsp;F)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+ km) \(([0-9,.]+&nbsp;mi)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+&nbsp;km<sup>2<\/sup>) \(([0-9,.]+&nbsp;sq&nbsp;mi)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+) square kilometres \(([0-9,.]+)&nbsp;sq&nbsp;mi\)/g,'$2 square miles ($1 km<sup>2</sup>)');
h = h.replace(/([0-9,.]+)&nbsp;square&nbsp;kilometres \(([0-9,.]+)&nbsp;sq&nbsp;mi\)/g,'$2 square miles ($1 km<sup>2</sup>)');
h = h.replace(/([0-9,.]+&nbsp;km²) \(([0-9,.]+&nbsp;sq&nbsp;mi)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+&nbsp;km) \(([0-9,.]+&nbsp;mi)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+) kilograms \(([0-9,.]+)&nbsp;lb\)/g,'$2 pounds ($1 kg)');
h = h.replace(/([0-9,.]+) kg \(([0-9,.]+)&nbsp;lb\)/g,'$2 lb ($1 kg)');
h = h.replace(/([0-9,.]+&nbsp;cm) \(([0-9,.]+&nbsp;in)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+)&nbsp;centimetres \(([0-9,.]+)&nbsp;in\)/g,'$2 inches ($1 cm)');
h = h.replace(/([0-9,.]+ cm) \(([0-9,.]+&nbsp;in)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+) centimetres \(([0-9,.]+)&nbsp;in\)/g,'$2 inches ($1 cm)');
h = h.replace(/([0-9,.]+&nbsp;mm) \(([0-9,.]+&nbsp;in)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+)&nbsp;millimetres \(([0-9,.]+)&nbsp;in\)/g,'$2 inches ($1 mm)');
h = h.replace(/([0-9,.]+ mm) \(([0-9,.]+&nbsp;in)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+) millimetres \(([0-9,.]+)&nbsp;mm\)/g,'$2 inches ($1 mm)');
h = h.replace(/([0-9,.]+&nbsp;m) \(([0-9,.]+&nbsp;ft)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+\/km<sup>2<\/sup>) \(([0-9,.]+\/&nbsp;sq&nbsp;mi)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+\/km²) \(([0-9,.]+\/&nbsp;sq&nbsp;mi)\)/g,'$2 ($1)');
h = h.replace(/([0-9,.]+&nbsp;km)(<sup.*<\/sup>) \(([0-9.,]+&nbsp;mi)\)/g,'$3$2 ($1)');
h = h.replace(/([0-9,.]+)-metre-wide \(([0-9.,]+)&nbsp;ft\)/g,'$2-foot-wide ($1 m)');
h = h.replace(/([0-9,.]+) kilometres per hour \(([0-9.,]+)&nbsp;mph\)/g,'$2 miles per hour ($1 km/h)');
h = h.replace(/([0-9,.]+) kilometres per hour \(([0-9.,]+)&nbsp;miles per hour\)/g,'$2 miles per hour ($1 kilometres per hour)');
h = h.replace(/([0-9,.]+) km\/h \(([0-9.,]+)&nbsp;mph\)/g,'$2 mph ($1 km/h)');
h = h.replace(/([0-9,.]+)&nbsp;km\/h \(([0-9.,]+)&nbsp;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;