Changes in / [0b6c6fc:cf12619] in OpenWorkouts-current
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
bin/js_deps
- Property mode changed from 100755 to 100644
r0b6c6fc rcf12619 179 179 180 180 leaflet_elevation() { 181 NAME=" leaflet-elevation"182 VERSION=" 0.0.8"183 URL=https://github.com/ Raruto/${NAME}/archive/${VERSION}.tar.gz181 NAME="Leaflet.Elevation" 182 VERSION="master" 183 URL=https://github.com/MrMufflon/${NAME}/archive/${VERSION}.tar.gz 184 184 check_cache ${NAME} ${VERSION} 185 185 in_cache=$? -
bin/screenshot_map
- Property mode changed from 100755 to 100644
-
ow/static/js/ow.js
r0b6c6fc rcf12619 35 35 var gpx; 36 36 var elevation; 37 var ow_charts; 37 38 38 39 var create_map = function create_map(latitude, longitude, zoom) { … … 51 52 This has to be called *after* create_map and *before* load_gpx. 52 53 */ 53 54 54 elevation = L.control.elevation({ 55 55 position: "bottomright", 56 theme: "openworkouts-theme", 56 theme: "steelblue-theme", //default: lime-theme 57 width: 600, 58 height: 125, 59 margins: { 60 top: 10, 61 right: 20, 62 bottom: 30, 63 left: 50 64 }, 57 65 useHeightIndicator: true, //if false a marker is drawn at map position 58 interpolation: d3.curveLinear, 59 elevationDiv: "#elevation", 60 detachedView: true, 61 responsiveView: true, 62 gpxOptions: { 63 async: true, 64 marker_options: { 65 startIconUrl: null, 66 endIconUrl: null, 67 shadowUrl: null, 68 }, 69 polyline_options: { 70 color: '#EE4056', 71 opacity: 0.75, 72 weight: 5, 73 lineCap: 'round' 74 }, 75 }, 76 }); 77 elevation.loadGPX(map, gpx_url); 78 // var ele_container = elevation.addTo(map); 66 interpolation: "linear", //see https://github.com/mbostock/d3/wiki/SVG-Shapes#wiki-area_interpolate 67 hoverNumber: { 68 decimalsX: 3, //decimals on distance (always in km) 69 decimalsY: 0, //deciamls on height (always in m) 70 formatter: undefined //custom formatter function may be injected 71 }, 72 xTicks: undefined, //number of ticks in x axis, calculated by default according to width 73 yTicks: undefined, //number of ticks on y axis, calculated by default according to height 74 collapsed: false //collapsed mode, show chart on click or mouseover 75 }); 76 77 var ele_container = elevation.addTo(map); 78 /* document.getElementById('ow-analysis').appendChild( 79 ele_container._container); */ 79 80 }; 80 81 … … 91 92 shadowUrl: shadow, 92 93 }, 93 polyline_options: {94 color: '#EE4056',95 opacity: 0.75,96 weight: 5,97 lineCap: 'round'98 },99 94 }); 100 95 … … 106 101 gpx.on("addline",function(e){ 107 102 elevation.addData(e.line); 103 // ow_charts.addData(e.line); 108 104 }); 109 105 }; … … 113 109 114 110 var render = function render() { 115 // create the map, add elevation, load gpx (only if needed, as the 116 // elevation plugin already loads the gpx data) 111 // create the map, add elevation, load gpx 117 112 create_map(latitude, longitude, zoom); 118 113 if (elevation) { 119 114 add_elevation_chart(); 120 115 } 121 else { 122 load_gpx(gpx_url); 123 } 116 // add_ow_charts(); 117 load_gpx(gpx_url); 124 118 }; 125 119 -
ow/templates/workout.pt
r0b6c6fc rcf12619 17 17 href="${request.static_url('ow:static/components/Leaflet/leaflet.css')}" /> 18 18 <link rel="stylesheet" tal:condition="context.has_gpx" 19 href="${request.static_url('ow:static/components/leaflet-elevation/leaflet-elevation.css')}" /> 20 <link rel="stylesheet" 21 href="${request.static_url('ow:static/css/leaflet-elevation.css')}" /> 19 href="${request.static_url('ow:static/components/Leaflet.Elevation/dist/leaflet.elevation-0.0.4.css')}" /> 22 20 </metal:css> 23 21 … … 32 30 <div class="workout-detail-resume"> 33 31 <h3 tal:content="context.title"></h3> 34 <div id="" tal:attributes="id 'workout-' + context.workout_id + '-notes'"> 35 <p tal:repeat="paragraph context.notes.split('\n')" 36 tal:content="paragraph"></p> 32 <div id="" tal:content="context.notes" 33 tal:attributes="id 'workout-' + context.workout_id + '-notes'"> 37 34 </div> 38 35 <ul class="workout-options"> 39 36 <li> 40 37 <a href="" i18n:translate="" 41 42 38 tal:attributes="href request.resource_url(context, 'edit')"> 39 edit workout 43 40 </a> 44 41 </li> 45 42 <li> 46 43 <a href="" i18n:translate="" 47 48 44 tal:attributes="href request.resource_url(context, 'update-from-file')"> 45 update with tracking file 49 46 </a> 50 47 </li> 51 48 <li class="owo-del"><a href="" i18n:translate="" 52 49 tal:attributes="href request.resource_url(context, 'delete')"> 53 50 delete 54 </a>51 </a> 55 52 </li> 56 53 </ul> … … 75 72 <span><tal:t i18n:translate="">Speed</tal:t></span> 76 73 <span class="avg"><tal:t i18n:translate="">Avg.</tal:t> 77 74 <tal:c tal:content="round(context.speed['avg'], 1)"></tal:c>km/h</span> 78 75 <span class="max"><tal:t i18n:translate="">Max.</tal:t> 79 76 <tal:c tal:content="round(context.speed['max'], 1)"></tal:c>km/h</span> 80 77 </li> 81 78 <li tal:condition="hr"> 82 79 <span><tal:t i18n:translate="">Heart Rate</tal:t></span> 83 80 <span class="avg"><tal:t i18n:translate="">Avg.</tal:t> 84 81 <tal:c tal:content="hr['avg']"></tal:c>bpm</span> 85 82 <span class="max"><tal:t i18n:translate="">Max.</tal:t> 86 83 <tal:c tal:content="hr['max']"></tal:c> bpm</span> 87 84 </li> 88 85 <li tal:condition="cad"> 89 86 <span><tal:t i18n:translate="">Cadence</tal:t></span> 90 87 <span class="avg"><tal:t i18n:translate="">Avg.</tal:t> 91 88 <tal:c tal:content="cad['avg']"></tal:c></span> 92 89 <span class="max"><tal:t i18n:translate="">Max.</tal:t> 93 90 <tal:c tal:content="cad['max']"></tal:c></span> 94 91 </li> 95 92 <li tal:condition="atemp"> 96 93 <span><tal:t i18n:translate="">Temperature</tal:t></span> 97 94 <span class="min"><tal:t i18n:translate="">Min.</tal:t> 98 95 <tal:c tal:content="atemp['min']"></tal:c>℃</span> 99 96 <span class="avg"><tal:t i18n:translate="">Avg.</tal:t> 100 97 <tal:c tal:content="atemp['avg']"></tal:c>℃</span> 101 98 <span class="max"><tal:t i18n:translate="">Max.</tal:t> 102 99 <tal:c tal:content="atemp['max']"></tal:c>℃</span> 103 100 </li> 104 101 </ul> 105 <div id="elevation"></div>106 102 </div> 107 103 </div> 108 109 104 <!--! Track map --> 110 105 <div id="map" tal:condition="context.has_gpx"></div> 106 107 <!--! Additional map controls --> 108 109 <div id="ow-analysis"> 110 111 <!--! 112 FIXME: the list of available charts should come from the workout 113 details, based on which data this workout has 114 --> 115 <!--! All those ids are needed for the leaflet openworkouts plugin --> 116 <tal:r tal:repeat="chart ['elevation', 'heartrate', 'cadence', 'temperature']"> 117 <div id="ow-" tal:attributes="id 'ow-' + chart"> 118 <div class="ow-average" id="" 119 tal:attributes="id 'ow-' + chart + '-average'"></div> 120 <div class="ow-chart" id="" 121 tal:attributes="id 'ow-' + chart + '-chart'"></div> 122 <div class="ow-current" id="" 123 tal:attributes="id 'ow-' + chart + '-current'"></div> 124 </div> 125 </tal:r> 126 127 </div> 111 128 </metal:content> 112 129 113 130 <metal:body-js metal:fill-slot="body-js"> 114 131 115 <script src="${request.static_url('ow:static/components/d3/d3.min.js')}" 132 133 <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script> 134 <!-- 135 <script src="${request.static_url('ow:static/d3/d3.min.js')}" 116 136 tal:condition="context.has_gpx"></script> 137 --> 117 138 118 139 <script src="${request.static_url('ow:static/components/Leaflet/leaflet.js')}" … … 122 143 tal:condition="context.has_gpx"></script> 123 144 124 <script src="${request.static_url('ow:static/components/ leaflet-elevation/leaflet-elevation.js')}"145 <script src="${request.static_url('ow:static/components/Leaflet.Elevation/dist/leaflet.elevation-0.0.4.min.js')}" 125 146 tal:condition="context.has_gpx"></script> 126 147
Note: See TracChangeset
for help on using the changeset viewer.