[00:37:33] wikihow just crashed firefox [00:37:36] booooo [00:37:42] not sure who to blame [14:50:32] DaSch88 is reporting some problems with the new wikieditor/js2 on #mediawiki. shall i send him here? [19:57:13] nimish_g: Are you aware of the parenthesized subexpression feature in regexes? [19:57:34] yes [19:57:48] I reviewed your templateEditor code today and you're spending a screenful of code muddling with indexOf() and substr() on what looks like could've been done much easier with a parenthesized regex [19:58:17] I've been spending all morning trying to get that code to be functional again [19:58:26] Did I break it? [19:58:30] YES [19:58:36] in many places =( [19:58:37] WTF how did I do that [19:58:46] My changes were mostly whitespace, and some simplification here and there [19:59:37] so far a missing , in a match call and a missing closing brace in a while statement, a few 'var' calls that localized variables that weren't supposed to be localized, now a loop that counts wrong... [20:00:14] Yeah I saw the missing comma [20:00:22] yeah that's the only one I've commited so far [20:00:29] Meh vars, guess I was overzealous there :( which loop was that? [20:00:38] The one where I changed i to j and introduced i? [20:00:43] yes [20:01:00] because .length does weird things when you use numbered indicies [20:01:10] Ooh [20:01:21] So the for ( .. in .. ) /was/ intentional [20:01:24] so if I go Roan = new Array(); Roan[222] = "hello"; it thinks the length is 222 [20:01:30] yes [20:02:05] We have this guideline that you should use a .length-style for loop for straight [ ] arrays and for .. in for { } objects [20:02:20] IIRC you were doing Roan = new Array(); or Roan = [ ]; and then Roan[222] [20:02:57] yeah. but if you put it in a for loop it loops 222 times, 221 of those returning undeefined [20:02:58] In that case it probably makes more sense to do Roan = { }; to indicate it's not a normal array but more like a hashtable with indices that happen to be numeric [20:03:00] My mistake [20:04:16] no worries, but next time, listen to yourself and PLEASE don't commit whitespace changes and functional changes in the same commit, it makes it really hard to figure out what's going on [20:04:30] "listen to yourself" heh yeah good one [20:04:37] ha ha ha [20:04:47] RoanKattouw yells at me for that often [20:04:58] *TrevorParscal deserves it [20:05:17] I know what the temptation is like now [20:05:22] :) [20:05:35] RoanKattouw: I'm making slow progress - but could use help, are you working? [20:05:43] I also have some more general questions and remarks that don't involve me breaking your code :) [20:05:49] I recall you saying you are now a volunteer until Jan. 1 [20:05:57] TrevorParscal: Sure, after I talk to nimish_g some more about TemplateEditor [20:06:04] RoanKattouw: coo [20:07:01] nimish_g: So one thing that confuses me (and the code comments aren't exactly helping me there) is that you're running markOffTemplates(); before parsing the template name and parameter list, while if I read the code correctly the former should kill all {}|= inside template calls [20:07:50] *RoanKattouw guesses karma bit him in the ass after he's been yelling at TrevorParscal about style versions all week [20:08:09] Or the other side of karma... whatever [20:08:29] ok, so there are a couple of things happening here [20:08:53] RoanKattouw: pfft style versions [20:09:12] werdna: That, and running the recombine+minify script [20:09:20] once the script loader (mdale!!!) is done we won't have to update those silly things by hand anymore [20:09:22] well I can understand that part :P [20:09:24] True [20:09:40] werdna: Now imagine someone forgets that for 12 commits in a row and you keep cleaning up after him :) [20:09:54] ha ha ha [20:10:02] *werdna offers RoanKattouw a pill of chill [20:10:03] RoanKattouw cleans up after TrevorParscal [20:10:21] first off, nested template/template params/etc. The marker is just designed to find the outermost boundaries of templates in wikitext, so if you have "==wikitext and {{ template1 | param1 = {{bob}} | {{{param-name}}}}}} {{template2}}" [20:10:33] werdna: I got that pill of chill right about the time when nimish_g let me know my 'whitespace fixes' totally broke his code :( [20:11:13] yeah, RoanKattouw, I was gonna write you a Tim email this morning [20:11:18] *tim-style [20:11:21] ha ha ha [20:11:43] Rightly so, I guess [20:12:30] the second part is that there's a model of the template in there, the model, given the boundaries of a template, will correctly identify things like param1 = {{templatecall | {{nested-nested-template}} = {{{more parens}}} }} [20:12:35] Aaah [20:12:47] I now /really/ understand what markOffTemplates() does [20:12:57] that will identify that there's a variable called "param1" and a variable called "{{nested-nested-template}}" [20:12:58] "Nowhere in your useless commit was there anything resembling constructive changes. Trevor, please assign someone to teach Roan the basics of walking and talking so that he can eventually aspire to learn what computers are." - Tim (actually Nimish (actually neither of those people) ) [20:13:14] It kills the wrapping {{ }} then searches for more {{ }} inside that, only then replaces {}|= inside /that [20:13:24] yes [20:13:35] Right [20:14:38] yeah, markOffTemplates just finds the top-level template boundaries accuratelly [20:14:56] And the fact that you're replacing them with Xs doesn't matter because you're storing position ranges, not actual substrings of the sanitized (not sanAtized) text [20:15:03] then the model does all the other parsing, should we want to do anything with nested templates [20:15:29] yeah, I just have X's in there as position holders, when you ask for the values and stuff you get the values from the original text [20:15:42] TrevorParscal: now now, Tim isn't usually that bad :P [20:15:46] The Range object is kinda genius BTW, only fully appreciated when I read the code of getText() [20:16:04] werdna: tim would also say "and your hair looks funny" or something =) [20:16:13] thanks =) [20:16:24] Well even when Tim is flaming, he usually says true things most of the time [20:16:27] that way we preserve whitespace [20:17:17] Also, the markers stuff is nice, but I think it could be nicer [20:17:45] Right now the highlight module places the markers there and templateEditor finds those and wraps them in a div [20:18:25] The downside of the current implementation is that it uses setContents() to completely reset the contents of the entire iframe, and I'm almost sure that'll mess up something [20:18:32] do you guys have a citron sandbox site? [20:18:35] I wanna play! [20:19:22] It'd be nicer to use DOM manipulation to cut up the TextNode and wrap it in a div [20:19:29] werdna: prototypes run what we have [20:19:37] Check out preferences to turn on experimental things [20:19:40] *RoanKattouw updates prototypes [20:19:42] yeah, also the highlight and templateEditor objects reach into eachother's innards and poke things around too much. I was gonna fix that, and also swap out the "setContents" with some sort of "setHTML" b/c it currently just surrounds the outermost templates with *text* and not useful HTML [20:20:03] or at least it *did* ::evilly eyes RoanKattouw:: [20:20:39] Yes that's what setContents() does. I didn't document that explicitly I guess, will do that [20:21:15] oh no, I mean the marking thing currently does nothing. setContents() changes text [20:21:35] but we wanna inject HTML [20:21:41] Yeah, it converts the
to <div>, right [20:21:45] yep [20:21:47] RoanKattouw: did you see my wonky stuff with that? [20:21:51] Exactly, and I think we should use the DOM manip functions for that [20:21:54] TrevorParscal: What's that? [20:21:57] Oh that [20:22:00] with setting and getting [20:22:01] The .text() special case for IE? [20:22:13] yeah, but i think IE7 needs it the normal way [20:22:18] it's insane as usual [20:22:21] I added a comment to that rev to ask wth is going on there [20:22:33] we should do a test and choose based on the results [20:23:09] RoanKattouw: well, I got it to stop crashing and actually work, so I was hoping to clean it up later... [20:23:14] Right [20:23:15] like soon [20:23:24] .replace( //g, '>' ) --> this freaks me out, looks like it's almost certainly wrong [20:25:21] nimish_g: However, if we are to do this DOM manip stuff, then we'd either have to traverse the TextNodes instead of the actual text, which means rewriting all your code in a very painful and unreadable way, or write a function that walks through the text in a second pass and does the wrapping. The latter is probably easier and more readable [20:25:21] i'm sure i saw designs for Citron somewhere, but i can't find a [[Citron Designs]] page on the usability wiki. [20:25:26] was i dreaming ? [20:26:09] It's probably Babaco designs#Beyond Babaco [20:26:37] that stuff needs organization badly [20:26:40] needs to be moved [20:26:49] the images all need consistent naming [20:27:06] *RoanKattouw lols at commit summary [20:27:19] That inherit thing sounds interesting, I'll take a look at it [20:27:19] there's tons of designs that we totally passed on that need to be split up into a section called something like "Concepts" [20:27:51] RoanKattouw: yes, please take a look at it in IE [20:28:20] RoanKattouw: templates aren't necessarily going to all be in 1 text node [20:28:23] tip: add a console.log line to the ready function, and notice it works well 2 times and fails the third time - in ff it just works well 2 times.. [20:28:38] simple ones, yes. complex ones, not so much [20:28:39] that 3rd time is the problem, and I don't know why it gets called the 3rd time.. [20:28:40] nimish_g: That's true [20:29:07] "Nothing selected" [20:29:11] what's that for? [20:29:22] So walking through the text nodes is not an option. I think it's best to keep the current Range logic, then write a function that takes a Range, then finds it in the DOM [20:30:54] yeah, that's what I was thinking, and then all the text nodes encapsulating that range with offsets and other pain [20:32:59] Yeah, it's a pain [20:33:37] Would you like me to write such a function? I've been messing with DOM stuff more lately [20:34:57] sure...let's see what the easiest input/output for such a function would be... [20:35:09] actually, did you understand what the 'markers' array does? [20:35:53] Sort of, I guess [20:36:18] if we had the following wikitext: == {{ TEMPLATE}} == [20:37:10] we might want it do actually be:
==
{{ TEMPLATE}}
==
[20:38:03] s/class="toc"/class="heading-2"/ [20:38:32] so the markers thing puts in a few...I forgot what I called them...markers prolly, at those indicies, saying (0, '
') (2, '
and if there are multiple things you want to put at a given index, it pushes them into an array at that index, and since they get added at the same time, they close at the same time [20:39:11] anyways, the indicies are indicies in the text [20:40:17] so ideally if we had something that says "assuming there's none of *our* markup on this page, I would like to insert the following markup at the given locations" it would be perfect. and, TrevorParscal and RoanKattouw, unless I'm mistaken, we should *only* be adding markup inside and via this function [20:40:22] inside the iFrame [20:40:28] iframe. sorry, stupid apple [20:41:13] Yeah so we'd have to port the code that's currently in the TOC module to this as well [20:41:18] iTemplateEditor X - Code name: "Sex Panther" [20:41:51] RoanKattouw: which has been expected I thought [20:42:20] so far, the thing is we don't have a sensible way of deciding *when* to run the marking/hilighting [20:42:52] Yeah, and we probably want to be able to run a limited or localized version of it [20:42:57] And be able to do it incrementally [20:43:05] yeah, that's what the "division" inside those function calls is gonna be [20:43:10] Like, if you're adding one marker, it shouldn't re-mark everything [20:43:17] exactly [20:43:21] well [20:43:32] actually, the idea is we wanted to isolate "affected areas" [20:43:54] so if you suddenly typed in }}, everything *before* that mark until the first {{ suddenly turns into a template [20:43:58] OK so the inputs we'd have would be the DOM of course, an array of (index, markers) pairs where index is an index in the text and markers an array of markers to insert there (or a single marker) [20:44:19] does the code folding thing actually work yet, or are you still working on it? [20:44:35] nimish_g: Yeah but what I mean is that if you add }} and suddenly make something a template, it should just insert that and not strip and re-insert a wrapper for a heading someplace else [20:44:48] werdna: It's what we're discussing at length right now [20:45:07] Other inputs would be like a division I guess [20:45:28] division would be like if you copy+paste stuff around [20:45:34] or delete a whole bunch of stuff at once [20:45:58] so then you say "all of this stuff is invalid and needs to be re-marked" [20:46:04] Hm wait I don't think this function needs to bother with that [20:46:09] If it just accepts a set of markers [20:46:13] oh, this function, no [20:46:27] I was just rambling about stuff =) [20:46:43] This just needs to go like "well here's a set of markers, and A, B and C seem to have been applied already so I just need to do D and E" [20:46:56] this function should take something that goes "at text position x, insert the following HTML" [20:46:57] "Oh and here I found marker F but apparently that one died, let's strip it" [20:47:02] ah yeah [20:47:11] The (2, "
") pairs you were talking about [20:47:15] What's the name of that class? [20:47:15] that'd be iteration 2 of it, but if you can do all that at once, then sweet [20:47:48] Would probably go in one pass [20:48:10] Where's the code that actually stores those (2, "
") marker tuple thingies? [20:48:19] oh, that's just information stored in modules.highlight.markers[] it's an array of stuff that looks like this [20:49:00] 2: "
" ,"" 7: "" 9: "
" [20:49:19] Ah yes [20:49:23] The Roan[222] example [20:49:33] BTW, you added spaces instead of tabs for indent at the end of highlight.js [20:50:10] I'll get cracking on that then [20:50:22] Although I have a Skype call with Trevor in 10 misn [20:50:54] oh yes... i better get my headset back from parul [20:52:41] Ah inherit is a 3rd party plugin [20:52:48] Didn't know that [20:53:44] RoanKattouw: i'm going to go grab lunch [20:53:51] parul is using my headset too [20:53:58] Ha [20:54:00] so, can we push our meeting back a bit [20:54:01] ? [20:54:03] Sure [20:54:09] I'll just start coding the Nimish Function [20:55:21] let's say 1:30 [20:55:26] OK [20:55:56] nimish_g: I'm gonna fix the whitespace at the end of highlight.js and add my function there; does that cause conflicts for you? [20:56:38] I don't think so, the version in SVN now works fine =) [20:56:43] brb lunch [20:57:06] OK [20:57:37] Oh wait the entire mark() function is probably gonna be totally rewritten anyway :) [21:00:35] *RoanKattouw wonders why the division parameter in mark() isn't being used (@ nimish_g ) [21:07:58] RoanKattouw: b/c we haven't implemented divisions yet =) [21:08:06] and yeah it'll prolly be rewritten [21:08:14] I'm rewriting it now :) [21:08:38] I think, to some degree, we just wanted to have some rough functioning thing that makes templates go away for Tuesday [21:09:47] hi RoanKattouw, quick question for you [21:10:02] Sure [21:10:12] is there easy way to count number of users who have account on our wiki? [21:10:30] http://usability.wikimedia.org/w/index.php?title=Special:ListUsers [21:10:41] i know we have more than 1500 users [21:11:01] but i don't want to count the number between 1500 and 2000 [21:11:04] Note that most of those are accounts created by SUL [21:11:18] the red ones? [21:11:23] I can get that number easily, but it's likely not meaningful [21:11:32] The red ones are the ones that don't have a userpage [21:11:34] *TrevorParscal eats lunch [21:11:43] desk om nom nom [21:11:56] Thing is, if you have an account on enwiki and so much as /visit/ usabilitywiki, it'll try to automatically log you in there and create an account for you if needed [21:12:35] hmm [21:12:41] A more useful metric might be the number of users with more than zero edits [21:13:20] i think erikz's stat captures that [21:13:40] but the number was pretty low as his stat does not take discussion edits into consideration [21:14:45] active user stats in this page is interesting [21:14:46] Ah [21:14:50] http://usability.wikimedia.org/wiki/Special:Statistics [21:14:57] so i will use both numbers then [21:14:59] thanks [21:15:29] beware, most of those numbers are rough estimates - they use describe rather than select statements [21:15:36] afaik [21:16:21] what do you mean by "describe" rather than "select statements" [21:16:22] ? [21:16:29] database stuff [21:16:48] I'm just saying, as long as you are getting a rough idea, it's perfect [21:17:04] just don't set your watch to this type of data - so to speak [21:17:36] i'm trying to gauge user participation to our wiki [21:18:09] what is human behavior difference captured in the database command you described? [21:18:28] Inaccuracy, generally [21:18:53] I think the DESCRIBE thing only applies to the job queue length and the active users count [21:19:13] The rest uses a running count in the site_stats table, which is slightly more accurate (although it's hardly the most accurate thing ever) [21:19:42] well I think 7.38 avg edits per page is not too bad, but still a bit low compared to meta's 11.10 and english wikipedia's 18.73 [21:19:57] We're not a content wiki, mind [21:20:36] yeah.. well, we should have fewer pages with more edits per page, rather than tons of pages with fewer edits per page [21:22:02] Oh nice, I'm looking at a real-world instance of "make this recursive algorithm iterative" problem [21:22:29] Except those assignments are usually 5 lines, and this is a 70-line DOM traversal algorithm... [21:25:14] Oh wait, I /can/ do it recursively with some .pop() smartness [21:27:10] oh yeah, RoanKattouw if you want to see the template thingy work, change event.data.scope == 'do_not_trigger' in highlight.js to 'keydown', and then just type a space or something into the editor window or whatever [21:27:27] obviously it can't be run on every key press, but just for testing [21:27:31] Right [21:27:48] i mean, it *shouldn't* be run on every key press, that would be very bad, especially since it overwrites the contents [21:27:58] I've messed up the code so bad now that that's not gonna do anything but throw a dozen errors :) [21:29:11] RoanKattouw: skype in a min or so [21:29:32] OK, you call m [21:29:34] e [21:29:55] will do [23:47:54] what does actually do?? [23:48:10] andone? [23:48:13] anyone? [23:48:51] parutron: it makes everything inside not be formatted [23:49:02] hmm, so that's what i thought [23:49:06] but i tried it around various links and images [23:49:12] so if I wrote: hey '''paru''' that makes it bold [23:49:28] is it just *particular* formatting [23:49:30] i.e. [23:49:31] hey '''paru''' makes it just a bunch of quotes