Permalink
Browse files

Added encoding of url in menu url api

  • Loading branch information...
1 parent ad7cdd3 commit 6f73605f753177d8b606436e6cf030c8337f3a14 @ernstsson committed Jul 1, 2012
Showing with 4 additions and 4 deletions.
  1. +1 −1 menu/menu.js
  2. +3 −3 project/project.js
View
@@ -4,7 +4,7 @@ var getTwitter = function() {
var loadBody = function(twitter) {
var titleVar = getUrlVars()["title"];
- var urlVar = getUrlVars()["url"];
+ var urlVar = decodeURIComponent(getUrlVars()["url"]);
twitter.src = "http://platform.twitter.com/widgets/tweet_button.html?" +
"via=ernstsson&count=horizontal" +
(titleVar ? "&text=" + titleVar : "") +
View
@@ -24,17 +24,17 @@ var setGraph = function(graph, data) {
graph.src = "/graph/graph.html?graph=" + data;
}
-var setMenu = function(menu, project) {
+var setMenu = function(menu) {
menu.src = "/menu/menu.html?title=" + document.title +
- "&url=" + document.URL;
+ "&url=" + encodeURIComponent(document.URL);
}
var loadBody = function(graph, title, menu) {
var project = getUrlVars()["project"];
var data = getUrlVars()["data"];
if (project && data) {
setTitle(title, project);
- setMenu(menu, project);
+ setMenu(menu);
setGraph(graph, data);
resizeGraph(graph);
}

0 comments on commit 6f73605

Please sign in to comment.