jquery-redirect 제거
This commit is contained in:
@@ -17,8 +17,6 @@ $generalObj = General::createGeneralObjFromDB($session->generalID);
|
|||||||
<title><?=UniqueConst::$serverName?>: 사령부</title>
|
<title><?=UniqueConst::$serverName?>: 사령부</title>
|
||||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||||
<?=WebUtil::printJS('dist_js/vendors.js')?>
|
<?=WebUtil::printJS('dist_js/vendors.js')?>
|
||||||
<?=WebUtil::printJS('dist_js/common.js')?>
|
|
||||||
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
|
|
||||||
<?=WebUtil::printJS('dist_js/chiefCenter.js')?>
|
<?=WebUtil::printJS('dist_js/chiefCenter.js')?>
|
||||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
|
|||||||
Vendored
-39
@@ -1,39 +0,0 @@
|
|||||||
type JqueryRedirectOpts = {
|
|
||||||
url: string,
|
|
||||||
values?: Record<string, string | number | string[] | boolean>,
|
|
||||||
method?: 'GET' | 'POST',
|
|
||||||
target?: string,
|
|
||||||
traditional?: boolean
|
|
||||||
redirectTop?: boolean,
|
|
||||||
}
|
|
||||||
|
|
||||||
interface JQueryStatic {
|
|
||||||
/**
|
|
||||||
* jQuery Redirect
|
|
||||||
* @param {string} url - Url of the redirection
|
|
||||||
* @param {Object} values - (optional) An object with the data to send. If not present will look for values as QueryString in the target url.
|
|
||||||
* @param {string} method - (optional) The HTTP verb can be GET or POST (defaults to POST)
|
|
||||||
* @param {string} target - (optional) The target of the form. If you set "_blank" will open the url in a new window.
|
|
||||||
* @param {boolean} traditional - (optional) This provides the same function as jquery's ajax function. The brackets are omitted on the field name if its an array. This allows arrays to work with MVC.net among others.
|
|
||||||
* @param {boolean} redirectTop - (optional) If its called from a iframe, force to navigate the top window.
|
|
||||||
*/
|
|
||||||
redirect(
|
|
||||||
url: string,
|
|
||||||
values?: Record<string, string | number | string[] | boolean>,
|
|
||||||
method?: 'GET' | 'POST',
|
|
||||||
target?: string, traditional?:
|
|
||||||
boolean, redirectTop?: boolean
|
|
||||||
): void;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* jQuery Redirect
|
|
||||||
* @param {string} opts - Options object
|
|
||||||
* @param {string} opts.url - Url of the redirection
|
|
||||||
* @param {Object} opts.values - (optional) An object with the data to send. If not present will look for values as QueryString in the target url.
|
|
||||||
* @param {string} opts.method - (optional) The HTTP verb can be GET or POST (defaults to POST)
|
|
||||||
* @param {string} opts.target - (optional) The target of the form. "_blank" will open the url in a new window.
|
|
||||||
* @param {boolean} opts.traditional - (optional) This provides the same function as jquery's ajax function. The brackets are omitted on the field name if its an array. This allows arrays to work with MVC.net among others.
|
|
||||||
* @param {boolean} opts.redirectTop - (optional) If its called from a iframe, force to navigate the top window.
|
|
||||||
*/
|
|
||||||
redirect(opt: JqueryRedirectOpts): void;
|
|
||||||
}
|
|
||||||
+20
-17
@@ -9,6 +9,7 @@ import { convertFormData } from './util/convertFormData';
|
|||||||
import { unwrap_any } from "./util/unwrap_any";
|
import { unwrap_any } from "./util/unwrap_any";
|
||||||
import { parseTime } from './util/parseTime';
|
import { parseTime } from './util/parseTime';
|
||||||
import { formatTime } from './util/formatTime';
|
import { formatTime } from './util/formatTime';
|
||||||
|
import { stringifyUrl } from 'query-string';
|
||||||
|
|
||||||
declare const maxChiefTurn: number;
|
declare const maxChiefTurn: number;
|
||||||
|
|
||||||
@@ -31,11 +32,11 @@ type ChiefResponse = InvalidResponse | {
|
|||||||
result: true,
|
result: true,
|
||||||
date: string,
|
date: string,
|
||||||
nationTurnBrief: {
|
nationTurnBrief: {
|
||||||
name:string|null,
|
name: string | null,
|
||||||
turnTime:string|null,
|
turnTime: string | null,
|
||||||
officerLevelText:string,
|
officerLevelText: string,
|
||||||
npcType:number,
|
npcType: number,
|
||||||
turn:string
|
turn: string
|
||||||
}[],
|
}[],
|
||||||
isChief: boolean,
|
isChief: boolean,
|
||||||
turnTerm: number
|
turnTerm: number
|
||||||
@@ -107,7 +108,7 @@ async function reloadTable() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const turnTerm = data.turnTerm;
|
const turnTerm = data.turnTerm;
|
||||||
const tmpFilledChiefList:Record<number, boolean> = {};
|
const tmpFilledChiefList: Record<number, boolean> = {};
|
||||||
|
|
||||||
if (data.isChief) {
|
if (data.isChief) {
|
||||||
chiefTableObj.btns.css('visibility', 'visible');
|
chiefTableObj.btns.css('visibility', 'visible');
|
||||||
@@ -134,7 +135,7 @@ async function reloadTable() {
|
|||||||
|
|
||||||
plateObj.officerLevelText.text(chiefInfo.officerLevelText);
|
plateObj.officerLevelText.text(chiefInfo.officerLevelText);
|
||||||
|
|
||||||
let turnTimeObj: Date|undefined;
|
let turnTimeObj: Date | undefined;
|
||||||
|
|
||||||
if (chiefInfo.turnTime) {
|
if (chiefInfo.turnTime) {
|
||||||
turnTimeObj = parseTime(chiefInfo.turnTime);
|
turnTimeObj = parseTime(chiefInfo.turnTime);
|
||||||
@@ -176,11 +177,11 @@ async function reloadTable() {
|
|||||||
|
|
||||||
async function reserveTurn(turnList: number[], command: string) {
|
async function reserveTurn(turnList: number[], command: string) {
|
||||||
console.log(turnList, command);
|
console.log(turnList, command);
|
||||||
try{
|
try {
|
||||||
|
|
||||||
const response = await axios({
|
const response = await axios({
|
||||||
url: 'j_set_chief_command.php',
|
url: 'j_set_chief_command.php',
|
||||||
responseType:'json',
|
responseType: 'json',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: convertFormData({
|
data: convertFormData({
|
||||||
turnList,
|
turnList,
|
||||||
@@ -195,7 +196,7 @@ async function reserveTurn(turnList: number[], command: string) {
|
|||||||
}
|
}
|
||||||
await reloadTable();
|
await reloadTable();
|
||||||
}
|
}
|
||||||
catch(e){
|
catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
errUnknown();
|
errUnknown();
|
||||||
}
|
}
|
||||||
@@ -223,7 +224,7 @@ async function pushTurn(turnCnt: number) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery(function ($) {
|
$(function ($) {
|
||||||
|
|
||||||
chiefTableObj = genChiefTableObj();
|
chiefTableObj = genChiefTableObj();
|
||||||
void reloadTable();
|
void reloadTable();
|
||||||
@@ -232,12 +233,14 @@ jQuery(function ($) {
|
|||||||
const turnList = unwrap_any<string[]>($('#chiefTurnSelector').val()).map(function (v) { return parseInt(v); });
|
const turnList = unwrap_any<string[]>($('#chiefTurnSelector').val()).map(function (v) { return parseInt(v); });
|
||||||
const $command = $('#chiefCommandList option:selected');
|
const $command = $('#chiefCommandList option:selected');
|
||||||
if ($command.data('reqarg')) {
|
if ($command.data('reqarg')) {
|
||||||
$.redirect(
|
document.location.href = stringifyUrl({
|
||||||
"b_processing.php", {
|
url: 'b_processing.php',
|
||||||
command: unwrap($command.val()),
|
query: {
|
||||||
turnList: turnList.join('_'),
|
command: unwrap_any<string>($command.val()),
|
||||||
is_chief: true
|
turnList: turnList.join('_'),
|
||||||
}, "GET");
|
is_chief: true
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
void reserveTurn(turnList, unwrap_any<string>($command.val()));
|
void reserveTurn(turnList, unwrap_any<string>($command.val()));
|
||||||
|
|||||||
Reference in New Issue
Block a user