[17:01:21] RoanKattouw: I see a few things changed in jquery.localize.js recently. Do you know if it's used or planned to be used in core ? [17:01:33] I don't know [17:01:40] It's currently only used in ArticleFeedback [17:01:46] it [17:01:58] It's only really useful when building large-ish blobs of HTML with i18n'ed text in them [17:02:14] WikiEditor could benefit from it I guess (dialogs module) [17:03:07] Hm.. I guess it should/would only be used on dynamically added elements right ? not called on html elements served by PHP ? [17:03:49] No, you actually can't use it the latter way [17:03:56] Because the HTML would be invalid [17:04:03] its better to use jQuery build out for html [17:04:12] You can't actually have tags in the main DOM [17:04:33] mdale: Yeah unless it's a ridiculous amount of fairly static HTML, that's when you use templates [17:04:43] This is what we do with the dialogs [17:05:04] The static HTML is in a JS string, then there's code to put the dynamic bits in, and jquery.localize to put the i18n in [17:05:17] mmm [17:05:47] once you accept some formatting conventions jQuery build out is really not /more/ ugly [17:05:56] and it is validated and a lot harder to mess up [17:06:58] you get used to seeing jQuery built out for html and then static HTML looks verbose and ugly :P [17:08:28] mdale: jQuery build out ? Is that some kind of method or plugin ? [17:08:43] its just the word I use for building html with jquery objects [17:08:49] ah, okay [17:09:35] But isn't it slower to let jquery construct each element rather than leaving it as a string until needed ? [17:09:44] slightly slower [17:10:04] not noticeable untill you get to the many thousands of nodes [17:10:06] especially large constructions I can imagine could slow down if there are a dozen of them and perhaps none are needed. [17:10:18] Okay [17:10:23] well you don't build out until your about to insert [17:10:47] But in order to know what to build out it has to be in the script somewhere. That could be a string. [17:10:56] you construct your html with getters that get called right as your putting it into the dom. [17:11:23] true, the storage could be a function that retuns the jQuery object. [17:11:50] this makes the code very portable as your bindings happen in the same object request [17:12:10] you don't have any back-reference class or id selectors that have to be keep in sync with your static html structure. [17:12:44] all your text is inserted as .text() and you avoid string->html escalations from putting dynamic strings into .html calls [17:12:49] Like I said, the WikiEditor dialogs use HTML strings with the general structure, that are then fed to $(), get dynamic bits added, and are then inserted into the DOM [17:13:08] .text() counts as a dynamic bit, although in practice most .text() calls will be in .localize() [17:13:26] You are right that you have to keep classes and IDs in sync [17:13:40] But you also have to do that in CSS anyway [17:14:10] precisely .. you don't want your visual updates affecting your procedural bindings. [17:14:27] or at least not more then they have to [17:17:42] speaking of WikiEditor -- RoanKattouw I was looking for docs on extending the default toolbar with additional buttons, and got a little lost [17:17:46] is there a reference handy? [17:21:05] brion: it's on usability wiki [17:21:38] but since WikiEditor has multiple layers and levels I created a utility function for the common usecase (adding a button the main edit bar) [17:22:10] I'll probably put that in svn somewhere rather than wmf gadget. [17:22:24] http://meta.wikimedia.org/wiki/User:Krinkle/Scripts/insertVectorButtons [17:22:28] Krinkle, well, i want to use it from both extensions and gadgets [17:22:30] It's a lot like the monobook way brion [17:22:43] based on the use cases for its design, it should be realllllllll easy to do from js [17:23:45] WikiEditor has excelent hooks imho, but requires a lot of variables to be set. I'd say if you need to add more than 2 buttons and only to the main bar (with Bold and Italic) copy my function ;-) [17:24:07] It seems to lack the ability to 'replace' a button [17:24:12] or have a good callback for when its "ready" [17:24:41] http://meta.wikimedia.org/wiki/User:Krinkle/Scripts/insertVectorButtons.js [17:24:57] I think 'adding' with an existing id overwrites it [17:25:04] not sure though [17:25:08] and rebuilds? [17:25:16] or how is timing handled? [17:25:46] well will revisit in a few days as I get to porting the Add media wizard over to RL_1_17 [17:26:17] ok wtf, how do I get fileinfo to recognize djvu files... [17:26:19] I would not recommend copying my exact function, just the basic thing of having a template object var wikiOptions. And setting the arguments from the function call in it and then calling the wikiEditor('addToToolbar' hook [17:27:01] Krinkle: how is time handled? [17:27:19] I'm not sure I follow mdale [17:27:43] does 'addToToolbar' rebuild the toolbar? [17:28:03] I dont think it rebuild everything, it adds what it's told to do [17:28:14] right away [17:28:40] oky.. ic .. its simpler case since your not replacing things [17:29:01] but what if you call it before its ready? [17:29:13] hehe [17:29:14] Krinkle, thanks [17:29:15] basically i want an 'insert drawing' button that triggers the SVG editor, then inserts a [[File:blah.svg]] when done [17:29:15] it's gonna be awesome :D [17:29:32] brion: that sounds cool ;) [17:29:38] you adding in svg-edit ? [17:29:59] http://toolserver.org/~krinkle/tmp/scrn_s102.png [17:30:00] yeah [17:30:10] i made a bunch of updates to the ext lately [17:30:16] that's where the buttons go [17:37:35] yummy buttons [17:38:55] yeah some of the buttons in that screenshot probably mean nothing to you :P - I which there was a way to just put text in there [17:39:14] I dont wanna be photoshopping a button for every snippet I wanna insert [17:39:23] *Krinkle picks yet another random image from Commons. [17:39:41] wish* [17:41:05] brion: Although the code you see in my gadget probably is enough to do what you need right now. If you wanna know why it is that way or what else there is, this is the page I meant: http://usability.wikimedia.org/wiki/Toolbar_customization [17:41:19] spiff [17:42:53] right [17:43:43] it's pretty advanced. I've seen some wikis that have switched to Vector early themselfs create some pretty cool stuff already with callbacks and auto-summaries and what not. [17:44:51] nice [17:45:07] Ah I see you found that page already :P (@ bugzilla) [17:49:42] Grmpf.. I can't add a note on usabilitywiki page about it being moved. The wiki is closed :P [17:49:59] Krinkle, I can, as a steward. [17:50:13] I was going to create 1 template and add it to (for now) 4 pages [17:50:15] If you tell me what needs to be done. [17:50:27] http://meta.wikimedia.org/wiki/Template:MovedToMediaWiki [17:51:10] wait, why would we want to add that? [17:51:19] {{MovedToMediaWiki|Extension:WikiEditor/Toolbar_customization}} [17:51:34] and for Talk, /Library and Talk:/Library [17:52:13] But since it's closed there's no need to do it [17:52:31] heh [17:52:42] right [17:55:54] Although a clean up of that wiki would make it easier (deleting orphan pages. And transwikied pages perhaps deleted with a comment containing an interwiki link) [17:56:24] guillom: Is that alright ? Deleting http://usability.wikimedia.org/wiki/Toolbar_customization with reason: [[mw:Extension:WikiEditor/Toolbar_customization]] for example ? [17:57:08] or stuff like: http://usability.wikimedia.org/w/index.php?title=A_bug_n_recent_changes_(2)&action=history [17:57:27] Krinkle, I don't know... Generally I'd prefer to avoid editing the wiki, since it's closed, so very few people can edit it. I'd prefer to just import what we need and forget the rest :) [17:58:18] k [20:04:23] TrevorParscal: in LoaderFileModule why does readStyleFile just use "getRemotePath()" while getScript uses $wgServer . getRemotePath() ... this makes it impossible to have css point to assets if the script is included from any page outside of the root path of the resource loader. In other words it inserts the css into the document assuming the document is in the same path as the loader [20:04:59] well, sounds inconsistent [20:05:20] small diff [20:05:22] diff [20:05:33] but I don't think i did that part actually, is Roan around? [20:05:39] no... :(