mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-28 23:03:25 +09:00
Fix #1294 use history.replaceState() to remove unnecessary comment_srl and page number from URL if new rewrite rules are in effect
This commit is contained in:
parent
dff97a9604
commit
6c19e6ebff
1 changed files with 17 additions and 0 deletions
|
|
@ -132,7 +132,24 @@ function doScrap(document_srl)
|
||||||
jQuery.exec_json('member.procMemberScrapDocument', params);
|
jQuery.exec_json('member.procMemberScrapDocument', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
jQuery(function($){
|
jQuery(function($){
|
||||||
|
|
||||||
|
/* remove comment_srl and unnecessary page number from short URL */
|
||||||
|
var match = location.pathname.match(/\/([a-zA-Z0-9_]+)\/([0-9]+)\/(comment|page)\/([0-9]+)$/);
|
||||||
|
if (match && match[1] === window.current_mid) {
|
||||||
|
var newpath = location.pathname.replace(/\/(comment|page)\/([0-9]+)$/, '');
|
||||||
|
if (location.hash && location.hash !== '#') {
|
||||||
|
newpath += location.hash;
|
||||||
|
}
|
||||||
|
if (history.replaceState) {
|
||||||
|
history.replaceState({
|
||||||
|
rx_replaced: true,
|
||||||
|
prev: location.pathname,
|
||||||
|
}, '', newpath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$(document.body).click(function(e){
|
$(document.body).click(function(e){
|
||||||
var t = $(e.target), act, params = {};
|
var t = $(e.target), act, params = {};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue