Implement simple popup.
[philipp/winterrodeln/mediawiki_extensions/wrmap.git] / wrmap.body.php
index 03af984aff360778fc0eca7136ecb06ea731a532..79a4ee8e1245410ba7162f66ec2ffbdf94e3c4be 100644 (file)
@@ -438,12 +438,16 @@ class WrBaseMap {
                // Create <div/> element where the map is placed in
                global $wgExtensionAssetsPath;
                $doc = new WrMapDOMDocument();
-               $div = $doc->appendElement('div', array('class' => 'wrmap', 'style' => 'border-style:none;', 'data-ext-path' => "$wgExtensionAssetsPath/wrmap"));
+               $div_map = $doc->appendElement('div', array('class' => 'wrmap', 'style' => 'border-style:none;', 'data-ext-path' => "$wgExtensionAssetsPath/wrmap"));
                // progress message
-               $div->appendElement('div', array())->appendText(wfMessage('wrmap-loading')->text());
+               $div_map->appendElement('div', array())->appendText(wfMessage('wrmap-loading')->text());
                // data
-               $div->appendElement('div', array('style' => 'height: 0px; display:none;'))->appendText($json_string);
-               return array($doc->saveHTML($div), 'markerType' => 'nowiki');
+               $div_map->appendElement('div', array('style' => 'height: 0px; display:none;'))->appendText($json_string);
+               // popup
+               $div_popup = $doc->appendElement('div', array('id' => 'popup', 'class' => 'ol-popup'));
+               $div_popup->appendElement('a', array('id' => 'popup-closer', 'href' => '#', 'class' => 'ol-popup-closer'));
+               $div_popup->appendElement('div', array('id' => 'popup-content'));
+               return array($doc->saveHTML($div_map) . $doc->saveHTML($div_popup), 'markerType' => 'nowiki');
        }