Jump to content

Topic on Extension talk:WikiLove

General help regarding the extension

1
Klein Muçi (talkcontribs)

This is a copied conversation regarding some technical details of the extension. The conversation was copied here hoping it could help other users understand some details better.


Hello! :)

Recently we just activated the WikiLove extension in SqWiki. We just finished localizing it but there are two technical details which we'd like to change. We have only two interface admins (I'm one of those) and for the moment being, none of us knows hows to do these changes in the .js page. I thought I'd ask for help in the EnWiki interface admins and since I saw your name in that list and you've helped me in the past... :P Can I write what I need help with here? Or if you don't feel like you're the best person for that, can you tell me who I might write to for it? Thank you in advance! :) - Klein Muçi (talk) 14:17, 13 August 2019 (UTC)

@Klein Muçi: hello, what would you like to change on your wikilove? I just sent you a wikilove on sqwiki to show that it works. — xaosflux Talk 14:43, 13 August 2019 (UTC)
I see you have already started working on it at w:sq:MediaWiki:WikiLove.jsxaosflux Talk 14:45, 13 August 2019 (UTC)
Yes, it does. We only want to change two small technical details, as I said. The first is regarding the template you just used. It's set up with a drop-down menu like with all other types of templates. But, unlike the other cases, this doesn't have subtypes. We tried setting it up as a type without subtypes but then the icon and description disappear. Is there any way to be just like it is only without a drop-down menu?
And secondly, please see the templates at "Medalje komunitetit" called "Medalje gjysmë D" and "Medalje gjysmë M". Those are the Albanian half stars awards. Those are the only templates that have a message form where the user can write, needed to put the name of the collaborator with whom they're sharing the award. We want to make the text (a hint) that appears at the message form disappear when the form is clicked and reappear if nothing was added to it or if it was emptied. How can we do that?
Thank you a lot for your fast replies! :) - Klein Muçi (talk) 14:56, 13 August 2019 (UTC)
@Klein Muçi: I'm getting a little stuck on this, but would you like to try this on testwiki? The changes take about 10mins before they are usable, but you will be able to try without breaking your running wiki. I can add you some temporary access on there if you would like? — xaosflux Talk 16:01, 13 August 2019 (UTC)
Thank you but I'm not sure that would be a good idea. We don't have a very active community so breaking the wiki is not really a problem. I'm just not good enough with the JavaScript syntax and wouldn't know what to do there more than what I'm already doing at SqWiki. Maybe is better than nothing, I'm not sure as I've never used TestWiki before, so if that's the case, then yes, please do grant me access there. Maybe I can make it work by experimenting. But I was hoping more on some help with the coding part. - Klein Muçi (talk) 17:04, 13 August 2019 (UTC)

@Klein Muçi: OK, I'll add you temporary access at testwiki - just clean up your tests when you are done and don't break it too much :D I suggest you follow up at mw:Extension talk:WikiLove or WP:VPT here. — xaosflux Talk 17:19, 13 August 2019 (UTC)

Thank you! :) I'll try asking at WP:VPT. Is there anyone from the list here who you think can help me with it? As far as you know them, I mean. Apart from Cyberpower, I've bothered him quite a lot about IABot lately. XD (And Kaldari, for similar reasons. :P ) As for the TestWiki, maybe I won't be able to deal with it a lot often these two weeks as tomorrow I start my vacations but as soon as I get back, I'll catch up with my wikiwork. :P - Klein Muçi (talk) 17:57, 13 August 2019 (UTC)
@Klein Muçi: all of our IAdmins watch VPT here, looking at the WikiLove project on phabricator does include Kaldari as a project member, though @Quiddity: may be able to direct you to someone that can help with WikiLove specific code quicker. — xaosflux Talk 18:10, 13 August 2019 (UTC)
I see. Okay then. I'll try using the VPT after Quiddity answers. :) - Klein Muçi (talk) 18:46, 13 August 2019 (UTC)
@Klein Muçi: I can only second what Xaosflux suggested, to ask at mw:Extension talk:WikiLove (and I see that you've already edited mw:Extension:WikiLove#Custom_configuration, so thank you for those improvements!). Kaldari is indeed the expert, so you could try pinging him when you write on the extension talkpage there. Hope that helps. Quiddity (talk) 10:37, 14 August 2019 (UTC)
@Quiddity: thank you! :) I've pinged him some days ago about a similar problem but I'm trying one more time. :P @Kaldari: please take a look at the conversation. As I wrote on your talkpage, I've finished working with the extension and we're using it already but there are two technical difficulties we're having with it and I'd need a bit help with the coding regarding them. @Xaosflux: sorry for having this conversation here but I didn't want to start from scratch somewhere else if I wasn't really forced to. :P Hope for your understatement. - Klein Muçi (talk) 14:35, 14 August 2019 (UTC)

