[00:17:38] jeblad, I've fixed it. [00:18:34] Thanks! :) [09:08:47] g'morning humans [09:09:14] Reedy, jetbrain licences are for all ide's? pycharm is included? [09:19:47] Alchimista: https://lists.wikimedia.org/pipermail/wikitech-l/2016-April/085332.html [09:33:37] thanks andre__ , seems to be included. do you know if the licence shows up for all, or if i must contact someone? [10:22:39] Alchimista: I know nothing, sorry. [10:23:43] thanks anyway, i've emailed yuri :D [14:40:04] Anyone around who's knows their basics of Git and rebasing? https://www.mediawiki.org/wiki/Gerrit/Tutorial#Squash_several_commits_into_one_single_commit_via_rebase welcomes some help. [14:40:30] There are two sentences on that page which feel contradictive to me: "It is important to leave the Change-Id for each commit in the message, otherwise Gerrit will not know how to handle the patch." and [14:40:34] "In regards to which Change-Id you want to use, squashing a commit into an existing commit (one that's already in Gerrit), you need to pick the Change-Id that belongs to the one you meant to submit a new patchset for (the surviving commit). If your commits are new and are not in Gerrit, it does not matter which Change-Id you choose." [14:40:58] If anyone knows better and if there's something to correct, please edit https://www.mediawiki.org/wiki/Gerrit/Tutorial#Squash_several_commits_into_one_single_commit_via_rebase - thanks in advance! [14:41:04] The second one is correct [14:41:58] at least I think having multiple change-ids would not work [14:42:01] never actually tried it [14:46:20] hmm [14:47:18] in extension.json, I have hooked several hooks with functions from my handler extension [14:47:33] however, they seem to run on every filetype, not just the type i am interested in [14:48:29] "Hooks": { "ImageOpenShowImageInlineBefore": [ "TypeHandler::onImageOpenShowImageInlineBefore" ], [14:48:51] yeah, that would run every time someone views an image page [14:49:27] whats the way to fix it [14:49:51] my idea was that my handler extension was only loaded when its of a certain type [14:50:23] if ( $imagePage->displayImg->getMimeType() === 'image/' ) [14:50:35] where $imagePage is the first argument given to your hook [14:50:52] or actually no [14:50:54] that won't work [14:52:25] since displayImg is private [14:52:29] yeah but [14:52:33] thats a good idea actually [14:52:52] to change the bodu.php file and leave hooks as is [14:53:03] really most of the per-image type stuff should be in the MediaHandler subclass, and not from the ImageOpenShowImageInlineBefore hook [14:53:42] well its not an image actually [14:55:43] what do you mean displayimage is private? [14:55:46] $full_url = $imagepage->getDisplayedFile()->getFullURL(); [14:55:54] that way getting the url works [14:56:20] ah, i misread, displayimg is private [14:59:31] Oh, I totally didn't see that method [15:00:29] yeah, jus ttested, Call to a member function getMimeType() on a non-object (null) Backtrace: [15:00:55] $imagepage->getDisplayedFile()->getMimeType() should work [15:01:37] unless there is no image, then $imagepage->getDisplayedFile() might be false [15:02:08] Call to a member function getDisplayedFile() on a non-object (null) [15:02:35] well that probably means that $imagepage has a typo in it [15:02:46] is there a [15:02:49] or the first argument to the hook was named something else [15:03:14] anyway [15:03:18] is there a page somewhere [15:03:37] that just contains full_volume audio of "YOU ARE STUPID!"? [15:03:50] id like to put this on repeat [15:04:21] You know, phabricator has a feature where you can make things do auto-playing repeat audio [15:04:35] or at least it used to [15:04:55] if you wrote the word seal on a line by itself, it used to make seal noises [15:05:18] LOL [15:05:31] look what happens when people have too much free time [15:06:16] I want to try it :( how long ago did it work? [15:06:59] serious tho, can i get mime type in a similar way in onbeforepagedisplay hook [15:07:00] last time I tried I think was a year ago [15:07:14] cause its parameter is outputpage, not imagepage necessarily [15:09:19] Harri: Maybe you could do $out->getWikiPage()->getFile() [15:09:37] CoolCanuck: I think i last tried like a year ago [15:10:21] CoolCanuck: Tested right now. still works (You can even do it in a preview so not to make a real comment) [15:10:29] OMG [15:10:38] what site is this under? [15:10:56] https://phabricator.wikimedia.org [15:11:19] (Please only test in preview, I don't want to be responsible for spamming seal sounds on random bugs) [15:12:42] not owrking for me xD [15:13:19] https://phab.wmfusercontent.org/file/data/wyugt2amcwnt32w35ult/PHID-FILE-e5nmjq2xrzg6fmons77u/2048px-Mirounga_leonina.jpg [15:13:21] LOL [15:13:31] wait a second [15:13:40] is it capturing our keylogs?! [15:14:00] image shameless stolen from commons (Without crediting the original author!) [15:15:16] ooohhh.. Not good [15:15:20] also there MUST be others ;) [15:15:34] Imma find the trigger words [15:15:42] bawolff: i cant really, because onbeforepagedisplay runs on every page [15:16:00] CoolCanuck: oh you can make your own trigger words [15:16:05] one of the stupider features [15:16:08] O_O [15:16:16] I made the seal thing to prove a point about how stupid an idea that feature is [15:16:17] that's very stupid [15:16:19] for example, Call to undefined method WikiPage::getFile() comes on main page [15:17:48] Harri: Yeah, you'd need to do checks like $out->canUseWikiPage() && $out->getWikiPage() instanceof ImagePage [15:17:53] or something [15:18:01] tried to do it with isset, but it didnt wqork [15:19:05] that eunexpected T_VARIABLE tho [15:19:21] if ($out->canUseWikiPage() && $out->getWikiPage() instanceof ImagePage $out->getWikiPage()->getFile()->getMimeType() === [15:20:05] If you really want to be paranoid, you can also check $out->getWikiPage()->getFile() instanceof File [15:20:37] I'm not sure what you're doing, but honestly, it sounds like there should be a better hook for it then this one [15:21:01] yeah, i am loading a module from my extension [15:21:05] in onbeforepagedisplay [15:21:23] so that a script from the module can be called in imageopenshowinlinebefore [15:21:32] Hmm, TimedMediaHandler uses an OuputHook to do that [15:21:43] which sort of doesn't really work that great either [15:22:03] There's a bug somewhere about how there is no good interface for media files to add scripts [15:22:25] Some people have also suggested the idea, of totally loading complex formats in an iframe, and handling all the scripts that way [15:25:38] .... not the best idea. lol [15:25:49] iframes are for content.. not for scripts :P [15:27:35] alternatively, i could just let the code as is and load the module on every page [15:27:58] it is not perfect and a waste of resources, but at least its something ican fall back on [15:28:45] CoolCanuck: Well if you load the video + javascript in an iframe, you can separate the security context (if its loaded cross-origin), so then you get a security win that if there's something wrong with the video javascript, it can't compromise the rest of your site [15:28:59] :| [15:29:10] Load the video in