Commit graph

108 commits

Author SHA1 Message Date
Michael Keller
2244f3f528 Export: Cleanup jqplot Module References.
Clean up references to the jqplot modules that were overlooked in #4350.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-10-22 10:23:29 +13:00
Michael Keller
364c776ff1 Export: Update jquery to a Secure Version.
Update jquery to a version that fixes known security vulnerabilities.
Triggered by https://github.com/subsurface/subsurface/security/dependabot/7

Signed-off-by: Michael Keller <github@ike.ch>
2024-10-21 09:25:19 +13:00
Martin Splitt
30c5dfce00 HTML export: make element ids more consistent
Signed-off-by: Martin Splitt <martinsplitt@google.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-01-19 06:56:52 -08:00
Martin Splitt
02f4eb6904 HTML export: rename divemaster references to diveguide
This fixes the search in the web export.

Signed-off-by: Martin Splitt <splitti@google.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-01-19 06:56:52 -08:00
Berthold Stoeger
9e0712d5dc core: replace dive master by dive guide
In general, replace "dive master" by "dive guide".

However, do not change written dive logs for now. On reading,
accept both versions.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-02-15 09:35:43 -08:00
Robert C. Helling
285fa8acbc Grammar: replaces 'indexes' by 'indices'
Grammar-nazi ran

git grep -l 'indexes' | xargs sed -i '' -e 's/indexes/indices/g'

to prevent future wincing when reading the source code.

Unfortunatly, Qt itself is infected as in
QModelIndexList QItemSelection::indexes() const

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-03-11 08:26:30 -07:00
willemferguson
7c024f12d2 Desktop: add export to html
Add the export of environmental parameters in star widgets to .html format. The
dive rating is always shown both in the condensed as well as in the expanded
view. The other five environmental variables are only shown in the expanded
view. Only those star widgets with a rating are shown: if a star widget has not
been rated in the UI, then it is assumed unrated and is not indicated in the
expanded view.

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-03 20:37:57 -08:00
Dirk Hohndel
0a25b32ca0 Cleanup: deal with lgtm.com Alerts
Small, obvious fixes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-03-16 20:25:24 -07:00
Rolf Eike Beer
7b1d5c5b8d JavaScript: remove needless variable assignments
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-16 10:06:26 -07:00
Rolf Eike Beer
2f6f48adec mark JavaScript variables as local
Found by LGTM.

Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-16 10:06:26 -07:00
Monty Taylor
8603a7d826 Reverse html trip list rendering order
In the HTML export, the list of trips emitted into lib.js is in
chronological order, the dives are shown reverse chronological order.
This leads to a weird experience of the earliest trip being on top and
the dives within it having the most recent dive on top.

Invert the processing order in the javascript layer so that the last
trip is rendered first.

Signed-off-by: Monty Taylor <mordred@inaugust.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-13 08:52:15 -07:00
Berthold Stoeger
5c248d91cd Coding-style: remove superfluous parentheses
Mostly replace "return (expression);" by "return expression;" and one
case of "function((parameter))" by "function(parameter)".

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-02-17 19:38:52 -08:00
Martin Měřinský
dcf2542215 Use abbreviations with dots. 2017-03-11 08:09:07 -08:00
Sander Kleijwegt
a02ea68582 HTML Export: Ignore case when searching for tags
Fixes #934

Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-04 16:29:32 +01:00
Dirk Hohndel
293569cb19 HTML export: before showing the dive list, sort descending by dive number
This way the newest dive gets shown first (which I think makes much more
sense) and the dives are in order as we show them in Subsurface.

I actually think we should toggle trips on by default - but I'm not sure.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-18 22:04:11 -07:00
Dirk Hohndel
f5510892a6 HTML export: cosmetic change to show 20 dives by default
10 just seemed a little... low.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-18 22:03:13 -07:00
Gehad elrobey
d23e71e99a HTML: Fix spelling mistake
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-18 21:31:18 -07:00
Dirk Hohndel
9f5207fc0d HTML exports: minor cosmetic improvements
This brings up the satellite view when clicking on GPS coordinates and
sets a slightly better page title.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 17:04:16 -07:00
Anton Lundin
b052d63789 Hide the dive-related controls when showing trips
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 16:38:11 -07:00
Anton Lundin
cfd001702f Make the expand/collapse buttons usefull on trips
There where some issues with trying to access non-existing dom elements
when clicking them when showing trips.

Instead of fixing that issue, this actually makes them do something
useful, expanding and collapsing the trips.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 16:38:03 -07:00
Anton Lundin
00db47b19e Remove old timing of function
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 16:37:58 -07:00
Dirk Hohndel
b345db0a64 HTML export: better Google maps link
This way we get an actual place marker

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 12:38:24 -07:00
Dirk Hohndel
a922e52b8f HTML Exporter: make JS work on Firefox as well
It appears the standard way to figure out what type of element is sending
the event is to use .target instead of .toElement - specifically, Firefox
doesn't understand .toElement and so the expansion of dives by clicking on
them didn't work in Firefox.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 10:15:08 -07:00
Gehad elrobey
5d09244c0f HTML: fix the unclosed <ul> tag.
The <ul> tag must be closed as defined by the html specs.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-17 09:29:39 -07:00
Gehad elrobey
3ff73d0a66 HTML: don't collapse the dive if hyperlink is clicked
fixes the wrong behaviour as dive details must not be closed when
hyperlinks are clicking, So check for Hyperlinks before toggling the
dive.

