WMDE-leszek has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391191 )

Change subject: Install JS part of DataTypes library as a git submodule
......................................................................

Install JS part of DataTypes library as a git submodule

Bug: T180448
Change-Id: I20447283c426fb26f0a76a773e5a42e74bf8773b
---
M .gitmodules
M view/lib/i18n.php
M view/lib/resources.php
A view/lib/resources/wikibase-data-types.php
A view/lib/resources/wikibase-data-types/resources.php
A view/lib/wikibase-data-types
6 files changed, 51 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/91/391191/1

diff --git a/.gitmodules b/.gitmodules
index fbb0476..662a7fa 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -13,3 +13,6 @@
 [submodule "view/lib/wikibase-data-model"]
        path = view/lib/wikibase-data-model
        url = https://phabricator.wikimedia.org/source/wikibase-data-model.git
+[submodule "view/lib/wikibase-data-types"]
+       path = view/lib/wikibase-data-types
+       url = https://github.com/wmde/wikibase-data-types-javascript.git
diff --git a/view/lib/i18n.php b/view/lib/i18n.php
index 09484bc..59bc2bd 100644
--- a/view/lib/i18n.php
+++ b/view/lib/i18n.php
@@ -8,6 +8,7 @@
 
        $wgMessagesDirs['WikibaseView'] = array_merge(
                $wgMessagesDirs['WikibaseView'],
-                [ __DIR__ . '/wikibase-data-values-value-view/i18n' ]
+               [ __DIR__ . '/wikibase-data-values-value-view/i18n' ],
+               [ __DIR__ . '/wikibase-data-types/i18n' ]
        );
 } );
diff --git a/view/lib/resources.php b/view/lib/resources.php
index 9ef13c0..45a4f40 100644
--- a/view/lib/resources.php
+++ b/view/lib/resources.php
@@ -9,6 +9,7 @@
                include __DIR__ . '/resources/wikibase-data-values.php',
                include __DIR__ . '/resources/wikibase-serialization.php',
                include __DIR__ . '/resources/wikibase-api.php',
+               include __DIR__ . '/resources/wikibase-data-types.php',
                include __DIR__ . 
'/resources/wikibase-data-values-value-view.php'
        );
 } );
diff --git a/view/lib/resources/wikibase-data-types.php 
b/view/lib/resources/wikibase-data-types.php
new file mode 100644
index 0000000..d6d0b28
--- /dev/null
+++ b/view/lib/resources/wikibase-data-types.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @license GPL-2.0+
+ */
+return call_user_func( function() {
+       return include __DIR__ . '/wikibase-data-types/resources.php';
+} );
\ No newline at end of file
diff --git a/view/lib/resources/wikibase-data-types/resources.php 
b/view/lib/resources/wikibase-data-types/resources.php
new file mode 100644
index 0000000..43657bb
--- /dev/null
+++ b/view/lib/resources/wikibase-data-types/resources.php
@@ -0,0 +1,36 @@
+<?php
+
+/**
+ * @license GPL-2.0+
+ */
+return call_user_func( function() {
+       $dir = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 
'..' . DIRECTORY_SEPARATOR
+               . 'wikibase-data-types' . DIRECTORY_SEPARATOR . 'src';
+
+       preg_match( '+' . preg_quote( DIRECTORY_SEPARATOR ) . 
'(?:vendor|extensions)'
+               . preg_quote( DIRECTORY_SEPARATOR ) . '.*+', $dir, 
$remoteExtPath );
+
+       $moduleTemplate = [
+               'localBasePath' => $dir,
+               'remoteExtPath' => '..' . $remoteExtPath[0],
+       ];
+
+       return [
+               'dataTypes.__namespace' => $moduleTemplate + [
+                       'scripts' => [
+                               'dataTypes/__namespace.js'
+                       ]
+               ],
+               'dataTypes.DataType' => $moduleTemplate + [
+                       'scripts' => 'dataTypes/DataType.js',
+                       'dependencies' => 'dataTypes.__namespace',
+               ],
+               'dataTypes.DataTypeStore' => [
+                       'scripts' => 'dataTypes/DataTypeStore.js',
+                       'dependencies' => [
+                               'dataTypes.__namespace',
+                               'dataTypes.DataType',
+                       ]
+               ],
+       ];
+} );
\ No newline at end of file
diff --git a/view/lib/wikibase-data-types b/view/lib/wikibase-data-types
new file mode 160000
index 0000000..f245ffd
--- /dev/null
+++ b/view/lib/wikibase-data-types
@@ -0,0 +1 @@
+Subproject commit f245ffd1f1037f7ad81729e8d0529e7df85072bd

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I20447283c426fb26f0a76a773e5a42e74bf8773b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: WMDE-leszek <leszek.mani...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to