Skip to content

Commit

Permalink
Merge pull request #340 from Maprunner/dev
Browse files Browse the repository at this point in the history
Version 1.3.3
  • Loading branch information
Maprunner authored Feb 2, 2017
2 parents 9fbc15b + 3519557 commit a6dc5b7
Show file tree
Hide file tree
Showing 19 changed files with 102 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = function(grunt) {
'kerno', 'kfo', 'lamm', 'leioc', 'loc', 'log', 'lok', 'lvo', 'maroc', 'mdoc', 'moravian', 'mvoc', 'nato', 'ngoc', 'noroc', 'nwo', 'od', 'omm', 'ouoc',
'pfo', 'potoc', 'pow', 'quantock', 'rafo', 'roxburghreivers', 'sa', 'sarum', 'saxons', 'sboc', 'scottish6days', 'seloc', 'slow', 'smbo', 'smoc', 'sn', 'so', 'soa', 'soc',
'solway', 'sportident', 'sroc', 'stag', 'start', 'suffoc', 'swoc', 'syo', 'tay', 'test', 'purple-thistle', 'tinto', 'tvoc', 'walton', 'waoc', 'wcoc', 'wim', 'wmoc',
'wrekin', 'wsco', 'wsco2008', 'wsoe', 'wsx'];
'wrekin', 'wsco2008', 'wsx'];

