From: Iain Patterson Date: Thu, 7 Nov 2013 16:36:17 +0000 (-0500) Subject: Merge branch 'master' into uat X-Git-Tag: uat-2013-11-07 X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=refs%2Ftags%2Fuat-2013-11-07;hp=1a03841178f8c990b3b196b915c5b288f629879f;p=readifood.git Merge branch 'master' into uat --- diff --git a/lib/footer.php b/lib/footer.php index 9943ff0..3ccf4a8 100644 --- a/lib/footer.php +++ b/lib/footer.php @@ -1,3 +1,4 @@ + diff --git a/lib/forms.php b/lib/forms.php index ae08607..c71c11f 100644 --- a/lib/forms.php +++ b/lib/forms.php @@ -30,10 +30,14 @@ } function textarea($name, $value = null) { - echo ""; + echo ""; } function option($select, $value, $text, $selected = null) { diff --git a/lib/functions.php b/lib/functions.php index eb48c4b..ec0b35a 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -320,7 +320,32 @@ function get_address_map_link($address) { $postcode = trim($address->getPostcode()); if ($postcode) { - return " " . get_small_link("Map", "http://maps.google.co.uk/maps?q=" . urlencode($postcode)); + # mrt=loc specifies a location search. + $map = "maps.google.co.uk/maps?q=" . urlencode($postcode) . "&mrt=loc"; + $url = "http://$map"; + # output=embed allows display in an iframe. + # iwloc=near hides the popup window for the embedded view. + $embed = $GLOBALS['http'] . "://$map&output=embed&iwloc=near"; + $html = " "; + $html .= get_small_link_with_id("map", "Map", $url); + $html .= ""; + return $html; } } @@ -536,12 +561,21 @@ } } - function get_small_link() { - /* Args are , , [ ...] */ + function get_small_link_with_id() { + /* Args are , , , [ ...] */ $args = func_get_args(); + $id = array_shift($args); + if (isset($id)) $id = " id=\"$id\""; $html = htmlspecialchars(array_shift($args)); $url = array_shift($args); - return vsprintf("$html\n", $args); + return vsprintf("$html\n", $args); + } + + function get_small_link() { + /* Args are , , [ ...] */ + $args = func_get_args(); + array_unshift($args, null); + return call_user_func_array("get_small_link_with_id", $args); } function small_link() { diff --git a/lib/header.php b/lib/header.php index 3c44dd9..e8b89da 100644 --- a/lib/header.php +++ b/lib/header.php @@ -6,6 +6,7 @@ echo "\n"; echo "\n"; ?> + diff --git a/www/.htaccess b/www/.htaccess index e56e28a..a3be2de 100644 --- a/www/.htaccess +++ b/www/.htaccess @@ -1,5 +1,3 @@ RewriteEngine on -RewriteCond %{REQUEST_FILENAME} !/style\.css$ -RewriteCond %{REQUEST_FILENAME} !/logo\.png$ -RewriteCond %{REQUEST_FILENAME} !/login\.php$ +RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+) index.php [L] diff --git a/www/jquery.autosize.js b/www/jquery.autosize.js new file mode 100644 index 0000000..0f296d4 --- /dev/null +++ b/www/jquery.autosize.js @@ -0,0 +1,250 @@ +/*! + Autosize v1.18.1 - 2013-11-05 + Automatically adjust textarea height based on user input. + (c) 2013 Jack Moore - http://www.jacklmoore.com/autosize + license: http://www.opensource.org/licenses/mit-license.php +*/ +(function ($) { + var + defaults = { + className: 'autosizejs', + append: '', + callback: false, + resizeDelay: 10 + }, + + // border:0 is unnecessary, but avoids a bug in Firefox on OSX + copy = '