User talk:Kanegasi

Edit counter script
Hey, just wanted to say I enjoyed your story about how my script got you into wiki scripting. :D Thanks for fixing up compatibility issues so more people can use it. Cheers! — Bility (talk) 23:43, 1 April 2013 (UTC)


 * Oh wow, I'm truly honored to hear from you. I'm glad to see you like my work on your script. I will get it to produce exactly what your original table looks like, eventually. Thank you :D  03:12, 2 April 2013 (UTC)

Found a bug with your edit counter script!
Hi, I was originally working on fixing the namespace limiting bug with the original stratwiki version by Najzere when I stumbled upon your chat on his page... Decided I would see how yours ran and I found a bug! See the. I would love to work with you on refining this script further. You can see the version I was working on User:Technical 13/Scripts/Edit counter.js where was get rid of the alert telling people to bug Najzere if it didn't work on their wiki, made it work for 'confirmed' or 'autoconfirmed' (there are a few cases of one but not the other) (thinking about checking for 'skipcaptcha' right instead so this works better on other wikis), added some TRON lines with formatting to be have an idea of what section my modifications were causing the script to hang when it loaded, and finally I temporarily disabled the table with actual results and opted for a list that returns NS### and name trying to get the ns limitation thing worked around. I'll watch your talk page here, let me know if you would like to work on this together... Thanks. Technical 13 (talk) 14:37, 10 April 2013 (UTC)


 * I was thinking of working on getting all namespaces myself since I'm working in the Module space a bit now, which isn't counted. It shouldn't be too hard, now that I know a bit more about wiki scripting than when I first wrote it in the beginning of 2010. But I'll see what you guys come up with. Looking forward to checking out your improvements. :D — Bility (talk) 15:22, 10 April 2013 (UTC)


 * I made sure everything in the api calls were escaped, but didn't escape the username in the contrib links lol. Fixed on v75.
 * As for the higher namespaces, that was a simple fix. Remove this:

if(siResponse.query.namespaces[ns].id != namespaces.length) break;
 * This was forcing the script to ignore the namespace if its number was higher than the sum of the total namespaces retrieved. If you noticed on your test with my script, it caught your one Portal talk contribution. I'm not sure if Najzere(Bility)'s original counting method would work with removing that line though. The original count method was to request from the API each specific namespace. The issue I ran into is that it wasn't handling the API limit well. At the time, I wasn't an admin on Minecraft Wiki and when my main contribs went past 500, the script would error out on that namespace and not show anything in the table. I then converted the counting method to a complete API request that goes down the list of contribs in one piece and it increments each namespace count in the array, which allowed it to count past 500 on any namespace since I knew the query continue was working this way.
 * In response to the captcha checks, autoconfirmed is a default user right with the 10 total edit setting also default, but since I'm using a regex function to search user rights, I changed that to search for the word "confirmed" which should make it ambiguous enough to work elsewhere. Now at v76.  18:40, 10 April 2013 (UTC)


 * Removing that line doesn't help. It locks up the script because it doesn't know when to stop.  Do you know if there is a way to ask the API what NS numbers exist, build an array from that and then pull the information? Technical 13 (talk) 18:47, 10 April 2013 (UTC)


 * This API call: action=query&meta=siteinfo&siprop=namespaces gives all the namespaces. The reason I was limiting namespaces originally was because I wanted to iterate through an array with a counter incrementing by 1, and it failed when namespace numbers jumped from 15 to 100 all of the sudden. This is due to the way the namespaces array is built, which is to assign the namespace name to an index that is the same as the namespace number. A silly way to do it, but the script was developed on a wiki that only had consecutive namespace numbers. Knowing what I know now though, it seems like it would be pretty easy to just use a different structure or an associative array to hold the namespace numbers. — Bility (talk) 20:24, 10 April 2013 (UTC)


 * My script still does that with namespaces. It builds an array using the namespace number as the index number. The way I count the contributions though is using an array for the edit count as well. In your original script, you had the edit count as a simple variable that was reset as it moved to the next namespace. Making the counts an array as well arranges the counts with the namespaces. It's the same way you used to count the moves and protects. I think that's what hangs up your script, Technical. The simple edit variable loop can't handle the non-incremental namespace number jump. I also changed the move/protect count subtract to an overall log event count, but then add file events since uploads and overwrites are technically valid contributions.  21:48, 10 April 2013 (UTC)
 * I know how it would look in php, but how would it look in js? php array would be something like:
 * 0 => 0["Main", edits, moves, protections]
 * 1 => 1["Main talk", edits, moves, protections]
 * 2 => 2["User", edits, moves, protections]
 * 3 => 3["User talk", edits, moves, protections]
 * 15 => 15["Category talk", edits, moves, protections]
 * 16 => 100["Portal", edits, moves, protections]
 * 17 => 101["Portal talk", edits, moves, protections]
 * 18 => 108["Book", edits, moves, protections]
 * 19 => 109["Book talk", edits, moves, protections]
 * 20 => 446["Education Program", edits, moves, protections]
 * 21 => 447["Education Program talk", edits, moves, protections]
 * 22 => 710["TimedText", edits, moves, protections]
 * 23 => 711["TimedText talk", edits, moves, protections]
 * 24 => 828["Module", edits, moves, protections]
 * 25 => 829["Module talk", edits, moves, protections]
 * So, the top array would have 25 arrays in it named by their respective namespace number which should make it easy to pull the information for each and still use the consecutive 1, 2, 3... for loop... No? Technical 13 (talk) 00:54, 11 April 2013 (UTC)
 * You could do it the same way in JavaScript with a multidimensional array, but it's probably easier to fit into the existing code to just use a separate array that holds the namespace numbers (your top level above) and then use that to drive the namespace iteration. — Bility (talk) 01:54, 11 April 2013 (UTC)
 * You could do it the same way in JavaScript with a multidimensional array, but it's probably easier to fit into the existing code to just use a separate array that holds the namespace numbers (your top level above) and then use that to drive the namespace iteration. — Bility (talk) 01:54, 11 April 2013 (UTC)

