Changeset a0085a2 in OpenWorkouts-current


Ignore:
Timestamp:
Dec 17, 2018, 12:20:52 PM (5 years ago)
Author:
borja <borja@…>
Branches:
current, feature/docs, master
Children:
8e5f92c
Parents:
f24ad73
Message:

Added missing leaflet elevation third-party js library.

We have been using this for elevation charts in the workout details page.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bin/js_deps

    rf24ad73 ra0085a2  
    178178}
    179179
    180 
     180leaflet_elevation() {
     181    NAME="Leaflet.Elevation"
     182    VERSION="master"
     183    URL=https://github.com/MrMufflon/${NAME}/archive/${VERSION}.tar.gz
     184    check_cache ${NAME} ${VERSION}
     185    in_cache=$?
     186    if [ ${in_cache} -eq 0 -a ${REINSTALL} -eq 1 ]; then
     187        echo "${NAME}-${VERSION} $ALREADY_INSTALLED"
     188    else
     189        echo "> Installing ${NAME} ${VERSION}"
     190        if [ -d ${COMPONENTS}/${NAME} ]; then
     191            # Clean up, delete previous install before installing
     192            rm -r ${COMPONENTS}/${NAME}
     193        fi
     194        cd ${TMP}
     195        ${GET} ${URL}
     196        ${TAR} ${VERSION}.tar.gz
     197        cd ${CURRENT}
     198        mv ${TMP}/${NAME}-${VERSION} ${COMPONENTS}/${NAME}
     199        echo "${NAME}-${VERSION}" >> ${CACHE}
     200        echo "< Installed ${NAME} ${VERSION}"
     201    fi
     202}
    181203
    182204echo "Installing JS dependencies in ${COMPONENTS}"
     
    186208leaflet
    187209leaflet_gpx
     210leaflet_elevation
    188211
    189212# Clean up, remove the tmp directory
  • ow/templates/workout.pt

    rf24ad73 ra0085a2  
    1616    <link rel="stylesheet" tal:condition="context.has_gpx"
    1717          href="${request.static_url('ow:static/components/Leaflet/leaflet.css')}" />
     18    <link rel="stylesheet" tal:condition="context.has_gpx"
     19          href="${request.static_url('ow:static/components/Leaflet.Elevation/dist/leaflet.elevation-0.0.4.css')}" />
    1820
    1921    <!--!
     
    129131            tal:condition="context.has_gpx"></script>
    130132
    131     <script src="${request.static_url('ow:static/leaflet-gpx/gpx.js')}"
     133    <script src="${request.static_url('ow:static/components/leaflet-gpx/gpx.js')}"
     134            tal:condition="context.has_gpx"></script>
     135
     136    <script src="${request.static_url('ow:static/components/Leaflet.Elevation/dist/leaflet.elevation-0.0.4.min.js')}"
    132137            tal:condition="context.has_gpx"></script>
    133138
Note: See TracChangeset for help on using the changeset viewer.