User:Rho9998/common.js

$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType: 'script',  cache: true }).then(function {  // page NS  pathoschild.TemplateScript.add( [     // RunningHeader {       name: 'OE OCR fixes - vowel accents', position: 'replace', script: function(editor) {

// replace most diacritics with macrons var replacements = [ [ /[àáäâã]/g, 'ā' ], [ /[èéëêẽ]/g, 'ē' ], [ /[ìíïîĩ]/g, 'ī' ], [ /[ũúüûũ]/g, 'ū' ], [ /[òóöôõ]/g, 'ō' ], [ /[ỳýÿŷỹ]/g, 'ȳ' ], ];

for ( var i = 0; i < replacements.length; ++i ) { editor .replace(replacements[ i ][ 0 ], replacements[ i ][ 1 ]); }       }      },    ], {      category: 'main', forNamespaces: ["Page"] } ); } );

$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType: 'script',  cache: true }).then(function {  // page NS  pathoschild.TemplateScript.add( [     // RunningHeader {       name: 'OE OCR fixes - ƿ -> þ', position: 'replace', script: function(editor) {

// replace wynns with p-s var replacements = [ [ /ƿ/g, 'þ' ], ];

for ( var i = 0; i < replacements.length; ++i ) { editor .replace(replacements[ i ][ 0 ], replacements[ i ][ 1 ]); }       }      },    ], {      category: 'main', forNamespaces: ["Page"] } ); } );

$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType: 'script',  cache: true }).then(function {  // page NS  pathoschild.TemplateScript.add( [     // RunningHeader {       name: 'OE OCR fixes - p -> þ (selected)', position: 'replace', script: function(editor) {

// replace p-s with thorns in common words var replacements = [ [ /pæt/g, 'þæt' ], [ /pæs/g, 'þæs' ], [ /pætte/g, 'þætte' ], [ /pær/g, 'þær' ], [ /pæt/g, 'þæt' ], [ /pæm/g, 'þæm' ], [ /para/g, 'þara' ], [ /pe/g, 'þe' ], [ /pē/g, 'þē' ], [ /pu/g, 'þu' ], [ /pū/g, 'þū' ], [ /pās/g, 'þās' ], [ /pas/g, 'þas' ], [ /pu/g, 'þu' ], [ /pam/g, 'þam' ], ];

for ( var i = 0; i < replacements.length; ++i ) { editor .replace(replacements[ i ][ 0 ], replacements[ i ][ 1 ]); }       }      },    ], {      category: 'main', forNamespaces: ["Page"] } ); } );

$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType: 'script',  cache: true }).then(function {  // page NS  pathoschild.TemplateScript.add( [     // RunningHeader {       name: 'OE OCR fixes - d -> ð (selected)', position: 'replace', script: function(editor) {

// replace most diacritics with macrons var replacements = [ [ /dæt/g, 'ðæt' ], [ /dæs/g, 'ðæs' ], [ /dætte/g, 'ðætte' ], [ /dær/g, 'ðær' ], [ /dæt/g, 'ðæt' ], [ /dæm/g, 'ðæm' ], [ /dāra/g, 'ðāra' ], [ /dara/g, 'ðara' ], [ /dū/g, 'ðū' ], [ /dās/g, 'ðās' ], [ /das/g, 'ðas' ], [ /du/g, 'ðu' ], [ /dam/g, 'ðam' ], ];

for ( var i = 0; i < replacements.length; ++i ) { editor .replace(replacements[ i ][ 0 ], replacements[ i ][ 1 ]); }       }      },    ], {      category: 'main', forNamespaces: ["Page"] } ); } );

$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType: 'script',  cache: true }).then(function {  // page NS  pathoschild.TemplateScript.add( [     // RunningHeader {       name: 'OE OCR fixes - p -> þ (all)', position: 'replace', script: function(editor) {

// replace most diacritics with macrons var replacements = [ [ /p/g, 'þ' ], ];

for ( var i = 0; i < replacements.length; ++i ) { editor .replace(replacements[ i ][ 0 ], replacements[ i ][ 1 ]); }       }      },    ], {      category: 'main', forNamespaces: ["Page"] } ); } );

$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType: 'script',  cache: true }).then(function {  // page NS  pathoschild.TemplateScript.add( [     // RunningHeader {       name: 'OE OCR fixes for the Dialogi', position: 'replace', script: function(editor) {

// replace most diacritics with macrons var replacements = [ [ /J/g, '⁊' ], [ /3/g, 'G' ], [ /[Zz]/g, 'g' ], [ /[Sp]/g, 'þ' ], ];

for ( var i = 0; i < replacements.length; ++i ) { editor .replace(replacements[ i ][ 0 ], replacements[ i ][ 1 ]); }       }      },    ], {      category: 'main', forNamespaces: ["Page"] } ); } );