Arbitrary break
So it turned out to be as easy as I thought, so I just updated mine and now it takes in all namespaces. You can see I now have the portal and module spaces on my edit count. Cheers, — Bility (talk) 14:25, 11 April 2013 (UTC)


 * I didn't really have much to add to the last comments, although the concept of visualizing the array was new to me. Pretty neat. I have tinkered with the script quite a bit more over the past week and I believe I reached a nice working plateau. I did some test stuff on Minecraft Wiki where I'm an admin and I now understand exactly how moves and protections work. This whole time I thought they did increment the wiki total and we were just subtracting them since they weren't edits. I now know it's the opposite. The script is supposed to get rid of that stuff from its count in order to match the wiki total. I also found out that new files increment, but not overwrites. My current version counts moves, protects, and overwrites and takes those away, then I take that number and subtract it from the wiki total to get deleted edits, and I put that in a tooltip on the total number. Testing it on my wikipedia account, it's dead on accurate. I have one deleted edit out of the 200ish contributions. My Minecraft Wiki count is above 4000 though, and the deleted edit count seems correct (didn't try to find all the deleted edits). Before I was admin, I marked quite a few things for deletion. I even increment the userspace count and total count by one each to account for the edit that submits the table, but that's OCD on my part to get things to match. There was also an issue that prevented the text link from changing when the script ran and I fixed that with a simple setTimeout delay to allow the text to change before the script kicks in. Just thought you guys would like to know my continued progress.
 * Oh, another interesting thing, I stumbled across the style tag "caption-side". I got rid of the encompassing and using the |+ table caption with style="caption-side: bottom", the date/link at the bottom of the table sits comfortably where it was, but now it's all one table. You are allowed to use more than one |+ caption too, so it didn't interfere with my tableCaption variable. Both the main caption and the "footer" caption display normally when used.  01:15, 21 April 2013 (UTC)


 * So, in the process of looking at another user's edit count usage on my wiki while on my iPhone (Safari), I noticed that their caption shows but not my date/link caption. Doing research, HTML standard should only allow one caption tag. I did some testing at browsershots.org and it seems Opera, Chrome, and IE support more than one caption (although IE is pretty stupid by displaying what should be the top caption to the left of the date caption, or ignoring the caption-side style and putting the date under the main caption. this seemed to be intermittent.). Firefox and Safari both honor what the HTML standard wants. I'm not sure how to fix this without putting the div back in. I kind of liked the tidy idea of just one solid table.  19:21, 21 April 2013 (UTC)


 * (more rambling) I did not realize I had a "deleted user contributions" link as an admin on the Minecraft Wiki. Tinkering with the display limit, I have 171 deleted contributions and the script counted 176. I think that's pretty accurate. Searching through the API and comparing a lot of edits, I found that while usercontribs in the API does not show deleted/hidden edits, file logevents can. My file overwrite count is picking up overwrites on deleted files. I'm not quite sure how to tackle this in a simple manner. One idea of mine is to setup two completely separate arrays and put file titles into one from the contrib count of ns 6, then file titles into the array from the overwrite count, filter out recurring titles, and then count the titles left.  03:45, 22 April 2013 (UTC)


 * For the caption, my advice would be to remove the extra caption or put the date in a colspan'd row at the bottom. There's no reason for extra captions anyway, especially how you've used it, as the title display is immaterial on a page that no one visits that's meant to be transcluded. If you wanted to add something extra to the page, like a category or display title, you don't need to put it in the table at all since it's not rendered. Using a caption for non-rendered content isn't semantically valid anyway.
 * Regarding the edit count discrepancy between MW's number and a totaling of user contribs, in the past the API wasn't fast enough to warrant the extra calculation time. At least not for me, since I have 40K+ edits on strategywiki, a ton of which are in the file namespace. The API seems to be a bit faster these days though, the last time I ran mine on SW it didn't even take a minute, so perhaps that's less of an issue. I really wish we had the ability to pass SQL queries through. It would be so much faster to just return the wanted aggregates instead of having to loop and count individual edits. Anyway, it's neat to see the differences between the two counting methods, and like you I researched where the differences come from pretty heavily, but ultimately abandoned the issue due to script run time.
 * Well, keep up the good work! — Bility (talk) 23:05, 22 April 2013 (UTC)


 * The way I'm using it is because I'm actually not using the caption, just hijacking the variable to put my page title css on the edit count page. A technically empty  like that doesn't get rendered into a second caption tag. The usage issue can be seen here (I used browsershots.org to get my tests). The reason I have the caption in the first place is using ultradude25's original title function wrapped in a div here, which comes to use on his main page (the first user I linked also does this). I originally didn't have a title/caption, just wrapped the date at the bottom in a div like ultradude25 did. Then I found the caption (which originally didn't work since encode doesn't work with + and I eventually stumbled across encodeURIComponent), and pretty close after found out about caption-side: bottom. I have tried formatting the date in it's own cell/row, but when one uses the wikitable class, along with that horizontal layout, I didn't like the look of that super long row with a small date in it. I'm thinking that the table title would look relatively fine in it's own row on top though.
 * For the deleted edits, I greatly simplified the math I was using, but came up with the same slightly off amount. I put in functionality for custom namespace names as mentioned below, but haven't thought about how to filter out deleted overwrites. Looking at other user counts, along with access to their deleted edits on the Minecraft Wiki, there seems to be more inaccuracy, but I can't quite place where it's coming from. More goals :D  02:48, 28 April 2013 (UTC)

