Physikerwelt has uploaded a new change for review.

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

Change subject: Add link to MinMathSearchInterface
......................................................................

Add link to MinMathSearchInterface

* The experiemental minMathSearchInterface can be
  used to enter mathmeatics using a combination of
  keyboard and mouse or a digital pen.

Change-Id: I0d457ac63f12859496d626f79d383c543524ff0e
---
A .gitmodules
M SpecialMathSearch.php
A modules/min
3 files changed, 12 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/74/185974/1

diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..a106a0d
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "modules/min"]
+       path = modules/min
+       url = https://github.com/physikerwelt/min
diff --git a/SpecialMathSearch.php b/SpecialMathSearch.php
index 6e9c2f1..094dd29 100644
--- a/SpecialMathSearch.php
+++ b/SpecialMathSearch.php
@@ -9,9 +9,8 @@
         * @file
         * @ingroup extensions
         */
-       class SpecialMathSearch extends SpecialPage
-       {
-
+       class SpecialMathSearch extends SpecialPage {
+               const  mathSearchInterfacePath = '/modules/min/index.xhtml';
                public $qs;
                public $math_result;
                public $mathSearchExpr;
@@ -51,8 +50,8 @@
                /**
                 * The main function
                 */
-               public function execute( $par )
-               {
+               public function execute( $par ) {
+                       global $wgExtensionAssetsPath;
                        $request = $this->getRequest();
                        $this->setHeaders();
                        $this->mathpattern = $request->getText( 'mathpattern' );
@@ -62,6 +61,10 @@
                                $this->mathpattern = htmlspecialchars_decode( 
$this->mathpattern );
                        }
                        $this->searchForm();
+                       if( file_exists( __DIR__ . mathSearchInterfacePath ) ) {
+                               $minurl = $wgExtensionAssetsPath . 
'/MathSearch'. self::mathSearchInterfacePath ;
+                               $this->getOutput()->addHTML("<p><a 
href=\"${minurl}\">Test experimental math input interface</a></p>");
+                       }
                        if ( $this->mathpattern || $this->textpattern ) {
                                $this->performSearch();
                        }
@@ -109,8 +112,7 @@
                        $htmlForm->show(); # Displaying the form
                }
 
-               public function performSearch()
-               {
+               public function performSearch() {
                        global $wgMathDebug;
                        $out = $this->getOutput();
                        $time_start = microtime( true );
diff --git a/modules/min b/modules/min
new file mode 160000
index 0000000..4f3fc3e
--- /dev/null
+++ b/modules/min
+Subproject commit 4f3fc3e2da04afee973448a81067a92df38164c8

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0d457ac63f12859496d626f79d383c543524ff0e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <[email protected]>

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

Reply via email to