// Project configuration.
grunt.initConfig({
Expand Down Expand Up @@ -106,7 +106,7 @@ module.exports = function(grunt) {
sync : {
rel : {
files: [{
src : ['rg2api.php', 'index.php', 'html/**'],
src : ['rg2api.php', 'index.php', 'html/**', 'img/favicon.ico'],
dest : 'rel/'
}],
verbose: true, // Default: false
Expand Down
File renamed without changes.
Binary file added img/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/favicon.ico
Binary file not shown.
17 changes: 17 additions & 0 deletions img/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Routegadget 2",
"icons": [
{
"src": "\/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image\/png"
},
{
"src": "\/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image\/png"
}
],
"theme_color": "#ffffff",
"display": "standalone"
}
Binary file added img/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions img/safari-pinned-tab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 12 additions & 6 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// version replaced by Gruntfile as part of release
define ('RG2VERSION', '1.3.2');
define ('RG2VERSION', '1.3.3');

if (file_exists( dirname(__FILE__) . '/rg2-config.php')) {
require_once( dirname(__FILE__) . '/rg2-config.php' );
Expand Down Expand Up @@ -102,15 +102,21 @@
<title>Routegadget 2</title>
<meta name="description" content="View and save route choices for orienteering events">
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<link rel="shortcut icon" href="img/favicon.ico"/>
<!-- favicon info -->
<link rel="apple-touch-icon" sizes="180x180" href='<?php echo $source_url ."/img/apple-touch-icon.png"; ?>'>
<link rel="icon" type="image/png" href='<?php echo $source_url ."/img/favicon-32x32.png"; ?>' sizes="32x32">
<link rel="icon" type="image/png" href='<?php echo $source_url ."/img/favicon-16x16.png"; ?>' sizes="16x16">
<link rel="manifest" href='<?php echo $source_url ."/img/manifest.json"; ?>'>
<link rel="mask-icon" href='<?php echo $source_url ."/img/safari-pinned-tab.svg"; ?>' color="#5bbad5">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"; ?>
<?php if ($debug) { ?>
<link rel="stylesheet" href='<?php echo $source_url ."/css/rg2.css'>"; ?>
<?php } else { ?>
<link rel="stylesheet" href='<?php echo $source_url ."/css/rg2-".RG2VERSION.".min.css'>"; ?>
<?php } ?>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.3/themes/<?php echo $ui_theme; ?>/jquery-ui.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.3/themes/<?php echo $ui_theme; ?>/jquery-ui.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
</head>
<body>
<!--[if lt IE 7]>
Expand Down Expand Up @@ -223,8 +229,8 @@
<?php include 'html/options.html'; ?>
<?php include 'html/misc.html'; ?>
</div>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="//code.jquery.com/ui/1.11.3/jquery-ui.min.js"></script>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.3/jquery-ui.min.js"></script>
<?php if ($debug) { ?>
<script src='<?php echo $source_url . "/js/rg2.js"; ?>'></script>
<script src='<?php echo $source_url . "/js/rg2ui.js"; ?>'></script>
Expand Down
2 changes: 1 addition & 1 deletion js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
EVENT_WITHOUT_RESULTS : 2,
SCORE_EVENT : 3,
// version gets set automatically by grunt file during build process
RG2VERSION: '1.3.2',
RG2VERSION: '1.3.3',
TIME_NOT_FOUND : 9999,
// values for evt.which
RIGHT_CLICK : 3,
Expand Down
6 changes: 3 additions & 3 deletions js/rg2-1.3.2.min.js → js/rg2-1.3.3.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/rg2-1.3.2.min.js.map → js/rg2-1.3.3.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/rg2manager-1.3.2.min.js → js/rg2manager-1.3.3.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rg2",
"description": "Routegadget 2",
"version": "1.3.2",
"version": "1.3.3",
"license": "MIT",
"repository": "https://github.com/Maprunner/rg2",
"devDependencies": {
Expand Down
22 changes: 14 additions & 8 deletions rg2api.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}

// version replaced by Gruntfile as part of release
define ('RG2VERSION', '1.3.2');
define ('RG2VERSION', '1.3.3');
define ('KARTAT_DIRECTORY', $url);
define ('LOCK_DIRECTORY', dirname(__FILE__)."/lock/saving/");
define ('CACHE_DIRECTORY', $url."cache/");
Expand Down Expand Up @@ -195,7 +195,7 @@ function handlePostRequest($type, $eventid) {

case 'deleteroute':
// this is the manager delete function
$write = deleteMyRoute($eventid, $data);
$write = deleteRoute($eventid);
@unlink(CACHE_DIRECTORY."results_".$eventid.".json");
@unlink(CACHE_DIRECTORY."tracks_".$eventid.".json");
@unlink(CACHE_DIRECTORY."stats.json");
Expand Down Expand Up @@ -806,6 +806,7 @@ function deleteRoute($eventid) {

if (isset($_GET['routeid'])) {
$routeid = $_GET['routeid'];
rg2log("Route to be deleted|".$routeid);
// delete comments
$filename = KARTAT_DIRECTORY."kommentit_".$eventid.".txt";
$oldfile = file($filename);
Expand All @@ -824,16 +825,19 @@ function deleteRoute($eventid) {
if ($status === FALSE) {
$write["status_msg"] .= "Save error for kommentit. ";
}
if (!$deleted) {
$write["status_msg"] .= "Route not found in comments file. ";
}

// delete result if this event started with no results (format 2)
// delete GPS details since these are always added as a new result
if (($routeid >= GPS_RESULT_OFFSET) || ($format == 2)) {
$filename = KARTAT_DIRECTORY."kilpailijat_".$eventid.".txt";
$oldfile = file($filename);
$updatedfile = array();
$deleted = FALSE;
foreach ($oldfile as $row) {
$data = explode("|", $row);
$deleted = FALSE;
if ($data[0] == $routeid) {
$deleted = TRUE;
} else {
Expand All @@ -845,14 +849,16 @@ function deleteRoute($eventid) {
if ($status === FALSE) {
$write["status_msg"] .= "Save error for kilpailijat. ";
}

if (!$deleted) {
$write["status_msg"] .= "Route not found in results file. ";
}
}

// delete route
$deleted = FALSE;
$filename = KARTAT_DIRECTORY."merkinnat_".$eventid.".txt";
$oldfile = file($filename);
$updatedfile = array();
$deleted = FALSE;
foreach ($oldfile as $row) {
$data = explode("|", $row);
if ($data[1] == $routeid) {
Expand All @@ -867,7 +873,7 @@ function deleteRoute($eventid) {
$write["status_msg"] .= " Save error for merkinnat. ";
}
if (!$deleted) {
$write["status_msg"] .= "Invalid route id. ";
$write["status_msg"] .= "Route not found in routes file. ";
}
} else {
$write["status_msg"] = "Invalid route id. ";
Expand All @@ -887,12 +893,12 @@ function deleteRoute($eventid) {
}

function canDeleteMyRoute($eventid, $data) {
$validrequest = false;
if (isset($_GET['routeid'])) {
$routeid = $_GET['routeid'];
$token = $data->token;
$filename = KARTAT_DIRECTORY."merkinnat_".$eventid.".txt";
$oldfile = file($filename);
$validrequest = false;
foreach ($oldfile as $row) {
$data = explode("|", $row);
if ($data[1] == $routeid) {
Expand Down Expand Up @@ -1681,7 +1687,7 @@ function isScoreEvent($eventid) {
}

function getResultsForEvent($eventid) {
rg2log("Get results for event ".$eventid);
//rg2log("Get results for event ".$eventid);
$output = array();
$comments = 0;
$text = array();
Expand Down

0 comments on commit a6dc5b7

Please sign in to comment.