X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=js%2Fredirection.js;h=5ceff2680f4823bb6a0e59893f6a756398a62430;hb=HEAD;hp=c8653204d8b354218971b8994c29335f4efe6bf7;hpb=f53425414d1861f105a3063cdbb4bf96cdc755a2;p=Rakka.git diff --git a/js/redirection.js b/js/redirection.js index c865320..5ceff26 100644 --- a/js/redirection.js +++ b/js/redirection.js @@ -1,30 +1,21 @@ $(document).ready(function () { - var fragment; - - if ($.browser.mozilla) { - fragment = window.location.hash; // 何故か勝手に URI デコードされる - } - else { - fragment = decodeURIComponent(window.location.hash); - } - var m = fragment.match(/^#Redirect:(.*)$/); - if (m) { - var from = m[1]; + var from = Rakka.getHashedParam("Redirect"); + if (from != null) { var editButton = $.INPUT({className: "editButton", type: "button", - value: from, - title: "Edit the page"}); + value: "Edit the page"}); $(editButton).click(function () { Rakka.editPage(from); }); var box = $.P({className: "redirection"}, - "This page is redirected from", editButton); + "This page has been redirected from “" + from + "”.", editButton); $("div.title").after(box); } + }); \ No newline at end of file