{"id":2,"date":"2020-05-26T17:43:33","date_gmt":"2020-05-26T17:43:33","guid":{"rendered":"http:\/\/js.billdawson.net\/?page_id=2"},"modified":"2020-05-26T21:24:55","modified_gmt":"2020-05-26T21:24:55","slug":"sample-page","status":"publish","type":"page","link":"http:\/\/js.billdawson.net\/?page_id=2","title":{"rendered":"Help Me Say It!"},"content":{"rendered":"\n<p>A friend of mine has a business called, &#8220;<a href=\"http:\/\/helpmesayit.com\">Help Me Say It!<\/a>&#8221; Bill Dawson &amp; Associates worked with him on the original concept.<\/p>\n\n\n\n<p>Brainstorming on it led to the following Javascript example:<\/p>\n\n\n\n<script type=\"text\/javascript\">\n\tfunction longWord(word) {\n\t\twords = word.split(\" \");\n\t\tstrlen2=0;\n\t\tfor(i=0;i<wordCount;i++) {\n\t\t\tstrlen = words[i].length;\n\t\t\tif(strlen > strlen2) {\n\t\t\t\tstrlen2 = strlen;\n\t\t\t}\n\t\t}\n\t\treturn strlen2;\n\t}\n<\/script>\n<script type=\"text\/javascript\">\n\tfunction changeFontSize(element,step) {\n\t\tstep = parseInt(step,10);\n\t\tvar el = document.getElementById(element);\n\t\tvar curFont = parseInt(el.style.fontSize,10);\n\t\tel.style.fontSize = (curFont+step) + 'pt';\n\t\tel.style.lineHeight = ((curFont)+(step)) + 'pt';\n\t\treturn;\n\t}\n\tfunction wrapandresize(o) {\n\t\tif(o) {\n\t\t\ttext = o;\n\t\t} else {\n\t\t\ttext = (event.srcElement.innerHTML);\n\t\t}\n\t\twordCount = text.split(' ').length;\n\t\tdocument.getElementById('textrect').innerHTML = text;\n\n\t\tvar targetWidth = document.getElementById('textrect').offsetWidth+1;\n\t\tvar targetHeight = document.getElementById('textrect').clientHeight+1;\n\t\tvar w = targetWidth;\n\t\tvar h = targetHeight;\n\t\tvar longestWord = longWord(text);\n\t\twhile (h<=252) {\n\t\t\t\tchangeFontSize('textrect','1');\n\t\t\t\th = document.getElementById('textrect').clientHeight;\n\t\t\t}\n\t\t\twhile (h>=292) {\n\t\t\t\tchangeFontSize('textrect','-1');\n\t\t\t\th = document.getElementById('textrect').clientHeight;\n\t\t\t}\n\t\t}\n\n\tfunction IO(U, V) {\n\t    var X = !window.XMLHttpRequest ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest();\n\t    X.open(V ? 'PUT' : 'GET', U, false );\n\t    X.setRequestHeader('Content-Type', 'text\/html')\n\t    X.send(V ? V : '');\n\t\treturn X.responseText;\n\t}\t\n\tfunction readTextFile() {\n\t\tvar lines=IO(\"quotes.txt\").split(\/\\r?\\n\/g);\n\t\talert(lines[1]);\n\t}\n\tfunction loadQuotes() {\n\t\tdocument.getElementById('textrect').innerHTML=quotes[0];\n\t\tdocument.getElementById('quotelist').innerHTML=answers;\n\t}\n\tfunction reset() {\n\t\tdocument.getElementById('textrect').innerHTML = \"\";\n\t}\n<\/script>\n<script type=\"text\/javascript\">\nvar quotes=IO(\"quotes.txt\").split(\/\\r?\\n\/g);\nvar stopcount = quotes.length;\nvar c=0;\nvar t;\nvar timer_is_on=0;\nvar answers=\"<ul>\";\nfor(i=0;i<stopcount;i++) {\n\tanswers = answers+\"<li onmouseover='wrapandresize();'>\"+quotes[i]+\"<\/li>\";\n}\nanswers = answers+\"<\/ul>\";\nvar rand=0;\nvar lastrandomnumber=0;\nfunction timedCount() {\n\tif(rand==1) {\n\t\tvar randomnumber=Math.floor((Math.random()*(stopcount-1)));\n\t\twhile(randomnumber==lastrandomnumber) {\n\t\t\trandomnumber=Math.floor((Math.random()*(stopcount-1)));\n\t\t}\n\t\twrapandresize(quotes[randomnumber]);\n\t\tlastrandomnumber = randomnumber;\n\t} else {\n\t\twrapandresize(quotes[c]);\n\t\tif(c==stopcount-1) {\n\t\t\tc=0;\n\t\t} else {\n\t\t\tc=c+1;\n\t\t}\n\t}\n\tseconds=document.getElementById('speed').value;\n\tt=setTimeout(\"timedCount()\",(seconds*1000));\n}\nfunction doTimer() {\n\tif (!timer_is_on) {\n\t\ttimer_is_on=1;\n\t\ttimedCount();\n\t}\n}\nfunction stopCount() {\n\tclearTimeout(t);\n\ttimer_is_on=0;\n}\nvar TimeToFade = 1000.0;\n\nfunction fade(eid) {\n\tvar element = document.getElementById(eid);\n\tif(element == null)\n\t\treturn;\n   \n\tif(element.FadeState == null) {\n\t\tif(element.style.opacity == null || element.style.opacity == '' || element.style.opacity == '1') {\n\t\t\telement.FadeState = 2;\n\t\t} else {\n\t\t\telement.FadeState = -2;\n\t\t}\n\t}\n\tif(element.FadeState == 1 || element.FadeState == -1) {\n\t\telement.FadeState = element.FadeState == 1 ? -1 : 1;\n\t\telement.FadeTimeLeft = TimeToFade - element.FadeTimeLeft;\n\t} else {\n\t\telement.FadeState = element.FadeState == 2 ? -1 : 1;\n\t\telement.FadeTimeLeft = TimeToFade;\n\t\tsetTimeout(\"animateFade(\" + new Date().getTime() + \",'\" + eid + \"')\", 33);\n\t}  \n}\nfunction fadein(eid) {\n\tvar element = document.getElementById(eid);\n\tif(element == null)\n\t\treturn;\n\telement.FadeState = -1;\n    element.FadeState = element.FadeState == 1 ? -1 : 1;\n    element.FadeTimeLeft = TimeToFade - element.FadeTimeLeft;\n    setTimeout(\"animateFade(\" + new Date().getTime() + \",'\" + eid + \"')\", 33);\n}\nfunction fadeout(eid) {\n\tvar element = document.getElementById(eid);\n\tif(element == null)\n\t\treturn;\n\telement.FadeState = 2;\n    element.FadeState = element.FadeState == 2 ? -1 : 1;\n    element.FadeTimeLeft = TimeToFade;\n    setTimeout(\"animateFade(\" + new Date().getTime() + \",'\" + eid + \"')\", 33);\n}\nfunction animateFade(lastTick, eid) {  \n\tvar curTick = new Date().getTime();\n\tvar elapsedTicks = curTick - lastTick;\n  \n\tvar element = document.getElementById(eid);\n \n\tif(element.FadeTimeLeft <= elapsedTicks) {\n\t\telement.style.opacity = element.FadeState == 1 ? '1' : '0';\n\t\telement.style.filter = 'alpha(opacity = ' + (element.FadeState == 1 ? '100' : '0') + ')';\n\t\telement.FadeState = element.FadeState == 1 ? 2 : -2;\n\t\treturn;\n\t}\n \n\telement.FadeTimeLeft -= elapsedTicks;\n\tvar newOpVal = element.FadeTimeLeft\/TimeToFade;\n\tif(element.FadeState == 1)\n\t\tnewOpVal = 1 - newOpVal;\n\n\telement.style.opacity = newOpVal;\n\telement.style.filter = 'alpha(opacity = ' + (newOpVal*100) + ')';\n  \n\tsetTimeout(\"animateFade(\" + curTick + \",'\" + eid + \"')\", 33);\n}\n<\/script>\n\t\t<div id=\"balloonrect\">\n\t\t\t<div id=\"textrect\" style=\"font-size:80pt;\"><\/div>\n\t\t<\/div>\n\t\t<div id=\"quotelist\"><\/div>\n\t\t<div id=\"debug\">\n\t\t\n\t\t<\/div>\n\n\n\n<ul class=\"quotelist wp-block-list\"><li>Help Me Say It<\/li><li>How do I tell my grandmother I killed her cat?<\/li><li>What's the best way to tell my girlfriend she has bad breath?<\/li><li>How do I tell my best friend that I don't want to be an usher at his wedding?<\/li><li>Should I tell my co-worker that I know he's going to get fired?<\/li><li>How do I tell my parents I wrecked the car?<\/li><li>How do I tell my daughter I found the porn on her computer?<\/li><li>What's the best way to tell this guy I've been dating that I really don't want to see him again?<\/li><li>How do I tell my mother that she wears too much makeup?<\/li><li>What's the best way to tell my kids there is no Santa?<\/li><li>I'm going to become a Buddhist: what's the best way to break it to my Catholic friends?<\/li><li>I'm a man trapped in a woman's body: how do I tell my husband?<\/li><li>Just once, I would love to hear my wife tell me she thinks I look handsome: how do I tell her?<\/li><li>If my sister comes into my room one more time without knocking, I just might kill her: is there some way to tell her to respect my privacy?<\/li><li>How do I tell my cubicle mate that it's really gross when he picks his nose?<\/li><li>How do I tell one of my Facebook friends that I really don't appreciate the snotty remarks he leaves when he comments on my posts?<\/li><li>How do I tell my roommate to stop eating all the food I buy?<\/li><li>I'm in love with my best friend: what's the best way to tell her?<\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A friend of mine has a business called, &#8220;Help Me Say It!&#8221; Bill Dawson &amp; Associates worked with him on the original concept. Brainstorming on it led to the following Javascript example: Help Me Say It How do I tell my grandmother I killed her cat? What&#8217;s the best way to tell my girlfriend she [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-2","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/js.billdawson.net\/index.php?rest_route=\/wp\/v2\/pages\/2"}],"collection":[{"href":"http:\/\/js.billdawson.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/js.billdawson.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/js.billdawson.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/js.billdawson.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2"}],"version-history":[{"count":13,"href":"http:\/\/js.billdawson.net\/index.php?rest_route=\/wp\/v2\/pages\/2\/revisions"}],"predecessor-version":[{"id":46,"href":"http:\/\/js.billdawson.net\/index.php?rest_route=\/wp\/v2\/pages\/2\/revisions\/46"}],"wp:attachment":[{"href":"http:\/\/js.billdawson.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}