User talk:Grunny

Welcome
Hi, welcome to Wikia Developers Wiki! Thanks for your edit to the List of Bot frameworks page.

Please leave a message on my talk page if I can help with anything! -- Uberfuzzy (Talk) 14:41, September 23, 2009

Spanish
Hi, I'm a spanish user of Wikia. Dev wiki has a lot of functions, but all they are English. I want to traslate the functions to the spanish. Can I do it here?.--Ivancillo http://images2.wikia.nocookie.net/amiguetes/es/images/9/9e/SP.png 15:18, March 29, 2010 (UTC)

fastdelete
Hi, I have been having some issues with the fastdelete tool as on talk pages as it is adding a line think this could be corrected? also the buttom is not showing on the user, user talk, blog and category namespaces. Aside from that when editing it does not appear. --Cizagna (Discusión) • Helper • Central hispana 04:32, 06 November 2010 (UTC)

 Brought from User_talk:Cizagna Hi. I've moved the buttons on talk pages so they don't cause a line break, and I've added them on user, user talk, blog and category. As for when editing pages, the issue is, the code checks if there is a delete button on the page already to make sure the user is allowed to delete, and currently there are no delete buttons in the edit view. Adding them there would mean people would have delete buttons appearing when editing on wikis where they do not have the rights to delete, so it would be adding functionality which they may not expect/like. I could create a second code page for staff/helper/vstf and those who don't mind having delete buttons on every wiki regardless that puts the fast delete buttons while editing and on diff pages as well. Let me know if you think any of the buttons would be better placed elsewhere :). Cheers, Grunny  ( talk ) 10:10, November 6, 2010 (UTC)

End of Quote User_talk:Cizagna

Awsome, I saw your changes and thought maybe you could use a switch that would save a couple of bytes. Also I think you could simplify all those repetitive links codes into a variable. If I did properly my code, it should look like this: afd = ''+ fdButtons[i].label + '' Switch (wgNamespaceNumber) { case '1': case '5': case '7': case '9': case '11': case '13': case '14': case '15': case '111': case '401': $('header.WikiaPageHeader > h2').before(afd); case '2': case '3': $('div.WikiaUserPagesHeader > ul.wikia-avatar').after(afd); case '500': case '502': $('div.WikiaUserPagesHeader > h1').after(afd); default: $('header.WikiaPageHeader > details').before(afd); } Hope this helps, thank you very much --Cizagna (Discusión) • Helper • Central hispana 20:29, 06 November 2010 (UTC)
 * Good idea. I've implemented this :). Cheers, Grunny  ( talk ) 01:03, November 7, 2010 (UTC)

Oasis Toolbar Buttons
Thanks for fixing that, it isn't a huge problem but it can really confuse people. :) --Anon talk 00:18, January 4, 2011 (UTC)
 * Thanks for taking care of this while I was away :) -- Porter21 (talk) 19:34, January 11, 2011 (UTC)
 * No problem :). Grunny  ( talk ) 07:57, January 12, 2011 (UTC)

AJAX RC
Hi Grunny, since you were able to fix The auto refresh last time i was wondering if you could find out why its not compatible with recent chanes on wikis that use the admin dashboard. Thanks,  Kangaroopowah -Briefing Room   05:00, August 1, 2011 (UTC)


 * I just checked, and it does work on wikis with the AdminDashboard. Can you link to a wiki where it doesn't? ~ Monchoman45 ( Talk  |  Contribs  |  Central ) 13:56, August 8, 2011 (UTC)


 * Quick fix for admindashboard has been implemented as it has now been pushed sitewide. Cheers, grunny  :&#126;$ 01:04, August 5, 2011 (UTC)

Monobook
What would I have to do to view AJAX RC in monobook. Thanks,  Kangaroopowah -Briefing Room   19:38, August 25, 2011 (UTC)
 * AjaxRC should work fine in monobook. You'd just have to put the import into either your global.js or your /monobook.js on any wiki. Cheers, grunny  :&#126;$ 00:06, August 26, 2011 (UTC)
 * Its in my global but I dont see it in monobook. I can give you a screenshot if you want.  Kangaroopowah -Briefing Room   00:08, August 26, 2011 (UTC)
 * Check your error console while viewing the RCs in monobook. It's possible there is JS specific to the Wikia skin that breaks in monobook. If so, you should put checks in that JS for which skin you are using. Cheers, grunny  :&#126;$ 00:12, August 26, 2011 (UTC)
 * It said it can't call method 'Index of' of undefined. What does that mean?  Kangaroopowah -Briefing Room   00:19, August 26, 2011 (UTC)
 * It's likely what I said above about Wikia skin specific JS. It is happening because indexOf is being called on an object that it can't find. Cheers, grunny  :&#126;$ 00:34, August 26, 2011 (UTC)
 * It's likely what I said above about Wikia skin specific JS. It is happening because indexOf is being called on an object that it can't find. Cheers, grunny  :&#126;$ 00:34, August 26, 2011 (UTC)

