var scores = document.getElementsByClassName("reputation-score");
if (scores.length == 0 || parseInt(scores[0].innerHTML.replace(",", "")) < 15) {
document.getElementById("banner-top").style.display = "none";
}
and
var questionId = $("#question-header a").attr("href").split('/')[2];
var query = "#" + questionId + "-is-owned-by-current-user";
if(!($(query).val())){
document.getElementById("banner-bottom").style.display = "none";
}
]]>
<div id="question" class="">
<div class="porthole" id="banner-top"> <h3>Remember to vote up questions/answers you find interesting or helpful (requires 15 <a href="http://mathoverflow.net/faq#reputation">reputation points</a>)</h3>
<script>
if($("#question").length === 1){
var questionId = $("#question-header a").attr("href").split('/')[2];
var query = "#" + questionId + "-is-owned-by-current-user";
var reminder = $("You can also accept an answer by clicking the check mark next to it. This awards 15 reputation points to the person who answered and 2 reputation points to you.");
if($(query).val()){
$("#question").append(reminder);
}
}
</script>
From what I can read at 4AM, the text "You can also accept..." is automatically inserted as the top banner provided that (1) the user owns the question (2) some attribute $("#question").length === 1.
Update: the latter condition in jQuery means that there is exactly one element with id "question" which should be true. So, unless I miss something, for a person with less than 200 rep the line $("#question").append(reminder) gets executed.
I'm not sure if the $(...text...) will really create just a text line and then the next line will correctly append it, but if it does, then a <200 rep user will see two "accept an answer" texts on an answer s/he owns. Could anyone debug it a bit please?
]]>if (length(document.getElementsByClassName("vote-accepted")) = 0) document.getElementById("banner-bottom").hide()
and
]]>scores = document.getElementsByClassName("reputation-score")
if (length(scores) = 0 || int(scores[0].innerHTML.replace(",", "")) < 15) document.getElementById("banner-top").hide()
You can also accept an answer to one of your own questions by clicking the check mark next to it. This awards 15 reputation points to the person who answered and 2 reputation points to you.
Good to know that, but isn't the usefulness of this banner limited only to the poster of the question and only when logged in?
]]>Remember to vote up questions/answers you find interesting or helpful (requires 15 reputation points)
From my reading of the above, the banner seems to nudge person toward clicking on the "vote up" button, which is strange, since for a person who is new to Math Overflow this action is guaranteed to fail. Helpfully, the banner says something about reputation points — the concept most novices will easily "get" after an unsuccessful attempt to vote a question up. Is this by design?
I guess the banner could be targeting returning users who forgot to login, but the more likely explanation is that it's a bug.
]]>