From 69e93a881bbc8a20f91694d81bca72d926e9484f Mon Sep 17 00:00:00 2001 From: Dale Harvey Date: Sat, 18 Feb 2012 14:29:15 +0000 Subject: [PATCH] Fix setting title --- public/js/global.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/public/js/global.js b/public/js/global.js index fc2b84e..363bd6a 100644 --- a/public/js/global.js +++ b/public/js/global.js @@ -4,7 +4,7 @@ $("#main-title.changeling").bind("click", function () { if ($(this).is(":not(.editing)")) { - title = $('h3', this).text(); + title = $.trim($('h3', this).text()); $(this).addClass("editing"); $('h3', this).empty().append(tpl); var input = $(this).find("#title-input"); @@ -32,7 +32,7 @@ $("#save-title").live("click", function () { var newTitle = $("#title-input").val(); - var data = "title=" + newTitle; + var data = "title=" + encodeURIComponent(newTitle); data += isThread() ? "&thread_id=" + thread.id() : ''; $.ajax({ @@ -215,10 +215,10 @@ function isThread() { e.preventDefault(); $('#login-box').html(defaultLoginBox); }); - + $('#hide-ads').live('click', function(e){ e.preventDefault(); - + $.ajax({ url: '/ajax/hide_ads/'+session_id, success: function(data){ @@ -227,16 +227,16 @@ function isThread() { } }); }); - + $('#unhide-ads').live('click', function(e){ e.preventDefault(); - + $.ajax({ url: '/ajax/show_ads/'+session_id, success: function(data){ if (data == 1) if (data == 1) - window.location.reload(false); + window.location.reload(false); } }); });