Add fullscreen control.

This commit is contained in:
David Molineus
2015-01-20 17:36:19 +01:00
parent 0c1df3b6d9
commit 8ddfdc753b
5 changed files with 129 additions and 52 deletions

View File

@@ -99,6 +99,7 @@ $GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\ScaleCo
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\LayersControlMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\AttributionControlMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\LoadingControlMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\FullscreenControlMapper';
// Vector mappers.
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Vector\PolylineMapper';
@@ -216,7 +217,7 @@ $GLOBALS['LEAFLET_LAYERS'] = array
*
* Supported leaflet control types. Register your type for the database driven definition here.
*/
$GLOBALS['LEAFLET_CONTROLS'] = array('zoom', 'layers', 'scale', 'attribution', 'loading');
$GLOBALS['LEAFLET_CONTROLS'] = array('zoom', 'layers', 'scale', 'attribution', 'loading', 'fullscreen');
/*

View File

@@ -119,7 +119,10 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array
),
'loading extends default' => array(
'config' => array('separate', 'zoomControl', 'spinjs')
)
),
'fullscreen extends default' => array(
'config' => array('buttonTitle', 'separate', 'simulateFullScreen')
),
),
'metasubpalettes' => array(
@@ -399,5 +402,21 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array
),
'sql' => "mediumtext NULL"
),
'simulateFullScreen' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['simulateFullScreen'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50 m12'),
'sql' => "char(1) NOT NULL default ''"
),
'buttonTitle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['buttonTitle'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
),
);

View File

@@ -10,6 +10,8 @@ $GLOBALS['TL_LANG']['leaflet_control']['scale'][0] = 'Scale control';
$GLOBALS['TL_LANG']['leaflet_control']['scale'][1] = 'A simple scale control that shows the scale of the current center of the screen. For more details read the <a href="http://leafletjs.com/reference.html#control-scale" target="_blank">Leaflet documentation</a>.';
$GLOBALS['TL_LANG']['leaflet_control']['loading'][0] = 'Loading indicator';
$GLOBALS['TL_LANG']['leaflet_control']['loading'][1] = 'Leaflet.loading is a simple loading indicator implemented as control. For more details read the <a href="https://github.com/ebrelsford/Leaflet.loading" target="_blank">Plugin documentation</a>.';
$GLOBALS['TL_LANG']['leaflet_control']['fullscreen'][0] = 'Fullscreen control';
$GLOBALS['TL_LANG']['leaflet_control']['fullscreen'][1] = 'Add a fullscreen toggle button. For more details read the <a href="https://github.com/brunob/leaflet.fullscreen" target="_blank">Plugin documentation</a>.';
$GLOBALS['TL_LANG']['leaflet_layer']['provider'][0] = 'Leaflet provider';
$GLOBALS['TL_LANG']['leaflet_layer']['provider'][1] = 'Leaflet tile provider. For more details read the <a href="https://github.com/leaflet-extras/leaflet-providers" target="_blank">plugin documentation</a>.';

View File

@@ -19,56 +19,62 @@ $GLOBALS['TL_LANG']['tl_leaflet_control']['show'][1] = 'Show control ID %s d
$GLOBALS['TL_LANG']['tl_leaflet_control']['pastenew'][0] = 'Copy control';
$GLOBALS['TL_LANG']['tl_leaflet_control']['pastenew'][1] = 'Create new copy of control ID %s';
$GLOBALS['TL_LANG']['tl_leaflet_control']['title'][0] = 'Title';
$GLOBALS['TL_LANG']['tl_leaflet_control']['title'][1] = 'Title of the control.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['alias'][0] = 'Alias';
$GLOBALS['TL_LANG']['tl_leaflet_control']['alias'][1] = 'Alias of the control.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['type'][0] = 'Type';
$GLOBALS['TL_LANG']['tl_leaflet_control']['type'][1] = 'Choose the control type.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['position'][0] = 'Position';
$GLOBALS['TL_LANG']['tl_leaflet_control']['position'][1] = 'Position of the control.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInText'][0] = 'Zoom in text';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInText'][1] = 'The text set on the zoom in button. By default its the "+" sign. Leave empty for the default value';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomOutText'][0] = 'Zoom out text';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomOutText'][1] = 'The text set on the zoom out button. By default its the "-" sign. Leave empty for the default value';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInTitle'][0] = 'Zoom in title';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInTitle'][1] = 'The title set on the zoom in button.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomOutTitle'][0] = 'Zoom out title';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomOutTitle'][1] = 'The title set on the zoom out button.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['active'][0] = 'Activate control';
$GLOBALS['TL_LANG']['tl_leaflet_control']['active'][1] = 'Activate control on the map.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['attributions'][0] = 'Attributions';
$GLOBALS['TL_LANG']['tl_leaflet_control']['attributions'][1] = 'Add attribution texts. HTML is allowed here.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['prefix'][0] = 'Attribution prefix';
$GLOBALS['TL_LANG']['tl_leaflet_control']['prefix'][1] = 'Customize the attribution prefix. By default it\'s the Leaflet link. HTML is allowed here.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['maxWidth'][0] = 'Max width';
$GLOBALS['TL_LANG']['tl_leaflet_control']['maxWidth'][1] = 'Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).';
$GLOBALS['TL_LANG']['tl_leaflet_control']['metric'][0] = 'Metric scale';
$GLOBALS['TL_LANG']['tl_leaflet_control']['metric'][1] = 'Whether to show the metric scale line (m/km).';
$GLOBALS['TL_LANG']['tl_leaflet_control']['imperial'][0] = 'Imperial scale';
$GLOBALS['TL_LANG']['tl_leaflet_control']['imperial'][1] = 'Whether to show the imperial scale line (mi/ft).';
$GLOBALS['TL_LANG']['tl_leaflet_control']['updateWhenIdle'][0] = 'Update when idle';
$GLOBALS['TL_LANG']['tl_leaflet_control']['updateWhenIdle'][1] = 'If true, the control is updated on moveend, otherwise it\'s always up-to-date (updated on move).';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layers'][0] = 'Layers';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layers'][1] = 'Add layers to the control.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layer'][0] = 'Layer';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layer'][1] = 'Choose a layer. Each layer can only be added once.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layerMode'][0] = 'Mode';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layerMode'][1] = 'Add layer as baselayer or overlay.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['collapsed'][0] = 'Collapsed';
$GLOBALS['TL_LANG']['tl_leaflet_control']['collapsed'][1] = 'If true, the control will be collapsed into an icon and expanded on mouse hover or touch.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['autoZIndex'][0] = 'Auto zIndex';
$GLOBALS['TL_LANG']['tl_leaflet_control']['autoZIndex'][1] = 'If true, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['spin'][0] = 'Spin.js configuration';
$GLOBALS['TL_LANG']['tl_leaflet_control']['spin'][1] = 'Use valid json to configure the spin.js plugin. For more details see <a href="http://fgnass.github.io/spin.js/" target="_blank">http://fgnass.github.io/spin.js/</a>.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['spinjs'][0] = 'Use spin.js';
$GLOBALS['TL_LANG']['tl_leaflet_control']['spinjs'][1] = 'Instead of an background image the spin.js plugin is used.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['separate'][0] = 'Separate';
$GLOBALS['TL_LANG']['tl_leaflet_control']['separate'][1] = 'Display control separate from zoom control.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomControl'][0] = 'Zoom control';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomControl'][1] = 'Assign loading control to a specific zoom control. If it\'s not used on the map/activated the default one is used.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layerMode'][0] = 'Mode';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layerMode'][1] = 'Add layer as baselayer or overlay.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['title'][0] = 'Title';
$GLOBALS['TL_LANG']['tl_leaflet_control']['title'][1] = 'Title of the control.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['alias'][0] = 'Alias';
$GLOBALS['TL_LANG']['tl_leaflet_control']['alias'][1] = 'Alias of the control.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['type'][0] = 'Type';
$GLOBALS['TL_LANG']['tl_leaflet_control']['type'][1] = 'Choose the control type.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['position'][0] = 'Position';
$GLOBALS['TL_LANG']['tl_leaflet_control']['position'][1] = 'Position of the control.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInText'][0] = 'Zoom in text';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInText'][1] = 'The text set on the zoom in button. By default its the "+" sign. Leave empty for the default value';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomOutText'][0] = 'Zoom out text';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomOutText'][1] = 'The text set on the zoom out button. By default its the "-" sign. Leave empty for the default value';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInTitle'][0] = 'Zoom in title';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomInTitle'][1] = 'The title set on the zoom in button.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomOutTitle'][0] = 'Zoom out title';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomOutTitle'][1] = 'The title set on the zoom out button.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['active'][0] = 'Activate control';
$GLOBALS['TL_LANG']['tl_leaflet_control']['active'][1] = 'Activate control on the map.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['attributions'][0] = 'Attributions';
$GLOBALS['TL_LANG']['tl_leaflet_control']['attributions'][1] = 'Add attribution texts. HTML is allowed here.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['prefix'][0] = 'Attribution prefix';
$GLOBALS['TL_LANG']['tl_leaflet_control']['prefix'][1] = 'Customize the attribution prefix. By default it\'s the Leaflet link. HTML is allowed here.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['maxWidth'][0] = 'Max width';
$GLOBALS['TL_LANG']['tl_leaflet_control']['maxWidth'][1] = 'Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).';
$GLOBALS['TL_LANG']['tl_leaflet_control']['metric'][0] = 'Metric scale';
$GLOBALS['TL_LANG']['tl_leaflet_control']['metric'][1] = 'Whether to show the metric scale line (m/km).';
$GLOBALS['TL_LANG']['tl_leaflet_control']['imperial'][0] = 'Imperial scale';
$GLOBALS['TL_LANG']['tl_leaflet_control']['imperial'][1] = 'Whether to show the imperial scale line (mi/ft).';
$GLOBALS['TL_LANG']['tl_leaflet_control']['updateWhenIdle'][0] = 'Update when idle';
$GLOBALS['TL_LANG']['tl_leaflet_control']['updateWhenIdle'][1] = 'If true, the control is updated on moveend, otherwise it\'s always up-to-date (updated on move).';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layers'][0] = 'Layers';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layers'][1] = 'Add layers to the control.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layer'][0] = 'Layer';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layer'][1] = 'Choose a layer. Each layer can only be added once.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layerMode'][0] = 'Mode';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layerMode'][1] = 'Add layer as baselayer or overlay.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['collapsed'][0] = 'Collapsed';
$GLOBALS['TL_LANG']['tl_leaflet_control']['collapsed'][1] = 'If true, the control will be collapsed into an icon and expanded on mouse hover or touch.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['autoZIndex'][0] = 'Auto zIndex';
$GLOBALS['TL_LANG']['tl_leaflet_control']['autoZIndex'][1] = 'If true, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['spin'][0] = 'Spin.js configuration';
$GLOBALS['TL_LANG']['tl_leaflet_control']['spin'][1] = 'Use valid json to configure the spin.js plugin. For more details see <a href="http://fgnass.github.io/spin.js/" target="_blank">http://fgnass.github.io/spin.js/</a>.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['spinjs'][0] = 'Use spin.js';
$GLOBALS['TL_LANG']['tl_leaflet_control']['spinjs'][1] = 'Instead of an background image the spin.js plugin is used.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['separate'][0] = 'Separate';
$GLOBALS['TL_LANG']['tl_leaflet_control']['separate'][1] = 'Display control separate from zoom control.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomControl'][0] = 'Zoom control';
$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomControl'][1] = 'Assign loading control to a specific zoom control. If it\'s not used on the map/activated the default one is used.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layerMode'][0] = 'Mode';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layerMode'][1] = 'Add layer as baselayer or overlay.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layerMode'][0] = 'Mode';
$GLOBALS['TL_LANG']['tl_leaflet_control']['layerMode'][1] = 'Add layer as baselayer or overlay.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['buttonTitle'][0] = 'Button title';
$GLOBALS['TL_LANG']['tl_leaflet_control']['buttonTitle'][1] = 'Title attribute of the control button.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['simulateFullScreen'][0] = 'Always simulate fullscreen';
$GLOBALS['TL_LANG']['tl_leaflet_control']['simulateFullScreen'][1] = 'Simulate fullscreen no matter if the browser supports the Fullscreen API.';
$GLOBALS['TL_LANG']['tl_leaflet_control']['bottomleft'][0] = 'Bottom left';
$GLOBALS['TL_LANG']['tl_leaflet_control']['bottomleft'][1] = 'Bottom left of the map.';