Browse Source

Use modulekit for loading certain sub modules

master
parent
commit
caed70f952
  1. 1
      .gitignore
  2. 6
      .gitmodules
  3. 15
      README.md
  4. 1
      conf.php-dist
  5. 7
      index.php
  6. 1
      lib/modulekit/base
  7. 1
      modulekit
  8. 9
      modulekit.php
  9. 2
      src/index.js

1
.gitignore

@ -0,0 +1 @@
/conf.php

6
.gitmodules

@ -0,0 +1,6 @@
[submodule "modulekit"]
path = modulekit
url = https://github.com/plepe/modulekit.git
[submodule "lib/modulekit/base"]
path = lib/modulekit/base
url = https://github.com/plepe/modulekit-base.git

15
README.md

@ -1,3 +1,18 @@
## INSTALL
```sh
git clone https://github.com/plepe/openstreetbrowser.git
cd openstreetbrowser
npm install
git submodule init
git submodule update
cp conf.php-dist conf.php
nano conf.php
npm run build
```
I plan to replace all PHP dependencies through JS replacements.
## API
```js
new OpenStreetBrowserCategory(query, options)
```

1
conf.php-dist

@ -0,0 +1 @@
<?php

7
index.html → index.php

@ -1,3 +1,6 @@
<?php include "conf.php"; /* load a local configuration */ ?>
<?php include "modulekit/loader.php"; /* loads all php-includes */ ?>
<?php call_hooks("init"); /* initialize submodules */ ?>
<!DOCTYPE html>
<html>
<head>
@ -12,6 +15,10 @@
<script src="node_modules/leaflet/dist/leaflet.js"></script>
<script src="dist/openstreetbrowser.js"></script>
<script src="node_modules/leaflet.locatecontrol/dist/L.Control.Locate.min.js"></script>
<?php print modulekit_to_javascript(); /* pass modulekit configuration to JavaScript */ ?>
<?php print modulekit_include_js(); /* prints all js-includes */ ?>
<?php print modulekit_include_css(); /* prints all css-includes */ ?>
<?php print_add_html_headers(); /* print additional html headers */ ?>
</head>
<body>
<div id='map'></div>

1
lib/modulekit/base

@ -0,0 +1 @@
Subproject commit 279863bd46c9ee04b34c4a97cdfaee74f92172d5

1
modulekit

@ -0,0 +1 @@
Subproject commit 26fb8675c00a9b094f5731c9f57309bd21ccaf2f

9
modulekit.php

@ -0,0 +1,9 @@
<?php
$id = "openstreetbrowser";
$depend = array(
'hooks',
'html',
);
$include = array(
);
$version = "3.x-dev";

2
src/index.js

@ -15,6 +15,8 @@ var tagTranslations = require('./tagTranslations')
var map
window.onload = function() {
call_hooks('init')
map = L.map('map')
ipLocation('', function (err, ipLoc) {

Loading…
Cancel
Save