mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-30 01:05:26 +09:00
Merge pull request #324 from kijin/pr/redirect-after-board-write
#323 게시판에서 글이나 댓글을 작성 또는 삭제한 후 짧은 주소로 redirect하도록 변경
This commit is contained in:
commit
f40ea2e05d
5 changed files with 72 additions and 48 deletions
|
|
@ -377,6 +377,21 @@ function sendMailTo(to) {
|
|||
location.href="mailto:"+to;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief url이동 (Rhymix 개선된 버전)
|
||||
*/
|
||||
function redirect(url) {
|
||||
if (url === window.location.href || url.indexOf(window.location.href.replace(/#.+$/, "") + "#") === 0)
|
||||
{
|
||||
window.location.href = url;
|
||||
window.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
window.location.href = url;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief url이동 (open_window 값이 N 가 아니면 새창으로 띄움)
|
||||
**/
|
||||
|
|
@ -394,7 +409,7 @@ function move_url(url, open_window) {
|
|||
if(open_window) {
|
||||
winopen(url);
|
||||
} else {
|
||||
location.href=url;
|
||||
redirect(url);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -102,9 +102,11 @@
|
|||
}
|
||||
|
||||
// If the response contains a redirect URL, redirect immediately.
|
||||
if (result.redirect_url) {
|
||||
window.location = result.redirect_url.replace(/&/g, "&");
|
||||
return null;
|
||||
if (data.redirect_url) {
|
||||
data.redirect_url = data.redirect_url.replace(/&/g, "&");
|
||||
}
|
||||
if (data.redirect_url && !$.isFunction(callback_success)) {
|
||||
return redirect(data.redirect_url);
|
||||
}
|
||||
|
||||
// If there was a success callback, call it.
|
||||
|
|
@ -220,6 +222,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
// If the response contains a redirect URL, redirect immediately.
|
||||
if (data.redirect_url) {
|
||||
data.redirect_url = data.redirect_url.replace(/&/g, "&");
|
||||
}
|
||||
if (data.redirect_url && !$.isFunction(callback_success)) {
|
||||
return redirect(data.redirect_url);
|
||||
}
|
||||
|
||||
// If there was a success callback, call it.
|
||||
if($.isFunction(callback_success)) {
|
||||
callback_success(data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue