[08:20:22] Hello, [08:20:22] I have a Question, [08:20:22] I am using MediaWiki 1.16.4 with the Semantic extension. As skin i have chosen to use the OntoSkin3 template. It is a fine skin except for the fact, that when rendering a large piece of content, it sets a height for the id="content" div. Because of that, my content area shows a scrollbar, next to the scrollbar of my browser. I want to remove the functionality that creates that height. [08:20:22] I have discoverd that the function that is responsible for rendering that part of the page is called "$this->html('bodytext')". Does anyone know where to find the PHP page where this function is defined? [10:31:47] hi guys, we have to upgrade on mediawiki install to 1.17. the wiki uses lots of javascripts and many of them are not loaded. I've read something about depricated js functions and the ResourceLoader. The globnal variables such as mw, mediaWiki and stylePath are not loaded as well. Is there a way how can I enable the JavaSript? [10:36:18] chombium: you may like to ask on #mediawiki where is much more people [10:36:28] tx [13:13:13] hexmode: I am changing the default assignee in bugzilla for MediaWiki > Unitests components [13:21:23] hashar: to you? Excellent! [13:21:29] yup [13:21:44] this way people would know whom to ask :D [13:33:22] surrur [18:34:06] form is at index.php/Special:GlobalCollectGateway?form_name=TwoStepAmount [18:34:07] donationinterface.php Line 119 [18:34:19] extensions/DonationInterface/globalcollect_gateway/forms/TwoStepAmount.php [18:34:19] line 57-59 [18:34:28] aight [18:36:31] well shucks im not seeing anything obvious [18:37:55] the js is actually loading for me, but I think the scope is off when the stuff is being loaded thru ResourceLoader [18:37:57] localBasePath: /www/sites/localhost/wikimedia-fundraising-1.17.localhost.wikimedia.org/extensions/DonationInterface/globalcollect_gateway/modules [18:38:08] remoteExtPath: DonationInterface/globalcollect_gateway/modules [18:38:24] anything wrong with those? [18:38:34] don't think so [18:38:47] localBasePath exists [18:38:56] it only has the js folder [18:39:56] kaldari: you have the script loading via RL? [18:40:18] yes, I have it definitely loading, but it isn't working due to scope [18:40:38] ahha [18:40:46] how can you that it is loading? [18:41:05] i know the dependencies: ext.donationInterface.errorMessages [18:41:08] I added alert("Hello"); as the first line of validate.js :) [18:41:13] work, because [18:41:24] ok [18:41:26] :) [18:41:39] try that and if you get the hello [18:41:48] see if [18:42:03] it would not have anything to do with using $ vs jQuery? [18:42:14] nah [18:42:34] it's because ResourceLoader changes the scope of everything it loads [18:42:49] at least I'm assuming it's that [18:43:05] I still haven't isolated the actual failure [18:43:10] but I have the js loading now [18:43:12] maybe it is because it gets loaded at the bottom [18:43:16] i need to wrap [18:43:39] validateForm in a document.ready [18:43:54] will test real quicj [18:43:56] quick [18:44:30] you can also tell if it's getting loaded by looking at the resources that get loaded in firebug [18:44:56] yeah, you'll also need to put all the js functions within an object called by jQuery or else explicitily scope them to window scope [18:44:57] does not show in firebug for me [18:45:04] even if debug=false mode, you can look at the Net->JS tab in firebug [18:45:15] oh right, that tab [18:45:16] you'll see a resource loaded that looks like this: [18:45:17] http://localhost/payments_117/load.php?debug=false&lang=en&modules=ext!donationInterface!errorMessages%7Cgc!form!core!validate%7Cjquery!checkboxShiftClick%7Cjquery!placeholder%7Cmediawiki!language%7Cmediawiki!legacy!ajax%7Cmediawiki!legacy!wikibits%7Cmediawiki!util%7Cpfp!core!logolink_override&skin=vector&version=20111027T184355Z [18:45:29] i was looking at the wrong spot [18:45:36] there may be 2 separate issues if you're not getting the "Hello" [18:45:37] look at what's in the string for the modules param [18:45:44] i go the hello [18:45:47] cool [18:45:50] from validate.js [18:45:58] you can see 'gc!form!core!validate' [18:46:07] i was seeing that [18:46:20] and my dependencies were always being loaded [18:46:30] regardless of how the js is loaded [18:46:51] So, for example, you'll want to change "function validateElementState( options ) {" to... [18:47:18] window.validateElementState = function( options ) { [18:47:34] ok, I will do a find and replace real quick [18:50:14] window.validateForm = function( options ) { [18:50:20] still does not make it work [18:50:47] Error: validateForm is not defined [18:50:47] Source File: http://wikimedia-fundraising-1.17.localhost.wikimedia.org/index.php/Special:GlobalCollectGateway?form_name=TwoStepAmount [18:50:48] Line: 34 [18:51:07] i always get that with using 'scripts' [18:51:17] $wgOut->addHeadItem() [18:51:26] does not cause a problem [18:51:52] that's weird validate form should be defined if you set it to window [18:52:10] I'll see if I can get it working... [18:52:16] cool [18:53:13] comment out the other validators on line 525-564 [18:53:23] just enable one like validateElementFirstName( options ); [18:53:31] to make testing easier :) [18:54:10] thanks [18:55:59] also, you don't need to wrap that stuff in $().ready(function() {" [18:56:04] since it's in a function [18:59:04] right :) [19:00:57] ok, I see the problem [19:01:10] You're right that it has to do with it not loading in the head [19:01:51] for me, it's breaking due to... [19:01:54] $js = "\n" . '' . "\n"; [19:02:01] in TwoStepAmount.php [19:02:46] why do you do a validate right when the form loads? Is that necessary? [19:03:28] if so we'll need to set 'position' => 'top' in the module definition [19:03:47] jpostlethwaite: ^ [19:03:49] it does not validate until after the form is submitted [19:04:00] it attaches a listener for submit [19:04:11] see line 59 in TwoStepAmount.php [19:04:52] right, that is calling validateForm() from validate.js [19:04:57] ok, I see what you're trying to do [19:05:52] the problem is that this line is trying to call validateForm() immediately, before the module has even loaded... [19:06:00] right [19:06:13] we could move that to the bottom? [19:06:24] what you really want to do is have that call made from within a $().ready(function() { inside one of the js files [19:06:26] that is why i was wanting to wrap that [19:06:39] i think you are right [19:06:54] i will just declare the form validate options on the page [19:06:59] they will get picked up [19:07:06] that seems pretty simple [19:07:12] what does validateForm() actually do? Does that set up the validation rules or actually validate the form? [19:07:24] i can code that up pretty quickly [19:07:35] $("#" + options.formId).validate(); [19:07:41] that is the critical peice [19:07:45] piece [19:08:11] that attaches the listener to the on submit handler [19:08:17] onsubmit [19:08:50] that is how jquery.validate.js does validation [19:08:57] so what you should do is replace "window.validateForm = function ( options ) {" with "$().ready(function() {" [19:09:07] right [19:09:14] and then replace the "}" at the end with "}); [19:09:15] " [19:09:17] i think that is perfectly sage [19:09:20] safe [19:09:33] will do that now [19:09:41] and delete line 59 from TwoStepAmount.php [19:10:44] actually I may be wrong still... [19:12:50] is validateForm() purely just to initialize everything? [19:13:18] if so, my advice is right. But if not, we may need to rearrange some more. [19:14:44] Question about line 423 in validate.js... [19:14:46] $("#" + options.formId).validate(); [19:15:20] are you meaning to actually call the validate function here or just attach it to the form submission action? [19:17:09] it works [19:17:12] thanks [19:17:13] yay! [19:17:31] i will commit shortly, but first i will double check i am not full of it [19:17:45] :) [19:17:54] If you ever do need to force the module to be loaded in the head, you can do that, but in this case it isn't really necessary. [19:20:18] it will actually be a few minutes before i commit. It is working properly. I did not wrap any functions with window.somefunction = function( options ) [19:20:47] i just have to fix a few things in TwoStepAmount [19:22:21] jpostlethwaite: I guess that makes sense, since all the functions are being called from the same file [19:23:11] Also, you can get rid of any "$().ready(function() {" you have within a function, since it's redundant. [19:23:29] as they are all called from within the final ().ready(function() { [19:26:01] correct [20:41:22] Ryan_Lane: do we care about Open Compute Project or Open Data Center Alliance? I am reading http://arstechnica.com/business/news/2011/10/facebook-friends-open-source-hardware-for-data-centers.ars [20:41:46] was it you that forwarded me that email from them? [20:41:53] no! not that I recall [20:41:59] I got some email from them... [20:42:00] lol, pentium 4 [20:42:22] Yay, webscale data centres [20:42:52] ah. it was danese [20:43:11] The other Sumana [20:43:57] I'd never heard the phrase "vanity free" wrt servers before [20:44:50] sumanah: well, we don't really have any plans to use open compute [20:45:03] open source hardware doesn't really help us much, since we can't modify it [20:45:16] ok [20:45:24] it would also mean we wouldn't have support [20:45:31] which means no replacement parts, etc [20:45:38] no one to call if there is a serious issue [20:45:42] surprised at "open source hardware doesn't really help us much, since we can't modify it" [20:45:51] that is counterintuitive to me [20:46:02] just cause it's open source doesn't mean we can modify it [20:46:03] sure, we can change the design [20:46:08] but how do we produce them? [20:46:11] aha [20:46:20] we don't have the money, or the facilities needed to do so [20:46:27] I misunderstood your "can't" there [20:46:27] hell, really we don't have the people [20:46:28] ok [20:46:33] none of us are hardware people [20:46:37] also misunderstood "modify" [20:46:46] Want a soldering iron? [20:46:53] like the difference between genetic engineering & retroviral therapy [20:47:05] I meant the actual process of doing it, not the legal rights to do so :) [20:47:50] I like the concept behind it, but we are too small and poor to use it [20:47:56] ok. should we be in this alliance of data centers? [20:48:38] I dunno [20:50:28] I'm not sure if this applies to us much [20:50:34] sumanah: I'd talk to mark about it [20:50:59] ok [20:51:12] I have no skin in any game here, just wanted to bring it to ops's attention [21:44:30] Anybody know what this means: [21:44:31] {"servedby":"test-payments","error":{"code":"readapidenied","info":"You need read permission to use this module"}} [21:44:44] it worked a minute ago [21:44:55] still logged in? [21:45:12] I'm not logged in [21:45:41] but I shouldn't need to be for this API [21:46:39] I'll try it again while logged in [21:47:13] worked that time [21:48:10] yeah, if I log out it doesn't work [21:48:34] guess I need to read about read permissions for API [21:49:58] Read perms are required by deafult [21:50:11] If this is a custom module and it's intended to be usable without read perms, it should explicitly indicate this [21:50:15] See ApiLogin for example [21:52:59] RoanKattouw: Could you elaborate? How do I indicate it exactly? [21:53:22] public function isReadMode() { [21:53:23] return false; [21:53:25] } [21:53:26] In the API module class [21:53:35] ah [22:02:05] RoanKattouw: I tried override the function locally with return true, but that didn't fix it. Is there more I need to do? [22:02:18] That should have worked [22:02:21] hmm [22:02:23] Revision #? [22:02:25] Oh, locally [22:02:45] http://www.mediawiki.org/wiki/Special:Code/MediaWiki/101071 [22:02:50] no on test-payments [22:02:59] which I updated with that rev [22:03:12] return false, my friend [22:03:32] I read that novel [22:03:51] Jonathan Lethem's "Return False, My Friend" [22:03:52] *sumanah returns to writing NOLA writeup [22:04:24] ah [22:05:52] Yay! That works! [22:06:04] RoanKattouw: Thank you