collapsible collapsed
The script does seem to support collapsible collapsed According to kipod says that it doesn't work if the table has  tags (table rows that start with "!" instead of "|"). This comment made from my BlackBerry Curve 9330/6.0.0.706 at 8:09a on 4/20/2013. - Please feel free to correct any typographical errors that may exist. Thank You. Technical 13 (talk) 12:01, 20 April 2013 (UTC)


 * The opposite is true. The table has to have the  tags in order for it to be collapsible. If the namespace row is plain cells (which is an option in my script) the collapse option will not work. See this revision of my edit count to see the collapse function working (with the ! headers) and this revision not working with normal cells.  12:09, 20 April 2013 (UTC)


 * I'll have to play with that a little more, perhaps I misunderstood him. Technical 13 (talk) 12:19, 20 April 2013 (UTC)
 * Linked his name above and found the quote: "the "collapse" script does not touch the th (aka title). all i did was add a new "tr/td" pair," Technical 13 (talk) 22:48, 21 April 2013 (UTC)


 * Ah, I see. That's in context to a template. I was speaking about table code in general. A default table in a wiki (which is just wikicode shorthand for html table, th, tr, td, and caption tags) will only use the collapsed html function with th tags, so if a wiki table has no "|-" in it, it won't have a collapse function. I could see what they did with that script and do something similar in my script to force a collapse function independent of html tr tags.  23:00, 21 April 2013 (UTC)

