diff --git a/controllers/controllers.php b/controllers/controllers.php index 3c24f56..8ccde89 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -238,7 +238,7 @@ $app->get('/new/options', function() use($app) { $app->get('/map.png', function() use($app) { $params = $app->request()->params(); - $url = static_map($params['latitude'], $params['longitude']); + $url = get_static_map($_SERVER['QUERY_STRING']); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $img = curl_exec($ch); @@ -246,6 +246,12 @@ $app->get('/map.png', function() use($app) { $app->response()->body($img); }); +$app->get('/teacup.appcache', function() use($app) { + $content = partial('appcache'); + + $app->response()['Content-type'] = 'text/cache-manifest'; + $app->response()->body($content); +}); $app->get('/:domain', function($domain) use($app) { $params = $app->request()->params(); @@ -325,5 +331,3 @@ $app->get('/:domain/:entry', function($domain, $entry_id) use($app) { )); - - diff --git a/lib/helpers.php b/lib/helpers.php index 7cc4220..af7ac53 100644 --- a/lib/helpers.php +++ b/lib/helpers.php @@ -171,7 +171,12 @@ function get_syndication_targets(&$user) { } function static_map($latitude, $longitude, $height=174, $width=300, $zoom=14) { - return 'http://static-maps.pdx.esri.com/img.php?marker[]=lat:' . $latitude . ';lng:' . $longitude . ';icon:small-green-cutout&basemap=topo&width=' . $width . '&height=' . $height . '&zoom=' . $zoom; + #return 'http://static-maps.pdx.esri.com/img.php?marker[]=lat:' . $latitude . ';lng:' . $longitude . ';icon:small-green-cutout&basemap=topo&width=' . $width . '&height=' . $height . '&zoom=' . $zoom; + return '/map.png?marker[]=lat:' . $latitude . ';lng:' . $longitude . ';icon:small-green-cutout&basemap=topo&width=' . $width . '&height=' . $height . '&zoom=' . $zoom; +} + +function get_static_map($query) { + return 'http://static-maps.pdx.esri.com/img.php?' . $query; } function relative_time($date) { diff --git a/views/appcache.php b/views/appcache.php new file mode 100644 index 0000000..8640e75 --- /dev/null +++ b/views/appcache.php @@ -0,0 +1,13 @@ +CACHE MANIFEST +/new +/bootstrap/css/bootstrap.min.css +/bootstrap/css/bootstrap-theme.css +/bootstrap/css/bootstrap-theme.css.map +/css/font-awesome/css/font-awesome.min.css +/css/style.css +/js/jquery-1.7.1.min.js +/images/teacup-logo-144.png +/images/spinner.gif + +NETWORK: +* diff --git a/views/layout.php b/views/layout.php index 91b07f2..9430919 100644 --- a/views/layout.php +++ b/views/layout.php @@ -1,5 +1,5 @@ - +