ShowHide localization
Jrooksjr stumbled upon an issue with Dantman's i18n function when trying to add a translation for a language code with a dash in it. As you probably know, dashes are not permitted in JS variable names, so the script threw an error and ceased working. In order to fix this, I've altered the function like this:

I.e. it's replacing dashes with underscores in the language variables. You might know a better way to address this, but I thought I'd make you aware so the localization of ShowHide can be fixed (since I can't edit it). I'll patch up the other scripts using that function. -- Porter21 (talk) 11:33, November 23, 2011 (UTC)


 * It would be a lot simpler to leave it as is and when languages with a dash in them are added, they should use quotes, i.e. . In objects, keys are strings, but when they are a valid variable name, the quotes can be dropped. In this case, as it is not a valid variable name, just use quotes around it. :) Cheers,  grunny  :&#126;$ 12:10, November 23, 2011 (UTC)


 * Right. Guess that's what you get when you work on script stuff in the early morning... :P -- Porter21 (talk) 13:48, November 23, 2011 (UTC)

Page protection
Thanks for protecting the PurgeButton and EditIntro code pages. Great idea! — Spike  Toronto  04:12, February 14, 2012 (UTC)
 * No problem :). grunny  :&#126;$ 04:13, February 14, 2012 (UTC)

Re: New Protection Level
Sorry for the dumb question but I'm a noob: The codeeditor permission means that I will continue to be able to edit the code I added but that third parties would have to either ask me to add their patches or request the codeeditor permission from you or me? Is that correct? If so, then sign me up please! (Not that my code has high traffic - what with being brandnew and all - but better safe than sorry. :) -- Pecoes 18:14, February 24, 2012 (UTC)
 * Yep, basically it will mean that only people with the codeeditor permission will be able to edit it, which will be kept to only those that are maintaining code, and have demonstrated they won't break anything :P. I've given you the right and protected your code page. I hope that helps. :) Cheers, grunny  :&#126;$ 18:19, February 24, 2012 (UTC)


 * Thanks :) -- Pecoes 18:23, February 24, 2012 (UTC)
 * Just a quick comment. Could you switch the description for coeditor on Special:Listgrouprights to something more descriptive? THanks, -- Kangaroopowah  ( Talk ) 03:48, February 26, 2012 (UTC)


 * How about: "Edit protected JS and CSS pages"? -- Pecoes 07:09, February 26, 2012 (UTC)


 * Done. Cheers, grunny  :&#126;$ 10:57, February 26, 2012 (UTC)
 * Thanks, -- Kangaroopowah  ( Talk ) 21:26, February 26, 2012 (UTC)

Two more please: Pecoes 02:51, March 13, 2012 (UTC)
 * 1) Sine/code.js
 * 2) FixWantedFiles/code.js
 * Actually, can you wait on sine. I have some config fixes I want to push. Thanks --  Kangaroopowah  ( Talk ) 03:28, March 13, 2012 (UTC)


 * If you want to edit Sine you might want to wait a little. I'm currently rewriting the whole thing from scratch because it's such an ugly mess of spaghetti code. -- Pecoes 04:05, March 13, 2012 (UTC)


 * I've protected the WantedFiles code page, do you still want the Sine code page protected or did you want to wait a while? Cheers, grunny  :&#126;$ 14:34, March 13, 2012 (UTC)

fd
Hi Grunny,

I recently saw you rewrote AjaxBatchDelete, which included removing the Querystring function with window.location.href.match. I was wondering if it would be possible to push those for Fastdelete. Best, -- Kangaroopowah  ( Talk ) 05:38, March 8, 2012 (UTC)
 * I went and changed both instead to $.getUrlVar, which is a jQuery function loaded on all pages anyway. :) Cheers, grunny  :&#126;$ 06:43, March 8, 2012 (UTC)
 * According to FastDelete its still 1.5. Do you think it's ready to jump to 2.0 yet :P. Anyways, out of curiosity couldn't all the document.getElementById in fd_checkdelete be changed to the jquery shortcut $? Just curious, -- Kangaroopowah  ( Talk ) 21:03, March 10, 2012 (UTC)
 * I was actually gonna bump it to 2.0 when I update it to use Ajax instead of going to ?action=delete then submitting. :) As for the document.getElementById, it could but there's no real advantage in doing so. Cheers, grunny  :&#126;$ 14:11, March 11, 2012 (UTC)

JavaScript and CSS Cheatsheet
Hi Grunny!

I aggregated this little cheatsheet which contains the things absolutely everybody who comes here needs to know. So I was wondering if you could add a link to it to the top navigation?

Pecoes 06:13, March 8, 2012 (UTC)
 * Done. :) grunny  :&#126;$ 06:39, March 8, 2012 (UTC)

RE
Hi Grunny, thanks for the reply. Regarding this, I wanted to make it work on the Dead Space wiki, but before I would make any changes to the site's .js I wanted to test if it would work on my global.js first.

Since I first left that question, an other admin from the wiki applied the change to the site's .js, and it turns out that it works fine, as it should. Which leaves me buffled as to why it did not work when I was testing the change to the copy (note: copy, not import) of the script over at my global.js. Don't scripts work when they are actually in the global.js, instead of being imported?

Oh and since you asked, I was testing on both Chrome and Firefox.

One last thing if I may ask. Can you visit the Dead Space wiki on firefox and let me know if the Back To Top button appears in the site's footer? The script, which is local to the site, does not load for me on Firefox, however it loads fine on Chrome, and also loads fine on both browsers when I import it to my global.js from dev wiki. I'd like to know if it happens to all users or is it just me for some reason.

Regards! -- Noemo n  * talk * 23:32, March 11, 2012 (UTC)


 * I can confirm that the JS doesn't load on Firefox (v10.0.2), but it does on Chrome (v17.0.963.79). Haven't test it out on Safari or Opera yet.— subtank  ( 7alk ) 17:32, March 12, 2012 (UTC)


 * I'll take a look at your wiki's JS later today and see if I can track down the issue. Cheers, grunny  :&#126;$ 01:21, March 13, 2012 (UTC)


 * Thanks, but just so you know, in case I can spare you the time, I think the issue is resolved. Regards :) -- Noemo n  * talk * 01:25, March 13, 2012 (UTC)

Fastdelete ajax
I used your ajax batch delete functions to turn fd into ajax. It drops support for monaco but that's about it (oh and a little more jquery to remove addonloadhook). Can you push it if it's good?

Here's the code:

Best, --  Kangaroopowah  ( Talk ) 02:26, March 14, 2012 (UTC)

P.S. I used javascript:fd_delete in the hrefs, but I'm not sure I coded that right. Can you check that part please? Thanks,  Kangaroopowah  ( Talk ) 02:30, March 14, 2012 (UTC)


 * I had actually already written an AJAX version, just hadn't posted it yet. I have now. Have a go and let me know what you think. :) Cheers, grunny  :&#126;$ 13:48, March 14, 2012 (UTC)

Thanks but can you check the JavaScript links to make sure I cod that properly for future reference? Thanks. -- Kangaroopowah  ( Talk ) 00:59, March 15, 2012 (UTC)
 * It's close, but the variable in the JavaScript function call needs to be wrapped in quotes and you need to concatenate it (otherwise the href would appear as  which will cause an error as it should be say  ), like this:


 * You could also tie clicking an element with a function by binding an event handler to it, such as by using, or using the onclick parameter of a tag instead. I hope that helps. Cheers,  grunny  :&#126;$ 14:34, March 15, 2012 (UTC)
 * So if I wished to use the onclick tag would i have to use encodeURIComponent? --  Kangaroopowah  ( Talk ) 16:27, March 16, 2012 (UTC)
 * Well, you want to at least make sure you escape any ' as if the variable has one it will close the quote in the  which will cause an error. How you do that is up to you, so it depends what you're doing with the variable in the function and also what type of variable you're getting. Cheers,  grunny  :&#126;$ 16:31, March 16, 2012 (UTC)

Advanced Oasis UI
Hi Grunny,

I was update Advanced Oasis UI by i18n'ning save page but the script is now broken. When I open console it tells me that the problem is an unexpected identifier on line thirty, or Save Page :  "Seite speichern" , in the de section of config. Can you try to fix the problem?

Thanks, --  Kangaroopowah  ( Talk ) 04:02, March 16, 2012 (UTC)


 * Fixed. In objects, keys are strings, but when they are a valid variable name, the quotes can be dropped. In this case, as 'Save Page' is not a valid variable name, it either needs quotes around it or to be made a valid variable name. To match the others, I changed it to savePage. Cheers, grunny  :&#126;$ 05:00, March 16, 2012 (UTC)
 * Thanks! --  Kangaroopowah  ( Talk ) 05:05, March 16, 2012 (UTC)

Js debug
Hi Grunny,

I recently made a mass rollback script on WP and I was wondering if youu could dind the mistake I made in it because it doesn't work. The code is here. Thanks, -- Kangaroopowah  ( Talk ) 17:05, March 24, 2012 (UTC)

Spoiler Alert
Hi Grunny!

