![]() | This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | Archive 2 | Archive 3 |
(copied from User talk:Drilnoth)
Hi, since we seem to be collaborating quite a bit on script writing, I was wondering if you might want to try to come up with a more systematic way for collaboration. For example, I noticed that you copied some stuff from my script, which is absolutely fine as I am very happy to see people reusing what I have written. However, when I find bugs in this code, I am not able to fix them in your version and I may not be aware of every place where this bug has propagated if other people are using it. One possible option would be to continue as we have been working, but split off some of our tools into a (or a few) separate file(s). For example, see User:Plastikspork/tools.js. This would allow us to include one another's tools, using an 'includescript' statement. The function names would be prefixed with either Drilnoth or Spork or Plastikspork or whatever to make it clear where the function lives. The names of the functions may be long, but descriptive. The other option would be to create a separate project space where we could both contribute these short common helper functions, but that might be more complicated. Of course, both options require a bit of trust, but so does copying and pasting one another's code. But this is why I put every script that I include on my watchlist. In either case, I feel small helper functions and short scripts with collections of related helper functions are extremely useful. The problem with codes like 'Formatter' is that primarily that I cannot include it without everything. Let me know what you think or if you have any better ideas. I plan to continue to split my script into these smaller subscripts since there are several users of my scripts who have expressed an interest in using on part of its functionality. Thanks! Plastikspork ( talk) 16:44, 27 April 2009 (UTC)
Yes, I think you have the basic idea. In the first iteration you could start by doing the following:
As a second step, it would be great to see the large codefixer function broken down into subfunctions which do only a specific task
Of course, we will probably find that once this is performed that there are repeated subfunctions which can start to share. We might want to put these shared functions (once they have been reasonably debugged) in a common place outside of the user namespace which is then edit protected? Much in the same way that Formatter isn't in the user namespace and many people can reuse these functions by simply including them in their scripts.
As a programming note, it would be great if these smaller subfunctions could take strings as input and return strings as output, that way they can be used in a more general context. This is why I have been using str for subfunctions which do not load the editform and txt.value for the parent functions which does load the editform. I actually like the way that WP:FORMATTER is structured, if only it were (a) split into two parts so the subfunctions could be reused and (b) used prefixed function names to prevent name collision. Today, I have been splitting my code into smaller chunks with reusable subfunctions. I currently have User:Plastikspork/tools.js and User:Plastikspork/datetools.js. My plan is to split tools into linktools and perhaps html2wikitools. I believe we will find quite a bit of overlap at that point and we can look into merging my html2wikitools. Or if we can come up with a plan sooner, I can just remove the html2wikitools part of my code and merge it into a shared tool space. Plastikspork ( talk) 23:45, 27 April 2009 (UTC)
(not indented due to # of paragraphs) Great! I've been working today on creating a "core" framework at User:Drilnoth/EasyEd/core.js, although moving that into Wikipedia-space and protecting it would probably make more sense. My idea was that it could be structured as follows:
The setup which I have in mind would allow for every function to be set as either automatic (done simultaneously with other edits by clicking a tab) or selectively activated (like how the various Sprk functions are now). It would be easy to maintain and customize, and we'd both be able to contribute "modules" from our own userspaces, as could others, to the "main" selection. Users who want to customize what their script replaces could configure it to do so, using a basic help guide that describes the script's layout and how it can be altered (maybe including a basic RegExp introduction for new scripters?).
I was trying to come up with a better name for it than "CodeFixer", since that's already kind of inaccurate and with this level of customizability it most certainly would be wrong, and "EasyEd" was the best that I could come up with... it's an editing tool that makes simple or common fixes easy to do. If you have a better idea for a name, I'd be happy to hear it.
I don't quite understand why "str" or something similar would make more sense than just using txt.value... what difference does it really make? I'm open to having it either way, I'm just curious.
I'm thinking that this could then by a real "community" script... the two of us might be the primary "maintainers", but everyone will be able to create new modules for it.
Does that make sense? Or am I going in completely the wrong direction? I can keep working on this... I think that working on the "core" or "main" functions at the same time could get confusing, so if it makes sense to you I could get those basic two set up and then we can work on converting our scripts to use the proper format/design. I'd just need to know whether str or txt.value should be used and I'd be ready to really start, if you think that this is a good idea. I think that its pretty close to yours, except that everything would be set up in one step. – Drilnoth ( T • C • L) 00:46, 28 April 2009 (UTC)
txt = document.editform.wpTextbox1;
, the txt variable holds a reference to the textbox object from the first textbox on the page. When we write str = txt.value
we now copy the contents of the textbox into a string. Now, the question is do we want these subfunctions to act on strings or act on textboxes? Certainly repeated writing 'str = str.replace(...)
' is shorter than 'txt.value = txt.value.replace(...)
'. The question is what does javascript do when you execute 'txt.value = txt.value.replace
' vs 'str = str.replace
' and is one faster than the other? I actually don't know and it probably doesn't make much of that difference. Note that 'str
' and 'txt
' are just a names and I just as easily could have said 'monkey = document.editform.wpTextbox1
', but the convention in most of these scripts seems to be use the name 'str
' for strings and 'txt
' for textboxes.txt.value = sample_function(txt.value)
, which is how Formatter does it, or like sample_function(txt)
, which should work and wouldn't require a return statement at the end of sample_function. The only unmentioned advantage of using txt.value = sample_function(txt.value)
would be that these could be thought of as string processing functions which could be used on subsections of a textbox form, making them more general since they don't need to know about the fact that this string came from a textbox. Computer Scientists usually try to have functions operate on a 'need to know basis' for security reasons, although that's probably not an issue here, but just a general programming style.
Plastikspork (
talk)
02:09, 28 April 2009 (UTC)Excellent. We now have a great start for the project. It really looks very nice so far. I have been a bit busy today, but I have started to look over the project and I have some initial thoughts:
Question: How should I go about helping edit the code? Is it possible to an individual exception for the protection, or should I apply for admin? Thanks! Plastikspork ( talk) 02:28, 29 April 2009 (UTC)
I decided to create my own user-fied development version ( User:Plastikspork/AutoEd). It might make sense to have a development branch, but this should suffice for now as it will allow me to do testing without breaking the main code. As a result of some testing, I have my first request for a changes to the code. I have implemented these changes in User:Plastikspork/AutoEd/core.js, and you should be able to just replace WP:AutoEd/core.js with the contents of that file. If you check the edit history, you can see the sequence of changes, with a few mistakes and second thoughts about design. However, it might be better to just summarize the basic changes:
Let me know if you have any questions or suggestions. Thanks! Plastikspork ( talk) 20:42, 29 April 2009 (UTC)
I made some updates to htmltowikitext.js in my version ( User:Plastikspork/AutoEd).
<b>bold <i>italics</i></b>
or with the order reversed).I tested it on a sandbox page and it appears to be working correctly.
It's actually interesting to see what WP does if you give it incorrectly formatted HTML tags. For example, if you try to close a <h3> tag with a </h5> tag. It appears that WP corrects this problem and closes the tag for you. In addition if you try to nest a <h1> tag inside an <h3>, like say <h3>This is a <h1>big</h1> heading</h3>
. It appears WP trys to split this into <h3>This is a </h3><h1>big</h1> heading
. I was tempted to add some of this as well, but I will wait until we actually see it in practice (
WP:KISS).
Plastikspork (
talk)
05:12, 2 May 2009 (UTC)
start="#"
for ordered lists); these lists should not be touched by the script. 「
ダイノ
ガイ
千?!」(Dinoguy1000)
16:14, 2 May 2009 (UTC)
I have some more improvements to some of the current functionality, but I am still merging and testing. Plastikspork ( talk) 05:48, 3 May 2009 (UTC)
The editor seems to replace · (·) by the bolder dot •, which is a different symbol. (See [1] this edit.) Whoever is involved in the program, it would be good to fix this. Thanks, Jakob.scholbach ( talk) 10:48, 3 May 2009 (UTC)
Folks, do the new scripts play nice with wikEd or does wikEd have to be disabled before they will function? Thanks. – ukexpat ( talk) 22:00, 4 May 2009 (UTC)
When i used AutoEd here it changed [[Category:Saturday morning television| ]] to [[Category:Saturday morning television|Saturday morning television]] as Saturday morning cartoon is the main article in Category:Saturday morning television it should not change [[Category:Saturday morning television| ]] to [[Category:Saturday morning television|Saturday morning television]]. Powergate92 Talk 22:17, 4 May 2009 (UTC)
You should just disable Wikipedia:AutoEd/links.js until we have a chance to audit the code. I see some other sketchy stuff in there as well and I don't trust it. Plastikspork ( talk) 00:30, 5 May 2009 (UTC)
Another bug (presumably with the same module): [2]. – Drilnoth ( T • C • L) 02:50, 5 May 2009 (UTC)
[ http://en.wikipedia.org wikipedia]
str = str.replace(/\[?\[http:\/\/([^\]\n]*?)\]\]?/gi, "[http://$1]");
Hello again
I have tried to use the AutoEd in English and Norwegian, and in both languages I keep getting the 'AutoEd/core.js: autoEdFunctions is undefined'-alert. I've installed all the scripts and subscripts to my userspace in Norwegian, and added wikichecker.js and core.js to my monobook. I'm sorry if I'm overlooking something, but I would really appreciate some assistance here. - Helt ( talk) 09:19, 6 May 2009 (UTC) —Preceding unsigned comment added by Helt ( talk • contribs)
I simplified and expanded the extra breaks code to just three lines User:Plastikspork/AutoEd/extrabreaks.js
I have been using <br> within sortable tables so that the sort icon is always in the same place in the heading, centered on a line by itself and thus ALSO not needlessly widening the column. The script is removing them.-- JimWae ( talk) 03:54, 21 June 2009 (UTC)
Here is a sample. There is no big rush, and thanks for your attention -- JimWae ( talk) 18:23, 21 June 2009 (UTC)
Sortable tables are all I have seen that needs changing -- JimWae ( talk) 18:53, 21 June 2009 (UTC)
I have created an updated version of User:Plastikspork/AutoEd/headlines.js.
I am copying the autoEd check scripts to Chinese Wikipedia. I noticed that it will convert [[a]] [[b]] into [[a]] [[b]], but this is not necessary for Chinese because in Chinese we don't seperate words by space. Can anyone help me cancel this function? -- Ben.MQ ( talk) 16:41, 14 May 2009 (UTC)
Hello!, as a wikichecker I usually use this script and I have noted that it damages some Japanese interwikis (as you can see here), I have had to fix the interwiki by myself, is someone else having this trouble? Locos ~ epraix Beaste~ praix 03:02, 16 May 2009 (UTC)
I would suggest to add a regular expression that detects a common error found in the checker: <br>> and <<br>, the script doesn't detect them and I have to fix them manually. Locos ~ epraix Beaste~ praix 17:41, 17 May 2009 (UTC)
str = str.replace(/<?(<br[\s\/]*>)>?/gim, '$1');
str = str.replace(/<[\s]*(<br[\s\/]*>)/gim, '$1');
str = str.replace(/(<br[\s\/]*>)[\s]*>/gim, '$1');
Hello! First, thanks for your work on developing these tools. I just switched from codefixer and codefixer+ to AutoEd -- very nice. I think this edit is a mistake - the space after the pipe is intentional to ensure that the article shows up at the beginning of the list in Category:Lists of environmental topics. Regards— G716 < T· C> 07:35, 26 May 2009 (UTC)
| {{PAGENAME}}]]
(and is actually more out of habit than necessity; the template would sort after the main article (assuming it has a proper sortkey itself) regardless of the presence or absence of {{PAGENAME}}
). ···「
ダイノガイ
千?!」
?
Talk to Dinoguy1000
18:41, 27 May 2009 (UTC)
After some correspondence with Symplectic Map, I believe we can soon officially support at least three browsers: IE, Chrome and Firefox. SM pointed out that the main problem is that the order in which statements are executed in javascript is not always that reliable. We noticed this before, when Chrome users were getting the 'function is undefined' alert message. I am in the process of testing a suggested fix, (see User:Symplectic Map/autoedcore.js), and it appears to work. One thing that SM did, which I wanted to ask about is simplification to the namespace logic. In particular, in SM's version, it just checks to see if 'wgIsArticle' is true, rather than checking all the various namespaces. Is there a particular namespace which are trying to avoid, or is this check enough? It looks like it at least does the minimum, which is to avoid adding the tab to (most or all?) pages which don't have an edit tab? This is also what SM is doing with his autospeller script. Plastikspork ( talk) 19:28, 29 May 2009 (UTC)
I've been trying to make this script work in the spanish wikipedia, putting this code in my monobook.js:
document.write('<script src="' + 'http://en.wikipedia.org/?title=Wikipedia:AutoEd/complete.js' + '&action=raw&ctype=text/javascript"></script>');
and it isn't working for me, is there any other way to make this script work? Locos ~ epraix Beaste~ praix 20:53, 31 May 2009 (UTC) I already clean up my cache and all that stuff.
importScript();
defined, in which case this wouldn't work because importing other pages is required. Maybe changing those functions to use document.write
instead will fix it. Just give me a few days. –
Drilnoth (
T •
C •
L)
02:47, 3 June 2009 (UTC)
importScript();
defined just like the es.wikipedia.
Locos ~
epraix
Beaste~
praix
02:53, 3 June 2009 (UTC)
&action=edit&AutoEd=true
), it doesn't work.
Locos ~
epraix
Beaste~
praix
03:15, 3 June 2009 (UTC)
(undent) Okay, I think that I've figured this out. When you import
Wikipedia:AutoEd/complete.js into another wiki, it then in turn tries to import
Wikipedia:AutoEd/core.js and all of the modules using importScript()
. The problem is, it is trying to import the local copy of the various modules and the core function, so when you use document.write
in that context and use the JavaScript from en's complete.js page, it then tries to import
es:Wikipedia:AutoEd/core.js, rather than
en:Wikipedia:AutoEd/core.js. To try and fix this I have made
this edit. Before changing all of the modules, could you confirm if the "auto ed" tab now appears on the Spanish Wikipedia? It wouldn't really do anything at this point, but I thought I'd ask before I went and converted everything. Thanks! –
Drilnoth (
T •
C •
L)
13:58, 12 June 2009 (UTC)
I don't know where but I have read that the basic order of an article is: Content, navtemplate (if necessary), categories, stub-template (if necessary) and interwikis. See this change, or any other with a stub template misplaced, AutoEd is not correcting the place of the Stub template. Locos ~ epraix Beaste~ praix 02:19, 3 June 2009 (UTC)
Something like this may be useful for numerical character refs, for example to convert annoying crap like "ü" or "ü" into "ü";
// symbols for which there may be a good reason to obfuscate/excape var dont_repl = "|!{}[]=<>"; function unicodify2(str){ function repl(ent, base){ num = parseInt(ent.replace(/[\&\#\;x]/g, ''), base); // see [[UTF-16]] for chars outside the BMP // try this with Gothic letters at full volume ^_^ if (num > 0xFFFF) { num -= 0x10000; chr = String.fromCharCode(0xD800 + (num >> 10), 0xDC00 + (num & 0x3FF)); } else chr = String.fromCharCode(num); if (dont_repl.indexOf(chr) == -1) str = str.replace(ent, chr, "gi"); } if(m = str.match(/\&\#(\d+)\;/g)) for(i = 0; i < m.length; i++) repl(m[i], 10); if(m2 = str.match(/\&\#x([\da-f]+)\;/gi)) for(i = 0; i < m2.length; i++) repl(m2[i], 16); return str; }
This is close to what I've been using. Other people might want it as well, at least as an option. — CharlotteWebb 17:18, 6 June 2009 (UTC)
It finds numerical character references and changes them to literal letters/numbers/symbols etc. It works for any character except those specified to be ignored. For example it would make changes like these:
from | to |
---|---|
|
|
— CharlotteWebb 10:31, 13 June 2009 (UTC)
Actually something like this falls in a category of its own. I think there are certain users who use entity-refs in the 0x80–0x9F (128–159) range based on the unwarranted assumption that everyone's browser will fall back on Windows-1252 encoding when unprintable control characters are found. However I doubt this works well on non-Windows systems, and I know it doesn't work if these are changed to literal control-char code points. Personally I'd follow the above with replacements like this:
fail = "<!-- rm unicode ctrl char w/no win-1252 mapping, intent unknown -->"; return str .replace(/\u0080/g, "\u20AC") // euro .replace(/\u0081/g, fail) // none .replace(/\u0082/g, "\u201A") // sbquo .replace(/\u0083/g, "\u0192") // florin (italic f) .replace(/\u0084/g, "\u201E") // bdquo .replace(/\u0085/g, "\u2026") // ellipsis .replace(/\u0086/g, "\u2020") // dagger .replace(/\u0087/g, "\u2021") // double dagger .replace(/\u0088/g, "\u02c6") // circumflex .replace(/\u0089/g, "\u2030") // per mil "0/00" .replace(/\u008a/g, "\u0160") // capital S with caron (hacek) .replace(/\u008b/g, "\u2039") // lsaquo .replace(/\u008c/g, "\u0152") // OElig .replace(/\u008d/g, fail) // none .replace(/\u008e/g, "\u017D") // Z with caron (hacek) .replace(/\u008f/g, fail) // none .replace(/\u0090/g, fail) // none .replace(/\u0091/g, "\u2018") // lsquo .replace(/\u0092/g, "\u2019") // rsquo .replace(/\u0093/g, "\u201C") // ldquo .replace(/\u0094/g, "\u201D") // rdquo .replace(/\u0095/g, "\u2022") // bullet .replace(/\u0096/g, "\u2013") // ndash .replace(/\u0097/g, "\u2014") // mdash .replace(/\u0098/g, "\u02DC") // small tilde .replace(/\u0099/g, "\u2122") // trademark (tm) .replace(/\u009a/g, "\u0161") // lowercase s with caron (hacek) .replace(/\u009b/g, "\u203A") // rsaquo .replace(/\u009c/g, "\u0153") // oelig .replace(/\u009d/g, fail) // none .replace(/\u009e/g, "\u017e") // lowercase z with caron (hacek) .replace(/\u009f/g, "\u0178") // y with umlaut ;
— CharlotteWebb 23:07, 13 June 2009 (UTC)
In response to the comment on my talk page, the best way to test this would be to create a test page full of them:
{| class="wikitable" style="font-family:monospace;" ! !! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! A !! B !! C !! D !! E !! F |- ! 0x8… | € € ||   || ‚ ‚ || ƒ ƒ | „ „ || … … || † † || ‡ ‡ | ˆ ˆ || ‰ ‰ || Š Š || ‹ ‹ | Œ Œ ||   || Ž Ž ||   |- ! 0x9… |   || ‘ ‘ || ’ ’ || “ “ | ” ” || • • || – – || — — | ˜ ˜ || ™ ™ || š š || › › | œ œ ||   || ž ž || Ÿ Ÿ |}
Then run the script and confirm that the result matches that shown in rows 8 and 9 of this table. — CharlotteWebb 19:26, 18 June 2009 (UTC)
Plastikspork, I looked at your other script and if you really want to clean up percent-encoding, anchor-encoding, etc. from wiki-links (once again, to make the text more readable in the edit window) you should use something like this:
function normalize_wikilinks(txt){ // to keep things simple we'll ignore all image links. because some people prefer // underscores in the file name and the caption can contain god-knows-what. // one easy way is to flag them with a character which should never be used, // but if it is already present we have a problem, so let's just quit. if(txt.match(/\uE000/)) return(txt); // see [[Private Use Area]] txt = txt.replace(/(\[\[[\:\s*]*(?:Image|File|Media)\s*\:)/gi, "$1\uE000"); if(m = txt.match(/\[\[[^\[\]\n\uE000]+\]\]/g)) for(var i = 0; i < m.length; i++){ parts = m[i].split("|"); link = parts[0]; a = link.split("#"); title = a[0]; section = a[1]; try { link = decodeURIComponent(title // explained below .replace(/\%(.[^0-9A-F]|[^0-9A-F].|$)/gi, "%25$1") ) + ( section ? ( "#" + decodeURIComponent(section // change "." to "%" when followed by valid hex .replace(/\.([0-9A-F]{2})/gi, "%$1") // explained below .replace(/\%(.[^0-9A-F]|[^0-9A-F].|$)/gi, "%25$1") ) ) : "" ) } catch(e) { } // just do no decoding parts[0] = link.replace(/[\s_]+/g, " ").replace(/\s*#\s*/, "#"); txt = txt.replace(m[i], parts //cleanup some spaces .join("|").replace(/\s*\|\s*/, "|").replace(/\s*(\[|\])\s*/g, "$1") ); } return(txt.replace(/\uE000/g, "")); }
Here's a good example of what it does: [4]. The reason for changing literal "%" signs to "%25" first is because decodeURIComponent() will choke otherwise because it expects the next two characters to always be valid hex digits. Wiki-links are more flexible than that. A page title can contain a literal percent sign as long as it is not mistakable for url-encoding. [[70%WATER]] is ok (the url is "/wiki/70%25WATER") but [[10%FAT]] just links to [[10úT]] (though it doesn't display properly). Trying to create a page with url "/wiki/10%25FAT" will give you a Bad Title error. On the other hand [[I%U]] and [[I%U]] produce identical html.
While /wiki/%FA is accepted as a valid alternative to the properly UTF-8 encoded /wiki/%C3%BA—both of them link to ú (which I wrote, just the other day by some coincidence)—decodeURIComponent() will still reject it. I'm wondering whether it would be worthwhile for the script to try and pick up the slack in this respect (perhaps violate RFC 3629), or at least produce a meaningful error message. Guess that would depend on how commonly it becomes an issue. — CharlotteWebb 19:26, 18 June 2009 (UTC)
A module for cleaning up references would be quite useful. Basics would be checking for quotes on ref names (e.g. changing <ref name=name> to <ref name="name">), and misspelled parameters for the various cite templates (stuff like accesdate instead of accessdate). Thoughts? 「 ダイノガイ 千?!」 ? · Talk⇒Dinoguy1000 02:40, 9 June 2009 (UTC)
<ref name="name" />
? Do any components currently touch the space (or lack thereof) in <references />
, and if so, what do they do with it (since consistency is good)? 「
ダイノガイ
千?!」
? ·
Talk⇒Dinoguy1000
18:15, 9 June 2009 (UTC)
~poke~ Any attention on this, either? 「 ダイノガイ 千?!」 ? · Talk⇒Dinoguy1000 19:12, 14 September 2009 (UTC)
{{cite}}
templatesShould we just do this instead? It appears there is now support to move all the named references to the references section. It should make the text much more readable. Plastikspork ―Œ(talk) 21:37, 23 September 2009 (UTC)
Currently, the Formatter and Complete presets collapse double (and more) spaces into single spaces (via the Whitespace module). This is generally good, but there are some places (especially in template code) where this extra whitespace is used for readability purposes:
{{Infobox animanga/Header | name = Fist of the Blue Sky | image = [[Image:FistoftheBlueSky1.jpg|230px]] | caption = Volume 1 cover | ja_kanji = 蒼天の拳 | ja_romaji = Sōten no Ken | genre = [[Historical fiction]], [[Action genre|Action]], [[Drama]] }} {{Infobox animanga/Manga | title = | author = [[Tetsuo Hara]], [[Nobuhiko Horie]] | publisher = {{flagicon|Japan}} [[Shinchosha]] | publisher_other = {{flagicon|Italy}} [[Panini Comics]] | demographic = [[Seinen]] | magazine = {{flagicon|Japan}} [[Comic Bunch]]<br>{{flagicon|USA}} [[Raijin Comics]] (2003-2004) | first = May 2001 | last = | volumes = 20 }} {{Infobox animanga/Anime | title = | director = Yoshihiro Yamaguchi | studio = Souten Studio | network = {{flagicon|Japan}} [[TV Asahi]], [[Animax]] | first = [[October 4]], [[2006]] | last = [[March 14]], [[2007]] | episodes = 26 }} {{Infobox animanga/Footer}}
{{Infobox animanga/Header | name = Fist of the Blue Sky | image = [[Image:FistoftheBlueSky1.jpg|230px]] | caption = Volume 1 cover | ja_kanji = 蒼天の拳 | ja_romaji = Sōten no Ken | genre = [[Historical fiction]], [[Action genre|Action]], [[Drama]] }} {{Infobox animanga/Manga | title = | author = [[Tetsuo Hara]], [[Nobuhiko Horie]] | publisher = {{flagicon|Japan}} [[Shinchosha]] | publisher_other = {{flagicon|Italy}} [[Panini Comics]] | demographic = [[Seinen]] | magazine = {{flagicon|Japan}} [[Comic Bunch]]<br>{{flagicon|USA}} [[Raijin Comics]] (2003-2004) | first = May 2001 | last = | volumes = 20 }} {{Infobox animanga/Anime | title = | director = Yoshihiro Yamaguchi | studio = Souten Studio | network = {{flagicon|Japan}} [[TV Asahi]], [[Animax]] | first = [[October 4]], [[2006]] | last = [[March 14]], [[2007]] | episodes = 26 }} {{Infobox animanga/Footer}}
Two other issues: First it seems that AutoEd will also remove trailing whitespace from empty template parameters (as in the above example, even though you can't see it) - once again, this isn't desirable either. And second, it currently adds whitespace between list markup and the list element's content (e.g. *Some text
to * Some text
); however, it currently doesn't touch definition lists (ones using semicolons, ; ). This last point is the easiest of these to address, I think (the others require some memory on the part of the script, to know when it's in template code and (in the first case) how much extra whitespace to add, by way of remembering how long the longest parameter name is). Thoughts? 「
ダイノガイ
千?!」
? ·
Talk⇒Dinoguy1000
18:29, 10 June 2009 (UTC)
str = str.replace(/[ \t] [ \t]+/g, " ");
, but I'm not real familiar with that module (just stole it from Formatter with a handful of tweaks). –
Drilnoth (
T •
C •
L)
14:55, 13 June 2009 (UTC)~poke~ Can any of you guys have another look at this? It's been a few months, but hasn't been touched... =/ 「 ダイノガイ 千?!」 ? · Talk⇒Dinoguy1000 19:08, 14 September 2009 (UTC)
There seems to be a strange new bug, see discussion here: User talk:Aldaron#Script problems?. My guess is an incompatibility with another script, but I'm not sure exactly what is going on at this point. The strange thing is that the text being pasted is exactly the 'document.write' commands which were recently added. Plastikspork ( talk) 20:08, 17 June 2009 (UTC)
document.write
used for a lot of script-importing before so I thought that it would work fine here too... I actually hadn't known about importScriptURI()
before; thanks. It should all be working good now. –
Drilnoth (
T •
C •
L)
15:08, 18 June 2009 (UTC)
document.write
had bothered me before, but I forgot to ever bring it up. Nice to see it changed to something less random, though! ^_^ 「
ダイノガイ
千?!」
? ·
Talk⇒Dinoguy1000
18:10, 18 June 2009 (UTC)I've got an experimental new one for fixing mojibake, something like this:
function fixmojibake(txt) { r = /[\u00C2-\u00DF] [\u0080-\u00BF]|[\u00E0-\u00EF] [\u0080-\u00BF]{2}|[\u00F0-\u00F4] [\u0080-\u00BF]/g; if(m = txt.match(r)) for(i = 0; i < m.length; i++) txt = txt.replace(m[i], decodeURIComponent(escape(m[i]))); return txt; }
Something like this would catch encoding errors such as those introduced by the utf-impaired Polbot in late 2008 and which I corrected just now (see "Fidèle" ↔ "Fidèle" in the last line).
It uses sort of a reverse type punning to ASCII-encode à and ¨ as [[%C3]] and [[%A8]], then UTF-decode %C3%A8 as è. This should be used manually and with caution due to the potential for false positives (which I have yet to estimate).
For most users mojibake is an "I know it when I see it, but not what it means or how to fix it" sort of thing, whereas a script like this knows what it might mean, and how to fix it, but not whether the status quo isn't already correct. I'm not sure it could be trained for the latter , but feel free to try that
. —
CharlotteWebb
21:05, 27 June 2009 (UTC)
User:SUL messed up the formatting of Acid dissociation constant under the self-ionization section when he used Auto Ed here.-- Jorfer ( talk) 01:25, 25 August 2009 (UTC)
I installed the autoed script, purged the page, cleared the cache but cannot find the autoed tab or button outside of the edit box. Where is the autoed tab? warrior 4321 14:17, 12 September 2009 (UTC)
My problem with the auto-ed tab is that it has been replaced with "check". This happened a few days ago soon after I had installed auto-ed. The check tab works perfectly, so I thought check was the new default tab and changed the text in the project page. Obviously I was wrong. But in my browsers, both firefox and IE, the check tab is still there. So what's the deal? -- Hans ( talk) 08:15, 18 September 2009 (UTC)
AutoEd doesn't seem to work on Google Chrome 3. Error console gives the error "Uncaught ReferenceError: autoEdUnicodify is not defined" with URL "/?title=Wikipedia:AutoEd/complete.js&action=raw&ctype=text/javascript:20".
On a semi-not-really-related note, is there any difference between document.editform
and document.forms.editform
? 「
ダイノガイ
千?!」
? ·
Talk⇒Dinoguy1000
19:26, 24 September 2009 (UTC)
editform
would there refer to the editform's ID, which now should be done via document.getElementById()
, whereas the latter is more correct form-access syntax, using the name editform
. –
Drilnoth (
T •
C •
L)
19:35, 24 September 2009 (UTC)
forms.editform
or getElementById()
)? 「
ダイノガイ
千?!」
? ·
Talk⇒Dinoguy1000
20:25, 24 September 2009 (UTC)The AutoEd whitespace cleaner seems to be collapsing double spaces after a period (full stop) into a single space. An example is this edit. However, double spaces after periods is allowed by MOS:FULLSTOP, and many editors (including myself) use them intentionally, to make where sentences end easier to find in the edit view and because it's a well-ingrained habit from the double spacing at the end of sentences typographic convention. So I would request that this case of whitespace editing be turned off in the script. Thanks. Wasted Time R ( talk) 23:58, 28 September 2009 (UTC)
I created module Wikipedia:AutoEd/dashes.js for converting hyphens to dashes. I've extensively tested it and false positives are fairly rare. Some specific tests are in my sandbox. — GregU ( talk) 13:22, 2 October 2009 (UTC)
I implemented Quibik's suggestion to check for incorrect use of minus signs, where possible. It can't really determine if a spaced minus sign is incorrect in many cases—at least not without adding a "math" heuristic. I tested on quite a few math articles to ensure no false positives were added by this. I'm not comfortable with automatically changing a spaced em dash, as think this needs human judgement on a case-by-case basis. And this is one of the easiest things to catch by eye. I moved the script back under my user space so that I can continue to maintain it, since I'm not an admin. If using it already, please update your monobook.js to read it from User:GregU/dashes.js. Please go ahead and add it to the appropriate presets, if no objections from anyone. — GregU ( talk) 00:00, 13 October 2009 (UTC)
Hello, I'm still waiting for the dashes.js module to be added to the presets, so I can begin advertising use of AutoEd to fix hyphens/dashes. I've continued testing on a daily basis and it is still working well, finding corrections in most featured articles. — GregU ( talk) 03:04, 27 October 2009 (UTC)
Please explain why was removed all wikilinks to American Psychological Association from the page? http://en.wikipedia.org/?title=Homosexuality&action=historysubmit&diff=330641150&oldid=330639500 I don't see any reason why other associations are wikilinked to be ready to click on them (which is useful) and this one not. -- Destinero ( talk) 10:07, 9 December 2009 (UTC)
![]() | This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | Archive 2 | Archive 3 |
(copied from User talk:Drilnoth)
Hi, since we seem to be collaborating quite a bit on script writing, I was wondering if you might want to try to come up with a more systematic way for collaboration. For example, I noticed that you copied some stuff from my script, which is absolutely fine as I am very happy to see people reusing what I have written. However, when I find bugs in this code, I am not able to fix them in your version and I may not be aware of every place where this bug has propagated if other people are using it. One possible option would be to continue as we have been working, but split off some of our tools into a (or a few) separate file(s). For example, see User:Plastikspork/tools.js. This would allow us to include one another's tools, using an 'includescript' statement. The function names would be prefixed with either Drilnoth or Spork or Plastikspork or whatever to make it clear where the function lives. The names of the functions may be long, but descriptive. The other option would be to create a separate project space where we could both contribute these short common helper functions, but that might be more complicated. Of course, both options require a bit of trust, but so does copying and pasting one another's code. But this is why I put every script that I include on my watchlist. In either case, I feel small helper functions and short scripts with collections of related helper functions are extremely useful. The problem with codes like 'Formatter' is that primarily that I cannot include it without everything. Let me know what you think or if you have any better ideas. I plan to continue to split my script into these smaller subscripts since there are several users of my scripts who have expressed an interest in using on part of its functionality. Thanks! Plastikspork ( talk) 16:44, 27 April 2009 (UTC)
Yes, I think you have the basic idea. In the first iteration you could start by doing the following:
As a second step, it would be great to see the large codefixer function broken down into subfunctions which do only a specific task
Of course, we will probably find that once this is performed that there are repeated subfunctions which can start to share. We might want to put these shared functions (once they have been reasonably debugged) in a common place outside of the user namespace which is then edit protected? Much in the same way that Formatter isn't in the user namespace and many people can reuse these functions by simply including them in their scripts.
As a programming note, it would be great if these smaller subfunctions could take strings as input and return strings as output, that way they can be used in a more general context. This is why I have been using str for subfunctions which do not load the editform and txt.value for the parent functions which does load the editform. I actually like the way that WP:FORMATTER is structured, if only it were (a) split into two parts so the subfunctions could be reused and (b) used prefixed function names to prevent name collision. Today, I have been splitting my code into smaller chunks with reusable subfunctions. I currently have User:Plastikspork/tools.js and User:Plastikspork/datetools.js. My plan is to split tools into linktools and perhaps html2wikitools. I believe we will find quite a bit of overlap at that point and we can look into merging my html2wikitools. Or if we can come up with a plan sooner, I can just remove the html2wikitools part of my code and merge it into a shared tool space. Plastikspork ( talk) 23:45, 27 April 2009 (UTC)
(not indented due to # of paragraphs) Great! I've been working today on creating a "core" framework at User:Drilnoth/EasyEd/core.js, although moving that into Wikipedia-space and protecting it would probably make more sense. My idea was that it could be structured as follows:
The setup which I have in mind would allow for every function to be set as either automatic (done simultaneously with other edits by clicking a tab) or selectively activated (like how the various Sprk functions are now). It would be easy to maintain and customize, and we'd both be able to contribute "modules" from our own userspaces, as could others, to the "main" selection. Users who want to customize what their script replaces could configure it to do so, using a basic help guide that describes the script's layout and how it can be altered (maybe including a basic RegExp introduction for new scripters?).
I was trying to come up with a better name for it than "CodeFixer", since that's already kind of inaccurate and with this level of customizability it most certainly would be wrong, and "EasyEd" was the best that I could come up with... it's an editing tool that makes simple or common fixes easy to do. If you have a better idea for a name, I'd be happy to hear it.
I don't quite understand why "str" or something similar would make more sense than just using txt.value... what difference does it really make? I'm open to having it either way, I'm just curious.
I'm thinking that this could then by a real "community" script... the two of us might be the primary "maintainers", but everyone will be able to create new modules for it.
Does that make sense? Or am I going in completely the wrong direction? I can keep working on this... I think that working on the "core" or "main" functions at the same time could get confusing, so if it makes sense to you I could get those basic two set up and then we can work on converting our scripts to use the proper format/design. I'd just need to know whether str or txt.value should be used and I'd be ready to really start, if you think that this is a good idea. I think that its pretty close to yours, except that everything would be set up in one step. – Drilnoth ( T • C • L) 00:46, 28 April 2009 (UTC)
txt = document.editform.wpTextbox1;
, the txt variable holds a reference to the textbox object from the first textbox on the page. When we write str = txt.value
we now copy the contents of the textbox into a string. Now, the question is do we want these subfunctions to act on strings or act on textboxes? Certainly repeated writing 'str = str.replace(...)
' is shorter than 'txt.value = txt.value.replace(...)
'. The question is what does javascript do when you execute 'txt.value = txt.value.replace
' vs 'str = str.replace
' and is one faster than the other? I actually don't know and it probably doesn't make much of that difference. Note that 'str
' and 'txt
' are just a names and I just as easily could have said 'monkey = document.editform.wpTextbox1
', but the convention in most of these scripts seems to be use the name 'str
' for strings and 'txt
' for textboxes.txt.value = sample_function(txt.value)
, which is how Formatter does it, or like sample_function(txt)
, which should work and wouldn't require a return statement at the end of sample_function. The only unmentioned advantage of using txt.value = sample_function(txt.value)
would be that these could be thought of as string processing functions which could be used on subsections of a textbox form, making them more general since they don't need to know about the fact that this string came from a textbox. Computer Scientists usually try to have functions operate on a 'need to know basis' for security reasons, although that's probably not an issue here, but just a general programming style.
Plastikspork (
talk)
02:09, 28 April 2009 (UTC)Excellent. We now have a great start for the project. It really looks very nice so far. I have been a bit busy today, but I have started to look over the project and I have some initial thoughts:
Question: How should I go about helping edit the code? Is it possible to an individual exception for the protection, or should I apply for admin? Thanks! Plastikspork ( talk) 02:28, 29 April 2009 (UTC)
I decided to create my own user-fied development version ( User:Plastikspork/AutoEd). It might make sense to have a development branch, but this should suffice for now as it will allow me to do testing without breaking the main code. As a result of some testing, I have my first request for a changes to the code. I have implemented these changes in User:Plastikspork/AutoEd/core.js, and you should be able to just replace WP:AutoEd/core.js with the contents of that file. If you check the edit history, you can see the sequence of changes, with a few mistakes and second thoughts about design. However, it might be better to just summarize the basic changes:
Let me know if you have any questions or suggestions. Thanks! Plastikspork ( talk) 20:42, 29 April 2009 (UTC)
I made some updates to htmltowikitext.js in my version ( User:Plastikspork/AutoEd).
<b>bold <i>italics</i></b>
or with the order reversed).I tested it on a sandbox page and it appears to be working correctly.
It's actually interesting to see what WP does if you give it incorrectly formatted HTML tags. For example, if you try to close a <h3> tag with a </h5> tag. It appears that WP corrects this problem and closes the tag for you. In addition if you try to nest a <h1> tag inside an <h3>, like say <h3>This is a <h1>big</h1> heading</h3>
. It appears WP trys to split this into <h3>This is a </h3><h1>big</h1> heading
. I was tempted to add some of this as well, but I will wait until we actually see it in practice (
WP:KISS).
Plastikspork (
talk)
05:12, 2 May 2009 (UTC)
start="#"
for ordered lists); these lists should not be touched by the script. 「
ダイノ
ガイ
千?!」(Dinoguy1000)
16:14, 2 May 2009 (UTC)
I have some more improvements to some of the current functionality, but I am still merging and testing. Plastikspork ( talk) 05:48, 3 May 2009 (UTC)
The editor seems to replace · (·) by the bolder dot •, which is a different symbol. (See [1] this edit.) Whoever is involved in the program, it would be good to fix this. Thanks, Jakob.scholbach ( talk) 10:48, 3 May 2009 (UTC)
Folks, do the new scripts play nice with wikEd or does wikEd have to be disabled before they will function? Thanks. – ukexpat ( talk) 22:00, 4 May 2009 (UTC)
When i used AutoEd here it changed [[Category:Saturday morning television| ]] to [[Category:Saturday morning television|Saturday morning television]] as Saturday morning cartoon is the main article in Category:Saturday morning television it should not change [[Category:Saturday morning television| ]] to [[Category:Saturday morning television|Saturday morning television]]. Powergate92 Talk 22:17, 4 May 2009 (UTC)
You should just disable Wikipedia:AutoEd/links.js until we have a chance to audit the code. I see some other sketchy stuff in there as well and I don't trust it. Plastikspork ( talk) 00:30, 5 May 2009 (UTC)
Another bug (presumably with the same module): [2]. – Drilnoth ( T • C • L) 02:50, 5 May 2009 (UTC)
[ http://en.wikipedia.org wikipedia]
str = str.replace(/\[?\[http:\/\/([^\]\n]*?)\]\]?/gi, "[http://$1]");
Hello again
I have tried to use the AutoEd in English and Norwegian, and in both languages I keep getting the 'AutoEd/core.js: autoEdFunctions is undefined'-alert. I've installed all the scripts and subscripts to my userspace in Norwegian, and added wikichecker.js and core.js to my monobook. I'm sorry if I'm overlooking something, but I would really appreciate some assistance here. - Helt ( talk) 09:19, 6 May 2009 (UTC) —Preceding unsigned comment added by Helt ( talk • contribs)
I simplified and expanded the extra breaks code to just three lines User:Plastikspork/AutoEd/extrabreaks.js
I have been using <br> within sortable tables so that the sort icon is always in the same place in the heading, centered on a line by itself and thus ALSO not needlessly widening the column. The script is removing them.-- JimWae ( talk) 03:54, 21 June 2009 (UTC)
Here is a sample. There is no big rush, and thanks for your attention -- JimWae ( talk) 18:23, 21 June 2009 (UTC)
Sortable tables are all I have seen that needs changing -- JimWae ( talk) 18:53, 21 June 2009 (UTC)
I have created an updated version of User:Plastikspork/AutoEd/headlines.js.
I am copying the autoEd check scripts to Chinese Wikipedia. I noticed that it will convert [[a]] [[b]] into [[a]] [[b]], but this is not necessary for Chinese because in Chinese we don't seperate words by space. Can anyone help me cancel this function? -- Ben.MQ ( talk) 16:41, 14 May 2009 (UTC)
Hello!, as a wikichecker I usually use this script and I have noted that it damages some Japanese interwikis (as you can see here), I have had to fix the interwiki by myself, is someone else having this trouble? Locos ~ epraix Beaste~ praix 03:02, 16 May 2009 (UTC)
I would suggest to add a regular expression that detects a common error found in the checker: <br>> and <<br>, the script doesn't detect them and I have to fix them manually. Locos ~ epraix Beaste~ praix 17:41, 17 May 2009 (UTC)
str = str.replace(/<?(<br[\s\/]*>)>?/gim, '$1');
str = str.replace(/<[\s]*(<br[\s\/]*>)/gim, '$1');
str = str.replace(/(<br[\s\/]*>)[\s]*>/gim, '$1');
Hello! First, thanks for your work on developing these tools. I just switched from codefixer and codefixer+ to AutoEd -- very nice. I think this edit is a mistake - the space after the pipe is intentional to ensure that the article shows up at the beginning of the list in Category:Lists of environmental topics. Regards— G716 < T· C> 07:35, 26 May 2009 (UTC)
| {{PAGENAME}}]]
(and is actually more out of habit than necessity; the template would sort after the main article (assuming it has a proper sortkey itself) regardless of the presence or absence of {{PAGENAME}}
). ···「
ダイノガイ
千?!」
?
Talk to Dinoguy1000
18:41, 27 May 2009 (UTC)
After some correspondence with Symplectic Map, I believe we can soon officially support at least three browsers: IE, Chrome and Firefox. SM pointed out that the main problem is that the order in which statements are executed in javascript is not always that reliable. We noticed this before, when Chrome users were getting the 'function is undefined' alert message. I am in the process of testing a suggested fix, (see User:Symplectic Map/autoedcore.js), and it appears to work. One thing that SM did, which I wanted to ask about is simplification to the namespace logic. In particular, in SM's version, it just checks to see if 'wgIsArticle' is true, rather than checking all the various namespaces. Is there a particular namespace which are trying to avoid, or is this check enough? It looks like it at least does the minimum, which is to avoid adding the tab to (most or all?) pages which don't have an edit tab? This is also what SM is doing with his autospeller script. Plastikspork ( talk) 19:28, 29 May 2009 (UTC)
I've been trying to make this script work in the spanish wikipedia, putting this code in my monobook.js:
document.write('<script src="' + 'http://en.wikipedia.org/?title=Wikipedia:AutoEd/complete.js' + '&action=raw&ctype=text/javascript"></script>');
and it isn't working for me, is there any other way to make this script work? Locos ~ epraix Beaste~ praix 20:53, 31 May 2009 (UTC) I already clean up my cache and all that stuff.
importScript();
defined, in which case this wouldn't work because importing other pages is required. Maybe changing those functions to use document.write
instead will fix it. Just give me a few days. –
Drilnoth (
T •
C •
L)
02:47, 3 June 2009 (UTC)
importScript();
defined just like the es.wikipedia.
Locos ~
epraix
Beaste~
praix
02:53, 3 June 2009 (UTC)
&action=edit&AutoEd=true
), it doesn't work.
Locos ~
epraix
Beaste~
praix
03:15, 3 June 2009 (UTC)
(undent) Okay, I think that I've figured this out. When you import
Wikipedia:AutoEd/complete.js into another wiki, it then in turn tries to import
Wikipedia:AutoEd/core.js and all of the modules using importScript()
. The problem is, it is trying to import the local copy of the various modules and the core function, so when you use document.write
in that context and use the JavaScript from en's complete.js page, it then tries to import
es:Wikipedia:AutoEd/core.js, rather than
en:Wikipedia:AutoEd/core.js. To try and fix this I have made
this edit. Before changing all of the modules, could you confirm if the "auto ed" tab now appears on the Spanish Wikipedia? It wouldn't really do anything at this point, but I thought I'd ask before I went and converted everything. Thanks! –
Drilnoth (
T •
C •
L)
13:58, 12 June 2009 (UTC)
I don't know where but I have read that the basic order of an article is: Content, navtemplate (if necessary), categories, stub-template (if necessary) and interwikis. See this change, or any other with a stub template misplaced, AutoEd is not correcting the place of the Stub template. Locos ~ epraix Beaste~ praix 02:19, 3 June 2009 (UTC)
Something like this may be useful for numerical character refs, for example to convert annoying crap like "ü" or "ü" into "ü";
// symbols for which there may be a good reason to obfuscate/excape var dont_repl = "|!{}[]=<>"; function unicodify2(str){ function repl(ent, base){ num = parseInt(ent.replace(/[\&\#\;x]/g, ''), base); // see [[UTF-16]] for chars outside the BMP // try this with Gothic letters at full volume ^_^ if (num > 0xFFFF) { num -= 0x10000; chr = String.fromCharCode(0xD800 + (num >> 10), 0xDC00 + (num & 0x3FF)); } else chr = String.fromCharCode(num); if (dont_repl.indexOf(chr) == -1) str = str.replace(ent, chr, "gi"); } if(m = str.match(/\&\#(\d+)\;/g)) for(i = 0; i < m.length; i++) repl(m[i], 10); if(m2 = str.match(/\&\#x([\da-f]+)\;/gi)) for(i = 0; i < m2.length; i++) repl(m2[i], 16); return str; }
This is close to what I've been using. Other people might want it as well, at least as an option. — CharlotteWebb 17:18, 6 June 2009 (UTC)
It finds numerical character references and changes them to literal letters/numbers/symbols etc. It works for any character except those specified to be ignored. For example it would make changes like these:
from | to |
---|---|
|
|
— CharlotteWebb 10:31, 13 June 2009 (UTC)
Actually something like this falls in a category of its own. I think there are certain users who use entity-refs in the 0x80–0x9F (128–159) range based on the unwarranted assumption that everyone's browser will fall back on Windows-1252 encoding when unprintable control characters are found. However I doubt this works well on non-Windows systems, and I know it doesn't work if these are changed to literal control-char code points. Personally I'd follow the above with replacements like this:
fail = "<!-- rm unicode ctrl char w/no win-1252 mapping, intent unknown -->"; return str .replace(/\u0080/g, "\u20AC") // euro .replace(/\u0081/g, fail) // none .replace(/\u0082/g, "\u201A") // sbquo .replace(/\u0083/g, "\u0192") // florin (italic f) .replace(/\u0084/g, "\u201E") // bdquo .replace(/\u0085/g, "\u2026") // ellipsis .replace(/\u0086/g, "\u2020") // dagger .replace(/\u0087/g, "\u2021") // double dagger .replace(/\u0088/g, "\u02c6") // circumflex .replace(/\u0089/g, "\u2030") // per mil "0/00" .replace(/\u008a/g, "\u0160") // capital S with caron (hacek) .replace(/\u008b/g, "\u2039") // lsaquo .replace(/\u008c/g, "\u0152") // OElig .replace(/\u008d/g, fail) // none .replace(/\u008e/g, "\u017D") // Z with caron (hacek) .replace(/\u008f/g, fail) // none .replace(/\u0090/g, fail) // none .replace(/\u0091/g, "\u2018") // lsquo .replace(/\u0092/g, "\u2019") // rsquo .replace(/\u0093/g, "\u201C") // ldquo .replace(/\u0094/g, "\u201D") // rdquo .replace(/\u0095/g, "\u2022") // bullet .replace(/\u0096/g, "\u2013") // ndash .replace(/\u0097/g, "\u2014") // mdash .replace(/\u0098/g, "\u02DC") // small tilde .replace(/\u0099/g, "\u2122") // trademark (tm) .replace(/\u009a/g, "\u0161") // lowercase s with caron (hacek) .replace(/\u009b/g, "\u203A") // rsaquo .replace(/\u009c/g, "\u0153") // oelig .replace(/\u009d/g, fail) // none .replace(/\u009e/g, "\u017e") // lowercase z with caron (hacek) .replace(/\u009f/g, "\u0178") // y with umlaut ;
— CharlotteWebb 23:07, 13 June 2009 (UTC)
In response to the comment on my talk page, the best way to test this would be to create a test page full of them:
{| class="wikitable" style="font-family:monospace;" ! !! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! A !! B !! C !! D !! E !! F |- ! 0x8… | € € ||   || ‚ ‚ || ƒ ƒ | „ „ || … … || † † || ‡ ‡ | ˆ ˆ || ‰ ‰ || Š Š || ‹ ‹ | Œ Œ ||   || Ž Ž ||   |- ! 0x9… |   || ‘ ‘ || ’ ’ || “ “ | ” ” || • • || – – || — — | ˜ ˜ || ™ ™ || š š || › › | œ œ ||   || ž ž || Ÿ Ÿ |}
Then run the script and confirm that the result matches that shown in rows 8 and 9 of this table. — CharlotteWebb 19:26, 18 June 2009 (UTC)
Plastikspork, I looked at your other script and if you really want to clean up percent-encoding, anchor-encoding, etc. from wiki-links (once again, to make the text more readable in the edit window) you should use something like this:
function normalize_wikilinks(txt){ // to keep things simple we'll ignore all image links. because some people prefer // underscores in the file name and the caption can contain god-knows-what. // one easy way is to flag them with a character which should never be used, // but if it is already present we have a problem, so let's just quit. if(txt.match(/\uE000/)) return(txt); // see [[Private Use Area]] txt = txt.replace(/(\[\[[\:\s*]*(?:Image|File|Media)\s*\:)/gi, "$1\uE000"); if(m = txt.match(/\[\[[^\[\]\n\uE000]+\]\]/g)) for(var i = 0; i < m.length; i++){ parts = m[i].split("|"); link = parts[0]; a = link.split("#"); title = a[0]; section = a[1]; try { link = decodeURIComponent(title // explained below .replace(/\%(.[^0-9A-F]|[^0-9A-F].|$)/gi, "%25$1") ) + ( section ? ( "#" + decodeURIComponent(section // change "." to "%" when followed by valid hex .replace(/\.([0-9A-F]{2})/gi, "%$1") // explained below .replace(/\%(.[^0-9A-F]|[^0-9A-F].|$)/gi, "%25$1") ) ) : "" ) } catch(e) { } // just do no decoding parts[0] = link.replace(/[\s_]+/g, " ").replace(/\s*#\s*/, "#"); txt = txt.replace(m[i], parts //cleanup some spaces .join("|").replace(/\s*\|\s*/, "|").replace(/\s*(\[|\])\s*/g, "$1") ); } return(txt.replace(/\uE000/g, "")); }
Here's a good example of what it does: [4]. The reason for changing literal "%" signs to "%25" first is because decodeURIComponent() will choke otherwise because it expects the next two characters to always be valid hex digits. Wiki-links are more flexible than that. A page title can contain a literal percent sign as long as it is not mistakable for url-encoding. [[70%WATER]] is ok (the url is "/wiki/70%25WATER") but [[10%FAT]] just links to [[10úT]] (though it doesn't display properly). Trying to create a page with url "/wiki/10%25FAT" will give you a Bad Title error. On the other hand [[I%U]] and [[I%U]] produce identical html.
While /wiki/%FA is accepted as a valid alternative to the properly UTF-8 encoded /wiki/%C3%BA—both of them link to ú (which I wrote, just the other day by some coincidence)—decodeURIComponent() will still reject it. I'm wondering whether it would be worthwhile for the script to try and pick up the slack in this respect (perhaps violate RFC 3629), or at least produce a meaningful error message. Guess that would depend on how commonly it becomes an issue. — CharlotteWebb 19:26, 18 June 2009 (UTC)
A module for cleaning up references would be quite useful. Basics would be checking for quotes on ref names (e.g. changing <ref name=name> to <ref name="name">), and misspelled parameters for the various cite templates (stuff like accesdate instead of accessdate). Thoughts? 「 ダイノガイ 千?!」 ? · Talk⇒Dinoguy1000 02:40, 9 June 2009 (UTC)
<ref name="name" />
? Do any components currently touch the space (or lack thereof) in <references />
, and if so, what do they do with it (since consistency is good)? 「
ダイノガイ
千?!」
? ·
Talk⇒Dinoguy1000
18:15, 9 June 2009 (UTC)
~poke~ Any attention on this, either? 「 ダイノガイ 千?!」 ? · Talk⇒Dinoguy1000 19:12, 14 September 2009 (UTC)
{{cite}}
templatesShould we just do this instead? It appears there is now support to move all the named references to the references section. It should make the text much more readable. Plastikspork ―Œ(talk) 21:37, 23 September 2009 (UTC)
Currently, the Formatter and Complete presets collapse double (and more) spaces into single spaces (via the Whitespace module). This is generally good, but there are some places (especially in template code) where this extra whitespace is used for readability purposes:
{{Infobox animanga/Header | name = Fist of the Blue Sky | image = [[Image:FistoftheBlueSky1.jpg|230px]] | caption = Volume 1 cover | ja_kanji = 蒼天の拳 | ja_romaji = Sōten no Ken | genre = [[Historical fiction]], [[Action genre|Action]], [[Drama]] }} {{Infobox animanga/Manga | title = | author = [[Tetsuo Hara]], [[Nobuhiko Horie]] | publisher = {{flagicon|Japan}} [[Shinchosha]] | publisher_other = {{flagicon|Italy}} [[Panini Comics]] | demographic = [[Seinen]] | magazine = {{flagicon|Japan}} [[Comic Bunch]]<br>{{flagicon|USA}} [[Raijin Comics]] (2003-2004) | first = May 2001 | last = | volumes = 20 }} {{Infobox animanga/Anime | title = | director = Yoshihiro Yamaguchi | studio = Souten Studio | network = {{flagicon|Japan}} [[TV Asahi]], [[Animax]] | first = [[October 4]], [[2006]] | last = [[March 14]], [[2007]] | episodes = 26 }} {{Infobox animanga/Footer}}
{{Infobox animanga/Header | name = Fist of the Blue Sky | image = [[Image:FistoftheBlueSky1.jpg|230px]] | caption = Volume 1 cover | ja_kanji = 蒼天の拳 | ja_romaji = Sōten no Ken | genre = [[Historical fiction]], [[Action genre|Action]], [[Drama]] }} {{Infobox animanga/Manga | title = | author = [[Tetsuo Hara]], [[Nobuhiko Horie]] | publisher = {{flagicon|Japan}} [[Shinchosha]] | publisher_other = {{flagicon|Italy}} [[Panini Comics]] | demographic = [[Seinen]] | magazine = {{flagicon|Japan}} [[Comic Bunch]]<br>{{flagicon|USA}} [[Raijin Comics]] (2003-2004) | first = May 2001 | last = | volumes = 20 }} {{Infobox animanga/Anime | title = | director = Yoshihiro Yamaguchi | studio = Souten Studio | network = {{flagicon|Japan}} [[TV Asahi]], [[Animax]] | first = [[October 4]], [[2006]] | last = [[March 14]], [[2007]] | episodes = 26 }} {{Infobox animanga/Footer}}
Two other issues: First it seems that AutoEd will also remove trailing whitespace from empty template parameters (as in the above example, even though you can't see it) - once again, this isn't desirable either. And second, it currently adds whitespace between list markup and the list element's content (e.g. *Some text
to * Some text
); however, it currently doesn't touch definition lists (ones using semicolons, ; ). This last point is the easiest of these to address, I think (the others require some memory on the part of the script, to know when it's in template code and (in the first case) how much extra whitespace to add, by way of remembering how long the longest parameter name is). Thoughts? 「
ダイノガイ
千?!」
? ·
Talk⇒Dinoguy1000
18:29, 10 June 2009 (UTC)
str = str.replace(/[ \t] [ \t]+/g, " ");
, but I'm not real familiar with that module (just stole it from Formatter with a handful of tweaks). –
Drilnoth (
T •
C •
L)
14:55, 13 June 2009 (UTC)~poke~ Can any of you guys have another look at this? It's been a few months, but hasn't been touched... =/ 「 ダイノガイ 千?!」 ? · Talk⇒Dinoguy1000 19:08, 14 September 2009 (UTC)
There seems to be a strange new bug, see discussion here: User talk:Aldaron#Script problems?. My guess is an incompatibility with another script, but I'm not sure exactly what is going on at this point. The strange thing is that the text being pasted is exactly the 'document.write' commands which were recently added. Plastikspork ( talk) 20:08, 17 June 2009 (UTC)
document.write
used for a lot of script-importing before so I thought that it would work fine here too... I actually hadn't known about importScriptURI()
before; thanks. It should all be working good now. –
Drilnoth (
T •
C •
L)
15:08, 18 June 2009 (UTC)
document.write
had bothered me before, but I forgot to ever bring it up. Nice to see it changed to something less random, though! ^_^ 「
ダイノガイ
千?!」
? ·
Talk⇒Dinoguy1000
18:10, 18 June 2009 (UTC)I've got an experimental new one for fixing mojibake, something like this:
function fixmojibake(txt) { r = /[\u00C2-\u00DF] [\u0080-\u00BF]|[\u00E0-\u00EF] [\u0080-\u00BF]{2}|[\u00F0-\u00F4] [\u0080-\u00BF]/g; if(m = txt.match(r)) for(i = 0; i < m.length; i++) txt = txt.replace(m[i], decodeURIComponent(escape(m[i]))); return txt; }
Something like this would catch encoding errors such as those introduced by the utf-impaired Polbot in late 2008 and which I corrected just now (see "Fidèle" ↔ "Fidèle" in the last line).
It uses sort of a reverse type punning to ASCII-encode à and ¨ as [[%C3]] and [[%A8]], then UTF-decode %C3%A8 as è. This should be used manually and with caution due to the potential for false positives (which I have yet to estimate).
For most users mojibake is an "I know it when I see it, but not what it means or how to fix it" sort of thing, whereas a script like this knows what it might mean, and how to fix it, but not whether the status quo isn't already correct. I'm not sure it could be trained for the latter , but feel free to try that
. —
CharlotteWebb
21:05, 27 June 2009 (UTC)
User:SUL messed up the formatting of Acid dissociation constant under the self-ionization section when he used Auto Ed here.-- Jorfer ( talk) 01:25, 25 August 2009 (UTC)
I installed the autoed script, purged the page, cleared the cache but cannot find the autoed tab or button outside of the edit box. Where is the autoed tab? warrior 4321 14:17, 12 September 2009 (UTC)
My problem with the auto-ed tab is that it has been replaced with "check". This happened a few days ago soon after I had installed auto-ed. The check tab works perfectly, so I thought check was the new default tab and changed the text in the project page. Obviously I was wrong. But in my browsers, both firefox and IE, the check tab is still there. So what's the deal? -- Hans ( talk) 08:15, 18 September 2009 (UTC)
AutoEd doesn't seem to work on Google Chrome 3. Error console gives the error "Uncaught ReferenceError: autoEdUnicodify is not defined" with URL "/?title=Wikipedia:AutoEd/complete.js&action=raw&ctype=text/javascript:20".
On a semi-not-really-related note, is there any difference between document.editform
and document.forms.editform
? 「
ダイノガイ
千?!」
? ·
Talk⇒Dinoguy1000
19:26, 24 September 2009 (UTC)
editform
would there refer to the editform's ID, which now should be done via document.getElementById()
, whereas the latter is more correct form-access syntax, using the name editform
. –
Drilnoth (
T •
C •
L)
19:35, 24 September 2009 (UTC)
forms.editform
or getElementById()
)? 「
ダイノガイ
千?!」
? ·
Talk⇒Dinoguy1000
20:25, 24 September 2009 (UTC)The AutoEd whitespace cleaner seems to be collapsing double spaces after a period (full stop) into a single space. An example is this edit. However, double spaces after periods is allowed by MOS:FULLSTOP, and many editors (including myself) use them intentionally, to make where sentences end easier to find in the edit view and because it's a well-ingrained habit from the double spacing at the end of sentences typographic convention. So I would request that this case of whitespace editing be turned off in the script. Thanks. Wasted Time R ( talk) 23:58, 28 September 2009 (UTC)
I created module Wikipedia:AutoEd/dashes.js for converting hyphens to dashes. I've extensively tested it and false positives are fairly rare. Some specific tests are in my sandbox. — GregU ( talk) 13:22, 2 October 2009 (UTC)
I implemented Quibik's suggestion to check for incorrect use of minus signs, where possible. It can't really determine if a spaced minus sign is incorrect in many cases—at least not without adding a "math" heuristic. I tested on quite a few math articles to ensure no false positives were added by this. I'm not comfortable with automatically changing a spaced em dash, as think this needs human judgement on a case-by-case basis. And this is one of the easiest things to catch by eye. I moved the script back under my user space so that I can continue to maintain it, since I'm not an admin. If using it already, please update your monobook.js to read it from User:GregU/dashes.js. Please go ahead and add it to the appropriate presets, if no objections from anyone. — GregU ( talk) 00:00, 13 October 2009 (UTC)
Hello, I'm still waiting for the dashes.js module to be added to the presets, so I can begin advertising use of AutoEd to fix hyphens/dashes. I've continued testing on a daily basis and it is still working well, finding corrections in most featured articles. — GregU ( talk) 03:04, 27 October 2009 (UTC)
Please explain why was removed all wikilinks to American Psychological Association from the page? http://en.wikipedia.org/?title=Homosexuality&action=historysubmit&diff=330641150&oldid=330639500 I don't see any reason why other associations are wikilinked to be ready to click on them (which is useful) and this one not. -- Destinero ( talk) 10:07, 9 December 2009 (UTC)