User:WOSlinker/imdb.js

function imdb_queryString(p) { var re = RegExp('[&?]' + p + '=([^&]*)'); var matches; if (matches = re.exec(document.location)) { try { return decodeURI(matches[1]); } catch (e) { } }   return null; }

//Add a 'imdb edit' tab if(mw.config.get('wgArticleId') != 0 ) { $( function imdbEditButton {       mw.util.addPortletLink('p-cactions', mw.util.getUrl(null,{action:'edit',imdb:true}), 'imdb', 'p-imdb', 'imdb edit');   } )}

if(mw.config.get('wgAction') == 'edit' && imdb_queryString('imdb') == 'true') { $(function imdb {       var myContent = document.getElementById('wpTextbox1').value;

/* IMDb */ myContent = myContent.replace(/\n\*\[http\:\/\/www\.imdb\.com\/name\/nm(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n*\n');       myContent = myContent.replace(/\n\* \[http\:\/\/www\.imdb\.com\/name\/nm(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n* \n');        myContent = myContent.replace(/\n\*\[http\:\/\/imdb\.com\/name\/nm(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n*\n');        myContent = myContent.replace(/\n\* \[http\:\/\/imdb\.com\/name\/nm(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n* \n');

myContent = myContent.replace(/\n\*\[http\:\/\/www\.imdb\.com\/name\/nm(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/www\.imdb\.com\/name\/nm(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n* \n'); myContent = myContent.replace(/\n\*\[http\:\/\/imdb\.com\/name\/nm(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/imdb\.com\/name\/nm(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n* \n');

myContent = myContent.replace(/\n\*\[http\:\/\/www\.imdb\.com\/name\/nm(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\;\:\(\)]*\]\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/www\.imdb\.com\/name\/nm(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\;\:\(\)]*\]\n/g,'\n* \n'); myContent = myContent.replace(/\n\*\[http\:\/\/imdb\.com\/name\/nm(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\;\:\(\)]*\]\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/imdb\.com\/name\/nm(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\;\:\(\)]*\]\n/g,'\n* \n');

myContent = myContent.replace(/\n\*\[http\:\/\/www\.imdb\.com\/name\/nm(\d*)\/\?ref\_\=[ëèéóãáşúū\w\d \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n*\n');       myContent = myContent.replace(/\n\* \[http\:\/\/www\.imdb\.com\/name\/nm(\d*)\/\?ref\_\=[ëèéóãáşúū\w\d \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n* \n');        myContent = myContent.replace(/\n\*\[http\:\/\/imdb\.com\/name\/nm(\d*)\/\?ref\_\=[ëèéóãáşúū\w\d \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n*\n');        myContent = myContent.replace(/\n\* \[http\:\/\/imdb\.com\/name\/nm(\d*)\/\?ref\_\=[ëèéóãáşúū\w\d \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n* \n');

myContent = myContent.replace(/\n\*\[http\:\/\/www\.imdb\.com\/name\/nm(\d*)\/\?ref\_\=[ëèéóãáşúū\w\d \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/www\.imdb\.com\/name\/nm(\d*)\/\?ref\_\=[ëèéóãáşúū\w\d \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n* \n'); myContent = myContent.replace(/\n\*\[http\:\/\/imdb\.com\/name\/nm(\d*)\/\?ref\_\=[ëèéóãáşúū\w\d \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/imdb\.com\/name\/nm(\d*)\/\?ref\_\=[ëèéóãáşúū\w\d \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n* \n');

myContent = myContent.replace(/\n\*\[http\:\/\/www\.imdb\.com\/name\/nm(\d*)\/\?ref\_\=[ëèéóãáşúū\w\d \'\-\.\,\;\:\_\(\)]*\]\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/www\.imdb\.com\/name\/nm(\d*)\/\?ref\_\=[ëèéóãáşúū\w\d \'\-\.\,\;\:\_\(\)]*\]\n/g,'\n* \n'); myContent = myContent.replace(/\n\*\[http\:\/\/imdb\.com\/name\/nm(\d*)\/\?ref\_\=[ëèéóãáşúū\w\d \'\-\.\,\;\:\_\(\)]*\]\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/imdb\.com\/name\/nm(\d*)\/\?ref\_\=[ëèéóãáşúū\w\d \'\-\.\,\;\:\_\(\)]*\]\n/g,'\n* \n');

if(document.getElementById('wpTextbox1').value != myContent) { document.getElementById('wpTextbox1').value=myContent; document.getElementById('wpSummary').value='use IMDb name template'; } //       else //       { //           myContent = myContent.replace(/(\=* *External links *\=*)\n/g,'$1\n*\n'); //          document.getElementById('wpTextbox1').value=myContent; //          document.getElementById('wpSummary').value='use IMDb name template'; //       }

/* IBDB */ myContent = myContent.replace(/\n\*\[http\:\/\/www\.ibdb\.com\/person\.php\?id\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n*\n');       myContent = myContent.replace(/\n\* \[http\:\/\/www\.ibdb\.com\/person\.php\?id\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n* \n');        myContent = myContent.replace(/\n\*\[http\:\/\/ibdb\.com\/person\.php\?id\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n*\n');        myContent = myContent.replace(/\n\* \[http\:\/\/ibdb\.com\/person\.php\?id\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n* \n');

myContent = myContent.replace(/\n\*\[http\:\/\/www\.ibdb\.com\/person\.php\?id\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/www\.ibdb\.com\/person\.php\?id\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n* \n'); myContent = myContent.replace(/\n\*\[http\:\/\/ibdb\.com\/person\.php\?id\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/ibdb\.com\/person\.php\?id\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n* \n');

myContent = myContent.replace(/\n\*\[http\:\/\/www\.ibdb\.com\/person\.php\?id\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\;\:\(\)]*\]\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/www\.ibdb\.com\/person\.php\?id\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\;\:\(\)]*\]\n/g,'\n* \n'); myContent = myContent.replace(/\n\*\[http\:\/\/ibdb\.com\/person\.php\?id\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\;\:\(\)]*\]\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/ibdb\.com\/person\.php\?id\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\;\:\(\)]*\]\n/g,'\n* \n');

myContent = myContent.replace(/\n\*\[http\:\/\/www\.ibdb\.com\/person\.asp\?[Ii][Dd]\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n*\n');       myContent = myContent.replace(/\n\* \[http\:\/\/www\.ibdb\.com\/person\.asp\?[Ii][Dd]\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n* \n');        myContent = myContent.replace(/\n\*\[http\:\/\/ibdb\.com\/person\.asp\?[Ii][Dd]\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n*\n');        myContent = myContent.replace(/\n\* \[http\:\/\/ibdb\.com\/person\.asp\?[Ii][Dd]\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|]*\]\]\.*\n/g,'\n* \n');

myContent = myContent.replace(/\n\*\[http\:\/\/www\.ibdb\.com\/person\.asp\?[Ii][Dd]\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/www\.ibdb\.com\/person\.asp\?[Ii][Dd]\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n* \n'); myContent = myContent.replace(/\n\*\[http\:\/\/ibdb\.com\/person\.asp\?[Ii][Dd]\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/ibdb\.com\/person\.asp\?[Ii][Dd]\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\(\)]*\][\w \-\.]*\n/g,'\n* \n');

myContent = myContent.replace(/\n\*\[http\:\/\/www\.ibdb\.com\/person\.asp\?[Ii][Dd]\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\;\:\(\)]*\]\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/www\.ibdb\.com\/person\.asp\?[Ii][Dd]\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\;\:\(\)]*\]\n/g,'\n* \n'); myContent = myContent.replace(/\n\*\[http\:\/\/ibdb\.com\/person\.asp\?[Ii][Dd]\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\;\:\(\)]*\]\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[http\:\/\/ibdb\.com\/person\.asp\?[Ii][Dd]\=(\d*)\/* [ëèéóãáşúū\w \'\-\.\,\;\:\(\)]*\]\n/g,'\n* \n');

if(document.getElementById('wpTextbox1').value != myContent) { document.getElementById('wpTextbox1').value=myContent; document.getElementById('wpSummary').value='use IBDB name template'; }

/* Find a Grave */ myContent = myContent.replace(/\n\*\[https?\:\/\/www\.findagrave\.com\/cgi\-bin\/fg\.cgi\?[\w\d\=\&\+]*GRid\=(\d*)[\w\=\&\+]* [ëèéóãáşúū\w\d \'\-\–\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|\-]*\]\]\.*\n/g,'\n*\n');       myContent = myContent.replace(/\n\* \[https?\:\/\/www\.findagrave\.com\/cgi\-bin\/fg\.cgi\?[\w\d\=\&\+]*GRid\=(\d*)[\w\=\&\+]* [ëèéóãáşúū\w\d \'\-\–\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|\-]*\]\]\.*\n/g,'\n* \n');        myContent = myContent.replace(/\n\*\[https?\:\/\/findagrave\.com\/cgi\-bin\/fg\.cgi\?[\w\d\=\&\+]*GRid\=(\d*)[\w\=\&\+]* [ëèéóãáşúū\w\d \'\-\–\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|\-]*\]\]\.*\n/g,'\n*\n');        myContent = myContent.replace(/\n\* \[https?\:\/\/findagrave\.com\/cgi\-bin\/fg\.cgi\?[\w\d\=\&\+]*GRid\=(\d*)[\w\=\&\+]* [ëèéóãáşúū\w\d \'\-\–\.\,\(\)]*\][\w\@ ]*\[\[[\w \.\|\-]*\]\]\.*\n/g,'\n* \n');

myContent = myContent.replace(/\n\*\[https?\:\/\/www\.findagrave\.com\/cgi\-bin\/fg\.cgi\?[\w\d\=\&\+]*GRid\=(\d*)[\w\=\&\+]* [ëèéóãáşúū\w\d \'\-\–\.\,\(\)]*\][\w\d\@\'\-\.\,\(\) ]*\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[https?\:\/\/www\.findagrave\.com\/cgi\-bin\/fg\.cgi\?[\w\d\=\&\+]*GRid\=(\d*)[\w\=\&\+]* [ëèéóãáşúū\w\d \'\-\–\.\,\(\)]*\][\w\d\@\'\-\.\,\(\) ]*\n/g,'\n* \n'); myContent = myContent.replace(/\n\*\[https?\:\/\/findagrave\.com\/cgi\-bin\/fg\.cgi\?[\w\d\=\&\+]*GRid\=(\d*)[\w\=\&\+]* [ëèéóãáşúū\w\d \'\-\–\.\,\(\)]*\][\w\d\@\'\-\.\,\(\) ]*\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[https?\:\/\/findagrave\.com\/cgi\-bin\/fg\.cgi\?[\w\d\=\&\+]*GRid\=(\d*)[\w\=\&\+]* [ëèéóãáşúū\w\d \'\-\–\.\,\(\)]*\][\w\d\@\'\-\.\,\(\) ]*\n/g,'\n* \n');

myContent = myContent.replace(/\n\*\[https?\:\/\/www\.findagrave\.com\/cgi\-bin\/fg\.cgi\?[\w\d\=\&\+]*GRid\=(\d*)[\w\=\&\+]* [ëèéóãáşúū\w\d \'\-\–\.\,\(\)\:]*\]\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[https?\:\/\/www\.findagrave\.com\/cgi\-bin\/fg\.cgi\?[\w\d\=\&\+]*GRid\=(\d*)[\w\=\&\+]* [ëèéóãáşúū\w\d \'\-\–\.\,\(\)\:]*\]\n/g,'\n* \n'); myContent = myContent.replace(/\n\*\[https?\:\/\/findagrave\.com\/cgi\-bin\/fg\.cgi\?[\w\d\=\&\+]*GRid\=(\d*)[\w\=\&\+]* [ëèéóãáşúū\w\d \'\-\–\.\,\(\)\:]*\]\n/g,'\n*\n'); myContent = myContent.replace(/\n\* \[https?\:\/\/findagrave\.com\/cgi\-bin\/fg\.cgi\?[\w\d\=\&\+]*GRid\=(\d*)[\w\=\&\+]* [ëèéóãáşúū\w\d \'\-\–\.\,\(\)\:]*\]\n/g,'\n* \n');

if(document.getElementById('wpTextbox1').value != myContent) { document.getElementById('wpTextbox1').value=myContent; document.getElementById('wpSummary').value='use Find a Grave template'; }   } )}