v91 with...
This table is getting too long and there are NS I haven't edited in yet. Do you think you could add a switch that would allow people to use NS Aliases/pseudo NS as column headers to fit more columns in the width of screen available? Technical 13 (talk) 22:49, 21 April 2013 (UTC)


 * I have noticed a "squishing" issue with my count table as well when viewing it on an iPhone (my browser is wide) but haven't considered doing anything about it. I'll look into it.  23:00, 21 April 2013 (UTC)
 * v93 allows the nameSpaces array to preexist. I'm not too thrilled you still have to declare a new array and there's probably a neater and simpler way to do it in terms of someone setting up their common.js, like making carrier variables for each namespace or something "code messy" but user friendly on the outside. I'll update the doc later, but for now, you can put this in your common.js:

var nameSpaces = new Array; nameSpaces[0] = 'custom Main name'; nameSpaces[1] = 'custom Talk name';
 * ...and so on. The number in the brackets is the corresponding namespace id. You don't have to declare each namespace. The script will still fill in the canonical names for any namespace you don't declare.  02:49, 28 April 2013 (UTC)

v100
I'm not very impressed with v100's preventing the script from running more than once per day. It is preventing me from trying different parameters to see how the output is resolved. Technical 13 (talk) 20:20, 6 May 2013 (UTC)
 * I see you're modifying the script again... User:Technical 13/Long edit count space in my name bug is back. Technical 13 (talk) 00:21, 7 May 2013 (UTC)


 * For the daily limit, there was someone in the past that was using it multiple times in a row, just to see the count increase. It wasn't until recently that I was comfortable enough with the script to try a "cooldown". I understand your thought process about testing settings, even though I believe it isn't necessary. Every one of the vars can be tested by manually changing the table itself and using the preview function. Despite my belief, though, I put in a bypass that unlocks the daily limit provided that the user has changed their common or vector pages the same day. I'm thinking about making a var just for this so the user can declare what script page to check, but I would rather not have this bypass known. As for your name bug, that's my fault. The new ajax call format using mw.util.wikiScript automatically includes url encoding for the api calls, but I forgot the simple contrib links still needed encoding. Sorry about that. v103 should work just fine.  18:29, 7 May 2013 (UTC)

German titles/editcounter
How I can translate the titles into German? ILeon (talk) 12:11, 29 August 2013 (UTC)


 * Use the var nameSpaces option in the code you have in your common.js or wherever you placed the editcounter code. For example, the following produces what is shown here.

var nameSpaces = new Array; nameSpaces[3] = 'Utalk'; nameSpaces[4] = 'MCW'; nameSpaces[5] = 'MCWtalk'; nameSpaces[7] = 'Ftalk'; nameSpaces[8] = 'MW'; nameSpaces[9] = 'MWtalk'; nameSpaces[10] = 'Temp'; nameSpaces[11] = 'Ttalk'; nameSpaces[13] = 'Htalk'; nameSpaces[14] = 'Cat'; nameSpaces[15] = 'Ctalk';
 * The numbers correspond with namespace id numbers shown here on the right side. 04:51, 23 September 2013 (UTC)

