// personal_links.js
// RJM Programming
// January, 2022
// Script HTML element with src='//www.rjmprogramming.com.au/personal_links.js?wordingis=a%20Link%20Wording%20To%20Match' is a hotlinking idea
var retvwpp='';
var retplinks=[];
var pltextstr='';
var butnotnow=false;
var wordingis=location.search.split('wordin' + 'gis=')[1] ? decodeURIComponent(location.search.split('wordin' + 'gis=')[1]).split('&')[0] : 'Highlighting and long hover help.';
if (wordingis == 'Highlighting and long hover help.') {
var otherideais='';
try {
otherideais='
' + document.head.innerHTML + '' + document.body.innerHTML + '';
} catch (erris) {
otherideais='';
}
var othersare=otherideais.replace('person' + 'al_links.js?wordin' + 'gis=','person' + 'al_links.js&wordin' + 'gis=').split('&wordin' + 'gis=');
if (eval('' + othersare.length) > 1) {
wordingis=decodeURIComponent(othersare[1].split('&')[0].split("'")[0].split('"')[0].split('>')[0]);
}
}
if (window.localStorage) {
var wp_ls=location.search.split('wpplgro=')[1] ? decodeURIComponent(location.search.split('wpplgro=')[1]).split('&')[0] : ''
if (wp_ls != '') {
localStorage.removeItem('wp_personal_links');
retvwpp='';
} else if (getwpplgro() != '') {
var retvis=(retvwpp.trim());
if (retvis != '') {
pltextstr='';
retplinks=retvis.split('`');
for (var irg=0; irg➕🔗');
} else {
xasare[ixasare].innerHTML+='➕🔗';
}
if (document.URL.toLowerCase().indexOf('rjmprogramming.com.au/itblog') != -1) {
xasare[ixasare].title+=' Also come here for personalized blog link management functionality. ';
}
}
}
}
function lbnl() {
butnotnow=false;
retvwpp=retvwpp.trim();
}
function askwpplgro() {
var prepeu='', midpeu='';
if (butnotnow) { return ''; }
if (document.URL.toLowerCase().indexOf('rjmprogramming.com.au/itblog') != -1) {
prepeu='If contextual help is available for a feature (that you long hover over) of this webpage a new green bordered webpage part will open and on clicking in this and answering Y you can read and interact with a relevant Blog Posting regarding this. To remove (or restore) context help access the All Posts menu Toggle Context Help Mode submenu, as required. ' + String.fromCharCode(10) + ' ';
}
if (document.URL.toLowerCase().indexOf('localhost') == -1) {
if (retvwpp.trim() != retvwpp) { prepeu=''; butnotnow=true; setTimeout(lbnl,2000); }
midpeu=' (or enter ? for just personalized link information)';
} else {
midpeu=' (or enter ? for just personalized link information)';
}
var peu='?';
while (peu == '?') {
peu=prompt(prepeu + 'Please enter URL (no hashtags)' + midpeu + ' followed by hashtag (#) then case sensitive wording to associate the URL with (when not already linked) greater than one character long (spaces encouraged). Special URL of . gets its URL from the first matching link found on the webpage. Enter X to clear your URLs. URLs with arguments where last entered URL character is = will have last argument populated by innerText of words to right.', '');
prepeu=retvwpp.trim() + String.fromCharCode(10) + String.fromCharCode(10);
midpeu='';
}
if (peu == null) { peu=''; }
if (peu.indexOf('#') > 0) {
if (peu.split('#')[1].trim() != '') {
if (peu.split('#')[0] == '.') {
var restp=peu.split('#')[1];
var asare=document.getElementsByTagName('a');
for (var iasare=0; iasare 1) {
if (peu.indexOf('?') > 0) {
setwpplgro(peu.split('?')[0] + '?' + encodeURIComponent(peu.split('?')[1]).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&').replace(/\%23/g,'#'));
} else {
setwpplgro(peu.split('#')[0] + '#' + encodeURIComponent(peu.split('#')[1]).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?'));
}
}
}
retvwpp='';
} else if (peu.toLowerCase() == 'x') {
localStorage.removeItem('wp_personal_links');
}
}
function setwpplgro(invlu) {
if (retvwpp.trim() == '') {
localStorage.setItem('wp_personal_links', (invlu).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&'));
andsogolooking();
} else {
localStorage.removeItem('wp_personal_links');
localStorage.setItem('wp_personal_links', (retvwpp.trim()) + ('`') + (invlu).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&'));
andsogolooking();
}
retvwpp=getwpplgro();
}
function getwpplgro() {
retvwpp=('' + localStorage.getItem('wp_personal_links')).replace(/^null$/g,'');
if (retvwpp.trim() != '') {
var retvis=(localStorage.getItem('wp_personal_links')).replace(/^null$/g,'');
if (retvis != '') {
pltextstr='';
//alert('retvis=' + retvis);
retplinks=retvis.split('`');
for (var irg=0; irg') != -1 && eval('' + intextpart.indexOf('<')) > eval('' + intextpart.indexOf('>'))) {
//console.log('0:' + inurlis + ' ... ' + intextpart + ' ... ' + (inurlis + encodeURIComponent(intextpart.split('<')[0].split('>')[eval(-1 + intextpart.split('<')[0].split('>').length)])).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&'));
if ((intextpart.split('<')[0].split('>')[eval(-1 + intextpart.split('<')[0].split('>').length)] + '~').indexOf(' Tutorial~') != -1) { prefc='"'; suffc='"'; }
return (inurlis + encodeURIComponent(prefc + intextpart.split('<')[0].split('>')[eval(-1 + intextpart.split('<')[0].split('>').length)] + suffc)).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&');
} else if ((' ' + inurlis).slice(-1) == '=' && inurlis.indexOf('?') != -1 && intextpart.indexOf('<') != -1 && intextpart.indexOf('>') != -1 && eval('' + intextpart.indexOf('<')) < eval('' + intextpart.indexOf('>'))) {
//console.log('1:' + inurlis + ' ... ' + intextpart + ' ... ' + (inurlis + encodeURIComponent(intextpart.split('<')[0])).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&'));
if ((intextpart.split('<')[0] + '~').indexOf(' Tutorial~') != -1) { prefc='"'; suffc='"'; }
return (inurlis + encodeURIComponent(prefc + intextpart.split('<')[0] + suffc)).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&');
} else if ((' ' + inurlis).slice(-1) == '=' && inurlis.indexOf('?') != -1 && intextpart.indexOf('<') != -1) {
//console.log('2:' + inurlis + ' ... ' + intextpart + ' ... ' + (inurlis + encodeURIComponent(intextpart.split('<')[0])).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&'));
if ((intextpart.split('<')[0] + '~').indexOf(' Tutorial~') != -1) { prefc='"'; suffc='"'; }
return (inurlis + encodeURIComponent(prefc + intextpart.split('<')[0] + suffc)).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&');
} else if ((' ' + inurlis).toLowerCase().slice(-3) == '%3d' && inurlis.toLowerCase().replace('?','%3f').indexOf('%3f') != -1 && intextpart.indexOf('<') != -1 && intextpart.indexOf('>') != -1 && eval('' + intextpart.indexOf('<')) > eval('' + intextpart.indexOf('>'))) {
//console.log('-0:' + inurlis + ' ... ' + intextpart + ' ... ' + (inurlis + encodeURIComponent(intextpart.split('<')[0].split('>')[eval(-1 + intextpart.split('<')[0].split('>').length)])).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&'));
if ((intextpart.split('<')[0].split('>')[eval(-1 + intextpart.split('<')[0].split('>').length)] + '~').indexOf(' Tutorial~') != -1) { prefc='"'; suffc='"'; }
return (inurlis + encodeURIComponent(prefc + intextpart.split('<')[0].split('>')[eval(-1 + intextpart.split('<')[0].split('>').length)] + suffc)).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&');
} else if ((' ' + inurlis).toLowerCase().slice(-3) == '%3d' && inurlis.toLowerCase().replace('?','%3f').indexOf('%3f') != -1 && intextpart.indexOf('<') != -1 && intextpart.indexOf('>') != -1 && eval('' + intextpart.indexOf('<')) < eval('' + intextpart.indexOf('>'))) {
//console.log('-1:' + inurlis + ' ... ' + intextpart + ' ... ' + (inurlis + encodeURIComponent(intextpart.split('<')[0])).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&'));
if ((intextpart.split('<')[0] + '~').indexOf(' Tutorial~') != -1) { prefc='"'; suffc='"'; }
return (inurlis + encodeURIComponent(prefc + intextpart.split('<')[0] + suffc)).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&');
} else if ((' ' + inurlis).toLowerCase().slice(-3) == '%3d' && inurlis.toLowerCase().replace('?','%3f').indexOf('%3f') != -1 && intextpart.indexOf('<') != -1) {
//console.log('-2:' + inurlis + ' ... ' + intextpart + ' ... ' + (inurlis + encodeURIComponent(intextpart.split('<')[0])).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&'));
if ((intextpart.split('<')[0] + '~').indexOf(' Tutorial~') != -1) { prefc='"'; suffc='"'; }
return (inurlis + encodeURIComponent(prefc + intextpart.split('<')[0] + suffc)).replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&');
}
return inurlis.replace(/\%3D/g,'=').replace(/\%3d/g,'=').replace(/\%3F/g,'?').replace(/\%3f/g,'?').replace(/\%26/g,'&');
}
function andsogolooking() {
var ttsf=[], thiswptext='', rawhwptext='', ideareps=[], jjn, kkn, allokaywpl=false, newbih='', doit=false, addone=1;
if (pltextstr != '') {
ttsf=pltextstr.substring(0,eval(-1 + eval('' + pltextstr.length))).substring(1).split('`');
//alert('two:' + ttsf.length + ' and pltextstr=' + pltextstr + ' and ttsf[0]=' + ttsf[0]);
}
if (ttsf.length != 0) {
thiswptext=(document.body.innerText || document.body.contentWindow || document.body.contentDocument);
rawhwptext=document.body.innerHTML;
newbih=rawhwptext;
//alert('ttsf.length=' + ttsf.length + ':' + ttsf[0] + ' and retplinks.length=' + retplinks.length + ':' + retplinks[0]);
}
for (jjn=0; jjn' + decodeURIComponent(ttsf[jjn]) + '<') == -1)) && newbih.indexOf('"' + decodeURIComponent(ttsf[jjn]) + '"') == -1) {
ideareps=newbih.split(decodeURIComponent(ttsf[jjn]));
allokaywpl=true;
for (kkn=0; kkn= eval('' + ideareps.length)) { addone=0; }
//if (ttsf[jjn] == 'en') { alert('reverse(ideareps[kkn]=' + reverse(ideareps[kkn])); }
if (eval('' + reverse(ideareps[kkn]).indexOf('"')) > eval('' + reverse(ideareps[kkn]).replace('>','<').indexOf('<'))) {
if (ideareps[kkn].slice(-1) != '>' || ideareps[eval(addone + kkn)].substring(0,1) != '<') {
if (retplinks[jjn].split('#')[0].replace(/\?$/g,'').replace(/\&$/g,'') != retplinks[jjn].split('#')[0]) {
newbih=newbih.replace(ideareps[kkn] + decodeURIComponent(ttsf[jjn]), ideareps[kkn] + '' + decodeURIComponent(ttsf[jjn]) + '');
} else {
newbih=newbih.replace(ideareps[kkn] + decodeURIComponent(ttsf[jjn]), ideareps[kkn] + '' + decodeURIComponent(ttsf[jjn]) + '');
}
doit=true;
}
}
}
}
}
}
}
if (doit) { document.body.innerHTML=newbih; }
}