Robert Vogel has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/159371

Change subject: [WIP] Stub implementation
......................................................................

[WIP] Stub implementation

This code does not work yet!

Change-Id: I2c725f627e67b7953cb6a520bb634633b261c86d
---
A COPYING
M Teahouse.php
M i18n/de.json
A resources/mediawiki.teahouse.QuestionDialog.js
A resources/mediawiki.teahouse.development.js
M resources/mediawiki.teahouse.js
6 files changed, 90 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Teahouse 
refs/changes/71/159371/1

diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..0c5e50e
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,7 @@
+This is a project of "Wikimedia Deutschland Gesellschaft zur Förderung Freien
+Wissens e. V." (https://www.wikimedia.de) implemented by "Hallo Welt!
+Medienwerstakk GmbH" (http://www.hallowelt.biz).
+
+It is inspired by the "Teahouse" project of english Wikipedia.
+
+https://en.wikipedia.org/wiki/Wikipedia:Teahouse
\ No newline at end of file
diff --git a/Teahouse.php b/Teahouse.php
index 0bd14e6..91cbced 100644
--- a/Teahouse.php
+++ b/Teahouse.php
@@ -1,13 +1,57 @@
 <?php
+/**
+ * Copyright (C) 2014 Hallo Welt! Medienwerkstatt GmbH
+ * http://www.hallowelt.biz
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ */
 
-$wgExtensionCredits['Teahouse'][] = array(
+$wgExtensionCredits['other'][] = array(
        'path' => __FILE__,
        'name' => 'Teahouse',
        'author' => array(
                'Stefan Widmann',
                'Robert Vogel'
        ),
-       //'url' => 'https://www.mediawiki.org/wiki/Extension:Teahouse', 
+       //'url' => 'https://www.mediawiki.org/wiki/Extension:Teahouse',
        'description' => '',
        'version'  => 1.24
-);
\ No newline at end of file
+);
+
+$wgMessagesDirs['Teahouse'] = __DIR__ . '/i18n';
+
+$wgResourceModules['ext.teahouse'] = array(
+       'scripts' => array(
+               'mediawiki.teahouse.js',
+               'mediawiki.teahouse.development.js'
+       ),
+       'messages' => array(
+               'th-button-text',
+               'th-dialog-title',
+               'th-dialog-description-top',
+               'th-dialog-label-summary',
+               'th-dialog-label-text',
+               'th-dialog-btn-ok',
+               'th-dialog-btn-cancel',
+       ),
+       'localBasePath' => __DIR__.'/resources',
+       'remoteExtPath' => 'Teahouse/resources',
+);
+
+$wgHooks['BeforePageDisplay'][] = function( &$out, &$skin ) {
+       $out->addModules('ext.teahouse');
+       return true;
+};
\ No newline at end of file
diff --git a/i18n/de.json b/i18n/de.json
index a728b69..84d5f47 100644
--- a/i18n/de.json
+++ b/i18n/de.json
@@ -4,10 +4,10 @@
                        "Robert Vogel <[email protected]>"
                ]
        },
-       "th-desc": "Entwicklungserweiterung für das 'Teahouse' Gadget",
+       "th-desc": "Entwicklungserweiterung für das 'Teahouse' Gadget",
        "th-button-text": "Stelle deine Frage",
        "th-dialog-title": "Stelle deine Frage",
-       "th-dialog-description-top": "Bitte schreibe eine kurze Frage in das 
Textfeld. Wenn du weitere Informationen angeben willst, verwende bitte die 
große Textbox.",
+       "th-dialog-description-top": "Bitte schreibe eine kurze Frage in das 
Textfeld. Wenn du weitere Informationen angeben willst, verwende bitte die 
große Textbox.",
        "th-dialog-label-summary": "Deine Frage",
        "th-dialog-label-text": "Genauere Beschreibung der Frage (Du kannst 
WikiText verwenden)",
        "th-dialog-btn-ok": "Frage abschicken",
diff --git a/resources/mediawiki.teahouse.QuestionDialog.js 
b/resources/mediawiki.teahouse.QuestionDialog.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/resources/mediawiki.teahouse.QuestionDialog.js
diff --git a/resources/mediawiki.teahouse.development.js 
b/resources/mediawiki.teahouse.development.js
new file mode 100644
index 0000000..e0ef384
--- /dev/null
+++ b/resources/mediawiki.teahouse.development.js
@@ -0,0 +1,3 @@
+mw.teahouse.init({
+       basePage: 'Help:Teahouse'
+});
\ No newline at end of file
diff --git a/resources/mediawiki.teahouse.js b/resources/mediawiki.teahouse.js
index e69de29..394484f 100644
--- a/resources/mediawiki.teahouse.js
+++ b/resources/mediawiki.teahouse.js
@@ -0,0 +1,31 @@
+(function( mw, $, d, undefined ){
+
+       function _init( config ){
+               $('.th-button').each(function(){
+                       var button = new OO.ui.ButtonWidget( {
+                               'label': mw.message('th-button-text').plain()
+                       } );
+
+                       $(this).append( button.$element );
+
+                       button.on( 'click', _openDialog );
+               });
+
+               $('<li id="p-teahouse"><a title="" href="#">Teahouse</a></li>')
+               .appendTo( $('#p-personal > ul').first() );
+
+               $(d).on( 'click', '#p-teahouse', _openDialog );
+       }
+
+       function _openDialog() {
+               alert('DIALOG');
+       }
+
+       mw.teahouse = {
+               init: function() {
+                       //Load dependencies
+                       mw.loader.using( 'oojs-ui', _init );
+               }
+       };
+
+})( mediaWiki, jQuery, document );
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/159371
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2c725f627e67b7953cb6a520bb634633b261c86d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Teahouse
Gerrit-Branch: master
Gerrit-Owner: Robert Vogel <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to