User talk:Thundergnat: Difference between revisions

Content added Content deleted
(→‎moving of REXX routines: added a follow-up.)
Line 183: Line 183:
http://rosettacode.org/wiki/Number_names/REXX
http://rosettacode.org/wiki/Number_names/REXX
:: It now works as advertized.   Thanks again for whatever ya did to make the link work again.   -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 00:26, 7 September 2017 (UTC)
:: It now works as advertized.   Thanks again for whatever ya did to make the link work again.   -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 00:26, 7 September 2017 (UTC)

==problems with Rosetta Code CAPTCHA and/or "Shared CSS/JavaScript for all skins"==
Today, around 1630 my time, all of my viewing of every (or any) Rosetta Code tasks (of any flavor) no longer honors my
JS (Java script) for all skins (I was, of course, logged in):

Username (Gerard Schildberger)
Preferences
Appearance
Skin
Chameleon (or Vector, both aren't working)
Shared CSS/JavaScript for all skins
Custom JavaScript
that I had previously entered (it allowed me to toggle the highlighting [ON or OFF, with the default of OFF].   I tweaked the JavaScript (that was created by some JavaScript expert and posted here [somewhere] on Rosetta Code a few years back) such that a long (solid) bar is pre-pended to the toggle so that is makes a handy-dandy eyeball fence, allowing more visual fidelity and creates a good eye-catcher.

The failing (of the JavaScript) came out of the blue, I hadn't changed anything in my "Preferences" for quite some time.

When I went to re-save it (thinking that may do the trick), I got the message (in red):
To protect the wiki against automated page creation, we kindly ask you to solve the following CAPTCHA:
BUT ... no CAPTCHA appeared, and I was then in some manner of limbo --- no way to save it (successfully).   If I tried to save it again, I just got the same (red) message, but CAPTCHA (usually it used to be something of the sort like "I am not a robot").   I could (and did) leave the page un-saved by closing the window (and at another time, just navigated to another Rosetta Code page).   I have re-booted in an attempt to flush all the buffers and what-not, but the same thing happens.

Is something happening to Rosetta Code, and will time fix this problem on its own?

Next question, are you a/the person to ask, or should I ask someone else?   -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 22:15, 12 September 2017 (UTC)


In case you can't see it or have trouble getting to it, here is the code:
<lang>
(function(){
function get_code_pres() {
var pres = document.getElementsByTagName('pre');
var codes = [];
for(var i=0;i<pres.length;i++)
if(pres[i].className.match(/\bhighlighted_source\b/)) codes.push(pres[i]);
return codes;
}

function toggle_highlight(pre) {
if(pre._alt_html == null) {
pre._alt_html = pre.innerHTML;
var spans = pre.getElementsByTagName('span');
for(var i=0;i<spans.length;i++) spans[i].className = '';
}
else {var z=pre.innerHTML;
pre.innerHTML=pre._alt_html;
pre._alt_html=z;
}
}

function show_toggle() { // the bar below has 61 'db'x characters.
var xdb = '███████████████████████████████████████████████████████████████████████';
var bar = xdb.concat(' «toggle highlighting»');
var codes = get_code_pres();
for(var i=0;i<codes.length;i++) {
var a=document.createElement('a');
a.textContent = bar;
a.style.cursor = 'pointer';
(function(e) {a.addEventListener('click', function() { toggle_highlight(e); }, false);
e.parentNode.insertBefore(a, e);
} ) (codes[i]);
toggle_highlight(codes[i]);
}
}
show_toggle();
} ) ();</lang>
I tried to align (with indentations) what I could understand so I could follow the logic better. &nbsp; I also re-named some function names.

For what it's worth, the solid bar shows up as blue on Rosetta Code task/draft pages. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 22:15, 12 September 2017 (UTC)