Fixes #713

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-25 02:34:29 -07:00
Gehad elrobey
e70dbb568d HTML: don't show dive photos if photos are missing
some photos can be missing due to permission issues during exporting.

There are 3 cases:

-All photos are missing, the photo view must disapear.
-Some photos are missing, these photos must not be shown.
-No missing photos, all the photos must be viewed.

at loading try to get all the existing photos by GET. missing photos
must be marked for later removal. After all asynchronous GET requests
are received, remove all missing photos then finally show them all.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 11:02:28 -07:00
Gehad elrobey
9e09bc0f52 HTML: Report start cylinder pressure correctly.
Report start cylinder pressure from the samples with empty value.
Must search for the first nonzero value.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 11:02:21 -07:00
Gehad elrobey
d922dbbd99 HTML: fix the value of cylinder gas in trimix dives
Value of He must be showed in trimix dives, also fixes the format of the
dive events table. Gas change should be something like O2: 50 - He 0

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-11 11:02:16 -07:00
Gehad elrobey
0995a800d9 HTML: Add Max. depth to dive view.
Add Max. Depth feild to the expanded and main dive views.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-28 12:43:17 +01:00
Gehad elrobey
c97128102d HTML: add Depth and Duration data to the dive list view.
Add the Depth and Duration information to the list view and make dives
sortable by them instead of the water and air temperatures.

Fixes #725

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-06 07:04:06 -08:00
Miika Turkia
194d4b4c00 Variable should be declared before loop
Fixing incorrect variable scope. (I do not really see any functional
differences on Firefox, but better declare the variable before the
loop.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-02 07:05:42 -08:00
Gehad elrobey
e3be473a7f Fix inconsistent search result in HTML export
The advanced search drop down menu always showed the user selected
settings, even if this is a customized search (tag, location) that took
place by clicking on the search quick hyperlink.

This is fixed by saving the user default search preferences and changing
them temporarily when quick hyperlinks searching is used.

Fixes #723

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01 22:03:01 -07:00
Gehad elrobey
540dbe927e HTML: Fix the Javascript library to support multi units.
-make the dive profile dynamic to check user selected units from the
settings file.
-some of the code needs to be refactored and copied to a more
appropriate location.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-20 18:08:49 -07:00
Gehad elrobey
8aa387414c HTML: Cursor is on top of graph tooltip
-change the color of the depth graph slightly to be more readable.
-change the tooltip of the depth graph to NW-corner of the cursor.
-change the opacity of the tooltip for readability.

Fixes #724

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:31:42 -07:00
Gehad Elrobey
01d0eb5f8b HTML: fix typo in dive counter
adds a missing space to dive counter.

Fixes #722

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:30:36 -07:00
Tim Wootton
9901169485 Bring save html capitalisation in line
Converted save html to use same capitalisation style as the
rest of the application
Changed references to equipments to equipment.

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18 06:25:24 -07:00
Gehad elrobey
3925aed5ea HTML: Changing the files extensions to js
These are actually javascript files containing js objects and not json
files.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-28 07:43:18 -07:00
Gehad elrobey
abfa4f2108 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>
2014-08-28 07:43:14 -07:00
Gehad elrobey
d00390d46d HTML: Save divecomputer data to the HTML exports
Save divecomputers data to the JSON files. and show them in the HTML
dive detailed view.

Fixes #711

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-27 07:18:41 -07:00
Gehad elrobey
d72e02c83e HTML: time unit is in minutes not seconds.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 22:58:42 -05:00
Gehad elrobey
4ac018712f HTML: Fix Fake precision value.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 22:58:39 -05:00
Gehad elrobey
16515a970f HTML: change empty O2 Value to Air.
-Change column name to 'Gas' as changed in Subsurface.
-Replace '--' with 'Air' to empty tanks.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 12:03:24 -06:00
Gehad elrobey
5b9537222e HTML: Make theme colors consistent.
Buttons and fields colors must be consistent in different themes.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 12:03:22 -06:00
Gehad elrobey
1494ea9727 HTML: Make SAC, OTU and CNS in uppercase letters.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 12:03:19 -06:00
Gehad elrobey
9194a43fd4 HTML: add units to time in dive profile.
Also change the separator to a colon which is more readable.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 12:03:17 -06:00
Gehad elrobey
27e400f5e4 HTML: don't show cylinders or weights table if they don't exist
Don't show the table header of cylinders or weights if they are not
available.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 12:03:14 -06:00
Miika Turkia
d83c36c36b Fix typo
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-17 12:03:01 -06:00
Gehad elrobey
9015160199 HTML: Add coordinates to the HTML exports
- Export dive coordinates (if exist) to JSON file.
- Add dive coordinates to list view and detailed dive view.
- Add hyperlink that opens the dive location in a new tab viewed in
Google maps.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14 09:53:05 -06:00
Gehad elrobey
a03e772954 HTML: Sort by number based on the chosen number format.
Sorting by the number must be based on either subsurface number or the
regular indexing as choosed in settings.json

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14 09:53:03 -06:00
Gehad elrobey
63691ed61b HTML: arrow navigation is based on full dive list.
The navigation arrows from the detailed dive view is based on the full
dive list, regardless of 'items_to_show' list.

This can introduce unexpected behaviour if some search results or
explicitly sorted list are shown in the list view. Restoring this
list view from the detailed dive view after some arrow navigation.

Arrow navigation must be separte and don't change the 'start_id'
variable.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14 09:52:57 -06:00