User talk:BryanDavis/Sandbox/userfeedback.js

Rendered with Parsoid
From Wikitech

Proposed updates for MediaWiki:Gadget-userfeedback.js

@Srishakatux: I started poking at MediaWiki:Gadget-userfeedback.js for phab:T226296, and things got kind of involved. :) I was hoping you could take a look and give me some feedback on the changes I'm proposing. You can see it render by side loading my version in your common.js here on wikitech:

mw.loader.load('https://wikitech.wikimedia.org/w/index.php?title=User:BryanDavis/Sandbox/userfeedback.js&action=raw&ctype=text/javascript');

It would also be pretty cool to have you state a license for the code that we could add to the doc header that I started too. --BryanDavis (talk) 05:08, 24 June 2019 (UTC)Reply

WOW! The script looks neat and clean and readable with new changes. Thank you for improving it :) I've tested it, and it works. I only have one suggestion which is not to use OOUI as with that we get button boxes with borders by default, and I don't want that. So, I am guessing to get rid of the border; we might have to apply a custom style. Unless you have some concerns with not using OOUI, I would like to keep the buttons in their original state. The thumbs-up and down buttons might be looking funny right now without the new changes as we didn't update the CSS on Wikitech after making a few changes that were suggested around accessibility. So, ideally, the Wikitech CSS be also replaced with this code: MediaWiki:Gadget-userfeedback.css. For license, I would go like to add something like below to the script. Side question: which JS editor/linter did you use, I would like to use the same in my future experimentations :)
/*    
        @licstart  The following is the entire license notice for the 
        JavaScript code in this page.

        Copyright (C) 2019  Srishti Sethi <https://meta.wikimedia.org/wiki/User:SSethi_(WMF)>

        The JavaScript/Gadget code in this page is free software: you can
        redistribute it and/or modify it under the terms of the GNU
        General Public License (GNU GPL) as published by the Free Software
        Foundation, either version 3 of the License, or (at your option)
        any later version.  The code is distributed WITHOUT ANY WARRANTY;
        without even the implied warranty of MERCHANTABILITY or FITNESS
        FOR A PARTICULAR PURPOSE.  See the GNU GPL for more details.

        As additional permission under GNU GPL version 3 section 7, you
        may distribute non-source (e.g., minimized or compacted) forms of
        that code without the copy of the GNU GPL normally required by
        section 4, provided you include this license notice and a URL
        through which recipients can access the Corresponding Source.   


        @licend  The above is the entire license notice
        for the JavaScript/Gadget code in this page.
        */
-- Srishakatux (talk) 20:55, 24 June 2019 (UTC)Reply
Srishakatux I have updated the OOUI for the buttons to remove the frame and also to add classes that make it easier to target them with custom css as was done for the non-OOUI version. I then updated MediaWiki:Gadget-userfeedback.css by importing the version from mediawiki.org and added selectors for the OOUI generated version of the gadget. The main visual difference now on my browser is horizontal separation of the two buttons. We can go back to hand built buttons at any point, but since OOUI is being used more and more widely in the MediaWiki UI I think it may be easier to keep up with changes in preferred styling by using the same core library. Obviously right now we are purposefully deviating from the default styles for OOUI buttons. We can revisit that decision later if desired.
I have also added a variation on your license statement. I changed the comment string for the @licstart/@licend marker lines due to the inclusion of other javascript in any page where this is viewable (other than an explicit action=raw link). I also added "and contributors" to the copyright declaration which is a nice way to show that the copyright is jointly held. I also included an @license magnet link and @source link as recommended by https://www.gnu.org/software/librejs/free-your-javascript.html. We will need to update the @source when we move the script from my sandbox space to its real location.
The JS editor/linter used was... my eyes and fingers. I made all the changes inside the wiki using the source editor. --BryanDavis (talk) 00:07, 25 June 2019 (UTC)Reply
BryanDavis All this sounds too to me! Reminding myself that perfect is the enemy of good (:P), still I've one last change to request. With the current implementation of OOUI, we end up with slightly more space between thumbs-up and down button as it was there previously. So, here is what I've to fix the margins. Change the CSS to what is in here: https://wikitech.wikimedia.org/wiki/User:Srishakatux/common.css. And, then finally replace the following line in JS code <span>Was this documentation helpful? </span> with <span class="survey-question">Was this documentation helpful?</span>. -- Srishakatux (talk) 01:28, 25 June 2019 (UTC)Reply
@Srishakatux: Yes Done! I have made the updates you requested and then synced MediaWiki:Gadget-userfeedback.js with Special:PermanentLink/1830330. Thanks for being accepting of my proposed changes. This was an interesting experiment in collaborating on a gadget for me. It has helped me clarify my idea of what sort of tools a technical contributor might need to do this more effectively. --BryanDavis (talk) 03:22, 25 June 2019 (UTC)Reply