Author: kake
Date: 2012-06-15 19:28:42 +0100 (Fri, 15 Jun 2012)
New Revision: 1413
Modified:
trunk/Changes
trunk/templates/node.tt
Log:
Fixed a JavaScript escaping issue for nodes with apostrophes in names.
Modified: trunk/Changes
===================================================================
--- trunk/Changes 2012-06-04 20:18:13 UTC (rev 1412)
+++ trunk/Changes 2012-06-15 18:28:42 UTC (rev 1413)
@@ -5,6 +5,7 @@
0.69 ?
The output of the "show_missing_metadata" action is now alphabetised.
+ Fixed a JavaScript escaping issue for nodes with apostrophes in names.
0.68 21 May 2012
Made sure that maps are centred and zoomed properly even when they only
Modified: trunk/templates/node.tt
===================================================================
--- trunk/templates/node.tt 2012-06-04 20:18:13 UTC (rev 1412)
+++ trunk/templates/node.tt 2012-06-15 18:28:42 UTC (rev 1413)
@@ -1,4 +1,5 @@
[% USE CGI %]
+[% USE JSON.Escape %]
[% INCLUDE header.tt %]
[% INCLUDE banner.tt %]
@@ -27,7 +28,7 @@
var position = new L.LatLng( [% wgs84_lat %], [% wgs84_long %] );
marker = new L.Marker( position, { icon: new gicon() } );
map.addLayer( marker );
- marker.bindPopup( '[% node_name %]' );
+ marker.bindPopup( [% node_name.json %] );
}
</script>
[% ELSIF gmaps_api_key %]
Author: kake
Date: 2012-06-04 21:18:13 +0100 (Mon, 04 Jun 2012)
New Revision: 1412
Modified:
trunk/Changes
trunk/lib/OpenGuides.pm
trunk/t/701_missing_metadata.t
Log:
The output of the "show_missing_metadata" action is now alphabetised.
Modified: trunk/Changes
===================================================================
--- trunk/Changes 2012-05-23 20:11:33 UTC (rev 1411)
+++ trunk/Changes 2012-06-04 20:18:13 UTC (rev 1412)
@@ -4,8 +4,8 @@
<http://dev.openguides.org/log/trunk>.
0.69 ?
+ The output of the "show_missing_metadata" action is now alphabetised.
-
0.68 21 May 2012
Made sure that maps are centred and zoomed properly even when they only
contain one point.
Modified: trunk/lib/OpenGuides.pm
===================================================================
--- trunk/lib/OpenGuides.pm 2012-05-23 20:11:33 UTC (rev 1411)
+++ trunk/lib/OpenGuides.pm 2012-06-04 20:18:13 UTC (rev 1412)
@@ -2279,7 +2279,7 @@
# Build nice edit etc links for our nodes
my @tt_nodes;
- for my $node (@nodes) {
+ for my $node (sort @nodes) {
my %n;
# Make the URLs
Modified: trunk/t/701_missing_metadata.t
===================================================================
--- trunk/t/701_missing_metadata.t 2012-05-23 20:11:33 UTC (rev 1411)
+++ trunk/t/701_missing_metadata.t 2012-06-04 20:18:13 UTC (rev 1412)
@@ -11,8 +11,8 @@
plan skip_all => "DBD::SQLite could not be used - no database to test with ($error)";
}
-plan tests => 26;
- OpenGuides::Test::refresh_db();
+plan tests => 27;
+OpenGuides::Test::refresh_db();
my $config = OpenGuides::Test->make_basic_config;
$config->script_name( "wiki.cgi" );
@@ -22,8 +22,6 @@
my $wiki = $guide->wiki;
isa_ok( $wiki, "Wiki::Toolkit" );
-
-
# Add four different pages, one of which with two versions, one of which
# a redirect. The redirect should not show up on any "missing metadata"
# searches, regardless of the condition of the page it points to.
@@ -96,6 +94,11 @@
is( $nodes[2]->{'name'}, "Test Page", "Right nodes" );
is( $nodes[3]->{'name'}, "Test Page 3", "Right nodes" );
+# Make sure they're returned in alphabetical order.
+my @nodenames = map { $_->{name} } @{$ttvars{nodes}};
+is_deeply( \@nodenames,
+ [ "Category Foo", "Locale Bar", "Test Page", "Test Page 3" ],
+ "Nodes are returned in alphabetical order" );
# Try again, but exclude locale and category
%ttvars = eval {