입력창 준비
This commit is contained in:
1 parent
42c3c6ff46
commit
a133dfc722
8 files changed
+429
-113
No files matched your search
Vendored
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
* Bootstrap v4.1.3 (https://getbootstrap.com/)
|
* Bootstrap v4.4.1 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
*/
|
*/
|
||||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("jquery")):"function"==typeof define&&define.amd?define(["exports","jquery"],t):t(e.bootstrap={},e.jQuery)}(this,function(e,t){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function s(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function l(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{},t=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),t.forEach(function(e){var t,n,i;t=r,i=o[n=e],n in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i})}return r}for(var r,n,o,a,c,u,f,h,d,p,m,g,_,v,y,E,b,w,C,T,S,D,A,I,O,N,k,x,P,L,j,H,M,F,W,R,U,B,q,K,Q,Y,V,z,G,J,Z,X,$,ee,te,ne,ie,re,oe,se,ae,le,ce,ue,fe,he,de,pe,me,ge,_e,ve,ye,Ee,be,we=function(i){var t="transitionend";function e(e){var t=this,n=!1;return i(this).one(l.TRANSITION_END,function(){n=!0}),setTimeout(function(){n||l.triggerTransitionEnd(t)},e),this}var l={TRANSITION_END:"bsTransitionEnd",getUID:function(e){for(;e+=~~(1e6*Math.random()),document.getElementById(e););return e},getSelectorFromElement:function(e){var t=e.getAttribute("data-target");t&&"#"!==t||(t=e.getAttribute("href")||"");try{return document.querySeLine truncated
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("jquery")):"function"==typeof define&&define.amd?define(["exports","jquery"],t):t((e=e||self).bootstrap={},e.jQuery)}(this,function(e,p){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function s(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function l(o){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?t(Object(r),!0).forEach(function(e){var t,n,i;t=o,i=r[n=e],n in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(r,e))})}return o}p=p&&p.hasOwnProperty("default")?p.default:p;var n="transitionend";function o(e){var t=this,n=!1;return p(this).one(m.TRANSITION_END,function(){n=!0}),setTimeout(function(){n||m.triggerTransitionEnd(t)},e),this}var m={TRANSITION_END:"bsTransitionEnd",getUID:function(e){for(;e+=~~(1e6*Math.random()),document.getElementById(e););return e},getSelectorFromElement:functLine truncated
|
||||||
//# sourceMappingURL=bootstrap.bundle.min.js.map
|
//# sourceMappingURL=bootstrap.bundle.min.js.map
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../../node_modules/popper.js/dist/esm/popper.js","../../js/src/util.js","../../js/src/alert.js","../../js/src/button.js","../../js/src/carousel.js","../../js/src/collapse.js","../../js/src/dropdown.js","../../js/src/modal.js","../../js/src/tooltip.js","../../js/src/popover.js","../../js/src/scrollspy.js","../../js/src/tab.js","../../js/src/index.js"],"names":["$","NAME","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","Event","ClassName","Alert","DATA_API_KEY","Selector","Button","Default","DefaultType","Direction","Carousel","Dimension","Collapse","Util","TRANSITION_END","transitionEndEmulator","duration","_this","this","called","one","setTimeout","triggerTransitionEnd","getUID","prefix","Math","random","document","getElementById","getSelectorFromElement","element","selector","getAttribute","querySelector","err","getTransitionDurationFromElement","transitionDuration","css","parseFloat","split","reflow","offsetHeight","trigger","supportsTransitionEnd","Boolean","isElement","obj","nodeType","typeCheckConfig","componentName","config","configTypes","property","Object","prototype","hasOwnProperty","call","expectedTypes","value","valueType","toString","match","toLowerCase","RegExp","test","Error","toUpperCase","fn","emulateTransitionEnd","event","special","bindType","delegateType","handle","target","is","handleObj","handler","apply","arguments","CLOSE","CLOSED","CLICK_DATA_API","_element","_proto","close","rootElement","_getRootElement","_triggerCloseEvent","iLine truncated
|
{"version":3,"sources":["../../js/src/util.js","../../js/src/alert.js","../../js/src/button.js","../../js/src/carousel.js","../../js/src/collapse.js","../../node_modules/popper.js/dist/esm/popper.js","../../js/src/dropdown.js","../../js/src/modal.js","../../js/src/tools/sanitizer.js","../../js/src/tooltip.js","../../js/src/popover.js","../../js/src/scrollspy.js","../../js/src/tab.js","../../js/src/toast.js"],"names":["TRANSITION_END","transitionEndEmulator","duration","_this","this","called","$","one","Util","setTimeout","triggerTransitionEnd","getUID","prefix","Math","random","document","getElementById","getSelectorFromElement","element","selector","getAttribute","hrefAttr","trim","querySelector","err","getTransitionDurationFromElement","transitionDuration","css","transitionDelay","floatTransitionDuration","parseFloat","floatTransitionDelay","split","reflow","offsetHeight","trigger","supportsTransitionEnd","Boolean","isElement","obj","nodeType","typeCheckConfig","componentName","config","configTypes","property","Object","prototype","hasOwnProperty","call","expectedTypes","value","valueType","toString","match","toLowerCase","RegExp","test","Error","toUpperCase","findShadowRoot","documentElement","attachShadow","getRootNode","ShadowRoot","parentNode","root","jQueryDetection","TypeError","version","fn","jquery","emulateTransitionEnd","event","special","bindType","delegateType","handle","target","is","handleObj","handler","apply","arguments","NAME","DATA_KEY","EVENT_KEY","JQUERLine truncated
|
||||||
Vendored
+6
-6
@@ -1,12 +1,12 @@
|
|||||||
/*!
|
/*!
|
||||||
* Bootswatch v4.1.3
|
* Bootswatch v4.4.1
|
||||||
* Homepage: https://bootswatch.com
|
* Homepage: https://bootswatch.com
|
||||||
* Copyright 2012-2018 Thomas Park
|
* Copyright 2012-2020 Thomas Park
|
||||||
* Licensed under MIT
|
* Licensed under MIT
|
||||||
* Based on Bootstrap
|
* Based on Bootstrap
|
||||||
*//*!
|
*//*!
|
||||||
* Bootstrap v4.1.3 (https://getbootstrap.com/)
|
* Bootstrap v4.4.1 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2018 The Bootstrap Authors
|
* Copyright 2011-2019 The Bootstrap Authors
|
||||||
* Copyright 2011-2018 Twitter, Inc.
|
* Copyright 2011-2019 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
*/@import url("https://fonts.googleapis.com/css?family=Lato:400,700,400italic");:root{--blue:#375a7f;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#E74C3C;--orange:#fd7e14;--yellow:#F39C12;--green:#00bc8c;--teal:#20c997;--cyan:#3498DB;--white:#fff;--gray:#999;--gray-dark:#303030;--primary:#375a7f;--secondary:#444;--success:#00bc8c;--info:#3498DB;--warning:#F39C12;--danger:#E74C3C;--light:#303030;--dark:#adb5bd;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:"Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--font-family-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:"Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:0.9375rem;font-weight:400;line-height:1.5;color:#fff;text-align:left;background-color:#222}[tabindex="-1"]:focus{outline:0 !Line truncated
|
*/@import url("https://fonts.googleapis.com/css?family=Lato:400,700,400italic&display=swap");:root{--blue: #375a7f;--indigo: #6610f2;--purple: #6f42c1;--pink: #e83e8c;--red: #E74C3C;--orange: #fd7e14;--yellow: #F39C12;--green: #00bc8c;--teal: #20c997;--cyan: #3498DB;--white: #fff;--gray: #888;--gray-dark: #303030;--primary: #375a7f;--secondary: #444;--success: #00bc8c;--info: #3498DB;--warning: #F39C12;--danger: #E74C3C;--light: #adb5bd;--dark: #303030;--breakpoint-xs: 0;--breakpoint-sm: 576px;--breakpoint-md: 768px;--breakpoint-lg: 992px;--breakpoint-xl: 1200px;--font-family-sans-serif: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:"Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:0.9375rem;font-weight:400;line-height:1.5;color:#fff;text-align:left;background-color:#222}[tabindex="-1"]:focus:not(:focus-visible){outline:0 !important}hr{-webkit-box-Line truncated
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* @author Script47 (https://github.com/Script47/Toast)
|
||||||
|
* @description Toast - A Bootstrap 4.2+ jQuery plugin for the toast component
|
||||||
|
* @version 0.7.1
|
||||||
|
**/
|
||||||
|
.toast-container {
|
||||||
|
position: sticky;
|
||||||
|
z-index: 1055;
|
||||||
|
top: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.toast-wrapper {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1055;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: 5px
|
||||||
|
}
|
||||||
|
|
||||||
|
.toast-container>.toast-wrapper>.toast {
|
||||||
|
min-width: 150px;
|
||||||
|
background-color: rgb(50, 50, 50);
|
||||||
|
border-top: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toast-container>.toast-wrapper>.toast>.toast-header strong {
|
||||||
|
padding-right: 20px;
|
||||||
|
}
|
||||||
Vendored
+136
@@ -0,0 +1,136 @@
|
|||||||
|
/**
|
||||||
|
* @author Script47 (https://github.com/Script47/Toast)
|
||||||
|
* @description Toast - A Bootstrap 4.2+ jQuery plugin for the toast component
|
||||||
|
* @version 0.7.1
|
||||||
|
**/
|
||||||
|
(function ($) {
|
||||||
|
var TOAST_CONTAINER_HTML = '<div class="toast-container" aria-live="polite" aria-atomic="true"></div>';
|
||||||
|
var TOAST_WRAPPER_HTML = '<div class="toast-wrapper"></div>';
|
||||||
|
|
||||||
|
$.toast = function (opts) {
|
||||||
|
// If container is not set in opts use body
|
||||||
|
var general_container = $('body');
|
||||||
|
if (opts.container && opts.container.length === 1)
|
||||||
|
general_container = opts.container;
|
||||||
|
|
||||||
|
// if toast container and wrapper are not present in container create them
|
||||||
|
if (!general_container.children('.toast-container').length) {
|
||||||
|
general_container.prepend(TOAST_CONTAINER_HTML);
|
||||||
|
general_container.children('.toast-container').append(TOAST_WRAPPER_HTML);
|
||||||
|
|
||||||
|
general_container.on('hidden.bs.toast', '.toast', function () {
|
||||||
|
$(this).remove();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
var toast_wrapper = general_container.children('.toast-container').children('.toast-wrapper');
|
||||||
|
|
||||||
|
var id = 'toast-' + ($('.toast').length + 1),
|
||||||
|
html = '',
|
||||||
|
bg_header_class = '',
|
||||||
|
fg_header_class = '',
|
||||||
|
fg_subtitle_class = 'text-muted',
|
||||||
|
fg_dismiss_class = '',
|
||||||
|
title = opts.title || 'Notice!',
|
||||||
|
subtitle = opts.subtitle || '',
|
||||||
|
content = opts.content || '',
|
||||||
|
type = opts.type || 'info',
|
||||||
|
delay = opts.delay || -1,
|
||||||
|
img = opts.img,
|
||||||
|
pause_on_hover = opts.pause_on_hover || false,
|
||||||
|
pause = false,
|
||||||
|
delay_or_autohide = '';
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case 'info':
|
||||||
|
bg_header_class = 'bg-info';
|
||||||
|
fg_header_class = 'text-white';
|
||||||
|
fg_subtitle_class = 'text-white';
|
||||||
|
fg_dismiss_class = 'text-white';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'success':
|
||||||
|
bg_header_class = 'bg-success';
|
||||||
|
fg_header_class = 'text-white';
|
||||||
|
fg_subtitle_class = 'text-white';
|
||||||
|
fg_dismiss_class = 'text-white';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'warning':
|
||||||
|
case 'warn':
|
||||||
|
bg_header_class = 'bg-warning';
|
||||||
|
fg_header_class = 'text-white';
|
||||||
|
fg_subtitle_class = 'text-white';
|
||||||
|
fg_dismiss_class = 'text-white';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'error':
|
||||||
|
case 'danger':
|
||||||
|
bg_header_class = 'bg-danger';
|
||||||
|
fg_header_class = 'text-white';
|
||||||
|
fg_subtitle_class = 'text-white';
|
||||||
|
fg_dismiss_class = 'text-white';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pause_on_hover !== false) {
|
||||||
|
var hide_timestamp = Math.floor(Date.now() / 1000) + (delay / 1000);
|
||||||
|
|
||||||
|
delay_or_autohide = 'data-autohide="false"';
|
||||||
|
pause_on_hover = 'data-hide-timestamp="' + hide_timestamp + '"';
|
||||||
|
} else {
|
||||||
|
if (delay === -1) {
|
||||||
|
delay_or_autohide = 'data-autohide="false"';
|
||||||
|
} else {
|
||||||
|
delay_or_autohide = 'data-delay="' + delay + '"';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
html = '<div id="' + id + '" class="toast" role="alert" aria-live="assertive" aria-atomic="true" ' + delay_or_autohide + ' ' + pause_on_hover + '>';
|
||||||
|
html += '<div class="toast-header ' + bg_header_class + ' ' + fg_header_class + '">';
|
||||||
|
|
||||||
|
if (typeof img !== 'undefined') {
|
||||||
|
html += '<img src="' + img.src + '" class="' + (img.class || '') + ' mr-2" alt="' + (img.alt || 'Image') + '" ' + (typeof img.title !== 'undefined' ? 'data-toggle="tooltip" title="' + img.title + '"' : '') + '>';
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<strong class="mr-auto">' + title + '</strong>';
|
||||||
|
html += '<small class="' + fg_subtitle_class + '">' + subtitle + '</small>';
|
||||||
|
html += '<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">';
|
||||||
|
html += '<span aria-hidden="true" class="' + fg_dismiss_class + '">×</span>';
|
||||||
|
html += '</button>';
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
if (content !== '') {
|
||||||
|
html += '<div class="toast-body">'
|
||||||
|
html += content
|
||||||
|
html += '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
toast_wrapper.append(html);
|
||||||
|
toast_wrapper.find('.toast:last').toast('show');
|
||||||
|
|
||||||
|
if (pause_on_hover !== false) {
|
||||||
|
setTimeout(function () {
|
||||||
|
if (!pause) {
|
||||||
|
$('#' + id).toast('hide');
|
||||||
|
}
|
||||||
|
}, delay);
|
||||||
|
|
||||||
|
$(document).on('mouseover', '#' + id, function () {
|
||||||
|
pause = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('mouseleave', '#' + id, function () {
|
||||||
|
var current = Math.floor(Date.now() / 1000),
|
||||||
|
future = parseInt($(this).data('hide-timestamp'));
|
||||||
|
|
||||||
|
pause = false;
|
||||||
|
|
||||||
|
if (current >= future) {
|
||||||
|
$(this).toast('hide');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}(jQuery));
|
||||||
+39
-42
@@ -76,20 +76,20 @@ $currentGeneralActionPriority = $rawNationGeneralPolicy['priority'] ?? $defaultG
|
|||||||
var availableNationPriorityItems = <?= Json::encode(AutorunNationPolicy::$defaultPriority) ?>;
|
var availableNationPriorityItems = <?= Json::encode(AutorunNationPolicy::$defaultPriority) ?>;
|
||||||
|
|
||||||
var defaultGeneralActionPriority = <?= Json::encode($defaultGeneralActionPriority) ?>;
|
var defaultGeneralActionPriority = <?= Json::encode($defaultGeneralActionPriority) ?>;
|
||||||
/*var currentGeneralActionPriority = <?= Json::encode($currentGeneralActionPriority) ?>;*/
|
var currentGeneralActionPriority = <?= Json::encode($currentGeneralActionPriority) ?>;
|
||||||
var currentGeneralActionPriority = ["NPC사망대비", "귀환", "금쌀구매", "출병", "긴급내정", "전투준비", "전방워프", "NPC헌납", "징병", "후방워프", "전쟁내정", "소집해제", "내정워프"];
|
|
||||||
var availableGeneralActionPriorityItems = <?= Json::encode(AutorunGeneralPolicy::$default_priority) ?>;
|
var availableGeneralActionPriorityItems = <?= Json::encode(AutorunGeneralPolicy::$default_priority) ?>;
|
||||||
</script>
|
</script>
|
||||||
<?= WebUtil::printJS('../e_lib/jquery-3.3.1.min.js') ?>
|
<?= WebUtil::printJS('../e_lib/jquery-3.3.1.min.js') ?>
|
||||||
<?= WebUtil::printJS('../e_lib/Sortable.min.js') ?>
|
<?= WebUtil::printJS('../e_lib/Sortable.min.js') ?>
|
||||||
<?= WebUtil::printJS('../e_lib/jquery-sortable.js') ?>
|
<?= WebUtil::printJS('../e_lib/jquery-sortable.js') ?>
|
||||||
<?= WebUtil::printJS('../e_lib/bootstrap.bundle.min.js') ?>
|
<?= WebUtil::printJS('../e_lib/bootstrap.bundle.min.js') ?>
|
||||||
|
<?= WebUtil::printJS('../e_lib/jquery_toast/toast.js') ?>
|
||||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||||
<?= WebUtil::printJS('js/common.js') ?>
|
<?= WebUtil::printJS('js/common.js') ?>
|
||||||
<?= WebUtil::printJS('js/npc_control.js') ?>
|
<?= WebUtil::printJS('js/npc_control.js') ?>
|
||||||
|
|
||||||
<?= WebUtil::printCSS('../e_lib/bootstrap.min.css') ?>
|
<?= WebUtil::printCSS('../e_lib/bootstrap.min.css') ?>
|
||||||
<?= WebUtil::printCSS('../e_lib/summernote/summernote-bs4.css') ?>
|
<?= WebUtil::printCSS('../e_lib/jquery_toast/toast.css') ?>
|
||||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||||
<?= WebUtil::printCSS('css/common.css') ?>
|
<?= WebUtil::printCSS('css/common.css') ?>
|
||||||
<?= WebUtil::printCSS('css/npc_control.css') ?>
|
<?= WebUtil::printCSS('css/npc_control.css') ?>
|
||||||
@@ -107,7 +107,7 @@ $currentGeneralActionPriority = $rawNationGeneralPolicy['priority'] ?? $defaultG
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<label for="reqNationGold" class="col-sm-6 col-form-label">국가 권장 금</label>
|
<label for="reqNationGold" class="col-sm-6 col-form-label">국가 권장 금</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input type="number" class="form-control" id="reqNationGold" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="reqNationGold" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style='text-align:right;'><small class="form-text text-muted">이 보다 많으면 포상, 적으면 몰수합니다.(긴급포상 제외)</small></div>
|
<div style='text-align:right;'><small class="form-text text-muted">이 보다 많으면 포상, 적으면 몰수합니다.(긴급포상 제외)</small></div>
|
||||||
@@ -115,73 +115,73 @@ $currentGeneralActionPriority = $rawNationGeneralPolicy['priority'] ?? $defaultG
|
|||||||
|
|
||||||
<label for="reqNationRice" class="col-sm-3 col-form-label">국가 권장 쌀</label>
|
<label for="reqNationRice" class="col-sm-3 col-form-label">국가 권장 쌀</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="reqNationRice" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="reqNationRice" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="reqHumanWarUrgentGold" class="col-sm-3 col-form-label">전투유저장 긴급포상 금</label>
|
<label for="reqHumanWarUrgentGold" class="col-sm-3 col-form-label">전투유저장 긴급포상 금</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="reqHumanWarUrgentGold" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="reqHumanWarUrgentGold" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
<label for="reqHumanWarUrgentRice" class="col-sm-3 col-form-label">전투유저장 긴급포상 쌀</label>
|
<label for="reqHumanWarUrgentRice" class="col-sm-3 col-form-label">전투유저장 긴급포상 쌀</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="reqHumanWarUrgentRice" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="reqHumanWarUrgentRice" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="reqHumanWarRecommandGold" class="col-sm-3 col-form-label">전투유저장 권장 금</label>
|
<label for="reqHumanWarRecommandGold" class="col-sm-3 col-form-label">전투유저장 권장 금</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="reqHumanWarRecommandGold" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="reqHumanWarRecommandGold" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
<label for="reqHumanWarRecommandRice" class="col-sm-3 col-form-label">전투유저장 권장 쌀</label>
|
<label for="reqHumanWarRecommandRice" class="col-sm-3 col-form-label">전투유저장 권장 쌀</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="reqHumanWarRecommandRice" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="reqHumanWarRecommandRice" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="reqHumanDevelGold" class="col-sm-3 col-form-label">내정유저장 권장 금</label>
|
<label for="reqHumanDevelGold" class="col-sm-3 col-form-label">내정유저장 권장 금</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="reqHumanDevelGold" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="reqHumanDevelGold" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
<label for="reqHumanDevelRice" class="col-sm-3 col-form-label">내정유저장 권장 쌀</label>
|
<label for="reqHumanDevelRice" class="col-sm-3 col-form-label">내정유저장 권장 쌀</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="reqHumanDevelRice" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="reqHumanDevelRice" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="reqNPCWarGold" class="col-sm-3 col-form-label">전투NPC 권장 금</label>
|
<label for="reqNPCWarGold" class="col-sm-3 col-form-label">전투NPC 권장 금</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="reqNPCWarGold" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="reqNPCWarGold" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
<label for="reqNPCWarRice" class="col-sm-3 col-form-label">전투NPC 권장 쌀</label>
|
<label for="reqNPCWarRice" class="col-sm-3 col-form-label">전투NPC 권장 쌀</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="reqNPCWarRice" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="reqNPCWarRice" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="reqNPCDevelGold" class="col-sm-3 col-form-label">내정NPC 권장 금</label>
|
<label for="reqNPCDevelGold" class="col-sm-3 col-form-label">내정NPC 권장 금</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="reqNPCDevelGold" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="reqNPCDevelGold" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
<label for="reqNPCDevelRice" class="col-sm-3 col-form-label">내정NPC 권장 쌀</label>
|
<label for="reqNPCDevelRice" class="col-sm-3 col-form-label">내정NPC 권장 쌀</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="reqNPCDevelRice" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="reqNPCDevelRice" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="minimumResourceActionAmount" class="col-sm-3 col-form-label">포상/몰수/헌납/삼/팜 최소 단위</label>
|
<label for="minimumResourceActionAmount" class="col-sm-3 col-form-label">포상/몰수/헌납/삼/팜 최소 단위</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="minimumResourceActionAmount" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="minimumResourceActionAmount" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
<label for="minWarCrew" class="col-sm-3 col-form-label">최소 전투 가능 병력 수</label>
|
<label for="minWarCrew" class="col-sm-3 col-form-label">최소 전투 가능 병력 수</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="minWarCrew" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="minWarCrew" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="minNPCRecruitCityPopulation" class="col-sm-3 col-form-label">NPC 최소 징병 가능 인구 수</label>
|
<label for="minNPCRecruitCityPopulation" class="col-sm-3 col-form-label">NPC 최소 징병 가능 인구 수</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="minNPCRecruitCityPopulation" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="minNPCRecruitCityPopulation" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
<label for="safeRecruitCityPopulationRatio" class="col-sm-3 col-form-label">제자리 징병 허용 인구율(%)</label>
|
<label for="safeRecruitCityPopulationRatio" class="col-sm-3 col-form-label">제자리 징병 허용 인구율(%)</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
@@ -191,24 +191,27 @@ $currentGeneralActionPriority = $rawNationGeneralPolicy['priority'] ?? $defaultG
|
|||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="minNPCWarLeadership" class="col-sm-3 col-form-label">NPC 전투 참여 통솔 기준</label>
|
<label for="minNPCWarLeadership" class="col-sm-3 col-form-label">NPC 전투 참여 통솔 기준</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="minNPCWarLeadership" min="0" value="0">
|
<input type="number" class="form-control" data-type="integer" id="minNPCWarLeadership" min="0" value="0">
|
||||||
</div>
|
</div>
|
||||||
<label for="properWarTrainAtmos" class="col-sm-3 col-form-label">훈련/사기진작 목표치</label>
|
<label for="properWarTrainAtmos" class="col-sm-3 col-form-label">훈련/사기진작 목표치</label>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<input type="number" class="form-control" id="properWarTrainAtmos" min="0" max="100" value="0">
|
<input type="number" class="form-control" data-type="integer" id="properWarTrainAtmos" min="0" max="100" value="0">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="alert alert-secondary">
|
<div class="alert alert-secondary">
|
||||||
전투 부대는 작업중입니다(json양식: {부대번호:[시작도시번호(아국),도착도시번호(적군)],...})<br>
|
전투 부대는 작업중입니다(json양식: {부대번호:[시작도시번호(아국),도착도시번호(적군)],...})<br>
|
||||||
후방 징병 부대는 작업중입니다(json양식: [부대번호,...])<br>
|
후방 징병 부대는 작업중입니다(json양식: [부대번호,...])<br>
|
||||||
내정 부대는 작업중입니다(json양식: [부대번호,...])
|
내정 부대는 작업중입니다(json양식: [부대번호,...])
|
||||||
<input type="hidden" value="{}" id="CombatForce">
|
<input type="hidden" value="{}" data-type="json" id="CombatForce">
|
||||||
<input type="hidden" value="[]" id="SupportForce">
|
<input type="hidden" value="[]" data-type="json" id="SupportForce">
|
||||||
<input type="hidden" value="[]" id="DevelopForce">
|
<input type="hidden" value="[]" data-type="json" id="DevelopForce">
|
||||||
<input type="hidden" value="true" id="allowNpcAttackCity">
|
<input type="hidden" value="true" data-type="json" id="allowNpcAttackCity"><!--allowNpcAttackCity는 현재 게임 내 비활성-->
|
||||||
</div>
|
</div>
|
||||||
<div class='control_bar'>
|
<div class='control_bar' data-type="nationPolicy">
|
||||||
<button type="button" class="btn btn-dark reset_btn" data-type="nation_policy">초기값으로</button><button type="button" class="btn btn-primary submit_btn" data-type="nation_policy">설정</button>
|
<div class="btn-group" role="group">
|
||||||
|
<button type="button" class="btn btn-dark reset_btn">초기값으로</button>
|
||||||
|
<button type="button" class="btn btn-secondary revert_btn">이전값으로</button>
|
||||||
|
</div><button type="button" class="btn btn-primary submit_btn">설정</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -219,22 +222,19 @@ $currentGeneralActionPriority = $rawNationGeneralPolicy['priority'] ?? $defaultG
|
|||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="bg2 sub_bar">비활성</div>
|
<div class="bg2 sub_bar">비활성</div>
|
||||||
<div id="nationPriorityDisabled" class="list-group col" data-type="list">
|
<div id="nationPriorityDisabled" class="list-group col" data-type="list">
|
||||||
<div class="list-group-item">비활성화1</div>
|
|
||||||
<div class="list-group-item">비활성화2</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="bg2 sub_bar">활성</div>
|
<div class="bg2 sub_bar">활성</div>
|
||||||
<div id="nationPriority" class="list-group col" data-type="list">
|
<div id="nationPriority" class="list-group col" data-type="list">
|
||||||
<div class="list-group-item">활성화1</div>
|
|
||||||
<div class="list-group-item">활성화2</div>
|
|
||||||
<div class="list-group-item">활성화3</div>
|
|
||||||
<div class="list-group-item">활성화4</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='control_bar'>
|
<div class='control_bar' data-type="nationPriority">
|
||||||
<button type="button" class="btn btn-dark reset_btn" data-type="nation_priority">초기값으로</button><button type="button" class="btn btn-primary submit_btn" data-type="nation_priority">설정</button>
|
<div class="btn-group" role="group">
|
||||||
|
<button type="button" class="btn btn-dark reset_btn">초기값으로</button>
|
||||||
|
<button type="button" class="btn btn-secondary revert_btn">이전값으로</button>
|
||||||
|
</div><button type="button" class="btn btn-primary submit_btn">설정</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -245,22 +245,19 @@ $currentGeneralActionPriority = $rawNationGeneralPolicy['priority'] ?? $defaultG
|
|||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="bg2 sub_bar">비활성</div>
|
<div class="bg2 sub_bar">비활성</div>
|
||||||
<div id="generalPriorityDisabled" class="list-group col" data-type="list">
|
<div id="generalPriorityDisabled" class="list-group col" data-type="list">
|
||||||
<div class="list-group-item">비활성화1</div>
|
|
||||||
<div class="list-group-item">비활성화2</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="bg2 sub_bar">활성</div>
|
<div class="bg2 sub_bar">활성</div>
|
||||||
<div id="generalPriority" class="list-group col" data-type="list">
|
<div id="generalPriority" class="list-group col" data-type="list">
|
||||||
<div class="list-group-item">활성화1</div>
|
|
||||||
<div class="list-group-item">활성화2</div>
|
|
||||||
<div class="list-group-item">활성화3</div>
|
|
||||||
<div class="list-group-item">활성화4</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='control_bar'>
|
<div class='control_bar' data-type="generalPriority">
|
||||||
<button type="button" class="btn btn-dark reset_btn" data-type="general_priority">초기값으로</button><button type="button" class="btn btn-primary submit_btn" data-type="general_priority">설정</button>
|
<div class="btn-group" role="group">
|
||||||
|
<button type="button" class="btn btn-dark reset_btn">초기값으로</button>
|
||||||
|
<button type="button" class="btn btn-secondary revert_btn">이전값으로</button>
|
||||||
|
</div><button type="button" class="btn btn-primary submit_btn">설정</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -311,6 +311,15 @@ function errUnknown(){
|
|||||||
alert('작업을 실패했습니다.');
|
alert('작업을 실패했습니다.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function errUnknownToast(){
|
||||||
|
$.toast({
|
||||||
|
title: '에러!',
|
||||||
|
content: '작업을 실패했습니다.',
|
||||||
|
type: 'danger',
|
||||||
|
delay: 5000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function quickReject(errMsg){
|
function quickReject(errMsg){
|
||||||
if(errMsg === undefined){
|
if(errMsg === undefined){
|
||||||
errMsg = '작업을 실패했습니다.';
|
errMsg = '작업을 실패했습니다.';
|
||||||
|
|||||||
+207
-61
@@ -1,69 +1,215 @@
|
|||||||
jQuery(function($){
|
jQuery(function ($) {
|
||||||
|
|
||||||
function initPriority(priorityKey, currentPriority, availablePriority){
|
function initPriority(priorityKey, currentPriority, availablePriority) {
|
||||||
var $disabledList = $('#{0}Disabled'.format(priorityKey));
|
var $disabledList = $('#{0}Disabled'.format(priorityKey));
|
||||||
var $enabledList = $('#{0}'.format(priorityKey));
|
var $enabledList = $('#{0}'.format(priorityKey));
|
||||||
|
|
||||||
$disabledList.empty();
|
$disabledList.empty();
|
||||||
$enabledList.empty();
|
$enabledList.empty();
|
||||||
|
|
||||||
var usedKey = {};
|
var usedKey = {};
|
||||||
var itemFrame = '<div class="list-group-item" data-value="{0}">{0}</div>';
|
var itemFrame = '<div class="list-group-item" data-value="{0}">{0}</div>';
|
||||||
$.each(currentPriority, function(key, val){
|
$.each(currentPriority, function (key, val) {
|
||||||
var $item = $(itemFrame.format(val));
|
var $item = $(itemFrame.format(val));
|
||||||
usedKey[val] = true;
|
usedKey[val] = true;
|
||||||
$enabledList.append($item);
|
$enabledList.append($item);
|
||||||
})
|
})
|
||||||
|
|
||||||
var $disabled = $(itemFrame.format('<비활성화 항목들>')).addClass('filtered');
|
|
||||||
$disabledList.append($disabled);
|
|
||||||
|
|
||||||
$.each(availablePriority, function(key, val){
|
var $disabled = $(itemFrame.format('<비활성화 항목들>')).addClass('filtered');
|
||||||
if(val in usedKey){
|
$disabledList.append($disabled);
|
||||||
return true;
|
|
||||||
|
$.each(availablePriority, function (key, val) {
|
||||||
|
if (val in usedKey) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var $item = $(itemFrame.format(val));
|
||||||
|
$disabledList.append($item);
|
||||||
|
})
|
||||||
|
|
||||||
|
$disabledList.sortable({
|
||||||
|
group: priorityKey,
|
||||||
|
filter: '.filtered',
|
||||||
|
animation: 150
|
||||||
|
});
|
||||||
|
|
||||||
|
$enabledList.sortable({
|
||||||
|
group: priorityKey,
|
||||||
|
filter: '.filtered',
|
||||||
|
animation: 150
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function initNationPolicy() {
|
||||||
|
$.each(currentNationPolicy, function (key, val) {
|
||||||
|
var $obj = $('#{0}'.format(key));
|
||||||
|
|
||||||
|
if (!$obj.length) {
|
||||||
|
console.log('{0}가 없대!'.format(key));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var type = $obj.data('type');
|
||||||
|
if (!$obj.is('input')) {
|
||||||
|
console.log('아니라고?');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == 'percent') {
|
||||||
|
$obj.val(val * 100);
|
||||||
|
}
|
||||||
|
else if (type == 'json') {
|
||||||
|
$obj.val(JSON.stringify(val));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$obj.val(val);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
initPriority('generalPriority', currentGeneralActionPriority, availableGeneralActionPriorityItems);
|
||||||
|
initPriority('nationPriority', currentNationPriority, availableNationPriorityItems);
|
||||||
|
initNationPolicy();
|
||||||
|
|
||||||
|
|
||||||
|
$('.reset_btn').click(function () {
|
||||||
|
var $this = $(this);
|
||||||
|
|
||||||
|
if (!confirm('서버 초기 설정으로 되돌릴까요?')) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
var $item = $(itemFrame.format(val));
|
|
||||||
$disabledList.append($item);
|
var type = $this.parents('.control_bar').data('type');
|
||||||
|
if (type === 'nationPolicy') {
|
||||||
|
window.currentNationPolicy = window.defaultNationPolicy;
|
||||||
|
initNationPolicy();
|
||||||
|
}
|
||||||
|
else if (type === 'generalPriority') {
|
||||||
|
window.currentGeneralActionPriority = window.defaultGeneralActionPriority;
|
||||||
|
initPriority('generalPriority', currentGeneralActionPriority, availableGeneralActionPriorityItems);
|
||||||
|
}
|
||||||
|
else if (type === 'nationPriority') {
|
||||||
|
window.currentNationPriority = window.defaultNationPriority;
|
||||||
|
initPriority('nationPriority', currentNationPriority, availableNationPriorityItems);
|
||||||
|
}
|
||||||
|
|
||||||
|
$.toast({
|
||||||
|
title: '초기화 완료',
|
||||||
|
content: '서버 초기값을 적용했습니다. 설정 버튼을 누르면 반영됩니다.',
|
||||||
|
type: 'info',
|
||||||
|
delay: 5000
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.revert_btn').click(function () {
|
||||||
|
var $this = $(this);
|
||||||
|
|
||||||
|
if (!confirm('이전 설정으로 되돌릴까요?')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var type = $this.parents('.control_bar').data('type');
|
||||||
|
if (type === 'nationPolicy') {
|
||||||
|
initNationPolicy();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type === 'generalPriority') {
|
||||||
|
initPriority('generalPriority', currentGeneralActionPriority, availableGeneralActionPriorityItems);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type === 'nationPriority') {
|
||||||
|
initPriority('nationPriority', currentNationPriority, availableNationPriorityItems);
|
||||||
|
}
|
||||||
|
|
||||||
|
$.toast({
|
||||||
|
title: '되돌리기 완료',
|
||||||
|
content: '이전 설정으로 되돌렸습니다.',
|
||||||
|
type: 'success',
|
||||||
|
delay: 5000
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
var collectPriority = function (priorityKey) {
|
||||||
|
var $list = $('#{0}'.format(priorityKey));
|
||||||
|
var result = [];
|
||||||
|
$list.find('.list-group-item').each(function(){
|
||||||
|
var $item = $(this);
|
||||||
|
result.push($item.data('value'));
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
var collectNationPolicy = function () {
|
||||||
|
var src = window.currentNationPolicy;
|
||||||
|
var result = {};
|
||||||
|
$.each(src, function (key, val) {
|
||||||
|
var $item = $('#{0}'.format(key));
|
||||||
|
var val = $item.val();
|
||||||
|
var dataType = $item.data('type');
|
||||||
|
if (dataType === 'percent') {
|
||||||
|
val /= 100;
|
||||||
|
}
|
||||||
|
else if (dataType === 'json') {
|
||||||
|
val = JSON.parse(val);
|
||||||
|
}
|
||||||
|
else if (dataType === 'integer') {
|
||||||
|
val = parseInt(val);
|
||||||
|
}
|
||||||
|
result[key] = val;
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
window.collectNationPolicy = collectNationPolicy;
|
||||||
|
|
||||||
|
$('.submit_btn').click(function () {
|
||||||
|
var $this = $(this);
|
||||||
|
if (!confirm('저장할까요?')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var type = $this.parents('.control_bar').data('type');
|
||||||
|
var data;
|
||||||
|
if (type === 'nationPolicy') {
|
||||||
|
data = collectNationPolicy();
|
||||||
|
}
|
||||||
|
else if (type === 'nationPriority') {
|
||||||
|
data = collectPriority(type);
|
||||||
|
}
|
||||||
|
else if (type === 'generalPriority') {
|
||||||
|
data = collectPriority(type);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
alert('올바르지 않은 type : {0}'.type);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
|
$.post({
|
||||||
|
url: 'j_set_npc_control.php',
|
||||||
|
dataType: 'json',
|
||||||
|
data: {
|
||||||
|
type: type,
|
||||||
|
data: JSON.stringify(data)
|
||||||
|
}
|
||||||
|
}).then(function (data) {
|
||||||
|
if (!data) {
|
||||||
|
return quickReject('설정하지 못했습니다.');
|
||||||
|
}
|
||||||
|
if (!data.result) {
|
||||||
|
return quickReject('설정하지 못했습니다. : ' + data.reason);
|
||||||
|
}
|
||||||
|
}, errUnknownToast)
|
||||||
|
.fail(function (reason) {
|
||||||
|
$.toast({
|
||||||
|
title: '에러!',
|
||||||
|
content: reason,
|
||||||
|
type: 'danger',
|
||||||
|
delay: 5000
|
||||||
|
});
|
||||||
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
$disabledList.sortable({
|
|
||||||
group: priorityKey,
|
|
||||||
filter: '.filtered',
|
|
||||||
animation: 150
|
|
||||||
});
|
|
||||||
|
|
||||||
$enabledList.sortable({
|
|
||||||
group: priorityKey,
|
|
||||||
filter: '.filtered',
|
|
||||||
animation: 150
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
initPriority('generalPriority', currentGeneralActionPriority, availableGeneralActionPriorityItems);
|
|
||||||
initPriority('nationPriority', currentNationPriority, availableNationPriorityItems);
|
|
||||||
|
|
||||||
|
|
||||||
$.each(currentNationPolicy, function(key, val){
|
|
||||||
var $obj = $('#{0}'.format(key));
|
|
||||||
|
|
||||||
if(!$obj.length){
|
|
||||||
console.log('{0}가 없대!'.format(key));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var type=$obj.data('type');
|
|
||||||
if(!$obj.is('input')){
|
|
||||||
console.log('아니라고?');
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(type =='percent'){
|
|
||||||
$obj.val(val*100);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$obj.val(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user