@Klein Muçi: it's OK. It looks like even our own local copy of MediaWiki:WikiLove.js has issues (e.g. the "Adding more kitten images" doesn't seem to actually do anything). If you move this to Extension_talk:WikiLove, feel free to copy and paste the entire conversation above for reference. — xaosflux Talk 14:52, 14 August 2019 (UTC)

Yeah, good idea. I'll pass the entire conversation there, regardless if the problems get solved or not, hoping it may help some people in the future. @Kaldari: pinging a second time as the first one had problems and I'm not sure if it succeeded or not. - Klein Muçi (talk) 15:12, 14 August 2019 (UTC)
@Xaosflux: The kitten additions at MediaWiki:WikiLove.js seem to be working fine. Just keep re-clicking the kitten icon until you see one of the new ones show up. Kaldari (talk) 10:20, 15 August 2019 (UTC)
@Klein Muçi: You can add an item without a subitem like this:
$.wikiLoveOptions.types.puppy = {
	name: 'Puppy',
	fields: [ 'header', 'message' ],
	header: 'You get a puppy',
	text: '[[File:2009-08-16 Puppy at Duke East 1.jpg|left|150px]]\n$1\n<br style="clear: both;"/>',
	icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/07/Fxemoji_u1F436.svg/53px-Fxemoji_u1F436.svg.png'
};
Kaldari (talk) 13:43, 15 August 2019 (UTC)
Thanks for the responses Kaldari (I see the local kittens working now, they change when you leave and return to the kitten selector). — xaosflux Talk 13:45, 15 August 2019 (UTC)
@Klein Muçi: once you have your changes tested and working, if you have time to add to the documentation (with examples) at mw:Extension:WikiLove#Custom_configuration it would be appreciated! — xaosflux Talk 13:46, 15 August 2019 (UTC)
@Kaldari: I've tried the aforementioned way. It ends up without a description or image at the second step, only showing the "preview" button. To many inexpert eyes, it looks broken like that and they keep pressing the type button to choose it, thinking their command hasn't been registered by the extension. That's why I asked if there's a way to make it without a drop-down menu while showing the description and image of the type. I understand there's not a way for that now so I'll leave it like that. What about the second question regarding the disappearing and reappearing of the text in the message form? If my explanation seems confusing, I'm talking about this: - Random link I searched on Google that seems to pinpoint the subject right. Isn't there a way to make the text in the message form disappear when clicked and reappear if it remains/becomes empty?
@Xaosflux: I've thought about that. The problem is that most of the changes I've made, were made with the trial and error method. :P And, although I can understand what I'm doing, I'm not able to explain it well enough for the others. That's why I set up the Portuguese Wikipedia as an example (since that was the one I copied the code from and started experimenting) and the Albanian one. I was hoping to at least help people with examples, if they ever needed them, or at least, urge some more experienced editors to write some good technical advice from the examples that were added. I think adding this conversation to the talkpage of that page will be a great help too. - Klein Muçi (talk) 23:58, 15 August 2019 (UTC)

Klein Muçi Are you looking to include an input placeholder? This would be best managed as an input field, and not with a javascript hack to add it in. — xaosflux Talk 00:42, 16 August 2019 (UTC)

@Xaosflux: please, try to give me Medalje gjysmë D (found in Medalje komuniteti) with the extension. A form will follow with some text in Albanian on it saying to erase said text and replace it with a user's name. I just want that text to disappear automatically when the form is clicked and then reappear if nothing was written on it. So the one who is using the extension won't need to delete the text manually before writing the user's name. It's a very common thing in website these days. A message with text as a hint appears telling you what to do and disappears immediately as soon as you click on it and start writing (reappearing if the form was left empty again). I thought it would require no more than a line of javascript code and to be honest, I'm a little surprised I'm having difficulties explaining it. :P - Klein Muçi (talk) 01:51, 16 August 2019 (UTC)
@Klein Muçi: As soon as this patch gets merged, the description for stand-alone types will no longer be broken. Getting images to work properly for stand-alone types will be more complicated. There is currently no support for placeholders in WikiLove. Kaldari (talk) 13:36, 16 August 2019 (UTC)
Okay, that finally answers everything I needed then. I didn't know the term I was looking for was "placeholder". I'm coping the entire conversation, including this sentence, to the talkpage of the extension. Thank you to everyone involved! :) - Klein Muçi (talk) 14:56, 16 August 2019 (UTC)
Reply to "General help regarding the extension"