Permalink
Browse files

Use afcHelper_ prefix for css class name to avoid conflicts; #191

Also remove way too broad "shadow" code (this was affecting ALL
textboxes)
  • Loading branch information...
theopolisme committed Sep 29, 2013
1 parent 76e56c5 commit 85c5d32d6b02f8417f27a867852b1fe1a6c16d43
Showing with 9 additions and 13 deletions.
  1. +2 −6 src/MediaWiki:Gadget-afchelper.css
  2. +7 −7 src/submissions.js
@@ -1,21 +1,17 @@
/* Stylesheet should be located at [[MediaWiki:Gadget-afchelper.css]] */
.notice {
.afcHelper_notice {
color: red;
}
span.notice {
span.afcHelper_notice {
font-size: 120%;
}
div#afcHelper_betanotice {
font-style: italic;
}
input[type=text]:hover { /* Small shadow on textarea hover */
box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.3) inset;
}
.afcHelper_button {
background-repeat: repeat-x;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
@@ -193,7 +193,7 @@ function afcHelper_init() {
displayMessage('<div id="afcHelper_loadingmsg">Loading the Article for creation helper script...</div>');
if (!wfSupportsAjax()) {
displayMessage('<span class="notice">Uh-oh! Your browser appears to be too old to handle the helper script or does not support AJAX. Please <a href="http://browsehappy.com">upgrade</a> to the latest version of Firefox, Safari, Chrome, or Opera for best results. Sorry about that; please <a href="https://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Articles_for_creation/Helper_script" target="_blank">let us know</a> if you need further assistance.</span>');
displayMessage('<span class="afcHelper_notice">Uh-oh! Your browser appears to be too old to handle the helper script or does not support AJAX. Please <a href="http://browsehappy.com">upgrade</a> to the latest version of Firefox, Safari, Chrome, or Opera for best results. Sorry about that; please <a href="https://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Articles_for_creation/Helper_script" target="_blank">let us know</a> if you need further assistance.</span>');
return;
}
@@ -1359,7 +1359,7 @@ function afcHelper_warnings(pagetext) {
var matchct = 0;
while (matched = recomment.exec(texttest)) {
matchct += 1;
if (errormsg == '') errormsg += '<div id="afcHelper_hiddenheader"><h3 class="notice">Please check the source code! This page contains one or more long (30+ characters) HTML comments, listed below:</h3></div>';
if (errormsg == '') errormsg += '<div id="afcHelper_hiddenheader"><h3 class="afcHelper_notice">Please check the source code! This page contains one or more long (30+ characters) HTML comments, listed below:</h3></div>';
errormsg += '<div class="afcHelper_hidden" id="'+ matchct +'"><a href="#">(Delete the following hidden comment)</a>: <b><i>' + matched[1] + '</b></i></div>';
afcHelper_longcomments[matchct.toString()] = matched[0];
}
@@ -1389,7 +1389,7 @@ function afcHelper_warnings(pagetext) {
);
var deletionlog = response['query']['logevents'];
if (deletionlog.length) {
errormsg += ('<h3><div class="notice">The page ' + afcHelper_escapeHtmlChars(afcHelper_submissionTitle) + ' was deleted ' + deletionlog.length + ' time' + ((deletionlog.length != 1) ? "s" : "") + '. Here ' + ((deletionlog.length != 1) ? "are" : "is") + ' the edit summar' + ((deletionlog.length != 1) ? "ies" : "y") + ' from the <a href="' + wgScript + '?title=Special%3ALog&type=delete&page=' + afcHelper_submissionTitle + '" target="_blank">deletion log</a>:</div></h3><table class="wikitable"><tr><td><b>Timestamp</b></td><td><b>User</b></td><td><b>Reason</b></td></tr>');
errormsg += ('<h3><div class="afcHelper_notice">The page ' + afcHelper_escapeHtmlChars(afcHelper_submissionTitle) + ' was deleted ' + deletionlog.length + ' time' + ((deletionlog.length != 1) ? "s" : "") + '. Here ' + ((deletionlog.length != 1) ? "are" : "is") + ' the edit summar' + ((deletionlog.length != 1) ? "ies" : "y") + ' from the <a href="' + wgScript + '?title=Special%3ALog&type=delete&page=' + afcHelper_submissionTitle + '" target="_blank">deletion log</a>:</div></h3><table class="wikitable"><tr><td><b>Timestamp</b></td><td><b>User</b></td><td><b>Reason</b></td></tr>');
for (var i = 0; i < deletionlog.length; i++) {
var deletioncomment = deletionlog[i].comment;
var deletioncomment1_re = /\[\[([^\[\]]*?[^\]\|]*?)(\|([^\[\]]*?))\]\]/gi;
@@ -1418,15 +1418,15 @@ function afcHelper_warnings(pagetext) {
if (refbegin) { //Firefox workaround!
if (refend) { //Firefox workaround!
if (refbegin.length !== refend.length) {
errormsg += '<h3><div class="notice">Please check the source code! This page contains unclosed &lt;ref&gt; tags!</div></h3>';
errormsg += '<h3><div class="afcHelper_notice">Please check the source code! This page contains unclosed &lt;ref&gt; tags!</div></h3>';
}
} else {
errormsg += '<h3><div class="notice">Please check the source code! This page contains unbalanced &lt;ref&gt; and &lt;/ref&gt; tags!</div></h3>';
errormsg += '<h3><div class="afcHelper_notice">Please check the source code! This page contains unbalanced &lt;ref&gt; and &lt;/ref&gt; tags!</div></h3>';
}
}
//test if ref tags are used, but no reflist available
if ((!reflistre.test(pagetext)) && refbegin) {
errormsg += '<h3><div class="notice">Be careful, there is a &lt;ref&gt; tag used, but no references list (reflist)! You might not see all references.</div></h3>';
errormsg += '<h3><div class="afcHelper_notice">Be careful, there is a &lt;ref&gt; tag used, but no references list (reflist)! You might not see all references.</div></h3>';
}
// test if <ref> foo <ref> on the page and place the markup on the box
@@ -1445,7 +1445,7 @@ function afcHelper_warnings(pagetext) {
if (o) {
temppagetext = temppagetext.slice(n + o[0].length);
if ((temppagetext.search(rerefbegin)) > -1) {
errormsg += '<h3><div class="notice">Be careful, there is a &lt;ref&gt; tag after the references list! You might not see all references.</div></h3>';
errormsg += '<h3><div class="afcHelper_notice">Be careful, there is a &lt;ref&gt; tag after the references list! You might not see all references.</div></h3>';
}
}
return errormsg;

4 comments on commit 85c5d32

@Technical-13

This comment has been minimized.

Contributor

Technical-13 replied Sep 29, 2013

We actually agreed it should be afch- instead of afcHelper_ on IRC...

@theopolisme

This comment has been minimized.

Contributor

theopolisme replied Sep 29, 2013

Then it should be changed for everything. And I mean EVERYTHING...every function name, every variable...that's a very big change.

@wikipedia-mabdul

This comment has been minimized.

Member

wikipedia-mabdul replied Sep 29, 2013

I !vote for the underscore!

@theopolisme

This comment has been minimized.

Contributor

theopolisme replied Sep 29, 2013

I <3 underscores. Who "agreed"?

Please sign in to comment.