Skip to content

Commit

Permalink
Add editor/embed support for map_background_color
Browse files Browse the repository at this point in the history
  • Loading branch information
jywsn committed Mar 18, 2014
1 parent 622acbf commit 280ae32
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/embed/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@
if(d.storymap.map_as_image) {
options.map_as_image = d.storymap.map_as_image;
}
if(d.storymap.map_background_color) {
options.map_background_color = d.storymap.map_background_color;
}
if(d.storymap.language) {
options.language = d.storymap.language;
}
Expand Down
6 changes: 6 additions & 0 deletions website/templates/_modals.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ <h5>Options</h5>
</div>
</div>
<!-- zoomify -->
<div class="control-group zoomify-control-group">
<label class="control-label">Map Background Color</label>
<div class="controls">
<input id="map_background_color" type="text" placeholder="#ffffff">
</div>
</div>
<div class="control-group zoomify-control-group">
<label class="control-label">Zoomify URL</label>
<div class="controls">
Expand Down
23 changes: 23 additions & 0 deletions website/templates/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
language: "en",
map_type: "stamen:toner-lite",
map_subdomains: "",
map_background_color: '#ffffff',
// just one...
slide: {
date: "",
Expand Down Expand Up @@ -413,6 +414,9 @@
if(_storymap_data.storymap.hasOwnProperty('map_as_image')) {
options.map_as_image = _storymap_data.storymap.map_as_image;
}
if(_storymap_data.storymap.hasOwnProperty('map_background_color')) {
options.map_background_color = _storymap_data.storymap.map_background_color;
}
if(_storymap_data.storymap.language) {
options.language = _storymap_data.storymap.language;
}
Expand Down Expand Up @@ -477,6 +481,25 @@

$('input:radio[name="map_as_image"][value="'+get_map_as_image()+'"]').prop('checked', true);

document.getElementById('map').style.backgroundColor =
_storymap_data.storymap.map_background_color || _default_data.storymap.map_background_color;

$('#map_background_color').minicolors({
control: 'hue',
opacity: false,
theme: 'bootstrap',
hide: function() {
var color = $(this).val();
if(color != _storymap_data.storymap.map_background_color) {
_storymap_data.storymap.map_background_color = color;
storymap_dirty(1);

document.getElementById('map').style.backgroundColor =
color || _default_data.storymap.map_background_color;
}
}
});

font_update();

// Slides 1,...,n
Expand Down

0 comments on commit 280ae32

Please sign in to comment.