mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
Security alert - Remove jquery and related
.. RideWindow is no longer required and brings in artefacts that have security alerts. This code should have been deprecated previously and was retained in error. Fixes #3426
This commit is contained in:
@@ -48,10 +48,6 @@
|
||||
#include "SpinScanPlotWindow.h"
|
||||
#include "WorkoutPlotWindow.h"
|
||||
#include "WorkoutWindow.h"
|
||||
#ifndef NOWEBKIT
|
||||
#include "RideWindow.h"
|
||||
#endif
|
||||
#include "RideMapWindow.h"
|
||||
#include "WebPageWindow.h"
|
||||
#ifdef GC_WANT_R
|
||||
#include "RChart.h"
|
||||
@@ -116,8 +112,6 @@ GcWindowRegistry::initialize()
|
||||
{ VIEW_TRAIN, tr("Workout"),GcWindowTypes::WorkoutPlot },
|
||||
{ VIEW_TRAIN, tr("Realtime"),GcWindowTypes::RealtimePlot },
|
||||
{ VIEW_TRAIN, tr("Pedal Stroke"),GcWindowTypes::SpinScanPlot },
|
||||
// { VIEW_TRAIN, tr("Map"), GcWindowTypes::MapWindow }, // DEPRECATED for now
|
||||
// { VIEW_TRAIN, tr("StreetView"), GcWindowTypes::StreetViewWindow }, // DEPRECATED for now, since it causes problems and memory leaks
|
||||
{ VIEW_TRAIN, tr("Video Player"),GcWindowTypes::VideoPlayer },
|
||||
{ VIEW_TRAIN, tr("Workout Editor"),GcWindowTypes::WorkoutWindow },
|
||||
{ VIEW_ANALYSIS|VIEW_HOME|VIEW_TRAIN, tr("Web page"),GcWindowTypes::WebPageWindow },
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<html>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2011 Greg Lonnon (greg.lonnon@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>
|
||||
<title>Map View</title>
|
||||
<link rel="stylesheet" type="text/css" href="qrc:///ride/web/Window.css"/>
|
||||
<script type="text/javascript" src="qrc:///ride/web/jquery-1.6.4.min.js"></script>
|
||||
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=geometry"></script>
|
||||
<script type="text/javascript" src="qrc:///ride/web/Rider.js"></script>
|
||||
<script type="text/javascript" src="qrc:///ride/web/ride.js"></script>
|
||||
<script type="text/javascript">
|
||||
var myArray = new Array();
|
||||
$(document).ready(function()
|
||||
{
|
||||
MapFactory("view");
|
||||
for(var i = 0; i < myArray.length; i++) {
|
||||
myArray[i].init();
|
||||
}
|
||||
animateLoop(0);
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="view"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2011 Greg Lonnon (greg.lonnon@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
// This the rider class...
|
||||
// It can take a JSON file and turn it into a rider.
|
||||
// or (in the future...) take live input from the RealtimeWindow
|
||||
|
||||
|
||||
function Rider_createRoute()
|
||||
{
|
||||
var path = new Array();
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
var routeLon = this.riderBridge.routeLon;
|
||||
var routeLat = this.riderBridge.routeLat;
|
||||
var length = routeLon.length;
|
||||
|
||||
for(var i = 0; i < length ; i++)
|
||||
{
|
||||
var lon = routeLon[i];
|
||||
var lat = routeLat[i];
|
||||
if(lon == 0) continue;
|
||||
if(lat == 0) continue;
|
||||
var coord = new google.maps.LatLng(lat,lon);
|
||||
path.push(coord);
|
||||
bounds.extend(coord);
|
||||
}
|
||||
var polyline = new google.maps.Polyline();
|
||||
polyline.setPath(path);
|
||||
return [polyline,bounds,path];
|
||||
}
|
||||
|
||||
function Rider_validTime(time)
|
||||
{
|
||||
if((time > 0) && (time <= this.routeLength))
|
||||
{
|
||||
return time;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function Rider_setTime(time)
|
||||
{
|
||||
this.time = this.validTime(time);
|
||||
}
|
||||
|
||||
function Rider_isDone(time)
|
||||
{
|
||||
if(this.routeLength < time)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function Rider_computeHeading()
|
||||
{
|
||||
var pos1 = this.position();
|
||||
var pos0 = pos1 -1;
|
||||
var coord1 = this.route[2][pos1];
|
||||
var coord0 = this.route[2][pos0];
|
||||
return google.maps.geometry.spherical.computeHeading(coord0,coord1);
|
||||
}
|
||||
|
||||
function Rider_coord()
|
||||
{
|
||||
return this.route[2][this.position()];
|
||||
}
|
||||
|
||||
function Rider_position()
|
||||
{
|
||||
return this.riderBridge.position;
|
||||
}
|
||||
|
||||
function Rider(riderBridge)
|
||||
{
|
||||
this.riderBridge = riderBridge;
|
||||
this.setTime = Rider_setTime;
|
||||
this.createRoute = Rider_createRoute;
|
||||
this.route = this.createRoute();
|
||||
this.routeLength = this.route[2].length;
|
||||
this.isDone = Rider_isDone;
|
||||
this.computeHeading = Rider_computeHeading;
|
||||
this.validTime = Rider_validTime;
|
||||
this.coord = Rider_coord;
|
||||
this.position = Rider_position;
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<html>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2011 Greg Lonnon (greg.lonnon@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>
|
||||
<title>StreetView View</title>
|
||||
<link rel="stylesheet" type="text/css" href="qrc:///ride/web/Window.css"/>
|
||||
<script type="text/javascript" src="qrc:///ride/web/jquery-1.6.4.min.js"></script>
|
||||
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=geometry"></script>
|
||||
<script type="text/javascript" src="qrc:///ride/web/Rider.js"></script>
|
||||
<script type="text/javascript" src="qrc:///ride/web/ride.js"></script>
|
||||
<script type="text/javascript">
|
||||
var myArray = new Array();
|
||||
$(document).ready(function()
|
||||
{
|
||||
StreetViewFactory("view");
|
||||
for(var i = 0; i < myArray.length; i++) {
|
||||
myArray[i].init();
|
||||
}
|
||||
animateLoop(0);
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="view"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2011 Greg Lonnon (greg.lonnon@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#view {
|
||||
margin-top:0%;
|
||||
margin-bottom: 0%;
|
||||
margin-right: 0%;
|
||||
margin-left: 0%;
|
||||
padding: 0%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #9cf;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
4
src/Resources/web/jquery-1.6.4.min.js
vendored
4
src/Resources/web/jquery-1.6.4.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,148 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2011 Greg Lonnon (greg.lonnon@gmail.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
// MAP
|
||||
|
||||
function Map_init()
|
||||
{
|
||||
var mapOptions = {
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
};
|
||||
this.map = new google.maps.Map(document.getElementById(this.id),mapOptions);
|
||||
var retArray = this.rider.route;
|
||||
var routePolyline = retArray[0];
|
||||
var mapBounds = retArray[1];
|
||||
routePolyline.setMap(this.map);
|
||||
this.map.fitBounds(mapBounds);
|
||||
this.marker = new google.maps.Marker();
|
||||
this.marker.setMap(this.map);
|
||||
}
|
||||
|
||||
function Map_update()
|
||||
{
|
||||
var curPosition = this.rider.position();
|
||||
if(curPosition == this.position){
|
||||
return;
|
||||
}
|
||||
var coord = this.rider.coord();
|
||||
if(coord.lat() == 0) return;
|
||||
if(coord.lng() == 0) return;
|
||||
this.map.panTo(coord);
|
||||
this.marker.setPosition(coord);
|
||||
}
|
||||
|
||||
function Map(rider)
|
||||
{
|
||||
this.rider = rider;
|
||||
this.map = null;
|
||||
this.marker = null;
|
||||
this.update = Map_update;
|
||||
this.init = Map_init;
|
||||
this.position = 0;
|
||||
}
|
||||
|
||||
function MapFactory(id)
|
||||
{
|
||||
if(typeof(GCRider) != "undefined")
|
||||
{
|
||||
// we are running inside GC
|
||||
GCRider.time = 1;
|
||||
var map = new Map(new Rider(GCRider));
|
||||
map.id = id;
|
||||
myArray.push(map);
|
||||
}
|
||||
}
|
||||
|
||||
// STREET VIEW
|
||||
function StreetView_init()
|
||||
{
|
||||
var streetOptions = {
|
||||
addressControl : false,
|
||||
panControl : false,
|
||||
linksControl : false,
|
||||
scrollwheel : false,
|
||||
zoomControl : false
|
||||
};
|
||||
this.street = new google.maps.StreetViewPanorama(document.getElementById(this.id),streetOptions);
|
||||
}
|
||||
|
||||
function StreetView_update()
|
||||
{
|
||||
var curPosition = this.rider.position();
|
||||
if(curPosition == this.position || curPosition == 0) {
|
||||
return;
|
||||
}
|
||||
this.position = curPosition;
|
||||
var h = this.rider.computeHeading();
|
||||
this.street.setPov({ heading: h, pitch: 10, zoom: 1 });
|
||||
this.street.setPosition(this.rider.coord());
|
||||
this.street.setVisible(true);
|
||||
}
|
||||
|
||||
function StreetView(rider)
|
||||
{
|
||||
this.rider = rider;
|
||||
this.update = StreetView_update;
|
||||
this.init = StreetView_init;
|
||||
this.position = 0;
|
||||
}
|
||||
|
||||
function StreetViewFactory(id)
|
||||
{
|
||||
if(typeof(GCRider) != "undefined")
|
||||
{
|
||||
// we are running inside GC
|
||||
GCRider.time = 1;
|
||||
var street = new StreetView(new Rider(GCRider));
|
||||
street.id = id;
|
||||
myArray.push(street);
|
||||
}
|
||||
}
|
||||
|
||||
function animateLoop(eventCount)
|
||||
{
|
||||
try
|
||||
{
|
||||
var done;
|
||||
for(var i = 0; i < myArray.length; i++) {
|
||||
myArray[i].update();
|
||||
if(done == false)
|
||||
{
|
||||
done = myArray[i].rider.isDone;
|
||||
}
|
||||
}
|
||||
eventCount = eventCount + 1;
|
||||
if(done != true)
|
||||
{
|
||||
setTimeout("animateLoop(" + eventCount+ ")",1000);
|
||||
}
|
||||
}
|
||||
catch(err) {
|
||||
// dump everything into a string
|
||||
var debugStr;
|
||||
for(var p in err) {
|
||||
debugStr += "property: " + p + " value: [" + err[p] + "]\n";
|
||||
}
|
||||
debugDebug += "toString(): " + " value: [" + err.toString() + "]";
|
||||
alert(debugStr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
16
src/src.pro
16
src/src.pro
@@ -244,7 +244,7 @@ QMAKE_EXTRA_COMPILERS += TSQM
|
||||
### RESOURCES
|
||||
###==========
|
||||
|
||||
RESOURCES = $${PWD}/Resources/application.qrc $${PWD}/Resources/RideWindow.qrc
|
||||
RESOURCES = $${PWD}/Resources/application.qrc
|
||||
|
||||
|
||||
|
||||
@@ -713,11 +713,6 @@ HEADERS += Charts/Aerolab.h Charts/AerolabWindow.h Charts/AllPlot.h Charts/AllPl
|
||||
Charts/ScatterPlot.h Charts/ScatterWindow.h Charts/SmallPlot.h Charts/SummaryWindow.h Charts/TreeMapPlot.h \
|
||||
Charts/TreeMapWindow.h Charts/ZoneScaleDraw.h
|
||||
|
||||
# RideWindow temporarily disabled if we don't have WebKit
|
||||
!contains(DEFINES, NOWEBKIT) {
|
||||
HEADERS += Charts/RideWindow.h
|
||||
}
|
||||
|
||||
# cloud services
|
||||
HEADERS += Cloud/BodyMeasuresDownload.h Cloud/CalendarDownload.h Cloud/CloudService.h \
|
||||
Cloud/LocalFileStore.h Cloud/OAuthDialog.h Cloud/TodaysPlanBodyMeasures.h \
|
||||
@@ -807,11 +802,6 @@ SOURCES += Charts/Aerolab.cpp Charts/AerolabWindow.cpp Charts/AllPlot.cpp Charts
|
||||
Charts/ScatterPlot.cpp Charts/ScatterWindow.cpp Charts/SmallPlot.cpp Charts/SummaryWindow.cpp Charts/TreeMapPlot.cpp \
|
||||
Charts/TreeMapWindow.cpp
|
||||
|
||||
# RideWindow temporarily disabled if we don't have WebKit
|
||||
!contains(DEFINES, NOWEBKIT) {
|
||||
SOURCES += Charts/RideWindow.cpp
|
||||
}
|
||||
|
||||
## Cloud Services / Web resources
|
||||
SOURCES += Cloud/BodyMeasuresDownload.cpp Cloud/CalendarDownload.cpp Cloud/CloudService.cpp \
|
||||
Cloud/LocalFileStore.cpp Cloud/OAuthDialog.cpp Cloud/TodaysPlanBodyMeasures.cpp \
|
||||
@@ -907,7 +897,5 @@ DEFERRES += Core/RouteWindow.h Core/RouteWindow.cpp Core/RouteItem.h Core/RouteI
|
||||
### MISCELLANEOUS FILES
|
||||
###====================
|
||||
|
||||
OTHER_FILES += Resources/web/Rider.js Resources/web/ride.js Resources/web/jquery-1.6.4.min.js \
|
||||
Resources/web/MapWindow.html Resources/web/StreetViewWindow.html Resources/web/Window.css \
|
||||
Resources/python/library.py Python/SIP/goldencheetah.sip
|
||||
OTHER_FILES += Resources/python/library.py Python/SIP/goldencheetah.sip
|
||||
|
||||
|
||||
Reference in New Issue
Block a user