Bug in: Edit counter v107-109
Hey, I just noticed that your edit counter isn't placing my edit count on User:Technical 13/Long edit count anymore and now is instead placing it on User:Technical 13/User:Technical 13. I'm using  although looking through your edits I can't see where or how there were any changes in your script that would cause that. The only thing I can think of is it may have something to do with the https: issue (I had to adjust my edit counter to adapt to that) or something in the api itself has been changed or modified. Let me go run the script again with the error console open and see I can get you some more information about what is happening. Technical 13 (talk) 18:04, 1 November 2013 (UTC)


 * Enjoy my console log which resulted in this misplaced table on ... ^^
 * For the record, my full code calling your script in my User:Technical 13/vector.js is:


 * Happy bug finding! Technical 13 (talk) 18:11, 1 November 2013 (UTC)


 * I'm not quite sure what the issue is. I copied what you have in your vector page and used that and my count appeared in Long edit count just fine. I have done nothing about https since my script does not differentiate between http and https and gets all url data from MediaWiki variables that Wikipedia provides. More than likely, this was a one-time issue on Wikipedia's side, like something went wrong with giving your browser the correct variable data. 05:14, 4 November 2013 (UTC)


 * That's just it, it's not a one time issue. If you look at the history pages for each  stops on September 9 (except my manual edit not made by the script) and  shows that the script has posted it there every time since.  I'll even run it again right now... Again it posted to .  I'm not sure where the bug is.  Go ahead and take another look at it and if still nothing I'll see if maybe someone on VPT can figure it out. Technical 13 (talk) 15:24, 4 November 2013 (UTC)


 * Alright, I found two issues, none of which are from my script, but both I could fix as well as you can. I'm not very savvy with global variables and strict mode and such, but because my script and your scripts are declaring global variables, they are interfering with each other.
 * The first issue, the one that is causing User:Technical 13/User:Technical 13, is your User:Technical_13/SandBox/Gadget-listStyles.js script is declaring a pageName value, which is overwriting my script's pageName value. I suggest using a unique variable for that.
 * The second issue, which is a separate one, is that our edit scripts cannot coexist because they use the same "t-editcounter" id on the menu link. They need to be different.
 * Both of these issues are both our faults. I'm about to go to work, and on top of that, I have other activities that may not let me tinker with my script for another few more days. In the meantime, make sure all of your variables are unique as well as use a different id for the menu link. I'll also make sure my variables are more unique sometime in the future. 19:30, 4 November 2013 (UTC)

Can't get it to work
I probably do something wrong. I copied the jscript to my .js and running it was a "Succes!". I tried to copy the table to my user space, but nothing happens. Can you take a look? I'm fine if you want to adjust something on my user space. Kind regards, Timelezz (talk) 15:35, 30 March 2014 (UTC)


 * Check your contributions. It worked just fine: User:Timelezz/edit count. Also, I'm not too familiar with Wikipedia's userspace policies, but I, and perhaps others, would appreciate it if you do not edit someone else's userspace.  15:44, 30 March 2014 (UTC)

Ps. I gave you personally explicit permission to edit my personal user page which overrules any guidelines that would prohibit that. Kind regards, Timelezz (talk) 13:18, 31 March 2014 (UTC)
 * I see it was not clear to me that I had to look at /edit count. I copied the template table to my user page which did not work. Now I've copied the table from the sub page, to my User page which seems to be stable. Thank you for your help!


 * I know you gave me permission, which I just took advantage of to transclude your table so you don't have to copy it every time. I was referring to you editing my info page about the script.  18:08, 31 March 2014 (UTC)
 * Thank you very much and my apologies. I was under the impression this was a regular page, not a user space. Hope you don't mind too much. Kind regards, Timelezz (talk) 18:31, 31 March 2014 (UTC)

Api change
Hey, heads up. They changed the api so &ucstart= is now &uccontinue= and the api now returns it as query-continue.uccontribs.uccontinue from query-continue.uccontribs.ucstart. — &#123;&#123;U&#124;Technical 13&#125;&#125; (e • t • c) 16:44, 1 June 2014 (UTC)


 * I'll take this to mean that it's broken until he changes some things? - Exhelah t - c  — Preceding undated comment added 18:27, 28 September 2014 (UTC)

JavaScript facepalm...
facepalm...

1. use logic operators for setting defaults value:

tableCaption = tableCaption || '';

2. new Array - is deprecated, is very very old style;

use literal [];

95.143.120.218 (talk) 10:49, 17 April 2015 (UTC)

Edit counter
Hi Kanegasi, sorry to bother you. I've been using your script for a while, and it works great. However, I have gone to update this today, and there is now no field to be able to update this under user contributions. Is this likely to be a browser issue (Same browser as always, Chrome), or a script issue? Thank you for your time.  Lee Vilenski (talk • contribs) 17:00, 16 November 2018 (UTC)