[Wikidata-bugs] [Maniphest] [Commented On] T47224: [Story] Custom edit summaries

2019-03-16 Thread Yurik
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
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T47224: [Story] Custom edit summaries

2019-03-08 Thread Yurik
Yurik added a comment.


  This feature has been requested several times when adding Wikibase to 
OpenStreetMap wiki.  I think the very first step we can already do is to make 
it possible for gadgets to add edit summary string during the "save" command.  
This way we can experiment with the UI implementation.
  
  What is the recommended way for gadgets to dynamically modify POST parameters?

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

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

To: Yurik
Cc: 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
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs