Robert Vogel has submitted this change and it was merged. Change subject: [WIP] Initial commit to the Teahouse extension ......................................................................
[WIP] Initial commit to the Teahouse extension This code does not work yet. It is just a stub to have the repo filled with something. Change-Id: I6ee25f4ba290dfe1b5ad111ef891e39375663039 --- A .gitignore A Teahouse.php A docs/wmfde.Teahouse.js A docs/wmfde.Teahouse.wiki A gadgetize.json A maintenance/Gadgetize.php A resources/mediawiki.teahouse.js 7 files changed, 116 insertions(+), 0 deletions(-) Approvals: Robert Vogel: Verified; Looks good to me, approved Swidmann: Checked; Looks good to me, but someone else must approve diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..98b092a --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.svn +*~ +*.kate-swp +.*.swp diff --git a/Teahouse.php b/Teahouse.php new file mode 100644 index 0000000..0bd14e6 --- /dev/null +++ b/Teahouse.php @@ -0,0 +1,13 @@ +<?php + +$wgExtensionCredits['Teahouse'][] = array( + 'path' => __FILE__, + 'name' => 'Teahouse', + 'author' => array( + 'Stefan Widmann', + 'Robert Vogel' + ), + //'url' => 'https://www.mediawiki.org/wiki/Extension:Teahouse', + 'description' => '', + 'version' => 1.24 +); \ No newline at end of file diff --git a/docs/wmfde.Teahouse.js b/docs/wmfde.Teahouse.js new file mode 100644 index 0000000..e56c8de --- /dev/null +++ b/docs/wmfde.Teahouse.js @@ -0,0 +1,73 @@ +(function(mw, $){ + + $.ajax( { + url: mw.util.getUrl( + 'MediaWiki:Gadget-teahouse/de.js', + { + action:'raw', + ctype: 'text/javascript' + } + ), + dataType:'json' //Wichtig, da sonst '.done' nicht aufgerufen + }) + .done(function( messages ) { + //"mw.loader.implement" sollte nicht von userland code aufgerufen werden + /*mw.loader.implement( + 'wmfde.Teahouse', + [], + {}, + messages + );*/ + + mw.messages.set( messages ); + + mw.loader.using( ['oojs-ui' /*, 'wmfde.Teahouse'*/], function(){ + window.th = {}; + + th.QuestionDialog = function ThQuestionDialog( manager, config ) { + th.QuestionDialog.super.call( this, manager, config ); + }; + + OO.inheritClass( th.QuestionDialog, OO.ui.Dialog ); + th.QuestionDialog.static.name = 'thQuestion'; + th.QuestionDialog.static.size = 'medium'; + th.QuestionDialog.static.verbose = true; + th.QuestionDialog.static.icon = 'help'; + th.QuestionDialog.static.actions = [ + { + 'label': OO.ui.deferMsg( 'visualeditor-dialog-beta-welcome-action-continue' ), + 'flags': 'primary' + } + ]; + + th.QuestionDialog.prototype.getSetupProcess = function ( data ) { + // Provide default title and message + data = $.extend( { + 'title': 'Ask a question', + 'message': 'Welcome to Wikipedia Teahouse! Please feel free to ask us for help.' + }, data ); + + return th.QuestionDialog.super.prototype.getSetupProcess.call( this, data ); + }; + + /*th.dialogs = new OO.Factory(); + th.dialogs.register( th.QuestionDialog ); + th.windowSet = new OO.ui.WindowSet( th.dialogs ) + $( 'body' ).append( th.windowSet.$ );*/ + + reasonButton = new OO.ui.ButtonWidget( { + 'label': mw.message('bs-no-information-available').plain() + } ); + + jQuery( '.firstHeading').after( reasonButton.$element ); + + reasonButton.on( 'click', function() { + var x = new th.QuestionDialog(); + x.open(); + //th.dialogs.open( 'thQuestion', {} ); + //alert( mw.message('bs-filesystemhelper-has-path-traversal').plain() ); + }); + }); + }); + +})( mediaWiki, jQuery ); \ No newline at end of file diff --git a/docs/wmfde.Teahouse.wiki b/docs/wmfde.Teahouse.wiki new file mode 100644 index 0000000..badd7e9 --- /dev/null +++ b/docs/wmfde.Teahouse.wiki @@ -0,0 +1,6 @@ + teahouse.autoComplete.js --> Extend jQueryUI autocomplete via Widget Factory? + + 2014-07-31: freenode#mediawiki-visualeditor + (13:13:25) Rob: Hi everybody! I'm trying to learn the OO JS and OOJ UI Framework/API. Can you tell me the current state of the codebase? Is it stable enough for third party use? Or would you not recommend building extension user interfaces upon it? + (13:22:45) Krinkle: osnard: OOjs is a stable code base that has had a 1.0 release and is following semver. + (13:23:36) Krinkle: osnard: OOjs UI is still in flux (pre 1.0). however it is well-documented, and if you take care to follow the release notes /git log we do mark any breaking changes as such. \ No newline at end of file diff --git a/gadgetize.json b/gadgetize.json new file mode 100644 index 0000000..6405a8b --- /dev/null +++ b/gadgetize.json @@ -0,0 +1,20 @@ +{ + _includeI18N: true, //Maybe better make two properties: One for config and one for assets? + + "MediaWiki:teahouse.js": [ + "resources/teahouse.apiStore.js", + "resources/teahouse.dialog.js", + "resources/teahouse.button.js", + "resources/teahouse.init.js" + ], + + "MediaWiki:teahouse.css": [ + "resources/teahouse.dialog.css", + "resources/teahouse.button.css" + ], + + "Template:Pending_Question": "assets/Template_Pending_Questions.wiki", + "Template:Answered_Question": "assets/Template_Answered_Questions.wiki", + "Module:Teahouse_Questions": "assets/Module_Teahouse_Questions.lua", + "Help:Teahouse": "assets/Help_Teahouse.wiki" +} \ No newline at end of file diff --git a/maintenance/Gadgetize.php b/maintenance/Gadgetize.php new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/maintenance/Gadgetize.php diff --git a/resources/mediawiki.teahouse.js b/resources/mediawiki.teahouse.js new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/resources/mediawiki.teahouse.js -- To view, visit https://gerrit.wikimedia.org/r/155526 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6ee25f4ba290dfe1b5ad111ef891e39375663039 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Teahouse Gerrit-Branch: master Gerrit-Owner: Robert Vogel <[email protected]> Gerrit-Reviewer: Robert Vogel <[email protected]> Gerrit-Reviewer: Swidmann <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