Does the SpoilerAlert conflict with Wikia's policies? I'm asking because it does obstruct content. In a sense that is its purpose.. -- peco e s 15:07, March 29, 2012 (UTC)


 * This site is mostly maintained by Staff (i.e., Grunny). So, there would be no scripts, etc., that would be here if they contravened Wikia policy and/or the ToU. Also, the policy of not using spoiler alert notices is a Wikipedia policy, not a Wikia policy. Thanks! — Spike  Toronto  17:25, March 29, 2012 (UTC)


 * Sorry. I completely misunderstood. I thought that the spoiler script was one that was already here on the dev wiki. I forgot that anyone can add scripts. Thanks for clearing that up Grunny. — Spike  Toronto  13:17, March 30, 2012 (UTC)


 * Okay. Sorry for frying your brain btw -- peco e s 18:25, March 29, 2012 (UTC)


 * Hi Pecoes. I just checked about whether this would violate TOU. I'm assuming this blacks out the whole web page until they confirm? If so, no that can't be put for all users on a wiki. However, if you made it so it only blacked out the content area but left the rest of the site surrounding the content area intact for people viewing the page, that would be fine. @Spike we allow things here that maybe wouldn't be allowed to be enabled sitewide but users can use for personal use as well :). Cheers, grunny  :&#126;$ 23:39, March 29, 2012 (UTC)


 * I'll change it if it's not okay. But, please, check out the demo, so you get the full idea! -- peco e s 23:48, March 29, 2012 (UTC)


 * Yeah, as that blocks areas of the site outside of the content area it's against TOU. If you could just blackout the content/text area of the page that would be fine. Also, you could add the ability to only hide certain areas of the text for articles that only have parts that are spoilers. :) Cheers, grunny  :&#126;$ 03:38, March 30, 2012 (UTC)


 * Alright. I'll change it. -- peco e s 03:59, March 30, 2012 (UTC)

(reset indent) Done. Can I make a demo here? Let's say at SpoilerAlert/Demo?

This is the code I'd need:

peco e s 12:32, March 30, 2012 (UTC)
 * For the sake of keeping everything in one place I'll give my two cents here. It's a good script but my only problem with it is that it tests document.title for a spoiler notice. Instead, it should test the article content itself. Best, -- Kangaroopowah  ( Talk ) 14:18, March 30, 2012 (UTC)


 * The function that tests the page is a configuration option. The example code features a version that tests if the page is in the category "Spoiler". Users can copypaste that one if they like it better. Or write a new one that tests if the page is in the "Spoiler" namespace. Or what have you...


 * But I will add another example function that tests if there are any elements with the css class "spoiler". That's what you were getting at, wasn't it? -- peco e s 14:41, March 30, 2012 (UTC)

Spoiler Alert 2
Er, Grunny? What about my demo request? Did you miss that? I'd still like to make one... -- peco e s 12:13, April 05, 2012 (UTC)
 * I saw it originally, but with the further discussion between you and Kangaroopower I forgot :P. Done. Cheers, grunny  :&#126;$ 13:39, April 5, 2012 (UTC)


 * Thanks :) -- peco e s 15:38, April 05, 2012 (UTC)

Hai
Hey there, just a hopefully quick question for you. I'm trying to come up with a toolbar that has slightly easier access to certain pages I commonly use. I've borrowed bits of code here and there, got odd bits of help where I can find it, but I've hit a dead end and in reality I'm no good with js. ):

$(function { $(' • <a href="/wiki/Special:RecentChanges">Recent Changes</a> • <a href="/wiki/Special:CreatePage">Create Page</a> • <a href="/wiki/Special:WhatLinksHere/"' + wgPageName '"">What Links Here</a> • <a href="/wiki/"' + wgPageName + '"?action=history">History</a> • <a href="/wiki/Special:WantedFiles">Wanted Files</a> • <a href="/wiki/Special:WantedPages">Wanted Pages</a> </li></ul>').appendTo('ul.tools'); });

As you can see it's a little bit on the messy side, but the main problem is that the  part doesn't work as intended. It's meant to link to the  of the current page, similarly with the , but it's not really working. I've got it implemented here if you wanted to see it in action. If it's not too much trouble, could you add in the relevant code to make  open in a new tab too and maybe clean it up so it's not so daunting to edit ;)?

Cheers Cam.


 * I'm not Grunny but I see a few problems with you code. Firstly, you're using the notifications interface which I don't think you want to use right now. Secondly, a much, much easier way to do this is to just click customize in the floating toolbar and customize it there- all the links you want can be easily inserted through that. Hope this helps! -- Kangaroopowah  ( Talk ) 01:49, April 13, 2012 (UTC)


 * I'm not Grunny either, but if you want to open Special:CreatePage in a new tab, you could do it like this:


 * And two tips for future reference:
 * Always check your browser's error console! The reason why your script does nothing is a syntax error.
 * The line number the error console will tell you isn't worth much, if most of your code is on a single line. You should try to break the code up into multiple lines.
 * peco e s 03:03, April 13, 2012 (UTC)