3d2
<
Window localStorage as Needed - RJM Programming - December, 2019
6,10d4
<
14,21d7
< var ao;
< var aohref='mailto:?subject=Capitals%20of%20Countries%20%2e%2e%2e%20can%20copy%20in%20clipboard%20contents&body=';
< var bo;
< var bohref='sms:?subject=Capitals%20of%20Countries%20%2e%2e%2e%20can%20copy%20in%20clipboard%20contents&body=';
< var numlines=0;
<
< var lastemail='';
< var lastsms='';
27,66d12
< function ask() {
< var eee=lastemail;
< if (numlines == 0) {
< aohref=aohref.replace('%20%2e%2e%2e%20can%20copy%20in%20clipboard%20contents', '');
< if (eee == '') { eee=prompt('Email address (best converted later at email into its Fixed Width font)?', lastemail); }
< } else {
< aohref=aohref.split('&body=')[0] + '&body=';
< if (eee == '') { eee=prompt('Email address (and once in email paste content into its body section before clicking its Send button, as best seen with its Fixed Width font)?', lastemail); }
< }
< if (!eee) { eee=''; }
< if (eee.indexOf('@') != -1) {
< lastemail=eee;
< var sufg=aohref.split('?')[1];
< var gurl='mailto:' + eee + '?' + sufg;
< ao.href=gurl;
< }
< aohref='mailto:?subject=Capitals%20of%20Countries%20%2e%2e%2e%20can%20copy%20in%20clipboard%20contents&body=';
< return ao;
< }
<
< function smsask() {
< var eee=lastsms;
< if (numlines == 0) {
< bohref=bohref.replace('%20%2e%2e%2e%20can%20copy%20in%20clipboard%20contents', '');
< if (eee == '') { eee=prompt('SMS number (best converted later at SMS into its Fixed Width font)?', lastsms); }
< } else {
< bohref=bohref.split('&body=')[0] + '&body=';
< if (eee == '') { eee=prompt('SMS number (and once in SMS paste content into its body section before clicking its Send button, as best seen with its Fixed Width font)?', lastsms); }
< }
< if (!eee) { eee=''; }
< if (eee != '') {
< lastsms=eee;
< var sufg=bohref.split('?')[1];
< var gurl='sms:' + eee + '?' + sufg;
< bo.href=gurl;
< }
< bohref='sms:?subject=Capitals%20of%20Countries%20%2e%2e%2e%20can%20copy%20in%20clipboard%20contents&body=';
< return bo;
< }
<
72,73d17
< var maxcap=-1;
< var maxcty=-1;
75d18
< numlines=0;
79,88d21
< if (maxcty < 0) {
< maxcty=sin.options[i].value.length;
< } else if (sin.options[i].value.length > maxcty) {
< maxcty=sin.options[i].value.length;
< }
< if (maxcap < 0) {
< maxcap=sin.options[i].innerText.length;
< } else if (sin.options[i].innerText.length > maxcap) {
< maxcap=sin.options[i].innerText.length;
< }
98,164d30
< if (!osino || 1 == 1) {
< if (capval != '' && ctyval != '') {
< document.getElementById('mybemail').style.display='inline-block';
< document.getElementById('mybsms').style.display='inline-block';
< maxcap=Math.floor(eval(eval(maxcap + 31) / 8)) * 8;
< maxcty=Math.floor(eval(eval(maxcty + 15) / 8)) * 8;
< var caps=capval.split('|');
< var ctys=ctyval.split('|');
< var repemail='';
< repemail+=tabit('Capital City', maxcap, 'Country', maxcty);
< repemail+=tabit('------------', maxcap, '-------', maxcty);
< document.getElementById('myaemail').href=pref + '&body=' + encodeURIComponent(repemail);
< for (var ij=0; ij 800) {
< numlines=eval(1 + ij);
< }
< var prefs=document.getElementById('myasms').href.split('&body=')[0];
< document.getElementById('myasms').href=prefs + '&body=' + encodeURIComponent(repemail);
< bohref=bohref.split('&body=')[0] + '&body=' + encodeURIComponent(repemail);
< }
< copytoclipboard(repemail);
< }
< }
< }
<
< function copytoclipboard(str) { // thanks to https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f
< var el = document.createElement('textarea');
< el.value = str;
< el.setAttribute('readonly', '');
< el.style.position = 'absolute';
< el.style.left = '-9999px';
< document.body.appendChild(el);
< el.select();
< document.execCommand('copy');
< document.body.removeChild(el);
< }
<
< function tabit(inleft, inleftl, inright, inrightl) {
< var retrec='';
< var ift=Math.floor(eval(eval(inleft.length + 8) / 8)) * 8;
< if (inleft.length < inleftl) {
< while (inleft.length < ift) {
< inleft+=' '; //inleft+=String.fromCharCode(9);
< }
< while (ift < inleftl) {
< inleft+=' '; //String.fromCharCode(9);
< ift+=8;
< }
< }
< retrec+=inleft;
< ift=Math.floor(eval(eval(inright.length + 8) / 8)) * 8;
< if (inright.length < inrightl) {
< while (inright.length < ift) {
< inright+=' '; //inright+=String.fromCharCode(9);
< }
< while (ift < inrightl) {
< inleft+=' '; //String.fromCharCode(9);
< ift+=8;
< }
< }
< retrec+=inright;
< retrec+=String.fromCharCode(10);
< return retrec;
170d35
< document.getElementById('myform').action=document.URL.split('#')[0].split('?')[0];
476c341
<
|
---
>
|
480,482d344
< Email
< SMS
<