Last modified: 2013-04-22 16:16:05 UTC
I think it is worth adding a boolean variable wgPostEdit, which is true if and only if the user just saved the article. Right now, this is implemented in https://www.mediawiki.org/wiki/Extension:PostEdit , but the real point of the extension is to show a visual notification. Other extensions ideally shouldn't have to depend on all that just to get a boolean. E3Experiments currently uses it implicitly (I will temporarily make it an explicit dependency), and I'm sure there are other extensions and gadgets that could use it. It looks like this could maybe be implemented in attemptSave, but I'm open to suggestions.
I mean "just saved a page", not specifically an article.
GuidedTour also uses this. I'm going to start implementing this.
Initial version at https://gerrit.wikimedia.org/r/#/c/50480/, ready to start review. It's basically similar to the Extension:PostEdit implementation of the variable. However, it uses the revision ID to avoid conflicts even if you save the same article twice in close succession (e.g. two sections). It also uses '/' for the path rather than exporting that.
Merged
I've documented this at https://www.mediawiki.org/wiki/Manual:Interface/JavaScript#Page-specific The documentation notes that you should depend on 'mediawiki.action.view.postEdit'. Even though the module will always be added on views, I believe this is necessary to avoid race conditions. Loading the module when they did not just save should not cause problems. I've just submitted https://gerrit.wikimedia.org/r/#/c/51885/ to guarantee the variable can never be set on a non-view.
Merged by Ori.