[03:15:58] Is the reason for requiring (in api.php?action=edit) section=new, prependtext, or appendtext with redirect-following mode just trying to be helpful, or is there an actual server-side reason? [03:21:00] https://phabricator.wikimedia.org/T26330 "we should enforce the requirement that the action is append or prepend. Otherwise, this looks like an extremely useful way to destroy data." [03:21:27] Anybody here? I need some help [03:21:59] Guest62: what do you need help with? [03:22:24] enterprisey: also https://gerrit.wikimedia.org/r/c/mediawiki/core/+/133955/4#message-7aa817a8e2dfd34ebd38a24146d0bab8c253d75e suggests that this was a real problem until the guard was put in :| [03:22:36] I'm a zhwiki user, and I'm working on a gadget which allows user to select a variant to show preview with [03:22:44] legoktm: yeah, that's sort of what I was thinking [03:23:00] However, there isn't an easy solution for live preview feature [03:23:57] After seeing its code at https://phabricator.wikimedia.org/source/mediawiki/browse/master/resources/src/mediawiki.action/mediawiki.action.edit.preview.js, I cannot find a easy way to modify that post request using user selected variant [03:24:55] mw.config.set( 'wgUserLanguage', myVariant ) seems to work but it's a dirty hack in my opinion [03:25:14] legoktm[m]: Please see above [03:25:28] yeah, I'm looking at the live preview code right now [03:27:24] I looked through all the tickets listed onhttps://phabricator.wikimedia.org/T41272 and don't see anything about variants, so I think you probably want to file a new bug about it [03:28:29] Probably. The best way I can think of is to do some modification on live preview code [03:28:50] Such as specifying variant on wikis which support variants [03:29:04] and then mw.config.set( 'wgUserVariant', myVariant ) [03:30:01] And I'd also like to modify DOM when live preview succeeds [03:30:46] Can I create a new task to request for more mw.hook ? Will they accept? [03:30:48] aha, it seems the API action=parse has a hidden/undocumented variant= parameter, see https://phabricator.wikimedia.org/T117549 [03:31:05] Yes, and I've noticed that [03:31:30] I don't know if a new mw.hook would be accepted, I don't work on the live preview code [03:31:47] but it can't really hurt to ask if you explain your use case [03:32:18] I see [03:32:32] and thank you for your answer [03:52:09] @legoktm: would you happen to feel comfortable merging https://gerrit.wikimedia.org/r/c/mediawiki/extensions/PageDisqus/+/698351 and a backport if I do it? Only asking because it's been a year since any real updates to that extension, and it is causing fatal anytime going to api.php [03:54:20] Universal_Omega well it looks like you made other, unrelated changes in that patch? [03:54:32] also I'd have a lot more confidence if CI was passing [03:54:53] setting a dummy value for that $wg global if $wgWikimediaJenkinsCI (or something like that) would fix it I think [03:55:55] legoktm[m]: yeah, that was my failed attempt at getting CI to work but it doesn't still because of wfWarn still there. I will do that then. [04:05:56] legoktm[m]: CI passed now. [04:38:49] (not a question) I am converting my custom skin from SkinTemplate to SkinMustache, SkinMustache has a lot of predefined templateData and it's cool. I am replacing my custom-defined templateData with predefined ones and it will make the code of my skin shorter and more manageable. [16:03:11] hey guys! is it possible to set a mw.config variable (such as wgRelevantUserName) through a client-side JS? [16:18:32] dopanic mw.config.set? [16:20:26] oh, that worked! thanks :D [16:20:37] * dopanic feels stupid now [16:33:37] dopanic: if you look at https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw it says that mw.config is of type mw.Map and https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.Map documents the exists/get/set methods :) [16:34:15] ahhhh, ty for the links :) [16:34:24] I'll know where to look the next time [16:35:04] :D [19:09:04] @legoktm: don't know if you saw my previous comment but https://gerrit.wikimedia.org/r/c/mediawiki/extensions/PageDisqus/+/698351 now has CI passing so was wondering if you could take another look? (I'm only asking because of the current fatals it gives, otherwise I would be asking so soon) thanks! I made unrelated change just to match up with the other place where it uses wfWarn instead of exception. And a fatal wasn't needed [19:09:04] there.