Skip to content

Commit fb98616

Browse files
committed
Init with code from Wikibase.git
Used code from c809beca8f8da10ff0a4ee69d838fc0ac75b89fc.
0 parents  commit fb98616

28 files changed

+4008
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/vendor/

.jshintrc

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"camelcase": true,
3+
"curly": true,
4+
"eqeqeq": true,
5+
"immed": true,
6+
"latedef": true,
7+
"newcap": true,
8+
"supernew": true,
9+
"shadow": true,
10+
"noarg": true,
11+
"noempty": true,
12+
"nonew": true,
13+
"quotmark": "single",
14+
"trailing": true,
15+
"undef": true,
16+
"unused": "vars",
17+
"laxbreak": true,
18+
"laxcomma": false,
19+
"onevar": false,
20+
"bitwise": false,
21+
"forin": false,
22+
"regexp": false,
23+
"strict": true,
24+
"scripturl": true,
25+
26+
// Environment
27+
"browser": true,
28+
29+
// Globals
30+
"predef": [
31+
"dataValues",
32+
"globeCoordinate",
33+
"jQuery",
34+
"mediaWiki",
35+
"QUnit",
36+
"valueFormatters",
37+
"valueParsers",
38+
"time",
39+
"util",
40+
// require.js globals:
41+
"require",
42+
"requirejs",
43+
"define"
44+
]
45+
}

LICENCE

Lines changed: 347 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Wikibase datamodel implementation in JavaScript
2+
3+
## Release notes
4+
5+
### 0.1 (2014-06-18)
6+
7+
Initial release.

composer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "wikibase/data-model-javascript",
3+
"description": "Wikibase datamodel implementation in JavaScript",
4+
"require": {
5+
"data-values/javascript": "~0.5.0"
6+
},
7+
"license": "GPL-2.0+",
8+
"authors": [
9+
{
10+
"name": "Daniel Werner",
11+
"homepage": "https://www.mediawiki.org/wiki/User:Danwe"
12+
},
13+
{
14+
"name": "H. Snater",
15+
"homepage": "http://www.snater.com"
16+
},
17+
{
18+
"name": "Jeroen De Dauw",
19+
"email": "jeroendedauw@gmail.com",
20+
"homepage": "http://jeroendedauw.com"
21+
},
22+
{
23+
"name": "Adrian Lang",
24+
"email": "adrian.lang@wikimedia.de"
25+
}
26+
],
27+
"minimum-stability": "dev",
28+
"support": {
29+
"issues": "https://bugzilla.wikimedia.org/",
30+
"irc": "irc://irc.freenode.net/wikidata"
31+
},
32+
"autoload": {
33+
"files" : [
34+
"init.mw.php"
35+
]
36+
}
37+
}

init.mw.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
3+
include 'resources.mw.php';
4+
include 'resources.test.mw.php';

resources.mw.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
/**
4+
* File for Wikibase resourceloader modules.
5+
*
6+
* @since 0.2
7+
*
8+
* @licence GNU GPL v2+
9+
* @author Daniel Werner
10+
* @author H. Snater < mediawiki@snater.com >
11+
*
12+
* @codeCoverageIgnoreStart
13+
*/
14+
return call_user_func( function() {
15+
global $wgResourceModules;
16+
17+
preg_match( '+^(.*?)' . DIRECTORY_SEPARATOR . '(vendor|extensions)' . DIRECTORY_SEPARATOR . '(.*)$+', __DIR__, $remoteExtPathParts );
18+
$moduleTemplate = array(
19+
'localBasePath' => __DIR__,
20+
'remoteExtPath' => '../' . $remoteExtPathParts[2] . DIRECTORY_SEPARATOR . $remoteExtPathParts[3],
21+
);
22+
23+
$modules = array(
24+
'wikibase.datamodel' => $moduleTemplate + array(
25+
'scripts' => array(
26+
'src/datamodel.entities/wikibase.Entity.js',
27+
'src/datamodel.entities/wikibase.Item.js',
28+
'src/datamodel.entities/wikibase.Property.js',
29+
'src/wikibase.EntityId.js',
30+
'src/wikibase.Snak.js',
31+
'src/wikibase.SnakList.js',
32+
'src/wikibase.PropertyValueSnak.js',
33+
'src/wikibase.PropertySomeValueSnak.js',
34+
'src/wikibase.PropertyNoValueSnak.js',
35+
'src/wikibase.Reference.js',
36+
'src/wikibase.Claim.js',
37+
'src/wikibase.Statement.js',
38+
),
39+
'dependencies' => array(
40+
'jquery', // wikibase.Claim
41+
'util.inherit',
42+
'wikibase', // What? Just for the namespace?
43+
'mw.ext.dataValues', // DataValues extension
44+
'wikibase.dataTypes', // That seems to be a wrong dependency
45+
)
46+
),
47+
);
48+
49+
$wgResourceModules = array_merge( $wgResourceModules, $modules );
50+
} );

resources.test.mw.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
global $wgHooks;
4+
5+
$wgHooks['ResourceLoaderTestModules'][] = function( array &$testModules, \ResourceLoader &$resourceLoader ) {
6+
preg_match( '+^(.*?)' . DIRECTORY_SEPARATOR . '(vendor|extensions)' . DIRECTORY_SEPARATOR . '(.*)$+', __DIR__, $remoteExtPathParts );
7+
$moduleTemplate = array(
8+
'localBasePath' => __DIR__,
9+
'remoteExtPath' => '../' . $remoteExtPathParts[2] . DIRECTORY_SEPARATOR . $remoteExtPathParts[3],
10+
);
11+
12+
$testModules['qunit']['wikibase.datamodel.tests'] = $moduleTemplate + array(
13+
'scripts' => array(
14+
'tests/Wikibase.claim.tests.js',
15+
'tests/Wikibase.reference.tests.js',
16+
'tests/Wikibase.snak.tests.js',
17+
'tests/Wikibase.SnakList.tests.js',
18+
'tests/wikibase.Statement.tests.js',
19+
'tests/datamodel.Entity.tests.js',
20+
'tests/datamodel.Item.tests.js',
21+
'tests/datamodel.Property.tests.js',
22+
),
23+
'dependencies' => array(
24+
'wikibase.tests.qunit.testrunner',
25+
)
26+
);
27+
28+
return true;
29+
};

0 commit comments

Comments
 (0)