-/* jshint devel: true */
( function ( mw, $ ) {
/**
- * @method confirmCloseWindow
- * @member mw
- *
* Prevent the closing of a window with a confirm message (the onbeforeunload event seems to
* work in most browsers.)
*
* // do whatever you wanted to do
* }
*
+ * @method confirmCloseWindow
+ * @member mw
* @param {Object} [options]
* @param {string} [options.namespace] Namespace for the event registration
* @param {string} [options.message]
/**
* Return the object with functions to release and manually trigger the confirm alert
+ *
* @ignore
*/
return {
/**
* Remove all event listeners and don't show an alert anymore, if the user wants to leave
* the page.
+ *
* @ignore
*/
release: function () {
* Trigger the module's function manually: Check, if options.test() returns true and show
* an alert to the user if he/she want to leave this page. Returns false, if options.test() returns
* false or the user cancelled the alert window (~don't leave the page), true otherwise.
+ *
* @ignore
- * @return boolean
+ * @return {boolean}
*/
trigger: function () {
// use confirm to show the message to the user (if options.text() is true)
}
};
};
-} )( mediaWiki, jQuery );
+}( mediaWiki, jQuery ) );