- download usecase
- select all or no modules - better reset for offline usecase - preset loader for offline usecase
This commit is contained in:
parent
08a6d31d32
commit
5c624df96f
2 changed files with 124 additions and 85 deletions
189
index.html
189
index.html
|
|
@ -104,93 +104,94 @@
|
||||||
</div>
|
</div>
|
||||||
<a id="downloadAnchorElem" style="display:none"></a>
|
<a id="downloadAnchorElem" style="display:none"></a>
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
* Settings Modal
|
||||||
|
*-->
|
||||||
|
<div class="modal fade" id="settings" tabindex="-1" role="dialog">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
|
<h4 class="modal-title"><span class="glyphicon glyphicon-globe"></span> Settings</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-md-6">
|
||||||
|
<label for="offset">Automatic Geolocation</label><br />
|
||||||
|
<button id="locate" class="btn btn-default"><span class="glyphicon glyphicon-map-marker"></span> Locate Me</button>
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-md-6">
|
||||||
|
<label for="lon">Manual Geolocation</label>
|
||||||
|
<input type="text" autocomplete="off" id="search" class="address form-control args" placeholder="City"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-md-6">
|
||||||
|
<label for="datetime">Date and Time</label>
|
||||||
|
<input type="text" class="form-control" id="datetime" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-md-6">
|
||||||
|
<label for="offset">UTC Offset</label>
|
||||||
|
<input type="text" class="coords form-control args" id="offset" placeholder="3"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-md-6">
|
||||||
|
<label for="lat">Latitude</label>
|
||||||
|
<input type="text" class="coords form-control args" id="lat" placeholder="37.2204674515" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-md-6">
|
||||||
|
<label for="lon">Longitude</label>
|
||||||
|
<input type="text" class="coords form-control args" id="lon" placeholder="38.9200813197"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-md-4">
|
||||||
|
<label for="lon">Generate Days</label>
|
||||||
|
<input type="text" id="days" class="form-control" value="7">
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-md-4">
|
||||||
|
<label for="lon">Filter Hours</label>
|
||||||
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<input id="future" type="checkbox"> Hide Past
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-md-4">
|
||||||
|
<label for="lon">Zodiac System</label>
|
||||||
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<input id="zodiac" type="checkbox"> Sidereal
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-md-12">
|
||||||
|
<label for="lon">Modules to Use</label>
|
||||||
|
<p><a id="allModules">All</a> <a id="noModules">None</a></p>
|
||||||
|
<div id="moduleSelect" class="checkbox form-check form-check-inline">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<label class="btn btn-default pull-left" id="fileInputLabel" for="fileInput">
|
||||||
|
<input id="fileInput" type="file" style="display:none"
|
||||||
|
onchange="$('#fileInputLabel').removeClass('btn-default').addClass('btn-success').find('span').html(this.files[0].name)">
|
||||||
|
<span>Select File</span>
|
||||||
|
</label>
|
||||||
|
<button type="button" class="btn btn-primary" id="generate" >Generate</button>
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
* DOM object with all modal templates
|
* DOM object with all modal templates
|
||||||
*-->
|
*-->
|
||||||
<div id="modals">
|
<div id="modals"></div>
|
||||||
|
|
||||||
<!--
|
|
||||||
* Settings Modal
|
|
||||||
*-->
|
|
||||||
<div class="modal fade" id="settings" tabindex="-1" role="dialog">
|
|
||||||
<div class="modal-dialog" role="document">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
|
||||||
<h4 class="modal-title"><span class="glyphicon glyphicon-globe"></span> Settings</h4>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="row">
|
|
||||||
<div class="form-group col-md-6">
|
|
||||||
<label for="offset">Automatic Geolocation</label><br />
|
|
||||||
<button id="locate" class="btn btn-default"><span class="glyphicon glyphicon-map-marker"></span> Locate Me</button>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-md-6">
|
|
||||||
<label for="lon">Manual Geolocation</label>
|
|
||||||
<input type="text" autocomplete="off" id="search" class="address form-control args" placeholder="City"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="form-group col-md-6">
|
|
||||||
<label for="datetime">Date and Time</label>
|
|
||||||
<input type="text" class="form-control" id="datetime" />
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-md-6">
|
|
||||||
<label for="offset">UTC Offset</label>
|
|
||||||
<input type="text" class="coords form-control args" id="offset" placeholder="3"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="form-group col-md-6">
|
|
||||||
<label for="lat">Latitude</label>
|
|
||||||
<input type="text" class="coords form-control args" id="lat" placeholder="37.2204674515" />
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-md-6">
|
|
||||||
<label for="lon">Longitude</label>
|
|
||||||
<input type="text" class="coords form-control args" id="lon" placeholder="38.9200813197"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="form-group col-md-4">
|
|
||||||
<label for="lon">Generate Days</label>
|
|
||||||
<input type="text" id="days" class="form-control" value="7">
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-md-4">
|
|
||||||
<label for="lon">Filter Hours</label>
|
|
||||||
<div class="checkbox">
|
|
||||||
<label>
|
|
||||||
<input id="future" type="checkbox"> Hide Past
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-md-4">
|
|
||||||
<label for="lon">Zodiac System</label>
|
|
||||||
<div class="checkbox">
|
|
||||||
<label>
|
|
||||||
<input id="zodiac" type="checkbox"> Sidereal
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-md-12">
|
|
||||||
<label for="lon">Modules to Use</label>
|
|
||||||
<div id="moduleSelect" class="checkbox form-check form-check-inline">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-footer">
|
|
||||||
<label class="btn btn-default pull-left" id="fileInputLabel" for="fileInput">
|
|
||||||
<input id="fileInput" type="file" style="display:none"
|
|
||||||
onchange="$('#fileInputLabel').removeClass('btn-default').addClass('btn-success').find('span').html(this.files[0].name)">
|
|
||||||
<span>Select File</span>
|
|
||||||
</label>
|
|
||||||
<button type="button" class="btn btn-primary" id="generate" >Generate</button>
|
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
* jQuery.loadTemplate templates
|
* jQuery.loadTemplate templates
|
||||||
|
|
@ -296,6 +297,14 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#allModules").on("click", function() {
|
||||||
|
$('#moduleSelect input:checkbox').prop('checked', true);
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#noModules").on("click", function() {
|
||||||
|
$('#moduleSelect input:checkbox').prop('checked', false);
|
||||||
|
});
|
||||||
|
|
||||||
// OSMNAmes OsmNamesAutocomplete
|
// OSMNAmes OsmNamesAutocomplete
|
||||||
var autocomplete = new kt.OsmNamesAutocomplete('search', 'https://geocoder.tilehosting.com/', 'kqIwOXlhKKgBoR5zVAnm');
|
var autocomplete = new kt.OsmNamesAutocomplete('search', 'https://geocoder.tilehosting.com/', 'kqIwOXlhKKgBoR5zVAnm');
|
||||||
autocomplete.registerCallback(function(item) {
|
autocomplete.registerCallback(function(item) {
|
||||||
|
|
@ -328,6 +337,18 @@
|
||||||
|
|
||||||
// "Reset" button in navbar menu bar
|
// "Reset" button in navbar menu bar
|
||||||
$('#filterreset').on('click', function() {
|
$('#filterreset').on('click', function() {
|
||||||
|
if ( $("body").attr("use") == "offline" ) {
|
||||||
|
$("#grid").empty();
|
||||||
|
$('#caption .stoke').html("resetting...please wait.");
|
||||||
|
$.get("presets/grid.html").done(function(html) {
|
||||||
|
$("#grid").append(html);
|
||||||
|
$('#caption .stoke').empty();
|
||||||
|
$('#moduleSelect input:checkbox').prop('checked', true);
|
||||||
|
$('.planetaryhour').on('click', SL.Calendar.hourInfo);
|
||||||
|
if ( $('#calendar').data('isotope') ) $('#calendar').isotope('destroy');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$('.actionlistfilter input').prop('checked', false);
|
||||||
$('.filteroptions input').prop('checked', false);
|
$('.filteroptions input').prop('checked', false);
|
||||||
filters = {};
|
filters = {};
|
||||||
$('#calendar').isotope({ filter: '*' });
|
$('#calendar').isotope({ filter: '*' });
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,8 @@ SL.Calendar = (function() {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
$('#caption .stoke').empty();
|
$('#caption .stoke').empty();
|
||||||
if ( $("body").attr("use") == "download" )
|
if ( $("body").attr("use") == "download" )
|
||||||
SL.Calendar.download( $("#grid").html(), fname, "skip", "html", "text/html; charset=utf-8");
|
SL.Calendar.download( $("#grid").html(), "grid.html", "skip", "html", "text/html; charset=utf-8");
|
||||||
|
SL.Calendar.download(Hours.moments, "ephemeris");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -384,6 +385,9 @@ SL.Calendar = (function() {
|
||||||
modal(plugin, definitions);
|
modal(plugin, definitions);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if ( $("body").attr("use") == "download" )
|
||||||
|
SL.Calendar.download( $("#filterList").html(), "filtermenu.html", "skip", "html", "text/html; charset=utf-8");
|
||||||
|
SL.Calendar.download( $("#modals").html(), "modals.html", "skip", "html", "text/html; charset=utf-8");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -518,6 +522,20 @@ SL.Calendar = (function() {
|
||||||
extend(m, eval('module_'+m));
|
extend(m, eval('module_'+m));
|
||||||
});
|
});
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
|
if ( $("body").attr("use") == "offline" ) {
|
||||||
|
$('#caption .stoke').html("loading preset...please wait.");
|
||||||
|
$.get("presets/filtermenu.html").done(function(html) {$("#filterList").append(html);});
|
||||||
|
$.get("presets/modals.html").done(function(html) {$("#modals").append(html);});
|
||||||
|
$.get("presets/grid.html").done(function(html) {
|
||||||
|
$("#grid").append(html);
|
||||||
|
$('#caption .stoke').empty();
|
||||||
|
$('#moduleSelect input:checkbox').prop('checked', true);
|
||||||
|
$('.planetaryhour').on('click', SL.Calendar.hourInfo);
|
||||||
|
});
|
||||||
|
$.getJSON("presets/ephemeris.json", function(json) {
|
||||||
|
Hours.moments = json.query;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue