{"id":55,"date":"2005-03-08T16:31:01","date_gmt":"2005-03-08T16:31:01","guid":{"rendered":"http:\/\/grind.rpol.net\/?p=55"},"modified":"2010-03-15T22:46:26","modified_gmt":"2010-03-15T22:46:26","slug":"the-redraw-is-an-only-child-hes-waiting-in-the-park","status":"publish","type":"post","link":"https:\/\/grind.rpol.net\/?p=55","title":{"rendered":"The redraw is an only child he&#8217;s waiting in the park"},"content":{"rendered":"<p>Ok, so Duran Duran never actually used <em>those<\/em> particular lyrics, and this post isn&#8217;t going to interest my regular readers (though I have faith it&#8217;ll be as interesting as my regular posts for them). \u00a0Nobody will really care except those who happen to stumble on this post after searching for keywords such as &#8220;dynamic redraw&#8221;, &#8220;innerHtml&#8221;, &#8220;innerText&#8221;, &#8220;document.write&#8221; with &#8220;lose&#8221;, &#8220;clear&#8221;, &#8220;undo&#8221;, &#8220;redo&#8221;, &#8220;buffer&#8221; and &#8220;IE&#8221; or &#8220;Internet Explorer&#8221;. \u00a0Possible also &#8220;Mozilla&#8221; or &#8220;Firefox&#8221;.<\/p>\n<p>To make sense of the keywords, basically when you dynamically update part of the text on the screen, Internet Explorer has the nasty habit of clearing the undo\/redo buffer. \u00a0Mozilla was supposed to have fixed this in a <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=158071\">bugfix<\/a>, but it still does the same thing to me.<\/p>\n<p>Changing form values also has the same effect, so I can&#8217;t use a form to update part of the screen for any value otherwise the undo buffer is cleared every time the update is called&#8230; basically if I was using such a function now and pressed Alt-Z, nothing would happen.<\/p>\n<p>I make far too many mistakes to not have undo!<\/p>\n<p>Now this was really annoying when I wanted to have a message input area like the one I&#8217;m using right now, while also having a status line showing how many characters the user has entered, and the limit they can have.<\/p>\n<p>I did, however, find out you can hide and unhide elements with the style.visibility = &#8220;hidden&#8221;\/&#8221;visible&#8221; javascript directive, so I originally had a fuel gauge type thing with a bunch of slashes etc<\/p>\n<p>(i.e. it looked like this; [ E\\\\\\\\\\\\\\\\\\\\|\/\/\/\/\/\/\/\/\/\/Full])<\/p>\n<p>And I used to hide all of the slashes except for the appropriate one (and hide the &#8220;ull&#8221; in &#8220;Full&#8221; unless it was full. \u00a0Simple enough I guess, but not really the nice-ity that a status line of &#8220;Using xxx of xxx characters&#8221; gave.<\/p>\n<p>So then one day I thought, hmmm, you actually can have HTML overlap each other. \u00a0Imagine 0 through to 9 all occupying the same spot on the screen, initially messy yes, but then you only make one of the digits visible&#8230; to the user they&#8217;d see the appropriate number. \u00a0So what if I did that for a bunch of numbers, 0 through to 9 repeated several times, with each repetition adjacent to the other. \u00a0Then surely I could only make the appropriate digit of each repetition visible, so I could effectively have a counter without the old dynamic redraw?<\/p>\n<p>Well, after about four hours of javascript hacking coding, I came up with the solution.<\/p>\n<p>And because I know my regular visitors are already bored, I&#8217;ll put the code in the comments section. (c;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ok, so Duran Duran never actually used those particular lyrics, and this post isn&#8217;t going to interest my regular readers (though I have faith it&#8217;ll be as interesting as my regular posts for them). \u00a0Nobody will really care except those who happen to stumble on this post after searching for keywords such as &#8220;dynamic redraw&#8221;, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-55","post","type-post","status-publish","format-standard","hentry","category-default-ramblings"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/grind.rpol.net\/index.php?rest_route=\/wp\/v2\/posts\/55","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/grind.rpol.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/grind.rpol.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/grind.rpol.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/grind.rpol.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=55"}],"version-history":[{"count":1,"href":"https:\/\/grind.rpol.net\/index.php?rest_route=\/wp\/v2\/posts\/55\/revisions"}],"predecessor-version":[{"id":56,"href":"https:\/\/grind.rpol.net\/index.php?rest_route=\/wp\/v2\/posts\/55\/revisions\/56"}],"wp:attachment":[{"href":"https:\/\/grind.rpol.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/grind.rpol.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/grind.rpol.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}