[12:14:50] any hints how to get javascript loaded on specialpage using extension.json Resources? [12:15:13] I have it there listed but it just doesn't get loaded. [12:17:32] Tuju: how have you declared them on extension.json? [12:18:40] Majavah: something like this [12:18:41] "ResourceModules": { [12:18:43] "ext.CSCAuthentication": { [12:18:44] "packageFiles": [ [12:18:46] "js/ext.CSCAuthenticationRequest.js" [12:18:47] ] [12:18:49] } [12:18:50] }, [12:18:52] grrr [12:18:53] https://pastebin.com/piFABrsa [12:18:56] don't paste here, the network might kick you [12:19:09] i know, that damn middle button paste didn't work. [12:20:05] in that case you should be able to just use $this->getOutput()->addModules( 'ext.CSCAuthentication' ); on your special pages execute() method [12:20:52] Is that CSC as in CSC.fi [12:20:57] Problem is that given page is AuthManager's AuthenticationRequest page and for some reason $this->getOutput() crashes there. [12:21:14] Nemo_bis: nope, it's client side certificate. [12:22:20] hmmm... maybe i should try to run it in primaryAuthManager class as it is actually the one that creates that Request. [12:23:03] well, primary Provider [12:23:48] Tuju: use the AuthChangeFormField hook [12:25:12] tgr_: hmm.... can i use that to inject js into that from page? [12:27:01] https://www.mediawiki.org/wiki/Manual:Hooks/AuthChangeFormFields [12:28:22] tgr_: since we last talked, I managed to get most stuff working. Session is activated with one apache url just fine when i load it. And it returns json about authentication details. Now i need to bind those buttons to call it background. [12:31:02] the nice approach would be to define your own form field class and set it in that hook, like e.g. recaptcha/hcaptcha do in ConfirmEdit. But you can get away with just adding via ReuqestContext::getMain, too. [12:32:41] GoogleLogin is maybe a closer example: [12:32:48] https://gerrit.wikimedia.org/g/mediawiki/extensions/GoogleLogin/+/39034829b71f863e4ca3a3df5028276e4c5120ec/includes/GoogleLoginHooks.php#94 [12:32:52] https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/GoogleLogin/+/refs/heads/master/includes/HtmlForm/HTMLGoogleLoginButtonField.php [12:33:08] tgr_: I've been reading those GL sources a lot. It's very complex thing. [12:33:53] learned a lot from it but still have a lot of that i don't understand in it. :) [12:42:06] tgr_: I understood, that those Hooks are existing call-points in mediawiki core code. I found some of those yesterday and tried to get it run. [12:43:04] AuthChangeFormFields specifically is responsible for adding complex behavior to authentication-related special pages [12:43:34] the basic idea is that there is equivalence between the auth special pages and the auth web APIs [12:44:26] so when you define an AuthenticationProvider + some AuthenticationRequests, that will automatically create a bunch of API fields and a bunch of equivalent simple form fields [12:45:32] if you want to make the form more elegant without fundamentally changing its functionality, you can manipulate the form descriptor in AuthChangeFormFields [12:46:46] okay, that's then the place where i need to modify it. [12:46:51] MediaWiki has a HtmlForm class, the form descriptor is an array representation of a HtmlForm object. In practice it's mostly a list of form fields which consist of a class name + constructor arguments. [12:47:22] yes, i read about that in doc page. I just need to learn how to modify it. [12:47:46] the form field objects do the HTML rendering for the form elements, which is the logical place for injecting Javascript. [12:48:25] or you can do it like here: [12:48:28] https://gerrit.wikimedia.org/g/mediawiki/extensions/GrowthExperiments/+/476824b9f7a6feea119ff76aad7ee84387043725/includes/ConfirmEmailHooks.php#45 [12:48:42] not elegant, but it works [12:49:18] okay, that looks something that i understand. [13:05:05] yep, now my hooks are running: "[authentication] AuthChangeFormFields started." [13:05:50] should that resource js be loaded separately or is it baked inside the one script that is always loaded? [13:10:42] Hi, there seems to be an issue with the visual editor in 1.35.1. The request to rest.php/example.com/v3/transform/html/to/wikitext/Main_Page/1 seems to time out which breaks saving in the editor. This happens with the docker image and a native install. Any idea? [13:12:29] I tried several configs and had no luck [13:13:26] tgr_: https://pastebin.com/ux79Ybji now i get the one button element. [20:07:23] odd that i don't get any error for that addModules(); it doesn't load anything so it probably wont work. but typically I get page all red when something is wrong. [20:38:02] is specialManage some generic term or just GoogleLogin thing? [22:37:22] finally, it all works(); [22:37:37] tgr|away: thanks a lot for your help. [22:37:57] you even helped when away, I read your comments from stackoverflow. :) [22:41:30] cool! [22:41:50] SpecialManage is probably GoogleLogin-specific