Yurik added a comment.

  Here's a working implementation using the browser's prompt text box, based on 
the original idea by @Ricordisamoa. Copy it into your 
`https://wiki.openstreetmap.org/wiki/User:___username___/common.js`  page. Note 
that the save will happen even if the user clicks `Cancel` because there is no 
good way to abort saving without crashing.  This code can be directly used as a 
gadget.
  
    /*
     * EditWikidataSummary.js
     * @author [[User:Yurik]] based on code by [[User:Ricordisamoa]]
     */
    ( function( $, mw, window ) {
      $( function () {
        if( !mw.config.exists( 'wbEntityId' ) ) {
          return;
        }
        mw.hook('wikibase.entityPage.entityView.rendered').add(function () {
          oldPost = wb.api.RepoApi.prototype._post;
      
          wb.api.RepoApi.prototype._post = function ( params ) {
            if ( params.summary === undefined ) {
              var summary = window.prompt('Enter edit summary (optional):', '');
              if ( summary ) {
                params.summary = summary;
              }
            }
            return oldPost.call( this, params );
          };
        } );
      } );
    } )( jQuery, mediaWiki, window );

TASK DETAIL
  https://phabricator.wikimedia.org/T47224

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Yurik
Cc: mxn, Yurik, Darwinius, CatCat, ElanHR, Salgo60, reosarevok, 
Lucas_Werkmeister_WMDE, Zppix, YFdyh000, Nikki, Daniel_Mietchen, 
Lydia_Pintscher, Bene, jayvdb, Aklapper, Candalua, MGChecker, Liuxinyu970226, 
Wikidata-bugs, Abraham, jeblad, Addshore, aude, matej_suchanek, Ricordisamoa, 
Beta16, Allen4names, Danmichaelo, alaa_wmde, Dinadineke, Nandana, 
tabish.shaikh91, Lahi, Gq86, GoranSMilovanovic, Soteriaspace, Jayprakash12345, 
JakeTheDeveloper, QZanden, dachary, merbst, LawExplorer, Puik, _jensen, 
rosalieper, D3r1ck01, Envlh, Tobias1984, Sjoerddebruin, TheDJ, Mbch331, Jay8g
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to