Add loading indicator.

This commit is contained in:
David Molineus
2015-01-08 11:01:22 +01:00
parent 5cd680562d
commit 91674e2f8d
15 changed files with 664 additions and 11 deletions

View File

@@ -48,6 +48,7 @@ $GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\ZoomCon
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Control\ScaleControlMapper';
$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\UI\MarkerMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Type\ImageIconMapper';
$GLOBALS['LEAFLET_MAPPERS'][] = 'Netzmacht\Contao\Leaflet\Mapper\Vector\PolylineMapper';
@@ -115,7 +116,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');
$GLOBALS['LEAFLET_CONTROLS'] = array('zoom', 'layers', 'scale', 'attribution', 'loading');
/*
@@ -181,3 +182,17 @@ $GLOBALS['LEAFLET_ASSETS']['leaflet-ajax'] = array(
)
);
$GLOBALS['LEAFLET_ASSETS']['leaflet-loading'] = array(
'css' => array(
array('assets/leaflet/libs/leaflet-loading/Control.Loading.css', 'file')
),
'javascript' => array(
array('assets/leaflet/libs/leaflet-loading/Control.Loading.js', 'file')
)
);
$GLOBALS['LEAFLET_ASSETS']['spin.js'] = array(
'javascript' => array(
array('assets/leaflet/libs/spin-js/spin.min.js', 'file')
)
);

View File

@@ -102,9 +102,16 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array
),
'attribution extends default' => array(
'config' => array('attributions', 'prefix')
),
'loading extends default' => array(
'config' => array('separate', 'zoomControl', 'spinjs')
)
),
'metasubpalettes' => array(
'spinjs' => array('spin')
),
'fields' => array
(
'id' => array
@@ -311,5 +318,51 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = array
'eval' => array('mandatory' => false, 'maxlength' => 255, 'tl_class' => 'clr', 'allowHtml' => true),
'sql' => "mediumblob NULL"
),
'separate' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['separate'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'zoomControl' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['zoomControl'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('Netzmacht\Contao\Leaflet\Dca\Control', 'getZoomControls'),
'reference' => &$GLOBALS['TL_LANG']['tl_leaflet_control'],
'eval' => array(
'mandatory' => false,
'tl_class' => 'w50',
'chosen' => true,
'includeBlankOption' => true
),
'sql' => "varchar(255) NOT NULL default ''"
),
'spinjs' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['spinjs'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50', 'submitOnChange' => true),
'sql' => "char(1) NOT NULL default ''"
),
'spin' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['spin'],
'exclude' => true,
'inputType' => 'textarea',
'eval' => array(
'style' => 'height:60px',
'preserveTags' => true,
'decodeEntities' => true,
'allowHtml' => true,
'rte' => 'ace|json',
'tl_class' => 'clr'
),
'sql' => "mediumtext NULL"
),
),
);

View File

@@ -49,16 +49,26 @@ $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']['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']['bottomleft'][0] = 'Bottom left';
$GLOBALS['TL_LANG']['tl_leaflet_control']['bottomleft'][1] = 'Bottom left of the map.';