mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
HTML: export valid JSON.
Remove the trailing commas from the exported JSON file as some json parsers just don't like it. The file 'file.json' is valid acording to the JSON spesification. Note: its a javascript file containing a JS variable 'trips' and not a JSON file. Because loading a pure JSON file from local disk is not accepted by the web-browsers itself. Actually I think changing the file extension to .js is now makes more sense. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4099aca82d
commit
abfa4f2108
2 changed files with 157 additions and 114 deletions
|
@ -897,7 +897,7 @@ function get_bookmark_HTML(event)
|
|||
*/
|
||||
function get_bookmarks_HTML(dive)
|
||||
{
|
||||
if (dive.events <= 0)
|
||||
if (!dive.events || dive.events <= 0)
|
||||
return "";
|
||||
var result = "";
|
||||
result += '<h2 class="det_hed">' + translate.Events + '</h2><table><tr><td class="words">' + translate.Name + '</td><td class="words">' + translate.Time + '</td><td class="words">' + translate.Value + '</td></tr>';
|
||||
|
@ -976,7 +976,7 @@ function get_status_HTML(dive)
|
|||
|
||||
function get_dive_photos(dive)
|
||||
{
|
||||
if (dive.photos.length <= 0) {
|
||||
if (!dive.photos || dive.photos.length <= 0) {
|
||||
document.getElementById("divephotos").style.display = 'none';
|
||||
return "";
|
||||
}
|
||||
|
@ -1092,11 +1092,13 @@ function canvas_draw()
|
|||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < items[dive_id].events.length; i++) {
|
||||
eventsData.push([
|
||||
items[dive_id].events[i].time / 60,
|
||||
0
|
||||
]);
|
||||
if (items[dive_id].events) {
|
||||
for (var i = 0; i < items[dive_id].events.length; i++) {
|
||||
eventsData.push([
|
||||
items[dive_id].events[i].time / 60,
|
||||
0
|
||||
]);
|
||||
}
|
||||
}
|
||||
if (plot1) {
|
||||
$('chart1').unbind();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue