Compare commits

..
754 Commits
Author SHA1 Message Date
Hide_D f78fcc2b71 여백 주기 2019-04-11 19:53:27 +09:00
Hide_D fb2d30f2c9 서버별 아이콘 적용 가능 2019-04-11 19:50:59 +09:00
Hide_D 8781e7c6ad tooltip 처리 방식을 지연 처리로 변경 2019-04-10 23:27:53 +09:00
Hide_D c34317b1e5 년, 월로 넘치더라도 그냥 자름 2019-04-08 01:56:57 +09:00
Hide_D b09730b422 스타크래프트 1 프로게이대전 추가 2019-04-08 01:51:38 +09:00
Hide_D 0f1725a7ab 인탐 조건에서 방랑군은 다시 불가능하게. 2019-04-08 01:45:05 +09:00
Hide_D b12e0358d6 방랑군이거나, 국가의 인구가 다 차더라도 인구 탐색 가능 2019-04-08 01:43:01 +09:00
Hide_D 7ef841746a 장수수 > 10, 집합장 제외 장수수 < 10일 때, 기술이 과도하게 오르는버그 수정 2019-04-08 01:33:49 +09:00
Hide_D 2b52b2379e 새 숙련도 공식 반영, 제곱식 기반에서 세제곱식 기반으로 2019-04-08 01:21:06 +09:00
Hide_D 8dd5965c44 진유저무쌍 릴리즈 2019-04-07 23:55:44 +09:00
Hide_D b273082492 세력 장수 쿼리 버그 수정 2019-04-07 17:15:16 +09:00
Hide_D da088d88ba 세력장수 본닉 2019-04-06 14:46:07 +09:00
Hide_D fd13570074 천통시 장수 일람 2019-04-06 14:25:12 +09:00
Hide_D b5630a9dae 오타(?) 수정 2019-03-26 15:47:17 +09:00
Hide_D 0e2cab6409 명전 재 갱신 코드 추가 2019-03-26 15:44:04 +09:00
Hide_D 38dc587318 명전 등록시 문자 문제 수정 2019-03-26 15:36:38 +09:00
Hide_D 6fbddcb7c2 cache control 수정 2019-03-22 09:30:24 +09:00
Hide_D df1df2964d session_cache_limiter 삭제. no-cache가 기본값임 2019-03-22 09:26:52 +09:00
Hide_D 9b9c2546c8 확률 추가 수정 2019-03-15 15:15:00 +09:00
Hide_D 6ce0e72b33 인탐 확률 핫픽스 2019-03-15 15:00:12 +09:00
Hide_D a7784d7870 지연 threshold 증가 2019-03-10 17:20:44 +09:00
Hide_D 306ca3e04f 점령 시 도시 관직 초기화. 코드 정리 2019-03-10 17:19:35 +09:00
Hide_D 82988b0e08 장사-영릉이 이어진걸로 나오는 일반지도 버그 수정 2019-03-10 14:19:29 +09:00
Hide_D 8b27d0e249 불가침 서신 거부 불가능한 버그 수정 2019-03-10 00:47:13 +09:00
Hide_D bfae547240 은퇴 연령 값을 GameConst로 이동 2019-03-09 17:08:11 +09:00
Hide_D 0abd026f78 인탐, 의병에서 발생할 수 있는 숙련 예외 케이스 제거 2019-03-09 16:50:31 +09:00
Hide_D 3362a76de7 값 실수 수정 2019-03-09 16:41:41 +09:00
Hide_D 355b6c2e7d 인탐 확률 추가 수정 2019-03-09 16:23:47 +09:00
Hide_D 4e3c643e43 시나리오 최대 장수값 조절 2019-03-09 13:45:29 +09:00
Hide_D 760cb97db4 인탐 가속 조건 강화 2019-03-09 06:12:26 +09:00
Hide_D 0be6f7f57e 오타 수정 2019-03-09 03:43:15 +09:00
Hide_D d31223fa0c 커맨드 attr 수정 2019-03-09 02:30:12 +09:00
Hide_D 86ee9befc1 커맨드 버그 수정? 2019-03-09 02:26:50 +09:00
Hide_D d5689b061f 의병 고용으로는 무지장이 안나옴 2019-03-09 01:59:41 +09:00
Hide_D a3c4da4455 의병고용 버그 수정 2019-03-09 01:57:51 +09:00
Hide_D ee9f97f917 m장 합산 능력치 버그 수정 2019-03-09 01:05:47 +09:00
Hide_D 270c7377de 사령턴 실행후 재 로드시 수비 켬끔 리셋 관련 버그 수정 2019-03-09 00:59:16 +09:00
Hide_D 9044b57306 영입 금지시에는 인탐 확률 보정 없음 2019-03-09 00:41:38 +09:00
Hide_D 9ad815a44a Revert "커밋 취소"
This reverts commit 0843da7a7c.
2019-03-09 00:40:16 +09:00
Hide_D b7e432228b 커밋 취소 2019-03-09 00:39:13 +09:00
Hide_D 78da30f2ad m장이 아주 적을땐 잘 뽑히도록 2019-03-09 00:33:14 +09:00
Hide_D aeea53017f 인탐 장수 비율 4:4:2로 변경. 인탐장 숙련도 평준화. 인탐 확률 상승. 발견 추가. 2019-03-09 00:15:51 +09:00
Hide_D f21ebfc366 관리자 턴 당김 버그 수정 2019-03-09 00:00:00 +09:00
Hide_D 2549aa5809 의병, 인탐장도 적은 비중으로 장수 카운트에 추가 2019-03-08 22:20:45 +09:00
Hide_D b733b70ad8 황제가 있을 경우 황제. 없으면 이전 천통 군주의 명으로 토너먼트 개최 2019-03-06 01:44:24 +09:00
Hide_D f9f59bd7c2 토너먼트 변경이 변경 횟수를 깎지 않음. 수비 끔 시 훈사 3 감소 2019-03-06 01:09:34 +09:00
Hide_D 58933a6bcd 인자 버그 수정 2019-03-06 00:40:56 +09:00
Hide_D 45d7a29a95 수비 순서에 훈사 영향을 더 강하게 주도록 변경 2019-03-06 00:38:35 +09:00
Hide_D e9d1fdb4ee 두번 탭 해 도시 이동 기능 재 부활, 옵션 설정 가능 2019-03-05 23:06:34 +09:00
Hide_D 2785ca9f31 천통 시에는 계략 명장이 보임 2019-03-05 02:32:42 +09:00
Hide_D 12912a62aa 아이템에 장수명을 띄우는것은 비합리적으로 보임 2019-03-05 02:29:10 +09:00
Hide_D 2c2b078514 명장일람에서 계략 시도 장수 본닉이 뜨는 문제 수정 2019-03-05 02:27:22 +09:00
Hide_D 110294103f 천통 후에는 명장 일람에 장수 본닉이 뜨도록 2019-03-05 02:23:28 +09:00
Hide_D a9f3b839ec 명전에서 장수의 본닉이 뜨도록 2019-03-05 02:11:52 +09:00
Hide_D 6bd677ad6f 은퇴 후 명전 등록 시 '이전 값보다 높아진 경우'에만 경신하도록 수정 2019-03-05 01:45:03 +09:00
Hide_D 7d1c5f3510 집합장이 군주인 경우 아무에게나 선양 2019-03-05 01:20:27 +09:00
Hide_D a49508fd20 외교권자 등에서 인사부 연동이 안되는 버그 해결 2019-02-27 23:33:18 +09:00
Hide_D 5870213ff0 권한 관련 버그 수정 2019-02-27 23:23:53 +09:00
Hide_D 65c3d7f925 선양 버그 수정 2019-02-25 21:27:17 +09:00
Hide_D 33f4fd8fee 외교권자 버그 수정 2019-02-25 21:25:29 +09:00
Hide_D 9bdc34dc42 버그 수정 2019-02-24 19:41:00 +09:00
Hide_D ff654df997 본인 국가 아닌 곳에 임명 가능한 버그 수정 2019-02-24 01:12:59 +09:00
Hide_D b7758da2f3 회의실 기밀실 '타이틀'이 거꾸로 표기되는 버그 수정 2019-02-24 00:56:25 +09:00
Hide_D 747089f1a8 게시판 위아래 가운데 정렬.. 2019-02-24 00:55:13 +09:00
Hide_D 9ee3021b76 NPC 군주는 유저장 수뇌에게 외교권자 권한 부여 2019-02-24 00:52:42 +09:00
Hide_D 0c60ea66e3 자국 내 외교권자에게는 메시지 보낼 수 있도록 수정 2019-02-24 00:42:34 +09:00
Hide_D c3bb312b5f 선양시 외교권자 지정 코드 수정 2019-02-24 00:37:01 +09:00
Hide_D 7447a42d40 외교 서신 수락시, 국메, 외교 둘다 뜨도록 수정 2019-02-24 00:32:22 +09:00
Hide_D 3e9cc367af 게시판 이름 ㅇ 2019-02-24 00:23:45 +09:00
Hide_D 4c1790014f 메시지 변경 2019-02-20 01:40:56 +09:00
Hide_D 03fc7a579a 비재야망명 버그 수정 2019-02-17 23:57:26 +09:00
Hide_D a53db257cf 외교부 버그 수정 2019-02-14 21:28:15 +09:00
Hide_D b093cab493 한칸 띄움 2019-02-03 02:18:07 +09:00
Hide_D 9b484dc819 간이 툴바 생성 2019-02-03 01:54:58 +09:00
Hide_D 5ab26a9f8c 메시지 자동 링크 2019-02-03 00:28:29 +09:00
Hide_D b800a63bd2 고대무장 신대륙국가 추가 2019-01-31 02:24:18 +09:00
Hide_D 43a5e47fb3 애니집결 5차 반영 2019-01-31 02:14:10 +09:00
Hide_D 319545106e 외교부 버튼 조건 변경 2019-01-30 02:54:38 +09:00
Hide_D 39b261b8a0 버그 수정 2019-01-30 00:04:33 +09:00
Hide_D c9e61d1098 버그 수정 2019-01-30 00:03:36 +09:00
Hide_D 0bffdaa5fc 외교 메시지 과거 권한 문제 수정 2019-01-30 00:02:28 +09:00
Hide_D 9228510834 댓글 입력도 투명하게 2019-01-29 23:46:47 +09:00
Hide_D 0b002a8946 댓글 엔터시 입력 2019-01-29 23:43:37 +09:00
Hide_D ad43ddabe6 Merge branch 'ng_diplomacy' of ssh://storage.hided.net:2525/devsam/core into ng_diplomacy 2019-01-29 23:40:35 +09:00
Hide_D 24c022a329 회의실 기밀실 템플릿 2019-01-29 23:40:28 +09:00
Hide_D 0e48cee0d6 하야 임관시 권한 초기화 2019-01-29 17:12:04 +09:00
Hide_D 4ad1794d95 버그 수정 2019-01-29 02:57:24 +09:00
Hide_D 46cf25b585 승인시 이전 내용 중첩 2019-01-29 02:53:39 +09:00
Hide_D b3d78fc30f 파기 요청 추가 2019-01-29 02:48:41 +09:00
Hide_D 556bc06da4 시중->종사, 감찰부 권한 정리 2019-01-28 20:33:44 +09:00
Hide_D 7e8f9c463b 공개, 비밀 문구 변경 2019-01-26 06:58:12 +09:00
Hide_D 568c7779b6 템플릿 미완 부분 수정 2019-01-26 06:56:19 +09:00
Hide_D 0a0d237f4d 대체된 메시지 보기 가능 2019-01-26 06:44:34 +09:00
Hide_D c243ccbdce 틀 일부 수정 2019-01-26 06:36:48 +09:00
Hide_D 64b79d6af5 외교부 추가 2019-01-26 06:30:29 +09:00
Hide_D 016c0f3743 외교 메시지 필터링에 invalid 옵션 추가 2019-01-26 04:03:15 +09:00
Hide_D fd1599e0a7 외교 메시지 전송시 알림 2019-01-26 03:50:08 +09:00
Hide_D 7408aa6b72 조언자 인원수로 보여줌 2019-01-26 03:40:01 +09:00
Hide_D e6b2107fa9 외교부 틀 작성중. 재야의 외교 메시지는 항상 보이도록 2019-01-26 03:31:04 +09:00
Hide_D 9aff52eaad 권한 문제 수정 2019-01-25 23:29:35 +09:00
Hide_D bf5bda0f85 내무부 권한 수정 2019-01-25 22:35:49 +09:00
Hide_D ffbf2d0a93 국적 변경시 permission 초기화 2019-01-25 20:30:02 +09:00
Hide_D 82f59ef5a2 게시물 순서 변경 2019-01-25 20:17:36 +09:00
Hide_D c2c40abbb4 외교권자 기밀실 버튼 활성화 2019-01-25 19:49:29 +09:00
Hide_D bb54d732d0 수락 불가능한 문제 해결 2019-01-25 19:46:32 +09:00
Hide_D eee4e0c676 없는것보단 나은 회의실 css 2019-01-25 19:40:13 +09:00
Hide_D d9457ae017 내무부 비고란 제거 2019-01-25 19:34:36 +09:00
Hide_D bbc0b18b19 외교 메시지 삭제 조건 완화 2019-01-25 19:32:13 +09:00
Hide_D da7651311e 메시지 삭제가 안되던 버그 수정 2019-01-25 19:30:33 +09:00
Hide_D 72846f0817 인사부 수정 2019-01-25 19:22:30 +09:00
Hide_D 05ef3387ab 외교권자 임명 대기중 2019-01-25 03:16:34 +09:00
Hide_D eed44e5737 외교권자 목록 출력 2019-01-25 02:18:20 +09:00
Hide_D 27c7a85a21 게시판 기능만 동작 2019-01-25 02:11:54 +09:00
Hide_D 4f6dd046ec 게시판이 '동작만 함' 2019-01-25 01:51:26 +09:00
Hide_D 89fad9ada7 이전 외교 메시지를 불러 올 수 있음 2019-01-25 01:39:45 +09:00
Hide_D bc31b49b99 외교권자에게는 메시지를 보낼 수 없음 2019-01-25 01:28:06 +09:00
Hide_D 09444e3624 1차 버그 수정 2019-01-25 01:02:13 +09:00
Hide_D 7586243a95 DB 스키마 변경 2019-01-25 00:13:04 +09:00
Hide_D 1e1c7801e1 중간반영 2019-01-24 03:34:03 +09:00
Hide_D a363f6ef5f 외교부 틀 작성 2019-01-23 03:11:07 +09:00
Hide_D 334e1fd2da 국메 처리 방식을 변경. 국가간 메시지는 외교권자만 가능 2019-01-23 02:36:03 +09:00
Hide_D 2e8e29e93c 외교메시지 수신 기준 변경중 2019-01-23 01:37:40 +09:00
Hide_D 5e5a1a3668 기존 회의실, 기밀실 코드 삭제 2019-01-22 03:17:44 +09:00
Hide_D b93b464ebf 외교서신 응답 2019-01-22 02:47:27 +09:00
Hide_D 842ba46a95 파일 명을 namespace를 고려하여 수정 2019-01-21 02:25:54 +09:00
Hide_D 03b27d8e8f 외교 서신 추가 기능 2019-01-21 02:23:23 +09:00
Hide_D c11b41c6ba 게시물 코드 2019-01-21 02:00:48 +09:00
Hide_D 018cc526ee 게시판 글, 댓글 작성 초안 2019-01-21 01:45:32 +09:00
Hide_D edf4508e6b 권한 세팅 2019-01-18 03:01:02 +09:00
Hide_D d26a1f0312 왕 무장 관직 순서 변경 2019-01-17 23:01:05 +09:00
Hide_D 2984f6a453 무관 최종 관직을 실제 삼국지 관직 순서에 맞게 변경 2019-01-17 22:59:54 +09:00
Hide_D a00058d959 시중->종사 2019-01-17 22:44:18 +09:00
Hide_D 8e56a457f1 게시물 구조 설정 2019-01-17 03:12:26 +09:00
Hide_D 74d5f021cd tui-editor와 새 게시판 준비 2019-01-17 02:54:58 +09:00
Hide_D a37715315d permission, penalty 대응 준비 2019-01-16 02:47:48 +09:00
Hide_D d9c9977610 장수 schema 수정 2019-01-16 02:26:28 +09:00
Hide_D c2f0cbb10a 버튼 이동 코드 정리 2019-01-16 02:18:42 +09:00
Hide_D a34d00d822 DB 스키마 정리, diplomacy 테이블 정리, 코드 정리 2019-01-16 01:59:07 +09:00
Hide_D 9924ec6963 국법 기능 제거. 외교부를 위한 자리 추가 2019-01-12 18:53:01 +09:00
Hide_D 9036201887 DB 스키마 준비 2019-01-12 07:21:34 +09:00
Hide_D b2435d2430 걸그룹 전콘 문제 일부 수정 2018-12-08 20:55:48 +09:00
Hide_D afd6148770 걸그룹 대전 0.5 반영 2018-12-02 22:28:10 +09:00
Hide_D b70b58a35a 지급율 -> 지급률 2018-12-01 23:37:40 +09:00
Hide_D df963c2780 외교 메시지는 삭제 할 수 없도록 2018-12-01 18:36:43 +09:00
Hide_D 1b732c76e6 국메 삭제 가능 2018-11-30 21:49:19 +09:00
Hide_D f9489b0173 디버그 코드 제거 2018-11-30 21:44:59 +09:00
Hide_D 18942c55ae 메시지 삭제 기능 추가 2018-11-30 21:29:31 +09:00
Hide_D bf34b2f1ca 메시지 타이밍 정책 일부 수정 2018-11-30 19:03:26 +09:00
Hide_D a717a021c2 페이지당 갱신 시간을 10초에서 5초로 변경 2018-11-30 02:05:33 +09:00
Hide_D dcf718d592 메시지를 띄울 때 flex 적용 2018-11-30 01:51:24 +09:00
Hide_D f5eeb2b839 로그아웃 되었을 경우 무한히 호출하는 버그 수정 2018-11-30 01:24:45 +09:00
Hide_D bc435adc11 이전 메시지 가져오기 기능 추가 2018-11-30 01:18:07 +09:00
Hide_D aeb8e82cbd 부상으로 인한 전투 우선순위 감소를 완화 2018-11-28 23:43:42 +09:00
Hide_D 5cb2ed3ccd 등갑, 맹수 너프 2018-11-28 01:24:29 +09:00
Hide_D 93b1864d1b 자객병의 기동을 8로 상향 2018-11-28 01:20:32 +09:00
Hide_D a6efffda45 selector에 검은색 추가 2018-11-28 01:14:43 +09:00
Hide_D c89d6f1a58 도시 목록에 select2를 시험 적용 2018-11-28 01:02:56 +09:00
Hide_D d4f16abfac 암행부의 장수수에서 '부대장'이 제외됩니다. 2018-11-28 00:29:53 +09:00
Hide_D 8529f3f355 임관턴이 어찌저찌 어거지로 동작하던 버그 수정 2018-11-28 00:26:29 +09:00
Hide_D 2eb136827d 랜덤 임관을 더 고르게 합니다. 2018-11-28 00:18:09 +09:00
Hide_D 9594e6eb32 부대장은 기술연구, 전투시 기술 상승에 영향을 주지 않도록 변경 2018-11-28 00:16:34 +09:00
Hide_D 9e8111994a 통합, 합병시 부대장까지 같이 포함되는 문제 수정 2018-11-28 00:14:36 +09:00
Hide_D af0c2b7129 select2 설치 2018-11-27 23:52:12 +09:00
Hide_D 96b73a0cef 도시 목록 등 불필요한 가로바 길이 줄임 2018-11-26 22:29:11 +09:00
Hide_D 6c290ee2d3 추방시 명성 안깎이는 버그 수정, 첫 하야시 패널티 없음 2018-11-26 18:12:21 +09:00
Hide_D ca53e3de3a 반계 상향 2018-11-26 18:08:57 +09:00
Hide_D 6ea3ec700a 수비 우선 순위를 부상여부, 수뇌여부, 훈사 여부를 반영하도록 변경 2018-11-26 15:17:51 +09:00
Hide_D fe3355e08e gitignore 변경 2018-11-26 15:08:33 +09:00
Hide_D 43da95b4a5 디버그 코드 제거 2018-11-25 00:51:59 +09:00
Hide_D 3d93a63caa php의 rename을 OS의 mv로 변경 2018-11-25 00:50:41 +09:00
Hide_D 9550607da3 디버그 모드 2018-11-25 00:39:49 +09:00
Hide_D d5d9798913 rename 재수정 2018-11-25 00:37:24 +09:00
Hide_D 6cfe08235f base을 filename으로 수정 시도 2018-11-25 00:35:11 +09:00
Hide_D 49eb850ff1 파일명 에러 수정 2018-11-25 00:29:26 +09:00
Hide_D 5a558583d2 폴더명 실수.. 2018-11-24 23:46:04 +09:00
Hide_D 1e5f0d0555 이전 디렉토리를 이동하도록 변경 2018-11-24 23:44:33 +09:00
Hide_D c58caeda4c 국방 표기 방식 변경 2018-11-13 19:55:40 +09:00
Hide_D 26fc56f2b8 extractMissingPostToGlobals(); 제거 2018-11-13 02:11:00 +09:00
Hide_D 6a9e7aa89d msg overflow 적용 2018-11-11 23:32:19 +09:00
Hide_D b6c3b0cdc3 방랑군이 아니어도 건국 가능한 버그 수정 2018-10-29 03:15:45 +09:00
Hide_D 5ae91ac620 견문 무력 버그 수정 2018-10-25 01:26:59 +09:00
Hide_D 70265c55ef 3인 임관 실패시 견문 2018-10-25 01:21:52 +09:00
Hide_D 7c3b5fc31e 견문 시 무력이 떨어지지 않도록 변경 2018-10-25 01:17:04 +09:00
Hide_D a9a830caa2 기타 설정 추가 2018-10-24 03:27:22 +09:00
Hide_D b49ff3d4ed 예약 안되는 버그 수정 2018-10-24 03:22:41 +09:00
Hide_D 42310fa170 랜임 개월 수 버그 수정 2018-10-24 01:17:03 +09:00
Hide_D bfff1d9e2f 랜임 모드 버그 수정 2018-10-24 00:54:18 +09:00
Hide_D 2c98777b9f 등용장 무효화 2018-10-23 23:33:12 +09:00
Hide_D 4a91260a31 오타 수정 설명 수정 2018-10-23 16:38:25 +09:00
Hide_D 076971bcae 오타 수정 2018-10-23 16:35:28 +09:00
Hide_D 01fcc9bcab 랜덤 임관 모드 추가 2018-10-23 15:05:19 +09:00
Hide_D 348877c7cd NPC 부대장 수치 버그 수정 2018-10-07 21:46:28 +09:00
sars 478f26e75a camelCase대신 underscore_case 사용 2018-10-04 00:16:08 +09:00
sars 57cc558b9b 장수 동향, 개인 기록, 중원 정세 id 등록 2018-10-04 00:07:46 +09:00
Hide_D 20b1f8eff8 전투 우선순위에 '유니크 아이템'의 효과가 과도하게 측정되는 버그 수정 2018-10-01 23:10:47 +09:00
Hide_D f0a7990404 계략 기본 성공률을 '보급'과 거꾸로 적용한 버그 수정 2018-09-27 17:00:56 +09:00
Hide_D 27f53ff4a6 임관 코드 최종 수정 2018-09-27 16:36:55 +09:00
Hide_D 9ec5dfc8b1 사실 모드 임관 수정 2018-09-27 16:29:49 +09:00
Hide_D e4c1e414c8 사실 모드 랜임 코드 버그 수정 2018-09-27 16:27:38 +09:00
Hide_D a391650472 인증 코드 자리 수 하나 감소 2018-09-25 10:45:21 +09:00
Hide_D 3cfde2b40d 주자사, 공, 황제일 때 장수 수가 내부적으로 1 차이나게 적용되는 버그 수정 2018-09-25 10:12:42 +09:00
Hide_D 8bf1ed33dc 전환 시 '빈칸' 보정, 설명 추가 2018-09-24 04:23:47 +09:00
Hide_D 422b3be0c5 flip image 추가 2018-09-24 04:17:54 +09:00
Hide_D c34e44c4ec data-flip을 허용하고, summernote에 img 태그에 data-flip을 추가하도록 2018-09-24 03:58:40 +09:00
Hide_D a2b20eca67 장수 생성시 초기 스탯으로 '임의 버튼을 클릭'하도록 지정 2018-09-24 02:16:42 +09:00
Hide_D d41c316bfb 설치 설명에서 MariaDB만 지원한다고 변경 2018-09-23 17:31:40 +09:00
Hide_D ca1d8aab84 WebUtil.php에서 drawMenu fallback 추가. 설치시 '활성화되지 않은' KakaoKey.php 파일 추가 2018-09-23 17:31:30 +09:00
Hide_D 32e3dcff7c 이미지 업로드 기능 추가 2018-09-22 03:05:58 +09:00
Hide_D 9a23470622 초반 제한 기간 텍스트 수정 2018-09-21 02:08:51 +09:00
Hide_D c37a186802 툴팁 class 수정. 지도의 년월에 올리면 초반 제한, 기술 제한 툴팁 2018-09-21 02:06:45 +09:00
Hide_D 84c17e3b22 왕조 일람 버그 수정 2018-09-20 02:26:20 +09:00
Hide_D 64e0fca124 전쟁 기한 공식을 스택형으로 변경 2018-09-20 01:15:50 +09:00
Hide_D 5c6537fd7a 멸망 시 접경 재설정 코드 버그 수정 2018-09-20 01:02:29 +09:00
Hide_D 764a82df00 버그 수정 2018-09-20 00:43:36 +09:00
Hide_D e904911fd9 후발 주자에게, 명성, 전특, 내특에 대해 일정 부분 보상 제공 2018-09-20 00:35:38 +09:00
Hide_D a7494f72f6 NPC 부대장에게 포상하지 않도록 수정 2018-09-19 23:56:33 +09:00
Hide_D b6b53b028d 부대탄 유저장도 발령하지 않도록 수정 2018-09-19 23:37:36 +09:00
Hide_D 1743ce714a 전투 코드를 모두 generator 기반으로 변경 2018-09-19 23:29:36 +09:00
Hide_D 656f0c5d11 부대장 주는 횟수 변경 2018-09-19 22:57:06 +09:00
Hide_D d80aebe1f4 집합장 때문에 총 기술치가 깎이는 버그 수정 2018-09-19 22:55:48 +09:00
Hide_D ad48bc1962 접경 내정 상승량 감소는 '수도가 아닐때' 적용 2018-09-19 03:01:38 +09:00
Hide_D d72fbb7098 부대장에게는 금쌀이 제공되지 않도록 수정 2018-09-19 02:21:38 +09:00
Hide_D 95d5eaa09b 주석 수정 2018-09-19 02:13:44 +09:00
Hide_D b997a6159e 치안에 따른 재난 확률 변경 2018-09-19 02:09:08 +09:00
Hide_D 1cd8b7a450 전쟁 중 접경에서는 농상성수 가 제대로 안 오르도록 2018-09-19 02:00:29 +09:00
Hide_D c5a8eb4261 접경지 처리시, 공백지 접경인지 적군 접경인지 구분 2018-09-19 01:49:46 +09:00
Hide_D 8891c29cbd 트래픽이 0인 경우 버그 수정 2018-09-19 01:46:15 +09:00
Hide_D 2facdfa1dd 루드라사움에서도 보병의 성벽 대미지 증가 2018-09-19 01:33:33 +09:00
Hide_D 65c9fa0c21 보병의 성벽 상대 전투력 20% 증가 2018-09-19 01:32:04 +09:00
Hide_D e53c85dbaf 돌격에 저지 불가 제거 2018-09-19 01:16:50 +09:00
Hide_D 3a231e8e61 저지 숙련 증가 2018-09-19 01:00:25 +09:00
Hide_D 4dc7776387 차병은 성벽 전투시 부상을 입지 않음 2018-09-19 00:39:15 +09:00
Hide_D 5ca043e0f1 견고 설명 수정 2018-09-19 00:29:24 +09:00
Hide_D 9ef052c814 견고 추가 상향 2018-09-19 00:28:09 +09:00
Hide_D 6d1690beaa 소울소드 리마스터 시나리오 업데이트 2018-09-18 23:19:30 +09:00
Hide_D 171656e5be 버그 수정 ㅜ 2018-09-18 03:30:40 +09:00
Hide_D 385e7f4871 천통했을 때에는 벌점이 늘어나지 않도록 수정 2018-09-18 03:26:12 +09:00
Hide_D 89c5485784 NPC 안생기는 버그 수정 2018-09-18 03:22:55 +09:00
Hide_D 02d191ec28 변수 대소문자 버그 수정 2018-09-18 03:17:20 +09:00
Hide_D 47c3090f3a NPC 생성 루프 수정 2018-09-18 03:15:40 +09:00
Hide_D 476dac1ac1 주목, 왕이되면 NPC 부대장 하나 더 추가 2018-09-18 02:56:35 +09:00
Hide_D 8ca0d0ced4 메시지 전송 시 장수명 순서대로 정렬 2018-09-18 02:31:41 +09:00
Hide_D ab197489d7 집합장 NPC 삭턴이 실행되지 않는 문제 수정 2018-09-18 02:25:03 +09:00
Hide_D 99736d187b 통합 제의 임시 삭제 2018-09-18 02:15:48 +09:00
Hide_D 197c09bd0d 집합장 턴을 그나마 확인할 수 있도록 삭턴 조정 2018-09-18 02:02:26 +09:00
Hide_D 6cc634ba1f 집합장은 턴이 항상 풀로 차도록.. 2018-09-18 02:01:55 +09:00
Hide_D 4c89ad91d2 부대장 시작 도시를 랜덤으로 2018-09-18 01:56:32 +09:00
Hide_D d66233bce0 NPC 부대장 버그 수정 2018-09-18 01:51:28 +09:00
Hide_D b485e6927e 부대장 번호 버그 수정 2018-09-18 01:47:48 +09:00
Hide_D 74b9e8bd7b 집합장 명칭을 부대장으로 변경 2018-09-18 01:46:37 +09:00
Hide_D 545742ecc0 부대 탄 사람은 발령 로직에서 최대한 배제 2018-09-18 01:27:30 +09:00
Hide_D d9f1f65352 NPC 부대 생성 버그 수정 2018-09-18 01:18:03 +09:00
Hide_D 0904d17a5f 집합장 등장 수식 수정 2018-09-18 00:36:05 +09:00
Hide_D 87171b4246 집합장 테스트 2018-09-18 00:29:44 +09:00
Hide_D 78f8b56203 reset_token에서 불필요한 명령 제거 2018-09-17 23:06:24 +09:00
Hide_D c160c5a555 천통시 모든 국가 등재 장수의 이름이 9글자 인 경우 발생하는 버그 수정 2018-09-12 01:46:16 +09:00
Hide_D 31c7bf5348 메뉴 아이템 길이 버그 2018-09-12 01:16:17 +09:00
Hide_D 6eadf718fc meta keyword 추가 2018-09-12 00:35:50 +09:00
Hide_D effced24d1 sitemap을 위하여 메뉴를 php에서 직접 출력하도록 변경 2018-09-12 00:12:32 +09:00
Hide_D 09f399db9a robots.txt 재등록 2018-09-11 23:50:29 +09:00
Hide_D 2b73f6faea 로봇에 대문자 들어가서 삭제 2018-09-11 23:50:16 +09:00
Hide_D 943662605e Robots.txt 설명 추가 2018-09-11 23:48:02 +09:00
Hide_D 9a04962bd6 대문에 meta 태그 추가 2018-09-11 23:03:10 +09:00
Hide_D c371f6bbb5 refresh_token 변수가 잘못된 것 수정 2018-09-11 11:13:37 +09:00
Hide_D 8324e2e454 access token 체크용 디버그 2018-09-11 11:08:37 +09:00
Hide_D 30307c1b56 로그인 인증 버그 체크 2018-09-11 10:55:53 +09:00
Hide_D f139d0d2a8 로그인 인증 디버깅용 코드 추가 2018-09-10 23:12:27 +09:00
Hide_D 33843764a7 로그인 토큰을 제대로 못 받은 경우 추가 2018-09-10 23:07:44 +09:00
Hide_D aca7d7c571 createOTP 반환형 버그 2018-09-10 01:49:11 +09:00
Hide_D bff72f609c 세션 로그인시 oauth token 값이 제대로 저장 안되는 버그 수정 2018-09-10 01:09:55 +09:00
Hide_D adb03b7420 인증시 로그아웃이 바로 풀리는 버그 수정 2018-09-10 00:38:06 +09:00
Hide_D 2094e18b60 IE에서 인증이 이상한 문제 해결 2018-09-10 00:35:59 +09:00
Hide_D 541d8ddd40 토큰 시간 초과시 즉시 로그아웃 되도록 변경 2018-09-10 00:22:57 +09:00
Hide_D f996172218 Merge branch 'kakao_login' into devel 2018-09-09 23:58:51 +09:00
Hide_D f9ffc1c1f3 oauth 인증중 token_valid_until만 table column으로 분리 2018-09-09 23:57:26 +09:00
Hide_D 05085ad504 5일이 지난후 로그인 토큰을 미리 초기화 가능하도록 수정 2018-09-09 23:18:23 +09:00
Hide_D 64aecaf28b 메인 페이지에 '비밀번호 초기화' 추가 2018-09-09 21:53:00 +09:00
Hide_D 7b3ef45300 카카오 로그인 작업 개선 2018-09-09 21:16:44 +09:00
Hide_D bd25de930b 카카오 로그인용 디버깅 코드 제거 2018-09-09 20:22:34 +09:00
Hide_D 15d43c9653 카카오 로그인 초기 구현 2018-09-09 20:19:00 +09:00
Hide_D 5b7eba61cc 반계에 '동그라미' 오타 제거 2018-09-09 15:54:17 +09:00
Hide_D 2445c79805 성벽 상대로 '혼란' 계략을 사용하지 않는 버그 수정 2018-09-08 12:33:41 +09:00
Hide_D 63be2dee47 운영자 찬스 수정 2018-09-07 02:06:13 +09:00
Hide_D 5bfef1be32 운영자 찬스2 2018-09-07 02:04:50 +09:00
Hide_D 8253526f23 운영자 찬스 2018-09-07 02:03:37 +09:00
Hide_D db19548e2c 불가능한 커맨드일 때 '불가' 표기 추가 2018-09-07 00:45:38 +09:00
Hide_D 10af31f042 customCSS를 조금 더 안전하게 적용 2018-09-06 23:38:47 +09:00
Hide_D e7c6e17590 왕조 일람의 '현재'에 대한 자세히 보기를 삭제 2018-09-05 23:39:16 +09:00
Hide_D a277ac182b 통합 안되는 버그 수정 2018-09-04 15:48:18 +09:00
Hide_D 0eee613a95 외교 커맨드 수정 2018-09-04 01:39:58 +09:00
Hide_D b76fa38e09 외교 커맨드 수식 오류 수정 2018-09-04 01:33:21 +09:00
Hide_D c0f5c8a358 내 정보에서 수비, 토너먼트가 즉시 반영되지 않는 버그 수정 2018-09-03 01:09:03 +09:00
Hide_D 71dd82afe8 메인 페이지 width 일부 수정 2018-09-02 21:00:05 +09:00
Hide_D ea5425a528 commandlist 가로로 짤리는 몇몇 유저용 수정 2018-09-02 20:55:47 +09:00
Hide_D d4ba13eee3 부대 탈퇴시 확인 창이 정상적으로 뜨지 않는 버그 수정 2018-09-02 14:19:17 +09:00
Hide_D 16831880dd 이전 시간대에 대해 리셋 가능하지 않도록 변경 2018-08-31 20:36:59 +09:00
Hide_D f79fc98ba6 customCSS 추가
장수 아이콘에 generalIcon 클래스 추가
2018-08-31 20:25:10 +09:00
Hide_D 0483c75dd7 전투 시뮬레이터에서 대미지 범위 표기 2018-08-31 19:32:56 +09:00
Hide_D 3a4dcacd56 글꼴 크기 범위 추가 2018-08-30 22:06:37 +09:00
Hide_D 5f6f09674e Merge branch 'devel' of ssh://storage.hided.net:2525/devsam/core into devel 2018-08-30 22:02:58 +09:00
Hide_D c785027c5c 에디터 변경 2018-08-30 22:02:51 +09:00
Hide_D d2659cea5f 원조시 특정 경우에 쌀 소모를 줄일 수 있는 버그 수정 2018-08-30 11:51:02 +09:00
Hide_D a9b966b159 증축 시 쌀 2000이 아닌 0 기준으로 계산하는 버그 수정 2018-08-30 11:49:37 +09:00
Hide_D f2c23e21c5 천도 시 쌀이 2000 미만이어도 가능한 버그 수정 2018-08-30 11:49:06 +09:00
Hide_D 53b973e2d3 장수 일람 연동 코드 버그 수정 2018-08-30 09:08:19 +09:00
Hide_D b7a570cba2 폰트 크기 변경에 대해서 즉시 반영이 되지 않는 버그 수정 2018-08-30 03:04:05 +09:00
Hide_D c77b79f0d2 글꼴 크기 커스터마이징 완료 2018-08-30 02:41:58 +09:00
Hide_D ef6678d8b0 에디터 글꼴 크기 커스터마이징 2018-08-30 02:12:48 +09:00
Hide_D 21609fa9c4 GUI 에디터 추가 옵션 2018-08-30 01:56:47 +09:00
Hide_D accc083702 gui 에디터 추가 2018-08-30 01:25:45 +09:00
Hide_D 9e677f3871 스탯 분류 방식 변경 2018-08-29 20:36:43 +09:00
Hide_D 55290eac30 네임스페이스 버그 해결 2018-08-29 15:04:44 +09:00
Hide_D d480502d33 NPC 네임스페이스 버그 해결 2018-08-29 15:03:43 +09:00
Hide_D c1cda16be0 성벽 공격 로그 수정 2018-08-28 21:56:33 +09:00
Hide_D 8ca9df9f34 '성인이 되어 등장' 시 전콘이 안뜨는 문제 해결 2018-08-28 20:36:46 +09:00
Hide_D 406b67b081 애니 집결 시나리오 변경 2018-08-28 20:29:42 +09:00
Hide_D 2c9fecf3ef 의병 고용, 인재 탐색시 기본 변종에 0 코드가 없는 경우 수정 2018-08-28 20:17:43 +09:00
Hide_D 6bc78b67bd 튜토리얼 버튼을 전투 시뮬레이터로 변경 2018-08-28 20:13:54 +09:00
Hide_D 5bbc46e070 구버전 시뮬레이터 삭제 2018-08-28 13:22:17 +09:00
Hide_D 6a9ceda361 국가에는 escape가 되어있으므로 메시지 템플릿에 2중 escape는 필요하지 않음 2018-08-28 01:49:25 +09:00
Hide_D ab2d5fd58f 이미지 출력시 주소에 빈칸이 있는 경우 안보이는 문제 해결 2018-08-27 23:39:58 +09:00
Hide_DandGogs 7018413777 Merge branch 'devel' of cappu/core into devel 2018-08-27 23:31:51 +09:00
cappu 77385616a4 테스트 겸 스탯업데이트 2018-08-27 23:17:31 +09:00
Hide_D c809f27bf5 전투 시뮬레이터를 포함한 코드 적용 2018-08-27 21:11:05 +09:00
Hide_D 493e778124 계략수비 시 전특 징병의 통솔이 반영되지 않는 버그 수정 2018-08-27 17:46:43 +09:00
Hide_D 7373af50b9 계략시 '징병' 전특의 통솔 상승을 받지 못하는 버그 수정 2018-08-27 17:43:53 +09:00
Hide_D 309f053510 화계시 도시 내정이 반영 안되는 버그 수정 2018-08-27 17:39:05 +09:00
Hide_D d976cf8a27 화계시 도시 내정이 반영 안되는 버그 수정 2018-08-27 17:38:08 +09:00
Hide_D 5d60a62a38 단어 수정 2018-08-27 13:53:07 +09:00
Hide_D a3f7dbccea 시뮬레이터 UI 일부 수정 2018-08-27 13:52:51 +09:00
Hide_D 0c4cce3339 시뮬레이터 숙련도 반영 안되는 버그 수정 2018-08-27 13:47:51 +09:00
Hide_D 58ccbc4d3d 불러오기시 json을 확장자로 지정 2018-08-27 03:13:34 +09:00
Hide_D c6cabc2087 전투 시뮬레이터 모두 저장/모두 불러오기 구현 2018-08-27 03:08:35 +09:00
Hide_D ef1f2722fc 전투 시뮬레이터 기본 기능 구현 완료 2018-08-27 02:21:45 +09:00
Hide_D 6b4a7ee03b 전투 시뮬레이션 구현 (동작) 2018-08-27 01:23:45 +09:00
Hide_D 7745a2051d 수비시 국가 성향이 공격국으로 지정되는 버그 수정 2018-08-27 00:18:50 +09:00
Hide_D eabd5e9acc 전투 시뮬레이터 구현 2018-08-27 00:18:19 +09:00
Hide_D d7dcbf98ff 전투 순서 버그 수정 2018-08-26 23:29:15 +09:00
Hide_D ff4c73f3d3 전투 종료시 로그 순서 변경 2018-08-26 23:25:47 +09:00
Hide_D dbf044b418 Revert "전투 종료 시 뜨는 로그 순서 변경"
This reverts commit 568e1b2923.
2018-08-26 23:23:06 +09:00
Hide_D 7a514e2492 쌀 소모에 '명성 버프/디버프' 성격이 적용되는 기존 버그 수정 2018-08-26 23:19:21 +09:00
Hide_D a73e533287 전투 종료 시 뜨는 로그 순서 변경 2018-08-26 23:19:09 +09:00
Hide_D 0f175ac4c6 수비 순서대로 정렬 버튼 활성화 2018-08-26 23:16:42 +09:00
Hide_D be15f1c698 쌀 소모에 '명성 버프/디버프' 성격이 적용되는 기존 버그 수정 2018-08-26 23:11:19 +09:00
Hide_D a315da6041 전투 종료 시 뜨는 로그 순서 변경 2018-08-26 22:59:14 +09:00
Hide_D 3f43f218ac 시뮬레이터 전투 준비 2018-08-26 22:32:37 +09:00
Hide_D 5c8ad646af ajax 쿼리 validation 종료 2018-08-26 22:31:14 +09:00
Hide_D 77f5fddd90 계략 실패 계수가 거꾸로 적용되는 버그 수정 2018-08-26 20:29:59 +09:00
Hide_D eab8b1ede5 전투 시뮬레이터 구현 중 2018-08-26 20:29:42 +09:00
Hide_D 2ab0896523 계략 실패 계수가 거꾸로 적용되는 버그 수정 2018-08-26 20:29:32 +09:00
Hide_D 639fe920df 전투 시뮬레이터 추가 구현 2018-08-26 20:01:08 +09:00
Hide_D 7577c84eca 국가 성향 버그 수정 2018-08-26 18:25:14 +09:00
Hide_D 22c4ec2d4a 국가 성향 출력 버그 수정 2018-08-26 18:24:35 +09:00
Hide_D 8ac85881a9 국가 성향이 제대로 등록되지 않는 버그 수정. 시뮬레이터 구현 2018-08-26 18:19:27 +09:00
Hide_D 724804efc6 전투 시뮬레이터 로컬 기능 구현 2018-08-26 17:20:47 +09:00
Hide_D ca57ef17fc 전투 시뮬레이터 추가 구현 2018-08-26 04:54:43 +09:00
Hide_D 480f015fb0 전투 시뮬레이터 구현 중 2018-08-25 11:27:29 +09:00
Hide_D d90e087f20 전투 시뮬레이터 추가 구현 2018-08-25 11:25:34 +09:00
Hide_D 3916cc0562 전투 시뮬레이터 UI 추가 구현 2018-08-25 11:15:33 +09:00
Hide_D cb54e56417 전투 시뮬레이터 작업 중 2018-08-24 03:46:21 +09:00
Hide_D 6aa606f2fa 전투 시뮬레이터 틀 작성 중 2018-08-24 01:09:17 +09:00
Hide_D 53d13a11ce 장수 생성시 능력치 덧셈이 이상한 버그 수정 2018-08-23 20:26:23 +09:00
Hide_D 9ba2b4142d 계략 시 수비 장수를 무시하는 버그 수정 2018-08-23 19:26:15 +09:00
Hide_D f5161a5b99 Merge branch 'devel' into battle_simulator 2018-08-23 18:45:32 +09:00
Hide_D f9d5d190d5 유니크 훈련,사기 템에서 훈련, 사기가 영구적으로 오르는 버그 수정 2018-08-23 16:21:18 +09:00
Hide_D eead9639a2 도시 점령시, 승수, 사기가 추가로 오르는 버그 수정 2018-08-23 16:10:49 +09:00
Hide_D 5044d5d3b4 파일 준비 2018-08-23 16:07:11 +09:00
Hide_D 44eed2c1df 탈취 확률 버그 수정 2018-08-23 01:53:00 +09:00
Hide_D e83b182e4d NPC가 기본 병종만 뽑는 버그 수정 2018-08-23 01:46:45 +09:00
Hide_D 888a76eda0 장수 생성 시 종능 부족하면 경고창 띄움 2018-08-23 01:07:25 +09:00
Hide_D 668364e583 수뇌이면 감찰부 상세 로그 표기 2018-08-22 15:27:44 +09:00
Hide_D 35c7a2d1b6 계략 로그에서 장수 부상 수치도 강조 2018-08-22 15:23:46 +09:00
Hide_D 79803178cd 민심 깎이는 로그에 반올림 적용 2018-08-22 15:22:20 +09:00
Hide_D 419ee8d8ff 전투 계략 실패 색상 버그 수정 2018-08-22 15:12:08 +09:00
Hide_D 328b3c9409 계략에 로그 추가 2018-08-22 15:11:29 +09:00
Hide_D f097508e87 탈취 버그 수정 2018-08-22 14:52:09 +09:00
Hide_D e6791ee8ec 탈취 성공시 일부는 장수가 소유 2018-08-22 14:49:15 +09:00
Hide_D cfbeba3de1 계략이 항상 성공하는 버그 수정 2018-08-22 14:43:01 +09:00
Hide_D bbc7f5a734 탈취 버그 수정 2018-08-22 14:37:48 +09:00
Hide_D e8726f03f3 탈취 버그 수정 2018-08-22 14:36:52 +09:00
Hide_D de95c6d698 계략 버그 수정 2018-08-22 14:31:37 +09:00
Hide_D 86b57447d8 계략시 소모성 아이템이 소모되지 않는 버그 수정 2018-08-22 14:29:27 +09:00
Hide_D c9d1efc6e7 계략 버그 수정 2018-08-22 14:21:53 +09:00
Hide_D dd1eeaddfa 계략 버그 수정 2018-08-22 14:20:49 +09:00
Hide_D 7f098db3de 계략 버그 수정 2018-08-22 14:18:30 +09:00
Hide_D 6468cbbfbd 계략 시전 버그 수정 2018-08-22 14:16:56 +09:00
Hide_D a30d61e842 계략 커맨드 리팩터링 2018-08-22 14:09:24 +09:00
Hide_D e0029fdc87 전투 중 사기 증가가 제대로 반영되지 않는 버그 수정 2018-08-22 02:44:59 +09:00
Hide_D 712e2c32a0 병력의 소집해제가 0분 0초가 아닌 '본인의 턴 실행 직전'에 실행되도록 변경 2018-08-22 02:18:55 +09:00
Hide_D f28e15b567 보급 끊긴 곳에 대한 계략 동작 변경 2018-08-22 02:05:24 +09:00
Hide_D 128e33661f 무한 발동 가능한 사령턴 커맨드의 명성,계급치 증가 삭제 2018-08-22 01:51:11 +09:00
sars 3916561c62 Revert "Revert "사스 권한 테스트겸, camelCase 적용""
This reverts commit 415791dddd.
2018-08-21 18:07:56 +09:00
sars 00638d074a Revert "사스 권한 테스트겸, camelCase 적용"
This reverts commit a5be15e453.
2018-08-21 18:07:05 +09:00
sars ca51b2d83a 사스 권한 테스트겸, camelCase 적용 2018-08-21 18:03:55 +09:00
Hide_D 1a879f97a2 기술 제한이 항상 걸리는 버그 수정 2018-08-21 18:02:02 +09:00
Hide_D 89d18cb7c5 성벽 전투시 떨어지는 내정 수치 수정 2018-08-21 16:41:31 +09:00
Hide_D 4e14249707 성벽 공격시 떨어지는 내정수치 수정 2018-08-21 16:35:37 +09:00
Hide_D 41f2c08da8 올바르지 않은 성격일 경우 기본 값 설정 2018-08-21 15:43:59 +09:00
Hide_D 4fca7bcfcf 저지 증가 숙련 변경 2018-08-21 14:59:58 +09:00
Hide_D 232725329a 툴팁 변경. 저지시 숙련 추가 2018-08-21 14:58:48 +09:00
Hide_D 88247851f4 징병 전특은 순수 통솔에서 15% 보정 2018-08-21 12:23:19 +09:00
Hide_D 6efaec6642 보병 상대 회피율 변경 2018-08-21 11:54:01 +09:00
Hide_D b9e31e39e2 보병은 상대의 회피를 5%p 감소 2018-08-21 11:51:09 +09:00
Hide_D e2cd8ed391 견고시 계략 성공 확률 변경 2018-08-21 11:07:28 +09:00
Hide_D 8a1641fbfa 견고 방식 변경 2018-08-21 11:04:27 +09:00
Hide_D 936f069ac3 수극 사용시 부상 정도 약화 2018-08-21 10:47:47 +09:00
Hide_D 89faad730e 전투 로그 중 회피에 오타 수정 2018-08-21 09:29:28 +09:00
Hide_D 798ab3e183 암행부 병종 표기 버그 수정 2018-08-21 02:24:58 +09:00
Hide_D 5508aa4533 전투 엔진 버그 4차 수정 2018-08-21 02:22:29 +09:00
Hide_D 81b7ebbab6 전투 엔진 버그 3차 수정 2018-08-21 02:01:56 +09:00
Hide_D 2d06e33e10 운영자가 '지도'에서 도시를 클릭할 수 있도록 변경 2018-08-21 01:32:00 +09:00
Hide_D d8cc820572 전투 엔진 버그 2차 수정 2018-08-21 01:22:18 +09:00
Hide_D d0ca46cfde 전투 엔진 버그 1차 수정 2018-08-21 00:53:00 +09:00
Hide_D 513124161e 전투 종료 코드 구현(마무리?) 2018-08-20 23:57:36 +09:00
Hide_D 7cfd8c7f79 전투 종료 코드 구현(마무리?) 2018-08-20 22:26:34 +09:00
Hide_D c32ce5e795 전투 종료 코드 구현 2018-08-20 22:20:59 +09:00
Hide_D d9c1530651 일부 게임 유틸리티 함수 간소화 2018-08-20 20:21:26 +09:00
Hide_D 305eb071a9 전투 종료 코드 구현 2018-08-20 17:24:16 +09:00
Hide_D 10dab69c63 전투 구현 반영 2018-08-20 03:48:54 +09:00
Hide_D 60ed594996 전투 구현 반영 2018-08-20 03:46:59 +09:00
Hide_D e60ddb3ee1 전투 구현 반영 2018-08-20 03:14:56 +09:00
Hide_D 26b0992285 전투 구현 반영 2018-08-19 03:47:28 +09:00
Hide_D 63f3ac807c 전투 구현 반영 2018-08-19 03:45:43 +09:00
Hide_D ed1c33eac0 전투 구현 반영 2018-08-19 03:30:47 +09:00
Hide_D e7b7fd0bcc 치료가 '필살', '회피'와 중복 가능. 전특과 의술 아이템의 치료 효과 증폭 2018-08-19 03:00:08 +09:00
Hide_D 79d2b04721 전투 구현 반영 2018-08-19 02:57:25 +09:00
Hide_D 5a8ab2d29c 전투 구현 반영 2018-08-19 02:33:42 +09:00
Hide_D ed527ac394 전투 코드 반영 2018-08-18 23:18:40 +09:00
Hide_D bf09f48196 전투 구현 반영 2018-08-18 22:21:25 +09:00
Hide_D 2a5af15aef 전투 코드 반영 2018-08-18 21:24:02 +09:00
Hide_D 1f8fe35e25 성벽 전투시 깎이는 성벽이 기존 대비 1/2 2018-08-18 20:46:30 +09:00
Hide_D 5979273a64 코드 중간 반영 2018-08-18 20:45:59 +09:00
Hide_D ef8c9e3968 전투 엔진 중간 반영 2018-08-18 19:04:13 +09:00
Hide_D baa9fdb660 유틸리티 함수 추가 2018-08-18 16:59:34 +09:00
Hide_D 35a860bb38 충차 성벽 보정 버그 수정 2018-08-18 15:18:40 +09:00
Hide_D 286939dc2c CriticalScore2, getCrew 이동 2018-08-18 14:02:53 +09:00
Hide_D dd5b1dbdd8 전투 추가 구현 2018-08-18 10:53:04 +09:00
Hide_D fb8d3a038d 새 전투 엔진 중간 반영 2018-08-18 02:26:27 +09:00
Hide_D ea5a25a671 전투 파일 추가 작성중
전투 코드 추가 준비

추가 구현
2018-08-14 23:11:03 +09:00
Hide_D d21fc4ab1d 새 전투 엔진 준비 2018-08-12 22:23:53 +09:00
Hide_D 3ae3974866 수극 사용 로그 버그 수정 2018-08-12 13:25:24 +09:00
Hide_D 71ffc3087e 전투 공식 핫픽스 2018-08-11 08:49:23 +09:00
Hide_D 8f406489d4 전콘 용량을 30KB로 증가 2018-08-10 19:58:31 +09:00
Hide_D a08d270968 루드라사움 지도 업데이트 2018-08-10 02:22:31 +09:00
Hide_D 48f13e4b82 루드라사움 스탯 수정 2018-08-08 03:47:04 +09:00
Hide_D 51060f0e4b 루드라사움 지도 업데이트 2018-08-08 03:36:00 +09:00
Hide_D c583109046 루드라사움 패치 2018-08-08 03:21:42 +09:00
Hide_D cf05b693f1 엑셀 파일에 빙의 불가 장수 목록 개념 추가 2018-08-08 02:48:17 +09:00
Hide_D d248c1ab0d 빙의가 불가능한 general_neutral 항목 추가 2018-08-08 02:45:41 +09:00
Hide_D 34623fca94 이민족 코드를 5에서 9로 이동. 그에따른 추가 코드 변경 2018-08-08 02:31:49 +09:00
Hide_D 975bdd5897 토너먼트 중복 참가 방지. 자동 참가시 돈을 받지 않음 2018-08-08 01:54:57 +09:00
Hide_D 1b3380c2ca 성벽을 때렸을 때 차숙이 오르지 않는 버그 해결 2018-08-07 04:00:31 +09:00
Hide_D bb707b4a03 명성 / 계급 계산식을 for loop 없앰 2018-08-06 01:23:39 +09:00
Hide_D acb3b6ac85 물자 조달로 올라가는 명성, 계급의 양을 다른 내정과 비슷하게 변경 2018-08-06 00:46:22 +09:00
Hide_D 80f6985f5f 지도 툴팁 line break 없앰 2018-07-30 03:23:01 +09:00
Hide_D 5e3a9c0579 지도 툴팁 너비 수정 2018-07-30 02:13:46 +09:00
Hide_D b30d62d483 루도라사움 지도 위치 수정 2018-07-30 02:11:51 +09:00
Hide_D 0ea1fdbd19 지도 출력 변경 2018-07-30 02:07:02 +09:00
Hide_D f068586f74 지도를 변경 가능하도록 업데이트 2018-07-30 02:00:53 +09:00
Hide_D 463f462e24 j_map_history에서 year가 0인 경우 2018-07-30 01:47:33 +09:00
Hide_D e0c4e3c58e 장수 생성시 기본 타입 2018-07-30 01:42:42 +09:00
Hide_D 5aa3ef38ba 연감용 루드라사움 지도 추가 2018-07-30 01:34:39 +09:00
Hide_D 827277f6a3 버그 수정 2018-07-30 01:26:12 +09:00
Hide_D 46389341db 루드라사움을 위한 시스템 보정 2018-07-30 00:37:39 +09:00
Hide_D a58f05a295 에러메시지를 VSCode에서 바로 이동하기 쉽도록 변경 2018-07-29 23:43:36 +09:00
Hide_D c0b0a0fe92 루드라사움 지도 연결 수정 2018-07-29 23:41:35 +09:00
Hide_D e9f471dd6f Neo 루드라사움 준비 2018-07-29 23:26:19 +09:00
Hide_D 7917c5dddb 부대편성 버그 수정 2018-07-29 16:20:43 +09:00
Hide_D de4541a3d9 부대 편성 일부 수정 2018-07-29 13:57:10 +09:00
Hide_D 77a496baa7 암행부 추가 확장 2018-07-28 02:38:19 +09:00
Hide_D 86e863de09 암행부 너비 추가 수정 2018-07-28 02:33:42 +09:00
Hide_D c2cfd217c2 암행부 턴 표기 수정 2018-07-28 02:02:50 +09:00
Hide_D f2366a61b0 IE11 모병창 UI 버그 수정 2018-07-28 01:58:35 +09:00
Hide_D 9959393dee IE 메인페이지 깨짐 일부 수정 2018-07-28 01:38:53 +09:00
Hide_D 16facf98f1 submit_btn 버그 수정 2018-07-28 01:32:00 +09:00
Hide_D bc8ce8832a 모/징병 페이지 변경 2018-07-28 01:24:23 +09:00
Hide_D 20bcf960ef 로그인 페이지를 모바일에서도 조금 더 잘보이게 변경 2018-07-27 18:56:01 +09:00
Hide_D 5cecd3e995 로그인 페이지가 약관 등에 가리지 않도록 변경 2018-07-27 18:47:48 +09:00
Hide_D d7ead25ea4 1턴에 어쩌다 휴식턴이 입력되는 버그 수정 2018-07-27 18:14:16 +09:00
Hide_D 75c0c375d1 장수 호칭 변경 2018-07-27 03:03:25 +09:00
Hide_D 5db4913292 세력일람 장수 표기순 변경 2018-07-27 02:39:26 +09:00
Hide_D a6a53b1d0d Merge branch 'devel' of ssh://storage.hided.net:2525/devsam/core into devel 2018-07-27 02:34:02 +09:00
Hide_D 81a0c0e120 세력일람 업데이트 2018-07-27 02:33:56 +09:00
Hide_D 0dae71a644 회피 디버그 수정 2018-07-26 17:13:27 +09:00
Hide_D f8eedaa3ea 전투 디버그 2018-07-26 15:40:46 +09:00
Hide_D ce2d97a7e7 전투 회피 코드 디버깅 적용 2018-07-26 15:39:34 +09:00
Hide_D 2cb570eaca foreach reference loop 버그 2018-07-26 00:12:12 +09:00
Hide_D c8c4352957 기존 도시/암행부 스크립트 통합. 2018-07-25 23:58:58 +09:00
Hide_D a311db4555 서버 관리 창에 에러 로그 보기 버튼 추가 2018-07-23 23:44:48 +09:00
Hide_D 05c515b2da j_map_history에서 fallback arg 제거 2018-07-23 23:30:53 +09:00
Hide_D c1acf2b0fe Trace의 모든 내용이 나오도록 수정 2018-07-23 23:26:32 +09:00
Hide_D 803a2407eb 에러 로그 보기 기능 추가 2018-07-23 23:19:39 +09:00
Hide_D a87945d1fb 에러 로그 업데이트 2018-07-23 22:54:06 +09:00
Hide_D 30793e68df 에러 로그용 클래스 설정 2018-07-23 22:50:22 +09:00
Hide_D 9c666bf7a9 FileDB 클래스 추가 2018-07-23 22:37:30 +09:00
Hide_D eff1dd7c34 라이브러리 업데이트 catfan/medoo 추가 2018-07-23 21:27:26 +09:00
Hide_D e79a33ebb0 NPC 군주의 호전성 추가(?) 2018-07-23 02:56:33 +09:00
Hide_D cb0adfdeaf npc attackable 보완 2018-07-23 02:50:58 +09:00
Hide_D 6b135c343c NPC의 선포 대상을 '국력'이 낮은 국가에 더 잘 하도록 변경 2018-07-23 01:49:43 +09:00
Hide_D 6c92db524b 선포 코드를 조금더 직관적으로 수정 2018-07-23 01:28:34 +09:00
Hide_D b8dfd1c041 징,모병시 민심이 떨어지지 않는 버그 수정 2018-07-22 15:39:53 +09:00
Hide_D 54d6347c1d 사령부 휴식 커맨드가 제대로 안보이는 문제 해결 2018-07-22 15:10:37 +09:00
Hide_D 4ea6e90600 연감에 serverID가 잘못된 경우 해결 2018-07-22 03:37:14 +09:00
Hide_D 4c7628a247 부대편성의 '집합' 확인 코드가 하드코딩인 부분 수정 2018-07-22 03:28:10 +09:00
revofpla 6c7334155a 필살확률 무조건 최소 50%인 버그 픽스 2018-07-21 13:49:15 +09:00
revofpla 480e3ea974 체섭 버그로 인한 핫픽스 1차
- 징병 숙련 100배 문제
 - 모병 비용 2배로 계산 안되는 문제
2018-07-21 13:12:52 +09:00
Hide_D 1f639a5bc6 애니집결 시나리오 번호 변경 2018-07-20 19:53:21 +09:00
Hide_D ccf3b07c3a 애니집결 업데이트 2018-07-20 19:51:11 +09:00
Hide_D d8508f2b72 충차가 1등급 되기만 하면 쓸 수 있던 버그 수정 2018-07-20 10:44:14 +09:00
Hide_D 5e13961ec8 protected인 자료에 접근해서 발생하는 문제 수정 2018-07-20 10:05:08 +09:00
Hide_D 80b1139371 버튼 너비 수정 2018-07-20 09:12:37 +09:00
Hide_D 635b41765c 계정 관리 창 살짝 넓힘 2018-07-20 09:08:04 +09:00
Hide_D 4b03686aa2 숙련 단련 버그 수정 2018-07-20 09:01:50 +09:00
Hide_D bfb0d8d639 message 템플릿 버그 수정 2018-07-20 00:06:03 +09:00
Hide_D 93d4a0211d 등용장의 경우에도 누를수 없는 경우 수정 2018-07-19 23:59:27 +09:00
Hide_D cd31bc69ef 추방 버그 수정 2018-07-19 23:13:05 +09:00
Hide_D 4a7b84d6de 외교 서신 레벨 지정 2018-07-19 22:19:26 +09:00
Hide_D 3142714c11 리셋 첫 해에는 추방해도 제약 없음 2018-07-19 21:25:00 +09:00
Hide_D 7ea10416a9 임관 권유 메시지 창 2018-07-19 21:03:42 +09:00
Hide_D 3e427db0f1 relativeYear에 음수 불가 2018-07-19 20:53:46 +09:00
Hide_D 9f7b18d294 시작 시 develcost가 0인 버그 해결 2018-07-19 20:50:29 +09:00
Hide_D 9af0e351b8 Merge branch 'devel' of ssh://storage.hided.net:2525/devsam/core into devel 2018-07-19 20:06:51 +09:00
Hide_D 5c6aa2340d 공백지 시나리오에 특기 연령 문제 해결 2018-07-19 20:06:39 +09:00
Hide_D 4424ec48cf 전투시 병종 명 버그 수정 2018-07-19 10:59:01 +09:00
Hide_D 61be34581e 반복 버튼 키움 2018-07-19 02:33:59 +09:00
Hide_D 731978356d Credit 양식 추가 2018-07-19 02:29:03 +09:00
Hide_D d5223ad1ab 리셋 시 사령부 Command encode가 제대로 이뤄지지 않았던 버그 수정 2018-07-19 01:42:16 +09:00
Hide_D 7cfdfab198 연감에서도 비교적 빠르게 동작하도록 설정 2018-07-19 01:31:13 +09:00
Hide_D eb70e51ac1 실시간 맵은 캐싱하도록 처리 2018-07-19 01:21:00 +09:00
Hide_D 1d48e7c7ae 영웅 난무 220 제목 변경 2018-07-19 00:51:47 +09:00
Hide_D d6fc9fc8c3 지도가 들어간 곳에 부트스트랩 추가 2018-07-19 00:46:15 +09:00
Hide_D 8ada0976fe 연감에 부트스트랩 없는 문제 해결 2018-07-19 00:44:01 +09:00
Hide_D 389ff5e9a4 지도에 도시명 켬끔 추가 2018-07-19 00:39:05 +09:00
Hide_D 5179e0228c 최대 스탯 표기 변경 2018-07-18 23:44:41 +09:00
Hide_D 2268526314 내 정보 페이지 툴팁 안나오는 문제 2018-07-18 23:14:52 +09:00
Hide_D db4bc0eafe 도시 좌표 업데이트 2018-07-18 23:11:02 +09:00
Hide_D 6edaf79df1 출력 병종 에러 2018-07-18 22:26:15 +09:00
Hide_D 79cead3b59 도시 css contain 2018-07-18 22:24:22 +09:00
Hide_D db1b12b85c 훈련에서 사기 하락 문구 삭제 2018-07-18 16:54:25 +09:00
Hide_D 9360b7675a 천인 강림 극 소형맵 2018-07-18 14:23:12 +09:00
Hide_D 9c82fd17fe 훈련시 사기 감소하지 않음 2018-07-18 11:18:33 +09:00
Hide_D 3a4665e473 맵 업데이트 2018-07-18 10:46:33 +09:00
Hide_D b34f4648ee 호로->사수, 몇몇 소성들 다시 진,수로 롤백 2018-07-18 10:41:06 +09:00
Hide_D 0de786d2ea 쿼리 받아오는 것 수정 2018-07-18 09:28:53 +09:00
Hide_D ec7aafa1ff history 받아오는 버그 수정 2018-07-18 09:28:10 +09:00
Hide_D 30c219716d 오타 수정 2018-07-18 09:08:20 +09:00
Hide_D 5dd47cb89b 오타수정 2018-07-18 09:05:36 +09:00
Hide_D abe856bd3f 버그 수정. 오타 수정 2018-07-18 08:24:09 +09:00
Hide_D 6ecb009466 오타 수정 2018-07-18 04:51:19 +09:00
Hide_D 3b4b2383a8 $me 버그 2018-07-18 04:50:17 +09:00
Hide_D 4ddd46c4a2 모병코드 2018-07-18 04:49:30 +09:00
Hide_D 69ec2469b4 쌀 검사 코드 2018-07-18 04:47:28 +09:00
Hide_D 5789af801a 징모병창 코스트 2018-07-18 04:44:12 +09:00
Hide_D 7171b6302b formattext 2018-07-18 04:41:08 +09:00
Hide_D 51d4818b1e gameStor 값 버그 2018-07-18 04:40:18 +09:00
Hide_D 1c2875e7fc 모병창 수정 2018-07-18 04:37:00 +09:00
Hide_D 5048a88310 징병창 우선 부활 2018-07-18 04:30:54 +09:00
Hide_D aef37f4362 징모병창 변수명 에러 2018-07-18 04:18:15 +09:00
Hide_D d04641041b 아이템 return 값 수정 2018-07-18 04:15:28 +09:00
Hide_D 67b2ccea86 급한대로 도시명 띄움 2018-07-18 04:10:07 +09:00
Hide_D 5ff9ca3c99 miniche가 최신 버전이 아닌 버그 수정 2018-07-18 03:44:32 +09:00
Hide_D fe55df8b2f 버그 체크 2018-07-18 03:41:45 +09:00
Hide_D 457f605898 버그 수정 2018-07-18 03:32:47 +09:00
Hide_D 0f2625133f 미니체 basemap 2018-07-18 03:05:36 +09:00
Hide_D fa34dbdf6f 초기 버그 수정 2018-07-18 03:04:59 +09:00
Hide_D 050913b0b4 영난 1c 2018-07-18 02:58:56 +09:00
Hide_D a47e47d42c 도시 정보 업데이트 2018-07-18 02:57:08 +09:00
Hide_D 43d994b59a credit 링크 추가 2018-07-18 02:31:15 +09:00
Hide_D e8204d46ce 커스텀 맵 준비 2018-07-18 00:25:51 +09:00
Hide_D fece659cfb 변수명 통일 2018-07-16 02:56:52 +09:00
Hide_D 695265b299 병종 코드를 GameUnitConst, GameUnitDetail에 기반하도록 변경 2018-07-16 02:54:47 +09:00
Hide_D b652ed0b33 병종 테이블에 상성 값 확장 2018-07-16 01:43:11 +09:00
Hide_D 9a641552e4 전투 코드 반영 중 2018-07-15 01:46:29 +09:00
Hide_D 3d18aeb5bc 징병, 모병 form 수정 2018-07-15 01:01:36 +09:00
Hide_D b545afce50 모병, 징병 코드 재 구현. 능력치 상승/감소 코드 재구현 2018-07-14 22:41:10 +09:00
Hide_D 8fca98c0c9 ActionLogger rollback 추가 2018-07-14 18:23:31 +09:00
Hide_D 0a98c71dfe 현재까지 작업물 보강, 모.징병 페이지 개선 중 2018-07-14 18:17:37 +09:00
Hide_D ed75f39094 ActionLogger 보강 2018-07-14 18:17:18 +09:00
Hide_D 456245f23a ActionLogger 추가 2018-07-14 17:53:08 +09:00
Hide_D b4529c9338 병종값 변경 2018-07-13 00:41:56 +09:00
Hide_D 0ca7a8ab8a 병종 테이블에 '병종 타입' 지정, 턴 커맨드를 json array로 변경 2018-07-13 00:12:12 +09:00
Hide_D 02f2209e8f GameConst에 mapName과 unitSet추가 2018-07-12 01:59:32 +09:00
Hide_D fb72d02912 d_setting 디렉도리 보관 방식 변경 2018-07-12 01:56:46 +09:00
Hide_D 665fb25fc1 기본 파일 추가 2018-07-12 01:02:28 +09:00
Hide_D 742c3c7156 맵 규격 재 정의 2018-07-12 01:00:24 +09:00
Hide_D 637dbbba0d 새 지도 준비를 위해 커밋 2018-07-12 00:20:43 +09:00
Hide_D f2a3bc4626 메시지함 높이 고정을 최소 높이로 변경 2018-07-11 23:49:57 +09:00
Hide_D e8ffa44544 메시지함 사라지는 버그 수정? 2018-07-11 23:04:38 +09:00
Hide_D bc09287666 도움 주신 분 임시 삭제. 나중에 Credit으로 되살리기로 2018-07-11 22:37:36 +09:00
Hide_D 392d9055fe td tr 되돌려놓음 2018-07-11 22:18:08 +09:00
Hide_D 0ee833d7ae list 일부 수정. tfoot 안에 tr td없는거 수정 2018-07-11 22:17:03 +09:00
Hide_D 3074bc00d7 지도 표기에서 box 표기 문제로 일부 수정 2018-07-11 22:04:20 +09:00
Hide_D cb6fb590c4 귀병, 환술 설명 수정 2018-07-11 21:53:13 +09:00
Hide_D a7270b2cd2 장수 성격, 아이템 설명 툴팁 추가 2018-07-11 21:50:01 +09:00
Hide_D 0d925af065 tooltip html trim 추가 2018-07-11 20:52:46 +09:00
Hide_D 7c7991e8ae 특기 없을 때 텍스트 수정 2018-07-11 20:51:13 +09:00
Hide_D 54461b6ea4 특기가 없는 경우에도 tooltip 띄우도록 2018-07-11 17:03:47 +09:00
Hide_D 6a17497fbd 빙의 시에도 전특 표기 2018-07-11 03:27:27 +09:00
Hide_D 84f18aa4b6 특기 전 페이지에 반영 2018-07-11 03:03:52 +09:00
Hide_D 73ab38563f 특기 마우스 오버 1차 적용 2018-07-11 02:47:31 +09:00
Hide_D 1f2b40e4d4 message form box sizing 변경. 메인 페이지에 bootstrap css 적용 2018-07-11 01:31:59 +09:00
Hide_D 1d920c5935 darkly 적용 2018-07-11 01:19:24 +09:00
Hide_D 037a1e9c0c 툴팁 준비 2018-07-11 01:15:22 +09:00
Hide_D 87e324d4d9 bootstrap 최신 버전으로 2018-07-11 01:15:02 +09:00
Hide_D d1e9b489e3 공성 전특 버그 수정. 전특 설명을 위한 텍스트 추가 2018-07-11 00:53:10 +09:00
Hide_D 34f1d538d1 세력도시에서 n장, m장 임명이 불가능한 버그 수정 2018-07-07 05:13:22 +09:00
Hide_D fb8d2a2e01 구버전 첩보 마이그레이션시 지도 표기 버그 수정 2018-07-07 04:58:19 +09:00
Hide_D 837db5183e 첩보를 join '|' 에서 json dict로 변경 2018-07-07 04:39:44 +09:00
Hide_D a556877a17 현재 진행중인 깃수인 경우 장수가 안 죽었으면 안나타나는 문제 해결 2018-07-05 00:24:03 +09:00
Hide_D bcbd6dc4db 왕조일람 버그 수정 2018-07-05 00:12:34 +09:00
Hide_D 41f7ad8d75 왕조 일람에 아무것도 없을 때 '현재'가 안보이는 문제 해결 2018-07-05 00:10:33 +09:00
Hide_D 258d4b28da 왕조 일람에 현재 국가 표시 2018-07-05 00:05:48 +09:00
Hide_D 31e900c422 메시지 버그 수정 2018-07-03 22:09:07 +09:00
Hide_D 7b1a76871a parseJsonPost 기반 동작 포기 2018-07-03 21:35:17 +09:00
Hide_D c6f3e7672f 국가 정보 빈칸 2018-07-03 20:48:34 +09:00
Hide_D 540c31903c 월마다 최대 국력, 최대 병력, 최대 도시 수를 계산하는 코드 추가. ng_old_nations에도 반영 2018-07-03 20:43:14 +09:00
Hide_D 3e5262d7a3 nation 테이블에 aux 추가 2018-07-03 20:09:36 +09:00
Hide_D 2b36ffef45 왕조일람 임시 갱신 2018-07-03 06:59:27 +09:00
Hide_D 4c25d2275c 버튼 대체 css 추가. form 일부 제거 2018-07-03 02:55:45 +09:00
Hide_D 6c66fcdfc3 명예의 전당 시나리오명 제대로 표기 안되는 문제 해결 2018-07-02 19:45:41 +09:00
Hide_D aaa972d767 명예의 전당 배경색 오류 수정 2018-07-02 19:15:43 +09:00
Hide_D 45c8538426 빙의 해제시 닉네임 초기화 2018-07-02 03:23:20 +09:00
Hide_D 95702724a9 베팅수익률 오타 2018-07-01 15:34:20 +09:00
Hide_D 98c4d3853c 명장 일람 레퍼런스 값 미표기 문제 해결 2018-07-01 15:30:15 +09:00
Hide_D 7c91143f39 명장일람에서 제약 조건 수정 2018-07-01 15:27:41 +09:00
Hide_D 56e6f57568 회원 가입시 링크 변경 2018-07-01 03:58:47 +09:00
Hide_D ccab456679 세력도시 스크립트 동작 안하는 문제 해결 2018-07-01 01:35:47 +09:00
Hide_D 5af000ca43 html 5 비표준 스크립트 제거 2018-07-01 01:28:35 +09:00
Hide_D 354c8f04ae IE=edge 대소문자 주의 2018-06-30 01:52:07 +09:00
Hide_D 3fbd336b45 Revert "컬러 프로필 적용"
This reverts commit 4f279c49c8.
2018-06-30 01:32:46 +09:00
Hide_D 3c0b86a322 컬러 프로필 적용 2018-06-30 01:26:23 +09:00
Hide_D fca4b69d5a 범장 -> 만능장 2018-06-30 01:18:52 +09:00
Hide_D ce62072761 확장 스크립트를 위해 태그 일부 정리 2018-06-30 00:28:45 +09:00
Hide_D 93dd7a8478 extractMissingPostToGlobals 호환을 위해 server_id 인자명 변경 2018-06-29 16:23:48 +09:00
Hide_D 02fb84a312 font boosting 약화 2018-06-29 14:46:06 +09:00
Hide_D f3e68989e5 뷰포트 추가 지정 2018-06-29 14:41:09 +09:00
Hide_D 468050a9ce 뷰포트 크기 변경 2018-06-29 14:37:30 +09:00
Hide_D f37a602da3 모든 웹 페이지에 viewport 지정 2018-06-29 14:32:59 +09:00
Hide_D 2979691d7e 기본 폰트 크기 지정 2018-06-29 14:20:20 +09:00
Hide_D 72920a0432 unset대신 []로 초기화 2018-06-29 09:35:24 +09:00
Hide_D e81075ef04 history 함수 인자 제한 완화 2018-06-29 09:28:58 +09:00
Hide_D df1a99d877 기본 폰트 지정 2018-06-29 09:16:40 +09:00
Hide_D 10e825dc9f 예약 테이블 점검. 스키마 수정 2018-06-29 01:50:28 +09:00
Hide_D 07ba7933fb 토너먼트 inf 버그 수정 2018-06-29 01:25:43 +09:00
Hide_D 3059eac0fd jquery 버전 업데이트 2018-06-29 01:22:03 +09:00
Hide_D aa33aa6d4f Json 에러시 에러 표기하도록 2018-06-29 00:30:05 +09:00
Hide_D 0a1cdeeaa3 세력일람 코드 변경 2018-06-28 14:16:38 +09:00
Hide_D e4bef47b7e 세력일람 연동 2018-06-28 14:14:56 +09:00
Hide_D f551f994b5 세력도시 코드 일단 통합 2018-06-28 13:57:21 +09:00
Hide_D 4b7a3af691 IE에서 카카오 2018-06-28 13:39:58 +09:00
Hide_D 6f88a80118 randBool이 아니라 randF 써서 생기는 버그 수정 2018-06-28 01:57:41 +09:00
Hide_D e03715ee46 천통 안되는 버그 수정 2018-06-28 00:28:00 +09:00
Hide_D aafe6d8863 천통시 저장되는 데이터 변경 2018-06-27 03:43:01 +09:00
Hide_D 47005483cd 버그 수정 2018-06-27 03:05:39 +09:00
Hide_D 378075955a 서버 오픈시 천통국 체크가 이상한 버그 수정 2018-06-27 03:04:54 +09:00
Hide_D 2059797904 사망, 천통시 장수를 ng_old_generals에 보관 2018-06-27 02:53:58 +09:00
Hide_D 8c711242a9 왕조 일람에 연감을 볼 수 있도록 통합 2018-06-27 02:12:59 +09:00
Hide_D 481894c89b 모든 국가 멸망 케이스에 ng_old_nations 백업 추가 2018-06-27 01:55:28 +09:00
Hide_D ba53275322 천통시 깃수 자동 표기 2018-06-27 01:49:46 +09:00
Hide_D cfe2b4c1bd 사소한 코드 수정 2018-06-27 01:34:11 +09:00
Hide_D 60e83f8324 오타 수정 2018-06-27 01:26:02 +09:00
Hide_D ceac040d82 명전에 0 이하는 안받도록 변경 2018-06-27 01:25:50 +09:00
Hide_D 89d400c81a 연감 월 표기 버그 수정 2018-06-27 01:22:16 +09:00
Hide_D 4cf7bca399 왕조 일람에서 서버 정보와 국가 정보를 보관하도록 변경 2018-06-27 01:14:34 +09:00
Hide_D 761441622e 왕조일람 '전체보기' 기능 살림 2018-06-26 23:05:04 +09:00
Hide_D 1b814abf0b 천통 시 왕조 일람용 테이블에 server_id 기록. 연감에 server_id로 이전 연감 조회기능 추가 2018-06-26 23:01:43 +09:00
Hide_D 62a2147e33 천통국 정상 추가 2018-06-26 22:45:47 +09:00
Hide_D 246dff9c87 명장일람 버그? 2018-06-26 16:27:51 +09:00
Hide_D 50494beb27 명장 일람 보정 시도 2018-06-26 16:21:47 +09:00
Hide_D ce3b3ebfd8 명장 일람, 설전 승률 % 표기 오류 2018-06-26 16:18:58 +09:00
Hide_D 213090c32e 오타 수정 2018-06-26 09:45:15 +09:00
Hide_D adb8668197 크롬과 파이어폭스에 최적화 2018-06-26 09:44:26 +09:00
Hide_D 0023677003 임관 권유문 길이 제한 2018-06-26 04:13:41 +09:00
Hide_D 0b19a37ad4 초반 3년 수뇌 임명 방식 변경 2018-06-26 03:52:17 +09:00
Hide_D 9f34ae5d28 천통시 재야 장수도 저장 2018-06-26 03:33:56 +09:00
Hide_D 6f07b5cf08 ng_games에 시나리오명 남도록 수정 2018-06-26 03:20:57 +09:00
Hide_D 0f39431157 chmod 재설정 2018-06-26 03:19:47 +09:00
Hide_D bc1a470e64 디렉토리 권한 문제 해결 2018-06-26 03:15:38 +09:00
Hide_D 09e24f5684 ng_games 누락분 추가 2018-06-26 03:10:50 +09:00
Hide_D 2f27ea4c8a schema 값 꼬이는 문제 해결 2018-06-26 03:06:34 +09:00
Hide_D d09aba70b7 천통시에도 ng_old_nations에 데이터가 저장되도록 변경 2018-06-26 03:00:02 +09:00
Hide_D 69b0a80684 명장 일람, 명예의 전당 최종 개선 2018-06-26 02:36:20 +09:00
Hide_D 48f0c56a9e 국가 멸망시 국가 정보 백업 2018-06-26 00:47:54 +09:00
Hide_D 83833a3693 등용장 및 메시지 일괄 전송 TODO 해결 2018-06-26 00:45:31 +09:00
Hide_D 18429d52d4 명장 일람, 명예의 전당 코드 재구현. 연감 등에 이전 국가 기록 남기도록 설정 2018-06-26 00:32:43 +09:00
Hide_D 58cc90083b 서버 별명에 연월일 추가 2018-06-25 16:08:19 +09:00
Hide_D 2772161144 왕조 일람 테이블 구조 변경. 2018-06-25 01:53:16 +09:00
Hide_D 0e95259b14 게임 오픈 시 logs에 서브 디렉토리를 사용하도록 변경 2018-06-25 01:45:23 +09:00
Hide_D 3d9f38f1e3 건국 등 문자열 입력 변경 2018-06-25 00:46:07 +09:00
Hide_D ba3accd834 스페이스 바 등 몇몇 문자열 가능하게 처리 & 문자열 보정 2018-06-24 04:44:34 +09:00
Hide_D 0786e40ebd 국방 표기 변경 2018-06-24 04:18:54 +09:00
Hide_D 8a56393159 임관 권유 메시지를 템플릿으로 이동 2018-06-24 04:12:19 +09:00
Hide_D 5ca8a6ecfa purifier 1차 적용 2018-06-24 03:47:44 +09:00
Hide_D 5c82edc4be html purifier 보강 2018-06-24 02:56:38 +09:00
Hide_D 093c04bc24 포상 계수 조절 2018-06-23 23:49:22 +09:00
Hide_D 131dd46a38 무지장의 경우에는 쌀 적게 주도록 수정 2018-06-23 22:58:11 +09:00
Hide_D 6b1b4fdfbb 베팅 표기 오류 변경 2018-06-23 22:55:59 +09:00
Hide_D e4ad779b37 npc 발령 로직 변경. 유저 무지장 포상 로직 변경 2018-06-23 22:52:43 +09:00
Hide_D 65d817624e 인사부 조건 검사 순서 변경 2018-06-23 14:36:05 +09:00
Hide_D 66501189c4 적극적 금쌀 교환 2018-06-23 14:22:41 +09:00
Hide_D 4303898bb8 금쌀 계수 조정 2018-06-23 14:10:52 +09:00
Hide_D 7d76a9d3ed 인사부 임명 해제 불가 버그 수정 2018-06-23 13:28:36 +09:00
Hide_D 1cc42f341b 내정, 전투 기준 일부 변경 2018-06-23 13:08:16 +09:00
Hide_D 0b41ee0a29 내정 발령시 내정 찬곳으로는 안함 2018-06-23 12:57:11 +09:00
Hide_D 66b6c4d04f query 간소화 2018-06-23 05:37:34 +09:00
Hide_D 6502843d6c 포상 전략 변경 2018-06-23 05:22:49 +09:00
Hide_D 5ecfe72e19 발령 전략 변경 2018-06-23 05:06:10 +09:00
Hide_D f28cdefffe npc 발령 전략 변경 2018-06-23 05:00:57 +09:00
Hide_D 40494f2cf1 전방 설정을 5개월 내로 변경 2018-06-23 04:51:07 +09:00
Hide_D f2664c112b NPC 사령턴 로직 새로 작성 2018-06-23 04:45:27 +09:00
Hide_D 41d91df355 상인 거래시 110% 가 잘 적용되도록 변경. 삭제된 거상 문구 수정 2018-06-23 02:23:06 +09:00
Hide_D 965671dd93 key,value pair를 보존한 섞기 추가 2018-06-23 02:22:49 +09:00
Hide_D c8d08e4b2c 저격 특기, 활 유니크, 수극 확률이 각각 적용되도록 수정 2018-06-23 02:22:32 +09:00
Hide_D 2897a9b484 환상향 시나리오 전콘 방식 재 적용 2018-06-21 20:16:01 +09:00
Hide_D d190e59d83 장수 등록시 최저 스탯이 10으로 표시되는 버그 수정 2018-06-21 02:55:52 +09:00
Hide_D 0bb25e8773 천인 강림 개선 2018-06-21 02:47:29 +09:00
Hide_D 37e1903cb1 HTML Purifier 추가 2018-06-21 02:27:02 +09:00
Hide_D b402846d43 PHP 7.2 버전용으로 올림! 2018-06-21 02:17:31 +09:00
Hide_D c1a6dd385a 설문 제목이 제대로 표시되지 않는 버그 수정 2018-06-19 02:42:55 +09:00
Hide_D ccbef236d3 업데이트 기능 추가 2018-06-19 02:11:17 +09:00
Hide_D d7b9e8b2e0 투표 동작 방식 변경 2018-06-19 01:49:16 +09:00
Hide_D deaf77d3d0 Merge branch 'devel' of ssh://storage.hided.net:2525/devsam/core into devel 2018-06-19 01:42:46 +09:00
Hide_D 5c738f97ed 투표 권한 추가 2018-06-19 01:42:40 +09:00
Hide_D c9f7f7ab08 공지 수정 불가능한 버그 수정 2018-06-18 10:11:56 +09:00
Hide_D 746977d5d0 서버 열단, 리셋 부분 권한 추가 2018-06-18 03:21:52 +09:00
Hide_D acb09bfe71 시나리오 생성시 잘못된 도시를 입력한 경우에도 정상 빌드되도록 수정 2018-06-18 02:23:30 +09:00
Hide_D e2a1203b43 시나리오 두개 수정 2018-06-18 02:01:45 +09:00
Hide_D 124036cea6 npc 생성시 전콘이 있는지 확인하는 코드 추가. 걸그룹 대전 변경 2018-06-16 11:01:12 +09:00
Hide_D 2ac1d82826 buildScoutMessage에서 null 반환 가능하던 문제 수정 2018-06-16 00:42:48 +09:00
Hide_D fa4e0c1948 이미지 주소 기반 자동 NPC 전콘 설정 기능 추가. 루드라사움 추가 2018-06-15 03:32:37 +09:00
Hide_D 735427ead0 기본 iconPath 설정 2018-06-15 02:18:44 +09:00
Hide_D 4fa99a7e1b 변환 코드를 v3에 맞게 변경 2018-06-15 02:17:07 +09:00
Hide_D 2f963a205a 등용장 안 받아지는 버그 수정 2018-06-14 02:41:36 +09:00
Hide_D 1f03f7e7c3 빙의 모드에서 장수 칸 여유있게 2018-06-14 02:00:09 +09:00
Hide_D 31689fb6ba processCommand에 affinity 없는 버그 수정, 등용장 못받는 버그 수정 2018-06-14 01:57:28 +09:00
Hide_D cf7ebbd314 Merge branch 'devel' of ssh://storage.hided.net:2525/devsam/core into devel 2018-06-14 01:49:22 +09:00
Hide_D 40a953aed5 storage의 isunited 변수 문제 2018-06-14 01:49:15 +09:00
revofpla c4d999ada7 가상시나리오 16(애니집결) 추가 2018-06-13 17:46:34 +09:00
Hide_D fff6b4e155 개전시 조사 버그 2018-06-13 10:20:48 +09:00
Hide_D 380e08d89f 랜임시 장수수를 셀 때 유저장, 빙의장, n장만 카운트하도록 변경 2018-06-13 04:17:18 +09:00
Hide_D 96c8199092 거병 확률 최종 수정 2018-06-13 03:50:51 +09:00
Hide_D 54870cf067 거병 확률 재 수정 2018-06-13 03:29:09 +09:00
Hide_D 8654447aac 추방 기준을 3년 이내로 재 변경 2018-06-13 03:28:11 +09:00
Hide_D 28a690cbba 추방 후 임관 확률 재 조정 2018-06-13 03:27:08 +09:00
Hide_D 52d1a48c0b 거병 확률 변경. NPC 임관 확률 추가 변경 2018-06-13 03:21:55 +09:00
Hide_D f45333db5e 임관 속도 조정 2018-06-13 03:06:30 +09:00
Hide_D c920e45934 임관 시도 확률 변경, NPC 랜임시 부상 패널티 약화 2018-06-13 02:51:39 +09:00
Hide_D dd86ef4591 걸그룹 시나리오 수정, NPC 임관 확률 대폭 감소 2018-06-13 02:45:00 +09:00
Hide_D b9fb00f042 npc 거병 확률 수정 2018-06-13 02:29:37 +09:00
Hide_D 355d9fd995 거병 확률 계수 변경 2018-06-13 02:24:52 +09:00
Hide_D b68c13c4f2 임관시 $general['nations'] 를 Json Array로 변경 2018-06-13 02:21:31 +09:00
Hide_D f2803291ab 일부 브라우저에서 명령창 줄 넘어감 방지 2018-06-13 00:53:31 +09:00
Hide_D 54df034c77 Merge branch 'devel' of ssh://storage.hided.net:2525/devsam/core into devel 2018-06-12 22:28:10 +09:00
Hide_D 7317b8bc18 JosaUtil 응급 대응 2018-06-12 13:05:22 +09:00
2148 changed files with 181412 additions and 126883 deletions
-15
View File
@@ -1,15 +0,0 @@
{
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "usage",
"corejs": 3,
"modules": false
}
]
],
"plugins": [
"lodash"
]
}
-42
View File
@@ -1,42 +0,0 @@
module.exports = {
root: true,
parser: "vue-eslint-parser",
"env": {
"browser": true,
"es2021": true
},
ignorePatterns: ['*.test.ts', '.eslintrc.cjs', 'postcss.config.cjs', 'webpack.config.cjs', '*.js'],
overrides: [{
files: ['*.ts', '*.tsx', "*.vue"],
}],
plugins: [
"@typescript-eslint"
],
extends: [
"eslint:recommended",
"plugin:vue/vue3-essential",
"plugin:@typescript-eslint/recommended"
],
parserOptions: {
"sourceType": "module",
"project": "./tsconfig.json",
"ecmaVersion": 2021,
"parser": "@typescript-eslint/parser",
extraFileExtensions: ['.vue']
},
rules: {
'@typescript-eslint/no-floating-promises': 'error',
},
settings: {
'import/resolver': {
alias: {
map: [
['@', './hwe/ts'],
['@util', './hwe/ts/util'],
['@scss', './hwe/scss'],
]
}
}
},
};
+50 -66
View File
@@ -1,66 +1,50 @@
.vscode/* .vscode/*
!.vscode/settings.json !.vscode/settings.json
!.vscode/tasks.json !.vscode/tasks.json
!.vscode/launch.json !.vscode/launch.json
!.vscode/extensions.json !.vscode/extensions.json
/node_modules
# 체섭 ignore
*.log # 체섭 ignore
*.log
logs/*.txt
d_log/*.txt logs/*.txt
d_log/*.zip d_log/*.txt
sess_* d_log/*.zip
*/logs/*.txt sess_*
*/logs/*/*.txt */logs/*.txt
*/logs/preserved */logs/*/*.txt
err.txt */logs/preserved
err.txt
hwe/.htaccess che/.htaccess
kwe/.htaccess
d_shared pwe/.htaccess
twe/.htaccess
/d_pic hwe/.htaccess
d_pic/*.jpg
d_pic/*.gif d_shared
d_pic/*.png
d_pic/*.webp d_pic/*.jpg
d_pic/uploaded_image d_pic/*.gif
d_pic/*.png
*/dist_misc/* d_pic/uploaded_image
*/dist_js/*
*/dist_css/* d_setting/*.php
/dist_misc/* */d_setting/*.php
/dist_js/* */d_setting/templates/*.php
/dist_css/*
**/old/*
d_setting/*.php test.php
*/d_setting/*.php
*/d_setting/*.json /che
*/d_setting/templates/*.php /kwe
!*.orig.php /pwe
/nya
*/data/file_cache /pya
/twe
**/old/*
test.* phpinfo.php
vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/*
/che *.sqlite3
/kwe
/pwe
/nya
/pya
/twe
/hwe/data
/vendor
phpinfo.php
*.sqlite3
ingame/js/*
ingame/css/*
gateway/js/*
gateway/css/*
-12
View File
@@ -1,12 +0,0 @@
{
"extension": ["ts"],
"spec": "hwe/test-ts/**/*.test.ts",
"require": [
"ts-node/register",
"tsconfig-paths/register"
],
"node-option": [
"experimental-specifier-resolution=node",
"loader=ts-node/esm"
]
}
+21 -127
View File
@@ -2,145 +2,44 @@
/** /**
* This configuration will be read and overlaid on top of the * This configuration will be read and overlaid on top of the
* default configuration. Command-line arguments will be applied * default configuration. Command line arguments will be applied
* after this file is read. * after this file is read.
*/ */
return [ return [
// Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`,
// `'7.4'`, `'8.0'`, `'8.1'`, `null`. // Supported values: '7.0', '7.1', '7.2', null.
// If this is set to `null`, // If this is set to null,
// then Phan assumes the PHP version which is closest to the minor version // then Phan assumes the PHP version which is closest to the minor version
// of the php executable used to execute Phan. // of the php executable used to execute phan.
// "target_php_version" => '7.0',
// Note that the **only** effect of choosing `'5.6'` is to infer 'backward_compatibility_checks ' => false,
// that functions removed in php 7.0 exist. 'ignore_undeclared_variables_in_global_scope' => false,
// (See `backward_compatibility_checks` for additional options) 'minimum_severity'=>\Phan\Issue::SEVERITY_LOW,
"target_php_version" => '8.0',
'backward_compatibility_checks ' => true,
'minimum_severity' => \Phan\Issue::SEVERITY_NORMAL,
'file_list' => [ 'file_list' => [
'f_config/config.php', 'f_config/config.php',
'hwe/_119_b.php', 'hwe/MYDB.php',
'hwe/_119.php', 'hwe/lib.php',
'hwe/a_bestGeneral.php',
'hwe/_admin1.php',
'hwe/_admin1_submit.php',
'hwe/_admin2.php',
'hwe/_admin2_submit.php',
'hwe/_admin4.php',
'hwe/_admin4_submit.php',
'hwe/_admin5.php',
'hwe/_admin5_submit.php',
'hwe/_admin7.php',
'hwe/_admin8.php',
'hwe/_admin_force_rehall.php',
'hwe/a_emperior_detail.php',
'hwe/a_emperior.php',
'hwe/a_genList.php',
'hwe/a_hallOfFame.php',
'hwe/a_history.php',
'hwe/a_kingdomList.php',
'hwe/a_npcList.php',
'hwe/api.php',
'hwe/a_status.php',
'hwe/a_traffic.php',
'hwe/a_vote.php',
'hwe/battle_simulator.php',
'hwe/b_auction.php',
'hwe/b_battleCenter.php',
'hwe/b_betting.php',
'hwe/v_chiefCenter.php',
'hwe/b_currentCity.php',
'hwe/v_nationStratFinan.php',
'hwe/b_diplomacy.php',
'hwe/b_genList.php',
'hwe/b_myBossInfo.php',
'hwe/b_myCityInfo.php',
'hwe/b_myGenInfo.php',
'hwe/b_myKingdomInfo.php',
'hwe/b_myPage.php',
'hwe/v_processing.php',
'hwe/b_tournament.php',
'hwe/b_troop.php',
'hwe/c_auction.php',
'hwe/c_tournament.php',
'hwe/c_vote.php',
'hwe/func_auction.php', 'hwe/func_auction.php',
'hwe/func_command.php', 'hwe/func_command.php',
'hwe/func_converter.php', 'hwe/func_converter.php',
'hwe/func_diplomacy.php',
'hwe/func_gamerule.php', 'hwe/func_gamerule.php',
'hwe/func_history.php', 'hwe/func_history.php',
'hwe/func_legacy.php', 'hwe/func_legacy.php',
'hwe/func_map.php', 'hwe/func_map.php',
'hwe/func_message.php', 'hwe/func_message.php',
'hwe/func.php', 'hwe/func_npc.php',
'hwe/func_process_chief.php',
'hwe/func_process_personnel.php',
'hwe/func_process_sabotage.php',
'hwe/func_process.php', 'hwe/func_process.php',
'hwe/func_string.php', 'hwe/func_string.php',
'hwe/func_template.php', 'hwe/func_template.php',
'hwe/func_time_event.php', 'hwe/func_time_event.php',
'hwe/func_tournament.php', 'hwe/func_tournament.php',
'hwe/index.php',
'hwe/install_db.php',
'hwe/install.php',
'hwe/j_adjust_icon.php',
'hwe/j_autoreset.php',
'hwe/j_basic_info.php',
'hwe/j_betting.php',
'hwe/j_board_article_add.php',
'hwe/j_board_comment_add.php',
'hwe/j_board_get_articles.php',
'hwe/j_die_immediately.php',
'hwe/j_diplomacy_destroy_letter.php',
'hwe/j_diplomacy_get_letter.php',
'hwe/j_diplomacy_respond_letter.php',
'hwe/j_diplomacy_rollback_letter.php',
'hwe/j_diplomacy_send_letter.php',
'hwe/j_export_simulator_object.php',
'hwe/j_general_log_old.php',
'hwe/j_general_set_permission.php',
'hwe/j_get_basic_general_list.php',
'hwe/j_get_city_list.php',
'hwe/j_get_general_list.php',
'hwe/j_get_nation_general_list.php',
'hwe/j_get_select_npc_token.php',
'hwe/j_get_select_pool.php',
'hwe/j_image_upload.php',
'hwe/j_install_db.php',
'hwe/j_install.php',
'hwe/j_load_scenarios.php',
'hwe/j_map_history.php',
'hwe/j_map.php',
'hwe/j_map_recent.php',
'hwe/j_msg_contact_list.php',
'hwe/j_msg_decide_opt.php',
'hwe/j_msg_delete.php',
'hwe/j_msg_get_old.php',
'hwe/j_msg_get_recent.php',
'hwe/j_msg_submit.php',
'hwe/j_myBossInfo.php',
'hwe/j_raise_event.php',
'hwe/j_select_npc.php',
'hwe/j_select_picked_general.php',
'hwe/j_server_basic_info.php',
'hwe/j_set_my_setting.php',
'hwe/j_set_npc_control.php',
'hwe/j_simulate_battle.php',
'hwe/j_troop.php',
'hwe/j_update_picked_general.php',
'hwe/j_vacation.php',
'hwe/lib.php',
'hwe/process_war.php', 'hwe/process_war.php',
'hwe/proc.php', 'hwe/func.php'
'hwe/readme.php',
'hwe/recent_map.php',
'hwe/select_general_from_pool.php',
'hwe/select_npc.php',
'hwe/t_diplomacy.php',
'hwe/v_board.php',
'hwe/v_inheritPoint.php',
'hwe/v_join.php',
'hwe/v_NPCControl.php',
], ],
// A list of directories that should be parsed for class and // A list of directories that should be parsed for class and
@@ -151,9 +50,9 @@ return [
// Thus, both first-party and third-party code being used by // Thus, both first-party and third-party code being used by
// your application should be included in this list. // your application should be included in this list.
'directory_list' => [ 'directory_list' => [
'hwe/d_setting', 'hwe/d_setting',
'hwe/sammo', 'hwe/sammo',
'd_setting', 'd_setting',
'src/sammo', 'src/sammo',
'src/kakao', 'src/kakao',
'vendor' 'vendor'
@@ -175,11 +74,6 @@ return [
'vendor/' 'vendor/'
], ],
'suppress_issue_types' => [
'PhanUnreferencedUseNormal',
'PhanTypeArraySuspiciousNullable',
],
// A list of plugin files to execute. // A list of plugin files to execute.
// See https://github.com/phan/phan/tree/master/.phan/plugins for even more. // See https://github.com/phan/phan/tree/master/.phan/plugins for even more.
// (Pass these in as relative paths. // (Pass these in as relative paths.
@@ -194,4 +88,4 @@ return [
'PregRegexCheckerPlugin', 'PregRegexCheckerPlugin',
'PrintfCheckerPlugin', 'PrintfCheckerPlugin',
], ],
]; ];
+2 -6
View File
@@ -13,7 +13,7 @@
"/nya":true, "/nya":true,
"/pya":true, "/pya":true,
"/twe":true, "/twe":true,
}, },
"search.exclude": { "search.exclude": {
"e_lib/*":true, "e_lib/*":true,
@@ -24,9 +24,5 @@
"/nya":true, "/nya":true,
"/pya":true, "/pya":true,
"/twe":true, "/twe":true,
}, },
"cSpell.words": [
"josa",
"sammo"
]
} }
-23
View File
@@ -1,23 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>닫혀 있습니다.</title>
<script>
setTimeout(function(){
window.location.href = '../';
}, 5000);
</script>
<style>
html, body{
background-color:black;
color:yellow;
}
</style>
</head>
<body>
서버가 닫혀있습니다.<br>
잠시 뒤에 입구로 이동합니다.
</body>
</html>
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License The MIT License
Copyright (c) 2022 Hide_D, 62che Copyright (c) 2018 Hide_D, 62che
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
+18 -26
View File
@@ -5,44 +5,36 @@
## 요구사항 ## 요구사항
* Apache2 또는 nginx * Apache2
* Apache2인 경우 `mpm_event` 권장 * <code>mpm_event</code> 권장
* PHP 8.0 이상 * PHP 7.2 이상
* `php-fpm` 권장 * <code>php-fpm</code> 권장
* php에서 curl, pdo-sqlite을 실행가능해야 합니다. * php에서 curl, pdo-sqlite을 실행가능해야 합니다. (기본값: 지원)
* mysqli, mysqlnd * mysqlnd가 지원되어야합니다. (기본값: 지원)
* gd
* mbstring
* NodeJS 14 이상
* 내부의 git을 통해 upgrade 때 `webpack build` 용도로 필요합니다.
* MariaDB 10.2.1 이상 * MariaDB 10.2.1 이상
* 현재 MySQL은 지원하지 않습니다. * MySQL 5.6 이상도 가능하도록 할 예정입니다.
* `git` * <code>git</code>
* `curl` * <code>curl</code>
Linux는 Ubuntu 18.04, 20.04, Windows는 WSL2를 사용한 환경에서 테스트되었습니다. Linux는 Ubuntu 16.04, Windows는 Windows 10에서 XAMPP를 사용한 환경에서 테스트되었습니다.
Docker를 이용한 설치도 제공하고 있습니다. Docker를 이용한 설치는 계획중입니다.
## Docker를 이용한 설치 ## 설치
https://storage.hided.net/gitea/devsam/docker 를 참고해 주세요.
## 수동 설치
본 게임은 <code>git</code>을 이용한 업그레이드 시스템을 구현하였으므로, <code>git</code>이 필요합니다. 본 게임은 <code>git</code>을 이용한 업그레이드 시스템을 구현하였으므로, <code>git</code>이 필요합니다.
또한 웹 서비스 데몬을 운영중인 사용자(일반적으로 <code>www-data</code>)에게 디렉토리 권한이 주어져야합니다. 또한 웹 서비스 데몬을 운영중인 사용자(일반적으로 <code>www-data</code>, <code>apache</code>)에게 디렉토리 권한이 주어져야합니다.
### 다운로드 ### 다운로드
웹 데몬 user가 <code>www-data</code>인 경우 다음과 같이 입력하여 최신 배포버전과 이미지 파일을 얻을 수 있습니다. 웹 데몬 user가 <code>www-data</code>인 경우 다음과 같이 입력하여 최신 배포버전과 이미지 파일을 얻을 수 있습니다.
``` ```
sudo -u www-data git clone https://storage.hided.net/gitea/devsam/core.git sudo -u www-data git clone ssh://git@storage.hided.net:2525/devsam/core.git
sudo -u www-data git clone https://storage.hided.net/gitea/devsam/image.git git clone ssh://git@storage.hided.net:2525/devsam/image.git
``` ```
> 이미지는 hook/git_hook.php을 통해 동기화되며, 서버 설치 과정에 이미지 갱신 키를 지정하는 것으로 '훼' 서버 업데이트 시 동기화됩니다. 이미지 서버가 게임 서버와 별개여도 동작하나, php와 git을 지원해야합니다. > 이미지는 git hook을 이용한 업데이트 기능을 제공하지만 아직 범용성 있는 설계가 되어있진 않습니다.
### 설치 ### 설치
@@ -55,9 +47,9 @@ Database 수는 로그인 관리 서버 1개, 내부 서버 7개로, 총 8개의
## 카카오로그인 연동 ## 카카오로그인 연동
서버 설치 시 카카오 로그인 연동을 위한 API KEY를 입력습니다. 현재 카카오로그인 API KEY를 입력하는 작업이 설치과정에 추가되어있지 않습니다.
만약 설치 이후 API KEY를 변경하고자 하는 경우 <code>d_setting/KakaoKey.php</code>에서 API키를 변경해야 합니다. 설치 후 <code>d_setting/KakaoKey.php</code>에서 API키를 입력해야 합니다.
## 라이선스 ## 라이선스
-12
View File
@@ -1,12 +0,0 @@
<?php
namespace sammo;
require(__DIR__ . '/vendor/autoload.php');
if (!class_exists('\\sammo\\RootDB')) {
Json::dieWithReason('No DB');
}
APIHelper::launch(dirname(__FILE__), $_GET['path']??null);
+45 -56
View File
@@ -1,56 +1,45 @@
{ {
"name":"sammo-hid/sammo", "name":"sammo-hid/sammo",
"description":"삼국지 모의전투 HiDCHe", "description":"삼국지 모의전투 HiDCHe",
"license": [ "license": [
"MIT", "MIT",
"GPL-2.0-or-later", "GPL-2.0-or-later",
"proprietary" "proprietary"
], ],
"config": { "require": {
"platform": { "brandonwamboldt/utilphp": "^1.1",
"php": "8.0" "sergeytsalkov/meekrodb": "^2.3",
} "league/plates": "^3.3",
}, "guzzlehttp/guzzle": "^6.3",
"require": { "leafo/scssphp": "^0.7.5",
"brandonwamboldt/utilphp": "^1.1", "monolog/monolog": "^1.23",
"sergeytsalkov/meekrodb": "^2.3", "firephp/firephp-core": "^0.4.0",
"league/plates": "^3.3", "vlucas/valitron": "^1.4",
"guzzlehttp/guzzle": "^6.3", "php-extended/php-tail": "^2.1",
"monolog/monolog": "^1.23", "pguardiario/phpuri": "^1.0",
"firephp/firephp-core": "^0.4.0", "symfony/lock": "^4.1",
"vlucas/valitron": "^1.4", "ezyang/htmlpurifier": "^4.10",
"php-extended/php-tail": "^2.1", "xemlock/htmlpurifier-html5": "^0.1.7",
"pguardiario/phpuri": "^1.0", "catfan/medoo": "^1.5"
"symfony/lock": "^4.1", },
"ezyang/htmlpurifier": "^4.10", "autoload": {
"xemlock/htmlpurifier-html5": "^0.1.7", "psr-4": {
"catfan/medoo": "^1.5", "sammo\\": [
"phan/phan": "*", "src/sammo"
"erusev/parsedown-extra": "^0.8.1", ],
"nette/caching": "^3.0", "kakao\\": [
"illuminate/database": "^8.61", "src/kakao"
"illuminate/events": "^8.61", ]
"spatie/data-transfer-object": "^3.7" },
}, "classmap": [
"autoload": { "d_setting/"
"psr-4": { ],
"sammo\\": [ "exclude-from-classmap": [
"d_setting", "**/*.orig.php"
"src/sammo" ],
], "files":[
"kakao\\": [ "f_config/config.php"
"d_setting", ]
"src/kakao" }
]
}, }
"exclude-from-classmap": [
"**/*.orig.php"
],
"files":[
"f_config/config.php"
]
},
"require-dev": {
"phpunit/phpunit": "^9.5"
}
}
Generated
+139 -5209
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+166 -234
View File
@@ -1,235 +1,167 @@
@charset "utf-8"; @charset "utf-8";
body {
color: white; body {
background-color: black; color:white; background-color:black; font-family: '맑은 고딕';
font-family: 'Pretendard'; }
}
table {
table { border: solid 1px; border-spacing: 0px; border-collapse: separate; border-top-color: gray; border-left-color: gray; border-right-color: black; border-bottom-color: black;
border: solid 1px; padding: 0px;
border-spacing: 0px; font-size: 13px;
border-collapse: separate; word-break: break-all;
border-top-color: gray; text-align: center;
border-left-color: gray; font-family: '맑은 고딕';
border-right-color: black; }
border-bottom-color: black; th, td {
padding: 0px; border: solid 1px; border-spacing: 0px; border-collapse: separate; border-top-color: gray; border-left-color: gray; border-right-color: black; border-bottom-color: black;
font-size: 14px; padding: 0px;
word-break: break-all; font-size: 13px;
text-align: center; word-break: break-all;
} text-align: center;
font-family: '맑은 고딕';
th, }
td {
border: solid 1px; a.just_link {
border-spacing: 0px; text-decoration: none;
border-collapse: separate; }
border-top-color: gray;
border-left-color: gray; .with_border{
border-right-color: black; margin:0;
border-bottom-color: black; border: solid 1px;
padding: 0px; border-spacing: 0px;
font-size: 14px; border-collapse: separate;
word-break: break-all; border-top-color: gray;
text-align: center; border-left-color: gray;
} border-right-color: black;
border-bottom-color: black;
a.just_link { }
text-decoration: none;
} .section_title {
height:50px;
.with_border { line-height:50px;
margin: 0; font-size: 30px; font-weight: bold;
border: solid 1px; text-align: center;
border-spacing: 0px; color:white;
border-collapse: separate; padding:0;
border-top-color: gray; }
border-left-color: gray;
border-right-color: black; .legacy_layout div {
border-bottom-color: black; border: solid 1px; border-spacing: 0px; border-collapse: separate; border-top-color: gray; border-left-color: gray; border-right-color: black; border-bottom-color: black;
} padding: 0px;
font-size: 13px;
.section_title { word-break: break-all;
height: 50px; text-align: center;
line-height: 50px; font-family: '맑은 고딕';;
font-size: 30px; }
font-weight: bold;
text-align: center; .obj_fill{
color: white; display:block;
padding: 0; width:100%;
} height:100%;
}
.legacy_layout div {
border: solid 1px; button.with_skin {
border-spacing: 0px; padding:0 4px;
border-collapse: separate; background-color: black; color: white;
border-top-color: gray; font-family: '맑은 고딕';
border-left-color: gray; font-size: 13px;
border-right-color: black; }
border-bottom-color: black;
padding: 0px; button.with_skin:disabled {
font-size: 14px; background-color:#333333;
word-break: break-all; }
text-align: center;
} input.with_skin {
background-color: black; color: white;
.obj_fill { font-family: '맑은 고딕';
display: block; font-size: 13px;
width: 100%; }
height: 100%;
} input.with_skin:disabled {
background-color: #333333;
button.with_skin { }
padding: 0 4px;
background-color: black; .font0 { font-size: 10px; }
color: white; .font1 { font-size: 13px; }
font-size: 14px; .font2 { font-size: 15px; }
} .font3 { font-size: 20px; }
.font4 { font-size: 30px; }
button.with_skin:disabled { .font5 { font-size: 50px; }
background-color: #333333;
} caption.section_title {
caption-side:top;
input.with_skin { }
background-color: black;
color: white;
font-size: 14px; .samButton{
} float:left;
display:block;
input.with_skin:disabled { padding:0;
background-color: #333333; margin:0;
} text-decoration: none;
position:relative;
.font0 { }
font-size: 10px;
} a.samButton.disabled {
pointer-events: none;
.font1 { cursor: default;
font-size: 14px; }
}
.samButtonOuter{
.font2 { display: table;
font-size: 15px; border: outset 2px white;
} box-sizing: border-box;
font-weight:bold;
.font3 { padding: 1px 6px;
font-size: 20px; width:125px;
} height:30px;
background-color:#000000;
.font4 { color:#ffffff;
font-size: 30px; }
}
.samButtonOuter:active{
.font5 { border: inset 2px white;
font-size: 50px; }
}
caption.section_title { .samButtonInner{
caption-side: top; display: table-cell;
} vertical-align: middle;
width: 100%;
.samButton { margin: 0 auto;
float: left; text-align: center;
display: block; user-select: none;
padding: 0; }
margin: 0;
text-decoration: none; .samToolbarButton > .samButtonOuter{
position: relative; width:125px;
} height:30px;
background-color:#225500;
a.samButton.disabled { color:white;
pointer-events: none; }
cursor: default;
} .samToolbarButton2 > .samButtonOuter{
width:125px;
.samButtonOuter { height:30px;
display: table; background-color:#225500;
border: outset 2px white; color:magenta;
box-sizing: border-box; }
font-weight: bold;
padding: 1px 6px; .samCommandButton > .samButtonOuter{
width: 125px; width:111px;
height: 30px; height:30px;
background-color: #000000; }
color: #ffffff;
} .samCommandButton.disabled > .samButtonOuter{
background-color:transparent !important;
.samButtonOuter:active { color:gray !important;
border: inset 2px white; border-color:transparent !important;
} }
.samButtonInner { .samCommandButton.disabled > .samButtonOuter > .samButtonInner::before{
display: table-cell; content:'【'
vertical-align: middle; }
width: 100%;
margin: 0 auto; .samCommandButton.disabled > .samButtonOuter > .samButtonInner::after{
text-align: center; content:'】'
user-select: none;
}
.samToolbarButton>.samButtonOuter {
width: 125px;
height: 30px;
background-color: #225500;
color: white;
}
.samToolbarButton2>.samButtonOuter {
width: 125px;
height: 30px;
background-color: #225500;
color: magenta;
}
.samCommandButton>.samButtonOuter {
width: 111px;
height: 30px;
}
.samCommandButton.disabled>.samButtonOuter {
background-color: transparent !important;
color: gray !important;
border-color: transparent !important;
}
.samCommandButton.disabled>.samButtonOuter>.samButtonInner::before {
content: '【'
}
.samCommandButton.disabled>.samButtonOuter>.samButtonInner::after {
content: '】'
}
.tooltip_copyable_info .tooltiptext {
display: inline;
color: rgba(0, 0, 0, 0);
font-size: 0;
}
.tooltiptext {
display: none;
}
.hidden_but_copyable {
color: rgba(0, 0, 0, 0);
font-size: 0;
}
.vertical_flex {
height: 100%;
display: flex;
align-content: center;
flex-direction: column;
align-items: stretch;
}
.vertical_flex .item {
display: block;
flex-grow: 1;
}
.fill_box {
display: block;
width: 100%;
height: 100%;
} }
+140 -155
View File
@@ -1,156 +1,141 @@
@charset "utf-8"; @charset "utf-8";
body {
line-height: 1.3; body{
} line-height: 1.3;
}
#server_notice {
margin: 10px 0; #server_notice {
border: none; margin:10px 0;
text-align: center; border: none;
} text-align:center;
}
#server_list_container {
width: 800px; #server_list_container{
position: absolute; width:800px;
left: 50%; position:absolute;
margin-left: -400px; left:50%;
} margin-left:-400px;
}
#server_list_table {
width: 100%; #server_list_table{
} width:100%;
}
#server_list tr {
height: 66px; #server_list tr{
} height:66px;
}
.ignore_border {
border: 0; #server_list .server_create_and_select .general_create,
margin: 0; #server_list .server_create_and_select .general_select {
padding: 0; width: 120px; height: 33px;
} float: left;
}
#user_info {
margin-top: 20px; #server_list .general_create,
width: 800px; #server_list .general_login {
height: 130px; width: 120px; height: 66px;
} float: left;
}
#user_info button {
width: 200px; .ignore_border{
height: 50px; border:0;
margin: 10px 50px; margin:0;
} padding:0;
}
.center_ordered_items {
text-align: center; #user_info {
} margin-top:20px;
width: 800px; height: 130px;
.Entrance_ServerList { }
width: 800px;
height: 64px;
border: none; #user_info button{
float: left; width: 200px;
} height: 50px;
margin: 10px 50px;
.Entrance_ServerListServer { }
width: 98px;
height: 64px; .center_ordered_items{
float: left; text-align:center;
} }
.Entrance_ServerListDown { .Entrance_ServerList {
width: 698px; width: 800px; height: 64px;
height: 64px; border: none;
float: left; float: left;
} }
.Entrance_ServerListInfo { .Entrance_ServerListServer {
width: 398px; width: 98px; height: 64px;
height: 64px; float: left;
float: left; }
}
.Entrance_ServerListDown {
.Entrance_ServerListBlock { width: 698px; height: 64px;
width: 298px; float: left;
height: 64px; }
float: left;
line-height: 64px; .Entrance_ServerListInfo {
} width: 398px; height: 64px;
float: left;
.Entrance_ServerListCharacter { }
width: 64px;
height: 64px; .Entrance_ServerListBlock {
float: left; width: 298px; height: 64px;
} float: left;
line-height: 64px;
.Entrance_ServerListName { }
width: 112px;
height: 64px; .Entrance_ServerListCharacter {
float: left; width: 64px; height: 64px;
line-height: 64px; float: left;
} }
.Entrance_ServerListSelect { .Entrance_ServerListName {
width: 120px; width: 112px; height: 64px;
height: 32px; float: left;
float: left; line-height: 64px;
} }
#Entrance_000003 {
width: 798px; .Entrance_ServerListSelect {
height: 155px; width: 120px; height: 32px;
text-align: left; float: left;
} }
.Entrance_Alert { #Entrance_000003 {
color: red; width: 798px; height: 155px;
font-size: 15px; text-align: left;
font-weight: bold; }
}
.Entrance_Alert {
.Entrance_Che { color: red; font-size: 15px; font-weight: bold;
color: white; }
font-size: 15px;
font-weight: bold; .Entrance_Che {
} color: white; font-size: 15px; font-weight: bold;
}
.Entrance_Kwe {
color: yellow; .Entrance_Kwe {
font-size: 15px; color: yellow; font-size: 15px; font-weight: bold;
font-weight: bold; }
}
.Entrance_Pwe {
.Entrance_Pwe { color: orange; font-size: 15px; font-weight: bold;
color: orange; }
font-size: 15px;
font-weight: bold; .Entrance_Twe {
} color: magenta; font-size: 15px; font-weight: bold;
}
.Entrance_Twe {
color: magenta; .Entrance_Nya {
font-size: 15px; color: #e67e22; font-size: 15px; font-weight: bold;
font-weight: bold; }
}
.Entrance_Pya {
.Entrance_Nya { color: #9b59b6; font-size: 15px; font-weight: bold;
color: #e67e22; }
font-size: 15px;
font-weight: bold; .Entrance_Hwe {
} color: red; font-size: 15px; font-weight: bold;
.Entrance_Pya {
color: #9b59b6;
font-size: 15px;
font-weight: bold;
}
.Entrance_Hwe {
color: red;
font-size: 15px;
font-weight: bold;
}
.BtnPlate {
height: inherit;
} }
+3 -3
View File
@@ -7,10 +7,10 @@ body, html{
margin-top: 70px; margin-top: 70px;
} }
h1.title { h1.title {
font-size: 50px; font-size: 50px;
font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic'; font-family: 'Passion One', cursive;
font-weight: 400; font-weight: 400;
} }
hr{ hr{
+3 -3
View File
@@ -7,10 +7,10 @@
margin-top: 70px; margin-top: 70px;
} }
h1.title { h1.title {
font-size: 50px; font-size: 50px;
font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic'; font-family: 'Passion One', cursive;
font-weight: 400; font-weight: 400;
} }
hr{ hr{
+131
View File
@@ -0,0 +1,131 @@
body, html{
height: 100%;
background-repeat: no-repeat;
}
.main{
margin-top: 70px;
}
h1.title {
font-size: 50px;
font-family: 'Passion One', cursive;
font-weight: 400;
}
hr{
width: 10%;
/*color: #fff;*/
}
.form-group{
margin-bottom: 15px;
}
label{
margin-bottom: 15px;
}
input,
input::-webkit-input-placeholder {
font-size: 11px;
padding-top: 3px;
}
.main-login{
/*background-color: #fff;*/
/* shadows and rounded borders */
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
-moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
}
.main-center{
margin-top: 30px;
margin: 0 auto;
max-width: 330px;
padding: 40px 40px;
}
.login_btn_group{
margin-top: 5px;
}
.login-register{
font-size: 11px;
text-align: center;
}
.col-form-label{
text-align:center;
}
.terms{
max-height: 200px; overflow-y: auto;
}
.terms pre{
width:100%;
white-space: pre-wrap; /* Since CSS 2.1 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
.vertical-center {
min-height: 100%; /* Fallback for browsers do NOT support vh unit */
min-height: 100vh; /* These two lines are counted as one :-) */
display: flex;
align-items: center;
}
.full-content {
position:fixed;
left:0;
top:0;
width:100%;
height:100%;
margin:0;
padding:0;
z-index:800;
}
#login_card{
z-index:801;
}
#btn_kakao_login{
cursor: pointer;
height:46px;
width:116px;
background-color: transparent;
color:transparent;
border:0;
background-size: 100%; /* To fill the dimensions of container (button), or */
background-repeat: no-repeat;
background-position: bottom center;
margin-top:5px;
background-image:url('../oauth_kakao/kakao_login_join.png');
}
#btn_kakao_login:hover {
background-image:url('../oauth_kakao/kakao_login_join_ov.png');
}
#bottom_box{
position:fixed;
bottom:0;
width:100%;
left:0;
}
#bottom_box .container{
text-align:center;
}
+1
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
+7
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+12
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+132
View File
@@ -0,0 +1,132 @@
//download.js v3.0, by dandavis; 2008-2014. [CCBY2] see http://danml.com/download.html for tests/usage
// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime
// v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs
// v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support
// data can be a string, Blob, File, or dataURL
function download(data, strFileName, strMimeType) {
var self = window, // this script is only for browsers anyway...
u = "application/octet-stream", // this default mime also triggers iframe downloads
m = strMimeType || u,
x = data,
D = document,
a = D.createElement("a"),
z = function(a){return String(a);},
B = self.Blob || self.MozBlob || self.WebKitBlob || z,
BB = self.MSBlobBuilder || self.WebKitBlobBuilder || self.BlobBuilder,
fn = strFileName || "download",
blob,
b,
ua,
fr;
//if(typeof B.bind === 'function' ){ B=B.bind(self); }
if(String(this)==="true"){ //reverse arguments, allowing download.bind(true, "text/xml", "export.xml") to act as a callback
x=[x, m];
m=x[0];
x=x[1];
}
//go ahead and download dataURLs right away
if(String(x).match(/^data\:[\w+\-]+\/[\w+\-]+[,;]/)){
return navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs:
navigator.msSaveBlob(d2b(x), fn) :
saver(x) ; // everyone else can save dataURLs un-processed
}//end if dataURL passed?
try{
blob = x instanceof B ?
x :
new B([x], {type: m}) ;
}catch(y){
if(BB){
b = new BB();
b.append([x]);
blob = b.getBlob(m); // the blob
}
}
function d2b(u) {
var p= u.split(/[:;,]/),
t= p[1],
dec= p[2] == "base64" ? atob : decodeURIComponent,
bin= dec(p.pop()),
mx= bin.length,
i= 0,
uia= new Uint8Array(mx);
for(i;i<mx;++i) uia[i]= bin.charCodeAt(i);
return new B([uia], {type: t});
}
function saver(url, winMode){
if ('download' in a) { //html5 A[download]
a.href = url;
a.setAttribute("download", fn);
a.innerHTML = "downloading...";
D.body.appendChild(a);
setTimeout(function() {
a.click();
D.body.removeChild(a);
if(winMode===true){setTimeout(function(){ self.URL.revokeObjectURL(a.href);}, 250 );}
}, 66);
return true;
}
//do iframe dataURL download (old ch+FF):
var f = D.createElement("iframe");
D.body.appendChild(f);
if(!winMode){ // force a mime that will download:
url="data:"+url.replace(/^data:([\w\/\-\+]+)/, u);
}
f.src = url;
setTimeout(function(){ D.body.removeChild(f); }, 333);
}//end saver
if (navigator.msSaveBlob) { // IE10+ : (has Blob, but not a[download] or URL)
return navigator.msSaveBlob(blob, fn);
}
if(self.URL){ // simple fast and modern way using Blob and URL:
saver(self.URL.createObjectURL(blob), true);
}else{
// handle non-Blob()+non-URL browsers:
if(typeof blob === "string" || blob.constructor===z ){
try{
return saver( "data:" + m + ";base64," + self.btoa(blob) );
}catch(y){
return saver( "data:" + m + "," + encodeURIComponent(blob) );
}
}
// Blob but not URL:
fr=new FileReader();
fr.onload=function(e){
saver(this.result);
};
fr.readAsDataURL(blob);
}
return true;
} /* end download() */
Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

+2
View File
File diff suppressed because one or more lines are too long
+7
View File
File diff suppressed because one or more lines are too long
+13
View File
File diff suppressed because one or more lines are too long
+152
View File
@@ -0,0 +1,152 @@
/*
jQuery Redirect v1.1.1
Copyright (c) 2013-2017 Miguel Galante
Copyright (c) 2011-2013 Nemanja Avramovic, www.avramovic.info
Licensed under CC BY-SA 4.0 License: http://creativecommons.org/licenses/by-sa/4.0/
This means everyone is allowed to:
Share - copy and redistribute the material in any medium or format
Adapt - remix, transform, and build upon the material for any purpose, even commercially.
Under following conditions:
Attribution - You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
ShareAlike - If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
*/
(function ($) {
'use strict';
/**
* 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. "_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 = function (url, values, method, target, traditional, redirectTop) {
redirectTop = redirectTop || false;
var generatedForm = $.redirect.getForm(url, values, method, target, traditional);
$('body', redirectTop ? window.top.document : undefined).append(generatedForm.form);
generatedForm.submit();
};
$.redirect.getForm = function (url, values, method, target, traditional) {
method = (method && ["GET", "POST", "PUT", "DELETE"].indexOf(method.toUpperCase()) !== -1) ? method.toUpperCase() : 'POST';
url = url.split("#");
var hash = url[1] ? ("#" + url[1]) : "";
url = url[0];
if (!values) {
var obj = $.parseUrl(url);
url = obj.url;
values = obj.params;
}
values = removeNulls(values);
var form = $('<form>')
.attr("method", method)
.attr("action", url + hash);
if (target) {
form.attr("target", target);
}
var submit = form[0].submit;
iterateValues(values, [], form, null, traditional);
return { form: form, submit: function () { submit.call(form[0]); } };
}
//Utility Functions
/**
* Url and QueryString Parser.
* @param {string} url - a Url to parse.
* @returns {object} an object with the parsed url with the following structure {url: URL, params:{ KEY: VALUE }}
*/
$.parseUrl = function (url) {
if (url.indexOf('?') === -1) {
return {
url: url,
params: {}
};
}
var parts = url.split('?'),
query_string = parts[1],
elems = query_string.split('&');
url = parts[0];
var i, pair, obj = {};
for (i = 0; i < elems.length; i += 1) {
pair = elems[i].split('=');
obj[pair[0]] = pair[1];
}
return {
url: url,
params: obj
};
};
//Private Functions
var getInput = function (name, value, parent, array, traditional) {
var parentString;
if (parent.length > 0) {
parentString = parent[0];
var i;
for (i = 1; i < parent.length; i += 1) {
parentString += "[" + parent[i] + "]";
}
if (array) {
if (traditional)
name = parentString;
else
name = parentString + "[" + name + "]";
} else {
name = parentString + "[" + name + "]";
}
}
return $("<input>").attr("type", "hidden")
.attr("name", name)
.attr("value", value);
};
var iterateValues = function (values, parent, form, isArray, traditional) {
var i, iterateParent = [];
Object.keys(values).forEach(function (i) {
if (typeof values[i] === "object") {
iterateParent = parent.slice();
iterateParent.push(i);
iterateValues(values[i], iterateParent, form, Array.isArray(values[i]), traditional);
} else {
form.append(getInput(i, values[i], parent, isArray, traditional));
}
});
};
var removeNulls = function (values) {
var propNames = Object.getOwnPropertyNames(values);
for (var i = 0; i < propNames.length; i++) {
var propName = propNames[i];
if (values[propName] === null || values[propName] === undefined) {
delete values[propName];
} else if (typeof values[propName] === 'object') {
values[propName] = removeNulls(values[propName]);
} else if (values[propName].length < 1) {
delete values[propName];
}
}
return values;
};
}(window.jQuery || window.Zepto || window.jqlite));
+4
View File
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
TODO : adobdb5, phpmailer5(?), plates, utilphp
+1
View File
@@ -0,0 +1 @@
"use strict";!function(t,r){var n=function(t){function r(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function n(t){return t.replace(/"/g,"&quot;")}function e(t){if(!t)return"";var r=[];for(var e in t){var i=t[e]+"";r.push(e+'="'+n(i)+'"')}return r.join(" ")}function i(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i=new a(i);for(var f=o(t),u=[],c=0;c<f.length;c++){var p=f[c];if("nl"===p.type&&i.nl2br)u.push("<br>\n");else if(p.isLink&&i.check(p)){var l=i.resolve(p),s=l.formatted,g=l.formattedHref,y=l.tagName,h=l.className,v=l.target,k=l.attributes,S="<"+y+' href="'+n(g)+'"';h&&(S+=' class="'+n(h)+'"'),v&&(S+=' target="'+n(v)+'"'),k&&(S+=" "+e(k)),S+=">"+r(s)+"</"+y+">",u.push(S)}else u.push(r(p.toString()))}return u.join("")}var o=t.tokenize,f=t.options,a=f.Options;if(!String.prototype.linkify)try{Object.defineProperty(String.prototype,"linkify",{a:function(){},get:function(){return function(t){return i(this,t)}}})}catch(u){String.prototype.linkify||(String.prototype.linkify=function(t){return i(this,t)})}return i}(r);t.linkifyStr=n}(window,linkify);
+1
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -1,3 +1,3 @@
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(n){return"너무 깁니다. "+(n.input.length-n.maximum)+" 글자 지워주세요."},inputTooShort:function(n){return"너무 짧습니다. "+(n.minimum-n.input.length)+" 글자 더 입력해주세요."},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(n){return"최대 "+n.maximum+"개까지만 선택 가능합니다."},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"},removeAllItems:function(){return"모든 항목 삭제"}}}),n.define,n.require}(); (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})();
+188 -553
View File
@@ -1,553 +1,188 @@
/* select2-bootstrap4 with Darkly */ /* select2-bootstrap4 with Darkly */
.select2-container--bootstrap4 { color: black; }
.select2-container--bootstrap4 {
color: black; .select2-container--bootstrap4 .select2-selection { background-color: #fff; border: 1px solid #ced4da; border-radius: 0.25rem; color: #495057; font-size: 1rem; outline: 0; }
}
.select2-container--bootstrap4 .select2-selection.form-control { border-radius: 0.25rem; }
.select2-container--bootstrap4 .select2-selection {
background-color: #fff; .select2-container--bootstrap4 .select2-search--dropdown .select2-search__field { background-color: #fff; border: 1px solid #ced4da; border-radius: 0.25rem; color: #495057; font-size: 1rem; }
border: 1px solid #ced4da;
border-radius: 0.25rem; .select2-container--bootstrap4 .select2-search__field { outline: 0; }
color: #495057;
font-size: 1rem; .select2-container--bootstrap4 .select2-search__field::-webkit-input-placeholder { color: #6c757d; }
outline: 0;
} .select2-container--bootstrap4 .select2-search__field:-moz-placeholder { color: #6c757d; }
.select2-container--bootstrap4 .select2-selection.form-control { .select2-container--bootstrap4 .select2-search__field::-moz-placeholder { color: #6c757d; opacity: 1; }
border-radius: 0.25rem;
} .select2-container--bootstrap4 .select2-search__field:-ms-input-placeholder { color: #6c757d; }
.select2-container--bootstrap4 .select2-search--dropdown .select2-search__field { .select2-container--bootstrap4 .select2-results__option { padding: 0.75rem 0.375rem; font-size: 1rem; }
background-color: #fff;
border: 1px solid #ced4da; .select2-container--bootstrap4 .select2-results__option[role=group] { padding: 0; }
border-radius: 0.25rem;
color: #495057; .select2-container--bootstrap4 .select2-results__option[aria-disabled=true] { color: #6c757d; cursor: not-allowed; }
font-size: 1rem;
} .select2-container--bootstrap4 .select2-results__option[aria-selected=true] { background-color: #f8f9fa; color: #16181b; }
.select2-container--bootstrap4 .select2-search__field { .select2-container--bootstrap4 .select2-results__option--highlighted[aria-selected] { background-color: #007bff; color: #fff; }
outline: 0;
} .select2-container--bootstrap4 .select2-results__option .select2-results__option { padding: 0.75rem 0.375rem; }
.select2-container--bootstrap4 .select2-search__field::-webkit-input-placeholder { .select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__group { padding-left: 0; }
color: #6c757d;
} .select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option { margin-left: -0.375rem; padding-left: 0.75rem; }
.select2-container--bootstrap4 .select2-search__field:-moz-placeholder { .select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -0.75rem; padding-left: 1.125rem; }
color: #6c757d;
} .select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -1.125rem; padding-left: 1.5rem; }
.select2-container--bootstrap4 .select2-search__field::-moz-placeholder { .select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -1.5rem; padding-left: 1.875rem; }
color: #6c757d;
opacity: 1; .select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -1.875rem; padding-left: 2.25rem; }
}
.select2-container--bootstrap4 .select2-results__group { color: #6c757d; display: block; padding: 0.75rem 0.375rem; font-size: 75%; line-height: 1; white-space: nowrap; }
.select2-container--bootstrap4 .select2-search__field:-ms-input-placeholder {
color: #6c757d; .select2-container--bootstrap4.select2-container--focus .select2-selection, .select2-container--bootstrap4.select2-container--open .select2-selection { transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; border-color: #80bdff; }
}
@media screen and (prefers-reduced-motion: reduce) { .select2-container--bootstrap4.select2-container--focus .select2-selection, .select2-container--bootstrap4.select2-container--open .select2-selection { transition: none; } }
.select2-container--bootstrap4 .select2-results__option {
padding: 0.75rem 0.375rem; .select2-container--bootstrap4.select2-container--open .select2-selection .select2-selection__arrow b { border-color: transparent transparent #6c757d transparent; border-width: 0 0.25rem 0.25rem 0.25rem; }
font-size: 1rem;
} .select2-container--bootstrap4.select2-container--open.select2-container--below .select2-selection { border-bottom-right-radius: 0; border-bottom-left-radius: 0; border-bottom-color: transparent; }
.select2-container--bootstrap4 .select2-results__option[role=group] { .select2-container--bootstrap4.select2-container--open.select2-container--above .select2-selection { border-top-left-radius: 0; border-top-right-radius: 0; border-top-color: transparent; }
padding: 0;
} .select2-container--bootstrap4 .select2-selection__clear { color: #6c757d; cursor: pointer; float: right; font-weight: bold; margin-right: 10px; }
.select2-container--bootstrap4 .select2-results__option[aria-disabled=true] { .select2-container--bootstrap4 .select2-selection__clear:hover { color: #343a40; }
color: #6c757d;
cursor: not-allowed; .select2-container--bootstrap4.select2-container--disabled .select2-selection { border-color: #ced4da; }
}
.select2-container--bootstrap4.select2-container--disabled .select2-selection, .select2-container--bootstrap4.select2-container--disabled .select2-search__field { cursor: not-allowed; }
.select2-container--bootstrap4 .select2-results__option[aria-selected=true] {
background-color: #f8f9fa; .select2-container--bootstrap4.select2-container--disabled .select2-selection, .select2-container--bootstrap4.select2-container--disabled .select2-selection--multiple .select2-selection__choice { background-color: #e9ecef; }
color: #16181b;
} .select2-container--bootstrap4.select2-container--disabled .select2-selection__clear, .select2-container--bootstrap4.select2-container--disabled .select2-selection--multiple .select2-selection__choice__remove { display: none; }
.select2-container--bootstrap4 .select2-results__option--highlighted[aria-selected] { .select2-container--bootstrap4 .select2-dropdown { border-color: #80bdff; border-width: 1px; overflow-x: hidden; margin-top: -1px; }
background-color: #007bff;
color: #fff; .select2-container--bootstrap4 .select2-dropdown--above { margin-top: 1px; }
}
.select2-container--bootstrap4 .select2-results > .select2-results__options { max-height: 200px; overflow-y: auto; }
.select2-container--bootstrap4 .select2-results__option .select2-results__option {
padding: 0.75rem 0.375rem; .select2-container--bootstrap4 .select2-selection--single { height: calc(2.25rem + 2px); line-height: 1; padding: 0.75rem 1.125rem 0.75rem 0.375rem; }
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow { position: absolute; bottom: 0; right: 0.375rem; top: 0; width: 0.25rem; }
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__group {
padding-left: 0; .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b { border-color: #6c757d transparent transparent transparent; border-style: solid; border-width: 0.25rem 0.25rem 0 0.25rem; height: 0; left: 0; margin-left: -0.25rem; margin-top: -0.125rem; position: absolute; top: 50%; width: 0; }
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered { color: #495057; padding: 0; }
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option {
margin-left: -0.375rem; .select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder { color: #6c757d; }
padding-left: 0.75rem;
} .select2-container--bootstrap4 .select2-selection--multiple { min-height: calc(2.25rem + 2px); padding: 0; height: auto; }
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option { .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered { box-sizing: border-box; display: block; line-height: 1; list-style: none; margin: 0; overflow: hidden; padding: 0.75rem 0.375rem 0 0.75rem; width: 100%; text-overflow: ellipsis; white-space: nowrap; }
margin-left: -0.75rem;
padding-left: 1.125rem; .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__placeholder { color: #6c757d; float: left; margin-top: 5px; }
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice { color: #495057; background: transparent; border: 1px solid #343a40; border-radius: 0.25rem; cursor: default; float: left; margin: -0.25rem 0 0 0.1875rem; padding: 0 0.75rem; }
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -1.125rem; .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field { background: transparent; padding: 0 0.375rem; height: calc(2.25rem + 2px)-2; line-height: 1; margin-top: 0; min-width: 5em; }
padding-left: 1.5rem;
} .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove { color: #6c757d; cursor: pointer; display: inline-block; font-weight: bold; margin-right: 0.375rem; }
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover { color: #343a40; }
margin-left: -1.5rem;
padding-left: 1.875rem; .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear { margin-top: 0.75rem; }
}
.select2-container--bootstrap4 .select2-selection--single.input-sm, .input-group-sm .select2-container--bootstrap4 .select2-selection--single, .form-group-sm .select2-container--bootstrap4 .select2-selection--single { border-radius: 0.2rem; font-size: 75%; height: calc(1.8125rem + 2px); line-height: 1; padding: 0.5rem 1rem 0.5rem 0.25rem; }
.select2-container--bootstrap4 .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -1.875rem; .select2-container--bootstrap4 .select2-selection--single.input-sm .select2-selection__arrow b, .input-group-sm .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b, .form-group-sm .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b { margin-left: -0.5rem; }
padding-left: 2.25rem;
} .select2-container--bootstrap4 .select2-selection--multiple.input-sm, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple { min-height: calc(1.8125rem + 2px); border-radius: 0.2rem; }
.select2-container--bootstrap4 .select2-results__group { .select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-selection__rendered, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered { padding: 0.5rem 0.25rem 0 0.5rem; }
color: #6c757d;
display: block; .select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-selection__choice, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice { font-size: 75%; line-height: 1; margin: 0 0 0 0.125rem; padding: 0 0.5rem; }
padding: 0.75rem 0.375rem;
font-size: 75%; .select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-search--inline .select2-search__field, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field { padding: 0 0.25rem; font-size: 75%; height: calc(1.8125rem + 2px)-2; line-height: 1; }
line-height: 1;
white-space: nowrap; .select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-selection__clear, .input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear, .form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear { margin-top: 0.5rem; }
}
.select2-container--bootstrap4 .select2-selection--single.input-lg, .input-group-lg .select2-container--bootstrap4 .select2-selection--single, .form-group-lg .select2-container--bootstrap4 .select2-selection--single { border-radius: 0.3rem; font-size: 1.25rem; height: calc(2.875rem + 2px); line-height: 1; padding: 1rem 1.4375rem 1rem 0.5rem; }
.select2-container--bootstrap4.select2-container--focus .select2-selection,
.select2-container--bootstrap4.select2-container--open .select2-selection { .select2-container--bootstrap4 .select2-selection--single.input-lg .select2-selection__arrow, .input-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow, .form-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow { width: 0.3125rem; }
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
border-color: #80bdff; .select2-container--bootstrap4 .select2-selection--single.input-lg .select2-selection__arrow b, .input-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b, .form-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b { border-width: 0.3125rem 0.3125rem 0 0.3125rem; margin-left: -0.3125rem; margin-left: -1rem; margin-top: -0.15625rem; }
}
.select2-container--bootstrap4 .select2-selection--multiple.input-lg, .input-group-lg .select2-container--bootstrap4 .select2-selection--multiple, .form-group-lg .select2-container--bootstrap4 .select2-selection--multiple { min-height: calc(2.875rem + 2px); border-radius: 0.3rem; }
@media screen and (prefers-reduced-motion: reduce) {
.select2-container--bootstrap4.select2-container--focus .select2-selection, .select2-container--bootstrap4 .select2-selection--multiple.input-lg .select2-selection__choice, .input-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice, .form-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice { font-size: 1.25rem; line-height: 1; border-radius: 0.25rem; margin: 0rem 0 0 0.25rem; padding: 0 1rem; }
.select2-container--bootstrap4.select2-container--open .select2-selection {
transition: none; .select2-container--bootstrap4 .select2-selection--multiple.input-lg .select2-search--inline .select2-search__field, .input-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field, .form-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field { padding: 0 0.5rem; font-size: 1.25rem; height: calc(2.875rem + 2px)-2; line-height: 1; }
}
} .select2-container--bootstrap4 .select2-selection--multiple.input-lg .select2-selection__clear, .input-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear, .form-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear { margin-top: 1rem; }
.select2-container--bootstrap4.select2-container--open .select2-selection .select2-selection__arrow b { .select2-container--bootstrap4 .select2-selection.input-lg.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #6c757d transparent; border-width: 0 0.3125rem 0.3125rem 0.3125rem; }
border-color: transparent transparent #6c757d transparent;
border-width: 0 0.25rem 0.25rem 0.25rem; .input-group-lg .select2-container--bootstrap4 .select2-selection.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #6c757d transparent; border-width: 0 0.3125rem 0.3125rem 0.3125rem; }
}
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single { padding-left: 1.125rem; padding-right: 0.375rem; }
.select2-container--bootstrap4.select2-container--open.select2-container--below .select2-selection {
border-bottom-right-radius: 0; .select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__rendered { padding-right: 0; padding-left: 0; text-align: right; }
border-bottom-left-radius: 0;
border-bottom-color: transparent; .select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__clear { float: left; }
}
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__arrow { left: 0.375rem; right: auto; }
.select2-container--bootstrap4.select2-container--open.select2-container--above .select2-selection {
border-top-left-radius: 0; .select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__arrow b { margin-left: 0; }
border-top-right-radius: 0;
border-top-color: transparent; .select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-search--inline { float: right; }
}
.select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__choice { margin-left: 0; margin-right: 0.1875rem; }
.select2-container--bootstrap4 .select2-selection__clear {
color: #6c757d; .select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { margin-left: 2px; margin-right: auto; }
cursor: pointer;
float: right; .has-warning .select2-dropdown, .has-warning .select2-selection { border-color: #ffc107; }
font-weight: bold;
margin-right: 10px; .has-warning .select2-container--focus .select2-selection, .has-warning .select2-container--open .select2-selection { border-color: #d39e00; }
}
.has-warning.select2-drop-active { border-color: #d39e00; }
.select2-container--bootstrap4 .select2-selection__clear:hover {
color: #343a40; .has-warning.select2-drop-active.select2-drop.select2-drop-above { border-top-color: #d39e00; }
}
.has-error .select2-dropdown, .has-error .select2-selection { border-color: #dc3545; }
.select2-container--bootstrap4.select2-container--disabled .select2-selection {
border-color: #ced4da; .has-error .select2-container--focus .select2-selection, .has-error .select2-container--open .select2-selection { border-color: #bd2130; }
}
.has-error.select2-drop-active { border-color: #bd2130; }
.select2-container--bootstrap4.select2-container--disabled .select2-selection,
.select2-container--bootstrap4.select2-container--disabled .select2-search__field { .has-error.select2-drop-active.select2-drop.select2-drop-above { border-top-color: #bd2130; }
cursor: not-allowed;
} .has-success .select2-dropdown, .has-success .select2-selection { border-color: #28a745; }
.select2-container--bootstrap4.select2-container--disabled .select2-selection, .has-success .select2-container--focus .select2-selection, .has-success .select2-container--open .select2-selection { border-color: #1e7e34; }
.select2-container--bootstrap4.select2-container--disabled .select2-selection--multiple .select2-selection__choice {
background-color: #e9ecef; .has-success.select2-drop-active { border-color: #1e7e34; }
}
.has-success.select2-drop-active.select2-drop.select2-drop-above { border-top-color: #1e7e34; }
.select2-container--bootstrap4.select2-container--disabled .select2-selection__clear,
.select2-container--bootstrap4.select2-container--disabled .select2-selection--multiple .select2-selection__choice__remove { .input-group > .select2-hidden-accessible:first-child + .select2-container--bootstrap4 > .selection > .select2-selection, .input-group > .select2-hidden-accessible:first-child + .select2-container--bootstrap4 > .selection > .select2-selection.form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
display: none;
} .input-group > .select2-hidden-accessible:not(:first-child) + .select2-container--bootstrap4:not(:last-child) > .selection > .select2-selection, .input-group > .select2-hidden-accessible:not(:first-child) + .select2-container--bootstrap4:not(:last-child) > .selection > .select2-selection.form-control { border-radius: 0; }
.select2-container--bootstrap4 .select2-dropdown { .input-group > .select2-hidden-accessible:not(:first-child):not(:last-child) + .select2-container--bootstrap4:last-child > .selection > .select2-selection, .input-group > .select2-hidden-accessible:not(:first-child):not(:last-child) + .select2-container--bootstrap4:last-child > .selection > .select2-selection.form-control { border-top-left-radius: 0; border-bottom-left-radius: 0; }
border-color: #80bdff;
border-width: 1px; .input-group > .select2-container--bootstrap4 { display: table; table-layout: fixed; position: relative; z-index: 2; width: 100%; margin-bottom: 0; }
overflow-x: hidden;
margin-top: -1px; .input-group > .select2-container--bootstrap4 > .selection > .select2-selection.form-control { float: none; }
}
.input-group > .select2-container--bootstrap4.select2-container--open, .input-group > .select2-container--bootstrap4.select2-container--focus { z-index: 3; }
.select2-container--bootstrap4 .select2-dropdown--above {
margin-top: 1px; .input-group > .select2-container--bootstrap4, .input-group > .select2-container--bootstrap4 .input-group-btn, .input-group > .select2-container--bootstrap4 .input-group-btn .btn { vertical-align: top; }
}
.form-control.select2-hidden-accessible { position: absolute !important; width: 1px !important; }
.select2-container--bootstrap4 .select2-results>.select2-results__options {
max-height: 200px; @media (min-width: 576px) { .form-inline .select2-container--bootstrap4 { display: inline-block; } }
overflow-y: auto;
}
.select2-container--bootstrap4 .select2-selection--single {
height: calc(2.25rem + 2px);
line-height: 1;
padding: 0.75rem 1.125rem 0.75rem 0.375rem;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
position: absolute;
bottom: 0;
right: 0.375rem;
top: 0;
width: 0.25rem;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b {
border-color: #6c757d transparent transparent transparent;
border-style: solid;
border-width: 0.25rem 0.25rem 0 0.25rem;
height: 0;
left: 0;
margin-left: -0.25rem;
margin-top: -0.125rem;
position: absolute;
top: 50%;
width: 0;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
color: #495057;
padding: 0;
}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
color: #6c757d;
}
.select2-container--bootstrap4 .select2-selection--multiple {
min-height: calc(2.25rem + 2px);
padding: 0;
height: auto;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered {
box-sizing: border-box;
display: block;
line-height: 1;
list-style: none;
margin: 0;
overflow: hidden;
padding: 0.75rem 0.375rem 0 0.75rem;
width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__placeholder {
color: #6c757d;
float: left;
margin-top: 5px;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
color: #495057;
background: transparent;
border: 1px solid #343a40;
border-radius: 0.25rem;
cursor: default;
float: left;
margin: -0.25rem 0 0 0.1875rem;
padding: 0 0.75rem;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field {
background: transparent;
padding: 0 0.375rem;
height: calc(2.25rem + 2px)-2;
line-height: 1;
margin-top: 0;
min-width: 5em;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove {
color: #6c757d;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 0.375rem;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #343a40;
}
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear {
margin-top: 0.75rem;
}
.select2-container--bootstrap4 .select2-selection--single.input-sm,
.input-group-sm .select2-container--bootstrap4 .select2-selection--single,
.form-group-sm .select2-container--bootstrap4 .select2-selection--single {
border-radius: 0.2rem;
font-size: 75%;
height: calc(1.8125rem + 2px);
line-height: 1;
padding: 0.5rem 1rem 0.5rem 0.25rem;
}
.select2-container--bootstrap4 .select2-selection--single.input-sm .select2-selection__arrow b,
.input-group-sm .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b,
.form-group-sm .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b {
margin-left: -0.5rem;
}
.select2-container--bootstrap4 .select2-selection--multiple.input-sm,
.input-group-sm .select2-container--bootstrap4 .select2-selection--multiple,
.form-group-sm .select2-container--bootstrap4 .select2-selection--multiple {
min-height: calc(1.8125rem + 2px);
border-radius: 0.2rem;
}
.select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-selection__rendered,
.input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered,
.form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered {
padding: 0.5rem 0.25rem 0 0.5rem;
}
.select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-selection__choice,
.input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice,
.form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
font-size: 75%;
line-height: 1;
margin: 0 0 0 0.125rem;
padding: 0 0.5rem;
}
.select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-search--inline .select2-search__field,
.input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field,
.form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field {
padding: 0 0.25rem;
font-size: 75%;
height: calc(1.8125rem + 2px)-2;
line-height: 1;
}
.select2-container--bootstrap4 .select2-selection--multiple.input-sm .select2-selection__clear,
.input-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear,
.form-group-sm .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear {
margin-top: 0.5rem;
}
.select2-container--bootstrap4 .select2-selection--single.input-lg,
.input-group-lg .select2-container--bootstrap4 .select2-selection--single,
.form-group-lg .select2-container--bootstrap4 .select2-selection--single {
border-radius: 0.3rem;
font-size: 1.25rem;
height: calc(2.875rem + 2px);
line-height: 1;
padding: 1rem 1.4375rem 1rem 0.5rem;
}
.select2-container--bootstrap4 .select2-selection--single.input-lg .select2-selection__arrow,
.input-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow,
.form-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
width: 0.3125rem;
}
.select2-container--bootstrap4 .select2-selection--single.input-lg .select2-selection__arrow b,
.input-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b,
.form-group-lg .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b {
border-width: 0.3125rem 0.3125rem 0 0.3125rem;
margin-left: -0.3125rem;
margin-left: -1rem;
margin-top: -0.15625rem;
}
.select2-container--bootstrap4 .select2-selection--multiple.input-lg,
.input-group-lg .select2-container--bootstrap4 .select2-selection--multiple,
.form-group-lg .select2-container--bootstrap4 .select2-selection--multiple {
min-height: calc(2.875rem + 2px);
border-radius: 0.3rem;
}
.select2-container--bootstrap4 .select2-selection--multiple.input-lg .select2-selection__choice,
.input-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice,
.form-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
font-size: 1.25rem;
line-height: 1;
border-radius: 0.25rem;
margin: 0rem 0 0 0.25rem;
padding: 0 1rem;
}
.select2-container--bootstrap4 .select2-selection--multiple.input-lg .select2-search--inline .select2-search__field,
.input-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field,
.form-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field {
padding: 0 0.5rem;
font-size: 1.25rem;
height: calc(2.875rem + 2px)-2;
line-height: 1;
}
.select2-container--bootstrap4 .select2-selection--multiple.input-lg .select2-selection__clear,
.input-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear,
.form-group-lg .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear {
margin-top: 1rem;
}
.select2-container--bootstrap4 .select2-selection.input-lg.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #6c757d transparent;
border-width: 0 0.3125rem 0.3125rem 0.3125rem;
}
.input-group-lg .select2-container--bootstrap4 .select2-selection.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #6c757d transparent;
border-width: 0 0.3125rem 0.3125rem 0.3125rem;
}
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single {
padding-left: 1.125rem;
padding-right: 0.375rem;
}
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__rendered {
padding-right: 0;
padding-left: 0;
text-align: right;
}
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left;
}
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__arrow {
left: 0.375rem;
right: auto;
}
.select2-container--bootstrap4[dir="rtl"] .select2-selection--single .select2-selection__arrow b {
margin-left: 0;
}
.select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__choice,
.select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,
.select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right;
}
.select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 0;
margin-right: 0.1875rem;
}
.select2-container--bootstrap4[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto;
}
.has-warning .select2-dropdown,
.has-warning .select2-selection {
border-color: #ffc107;
}
.has-warning .select2-container--focus .select2-selection,
.has-warning .select2-container--open .select2-selection {
border-color: #d39e00;
}
.has-warning.select2-drop-active {
border-color: #d39e00;
}
.has-warning.select2-drop-active.select2-drop.select2-drop-above {
border-top-color: #d39e00;
}
.has-error .select2-dropdown,
.has-error .select2-selection {
border-color: #dc3545;
}
.has-error .select2-container--focus .select2-selection,
.has-error .select2-container--open .select2-selection {
border-color: #bd2130;
}
.has-error.select2-drop-active {
border-color: #bd2130;
}
.has-error.select2-drop-active.select2-drop.select2-drop-above {
border-top-color: #bd2130;
}
.has-success .select2-dropdown,
.has-success .select2-selection {
border-color: #28a745;
}
.has-success .select2-container--focus .select2-selection,
.has-success .select2-container--open .select2-selection {
border-color: #1e7e34;
}
.has-success.select2-drop-active {
border-color: #1e7e34;
}
.has-success.select2-drop-active.select2-drop.select2-drop-above {
border-top-color: #1e7e34;
}
.input-group>.select2-hidden-accessible:first-child+.select2-container--bootstrap4>.selection>.select2-selection,
.input-group>.select2-hidden-accessible:first-child+.select2-container--bootstrap4>.selection>.select2-selection.form-control {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.input-group>.select2-hidden-accessible:not(:first-child)+.select2-container--bootstrap4:not(:last-child)>.selection>.select2-selection,
.input-group>.select2-hidden-accessible:not(:first-child)+.select2-container--bootstrap4:not(:last-child)>.selection>.select2-selection.form-control {
border-radius: 0;
}
.input-group>.select2-hidden-accessible:not(:first-child):not(:last-child)+.select2-container--bootstrap4:last-child>.selection>.select2-selection,
.input-group>.select2-hidden-accessible:not(:first-child):not(:last-child)+.select2-container--bootstrap4:last-child>.selection>.select2-selection.form-control {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.input-group>.select2-container--bootstrap4 {
display: table;
table-layout: fixed;
position: relative;
z-index: 2;
width: 100%;
margin-bottom: 0;
}
.input-group>.select2-container--bootstrap4>.selection>.select2-selection.form-control {
float: none;
}
.input-group>.select2-container--bootstrap4.select2-container--open,
.input-group>.select2-container--bootstrap4.select2-container--focus {
z-index: 3;
}
.input-group>.select2-container--bootstrap4,
.input-group>.select2-container--bootstrap4 .input-group-btn,
.input-group>.select2-container--bootstrap4 .input-group-btn .btn {
vertical-align: top;
}
.form-control.select2-hidden-accessible {
position: absolute !important;
width: 1px !important;
}
@media (min-width: 576px) {
.form-inline .select2-container--bootstrap4 {
display: inline-block;
}
}
+11 -8
View File
@@ -118,14 +118,12 @@
.select2-hidden-accessible { .select2-hidden-accessible {
border: 0 !important; border: 0 !important;
clip: rect(0 0 0 0) !important; clip: rect(0 0 0 0) !important;
-webkit-clip-path: inset(50%) !important;
clip-path: inset(50%) !important;
height: 1px !important; height: 1px !important;
margin: -1px !important;
overflow: hidden !important; overflow: hidden !important;
padding: 0 !important; padding: 0 !important;
position: absolute !important; position: absolute !important;
width: 1px !important; width: 1px !important; }
white-space: nowrap !important; }
.select2-container--default .select2-selection--single { .select2-container--default .select2-selection--single {
background-color: #fff; background-color: #fff;
@@ -188,13 +186,16 @@
width: 100%; } width: 100%; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered li { .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
list-style: none; } list-style: none; }
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
color: #999;
margin-top: 5px;
float: left; }
.select2-container--default .select2-selection--multiple .select2-selection__clear { .select2-container--default .select2-selection--multiple .select2-selection__clear {
cursor: pointer; cursor: pointer;
float: right; float: right;
font-weight: bold; font-weight: bold;
margin-top: 5px; margin-top: 5px;
margin-right: 10px; margin-right: 10px; }
padding: 1px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice { .select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4; background-color: #e4e4e4;
border: 1px solid #aaa; border: 1px solid #aaa;
@@ -213,7 +214,7 @@
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #333; } color: #333; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline { .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right; } float: right; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice { .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
@@ -419,7 +420,9 @@
color: #555; } color: #555; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
float: right; float: right; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px; margin-left: 5px;
margin-right: auto; } margin-right: auto; }
+220 -583
View File
@@ -1,11 +1,11 @@
/*! /*!
* Select2 4.0.13 * Select2 4.0.5
* https://select2.github.io * https://select2.github.io
* *
* Released under the MIT license * Released under the MIT license
* https://github.com/select2/select2/blob/master/LICENSE.md * https://github.com/select2/select2/blob/master/LICENSE.md
*/ */
;(function (factory) { (function (factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define(['jquery'], factory); define(['jquery'], factory);
@@ -574,10 +574,10 @@ S2.define('select2/utils',[
DecoratedClass.prototype = new ctr(); DecoratedClass.prototype = new ctr();
for (var m = 0; m < superMethods.length; m++) { for (var m = 0; m < superMethods.length; m++) {
var superMethod = superMethods[m]; var superMethod = superMethods[m];
DecoratedClass.prototype[superMethod] = DecoratedClass.prototype[superMethod] =
SuperClass.prototype[superMethod]; SuperClass.prototype[superMethod];
} }
var calledMethod = function (methodName) { var calledMethod = function (methodName) {
@@ -772,70 +772,6 @@ S2.define('select2/utils',[
$element.append($nodes); $element.append($nodes);
}; };
// Cache objects in Utils.__cache instead of $.data (see #4346)
Utils.__cache = {};
var id = 0;
Utils.GetUniqueElementId = function (element) {
// Get a unique element Id. If element has no id,
// creates a new unique number, stores it in the id
// attribute and returns the new id.
// If an id already exists, it simply returns it.
var select2Id = element.getAttribute('data-select2-id');
if (select2Id == null) {
// If element has id, use it.
if (element.id) {
select2Id = element.id;
element.setAttribute('data-select2-id', select2Id);
} else {
element.setAttribute('data-select2-id', ++id);
select2Id = id.toString();
}
}
return select2Id;
};
Utils.StoreData = function (element, name, value) {
// Stores an item in the cache for a specified element.
// name is the cache key.
var id = Utils.GetUniqueElementId(element);
if (!Utils.__cache[id]) {
Utils.__cache[id] = {};
}
Utils.__cache[id][name] = value;
};
Utils.GetData = function (element, name) {
// Retrieves a value from the cache by its key (name)
// name is optional. If no name specified, return
// all cache items for the specified element.
// and for a specified element.
var id = Utils.GetUniqueElementId(element);
if (name) {
if (Utils.__cache[id]) {
if (Utils.__cache[id][name] != null) {
return Utils.__cache[id][name];
}
return $(element).data(name); // Fallback to HTML5 data attribs.
}
return $(element).data(name); // Fallback to HTML5 data attribs.
} else {
return Utils.__cache[id];
}
};
Utils.RemoveData = function (element) {
// Removes all cached items for a specified element.
var id = Utils.GetUniqueElementId(element);
if (Utils.__cache[id] != null) {
delete Utils.__cache[id];
}
element.removeAttribute('data-select2-id');
};
return Utils; return Utils;
}); });
@@ -855,7 +791,7 @@ S2.define('select2/results',[
Results.prototype.render = function () { Results.prototype.render = function () {
var $results = $( var $results = $(
'<ul class="select2-results__options" role="listbox"></ul>' '<ul class="select2-results__options" role="tree"></ul>'
); );
if (this.options.get('multiple')) { if (this.options.get('multiple')) {
@@ -878,7 +814,7 @@ S2.define('select2/results',[
this.hideLoading(); this.hideLoading();
var $message = $( var $message = $(
'<li role="alert" aria-live="assertive"' + '<li role="treeitem" aria-live="assertive"' +
' class="select2-results__option"></li>' ' class="select2-results__option"></li>'
); );
@@ -971,7 +907,7 @@ S2.define('select2/results',[
$options.each(function () { $options.each(function () {
var $option = $(this); var $option = $(this);
var item = Utils.GetData(this, 'data'); var item = $.data(this, 'data');
// id needs to be converted to a string when comparing // id needs to be converted to a string when comparing
var id = '' + item.id; var id = '' + item.id;
@@ -1012,16 +948,11 @@ S2.define('select2/results',[
option.className = 'select2-results__option'; option.className = 'select2-results__option';
var attrs = { var attrs = {
'role': 'option', 'role': 'treeitem',
'aria-selected': 'false' 'aria-selected': 'false'
}; };
var matches = window.Element.prototype.matches || if (data.disabled) {
window.Element.prototype.msMatchesSelector ||
window.Element.prototype.webkitMatchesSelector;
if ((data.element != null && matches.call(data.element, ':disabled')) ||
(data.element == null && data.disabled)) {
delete attrs['aria-selected']; delete attrs['aria-selected'];
attrs['aria-disabled'] = 'true'; attrs['aria-disabled'] = 'true';
} }
@@ -1081,7 +1012,7 @@ S2.define('select2/results',[
this.template(data, option); this.template(data, option);
} }
Utils.StoreData(option, 'data', data); $.data(option, 'data', data);
return option; return option;
}; };
@@ -1122,10 +1053,7 @@ S2.define('select2/results',[
} }
self.setClasses(); self.setClasses();
self.highlightFirstItem();
if (self.options.get('scrollAfterSelect')) {
self.highlightFirstItem();
}
}); });
container.on('unselect', function () { container.on('unselect', function () {
@@ -1134,10 +1062,7 @@ S2.define('select2/results',[
} }
self.setClasses(); self.setClasses();
self.highlightFirstItem();
if (self.options.get('scrollAfterSelect')) {
self.highlightFirstItem();
}
}); });
container.on('open', function () { container.on('open', function () {
@@ -1173,7 +1098,7 @@ S2.define('select2/results',[
return; return;
} }
var data = Utils.GetData($highlighted[0], 'data'); var data = $highlighted.data('data');
if ($highlighted.attr('aria-selected') == 'true') { if ($highlighted.attr('aria-selected') == 'true') {
self.trigger('close', {}); self.trigger('close', {});
@@ -1191,9 +1116,8 @@ S2.define('select2/results',[
var currentIndex = $options.index($highlighted); var currentIndex = $options.index($highlighted);
// If we are already at the top, don't move further // If we are already at te top, don't move further
// If no options, currentIndex will be -1 if (currentIndex === 0) {
if (currentIndex <= 0) {
return; return;
} }
@@ -1286,7 +1210,7 @@ S2.define('select2/results',[
function (evt) { function (evt) {
var $this = $(this); var $this = $(this);
var data = Utils.GetData(this, 'data'); var data = $this.data('data');
if ($this.attr('aria-selected') === 'true') { if ($this.attr('aria-selected') === 'true') {
if (self.options.get('multiple')) { if (self.options.get('multiple')) {
@@ -1309,7 +1233,7 @@ S2.define('select2/results',[
this.$results.on('mouseenter', '.select2-results__option[aria-selected]', this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
function (evt) { function (evt) {
var data = Utils.GetData(this, 'data'); var data = $(this).data('data');
self.getHighlightedResults() self.getHighlightedResults()
.removeClass('select2-results__option--highlighted'); .removeClass('select2-results__option--highlighted');
@@ -1424,15 +1348,14 @@ S2.define('select2/selection/base',[
this._tabindex = 0; this._tabindex = 0;
if (Utils.GetData(this.$element[0], 'old-tabindex') != null) { if (this.$element.data('old-tabindex') != null) {
this._tabindex = Utils.GetData(this.$element[0], 'old-tabindex'); this._tabindex = this.$element.data('old-tabindex');
} else if (this.$element.attr('tabindex') != null) { } else if (this.$element.attr('tabindex') != null) {
this._tabindex = this.$element.attr('tabindex'); this._tabindex = this.$element.attr('tabindex');
} }
$selection.attr('title', this.$element.attr('title')); $selection.attr('title', this.$element.attr('title'));
$selection.attr('tabindex', this._tabindex); $selection.attr('tabindex', this._tabindex);
$selection.attr('aria-disabled', 'false');
this.$selection = $selection; this.$selection = $selection;
@@ -1442,6 +1365,7 @@ S2.define('select2/selection/base',[
BaseSelection.prototype.bind = function (container, $container) { BaseSelection.prototype.bind = function (container, $container) {
var self = this; var self = this;
var id = container.id + '-container';
var resultsId = container.id + '-results'; var resultsId = container.id + '-results';
this.container = container; this.container = container;
@@ -1484,19 +1408,17 @@ S2.define('select2/selection/base',[
self.$selection.removeAttr('aria-activedescendant'); self.$selection.removeAttr('aria-activedescendant');
self.$selection.removeAttr('aria-owns'); self.$selection.removeAttr('aria-owns');
self.$selection.trigger('focus'); self.$selection.focus();
self._detachCloseHandler(container); self._detachCloseHandler(container);
}); });
container.on('enable', function () { container.on('enable', function () {
self.$selection.attr('tabindex', self._tabindex); self.$selection.attr('tabindex', self._tabindex);
self.$selection.attr('aria-disabled', 'false');
}); });
container.on('disable', function () { container.on('disable', function () {
self.$selection.attr('tabindex', '-1'); self.$selection.attr('tabindex', '-1');
self.$selection.attr('aria-disabled', 'true');
}); });
}; };
@@ -1519,6 +1441,7 @@ S2.define('select2/selection/base',[
}; };
BaseSelection.prototype._attachCloseHandler = function (container) { BaseSelection.prototype._attachCloseHandler = function (container) {
var self = this;
$(document.body).on('mousedown.select2.' + container.id, function (e) { $(document.body).on('mousedown.select2.' + container.id, function (e) {
var $target = $(e.target); var $target = $(e.target);
@@ -1528,11 +1451,13 @@ S2.define('select2/selection/base',[
var $all = $('.select2.select2-container--open'); var $all = $('.select2.select2-container--open');
$all.each(function () { $all.each(function () {
var $this = $(this);
if (this == $select[0]) { if (this == $select[0]) {
return; return;
} }
var $element = Utils.GetData(this, 'element'); var $element = $this.data('element');
$element.select2('close'); $element.select2('close');
}); });
@@ -1556,27 +1481,6 @@ S2.define('select2/selection/base',[
throw new Error('The `update` method must be defined in child classes.'); throw new Error('The `update` method must be defined in child classes.');
}; };
/**
* Helper method to abstract the "enabled" (not "disabled") state of this
* object.
*
* @return {true} if the instance is not disabled.
* @return {false} if the instance is disabled.
*/
BaseSelection.prototype.isEnabled = function () {
return !this.isDisabled();
};
/**
* Helper method to abstract the "disabled" state of this object.
*
* @return {true} if the disabled option is true.
* @return {false} if the disabled option is false.
*/
BaseSelection.prototype.isDisabled = function () {
return this.options.get('disabled');
};
return BaseSelection; return BaseSelection;
}); });
@@ -1614,10 +1518,7 @@ S2.define('select2/selection/single',[
var id = container.id + '-container'; var id = container.id + '-container';
this.$selection.find('.select2-selection__rendered') this.$selection.find('.select2-selection__rendered').attr('id', id);
.attr('id', id)
.attr('role', 'textbox')
.attr('aria-readonly', 'true');
this.$selection.attr('aria-labelledby', id); this.$selection.attr('aria-labelledby', id);
this.$selection.on('mousedown', function (evt) { this.$selection.on('mousedown', function (evt) {
@@ -1641,15 +1542,17 @@ S2.define('select2/selection/single',[
container.on('focus', function (evt) { container.on('focus', function (evt) {
if (!container.isOpen()) { if (!container.isOpen()) {
self.$selection.trigger('focus'); self.$selection.focus();
} }
}); });
container.on('selection:update', function (params) {
self.update(params.data);
});
}; };
SingleSelection.prototype.clear = function () { SingleSelection.prototype.clear = function () {
var $rendered = this.$selection.find('.select2-selection__rendered'); this.$selection.find('.select2-selection__rendered').empty();
$rendered.empty();
$rendered.removeAttr('title'); // clear tooltip on empty
}; };
SingleSelection.prototype.display = function (data, container) { SingleSelection.prototype.display = function (data, container) {
@@ -1675,14 +1578,7 @@ S2.define('select2/selection/single',[
var formatted = this.display(selection, $rendered); var formatted = this.display(selection, $rendered);
$rendered.empty().append(formatted); $rendered.empty().append(formatted);
$rendered.prop('title', selection.title || selection.text);
var title = selection.title || selection.text;
if (title) {
$rendered.attr('title', title);
} else {
$rendered.removeAttr('title');
}
}; };
return SingleSelection; return SingleSelection;
@@ -1727,14 +1623,14 @@ S2.define('select2/selection/multiple',[
'.select2-selection__choice__remove', '.select2-selection__choice__remove',
function (evt) { function (evt) {
// Ignore the event if it is disabled // Ignore the event if it is disabled
if (self.isDisabled()) { if (self.options.get('disabled')) {
return; return;
} }
var $remove = $(this); var $remove = $(this);
var $selection = $remove.parent(); var $selection = $remove.parent();
var data = Utils.GetData($selection[0], 'data'); var data = $selection.data('data');
self.trigger('unselect', { self.trigger('unselect', {
originalEvent: evt, originalEvent: evt,
@@ -1745,9 +1641,7 @@ S2.define('select2/selection/multiple',[
}; };
MultipleSelection.prototype.clear = function () { MultipleSelection.prototype.clear = function () {
var $rendered = this.$selection.find('.select2-selection__rendered'); this.$selection.find('.select2-selection__rendered').empty();
$rendered.empty();
$rendered.removeAttr('title');
}; };
MultipleSelection.prototype.display = function (data, container) { MultipleSelection.prototype.display = function (data, container) {
@@ -1785,14 +1679,9 @@ S2.define('select2/selection/multiple',[
var formatted = this.display(selection, $selection); var formatted = this.display(selection, $selection);
$selection.append(formatted); $selection.append(formatted);
$selection.prop('title', selection.title || selection.text);
var title = selection.title || selection.text; $selection.data('data', selection);
if (title) {
$selection.attr('title', title);
}
Utils.StoreData($selection[0], 'data', selection);
$selections.push($selection); $selections.push($selection);
} }
@@ -1857,9 +1746,8 @@ S2.define('select2/selection/placeholder',[
S2.define('select2/selection/allowClear',[ S2.define('select2/selection/allowClear',[
'jquery', 'jquery',
'../keys', '../keys'
'../utils' ], function ($, KEYS) {
], function ($, KEYS, Utils) {
function AllowClear () { } function AllowClear () { }
AllowClear.prototype.bind = function (decorated, container, $container) { AllowClear.prototype.bind = function (decorated, container, $container) {
@@ -1888,7 +1776,7 @@ S2.define('select2/selection/allowClear',[
AllowClear.prototype._handleClear = function (_, evt) { AllowClear.prototype._handleClear = function (_, evt) {
// Ignore the event if it is disabled // Ignore the event if it is disabled
if (this.isDisabled()) { if (this.options.get('disabled')) {
return; return;
} }
@@ -1901,22 +1789,10 @@ S2.define('select2/selection/allowClear',[
evt.stopPropagation(); evt.stopPropagation();
var data = Utils.GetData($clear[0], 'data'); var data = $clear.data('data');
var previousVal = this.$element.val();
this.$element.val(this.placeholder.id);
var unselectData = {
data: data
};
this.trigger('clear', unselectData);
if (unselectData.prevented) {
this.$element.val(previousVal);
return;
}
for (var d = 0; d < data.length; d++) { for (var d = 0; d < data.length; d++) {
unselectData = { var unselectData = {
data: data[d] data: data[d]
}; };
@@ -1926,12 +1802,11 @@ S2.define('select2/selection/allowClear',[
// If the event was prevented, don't clear it out. // If the event was prevented, don't clear it out.
if (unselectData.prevented) { if (unselectData.prevented) {
this.$element.val(previousVal);
return; return;
} }
} }
this.$element.trigger('input').trigger('change'); this.$element.val(this.placeholder.id).trigger('change');
this.trigger('toggle', {}); this.trigger('toggle', {});
}; };
@@ -1954,14 +1829,12 @@ S2.define('select2/selection/allowClear',[
return; return;
} }
var removeAll = this.options.get('translations').get('removeAllItems');
var $remove = $( var $remove = $(
'<span class="select2-selection__clear" title="' + removeAll() +'">' + '<span class="select2-selection__clear">' +
'&times;' + '&times;' +
'</span>' '</span>'
); );
Utils.StoreData($remove[0], 'data', data); $remove.data('data', data);
this.$selection.find('.select2-selection__rendered').prepend($remove); this.$selection.find('.select2-selection__rendered').prepend($remove);
}; };
@@ -1983,7 +1856,7 @@ S2.define('select2/selection/search',[
'<li class="select2-search select2-search--inline">' + '<li class="select2-search select2-search--inline">' +
'<input class="select2-search__field" type="search" tabindex="-1"' + '<input class="select2-search__field" type="search" tabindex="-1"' +
' autocomplete="off" autocorrect="off" autocapitalize="none"' + ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
' spellcheck="false" role="searchbox" aria-autocomplete="list" />' + ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
'</li>' '</li>'
); );
@@ -2000,18 +1873,14 @@ S2.define('select2/selection/search',[
Search.prototype.bind = function (decorated, container, $container) { Search.prototype.bind = function (decorated, container, $container) {
var self = this; var self = this;
var resultsId = container.id + '-results';
decorated.call(this, container, $container); decorated.call(this, container, $container);
container.on('open', function () { container.on('open', function () {
self.$search.attr('aria-controls', resultsId);
self.$search.trigger('focus'); self.$search.trigger('focus');
}); });
container.on('close', function () { container.on('close', function () {
self.$search.val(''); self.$search.val('');
self.$search.removeAttr('aria-controls');
self.$search.removeAttr('aria-activedescendant'); self.$search.removeAttr('aria-activedescendant');
self.$search.trigger('focus'); self.$search.trigger('focus');
}); });
@@ -2031,11 +1900,7 @@ S2.define('select2/selection/search',[
}); });
container.on('results:focus', function (params) { container.on('results:focus', function (params) {
if (params.data._resultId) { self.$search.attr('aria-activedescendant', params.id);
self.$search.attr('aria-activedescendant', params.data._resultId);
} else {
self.$search.removeAttr('aria-activedescendant');
}
}); });
this.$selection.on('focusin', '.select2-search--inline', function (evt) { this.$selection.on('focusin', '.select2-search--inline', function (evt) {
@@ -2060,7 +1925,7 @@ S2.define('select2/selection/search',[
.prev('.select2-selection__choice'); .prev('.select2-selection__choice');
if ($previousChoice.length > 0) { if ($previousChoice.length > 0) {
var item = Utils.GetData($previousChoice[0], 'data'); var item = $previousChoice.data('data');
self.searchRemoveChoice(item); self.searchRemoveChoice(item);
@@ -2069,12 +1934,6 @@ S2.define('select2/selection/search',[
} }
}); });
this.$selection.on('click', '.select2-search--inline', function (evt) {
if (self.$search.val()) {
evt.stopPropagation();
}
});
// Try to detect the IE version should the `documentMode` property that // Try to detect the IE version should the `documentMode` property that
// is stored on the document. This is only implemented in IE and is // is stored on the document. This is only implemented in IE and is
// slightly cleaner than doing a user agent check. // slightly cleaner than doing a user agent check.
@@ -2160,7 +2019,7 @@ S2.define('select2/selection/search',[
this.resizeSearch(); this.resizeSearch();
if (searchHadFocus) { if (searchHadFocus) {
this.$search.trigger('focus'); this.$search.focus();
} }
}; };
@@ -2193,7 +2052,7 @@ S2.define('select2/selection/search',[
var width = ''; var width = '';
if (this.$search.attr('placeholder') !== '') { if (this.$search.attr('placeholder') !== '') {
width = this.$selection.find('.select2-selection__rendered').width(); width = this.$selection.find('.select2-selection__rendered').innerWidth();
} else { } else {
var minimumWidth = this.$search.val().length + 1; var minimumWidth = this.$search.val().length + 1;
@@ -2217,13 +2076,10 @@ S2.define('select2/selection/eventRelay',[
'open', 'opening', 'open', 'opening',
'close', 'closing', 'close', 'closing',
'select', 'selecting', 'select', 'selecting',
'unselect', 'unselecting', 'unselect', 'unselecting'
'clear', 'clearing'
]; ];
var preventableEvents = [ var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
'opening', 'closing', 'selecting', 'unselecting', 'clearing'
];
decorated.call(this, container, $container); decorated.call(this, container, $container);
@@ -2556,7 +2412,6 @@ S2.define('select2/diacritics',[
'\u019F': 'O', '\u019F': 'O',
'\uA74A': 'O', '\uA74A': 'O',
'\uA74C': 'O', '\uA74C': 'O',
'\u0152': 'OE',
'\u01A2': 'OI', '\u01A2': 'OI',
'\uA74E': 'OO', '\uA74E': 'OO',
'\u0222': 'OU', '\u0222': 'OU',
@@ -2966,7 +2821,6 @@ S2.define('select2/diacritics',[
'\uA74B': 'o', '\uA74B': 'o',
'\uA74D': 'o', '\uA74D': 'o',
'\u0275': 'o', '\u0275': 'o',
'\u0153': 'oe',
'\u01A3': 'oi', '\u01A3': 'oi',
'\u0223': 'ou', '\u0223': 'ou',
'\uA74F': 'oo', '\uA74F': 'oo',
@@ -3135,9 +2989,8 @@ S2.define('select2/diacritics',[
'\u03CD': '\u03C5', '\u03CD': '\u03C5',
'\u03CB': '\u03C5', '\u03CB': '\u03C5',
'\u03B0': '\u03C5', '\u03B0': '\u03C5',
'\u03CE': '\u03C9', '\u03C9': '\u03C9',
'\u03C2': '\u03C3', '\u03C2': '\u03C3'
'\u2019': '\''
}; };
return diacritics; return diacritics;
@@ -3222,7 +3075,7 @@ S2.define('select2/data/select',[
if ($(data.element).is('option')) { if ($(data.element).is('option')) {
data.element.selected = true; data.element.selected = true;
this.$element.trigger('input').trigger('change'); this.$element.trigger('change');
return; return;
} }
@@ -3243,13 +3096,13 @@ S2.define('select2/data/select',[
} }
self.$element.val(val); self.$element.val(val);
self.$element.trigger('input').trigger('change'); self.$element.trigger('change');
}); });
} else { } else {
var val = data.id; var val = data.id;
this.$element.val(val); this.$element.val(val);
this.$element.trigger('input').trigger('change'); this.$element.trigger('change');
} }
}; };
@@ -3265,7 +3118,7 @@ S2.define('select2/data/select',[
if ($(data.element).is('option')) { if ($(data.element).is('option')) {
data.element.selected = false; data.element.selected = false;
this.$element.trigger('input').trigger('change'); this.$element.trigger('change');
return; return;
} }
@@ -3283,7 +3136,7 @@ S2.define('select2/data/select',[
self.$element.val(val); self.$element.val(val);
self.$element.trigger('input').trigger('change'); self.$element.trigger('change');
}); });
}; };
@@ -3305,7 +3158,7 @@ S2.define('select2/data/select',[
// Remove anything added to child elements // Remove anything added to child elements
this.$element.find('*').each(function () { this.$element.find('*').each(function () {
// Remove any custom data set by Select2 // Remove any custom data set by Select2
Utils.RemoveData(this); $.removeData(this, 'data');
}); });
}; };
@@ -3378,7 +3231,7 @@ S2.define('select2/data/select',[
normalizedData.element = option; normalizedData.element = option;
// Override the option's data with the combined data // Override the option's data with the combined data
Utils.StoreData(option, 'data', normalizedData); $.data(option, 'data', normalizedData);
return $option; return $option;
}; };
@@ -3386,7 +3239,7 @@ S2.define('select2/data/select',[
SelectAdapter.prototype.item = function ($option) { SelectAdapter.prototype.item = function ($option) {
var data = {}; var data = {};
data = Utils.GetData($option[0], 'data'); data = $.data($option[0], 'data');
if (data != null) { if (data != null) {
return data; return data;
@@ -3424,13 +3277,13 @@ S2.define('select2/data/select',[
data = this._normalizeItem(data); data = this._normalizeItem(data);
data.element = $option[0]; data.element = $option[0];
Utils.StoreData($option[0], 'data', data); $.data($option[0], 'data', data);
return data; return data;
}; };
SelectAdapter.prototype._normalizeItem = function (item) { SelectAdapter.prototype._normalizeItem = function (item) {
if (item !== Object(item)) { if (!$.isPlainObject(item)) {
item = { item = {
id: item, id: item,
text: item text: item
@@ -3476,19 +3329,15 @@ S2.define('select2/data/array',[
'jquery' 'jquery'
], function (SelectAdapter, Utils, $) { ], function (SelectAdapter, Utils, $) {
function ArrayAdapter ($element, options) { function ArrayAdapter ($element, options) {
this._dataToConvert = options.get('data') || []; var data = options.get('data') || [];
ArrayAdapter.__super__.constructor.call(this, $element, options); ArrayAdapter.__super__.constructor.call(this, $element, options);
this.addOptions(this.convertToOptions(data));
} }
Utils.Extend(ArrayAdapter, SelectAdapter); Utils.Extend(ArrayAdapter, SelectAdapter);
ArrayAdapter.prototype.bind = function (container, $container) {
ArrayAdapter.__super__.bind.call(this, container, $container);
this.addOptions(this.convertToOptions(this._dataToConvert));
};
ArrayAdapter.prototype.select = function (data) { ArrayAdapter.prototype.select = function (data) {
var $option = this.$element.find('option').filter(function (i, elm) { var $option = this.$element.find('option').filter(function (i, elm) {
return elm.value == data.id.toString(); return elm.value == data.id.toString();
@@ -3638,8 +3487,7 @@ S2.define('select2/data/ajax',[
}, function () { }, function () {
// Attempt to detect if a request was aborted // Attempt to detect if a request was aborted
// Only works if the transport exposes a status property // Only works if the transport exposes a status property
if ('status' in $request && if ($request.status && $request.status === '0') {
($request.status === 0 || $request.status === '0')) {
return; return;
} }
@@ -3778,6 +3626,8 @@ S2.define('select2/data/tags',[
}; };
Tags.prototype._removeOldTags = function (_) { Tags.prototype._removeOldTags = function (_) {
var tag = this._lastTag;
var $options = this.$element.find('option[data-select2-tag]'); var $options = this.$element.find('option[data-select2-tag]');
$options.each(function () { $options.each(function () {
@@ -3852,7 +3702,7 @@ S2.define('select2/data/tokenizer',[
// Replace the search term if we have the search box // Replace the search term if we have the search box
if (this.$search.length) { if (this.$search.length) {
this.$search.val(tokenData.term); this.$search.val(tokenData.term);
this.$search.trigger('focus'); this.$search.focus();
} }
params.term = tokenData.term; params.term = tokenData.term;
@@ -3981,30 +3831,10 @@ S2.define('select2/data/maximumSelectionLength',[
decorated.call(this, $e, options); decorated.call(this, $e, options);
} }
MaximumSelectionLength.prototype.bind =
function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
container.on('select', function () {
self._checkIfMaximumSelected();
});
};
MaximumSelectionLength.prototype.query = MaximumSelectionLength.prototype.query =
function (decorated, params, callback) { function (decorated, params, callback) {
var self = this; var self = this;
this._checkIfMaximumSelected(function () {
decorated.call(self, params, callback);
});
};
MaximumSelectionLength.prototype._checkIfMaximumSelected =
function (_, successCallback) {
var self = this;
this.current(function (currentData) { this.current(function (currentData) {
var count = currentData != null ? currentData.length : 0; var count = currentData != null ? currentData.length : 0;
if (self.maximumSelectionLength > 0 && if (self.maximumSelectionLength > 0 &&
@@ -4017,10 +3847,7 @@ S2.define('select2/data/maximumSelectionLength',[
}); });
return; return;
} }
decorated.call(self, params, callback);
if (successCallback) {
successCallback();
}
}); });
}; };
@@ -4059,7 +3886,7 @@ S2.define('select2/dropdown',[
}; };
Dropdown.prototype.position = function ($dropdown, $container) { Dropdown.prototype.position = function ($dropdown, $container) {
// Should be implemented in subclasses // Should be implmented in subclasses
}; };
Dropdown.prototype.destroy = function () { Dropdown.prototype.destroy = function () {
@@ -4083,7 +3910,7 @@ S2.define('select2/dropdown/search',[
'<span class="select2-search select2-search--dropdown">' + '<span class="select2-search select2-search--dropdown">' +
'<input class="select2-search__field" type="search" tabindex="-1"' + '<input class="select2-search__field" type="search" tabindex="-1"' +
' autocomplete="off" autocorrect="off" autocapitalize="none"' + ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
' spellcheck="false" role="searchbox" aria-autocomplete="list" />' + ' spellcheck="false" role="textbox" />' +
'</span>' '</span>'
); );
@@ -4098,8 +3925,6 @@ S2.define('select2/dropdown/search',[
Search.prototype.bind = function (decorated, container, $container) { Search.prototype.bind = function (decorated, container, $container) {
var self = this; var self = this;
var resultsId = container.id + '-results';
decorated.call(this, container, $container); decorated.call(this, container, $container);
this.$search.on('keydown', function (evt) { this.$search.on('keydown', function (evt) {
@@ -4122,27 +3947,23 @@ S2.define('select2/dropdown/search',[
container.on('open', function () { container.on('open', function () {
self.$search.attr('tabindex', 0); self.$search.attr('tabindex', 0);
self.$search.attr('aria-controls', resultsId);
self.$search.trigger('focus'); self.$search.focus();
window.setTimeout(function () { window.setTimeout(function () {
self.$search.trigger('focus'); self.$search.focus();
}, 0); }, 0);
}); });
container.on('close', function () { container.on('close', function () {
self.$search.attr('tabindex', -1); self.$search.attr('tabindex', -1);
self.$search.removeAttr('aria-controls');
self.$search.removeAttr('aria-activedescendant');
self.$search.val(''); self.$search.val('');
self.$search.trigger('blur');
}); });
container.on('focus', function () { container.on('focus', function () {
if (!container.isOpen()) { if (!container.isOpen()) {
self.$search.trigger('focus'); self.$search.focus();
} }
}); });
@@ -4157,14 +3978,6 @@ S2.define('select2/dropdown/search',[
} }
} }
}); });
container.on('results:focus', function (params) {
if (params.data._resultId) {
self.$search.attr('aria-activedescendant', params.data._resultId);
} else {
self.$search.removeAttr('aria-activedescendant');
}
});
}; };
Search.prototype.handleSearch = function (evt) { Search.prototype.handleSearch = function (evt) {
@@ -4249,7 +4062,6 @@ S2.define('select2/dropdown/infiniteScroll',[
if (this.showLoadingMore(data)) { if (this.showLoadingMore(data)) {
this.$results.append(this.$loadingMore); this.$results.append(this.$loadingMore);
this.loadMoreIfNeeded();
} }
}; };
@@ -4268,27 +4080,25 @@ S2.define('select2/dropdown/infiniteScroll',[
self.loading = true; self.loading = true;
}); });
this.$results.on('scroll', this.loadMoreIfNeeded.bind(this)); this.$results.on('scroll', function () {
}; var isLoadMoreVisible = $.contains(
document.documentElement,
self.$loadingMore[0]
);
InfiniteScroll.prototype.loadMoreIfNeeded = function () { if (self.loading || !isLoadMoreVisible) {
var isLoadMoreVisible = $.contains( return;
document.documentElement, }
this.$loadingMore[0]
);
if (this.loading || !isLoadMoreVisible) { var currentOffset = self.$results.offset().top +
return; self.$results.outerHeight(false);
} var loadingMoreOffset = self.$loadingMore.offset().top +
self.$loadingMore.outerHeight(false);
var currentOffset = this.$results.offset().top + if (currentOffset + 50 >= loadingMoreOffset) {
this.$results.outerHeight(false); self.loadMore();
var loadingMoreOffset = this.$loadingMore.offset().top + }
this.$loadingMore.outerHeight(false); });
if (currentOffset + 50 >= loadingMoreOffset) {
this.loadMore();
}
}; };
InfiniteScroll.prototype.loadMore = function () { InfiniteScroll.prototype.loadMore = function () {
@@ -4309,7 +4119,7 @@ S2.define('select2/dropdown/infiniteScroll',[
var $option = $( var $option = $(
'<li ' + '<li ' +
'class="select2-results__option select2-results__option--load-more"' + 'class="select2-results__option select2-results__option--load-more"' +
'role="option" aria-disabled="true"></li>' 'role="treeitem" aria-disabled="true"></li>'
); );
var message = this.options.get('translations').get('loadingMore'); var message = this.options.get('translations').get('loadingMore');
@@ -4327,7 +4137,7 @@ S2.define('select2/dropdown/attachBody',[
'../utils' '../utils'
], function ($, Utils) { ], function ($, Utils) {
function AttachBody (decorated, $element, options) { function AttachBody (decorated, $element, options) {
this.$dropdownParent = $(options.get('dropdownParent') || document.body); this.$dropdownParent = options.get('dropdownParent') || $(document.body);
decorated.call(this, $element, options); decorated.call(this, $element, options);
} }
@@ -4335,14 +4145,27 @@ S2.define('select2/dropdown/attachBody',[
AttachBody.prototype.bind = function (decorated, container, $container) { AttachBody.prototype.bind = function (decorated, container, $container) {
var self = this; var self = this;
var setupResultsEvents = false;
decorated.call(this, container, $container); decorated.call(this, container, $container);
container.on('open', function () { container.on('open', function () {
self._showDropdown(); self._showDropdown();
self._attachPositioningHandler(container); self._attachPositioningHandler(container);
// Must bind after the results handlers to ensure correct sizing if (!setupResultsEvents) {
self._bindContainerResultHandlers(container); setupResultsEvents = true;
container.on('results:all', function () {
self._positionDropdown();
self._resizeDropdown();
});
container.on('results:append', function () {
self._positionDropdown();
self._resizeDropdown();
});
}
}); });
container.on('close', function () { container.on('close', function () {
@@ -4391,44 +4214,6 @@ S2.define('select2/dropdown/attachBody',[
this.$dropdownContainer.detach(); this.$dropdownContainer.detach();
}; };
AttachBody.prototype._bindContainerResultHandlers =
function (decorated, container) {
// These should only be bound once
if (this._containerResultsHandlersBound) {
return;
}
var self = this;
container.on('results:all', function () {
self._positionDropdown();
self._resizeDropdown();
});
container.on('results:append', function () {
self._positionDropdown();
self._resizeDropdown();
});
container.on('results:message', function () {
self._positionDropdown();
self._resizeDropdown();
});
container.on('select', function () {
self._positionDropdown();
self._resizeDropdown();
});
container.on('unselect', function () {
self._positionDropdown();
self._resizeDropdown();
});
this._containerResultsHandlersBound = true;
};
AttachBody.prototype._attachPositioningHandler = AttachBody.prototype._attachPositioningHandler =
function (decorated, container) { function (decorated, container) {
var self = this; var self = this;
@@ -4439,14 +4224,14 @@ S2.define('select2/dropdown/attachBody',[
var $watchers = this.$container.parents().filter(Utils.hasScroll); var $watchers = this.$container.parents().filter(Utils.hasScroll);
$watchers.each(function () { $watchers.each(function () {
Utils.StoreData(this, 'select2-scroll-position', { $(this).data('select2-scroll-position', {
x: $(this).scrollLeft(), x: $(this).scrollLeft(),
y: $(this).scrollTop() y: $(this).scrollTop()
}); });
}); });
$watchers.on(scrollEvent, function (ev) { $watchers.on(scrollEvent, function (ev) {
var position = Utils.GetData(this, 'select2-scroll-position'); var position = $(this).data('select2-scroll-position');
$(this).scrollTop(position.y); $(this).scrollTop(position.y);
}); });
@@ -4505,26 +4290,16 @@ S2.define('select2/dropdown/attachBody',[
top: container.bottom top: container.bottom
}; };
// Determine what the parent element is to use for calculating the offset // Determine what the parent element is to use for calciulating the offset
var $offsetParent = this.$dropdownParent; var $offsetParent = this.$dropdownParent;
// For statically positioned elements, we need to get the element // For statically positoned elements, we need to get the element
// that is determining the offset // that is determining the offset
if ($offsetParent.css('position') === 'static') { if ($offsetParent.css('position') === 'static') {
$offsetParent = $offsetParent.offsetParent(); $offsetParent = $offsetParent.offsetParent();
} }
var parentOffset = { var parentOffset = $offsetParent.offset();
top: 0,
left: 0
};
if (
$.contains(document.body, $offsetParent[0]) ||
$offsetParent[0].isConnected
) {
parentOffset = $offsetParent.offset();
}
css.top -= parentOffset.top; css.top -= parentOffset.top;
css.left -= parentOffset.left; css.left -= parentOffset.left;
@@ -4621,8 +4396,8 @@ S2.define('select2/dropdown/minimumResultsForSearch',[
}); });
S2.define('select2/dropdown/selectOnClose',[ S2.define('select2/dropdown/selectOnClose',[
'../utils'
], function (Utils) { ], function () {
function SelectOnClose () { } function SelectOnClose () { }
SelectOnClose.prototype.bind = function (decorated, container, $container) { SelectOnClose.prototype.bind = function (decorated, container, $container) {
@@ -4653,7 +4428,7 @@ S2.define('select2/dropdown/selectOnClose',[
return; return;
} }
var data = Utils.GetData($highlightedResults[0], 'data'); var data = $highlightedResults.data('data');
// Don't re-select already selected resulte // Don't re-select already selected resulte
if ( if (
@@ -4694,7 +4469,7 @@ S2.define('select2/dropdown/closeOnSelect',[
var originalEvent = evt.originalEvent; var originalEvent = evt.originalEvent;
// Don't close if the control key is being held // Don't close if the control key is being held
if (originalEvent && (originalEvent.ctrlKey || originalEvent.metaKey)) { if (originalEvent && originalEvent.ctrlKey) {
return; return;
} }
@@ -4748,9 +4523,6 @@ S2.define('select2/i18n/en',[],function () {
}, },
searching: function () { searching: function () {
return 'Searching…'; return 'Searching…';
},
removeAllItems: function () {
return 'Remove all items';
} }
}; };
}); });
@@ -4989,29 +4761,66 @@ S2.define('select2/defaults',[
); );
} }
// If the defaults were not previously applied from an element, it is if (typeof options.language === 'string') {
// possible for the language option to have not been resolved // Check if the language is specified with a region
options.language = this._resolveLanguage(options.language); if (options.language.indexOf('-') > 0) {
// Extract the region information if it is included
var languageParts = options.language.split('-');
var baseLanguage = languageParts[0];
// Always fall back to English since it will always be complete options.language = [options.language, baseLanguage];
options.language.push('en'); } else {
options.language = [options.language];
var uniqueLanguages = [];
for (var l = 0; l < options.language.length; l++) {
var language = options.language[l];
if (uniqueLanguages.indexOf(language) === -1) {
uniqueLanguages.push(language);
} }
} }
options.language = uniqueLanguages; if ($.isArray(options.language)) {
var languages = new Translation();
options.language.push('en');
options.translations = this._processTranslations( var languageNames = options.language;
options.language,
options.debug for (var l = 0; l < languageNames.length; l++) {
); var name = languageNames[l];
var language = {};
try {
// Try to load it with the original name
language = Translation.loadPath(name);
} catch (e) {
try {
// If we couldn't load it, check if it wasn't the full path
name = this.defaults.amdLanguageBase + name;
language = Translation.loadPath(name);
} catch (ex) {
// The translation could not be loaded at all. Sometimes this is
// because of a configuration problem, other times this can be
// because of how Select2 helps load all possible translation files.
if (options.debug && window.console && console.warn) {
console.warn(
'Select2: The language file for "' + name + '" could not be ' +
'automatically loaded. A fallback will be used instead.'
);
}
continue;
}
}
languages.extend(language);
}
options.translations = languages;
} else {
var baseTranslation = Translation.loadPath(
this.defaults.amdLanguageBase + 'en'
);
var customTranslation = new Translation(options.language);
customTranslation.extend(baseTranslation);
options.translations = customTranslation;
}
return options; return options;
}; };
@@ -5078,14 +4887,13 @@ S2.define('select2/defaults',[
debug: false, debug: false,
dropdownAutoWidth: false, dropdownAutoWidth: false,
escapeMarkup: Utils.escapeMarkup, escapeMarkup: Utils.escapeMarkup,
language: {}, language: EnglishTranslation,
matcher: matcher, matcher: matcher,
minimumInputLength: 0, minimumInputLength: 0,
maximumInputLength: 0, maximumInputLength: 0,
maximumSelectionLength: 0, maximumSelectionLength: 0,
minimumResultsForSearch: 0, minimumResultsForSearch: 0,
selectOnClose: false, selectOnClose: false,
scrollAfterSelect: false,
sorter: function (data) { sorter: function (data) {
return data; return data;
}, },
@@ -5100,103 +4908,6 @@ S2.define('select2/defaults',[
}; };
}; };
Defaults.prototype.applyFromElement = function (options, $element) {
var optionLanguage = options.language;
var defaultLanguage = this.defaults.language;
var elementLanguage = $element.prop('lang');
var parentLanguage = $element.closest('[lang]').prop('lang');
var languages = Array.prototype.concat.call(
this._resolveLanguage(elementLanguage),
this._resolveLanguage(optionLanguage),
this._resolveLanguage(defaultLanguage),
this._resolveLanguage(parentLanguage)
);
options.language = languages;
return options;
};
Defaults.prototype._resolveLanguage = function (language) {
if (!language) {
return [];
}
if ($.isEmptyObject(language)) {
return [];
}
if ($.isPlainObject(language)) {
return [language];
}
var languages;
if (!$.isArray(language)) {
languages = [language];
} else {
languages = language;
}
var resolvedLanguages = [];
for (var l = 0; l < languages.length; l++) {
resolvedLanguages.push(languages[l]);
if (typeof languages[l] === 'string' && languages[l].indexOf('-') > 0) {
// Extract the region information if it is included
var languageParts = languages[l].split('-');
var baseLanguage = languageParts[0];
resolvedLanguages.push(baseLanguage);
}
}
return resolvedLanguages;
};
Defaults.prototype._processTranslations = function (languages, debug) {
var translations = new Translation();
for (var l = 0; l < languages.length; l++) {
var languageData = new Translation();
var language = languages[l];
if (typeof language === 'string') {
try {
// Try to load it with the original name
languageData = Translation.loadPath(language);
} catch (e) {
try {
// If we couldn't load it, check if it wasn't the full path
language = this.defaults.amdLanguageBase + language;
languageData = Translation.loadPath(language);
} catch (ex) {
// The translation could not be loaded at all. Sometimes this is
// because of a configuration problem, other times this can be
// because of how Select2 helps load all possible translation files
if (debug && window.console && console.warn) {
console.warn(
'Select2: The language file for "' + language + '" could ' +
'not be automatically loaded. A fallback will be used instead.'
);
}
}
}
} else if ($.isPlainObject(language)) {
languageData = new Translation(language);
} else {
languageData = language;
}
translations.extend(languageData);
}
return translations;
};
Defaults.prototype.set = function (key, value) { Defaults.prototype.set = function (key, value) {
var camelKey = $.camelCase(key); var camelKey = $.camelCase(key);
@@ -5205,7 +4916,7 @@ S2.define('select2/defaults',[
var convertedData = Utils._convertData(data); var convertedData = Utils._convertData(data);
$.extend(true, this.defaults, convertedData); $.extend(this.defaults, convertedData);
}; };
var defaults = new Defaults(); var defaults = new Defaults();
@@ -5226,10 +4937,6 @@ S2.define('select2/options',[
this.fromElement($element); this.fromElement($element);
} }
if ($element != null) {
this.options = Defaults.applyFromElement(this.options, $element);
}
this.options = Defaults.apply(this.options); this.options = Defaults.apply(this.options);
if ($element && $element.is('input')) { if ($element && $element.is('input')) {
@@ -5253,6 +4960,14 @@ S2.define('select2/options',[
this.options.disabled = $e.prop('disabled'); this.options.disabled = $e.prop('disabled');
} }
if (this.options.language == null) {
if ($e.prop('lang')) {
this.options.language = $e.prop('lang').toLowerCase();
} else if ($e.closest('[lang]').prop('lang')) {
this.options.language = $e.closest('[lang]').prop('lang');
}
}
if (this.options.dir == null) { if (this.options.dir == null) {
if ($e.prop('dir')) { if ($e.prop('dir')) {
this.options.dir = $e.prop('dir'); this.options.dir = $e.prop('dir');
@@ -5266,7 +4981,7 @@ S2.define('select2/options',[
$e.prop('disabled', this.options.disabled); $e.prop('disabled', this.options.disabled);
$e.prop('multiple', this.options.multiple); $e.prop('multiple', this.options.multiple);
if (Utils.GetData($e[0], 'select2Tags')) { if ($e.data('select2Tags')) {
if (this.options.debug && window.console && console.warn) { if (this.options.debug && window.console && console.warn) {
console.warn( console.warn(
'Select2: The `data-select2-tags` attribute has been changed to ' + 'Select2: The `data-select2-tags` attribute has been changed to ' +
@@ -5275,11 +4990,11 @@ S2.define('select2/options',[
); );
} }
Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags')); $e.data('data', $e.data('select2Tags'));
Utils.StoreData($e[0], 'tags', true); $e.data('tags', true);
} }
if (Utils.GetData($e[0], 'ajaxUrl')) { if ($e.data('ajaxUrl')) {
if (this.options.debug && window.console && console.warn) { if (this.options.debug && window.console && console.warn) {
console.warn( console.warn(
'Select2: The `data-ajax-url` attribute has been changed to ' + 'Select2: The `data-ajax-url` attribute has been changed to ' +
@@ -5288,45 +5003,21 @@ S2.define('select2/options',[
); );
} }
$e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl')); $e.attr('ajax--url', $e.data('ajaxUrl'));
Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl')); $e.data('ajax--url', $e.data('ajaxUrl'));
} }
var dataset = {}; var dataset = {};
function upperCaseLetter(_, letter) {
return letter.toUpperCase();
}
// Pre-load all of the attributes which are prefixed with `data-`
for (var attr = 0; attr < $e[0].attributes.length; attr++) {
var attributeName = $e[0].attributes[attr].name;
var prefix = 'data-';
if (attributeName.substr(0, prefix.length) == prefix) {
// Get the contents of the attribute after `data-`
var dataName = attributeName.substring(prefix.length);
// Get the data contents from the consistent source
// This is more than likely the jQuery data helper
var dataValue = Utils.GetData($e[0], dataName);
// camelCase the attribute name to match the spec
var camelDataName = dataName.replace(/-([a-z])/g, upperCaseLetter);
// Store the data attribute contents into the dataset since
dataset[camelDataName] = dataValue;
}
}
// Prefer the element's `dataset` attribute if it exists // Prefer the element's `dataset` attribute if it exists
// jQuery 1.x does not correctly handle data attributes with multiple dashes // jQuery 1.x does not correctly handle data attributes with multiple dashes
if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
dataset = $.extend(true, {}, $e[0].dataset, dataset); dataset = $.extend(true, {}, $e[0].dataset, $e.data());
} else {
dataset = $e.data();
} }
// Prefer our internal data cache if it exists var data = $.extend(true, {}, dataset);
var data = $.extend(true, {}, Utils.GetData($e[0]), dataset);
data = Utils._convertData(data); data = Utils._convertData(data);
@@ -5363,8 +5054,8 @@ S2.define('select2/core',[
'./keys' './keys'
], function ($, Options, Utils, KEYS) { ], function ($, Options, Utils, KEYS) {
var Select2 = function ($element, options) { var Select2 = function ($element, options) {
if (Utils.GetData($element[0], 'select2') != null) { if ($element.data('select2') != null) {
Utils.GetData($element[0], 'select2').destroy(); $element.data('select2').destroy();
} }
this.$element = $element; this.$element = $element;
@@ -5380,7 +5071,7 @@ S2.define('select2/core',[
// Set up the tabindex // Set up the tabindex
var tabindex = $element.attr('tabindex') || 0; var tabindex = $element.attr('tabindex') || 0;
Utils.StoreData($element[0], 'old-tabindex', tabindex); $element.data('old-tabindex', tabindex);
$element.attr('tabindex', '-1'); $element.attr('tabindex', '-1');
// Set up containers and adapters // Set up containers and adapters
@@ -5441,9 +5132,6 @@ S2.define('select2/core',[
// Synchronize any monitored attributes // Synchronize any monitored attributes
this._syncAttributes(); this._syncAttributes();
Utils.StoreData($element[0], 'select2', this);
// Ensure backwards compatibility with $element.data('select2').
$element.data('select2', this); $element.data('select2', this);
}; };
@@ -5520,12 +5208,6 @@ S2.define('select2/core',[
return null; return null;
} }
if (method == 'computedstyle') {
var computedStyle = window.getComputedStyle($element[0]);
return computedStyle.width;
}
return method; return method;
}; };
@@ -5566,8 +5248,8 @@ S2.define('select2/core',[
if (observer != null) { if (observer != null) {
this._observer = new observer(function (mutations) { this._observer = new observer(function (mutations) {
self._syncA(); $.each(mutations, self._syncA);
self._syncS(null, mutations); $.each(mutations, self._syncS);
}); });
this._observer.observe(this.$element[0], { this._observer.observe(this.$element[0], {
attributes: true, attributes: true,
@@ -5689,7 +5371,7 @@ S2.define('select2/core',[
if (self.isOpen()) { if (self.isOpen()) {
if (key === KEYS.ESC || key === KEYS.TAB || if (key === KEYS.ESC || key === KEYS.TAB ||
(key === KEYS.UP && evt.altKey)) { (key === KEYS.UP && evt.altKey)) {
self.close(evt); self.close();
evt.preventDefault(); evt.preventDefault();
} else if (key === KEYS.ENTER) { } else if (key === KEYS.ENTER) {
@@ -5723,7 +5405,7 @@ S2.define('select2/core',[
Select2.prototype._syncAttributes = function () { Select2.prototype._syncAttributes = function () {
this.options.set('disabled', this.$element.prop('disabled')); this.options.set('disabled', this.$element.prop('disabled'));
if (this.isDisabled()) { if (this.options.get('disabled')) {
if (this.isOpen()) { if (this.isOpen()) {
this.close(); this.close();
} }
@@ -5734,7 +5416,7 @@ S2.define('select2/core',[
} }
}; };
Select2.prototype._isChangeMutation = function (evt, mutations) { Select2.prototype._syncSubtree = function (evt, mutations) {
var changed = false; var changed = false;
var self = this; var self = this;
@@ -5762,22 +5444,7 @@ S2.define('select2/core',[
} }
} else if (mutations.removedNodes && mutations.removedNodes.length > 0) { } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
changed = true; changed = true;
} else if ($.isArray(mutations)) {
$.each(mutations, function(evt, mutation) {
if (self._isChangeMutation(evt, mutation)) {
// We've found a change mutation.
// Let's escape from the loop and continue
changed = true;
return false;
}
});
} }
return changed;
};
Select2.prototype._syncSubtree = function (evt, mutations) {
var changed = this._isChangeMutation(evt, mutations);
var self = this;
// Only re-pull the data if we think there is a change // Only re-pull the data if we think there is a change
if (changed) { if (changed) {
@@ -5799,8 +5466,7 @@ S2.define('select2/core',[
'open': 'opening', 'open': 'opening',
'close': 'closing', 'close': 'closing',
'select': 'selecting', 'select': 'selecting',
'unselect': 'unselecting', 'unselect': 'unselecting'
'clear': 'clearing'
}; };
if (args === undefined) { if (args === undefined) {
@@ -5828,7 +5494,7 @@ S2.define('select2/core',[
}; };
Select2.prototype.toggleDropdown = function () { Select2.prototype.toggleDropdown = function () {
if (this.isDisabled()) { if (this.options.get('disabled')) {
return; return;
} }
@@ -5844,40 +5510,15 @@ S2.define('select2/core',[
return; return;
} }
if (this.isDisabled()) {
return;
}
this.trigger('query', {}); this.trigger('query', {});
}; };
Select2.prototype.close = function (evt) { Select2.prototype.close = function () {
if (!this.isOpen()) { if (!this.isOpen()) {
return; return;
} }
this.trigger('close', { originalEvent : evt }); this.trigger('close', {});
};
/**
* Helper method to abstract the "enabled" (not "disabled") state of this
* object.
*
* @return {true} if the instance is not disabled.
* @return {false} if the instance is disabled.
*/
Select2.prototype.isEnabled = function () {
return !this.isDisabled();
};
/**
* Helper method to abstract the "disabled" state of this object.
*
* @return {true} if the disabled option is true.
* @return {false} if the disabled option is false.
*/
Select2.prototype.isDisabled = function () {
return this.options.get('disabled');
}; };
Select2.prototype.isOpen = function () { Select2.prototype.isOpen = function () {
@@ -5954,7 +5595,7 @@ S2.define('select2/core',[
}); });
} }
this.$element.val(newVal).trigger('input').trigger('change'); this.$element.val(newVal).trigger('change');
}; };
Select2.prototype.destroy = function () { Select2.prototype.destroy = function () {
@@ -5980,12 +5621,10 @@ S2.define('select2/core',[
this._syncS = null; this._syncS = null;
this.$element.off('.select2'); this.$element.off('.select2');
this.$element.attr('tabindex', this.$element.attr('tabindex', this.$element.data('old-tabindex'));
Utils.GetData(this.$element[0], 'old-tabindex'));
this.$element.removeClass('select2-hidden-accessible'); this.$element.removeClass('select2-hidden-accessible');
this.$element.attr('aria-hidden', 'false'); this.$element.attr('aria-hidden', 'false');
Utils.RemoveData(this.$element[0]);
this.$element.removeData('select2'); this.$element.removeData('select2');
this.dataAdapter.destroy(); this.dataAdapter.destroy();
@@ -6013,7 +5652,7 @@ S2.define('select2/core',[
this.$container.addClass('select2-container--' + this.options.get('theme')); this.$container.addClass('select2-container--' + this.options.get('theme'));
Utils.StoreData($container[0], 'element', this.$element); $container.data('element', this.$element);
return $container; return $container;
}; };
@@ -6223,9 +5862,8 @@ S2.define('select2/compat/initSelection',[
}); });
S2.define('select2/compat/inputData',[ S2.define('select2/compat/inputData',[
'jquery', 'jquery'
'../utils' ], function ($) {
], function ($, Utils) {
function InputData (decorated, $element, options) { function InputData (decorated, $element, options) {
this._currentData = []; this._currentData = [];
this._valueSeparator = options.get('valueSeparator') || ','; this._valueSeparator = options.get('valueSeparator') || ',';
@@ -6289,13 +5927,13 @@ S2.define('select2/compat/inputData',[
}); });
this.$element.val(data.id); this.$element.val(data.id);
this.$element.trigger('input').trigger('change'); this.$element.trigger('change');
} else { } else {
var value = this.$element.val(); var value = this.$element.val();
value += this._valueSeparator + data.id; value += this._valueSeparator + data.id;
this.$element.val(value); this.$element.val(value);
this.$element.trigger('input').trigger('change'); this.$element.trigger('change');
} }
}; };
@@ -6318,7 +5956,7 @@ S2.define('select2/compat/inputData',[
} }
self.$element.val(values.join(self._valueSeparator)); self.$element.val(values.join(self._valueSeparator));
self.$element.trigger('input').trigger('change'); self.$element.trigger('change');
}); });
}; };
@@ -6342,7 +5980,7 @@ S2.define('select2/compat/inputData',[
InputData.prototype.addOptions = function (_, $options) { InputData.prototype.addOptions = function (_, $options) {
var options = $.map($options, function ($option) { var options = $.map($options, function ($option) {
return Utils.GetData($option[0], 'data'); return $.data($option[0], 'data');
}); });
this._currentData.push.apply(this._currentData, options); this._currentData.push.apply(this._currentData, options);
@@ -6745,9 +6383,8 @@ S2.define('jquery.select2',[
'jquery-mousewheel', 'jquery-mousewheel',
'./select2/core', './select2/core',
'./select2/defaults', './select2/defaults'
'./select2/utils' ], function ($, _, Select2, Defaults) {
], function ($, _, Select2, Defaults, Utils) {
if ($.fn.select2 == null) { if ($.fn.select2 == null) {
// All methods that should return the element // All methods that should return the element
var thisMethods = ['open', 'close', 'destroy']; var thisMethods = ['open', 'close', 'destroy'];
@@ -6768,7 +6405,7 @@ S2.define('jquery.select2',[
var args = Array.prototype.slice.call(arguments, 1); var args = Array.prototype.slice.call(arguments, 1);
this.each(function () { this.each(function () {
var instance = Utils.GetData(this, 'select2'); var instance = $(this).data('select2');
if (instance == null && window.console && console.error) { if (instance == null && window.console && console.error) {
console.error( console.error(
+1 -2
View File
File diff suppressed because one or more lines are too long
+214 -576
View File
@@ -1,11 +1,11 @@
/*! /*!
* Select2 4.0.13 * Select2 4.0.5
* https://select2.github.io * https://select2.github.io
* *
* Released under the MIT license * Released under the MIT license
* https://github.com/select2/select2/blob/master/LICENSE.md * https://github.com/select2/select2/blob/master/LICENSE.md
*/ */
;(function (factory) { (function (factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define(['jquery'], factory); define(['jquery'], factory);
@@ -574,10 +574,10 @@ S2.define('select2/utils',[
DecoratedClass.prototype = new ctr(); DecoratedClass.prototype = new ctr();
for (var m = 0; m < superMethods.length; m++) { for (var m = 0; m < superMethods.length; m++) {
var superMethod = superMethods[m]; var superMethod = superMethods[m];
DecoratedClass.prototype[superMethod] = DecoratedClass.prototype[superMethod] =
SuperClass.prototype[superMethod]; SuperClass.prototype[superMethod];
} }
var calledMethod = function (methodName) { var calledMethod = function (methodName) {
@@ -772,70 +772,6 @@ S2.define('select2/utils',[
$element.append($nodes); $element.append($nodes);
}; };
// Cache objects in Utils.__cache instead of $.data (see #4346)
Utils.__cache = {};
var id = 0;
Utils.GetUniqueElementId = function (element) {
// Get a unique element Id. If element has no id,
// creates a new unique number, stores it in the id
// attribute and returns the new id.
// If an id already exists, it simply returns it.
var select2Id = element.getAttribute('data-select2-id');
if (select2Id == null) {
// If element has id, use it.
if (element.id) {
select2Id = element.id;
element.setAttribute('data-select2-id', select2Id);
} else {
element.setAttribute('data-select2-id', ++id);
select2Id = id.toString();
}
}
return select2Id;
};
Utils.StoreData = function (element, name, value) {
// Stores an item in the cache for a specified element.
// name is the cache key.
var id = Utils.GetUniqueElementId(element);
if (!Utils.__cache[id]) {
Utils.__cache[id] = {};
}
Utils.__cache[id][name] = value;
};
Utils.GetData = function (element, name) {
// Retrieves a value from the cache by its key (name)
// name is optional. If no name specified, return
// all cache items for the specified element.
// and for a specified element.
var id = Utils.GetUniqueElementId(element);
if (name) {
if (Utils.__cache[id]) {
if (Utils.__cache[id][name] != null) {
return Utils.__cache[id][name];
}
return $(element).data(name); // Fallback to HTML5 data attribs.
}
return $(element).data(name); // Fallback to HTML5 data attribs.
} else {
return Utils.__cache[id];
}
};
Utils.RemoveData = function (element) {
// Removes all cached items for a specified element.
var id = Utils.GetUniqueElementId(element);
if (Utils.__cache[id] != null) {
delete Utils.__cache[id];
}
element.removeAttribute('data-select2-id');
};
return Utils; return Utils;
}); });
@@ -855,7 +791,7 @@ S2.define('select2/results',[
Results.prototype.render = function () { Results.prototype.render = function () {
var $results = $( var $results = $(
'<ul class="select2-results__options" role="listbox"></ul>' '<ul class="select2-results__options" role="tree"></ul>'
); );
if (this.options.get('multiple')) { if (this.options.get('multiple')) {
@@ -878,7 +814,7 @@ S2.define('select2/results',[
this.hideLoading(); this.hideLoading();
var $message = $( var $message = $(
'<li role="alert" aria-live="assertive"' + '<li role="treeitem" aria-live="assertive"' +
' class="select2-results__option"></li>' ' class="select2-results__option"></li>'
); );
@@ -971,7 +907,7 @@ S2.define('select2/results',[
$options.each(function () { $options.each(function () {
var $option = $(this); var $option = $(this);
var item = Utils.GetData(this, 'data'); var item = $.data(this, 'data');
// id needs to be converted to a string when comparing // id needs to be converted to a string when comparing
var id = '' + item.id; var id = '' + item.id;
@@ -1012,16 +948,11 @@ S2.define('select2/results',[
option.className = 'select2-results__option'; option.className = 'select2-results__option';
var attrs = { var attrs = {
'role': 'option', 'role': 'treeitem',
'aria-selected': 'false' 'aria-selected': 'false'
}; };
var matches = window.Element.prototype.matches || if (data.disabled) {
window.Element.prototype.msMatchesSelector ||
window.Element.prototype.webkitMatchesSelector;
if ((data.element != null && matches.call(data.element, ':disabled')) ||
(data.element == null && data.disabled)) {
delete attrs['aria-selected']; delete attrs['aria-selected'];
attrs['aria-disabled'] = 'true'; attrs['aria-disabled'] = 'true';
} }
@@ -1081,7 +1012,7 @@ S2.define('select2/results',[
this.template(data, option); this.template(data, option);
} }
Utils.StoreData(option, 'data', data); $.data(option, 'data', data);
return option; return option;
}; };
@@ -1122,10 +1053,7 @@ S2.define('select2/results',[
} }
self.setClasses(); self.setClasses();
self.highlightFirstItem();
if (self.options.get('scrollAfterSelect')) {
self.highlightFirstItem();
}
}); });
container.on('unselect', function () { container.on('unselect', function () {
@@ -1134,10 +1062,7 @@ S2.define('select2/results',[
} }
self.setClasses(); self.setClasses();
self.highlightFirstItem();
if (self.options.get('scrollAfterSelect')) {
self.highlightFirstItem();
}
}); });
container.on('open', function () { container.on('open', function () {
@@ -1173,7 +1098,7 @@ S2.define('select2/results',[
return; return;
} }
var data = Utils.GetData($highlighted[0], 'data'); var data = $highlighted.data('data');
if ($highlighted.attr('aria-selected') == 'true') { if ($highlighted.attr('aria-selected') == 'true') {
self.trigger('close', {}); self.trigger('close', {});
@@ -1191,9 +1116,8 @@ S2.define('select2/results',[
var currentIndex = $options.index($highlighted); var currentIndex = $options.index($highlighted);
// If we are already at the top, don't move further // If we are already at te top, don't move further
// If no options, currentIndex will be -1 if (currentIndex === 0) {
if (currentIndex <= 0) {
return; return;
} }
@@ -1286,7 +1210,7 @@ S2.define('select2/results',[
function (evt) { function (evt) {
var $this = $(this); var $this = $(this);
var data = Utils.GetData(this, 'data'); var data = $this.data('data');
if ($this.attr('aria-selected') === 'true') { if ($this.attr('aria-selected') === 'true') {
if (self.options.get('multiple')) { if (self.options.get('multiple')) {
@@ -1309,7 +1233,7 @@ S2.define('select2/results',[
this.$results.on('mouseenter', '.select2-results__option[aria-selected]', this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
function (evt) { function (evt) {
var data = Utils.GetData(this, 'data'); var data = $(this).data('data');
self.getHighlightedResults() self.getHighlightedResults()
.removeClass('select2-results__option--highlighted'); .removeClass('select2-results__option--highlighted');
@@ -1424,15 +1348,14 @@ S2.define('select2/selection/base',[
this._tabindex = 0; this._tabindex = 0;
if (Utils.GetData(this.$element[0], 'old-tabindex') != null) { if (this.$element.data('old-tabindex') != null) {
this._tabindex = Utils.GetData(this.$element[0], 'old-tabindex'); this._tabindex = this.$element.data('old-tabindex');
} else if (this.$element.attr('tabindex') != null) { } else if (this.$element.attr('tabindex') != null) {
this._tabindex = this.$element.attr('tabindex'); this._tabindex = this.$element.attr('tabindex');
} }
$selection.attr('title', this.$element.attr('title')); $selection.attr('title', this.$element.attr('title'));
$selection.attr('tabindex', this._tabindex); $selection.attr('tabindex', this._tabindex);
$selection.attr('aria-disabled', 'false');
this.$selection = $selection; this.$selection = $selection;
@@ -1442,6 +1365,7 @@ S2.define('select2/selection/base',[
BaseSelection.prototype.bind = function (container, $container) { BaseSelection.prototype.bind = function (container, $container) {
var self = this; var self = this;
var id = container.id + '-container';
var resultsId = container.id + '-results'; var resultsId = container.id + '-results';
this.container = container; this.container = container;
@@ -1484,19 +1408,17 @@ S2.define('select2/selection/base',[
self.$selection.removeAttr('aria-activedescendant'); self.$selection.removeAttr('aria-activedescendant');
self.$selection.removeAttr('aria-owns'); self.$selection.removeAttr('aria-owns');
self.$selection.trigger('focus'); self.$selection.focus();
self._detachCloseHandler(container); self._detachCloseHandler(container);
}); });
container.on('enable', function () { container.on('enable', function () {
self.$selection.attr('tabindex', self._tabindex); self.$selection.attr('tabindex', self._tabindex);
self.$selection.attr('aria-disabled', 'false');
}); });
container.on('disable', function () { container.on('disable', function () {
self.$selection.attr('tabindex', '-1'); self.$selection.attr('tabindex', '-1');
self.$selection.attr('aria-disabled', 'true');
}); });
}; };
@@ -1519,6 +1441,7 @@ S2.define('select2/selection/base',[
}; };
BaseSelection.prototype._attachCloseHandler = function (container) { BaseSelection.prototype._attachCloseHandler = function (container) {
var self = this;
$(document.body).on('mousedown.select2.' + container.id, function (e) { $(document.body).on('mousedown.select2.' + container.id, function (e) {
var $target = $(e.target); var $target = $(e.target);
@@ -1528,11 +1451,13 @@ S2.define('select2/selection/base',[
var $all = $('.select2.select2-container--open'); var $all = $('.select2.select2-container--open');
$all.each(function () { $all.each(function () {
var $this = $(this);
if (this == $select[0]) { if (this == $select[0]) {
return; return;
} }
var $element = Utils.GetData(this, 'element'); var $element = $this.data('element');
$element.select2('close'); $element.select2('close');
}); });
@@ -1556,27 +1481,6 @@ S2.define('select2/selection/base',[
throw new Error('The `update` method must be defined in child classes.'); throw new Error('The `update` method must be defined in child classes.');
}; };
/**
* Helper method to abstract the "enabled" (not "disabled") state of this
* object.
*
* @return {true} if the instance is not disabled.
* @return {false} if the instance is disabled.
*/
BaseSelection.prototype.isEnabled = function () {
return !this.isDisabled();
};
/**
* Helper method to abstract the "disabled" state of this object.
*
* @return {true} if the disabled option is true.
* @return {false} if the disabled option is false.
*/
BaseSelection.prototype.isDisabled = function () {
return this.options.get('disabled');
};
return BaseSelection; return BaseSelection;
}); });
@@ -1614,10 +1518,7 @@ S2.define('select2/selection/single',[
var id = container.id + '-container'; var id = container.id + '-container';
this.$selection.find('.select2-selection__rendered') this.$selection.find('.select2-selection__rendered').attr('id', id);
.attr('id', id)
.attr('role', 'textbox')
.attr('aria-readonly', 'true');
this.$selection.attr('aria-labelledby', id); this.$selection.attr('aria-labelledby', id);
this.$selection.on('mousedown', function (evt) { this.$selection.on('mousedown', function (evt) {
@@ -1641,15 +1542,17 @@ S2.define('select2/selection/single',[
container.on('focus', function (evt) { container.on('focus', function (evt) {
if (!container.isOpen()) { if (!container.isOpen()) {
self.$selection.trigger('focus'); self.$selection.focus();
} }
}); });
container.on('selection:update', function (params) {
self.update(params.data);
});
}; };
SingleSelection.prototype.clear = function () { SingleSelection.prototype.clear = function () {
var $rendered = this.$selection.find('.select2-selection__rendered'); this.$selection.find('.select2-selection__rendered').empty();
$rendered.empty();
$rendered.removeAttr('title'); // clear tooltip on empty
}; };
SingleSelection.prototype.display = function (data, container) { SingleSelection.prototype.display = function (data, container) {
@@ -1675,14 +1578,7 @@ S2.define('select2/selection/single',[
var formatted = this.display(selection, $rendered); var formatted = this.display(selection, $rendered);
$rendered.empty().append(formatted); $rendered.empty().append(formatted);
$rendered.prop('title', selection.title || selection.text);
var title = selection.title || selection.text;
if (title) {
$rendered.attr('title', title);
} else {
$rendered.removeAttr('title');
}
}; };
return SingleSelection; return SingleSelection;
@@ -1727,14 +1623,14 @@ S2.define('select2/selection/multiple',[
'.select2-selection__choice__remove', '.select2-selection__choice__remove',
function (evt) { function (evt) {
// Ignore the event if it is disabled // Ignore the event if it is disabled
if (self.isDisabled()) { if (self.options.get('disabled')) {
return; return;
} }
var $remove = $(this); var $remove = $(this);
var $selection = $remove.parent(); var $selection = $remove.parent();
var data = Utils.GetData($selection[0], 'data'); var data = $selection.data('data');
self.trigger('unselect', { self.trigger('unselect', {
originalEvent: evt, originalEvent: evt,
@@ -1745,9 +1641,7 @@ S2.define('select2/selection/multiple',[
}; };
MultipleSelection.prototype.clear = function () { MultipleSelection.prototype.clear = function () {
var $rendered = this.$selection.find('.select2-selection__rendered'); this.$selection.find('.select2-selection__rendered').empty();
$rendered.empty();
$rendered.removeAttr('title');
}; };
MultipleSelection.prototype.display = function (data, container) { MultipleSelection.prototype.display = function (data, container) {
@@ -1785,14 +1679,9 @@ S2.define('select2/selection/multiple',[
var formatted = this.display(selection, $selection); var formatted = this.display(selection, $selection);
$selection.append(formatted); $selection.append(formatted);
$selection.prop('title', selection.title || selection.text);
var title = selection.title || selection.text; $selection.data('data', selection);
if (title) {
$selection.attr('title', title);
}
Utils.StoreData($selection[0], 'data', selection);
$selections.push($selection); $selections.push($selection);
} }
@@ -1857,9 +1746,8 @@ S2.define('select2/selection/placeholder',[
S2.define('select2/selection/allowClear',[ S2.define('select2/selection/allowClear',[
'jquery', 'jquery',
'../keys', '../keys'
'../utils' ], function ($, KEYS) {
], function ($, KEYS, Utils) {
function AllowClear () { } function AllowClear () { }
AllowClear.prototype.bind = function (decorated, container, $container) { AllowClear.prototype.bind = function (decorated, container, $container) {
@@ -1888,7 +1776,7 @@ S2.define('select2/selection/allowClear',[
AllowClear.prototype._handleClear = function (_, evt) { AllowClear.prototype._handleClear = function (_, evt) {
// Ignore the event if it is disabled // Ignore the event if it is disabled
if (this.isDisabled()) { if (this.options.get('disabled')) {
return; return;
} }
@@ -1901,22 +1789,10 @@ S2.define('select2/selection/allowClear',[
evt.stopPropagation(); evt.stopPropagation();
var data = Utils.GetData($clear[0], 'data'); var data = $clear.data('data');
var previousVal = this.$element.val();
this.$element.val(this.placeholder.id);
var unselectData = {
data: data
};
this.trigger('clear', unselectData);
if (unselectData.prevented) {
this.$element.val(previousVal);
return;
}
for (var d = 0; d < data.length; d++) { for (var d = 0; d < data.length; d++) {
unselectData = { var unselectData = {
data: data[d] data: data[d]
}; };
@@ -1926,12 +1802,11 @@ S2.define('select2/selection/allowClear',[
// If the event was prevented, don't clear it out. // If the event was prevented, don't clear it out.
if (unselectData.prevented) { if (unselectData.prevented) {
this.$element.val(previousVal);
return; return;
} }
} }
this.$element.trigger('input').trigger('change'); this.$element.val(this.placeholder.id).trigger('change');
this.trigger('toggle', {}); this.trigger('toggle', {});
}; };
@@ -1954,14 +1829,12 @@ S2.define('select2/selection/allowClear',[
return; return;
} }
var removeAll = this.options.get('translations').get('removeAllItems');
var $remove = $( var $remove = $(
'<span class="select2-selection__clear" title="' + removeAll() +'">' + '<span class="select2-selection__clear">' +
'&times;' + '&times;' +
'</span>' '</span>'
); );
Utils.StoreData($remove[0], 'data', data); $remove.data('data', data);
this.$selection.find('.select2-selection__rendered').prepend($remove); this.$selection.find('.select2-selection__rendered').prepend($remove);
}; };
@@ -1983,7 +1856,7 @@ S2.define('select2/selection/search',[
'<li class="select2-search select2-search--inline">' + '<li class="select2-search select2-search--inline">' +
'<input class="select2-search__field" type="search" tabindex="-1"' + '<input class="select2-search__field" type="search" tabindex="-1"' +
' autocomplete="off" autocorrect="off" autocapitalize="none"' + ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
' spellcheck="false" role="searchbox" aria-autocomplete="list" />' + ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
'</li>' '</li>'
); );
@@ -2000,18 +1873,14 @@ S2.define('select2/selection/search',[
Search.prototype.bind = function (decorated, container, $container) { Search.prototype.bind = function (decorated, container, $container) {
var self = this; var self = this;
var resultsId = container.id + '-results';
decorated.call(this, container, $container); decorated.call(this, container, $container);
container.on('open', function () { container.on('open', function () {
self.$search.attr('aria-controls', resultsId);
self.$search.trigger('focus'); self.$search.trigger('focus');
}); });
container.on('close', function () { container.on('close', function () {
self.$search.val(''); self.$search.val('');
self.$search.removeAttr('aria-controls');
self.$search.removeAttr('aria-activedescendant'); self.$search.removeAttr('aria-activedescendant');
self.$search.trigger('focus'); self.$search.trigger('focus');
}); });
@@ -2031,11 +1900,7 @@ S2.define('select2/selection/search',[
}); });
container.on('results:focus', function (params) { container.on('results:focus', function (params) {
if (params.data._resultId) { self.$search.attr('aria-activedescendant', params.id);
self.$search.attr('aria-activedescendant', params.data._resultId);
} else {
self.$search.removeAttr('aria-activedescendant');
}
}); });
this.$selection.on('focusin', '.select2-search--inline', function (evt) { this.$selection.on('focusin', '.select2-search--inline', function (evt) {
@@ -2060,7 +1925,7 @@ S2.define('select2/selection/search',[
.prev('.select2-selection__choice'); .prev('.select2-selection__choice');
if ($previousChoice.length > 0) { if ($previousChoice.length > 0) {
var item = Utils.GetData($previousChoice[0], 'data'); var item = $previousChoice.data('data');
self.searchRemoveChoice(item); self.searchRemoveChoice(item);
@@ -2069,12 +1934,6 @@ S2.define('select2/selection/search',[
} }
}); });
this.$selection.on('click', '.select2-search--inline', function (evt) {
if (self.$search.val()) {
evt.stopPropagation();
}
});
// Try to detect the IE version should the `documentMode` property that // Try to detect the IE version should the `documentMode` property that
// is stored on the document. This is only implemented in IE and is // is stored on the document. This is only implemented in IE and is
// slightly cleaner than doing a user agent check. // slightly cleaner than doing a user agent check.
@@ -2160,7 +2019,7 @@ S2.define('select2/selection/search',[
this.resizeSearch(); this.resizeSearch();
if (searchHadFocus) { if (searchHadFocus) {
this.$search.trigger('focus'); this.$search.focus();
} }
}; };
@@ -2193,7 +2052,7 @@ S2.define('select2/selection/search',[
var width = ''; var width = '';
if (this.$search.attr('placeholder') !== '') { if (this.$search.attr('placeholder') !== '') {
width = this.$selection.find('.select2-selection__rendered').width(); width = this.$selection.find('.select2-selection__rendered').innerWidth();
} else { } else {
var minimumWidth = this.$search.val().length + 1; var minimumWidth = this.$search.val().length + 1;
@@ -2217,13 +2076,10 @@ S2.define('select2/selection/eventRelay',[
'open', 'opening', 'open', 'opening',
'close', 'closing', 'close', 'closing',
'select', 'selecting', 'select', 'selecting',
'unselect', 'unselecting', 'unselect', 'unselecting'
'clear', 'clearing'
]; ];
var preventableEvents = [ var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
'opening', 'closing', 'selecting', 'unselecting', 'clearing'
];
decorated.call(this, container, $container); decorated.call(this, container, $container);
@@ -2556,7 +2412,6 @@ S2.define('select2/diacritics',[
'\u019F': 'O', '\u019F': 'O',
'\uA74A': 'O', '\uA74A': 'O',
'\uA74C': 'O', '\uA74C': 'O',
'\u0152': 'OE',
'\u01A2': 'OI', '\u01A2': 'OI',
'\uA74E': 'OO', '\uA74E': 'OO',
'\u0222': 'OU', '\u0222': 'OU',
@@ -2966,7 +2821,6 @@ S2.define('select2/diacritics',[
'\uA74B': 'o', '\uA74B': 'o',
'\uA74D': 'o', '\uA74D': 'o',
'\u0275': 'o', '\u0275': 'o',
'\u0153': 'oe',
'\u01A3': 'oi', '\u01A3': 'oi',
'\u0223': 'ou', '\u0223': 'ou',
'\uA74F': 'oo', '\uA74F': 'oo',
@@ -3135,9 +2989,8 @@ S2.define('select2/diacritics',[
'\u03CD': '\u03C5', '\u03CD': '\u03C5',
'\u03CB': '\u03C5', '\u03CB': '\u03C5',
'\u03B0': '\u03C5', '\u03B0': '\u03C5',
'\u03CE': '\u03C9', '\u03C9': '\u03C9',
'\u03C2': '\u03C3', '\u03C2': '\u03C3'
'\u2019': '\''
}; };
return diacritics; return diacritics;
@@ -3222,7 +3075,7 @@ S2.define('select2/data/select',[
if ($(data.element).is('option')) { if ($(data.element).is('option')) {
data.element.selected = true; data.element.selected = true;
this.$element.trigger('input').trigger('change'); this.$element.trigger('change');
return; return;
} }
@@ -3243,13 +3096,13 @@ S2.define('select2/data/select',[
} }
self.$element.val(val); self.$element.val(val);
self.$element.trigger('input').trigger('change'); self.$element.trigger('change');
}); });
} else { } else {
var val = data.id; var val = data.id;
this.$element.val(val); this.$element.val(val);
this.$element.trigger('input').trigger('change'); this.$element.trigger('change');
} }
}; };
@@ -3265,7 +3118,7 @@ S2.define('select2/data/select',[
if ($(data.element).is('option')) { if ($(data.element).is('option')) {
data.element.selected = false; data.element.selected = false;
this.$element.trigger('input').trigger('change'); this.$element.trigger('change');
return; return;
} }
@@ -3283,7 +3136,7 @@ S2.define('select2/data/select',[
self.$element.val(val); self.$element.val(val);
self.$element.trigger('input').trigger('change'); self.$element.trigger('change');
}); });
}; };
@@ -3305,7 +3158,7 @@ S2.define('select2/data/select',[
// Remove anything added to child elements // Remove anything added to child elements
this.$element.find('*').each(function () { this.$element.find('*').each(function () {
// Remove any custom data set by Select2 // Remove any custom data set by Select2
Utils.RemoveData(this); $.removeData(this, 'data');
}); });
}; };
@@ -3378,7 +3231,7 @@ S2.define('select2/data/select',[
normalizedData.element = option; normalizedData.element = option;
// Override the option's data with the combined data // Override the option's data with the combined data
Utils.StoreData(option, 'data', normalizedData); $.data(option, 'data', normalizedData);
return $option; return $option;
}; };
@@ -3386,7 +3239,7 @@ S2.define('select2/data/select',[
SelectAdapter.prototype.item = function ($option) { SelectAdapter.prototype.item = function ($option) {
var data = {}; var data = {};
data = Utils.GetData($option[0], 'data'); data = $.data($option[0], 'data');
if (data != null) { if (data != null) {
return data; return data;
@@ -3424,13 +3277,13 @@ S2.define('select2/data/select',[
data = this._normalizeItem(data); data = this._normalizeItem(data);
data.element = $option[0]; data.element = $option[0];
Utils.StoreData($option[0], 'data', data); $.data($option[0], 'data', data);
return data; return data;
}; };
SelectAdapter.prototype._normalizeItem = function (item) { SelectAdapter.prototype._normalizeItem = function (item) {
if (item !== Object(item)) { if (!$.isPlainObject(item)) {
item = { item = {
id: item, id: item,
text: item text: item
@@ -3476,19 +3329,15 @@ S2.define('select2/data/array',[
'jquery' 'jquery'
], function (SelectAdapter, Utils, $) { ], function (SelectAdapter, Utils, $) {
function ArrayAdapter ($element, options) { function ArrayAdapter ($element, options) {
this._dataToConvert = options.get('data') || []; var data = options.get('data') || [];
ArrayAdapter.__super__.constructor.call(this, $element, options); ArrayAdapter.__super__.constructor.call(this, $element, options);
this.addOptions(this.convertToOptions(data));
} }
Utils.Extend(ArrayAdapter, SelectAdapter); Utils.Extend(ArrayAdapter, SelectAdapter);
ArrayAdapter.prototype.bind = function (container, $container) {
ArrayAdapter.__super__.bind.call(this, container, $container);
this.addOptions(this.convertToOptions(this._dataToConvert));
};
ArrayAdapter.prototype.select = function (data) { ArrayAdapter.prototype.select = function (data) {
var $option = this.$element.find('option').filter(function (i, elm) { var $option = this.$element.find('option').filter(function (i, elm) {
return elm.value == data.id.toString(); return elm.value == data.id.toString();
@@ -3638,8 +3487,7 @@ S2.define('select2/data/ajax',[
}, function () { }, function () {
// Attempt to detect if a request was aborted // Attempt to detect if a request was aborted
// Only works if the transport exposes a status property // Only works if the transport exposes a status property
if ('status' in $request && if ($request.status && $request.status === '0') {
($request.status === 0 || $request.status === '0')) {
return; return;
} }
@@ -3778,6 +3626,8 @@ S2.define('select2/data/tags',[
}; };
Tags.prototype._removeOldTags = function (_) { Tags.prototype._removeOldTags = function (_) {
var tag = this._lastTag;
var $options = this.$element.find('option[data-select2-tag]'); var $options = this.$element.find('option[data-select2-tag]');
$options.each(function () { $options.each(function () {
@@ -3852,7 +3702,7 @@ S2.define('select2/data/tokenizer',[
// Replace the search term if we have the search box // Replace the search term if we have the search box
if (this.$search.length) { if (this.$search.length) {
this.$search.val(tokenData.term); this.$search.val(tokenData.term);
this.$search.trigger('focus'); this.$search.focus();
} }
params.term = tokenData.term; params.term = tokenData.term;
@@ -3981,30 +3831,10 @@ S2.define('select2/data/maximumSelectionLength',[
decorated.call(this, $e, options); decorated.call(this, $e, options);
} }
MaximumSelectionLength.prototype.bind =
function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
container.on('select', function () {
self._checkIfMaximumSelected();
});
};
MaximumSelectionLength.prototype.query = MaximumSelectionLength.prototype.query =
function (decorated, params, callback) { function (decorated, params, callback) {
var self = this; var self = this;
this._checkIfMaximumSelected(function () {
decorated.call(self, params, callback);
});
};
MaximumSelectionLength.prototype._checkIfMaximumSelected =
function (_, successCallback) {
var self = this;
this.current(function (currentData) { this.current(function (currentData) {
var count = currentData != null ? currentData.length : 0; var count = currentData != null ? currentData.length : 0;
if (self.maximumSelectionLength > 0 && if (self.maximumSelectionLength > 0 &&
@@ -4017,10 +3847,7 @@ S2.define('select2/data/maximumSelectionLength',[
}); });
return; return;
} }
decorated.call(self, params, callback);
if (successCallback) {
successCallback();
}
}); });
}; };
@@ -4059,7 +3886,7 @@ S2.define('select2/dropdown',[
}; };
Dropdown.prototype.position = function ($dropdown, $container) { Dropdown.prototype.position = function ($dropdown, $container) {
// Should be implemented in subclasses // Should be implmented in subclasses
}; };
Dropdown.prototype.destroy = function () { Dropdown.prototype.destroy = function () {
@@ -4083,7 +3910,7 @@ S2.define('select2/dropdown/search',[
'<span class="select2-search select2-search--dropdown">' + '<span class="select2-search select2-search--dropdown">' +
'<input class="select2-search__field" type="search" tabindex="-1"' + '<input class="select2-search__field" type="search" tabindex="-1"' +
' autocomplete="off" autocorrect="off" autocapitalize="none"' + ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
' spellcheck="false" role="searchbox" aria-autocomplete="list" />' + ' spellcheck="false" role="textbox" />' +
'</span>' '</span>'
); );
@@ -4098,8 +3925,6 @@ S2.define('select2/dropdown/search',[
Search.prototype.bind = function (decorated, container, $container) { Search.prototype.bind = function (decorated, container, $container) {
var self = this; var self = this;
var resultsId = container.id + '-results';
decorated.call(this, container, $container); decorated.call(this, container, $container);
this.$search.on('keydown', function (evt) { this.$search.on('keydown', function (evt) {
@@ -4122,27 +3947,23 @@ S2.define('select2/dropdown/search',[
container.on('open', function () { container.on('open', function () {
self.$search.attr('tabindex', 0); self.$search.attr('tabindex', 0);
self.$search.attr('aria-controls', resultsId);
self.$search.trigger('focus'); self.$search.focus();
window.setTimeout(function () { window.setTimeout(function () {
self.$search.trigger('focus'); self.$search.focus();
}, 0); }, 0);
}); });
container.on('close', function () { container.on('close', function () {
self.$search.attr('tabindex', -1); self.$search.attr('tabindex', -1);
self.$search.removeAttr('aria-controls');
self.$search.removeAttr('aria-activedescendant');
self.$search.val(''); self.$search.val('');
self.$search.trigger('blur');
}); });
container.on('focus', function () { container.on('focus', function () {
if (!container.isOpen()) { if (!container.isOpen()) {
self.$search.trigger('focus'); self.$search.focus();
} }
}); });
@@ -4157,14 +3978,6 @@ S2.define('select2/dropdown/search',[
} }
} }
}); });
container.on('results:focus', function (params) {
if (params.data._resultId) {
self.$search.attr('aria-activedescendant', params.data._resultId);
} else {
self.$search.removeAttr('aria-activedescendant');
}
});
}; };
Search.prototype.handleSearch = function (evt) { Search.prototype.handleSearch = function (evt) {
@@ -4249,7 +4062,6 @@ S2.define('select2/dropdown/infiniteScroll',[
if (this.showLoadingMore(data)) { if (this.showLoadingMore(data)) {
this.$results.append(this.$loadingMore); this.$results.append(this.$loadingMore);
this.loadMoreIfNeeded();
} }
}; };
@@ -4268,27 +4080,25 @@ S2.define('select2/dropdown/infiniteScroll',[
self.loading = true; self.loading = true;
}); });
this.$results.on('scroll', this.loadMoreIfNeeded.bind(this)); this.$results.on('scroll', function () {
}; var isLoadMoreVisible = $.contains(
document.documentElement,
self.$loadingMore[0]
);
InfiniteScroll.prototype.loadMoreIfNeeded = function () { if (self.loading || !isLoadMoreVisible) {
var isLoadMoreVisible = $.contains( return;
document.documentElement, }
this.$loadingMore[0]
);
if (this.loading || !isLoadMoreVisible) { var currentOffset = self.$results.offset().top +
return; self.$results.outerHeight(false);
} var loadingMoreOffset = self.$loadingMore.offset().top +
self.$loadingMore.outerHeight(false);
var currentOffset = this.$results.offset().top + if (currentOffset + 50 >= loadingMoreOffset) {
this.$results.outerHeight(false); self.loadMore();
var loadingMoreOffset = this.$loadingMore.offset().top + }
this.$loadingMore.outerHeight(false); });
if (currentOffset + 50 >= loadingMoreOffset) {
this.loadMore();
}
}; };
InfiniteScroll.prototype.loadMore = function () { InfiniteScroll.prototype.loadMore = function () {
@@ -4309,7 +4119,7 @@ S2.define('select2/dropdown/infiniteScroll',[
var $option = $( var $option = $(
'<li ' + '<li ' +
'class="select2-results__option select2-results__option--load-more"' + 'class="select2-results__option select2-results__option--load-more"' +
'role="option" aria-disabled="true"></li>' 'role="treeitem" aria-disabled="true"></li>'
); );
var message = this.options.get('translations').get('loadingMore'); var message = this.options.get('translations').get('loadingMore');
@@ -4327,7 +4137,7 @@ S2.define('select2/dropdown/attachBody',[
'../utils' '../utils'
], function ($, Utils) { ], function ($, Utils) {
function AttachBody (decorated, $element, options) { function AttachBody (decorated, $element, options) {
this.$dropdownParent = $(options.get('dropdownParent') || document.body); this.$dropdownParent = options.get('dropdownParent') || $(document.body);
decorated.call(this, $element, options); decorated.call(this, $element, options);
} }
@@ -4335,14 +4145,27 @@ S2.define('select2/dropdown/attachBody',[
AttachBody.prototype.bind = function (decorated, container, $container) { AttachBody.prototype.bind = function (decorated, container, $container) {
var self = this; var self = this;
var setupResultsEvents = false;
decorated.call(this, container, $container); decorated.call(this, container, $container);
container.on('open', function () { container.on('open', function () {
self._showDropdown(); self._showDropdown();
self._attachPositioningHandler(container); self._attachPositioningHandler(container);
// Must bind after the results handlers to ensure correct sizing if (!setupResultsEvents) {
self._bindContainerResultHandlers(container); setupResultsEvents = true;
container.on('results:all', function () {
self._positionDropdown();
self._resizeDropdown();
});
container.on('results:append', function () {
self._positionDropdown();
self._resizeDropdown();
});
}
}); });
container.on('close', function () { container.on('close', function () {
@@ -4391,44 +4214,6 @@ S2.define('select2/dropdown/attachBody',[
this.$dropdownContainer.detach(); this.$dropdownContainer.detach();
}; };
AttachBody.prototype._bindContainerResultHandlers =
function (decorated, container) {
// These should only be bound once
if (this._containerResultsHandlersBound) {
return;
}
var self = this;
container.on('results:all', function () {
self._positionDropdown();
self._resizeDropdown();
});
container.on('results:append', function () {
self._positionDropdown();
self._resizeDropdown();
});
container.on('results:message', function () {
self._positionDropdown();
self._resizeDropdown();
});
container.on('select', function () {
self._positionDropdown();
self._resizeDropdown();
});
container.on('unselect', function () {
self._positionDropdown();
self._resizeDropdown();
});
this._containerResultsHandlersBound = true;
};
AttachBody.prototype._attachPositioningHandler = AttachBody.prototype._attachPositioningHandler =
function (decorated, container) { function (decorated, container) {
var self = this; var self = this;
@@ -4439,14 +4224,14 @@ S2.define('select2/dropdown/attachBody',[
var $watchers = this.$container.parents().filter(Utils.hasScroll); var $watchers = this.$container.parents().filter(Utils.hasScroll);
$watchers.each(function () { $watchers.each(function () {
Utils.StoreData(this, 'select2-scroll-position', { $(this).data('select2-scroll-position', {
x: $(this).scrollLeft(), x: $(this).scrollLeft(),
y: $(this).scrollTop() y: $(this).scrollTop()
}); });
}); });
$watchers.on(scrollEvent, function (ev) { $watchers.on(scrollEvent, function (ev) {
var position = Utils.GetData(this, 'select2-scroll-position'); var position = $(this).data('select2-scroll-position');
$(this).scrollTop(position.y); $(this).scrollTop(position.y);
}); });
@@ -4505,26 +4290,16 @@ S2.define('select2/dropdown/attachBody',[
top: container.bottom top: container.bottom
}; };
// Determine what the parent element is to use for calculating the offset // Determine what the parent element is to use for calciulating the offset
var $offsetParent = this.$dropdownParent; var $offsetParent = this.$dropdownParent;
// For statically positioned elements, we need to get the element // For statically positoned elements, we need to get the element
// that is determining the offset // that is determining the offset
if ($offsetParent.css('position') === 'static') { if ($offsetParent.css('position') === 'static') {
$offsetParent = $offsetParent.offsetParent(); $offsetParent = $offsetParent.offsetParent();
} }
var parentOffset = { var parentOffset = $offsetParent.offset();
top: 0,
left: 0
};
if (
$.contains(document.body, $offsetParent[0]) ||
$offsetParent[0].isConnected
) {
parentOffset = $offsetParent.offset();
}
css.top -= parentOffset.top; css.top -= parentOffset.top;
css.left -= parentOffset.left; css.left -= parentOffset.left;
@@ -4621,8 +4396,8 @@ S2.define('select2/dropdown/minimumResultsForSearch',[
}); });
S2.define('select2/dropdown/selectOnClose',[ S2.define('select2/dropdown/selectOnClose',[
'../utils'
], function (Utils) { ], function () {
function SelectOnClose () { } function SelectOnClose () { }
SelectOnClose.prototype.bind = function (decorated, container, $container) { SelectOnClose.prototype.bind = function (decorated, container, $container) {
@@ -4653,7 +4428,7 @@ S2.define('select2/dropdown/selectOnClose',[
return; return;
} }
var data = Utils.GetData($highlightedResults[0], 'data'); var data = $highlightedResults.data('data');
// Don't re-select already selected resulte // Don't re-select already selected resulte
if ( if (
@@ -4694,7 +4469,7 @@ S2.define('select2/dropdown/closeOnSelect',[
var originalEvent = evt.originalEvent; var originalEvent = evt.originalEvent;
// Don't close if the control key is being held // Don't close if the control key is being held
if (originalEvent && (originalEvent.ctrlKey || originalEvent.metaKey)) { if (originalEvent && originalEvent.ctrlKey) {
return; return;
} }
@@ -4748,9 +4523,6 @@ S2.define('select2/i18n/en',[],function () {
}, },
searching: function () { searching: function () {
return 'Searching…'; return 'Searching…';
},
removeAllItems: function () {
return 'Remove all items';
} }
}; };
}); });
@@ -4989,29 +4761,66 @@ S2.define('select2/defaults',[
); );
} }
// If the defaults were not previously applied from an element, it is if (typeof options.language === 'string') {
// possible for the language option to have not been resolved // Check if the language is specified with a region
options.language = this._resolveLanguage(options.language); if (options.language.indexOf('-') > 0) {
// Extract the region information if it is included
var languageParts = options.language.split('-');
var baseLanguage = languageParts[0];
// Always fall back to English since it will always be complete options.language = [options.language, baseLanguage];
options.language.push('en'); } else {
options.language = [options.language];
var uniqueLanguages = [];
for (var l = 0; l < options.language.length; l++) {
var language = options.language[l];
if (uniqueLanguages.indexOf(language) === -1) {
uniqueLanguages.push(language);
} }
} }
options.language = uniqueLanguages; if ($.isArray(options.language)) {
var languages = new Translation();
options.language.push('en');
options.translations = this._processTranslations( var languageNames = options.language;
options.language,
options.debug for (var l = 0; l < languageNames.length; l++) {
); var name = languageNames[l];
var language = {};
try {
// Try to load it with the original name
language = Translation.loadPath(name);
} catch (e) {
try {
// If we couldn't load it, check if it wasn't the full path
name = this.defaults.amdLanguageBase + name;
language = Translation.loadPath(name);
} catch (ex) {
// The translation could not be loaded at all. Sometimes this is
// because of a configuration problem, other times this can be
// because of how Select2 helps load all possible translation files.
if (options.debug && window.console && console.warn) {
console.warn(
'Select2: The language file for "' + name + '" could not be ' +
'automatically loaded. A fallback will be used instead.'
);
}
continue;
}
}
languages.extend(language);
}
options.translations = languages;
} else {
var baseTranslation = Translation.loadPath(
this.defaults.amdLanguageBase + 'en'
);
var customTranslation = new Translation(options.language);
customTranslation.extend(baseTranslation);
options.translations = customTranslation;
}
return options; return options;
}; };
@@ -5078,14 +4887,13 @@ S2.define('select2/defaults',[
debug: false, debug: false,
dropdownAutoWidth: false, dropdownAutoWidth: false,
escapeMarkup: Utils.escapeMarkup, escapeMarkup: Utils.escapeMarkup,
language: {}, language: EnglishTranslation,
matcher: matcher, matcher: matcher,
minimumInputLength: 0, minimumInputLength: 0,
maximumInputLength: 0, maximumInputLength: 0,
maximumSelectionLength: 0, maximumSelectionLength: 0,
minimumResultsForSearch: 0, minimumResultsForSearch: 0,
selectOnClose: false, selectOnClose: false,
scrollAfterSelect: false,
sorter: function (data) { sorter: function (data) {
return data; return data;
}, },
@@ -5100,103 +4908,6 @@ S2.define('select2/defaults',[
}; };
}; };
Defaults.prototype.applyFromElement = function (options, $element) {
var optionLanguage = options.language;
var defaultLanguage = this.defaults.language;
var elementLanguage = $element.prop('lang');
var parentLanguage = $element.closest('[lang]').prop('lang');
var languages = Array.prototype.concat.call(
this._resolveLanguage(elementLanguage),
this._resolveLanguage(optionLanguage),
this._resolveLanguage(defaultLanguage),
this._resolveLanguage(parentLanguage)
);
options.language = languages;
return options;
};
Defaults.prototype._resolveLanguage = function (language) {
if (!language) {
return [];
}
if ($.isEmptyObject(language)) {
return [];
}
if ($.isPlainObject(language)) {
return [language];
}
var languages;
if (!$.isArray(language)) {
languages = [language];
} else {
languages = language;
}
var resolvedLanguages = [];
for (var l = 0; l < languages.length; l++) {
resolvedLanguages.push(languages[l]);
if (typeof languages[l] === 'string' && languages[l].indexOf('-') > 0) {
// Extract the region information if it is included
var languageParts = languages[l].split('-');
var baseLanguage = languageParts[0];
resolvedLanguages.push(baseLanguage);
}
}
return resolvedLanguages;
};
Defaults.prototype._processTranslations = function (languages, debug) {
var translations = new Translation();
for (var l = 0; l < languages.length; l++) {
var languageData = new Translation();
var language = languages[l];
if (typeof language === 'string') {
try {
// Try to load it with the original name
languageData = Translation.loadPath(language);
} catch (e) {
try {
// If we couldn't load it, check if it wasn't the full path
language = this.defaults.amdLanguageBase + language;
languageData = Translation.loadPath(language);
} catch (ex) {
// The translation could not be loaded at all. Sometimes this is
// because of a configuration problem, other times this can be
// because of how Select2 helps load all possible translation files
if (debug && window.console && console.warn) {
console.warn(
'Select2: The language file for "' + language + '" could ' +
'not be automatically loaded. A fallback will be used instead.'
);
}
}
}
} else if ($.isPlainObject(language)) {
languageData = new Translation(language);
} else {
languageData = language;
}
translations.extend(languageData);
}
return translations;
};
Defaults.prototype.set = function (key, value) { Defaults.prototype.set = function (key, value) {
var camelKey = $.camelCase(key); var camelKey = $.camelCase(key);
@@ -5205,7 +4916,7 @@ S2.define('select2/defaults',[
var convertedData = Utils._convertData(data); var convertedData = Utils._convertData(data);
$.extend(true, this.defaults, convertedData); $.extend(this.defaults, convertedData);
}; };
var defaults = new Defaults(); var defaults = new Defaults();
@@ -5226,10 +4937,6 @@ S2.define('select2/options',[
this.fromElement($element); this.fromElement($element);
} }
if ($element != null) {
this.options = Defaults.applyFromElement(this.options, $element);
}
this.options = Defaults.apply(this.options); this.options = Defaults.apply(this.options);
if ($element && $element.is('input')) { if ($element && $element.is('input')) {
@@ -5253,6 +4960,14 @@ S2.define('select2/options',[
this.options.disabled = $e.prop('disabled'); this.options.disabled = $e.prop('disabled');
} }
if (this.options.language == null) {
if ($e.prop('lang')) {
this.options.language = $e.prop('lang').toLowerCase();
} else if ($e.closest('[lang]').prop('lang')) {
this.options.language = $e.closest('[lang]').prop('lang');
}
}
if (this.options.dir == null) { if (this.options.dir == null) {
if ($e.prop('dir')) { if ($e.prop('dir')) {
this.options.dir = $e.prop('dir'); this.options.dir = $e.prop('dir');
@@ -5266,7 +4981,7 @@ S2.define('select2/options',[
$e.prop('disabled', this.options.disabled); $e.prop('disabled', this.options.disabled);
$e.prop('multiple', this.options.multiple); $e.prop('multiple', this.options.multiple);
if (Utils.GetData($e[0], 'select2Tags')) { if ($e.data('select2Tags')) {
if (this.options.debug && window.console && console.warn) { if (this.options.debug && window.console && console.warn) {
console.warn( console.warn(
'Select2: The `data-select2-tags` attribute has been changed to ' + 'Select2: The `data-select2-tags` attribute has been changed to ' +
@@ -5275,11 +4990,11 @@ S2.define('select2/options',[
); );
} }
Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags')); $e.data('data', $e.data('select2Tags'));
Utils.StoreData($e[0], 'tags', true); $e.data('tags', true);
} }
if (Utils.GetData($e[0], 'ajaxUrl')) { if ($e.data('ajaxUrl')) {
if (this.options.debug && window.console && console.warn) { if (this.options.debug && window.console && console.warn) {
console.warn( console.warn(
'Select2: The `data-ajax-url` attribute has been changed to ' + 'Select2: The `data-ajax-url` attribute has been changed to ' +
@@ -5288,45 +5003,21 @@ S2.define('select2/options',[
); );
} }
$e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl')); $e.attr('ajax--url', $e.data('ajaxUrl'));
Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl')); $e.data('ajax--url', $e.data('ajaxUrl'));
} }
var dataset = {}; var dataset = {};
function upperCaseLetter(_, letter) {
return letter.toUpperCase();
}
// Pre-load all of the attributes which are prefixed with `data-`
for (var attr = 0; attr < $e[0].attributes.length; attr++) {
var attributeName = $e[0].attributes[attr].name;
var prefix = 'data-';
if (attributeName.substr(0, prefix.length) == prefix) {
// Get the contents of the attribute after `data-`
var dataName = attributeName.substring(prefix.length);
// Get the data contents from the consistent source
// This is more than likely the jQuery data helper
var dataValue = Utils.GetData($e[0], dataName);
// camelCase the attribute name to match the spec
var camelDataName = dataName.replace(/-([a-z])/g, upperCaseLetter);
// Store the data attribute contents into the dataset since
dataset[camelDataName] = dataValue;
}
}
// Prefer the element's `dataset` attribute if it exists // Prefer the element's `dataset` attribute if it exists
// jQuery 1.x does not correctly handle data attributes with multiple dashes // jQuery 1.x does not correctly handle data attributes with multiple dashes
if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
dataset = $.extend(true, {}, $e[0].dataset, dataset); dataset = $.extend(true, {}, $e[0].dataset, $e.data());
} else {
dataset = $e.data();
} }
// Prefer our internal data cache if it exists var data = $.extend(true, {}, dataset);
var data = $.extend(true, {}, Utils.GetData($e[0]), dataset);
data = Utils._convertData(data); data = Utils._convertData(data);
@@ -5363,8 +5054,8 @@ S2.define('select2/core',[
'./keys' './keys'
], function ($, Options, Utils, KEYS) { ], function ($, Options, Utils, KEYS) {
var Select2 = function ($element, options) { var Select2 = function ($element, options) {
if (Utils.GetData($element[0], 'select2') != null) { if ($element.data('select2') != null) {
Utils.GetData($element[0], 'select2').destroy(); $element.data('select2').destroy();
} }
this.$element = $element; this.$element = $element;
@@ -5380,7 +5071,7 @@ S2.define('select2/core',[
// Set up the tabindex // Set up the tabindex
var tabindex = $element.attr('tabindex') || 0; var tabindex = $element.attr('tabindex') || 0;
Utils.StoreData($element[0], 'old-tabindex', tabindex); $element.data('old-tabindex', tabindex);
$element.attr('tabindex', '-1'); $element.attr('tabindex', '-1');
// Set up containers and adapters // Set up containers and adapters
@@ -5441,9 +5132,6 @@ S2.define('select2/core',[
// Synchronize any monitored attributes // Synchronize any monitored attributes
this._syncAttributes(); this._syncAttributes();
Utils.StoreData($element[0], 'select2', this);
// Ensure backwards compatibility with $element.data('select2').
$element.data('select2', this); $element.data('select2', this);
}; };
@@ -5520,12 +5208,6 @@ S2.define('select2/core',[
return null; return null;
} }
if (method == 'computedstyle') {
var computedStyle = window.getComputedStyle($element[0]);
return computedStyle.width;
}
return method; return method;
}; };
@@ -5566,8 +5248,8 @@ S2.define('select2/core',[
if (observer != null) { if (observer != null) {
this._observer = new observer(function (mutations) { this._observer = new observer(function (mutations) {
self._syncA(); $.each(mutations, self._syncA);
self._syncS(null, mutations); $.each(mutations, self._syncS);
}); });
this._observer.observe(this.$element[0], { this._observer.observe(this.$element[0], {
attributes: true, attributes: true,
@@ -5689,7 +5371,7 @@ S2.define('select2/core',[
if (self.isOpen()) { if (self.isOpen()) {
if (key === KEYS.ESC || key === KEYS.TAB || if (key === KEYS.ESC || key === KEYS.TAB ||
(key === KEYS.UP && evt.altKey)) { (key === KEYS.UP && evt.altKey)) {
self.close(evt); self.close();
evt.preventDefault(); evt.preventDefault();
} else if (key === KEYS.ENTER) { } else if (key === KEYS.ENTER) {
@@ -5723,7 +5405,7 @@ S2.define('select2/core',[
Select2.prototype._syncAttributes = function () { Select2.prototype._syncAttributes = function () {
this.options.set('disabled', this.$element.prop('disabled')); this.options.set('disabled', this.$element.prop('disabled'));
if (this.isDisabled()) { if (this.options.get('disabled')) {
if (this.isOpen()) { if (this.isOpen()) {
this.close(); this.close();
} }
@@ -5734,7 +5416,7 @@ S2.define('select2/core',[
} }
}; };
Select2.prototype._isChangeMutation = function (evt, mutations) { Select2.prototype._syncSubtree = function (evt, mutations) {
var changed = false; var changed = false;
var self = this; var self = this;
@@ -5762,22 +5444,7 @@ S2.define('select2/core',[
} }
} else if (mutations.removedNodes && mutations.removedNodes.length > 0) { } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
changed = true; changed = true;
} else if ($.isArray(mutations)) {
$.each(mutations, function(evt, mutation) {
if (self._isChangeMutation(evt, mutation)) {
// We've found a change mutation.
// Let's escape from the loop and continue
changed = true;
return false;
}
});
} }
return changed;
};
Select2.prototype._syncSubtree = function (evt, mutations) {
var changed = this._isChangeMutation(evt, mutations);
var self = this;
// Only re-pull the data if we think there is a change // Only re-pull the data if we think there is a change
if (changed) { if (changed) {
@@ -5799,8 +5466,7 @@ S2.define('select2/core',[
'open': 'opening', 'open': 'opening',
'close': 'closing', 'close': 'closing',
'select': 'selecting', 'select': 'selecting',
'unselect': 'unselecting', 'unselect': 'unselecting'
'clear': 'clearing'
}; };
if (args === undefined) { if (args === undefined) {
@@ -5828,7 +5494,7 @@ S2.define('select2/core',[
}; };
Select2.prototype.toggleDropdown = function () { Select2.prototype.toggleDropdown = function () {
if (this.isDisabled()) { if (this.options.get('disabled')) {
return; return;
} }
@@ -5844,40 +5510,15 @@ S2.define('select2/core',[
return; return;
} }
if (this.isDisabled()) {
return;
}
this.trigger('query', {}); this.trigger('query', {});
}; };
Select2.prototype.close = function (evt) { Select2.prototype.close = function () {
if (!this.isOpen()) { if (!this.isOpen()) {
return; return;
} }
this.trigger('close', { originalEvent : evt }); this.trigger('close', {});
};
/**
* Helper method to abstract the "enabled" (not "disabled") state of this
* object.
*
* @return {true} if the instance is not disabled.
* @return {false} if the instance is disabled.
*/
Select2.prototype.isEnabled = function () {
return !this.isDisabled();
};
/**
* Helper method to abstract the "disabled" state of this object.
*
* @return {true} if the disabled option is true.
* @return {false} if the disabled option is false.
*/
Select2.prototype.isDisabled = function () {
return this.options.get('disabled');
}; };
Select2.prototype.isOpen = function () { Select2.prototype.isOpen = function () {
@@ -5954,7 +5595,7 @@ S2.define('select2/core',[
}); });
} }
this.$element.val(newVal).trigger('input').trigger('change'); this.$element.val(newVal).trigger('change');
}; };
Select2.prototype.destroy = function () { Select2.prototype.destroy = function () {
@@ -5980,12 +5621,10 @@ S2.define('select2/core',[
this._syncS = null; this._syncS = null;
this.$element.off('.select2'); this.$element.off('.select2');
this.$element.attr('tabindex', this.$element.attr('tabindex', this.$element.data('old-tabindex'));
Utils.GetData(this.$element[0], 'old-tabindex'));
this.$element.removeClass('select2-hidden-accessible'); this.$element.removeClass('select2-hidden-accessible');
this.$element.attr('aria-hidden', 'false'); this.$element.attr('aria-hidden', 'false');
Utils.RemoveData(this.$element[0]);
this.$element.removeData('select2'); this.$element.removeData('select2');
this.dataAdapter.destroy(); this.dataAdapter.destroy();
@@ -6013,7 +5652,7 @@ S2.define('select2/core',[
this.$container.addClass('select2-container--' + this.options.get('theme')); this.$container.addClass('select2-container--' + this.options.get('theme'));
Utils.StoreData($container[0], 'element', this.$element); $container.data('element', this.$element);
return $container; return $container;
}; };
@@ -6033,9 +5672,8 @@ S2.define('jquery.select2',[
'jquery-mousewheel', 'jquery-mousewheel',
'./select2/core', './select2/core',
'./select2/defaults', './select2/defaults'
'./select2/utils' ], function ($, _, Select2, Defaults) {
], function ($, _, Select2, Defaults, Utils) {
if ($.fn.select2 == null) { if ($.fn.select2 == null) {
// All methods that should return the element // All methods that should return the element
var thisMethods = ['open', 'close', 'destroy']; var thisMethods = ['open', 'close', 'destroy'];
@@ -6056,7 +5694,7 @@ S2.define('jquery.select2',[
var args = Array.prototype.slice.call(arguments, 1); var args = Array.prototype.slice.call(arguments, 1);
this.each(function () { this.each(function () {
var instance = Utils.GetData(this, 'select2'); var instance = $(this).data('select2');
if (instance == null && window.console && console.error) { if (instance == null && window.console && console.error) {
console.error( console.error(
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -2
View File
File diff suppressed because one or more lines are too long
+9
View File
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
+155
View File
@@ -0,0 +1,155 @@
(function($) {
$.extend($.summernote.lang, {
'ko-KR': {
font: {
bold: '굵게',
italic: '기울임꼴',
underline: '밑줄',
clear: '글자 효과 없애기',
height: '줄간격',
name: '글꼴',
superscript: '위 첨자',
subscript: '아래 첨자',
strikethrough: '취소선',
size: '글자 크기'
},
image: {
image: '사진',
insert: '사진 추가',
resizeFull: '100% 크기로 변경',
resizeHalf: '50% 크기로 변경',
resizeQuarter: '25% 크기로 변경',
floatLeft: '왼쪽 정렬',
floatRight: '오른쪽 정렬',
floatNone: '정렬하지 않음',
shapeRounded: '스타일: 둥근 모서리',
shapeCircle: '스타일: 원형',
shapeThumbnail: '스타일: 액자',
shapeNone: '스타일: 없음',
dragImageHere: '텍스트 혹은 사진을 이곳으로 끌어오세요',
dropImage: '텍스트 혹은 사진을 내려놓으세요',
selectFromFiles: '파일 선택',
maximumFileSize: 'Maximum file size',
maximumFileSizeError: 'Maximum file size exceeded.',
url: '사진 URL',
remove: '사진 삭제',
original: 'Original'
},
video: {
video: '동영상',
videoLink: '동영상 링크',
insert: '동영상 추가',
url: '동영상 URL',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, Youku 사용 가능)'
},
link: {
link: '링크',
insert: '링크 추가',
unlink: '링크 삭제',
edit: '수정',
textToDisplay: '링크에 표시할 내용',
url: '이동할 URL',
openInNewWindow: '새창으로 열기'
},
table: {
table: '테이블',
addRowAbove: 'Add row above',
addRowBelow: 'Add row below',
addColLeft: 'Add column left',
addColRight: 'Add column right',
delRow: 'Delete row',
delCol: 'Delete column',
delTable: 'Delete table'
},
hr: {
insert: '구분선 추가'
},
style: {
style: '스타일',
p: '본문',
blockquote: '인용구',
pre: '코드',
h1: '제목 1',
h2: '제목 2',
h3: '제목 3',
h4: '제목 4',
h5: '제목 5',
h6: '제목 6'
},
lists: {
unordered: '글머리 기호',
ordered: '번호 매기기'
},
options: {
help: '도움말',
fullscreen: '전체 화면',
codeview: '코드 보기'
},
paragraph: {
paragraph: '문단 정렬',
outdent: '내어쓰기',
indent: '들여쓰기',
left: '왼쪽 정렬',
center: '가운데 정렬',
right: '오른쪽 정렬',
justify: '양쪽 정렬'
},
color: {
recent: '마지막으로 사용한 색',
more: '다른 색 선택',
background: '배경색',
foreground: '글자색',
transparent: '투명',
setTransparent: '투명',
reset: '취소',
resetToDefault: '기본 값으로 변경'
},
shortcut: {
shortcuts: '키보드 단축키',
close: '닫기',
textFormatting: '글자 스타일 적용',
action: '기능',
paragraphFormatting: '문단 스타일 적용',
documentStyle: '문서 스타일 적용',
extraKeys: 'Extra keys'
},
help: {
'insertParagraph': 'Insert Paragraph',
'undo': 'Undoes the last command',
'redo': 'Redoes the last command',
'tab': 'Tab',
'untab': 'Untab',
'bold': 'Set a bold style',
'italic': 'Set a italic style',
'underline': 'Set a underline style',
'strikethrough': 'Set a strikethrough style',
'removeFormat': 'Clean a style',
'justifyLeft': 'Set left align',
'justifyCenter': 'Set center align',
'justifyRight': 'Set right align',
'justifyFull': 'Set full align',
'insertUnorderedList': 'Toggle unordered list',
'insertOrderedList': 'Toggle ordered list',
'outdent': 'Outdent on current paragraph',
'indent': 'Indent on current paragraph',
'formatPara': 'Change current block\'s format as a paragraph(P tag)',
'formatH1': 'Change current block\'s format as H1',
'formatH2': 'Change current block\'s format as H2',
'formatH3': 'Change current block\'s format as H3',
'formatH4': 'Change current block\'s format as H4',
'formatH5': 'Change current block\'s format as H5',
'formatH6': 'Change current block\'s format as H6',
'insertHorizontalRule': 'Insert horizontal rule',
'linkDialog.show': 'Show Link Dialog'
},
history: {
undo: '실행 취소',
redo: '다시 실행'
},
specialChar: {
specialChar: '특수문자',
select: '특수문자를 선택하세요'
}
}
});
})(jQuery);
@@ -0,0 +1,16 @@
.ext-databasic {
position: relative;
display: block;
min-height: 50px;
background-color: cyan;
text-align: center;
padding: 20px;
border: 1px solid white;
border-radius: 10px;
}
.ext-databasic p {
color: white;
font-size: 1.2em;
margin: 0;
}
@@ -0,0 +1,292 @@
(function(factory) {
/* global define */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(window.jQuery);
}
}(function($) {
// pull in some summernote core functions
var ui = $.summernote.ui;
var dom = $.summernote.dom;
// define the popover plugin
var DataBasicPlugin = function(context) {
var self = this;
var options = context.options;
var lang = options.langInfo;
self.icon = '<i class="fa fa-object-group"/>';
// add context menu button for dialog
context.memo('button.databasic', function() {
return ui.button({
contents: self.icon,
tooltip: lang.databasic.insert,
click: context.createInvokeHandler('databasic.showDialog')
}).render();
});
// add popover edit button
context.memo('button.databasicDialog', function() {
return ui.button({
contents: self.icon,
tooltip: lang.databasic.edit,
click: context.createInvokeHandler('databasic.showDialog')
}).render();
});
// add popover size buttons
context.memo('button.databasicSize100', function() {
return ui.button({
contents: '<span class="note-fontsize-10">100%</span>',
tooltip: lang.image.resizeFull,
click: context.createInvokeHandler('editor.resize', '1')
}).render();
});
context.memo('button.databasicSize50', function() {
return ui.button({
contents: '<span class="note-fontsize-10">50%</span>',
tooltip: lang.image.resizeHalf,
click: context.createInvokeHandler('editor.resize', '0.5')
}).render();
});
context.memo('button.databasicSize25', function() {
return ui.button({
contents: '<span class="note-fontsize-10">25%</span>',
tooltip: lang.image.resizeQuarter,
click: context.createInvokeHandler('editor.resize', '0.25')
}).render();
});
self.events = {
'summernote.init': function(we, e) {
// update existing containers
$('data.ext-databasic', e.editable).each(function() { self.setContent($(this)); });
// TODO: make this an undo snapshot...
},
'summernote.keyup summernote.mouseup summernote.change summernote.scroll': function() {
self.update();
},
'summernote.dialog.shown': function() {
self.hidePopover();
}
};
self.initialize = function() {
// create dialog markup
var $container = options.dialogsInBody ? $(document.body) : context.layoutInfo.editor;
var body = '<div class="form-group row-fluid">' +
'<label>' + lang.databasic.testLabel + '</label>' +
'<input class="ext-databasic-test form-control" type="text" />' +
'</div>';
var footer = '<button href="#" class="btn btn-primary ext-databasic-save">' + lang.databasic.insert + '</button>';
self.$dialog = ui.dialog({
title: lang.databasic.name,
fade: options.dialogsFade,
body: body,
footer: footer
}).render().appendTo($container);
// create popover
self.$popover = ui.popover({
className: 'ext-databasic-popover'
}).render().appendTo('body');
var $content = self.$popover.find('.popover-content');
context.invoke('buttons.build', $content, options.popover.databasic);
};
self.destroy = function() {
self.$popover.remove();
self.$popover = null;
self.$dialog.remove();
self.$dialog = null;
};
self.update = function() {
// Prevent focusing on editable when invoke('code') is executed
if (!context.invoke('editor.hasFocus')) {
self.hidePopover();
return;
}
var rng = context.invoke('editor.createRange');
var visible = false;
if (rng.isOnData()) {
var $data = $(rng.sc).closest('data.ext-databasic');
if ($data.length) {
var pos = dom.posFromPlaceholder($data[0]);
self.$popover.css({
display: 'block',
left: pos.left,
top: pos.top
});
// save editor target to let size buttons resize the container
context.invoke('editor.saveTarget', $data[0]);
visible = true;
}
}
// hide if not visible
if (!visible) {
self.hidePopover();
}
};
self.hidePopover = function() {
self.$popover.hide();
};
// define plugin dialog
self.getInfo = function() {
var rng = context.invoke('editor.createRange');
if (rng.isOnData()) {
var $data = $(rng.sc).closest('data.ext-databasic');
if ($data.length) {
// Get the first node on range(for edit).
return {
node: $data,
test: $data.attr('data-test')
};
}
}
return {};
};
self.setContent = function($node) {
$node.html('<p contenteditable="false">' + self.icon + ' ' + lang.databasic.name + ': ' +
$node.attr('data-test') + '</p>');
};
self.updateNode = function(info) {
self.setContent(info.node
.attr('data-test', info.test));
};
self.createNode = function(info) {
var $node = $('<data class="ext-databasic"></data>');
if ($node) {
// save node to info structure
info.node = $node;
// insert node into editor dom
context.invoke('editor.insertNode', $node[0]);
}
return $node;
};
self.showDialog = function() {
var info = self.getInfo();
var newNode = !info.node;
context.invoke('editor.saveRange');
self
.openDialog(info)
.then(function(dialogInfo) {
// [workaround] hide dialog before restore range for IE range focus
ui.hideDialog(self.$dialog);
context.invoke('editor.restoreRange');
// insert a new node
if (newNode) {
self.createNode(info);
}
// update info with dialog info
$.extend(info, dialogInfo);
self.updateNode(info);
})
.fail(function() {
context.invoke('editor.restoreRange');
});
};
self.openDialog = function(info) {
return $.Deferred(function(deferred) {
var $inpTest = self.$dialog.find('.ext-databasic-test');
var $saveBtn = self.$dialog.find('.ext-databasic-save');
var onKeyup = function(event) {
if (event.keyCode === 13) {
$saveBtn.trigger('click');
}
};
ui.onDialogShown(self.$dialog, function() {
context.triggerEvent('dialog.shown');
$inpTest.val(info.test).on('input', function() {
ui.toggleBtn($saveBtn, $inpTest.val());
}).trigger('focus').on('keyup', onKeyup);
$saveBtn
.text(info.node ? lang.databasic.edit : lang.databasic.insert)
.click(function(event) {
event.preventDefault();
deferred.resolve({ test: $inpTest.val() });
});
// init save button
ui.toggleBtn($saveBtn, $inpTest.val());
});
ui.onDialogHidden(self.$dialog, function() {
$inpTest.off('input keyup');
$saveBtn.off('click');
if (deferred.state() === 'pending') {
deferred.reject();
}
});
ui.showDialog(self.$dialog);
});
};
};
// Extends summernote
$.extend(true, $.summernote, {
plugins: {
databasic: DataBasicPlugin
},
options: {
popover: {
databasic: [
['databasic', ['databasicDialog', 'databasicSize100', 'databasicSize50', 'databasicSize25']]
]
}
},
// add localization texts
lang: {
'en-US': {
databasic: {
name: 'Basic Data Container',
insert: 'insert basic data container',
edit: 'edit basic data container',
testLabel: 'test input'
}
}
}
});
}));
@@ -0,0 +1,81 @@
(function(factory) {
/* global define */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(window.jQuery);
}
}(function($) {
// Extends plugins for adding hello.
// - plugin is external module for customizing.
$.extend($.summernote.plugins, {
/**
* @param {Object} context - context object has status of editor.
*/
'hello': function(context) {
var self = this;
// ui has renders to build ui elements.
// - you can create a button with `ui.button`
var ui = $.summernote.ui;
// add hello button
context.memo('button.hello', function() {
// create button
var button = ui.button({
contents: '<i class="fa fa-child"/> Hello',
tooltip: 'hello',
click: function() {
self.$panel.show();
self.$panel.hide(500);
// invoke insertText method with 'hello' on editor module.
context.invoke('editor.insertText', 'hello');
}
});
// create jQuery object from button instance.
var $hello = button.render();
return $hello;
});
// This events will be attached when editor is initialized.
this.events = {
// This will be called after modules are initialized.
'summernote.init': function(we, e) {
console.log('summernote initialized', we, e);
},
// This will be called when user releases a key on editable.
'summernote.keyup': function(we, e) {
console.log('summernote keyup', we, e);
}
};
// This method will be called when editor is initialized by $('..').summernote();
// You can create elements for plugin
this.initialize = function() {
this.$panel = $('<div class="hello-panel"/>').css({
position: 'absolute',
width: 100,
height: 100,
left: '50%',
top: '50%',
background: 'red'
}).hide();
this.$panel.appendTo('body');
};
// This methods will be called when editor is destroyed by $('..').summernote('destroy');
// You should remove elements on `initialize`.
this.destroy = function() {
this.$panel.remove();
this.$panel = null;
};
}
});
}));
@@ -0,0 +1,153 @@
/* Forked from https://github.com/asiffermann/summernote-image-title */
(function (factory) {
/* Global define */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(window.jQuery);
}
}(function ($) {
$.extend(true, $.summernote.lang, {
'en-US': {
imageFlip: {
edit: 'Flip image',
flipLabel: 'Alternative Image'
}
},
'ko-KR': {
imageFlip: {
edit: '이미지 전환',
flipLabel: '대체 이미지( , 로 구분)'
}
},
});
$.extend($.summernote.options, {
imageFlip: {
icon: '<i class="note-icon-pencil"/>',
tooltip: 'Image Flip'
}
});
$.extend($.summernote.plugins, {
'imageFlip': function (context) {
var self = this;
var ui = $.summernote.ui;
var $note = context.layoutInfo.note;
var $editor = context.layoutInfo.editor;
var $editable = context.layoutInfo.editable;
var $toolbar = context.layoutInfo.toolbar;
if (typeof context.options.imageFlip === 'undefined') {
context.options.imageFlip = {};
}
var options = context.options;
var lang = options.langInfo;
context.memo('button.imageFlip', function () {
var button = ui.button({
contents: ui.icon(options.icons.pencil),
container: false,
tooltip: lang.imageFlip.edit,
click: function (e) {
context.invoke('imageFlip.show');
}
});
return button.render();
});
this.initialize = function () {
var $container = options.dialogsInBody ? $(document.body) : $editor;
var body = '<div class="form-group">' +
'<label>' + lang.imageFlip.flipLabel + '</label>' +
'<input class="note-image-flip-text form-control" type="text" />' +
'</div>';
var footer = '<button href="#" class="btn btn-primary note-image-flip-btn">' + lang.imageFlip.edit + '</button>';
this.$dialog = ui.dialog({
title: lang.imageFlip.edit,
body: body,
footer: footer
}).render().appendTo($container);
};
this.destroy = function () {
ui.hideDialog(this.$dialog);
this.$dialog.remove();
};
this.bindEnterKey = function ($input, $btn) {
$input.on('keypress', function (event) {
if (event.keyCode === 13) {
$btn.trigger('click');
}
});
};
this.show = function () {
var $img = $($editable.data('target'));
var imgInfo = {
imgDom: $img,
flip: $img.data('flip'),
};
this.showLinkDialog(imgInfo).then(function (imgInfo) {
ui.hideDialog(self.$dialog);
var $img = imgInfo.imgDom;
if (imgInfo.flip) {
$img.attr('data-flip', imgInfo.flip);
}
else {
$img.removeData('flip');
}
$note.val(context.invoke('code'));
$note.change();
});
};
this.showLinkDialog = function (imgInfo) {
return $.Deferred(function (deferred) {
var $imageFlip = self.$dialog.find('.note-image-flip-text');
var $editBtn = self.$dialog.find('.note-image-flip-btn');
ui.onDialogShown(self.$dialog, function () {
context.triggerEvent('dialog.shown');
$editBtn.click(function (event) {
event.preventDefault();
deferred.resolve({
imgDom: imgInfo.imgDom,
flip: $imageFlip.val(),
});
});
$imageFlip.val(imgInfo.flip).trigger('focus');
self.bindEnterKey($imageFlip, $editBtn);
});
ui.onDialogHidden(self.$dialog, function () {
$editBtn.off('click');
if (deferred.state() === 'pending') {
deferred.reject();
}
});
ui.showDialog(self.$dialog);
});
};
}
});
}));
@@ -0,0 +1,312 @@
(function(factory) {
/* global define */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(window.jQuery);
}
}(function($) {
$.extend($.summernote.plugins, {
'specialchars': function(context) {
var self = this;
var ui = $.summernote.ui;
var $editor = context.layoutInfo.editor;
var options = context.options;
var lang = options.langInfo;
var KEY = {
UP: 38,
DOWN: 40,
LEFT: 37,
RIGHT: 39,
ENTER: 13
};
var COLUMN_LENGTH = 15;
var COLUMN_WIDTH = 35;
var currentColumn = 0;
var currentRow = 0;
var totalColumn = 0;
var totalRow = 0;
// special characters data set
var specialCharDataSet = [
'&quot;', '&amp;', '&lt;', '&gt;', '&iexcl;', '&cent;',
'&pound;', '&curren;', '&yen;', '&brvbar;', '&sect;',
'&uml;', '&copy;', '&ordf;', '&laquo;', '&not;',
'&reg;', '&macr;', '&deg;', '&plusmn;', '&sup2;',
'&sup3;', '&acute;', '&micro;', '&para;', '&middot;',
'&cedil;', '&sup1;', '&ordm;', '&raquo;', '&frac14;',
'&frac12;', '&frac34;', '&iquest;', '&times;', '&divide;',
'&fnof;', '&circ;', '&tilde;', '&ndash;', '&mdash;',
'&lsquo;', '&rsquo;', '&sbquo;', '&ldquo;', '&rdquo;',
'&bdquo;', '&dagger;', '&Dagger;', '&bull;', '&hellip;',
'&permil;', '&prime;', '&Prime;', '&lsaquo;', '&rsaquo;',
'&oline;', '&frasl;', '&euro;', '&image;', '&weierp;',
'&real;', '&trade;', '&alefsym;', '&larr;', '&uarr;',
'&rarr;', '&darr;', '&harr;', '&crarr;', '&lArr;',
'&uArr;', '&rArr;', '&dArr;', '&hArr;', '&forall;',
'&part;', '&exist;', '&empty;', '&nabla;', '&isin;',
'&notin;', '&ni;', '&prod;', '&sum;', '&minus;',
'&lowast;', '&radic;', '&prop;', '&infin;', '&ang;',
'&and;', '&or;', '&cap;', '&cup;', '&int;',
'&there4;', '&sim;', '&cong;', '&asymp;', '&ne;',
'&equiv;', '&le;', '&ge;', '&sub;', '&sup;',
'&nsub;', '&sube;', '&supe;', '&oplus;', '&otimes;',
'&perp;', '&sdot;', '&lceil;', '&rceil;', '&lfloor;',
'&rfloor;', '&loz;', '&spades;', '&clubs;', '&hearts;',
'&diams;'
];
context.memo('button.specialchars', function() {
return ui.button({
contents: '<i class="fa fa-font fa-flip-vertical">',
tooltip: lang.specialChar.specialChar,
click: function() {
self.show();
}
}).render();
});
/**
* Make Special Characters Table
*
* @member plugin.specialChar
* @private
* @return {jQuery}
*/
this.makeSpecialCharSetTable = function() {
var $table = $('<table/>');
$.each(specialCharDataSet, function(idx, text) {
var $td = $('<td/>').addClass('note-specialchar-node');
var $tr = (idx % COLUMN_LENGTH === 0) ? $('<tr/>') : $table.find('tr').last();
var $button = ui.button({
callback: function($node) {
$node.html(text);
$node.attr('title', text);
$node.attr('data-value', encodeURIComponent(text));
$node.css({
width: COLUMN_WIDTH,
'margin-right': '2px',
'margin-bottom': '2px'
});
}
}).render();
$td.append($button);
$tr.append($td);
if (idx % COLUMN_LENGTH === 0) {
$table.append($tr);
}
});
totalRow = $table.find('tr').length;
totalColumn = COLUMN_LENGTH;
return $table;
};
this.initialize = function() {
var $container = options.dialogsInBody ? $(document.body) : $editor;
var body = '<div class="form-group row-fluid">' + this.makeSpecialCharSetTable()[0].outerHTML + '</div>';
this.$dialog = ui.dialog({
title: lang.specialChar.select,
body: body
}).render().appendTo($container);
};
this.show = function() {
var text = context.invoke('editor.getSelectedText');
context.invoke('editor.saveRange');
this.showSpecialCharDialog(text).then(function(selectChar) {
context.invoke('editor.restoreRange');
// build node
var $node = $('<span></span>').html(selectChar)[0];
if ($node) {
// insert video node
context.invoke('editor.insertNode', $node);
}
}).fail(function() {
context.invoke('editor.restoreRange');
});
};
/**
* show image dialog
*
* @param {jQuery} $dialog
* @return {Promise}
*/
this.showSpecialCharDialog = function(text) {
return $.Deferred(function(deferred) {
var $specialCharDialog = self.$dialog;
var $specialCharNode = $specialCharDialog.find('.note-specialchar-node');
var $selectedNode = null;
var ARROW_KEYS = [KEY.UP, KEY.DOWN, KEY.LEFT, KEY.RIGHT];
var ENTER_KEY = KEY.ENTER;
function addActiveClass($target) {
if (!$target) {
return;
}
$target.find('button').addClass('active');
$selectedNode = $target;
}
function removeActiveClass($target) {
$target.find('button').removeClass('active');
$selectedNode = null;
}
// find next node
function findNextNode(row, column) {
var findNode = null;
$.each($specialCharNode, function(idx, $node) {
var findRow = Math.ceil((idx + 1) / COLUMN_LENGTH);
var findColumn = ((idx + 1) % COLUMN_LENGTH === 0) ? COLUMN_LENGTH : (idx + 1) % COLUMN_LENGTH;
if (findRow === row && findColumn === column) {
findNode = $node;
return false;
}
});
return $(findNode);
}
function arrowKeyHandler(keyCode) {
// left, right, up, down key
var $nextNode;
var lastRowColumnLength = $specialCharNode.length % totalColumn;
if (KEY.LEFT === keyCode) {
if (currentColumn > 1) {
currentColumn = currentColumn - 1;
} else if (currentRow === 1 && currentColumn === 1) {
currentColumn = lastRowColumnLength;
currentRow = totalRow;
} else {
currentColumn = totalColumn;
currentRow = currentRow - 1;
}
} else if (KEY.RIGHT === keyCode) {
if (currentRow === totalRow && lastRowColumnLength === currentColumn) {
currentColumn = 1;
currentRow = 1;
} else if (currentColumn < totalColumn) {
currentColumn = currentColumn + 1;
} else {
currentColumn = 1;
currentRow = currentRow + 1;
}
} else if (KEY.UP === keyCode) {
if (currentRow === 1 && lastRowColumnLength < currentColumn) {
currentRow = totalRow - 1;
} else {
currentRow = currentRow - 1;
}
} else if (KEY.DOWN === keyCode) {
currentRow = currentRow + 1;
}
if (currentRow === totalRow && currentColumn > lastRowColumnLength) {
currentRow = 1;
} else if (currentRow > totalRow) {
currentRow = 1;
} else if (currentRow < 1) {
currentRow = totalRow;
}
$nextNode = findNextNode(currentRow, currentColumn);
if ($nextNode) {
removeActiveClass($selectedNode);
addActiveClass($nextNode);
}
}
function enterKeyHandler() {
if (!$selectedNode) {
return;
}
deferred.resolve(decodeURIComponent($selectedNode.find('button').attr('data-value')));
$specialCharDialog.modal('hide');
}
function keyDownEventHandler(event) {
event.preventDefault();
var keyCode = event.keyCode;
if (keyCode === undefined || keyCode === null) {
return;
}
// check arrowKeys match
if (ARROW_KEYS.indexOf(keyCode) > -1) {
if ($selectedNode === null) {
addActiveClass($specialCharNode.eq(0));
currentColumn = 1;
currentRow = 1;
return;
}
arrowKeyHandler(keyCode);
} else if (keyCode === ENTER_KEY) {
enterKeyHandler();
}
return false;
}
// remove class
removeActiveClass($specialCharNode);
// find selected node
if (text) {
for (var i = 0; i < $specialCharNode.length; i++) {
var $checkNode = $($specialCharNode[i]);
if ($checkNode.text() === text) {
addActiveClass($checkNode);
currentRow = Math.ceil((i + 1) / COLUMN_LENGTH);
currentColumn = (i + 1) % COLUMN_LENGTH;
}
}
}
ui.onDialogShown(self.$dialog, function() {
$(document).on('keydown', keyDownEventHandler);
self.$dialog.find('button').tooltip();
$specialCharNode.on('click', function(event) {
event.preventDefault();
deferred.resolve(decodeURIComponent($(event.currentTarget).find('button').attr('data-value')));
ui.hideDialog(self.$dialog);
});
});
ui.onDialogHidden(self.$dialog, function() {
$specialCharNode.off('click');
self.$dialog.find('button').tooltip('destroy');
$(document).off('keydown', keyDownEventHandler);
if (deferred.state() === 'pending') {
deferred.reject();
}
});
ui.showDialog(self.$dialog);
});
};
}
});
}));
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+62 -105
View File
@@ -1,56 +1,55 @@
<?php <?php
namespace sammo; namespace sammo;
define('ROOT', realpath(__DIR__ . '/..')); define('ROOT', realpath(__dir__.'/..'));
setlocale(LC_ALL, 'ko_KR.UTF-8'); setlocale(LC_ALL, 'ko_KR.UTF-8');
date_default_timezone_set('Asia/Seoul'); date_default_timezone_set('Asia/Seoul');
mb_internal_encoding("UTF-8"); mb_internal_encoding("UTF-8");
mb_http_output('UTF-8'); mb_http_output('UTF-8');
mb_regex_encoding('UTF-8'); mb_regex_encoding('UTF-8');
ini_set("session.cache_expire", '10080'); // minutes ini_set("session.cache_expire", 10080); // minutes
ini_set("session.gc_maxlifetime", '604800'); // seconds ini_set("session.gc_maxlifetime", 604800); // seconds
function getFriendlyErrorType($type) function getFriendlyErrorType($type)
{ {
switch ($type) { switch($type)
case E_ERROR: // 1 // {
return 'E_ERROR'; case E_ERROR: // 1 //
case E_WARNING: // 2 // return 'E_ERROR';
return 'E_WARNING'; case E_WARNING: // 2 //
case E_PARSE: // 4 // return 'E_WARNING';
return 'E_PARSE'; case E_PARSE: // 4 //
case E_NOTICE: // 8 // return 'E_PARSE';
return 'E_NOTICE'; case E_NOTICE: // 8 //
case E_CORE_ERROR: // 16 // return 'E_NOTICE';
return 'E_CORE_ERROR'; case E_CORE_ERROR: // 16 //
case E_CORE_WARNING: // 32 // return 'E_CORE_ERROR';
return 'E_CORE_WARNING'; case E_CORE_WARNING: // 32 //
case E_COMPILE_ERROR: // 64 // return 'E_CORE_WARNING';
return 'E_COMPILE_ERROR'; case E_COMPILE_ERROR: // 64 //
case E_COMPILE_WARNING: // 128 // return 'E_COMPILE_ERROR';
return 'E_COMPILE_WARNING'; case E_COMPILE_WARNING: // 128 //
case E_USER_ERROR: // 256 // return 'E_COMPILE_WARNING';
return 'E_USER_ERROR'; case E_USER_ERROR: // 256 //
case E_USER_WARNING: // 512 // return 'E_USER_ERROR';
return 'E_USER_WARNING'; case E_USER_WARNING: // 512 //
case E_USER_NOTICE: // 1024 // return 'E_USER_WARNING';
return 'E_USER_NOTICE'; case E_USER_NOTICE: // 1024 //
case E_STRICT: // 2048 // return 'E_USER_NOTICE';
return 'E_STRICT'; case E_STRICT: // 2048 //
case E_RECOVERABLE_ERROR: // 4096 // return 'E_STRICT';
return 'E_RECOVERABLE_ERROR'; case E_RECOVERABLE_ERROR: // 4096 //
case E_DEPRECATED: // 8192 // return 'E_RECOVERABLE_ERROR';
return 'E_DEPRECATED'; case E_DEPRECATED: // 8192 //
case E_USER_DEPRECATED: // 16384 // return 'E_DEPRECATED';
return 'E_USER_DEPRECATED'; case E_USER_DEPRECATED: // 16384 //
} return 'E_USER_DEPRECATED';
return "{$type}"; }
return "{$type}";
} }
function getExceptionTraceAsString($exception) function getExceptionTraceAsString($exception) {
{
//https://gist.github.com/abtris/1437966 //https://gist.github.com/abtris/1437966
$rtn = ""; $rtn = "";
$count = 0; $count = 0;
@@ -74,105 +73,63 @@ function getExceptionTraceAsString($exception)
$args[] = get_resource_type($arg); $args[] = get_resource_type($arg);
} else { } else {
$args[] = $arg; $args[] = $arg;
} }
} }
$args = join(", ", $args); $args = join(", ", $args);
} }
$rtn[] = sprintf( $rtn[] = sprintf( "#%s %s:%s %s(%s)",
"#%s %s:%s %s(%s)", $count,
$count, isset($frame['file']) ? $frame['file'] : 'unknown file',
isset($frame['file']) ? $frame['file'] : 'unknown file', isset($frame['line']) ? $frame['line'] : 'unknown line',
isset($frame['line']) ? $frame['line'] : 'unknown line', (isset($frame['class'])) ? $frame['class'].$frame['type'].$frame['function'] : $frame['function'],
(isset($frame['class'])) ? $frame['class'] . $frame['type'] . $frame['function'] : $frame['function'], $args );
$args
);
$count++; $count++;
} }
return $rtn; return $rtn;
} }
function logError(string $err, string $errstr, string $errpath, array $trace) function logError(string $err, string $errstr, array $trace){
{ $fdb = FileDB::db(ROOT.'/d_log/err_log.sqlite3', ROOT.'/f_install/sql/err_log.sql');
$fdb = FileDB::db(ROOT . '/d_log/err_log.sqlite3', ROOT . '/f_install/sql/err_log.sql');
$date = date("Ymd_His"); $date = date("Ymd_His");
$errpath = str_replace(ROOT, '{ROOT}', $errpath); $trace = array_map(function(string $text){
$trace = array_map(function (string $text) {
return str_replace(ROOT, '{ROOT}', $text); return str_replace(ROOT, '{ROOT}', $text);
}, $trace); }, $trace);
$owner = Util::get_client_ip();
$session = Session::getInstance();
if ($session->isLoggedIn(true)) {
$owner .= '(' . $session->getUserID() . ',' . $session->userName . ')';
}
$fdb->insert('err_log', [ $fdb->insert('err_log', [
'date' => $date, 'date'=>$date,
'err' => $err, 'err'=>$err,
'errstr' => $errstr, 'errstr'=>$errstr,
'errpath' => $errpath, 'trace'=>Json::encode($trace)
'trace' => Json::encode($trace),
'webuser' => $owner
]); ]);
} }
function logErrorByCustomHandler(int $errno, string $errstr, string $errfile, int $errline, array $errcontext=null) function logErrorByCustomHandler(int $errno, string $errstr, string $errfile, int $errline, array $errcontext){
{
if (!(error_reporting() & $errno)) { if (!(error_reporting() & $errno)) {
// This error code is not included in error_reporting, so let it fall // This error code is not included in error_reporting, so let it fall
// through to the standard PHP error handler // through to the standard PHP error handler
return false; return false;
} }
$e = new \Exception(); $e = new \Exception();
logError( logError(
getFriendlyErrorType($errno), getFriendlyErrorType($errno),
$errstr, $errstr,
$errfile . ':' . $errline,
getExceptionTraceAsString($e) getExceptionTraceAsString($e)
); );
} }
set_error_handler("\\sammo\\logErrorByCustomHandler"); set_error_handler("\sammo\logErrorByCustomHandler");
function logExceptionByCustomHandler(\Throwable $e) function logExceptionByCustomHandler(\Throwable $e){
{
logError( logError(
get_class($e), get_class($e),
$e->getMessage(), $e->getMessage(),
$e->getFile() . ':' . $e->getLine(),
getExceptionTraceAsString($e) getExceptionTraceAsString($e)
); );
echo $e->getTraceAsString(); echo $e->getTraceAsString();
throw $e; throw $e;
} }
set_exception_handler('\\sammo\\logExceptionByCustomHandler'); set_exception_handler('\\sammo\\logExceptionByCustomHandler');
function getAPIExecutorClass($path){
static $basePath = __NAMESPACE__.'\\API\\';
if(is_string($path)){
}
else if(is_array($path)){
$path = join('\\', $path);
}
else{
throw new \InvalidArgumentException("{$path}는 올바른 API 지시자가 아님");
}
$classPath = str_replace('/', '\\', $basePath.$path);
if(class_exists($classPath)){
return $classPath;
}
throw new \InvalidArgumentException("{$path}는 올바른 API 경로가 아님");
}
function buildAPIExecutorClass($type, string $rootPath, array $args):\sammo\BaseAPI{
$class = getAPIExecutorClass($type);
return new $class($rootPath, $args);
}
+143 -164
View File
@@ -1,191 +1,170 @@
<?php <?php
namespace sammo; namespace sammo;
require(__DIR__ . '/../vendor/autoload.php'); require(__dir__.'/../vendor/autoload.php');
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ko"> <html lang="ko">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>설치</title> <title>설치</title>
<?php /* NOTE: 설치 이전에는 ServConfig가 준비되어있지 않으므로 예외로 수동 지정 */ ?> <?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?= WebUtil::printJS('../d_shared/common_path.js') ?> <?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?= WebUtil::printJS('../dist_js/gateway/vendors.js') ?> <?=WebUtil::printJS('../e_lib/jquery.validate.min.js')?>
<?= WebUtil::printCSS('../dist_js/gateway/vendor.css') ?> <?=WebUtil::printJS('../e_lib/sha512.min.js')?>
<?= WebUtil::printJS('../dist_js/gateway/common_ts.js') ?> <?=WebUtil::printJS('../js/common.js')?>
<?= WebUtil::printCSS('../dist_js/gateway/common_ts.css') ?> <?=WebUtil::printJS('../js/install.js')?>
<?= WebUtil::printJS('../dist_js/gateway/install.js') ?> <?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?= WebUtil::printCSS('../dist_js/gateway/install.css') ?> <?=WebUtil::printCSS('../css/install.css')?>
<?= WebUtil::printCSS('../css/install.css') ?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<h1 class="row justify-content-md-center">삼국지 모의전투 HiDCHe 설치</h1> <h1 class="row justify-content-md-center">삼국지 모의전투 HiDCHe 설치</h1>
<div class="row justify-content-md-center"> <div class="row justify-content-md-center">
<div class="col col-12 col-md-10 col-lg-7"> <div class="col col-12 col-md-10 col-lg-7">
<div class="card" id="db_form_card" style="display:none"> <div class="card" id="db_form_card" style="display:none">
<h3 class="card-header"> <h3 class="card-header">
설치(DB 설정) 설치(DB 설정)
</h3> </h3>
<div class="card-body"> <div class="card-body">
<form id="db_form" method="post" action="#"> <form id="db_form" method="post" action="#">
<div class="form-group row"> <div class="form-group row">
<label for="db_host" class="col-sm-4 col-form-label">DB호스트</label> <label for="db_host" class="col-sm-4 col-form-label">DB호스트</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input type="text" class="form-control" name="db_host" id="db_host" placeholder="호스트" value="localhost" /> <input type="text" class="form-control" name="db_host" id="db_host"
</div> placeholder="호스트" value="localhost" />
</div> </div>
<div class="form-group row">
<label for="db_port" class="col-sm-4 col-form-label">DB포트</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="db_port" id="db_port" placeholder="접속 포트" value="3306" />
</div>
</div>
<div class="form-group row">
<label for="db_id" class="col-sm-4 col-form-label">DB계정명</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="db_id" id="db_id" placeholder="DB계정" />
</div>
</div>
<div class="form-group row">
<label for="db_pw" class="col-sm-4 col-form-label">DB비밀번호</label>
<div class="col-sm-8">
<input type="password" class="form-control" name="db_pw" id="db_pw" placeholder="DB비밀번호" />
</div>
</div>
<div class="form-group row">
<label for="db_name" class="col-sm-4 col-form-label">DB명</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="db_name" id="db_name" placeholder="DB명(예:sammo)" />
</div>
</div>
<div class="form-group row">
<label for="serv_host" class="col-sm-4 col-form-label">접속 경로</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="serv_host" id="serv_host" placeholder="접속경로(예:http://www.example.com)" />
</div>
</div>
<div class="form-group row">
<label for="shared_icon_path" class="col-sm-4 col-form-label">공용 아이콘 주소</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="shared_icon_path" id="shared_icon_path" placeholder="공용 아이콘 주소(웹 주소, 또는 접속 경로에 따른 상대 주소)" value="../image/icons" />
</div>
</div>
<div class="form-group row">
<label for="game_image_path" class="col-sm-4 col-form-label">게임 이미지 주소</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="game_image_path" id="game_image_path" placeholder="게임 이미지 주소(웹 주소, 또는 접속 경로에 따른 상대 주소)" value="../image/game" />
</div>
</div>
<div class="form-group row">
<label for="image_request_key" class="col-sm-4 col-form-label">이미지 갱신 </label>
<div class="input-group col-sm-8">
<input type="text" class="form-control" name="image_request_key" id="image_request_key" placeholder="이미지 서버의 hook/HashKey.php의 값과 동일하게" value="" />
<div class="input-group-text">
<button id="btn_random_generate_key" class="btn btn-secondary" type="button">랜덤 생성</button>
</div>
</div>
</div>
<hr style="width:100%; border-top: 1px solid lightgray;">
<div class="form-group row">
<label for="kakao_rest_key" class="col-sm-4 col-form-label">카카오 API Rest Key</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="kakao_rest_key" id="kakao_rest_key" placeholder="카카오톡 API의 Rest Key" value="" />
</div>
</div>
<div class="form-group row">
<label for="kakao_admin_key" class="col-sm-4 col-form-label">카카오 API Admin Key</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="kakao_admin_key" id="kakao_admin_key" placeholder="카카오톡 API의 Admin Key" value="" />
</div>
</div>
<div class="form-group row">
<div class="col-sm-4"></div>
<div class="col-sm-8">
<button type="submit" class="btn btn-primary btn-lg btn-block login-button">설정 파일 생성</button>
</div>
</div>
</form>
</div> </div>
</div>
<!--DB -->
<div class="card" id="admin_form_card" style="display:none"> <div class="form-group row">
<h3 class="card-header"> <label for="db_port" class="col-sm-4 col-form-label">DB포트</label>
설치(관리자 생성) <div class="col-sm-8">
</h3> <input type="text" class="form-control" name="db_port" id="db_port"
<div class="card-body"> placeholder="접속 포트" value="3306" />
<form id="admin_form" method="post" action="#"> </div>
<div class="form-group row"> </div>
<label for="username" class="col-sm-3 col-form-label">계정명</label>
<div class="col-sm-9"> <div class="form-group row">
<input type="text" class="form-control" name="username" id="username" placeholder="계정명" /> <label for="db_id" class="col-sm-4 col-form-label">DB계정명</label>
</div> <div class="col-sm-8">
</div> <input type="text" class="form-control" name="db_id" id="db_id" placeholder="DB계정"/>
</div>
<div class="form-group row">
<label for="password" class="col-sm-3 col-form-label">비밀번호</label>
<div class="col-sm-9">
<input type="password" class="form-control" name="password" id="password" placeholder="비밀번호" />
</div>
</div>
<div class="form-group row">
<label for="confirm_password" class="col-sm-3 col-form-label">비밀번호 확인</label>
<div class="col-sm-9">
<input type="password" class="form-control" name="confirm_password" id="confirm_password" placeholder="비밀번호 확인" />
</div>
</div>
<div class="form-group row">
<label for="nickname" class="col-sm-3 col-form-label">닉네임</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="nickname" id="nickname" placeholder="닉네임" value="운영자" />
</div>
</div>
<input type="hidden" id="global_salt" name="global_salt">
<div class="form-group row">
<div class="col-sm-3"></div>
<div class="col-sm-9">
<button type="submit" class="btn btn-primary btn-lg btn-block login-button">관리자 계정 생성</button>
</div>
</div>
</form>
</div> </div>
</div>
<!--ADMIN -->
<!-- TODO: conf_kakao.php -->
<div class="form-group row">
<label for="db_pw" class="col-sm-4 col-form-label">DB비밀번호</label>
<div class="col-sm-8">
<input type="password" class="form-control" name="db_pw" id="db_pw"
placeholder="DB비밀번호"/>
</div>
</div>
<div class="form-group row">
<label for="db_name" class="col-sm-4 col-form-label">DB명</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="db_name" id="db_name"
placeholder="DB명(예:sammo)"/>
</div>
</div>
<div class="form-group row">
<label for="serv_host" class="col-sm-4 col-form-label">접속 경로</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="serv_host" id="serv_host"
placeholder="접속경로(예:http://www.example.com)"/>
</div>
</div>
<div class="form-group row">
<label for="shared_icon_path" class="col-sm-4 col-form-label">공용 아이콘 주소</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="shared_icon_path" id="shared_icon_path"
placeholder="공용 아이콘 주소(웹 주소, 또는 접속 경로에 따른 상대 주소)"
value="../image/icons" />
</div>
</div>
<div class="form-group row">
<label for="game_image_path" class="col-sm-4 col-form-label">게임 이미지 주소</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="game_image_path" id="game_image_path"
placeholder="게임 이미지 주소(웹 주소, 또는 접속 경로에 따른 상대 주소)"
value="../image/game" />
</div>
</div>
<div class="form-group row">
<div class="col-sm-4"></div>
<div class="col-sm-8">
<button type="submit"
class="btn btn-primary btn-lg btn-block login-button">설정 파일 생성</button>
</div>
</div>
</form>
</div> </div>
</div><!--DB -->
<div class="card" id="admin_form_card" style="display:none">
<h3 class="card-header">
설치(관리자 생성)
</h3>
<div class="card-body">
<form id="admin_form" method="post" action="#">
<div class="form-group row">
<label for="username" class="col-sm-3 col-form-label">계정명</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="username" id="username"
placeholder="계정명"/>
</div>
</div>
<div class="form-group row">
<label for="password" class="col-sm-3 col-form-label">비밀번호</label>
<div class="col-sm-9">
<input type="password" class="form-control" name="password" id="password"
placeholder="비밀번호"/>
</div>
</div>
<div class="form-group row">
<label for="confirm_password" class="col-sm-3 col-form-label">비밀번호 확인</label>
<div class="col-sm-9">
<input type="password" class="form-control" name="confirm_password" id="confirm_password"
placeholder="비밀번호 확인"/>
</div>
</div>
<div class="form-group row">
<label for="nickname" class="col-sm-3 col-form-label">닉네임</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="nickname" id="nickname"
placeholder="닉네임" value="운영자"/>
</div>
</div>
<input type="hidden" id="global_salt" name="global_salt">
<div class="form-group row">
<div class="col-sm-3"></div>
<div class="col-sm-9">
<button type="submit"
class="btn btn-primary btn-lg btn-block login-button">관리자 계정 생성</button>
</div>
</div>
</form>
</div>
</div><!--ADMIN -->
<!-- TODO: conf_kakao.php -->
</div>
</div> </div>
</div> </div>
</body> </body>
</html>
</html>
+33 -34
View File
@@ -1,34 +1,33 @@
<?php <?php
namespace sammo; namespace sammo;
require(__DIR__ . '/../vendor/autoload.php'); require(__dir__.'/../vendor/autoload.php');
session_start(); session_start();
session_destroy(); session_destroy();
$username = mb_strtolower(Util::getPost('username'), 'utf-8'); $username = mb_strtolower(Util::getReq('username'), 'utf-8');
$password = Util::getPost('password', 'string'); $password = Util::getReq('password', 'string');
$nickname = Util::getPost('nickname'); $nickname = Util::getReq('nickname');
if (!$username || !$password || !$nickname) { if(!$username || !$password || !$nickname){
Json::die([ Json::die([
'result' => false, 'result'=>false,
'reason' => '입력값이 설정되지 않았습니다.' 'reason'=>'입력값이 설정되지 않았습니다.'
]); ]);
} }
if (strlen((string) $password) != 128) { if(strlen((string)$password)!=128){
Json::die([ Json::die([
'result' => false, 'result'=>false,
'reason' => '올바르지 않은 비밀번호 해시 포맷입니다.' 'reason'=>'올바르지 않은 비밀번호 해시 포맷입니다.'
]); ]);
} }
if (!class_exists('\\sammo\\RootDB')) { if(!class_exists('\\sammo\\RootDB')){
Json::die([ Json::die([
'result' => false, 'result'=>false,
'reason' => 'DB 설정이 완료되지 않았습니다.' 'reason'=>'DB 설정이 완료되지 않았습니다.'
]); ]);
} }
@@ -38,43 +37,43 @@ $rootDB = RootDB::db();
$rootDB->query('LOCK TABLES member WRITE, member_log WRITE'); $rootDB->query('LOCK TABLES member WRITE, member_log WRITE');
$memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from member'); $memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from member');
if ($memberCnt > 0) { if($memberCnt > 0){
Json::die([ Json::die([
'result' => 'false', 'result'=>'false',
'reason' => '이미 계정이 생성되어 있습니다' 'reason'=>'이미 계정이 생성되어 있습니다'
]); ]);
} }
$userSalt = bin2hex(random_bytes(8)); $userSalt = bin2hex(random_bytes(8));
$finalPassword = Util::hashPassword($userSalt, $password); $finalPassword = Util::hashPassword($userSalt, $password);
$nowDate = TimeUtil::now(); $nowDate = TimeUtil::DatetimeNow();
$rootDB->insert('member', [ $rootDB->insert('member',[
'oauth_type' => 'NONE', 'oauth_type' => 'NONE',
'id' => $username, 'id' => $username,
'email' => null, 'email' => null,
'token_valid_until' => '2999-01-01 00:00:00', 'token_valid_until'=>'2999-01-01 00:00:00',
'pw' => $finalPassword, 'pw' => $finalPassword,
'salt' => $userSalt, 'salt' => $userSalt,
'grade' => 6, 'grade'=> 6,
'name' => $nickname, 'name'=>$nickname,
'reg_date' => $nowDate 'reg_date'=>$nowDate
]); ]);
$userID = $rootDB->insertId(); $userID = $rootDB->insertId();
$rootDB->insert('member_log', [ $rootDB->insert('member_log', [
'member_no' => $userID, 'member_no'=>$userID,
'date' => $nowDate, 'date'=>$nowDate,
'action_type' => 'reg', 'action_type'=>'reg',
'action' => Json::encode([ 'action'=>Json::encode([
'type' => 'none', 'type'=>'none',
'aux' => 'admin', 'aux'=>'admin',
'id' => $username, 'id'=>$username,
'name' => $nickname 'name'=>$nickname
]) ])
]); ]);
Json::die([ Json::die([
'result' => true, 'result'=>true,
'reason' => 'success' 'reason'=>'success'
]); ]);
+12 -18
View File
@@ -1,44 +1,38 @@
<?php <?php
namespace sammo; namespace sammo;
if(!file_exists(__DIR__ . '/../vendor/autoload.php')){ require(__dir__.'/../vendor/autoload.php');
http_response_code(503);
die('not_ready');
}
require(__DIR__ . '/../vendor/autoload.php'); if(!class_exists('\\sammo\\RootDB')){
if (!class_exists('\\sammo\\RootDB')) {
Json::die([ Json::die([
'step' => 'config' 'step'=>'config'
]); ]);
} }
$rootDB = RootDB::db(); $rootDB = RootDB::db();
$rootDB->throw_exception_on_nonsql_error = false; $rootDB->throw_exception_on_nonsql_error = false;
$rootDB->nonsql_error_handler = function ($params) { $rootDB->nonsql_error_handler = function($params){
Json::die([ Json::die([
'step' => 'conn_fail' 'step'=>'conn_fail'
]); ]);
}; };
$rootDB->error_handler = function ($params) { $rootDB->error_handler = function($params){
Json::die([ Json::die([
'step' => 'sql_fail' 'step'=>'sql_fail'
]); ]);
}; };
$memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from member'); $memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from member');
if ($memberCnt == 0) { if($memberCnt == 0){
Json::die([ Json::die([
'step' => 'admin', 'step'=>'admin',
'globalSalt' => RootDB::getGlobalSalt() 'globalSalt'=>RootDB::getGlobalSalt()
]); ]);
} }
Json::die([ Json::die([
'step' => 'done' 'step'=>'done'
]); ]);
+284 -313
View File
@@ -1,313 +1,284 @@
<?php <?php
namespace sammo;
namespace sammo;
require(__dir__.'/../vendor/autoload.php');
require(__DIR__ . '/../vendor/autoload.php');
$host = Util::getReq('db_host');
$host = Util::getPost('db_host'); $port = Util::getReq('db_port', 'int');
$port = Util::getPost('db_port', 'int'); $username = Util::getReq('db_id');
$username = Util::getPost('db_id'); $password = Util::getReq('db_pw');
$password = Util::getPost('db_pw'); $dbName = Util::getReq('db_name');
$dbName = Util::getPost('db_name'); $servHost = Util::getReq('serv_host');
$servHost = Util::getPost('serv_host'); $sharedIconPath = Util::getReq('shared_icon_path');
$sharedIconPath = Util::getPost('shared_icon_path'); $gameImagePath = Util::getReq('game_image_path');
$gameImagePath = Util::getPost('game_image_path');
$imageRequestKey = Util::getPost('image_request_key'); if (!$host || !$port || !$username || !$password || !$dbName || !$servHost || !$sharedIconPath || !$gameImagePath) {
Json::die([
$kakaoRESTKey = Util::getPost('kakao_rest_key', 'string', ''); 'result'=>false,
$kakaoAdminKey = Util::getPost('kakao_admin_key', 'string', ''); 'reason'=>'입력 값이 올바르지 않습니다'
]);
}
if (!$host || !$port || !$username || !$password || !$dbName || !$servHost || !$sharedIconPath || !$gameImagePath) {
Json::die([ if (!filter_var($servHost, FILTER_VALIDATE_URL)) {
'result' => false, Json::die([
'reason' => '입력 값이 올바르지 않습니다' 'result'=>false,
]); 'reason'=>'접속 경로가 올바르지 않습니다.'
} ]);
}
if (!filter_var($servHost, FILTER_VALIDATE_URL)) {
Json::die([ if (file_exists(ROOT.'/d_setting/RootDB.php') && is_dir(ROOT.'/d_setting/RootDB.php')) {
'result' => false, Json::die([
'reason' => '접속 경로가 올바르지 않습니다.' 'result'=>false,
]); 'reason'=>'d_setting/RootDB.php 가 디렉토리입니다'
} ]);
}
if (file_exists(ROOT . '/d_setting/RootDB.php') && is_dir(ROOT . '/d_setting/RootDB.php')) {
Json::die([ if (class_exists('\\sammo\\RootDB')) {
'result' => false, Json::die([
'reason' => 'd_setting/RootDB.php 가 디렉토리입니다' 'result'=>false,
]); 'reason'=>'이미 RootDB.php 파일이 있습니다'
} ]);
}
if (class_exists('\\sammo\\RootDB')) {
Json::die([ //파일 권한 검사
'result' => false, if (file_exists(AppConf::getUserIconPathFS()) && !is_dir(AppConf::getUserIconPathFS())) {
'reason' => '이미 RootDB.php 파일이 있습니다' Json::die([
]); 'result'=>false,
} 'reason'=>AppConf::$userIconPath.' 이 디렉토리가 아닙니다'
]);
//파일 권한 검사 }
if (file_exists(AppConf::getUserIconPathFS()) && !is_dir(AppConf::getUserIconPathFS())) {
Json::die([ if (file_exists(ROOT.'/d_log') && !is_dir(ROOT.'/d_log')) {
'result' => false, Json::die([
'reason' => AppConf::$userIconPath . ' 이 디렉토리가 아닙니다' 'result'=>false,
]); 'reason'=>'d_log 가 디렉토리가 아닙니다'
} ]);
}
if (file_exists(ROOT . '/d_log') && !is_dir(ROOT . '/d_log')) {
Json::die([ if (file_exists(ROOT.'/d_shared') && !is_dir(ROOT.'/d_shared')) {
'result' => false, Json::die([
'reason' => 'd_log 가 디렉토리가 아닙니다' 'result'=>false,
]); 'reason'=>'d_shared 가 디렉토리가 아닙니다'
} ]);
}
if (file_exists(ROOT . '/d_shared') && !is_dir(ROOT . '/d_shared')) {
Json::die([ if (file_exists(ROOT.'/d_setting') && !is_dir(ROOT.'/d_setting')) {
'result' => false, Json::die([
'reason' => 'd_shared 가 디렉토리가 아닙니다' 'result'=>false,
]); 'reason'=>'d_shared 가 디렉토리가 아닙니다'
} ]);
}
if (file_exists(ROOT . '/d_setting') && !is_dir(ROOT . '/d_setting')) {
Json::die([ if (!file_exists(ROOT.'/d_log')
'result' => false, || !file_exists(ROOT.'/d_shared')
'reason' => 'd_shared 가 디렉토리가 아닙니다' || !file_exists(ROOT.'/d_setting')
]); || !file_exists(AppConf::getUserIconPathFS())
} ) {
if (!is_writable(ROOT)) {
if ( Json::die([
!file_exists(ROOT . '/d_log') 'result'=>false,
|| !file_exists(ROOT . '/d_shared') 'reason'=>'하위 디렉토리 생성 권한이 없습니다'
|| !file_exists(ROOT . '/d_setting') ]);
|| !file_exists(AppConf::getUserIconPathFS()) }
) {
if (!is_writable(ROOT)) { //기본 파일 생성
Json::die([ if (!file_exists(AppConf::getUserIconPathFS())) {
'result' => false, mkdir(AppConf::getUserIconPathFS());
'reason' => '하위 디렉토리 생성 권한이 없습니다' }
]);
} if (!file_exists(ROOT.'/d_log')) {
mkdir(ROOT.'/d_log');
//기본 파일 생성 }
if (!file_exists(AppConf::getUserIconPathFS())) {
mkdir(AppConf::getUserIconPathFS()); if (!file_exists(ROOT.'/d_setting')) {
} mkdir(ROOT.'/d_setting');
}
if (!file_exists(ROOT . '/d_log')) {
mkdir(ROOT . '/d_log'); if (!file_exists(ROOT.'/d_shared')) {
} mkdir(ROOT.'/d_shared');
}
if (!file_exists(ROOT . '/d_setting')) { }
mkdir(ROOT . '/d_setting');
}
if (!is_writable(AppConf::getUserIconPathFS())) {
if (!file_exists(ROOT . '/d_shared')) { Json::die([
mkdir(ROOT . '/d_shared'); 'result'=>false,
} 'reason'=>AppConf::$userIconPath.' 디렉토리의 쓰기 권한이 없습니다'
} ]);
}
if (!is_writable(AppConf::getUserIconPathFS())) { if (!is_writable(ROOT.'/d_log')) {
Json::die([ Json::die([
'result' => false, 'result'=>false,
'reason' => AppConf::$userIconPath . ' 디렉토리의 쓰기 권한이 없습니다' 'reason'=>'d_log 디렉토리의 쓰기 권한이 없습니다'
]); ]);
} }
if (!is_writable(ROOT . '/d_log')) { if (!is_writable(ROOT.'/d_shared')) {
Json::die([ Json::die([
'result' => false, 'result'=>false,
'reason' => 'd_log 디렉토리의 쓰기 권한이 없습니다' 'reason'=>'d_shared 디렉토리의 쓰기 권한이 없습니다'
]); ]);
} }
if (!is_writable(ROOT . '/d_shared')) { if (!is_writable(ROOT.'/d_setting')) {
Json::die([ Json::die([
'result' => false, 'result'=>false,
'reason' => 'd_shared 디렉토리의 쓰기 권한이 없습니다' 'reason'=>'d_setting 디렉토리의 쓰기 권한이 없습니다.'
]); ]);
} }
if (!is_writable(ROOT . '/d_setting')) {
Json::die([
'result' => false, if (!file_exists(ROOT.'/d_log/.htaccess')) {
'reason' => 'd_setting 디렉토리의 쓰기 권한이 없습니다.' @file_put_contents(ROOT.'/d_log/.htaccess', 'Deny from all');
]); }
}
if (!file_exists(ROOT.'/d_setting/.htaccess')) {
@file_put_contents(ROOT.'/d_setting/.htaccess', 'Deny from all');
}
if (!file_exists(ROOT . '/d_log/.htaccess')) {
@file_put_contents(ROOT . '/d_log/.htaccess', 'Deny from all'); //DB 접근 권한 검사
}
$rootDB = new \MeekroDB($host, $username, $password, $dbName, $port, 'utf8mb4');
if (!file_exists(ROOT . '/d_setting/.htaccess')) { $rootDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true;
@file_put_contents(ROOT . '/d_setting/.htaccess', 'Deny from all');
} $rootDB->throw_exception_on_nonsql_error = false;
$rootDB->nonsql_error_handler = function ($params) {
//DB 접근 권한 검사 Json::die([
'result'=>false,
$rootDB = new \MeekroDB($host, $username, $password, $dbName, $port, 'utf8mb4'); 'reason'=>'DB 접속에 실패했습니다.'
$rootDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true; ]);
};
$rootDB->throw_exception_on_nonsql_error = false;
$rootDB->nonsql_error_handler = function ($params) { $rootDB->error_handler = function ($params) {
Json::die([ Json::die([
'result' => false, 'result'=>false,
'reason' => 'DB 접속에 실패했습니다.' 'reason'=>'SQL을 제대로 실행하지 못했습니다. DB상태를 확인해 주세요.'
]); ]);
}; };
$rootDB->error_handler = function ($params) { $mysqli_obj = $rootDB->get(); //로그인에 실패할 경우 자동으로 dbConnFail()이 실행됨.
Json::die([
'result' => false, if ($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/common_schema.sql'))) {
'reason' => 'SQL을 제대로 실행하지 못했습니다. DB상태를 확인해 주세요.' while (true) {
]); if (!$mysqli_obj->more_results()) {
}; break;
}
$mysqli_obj = $rootDB->get(); //로그인에 실패할 경우 자동으로 dbConnFail()이 실행됨. if (!$mysqli_obj->next_result()) {
break;
if ($mysqli_obj->multi_query(file_get_contents(__DIR__ . '/sql/common_schema.sql'))) { }
while (true) { }
if (!$mysqli_obj->more_results()) { }
break;
} $rootDB->insert('system', array(
if (!$mysqli_obj->next_result()) { 'REG' => 'N',
break; 'LOGIN' => 'N',
} 'CRT_DATE' => TimeUtil::DatetimeNow(),
} 'MDF_DATE' => TimeUtil::DatetimeNow()
} ));
$rootDB->insert('system', array( $globalSalt = bin2hex(random_bytes(16));
'REG' => 'N',
'LOGIN' => 'N', '@phan-var-force string $servHost';
'CRT_DATE' => TimeUtil::now(), '@phan-var-force string $sharedIconPath';
'MDF_DATE' => TimeUtil::now() '@phan-var-force string $gameImagePath';
));
$sharedIconPath = WebUtil::resolveRelativePath($sharedIconPath, $servHost);
$globalSalt = bin2hex(random_bytes(16)); $gameImagePath = WebUtil::resolveRelativePath($gameImagePath, $servHost);
'@phan-var-force string $servHost'; $result = Util::generateFileUsingSimpleTemplate(
'@phan-var-force string $sharedIconPath'; __dir__.'/templates/ServConfig.orig.php',
'@phan-var-force string $gameImagePath'; ROOT.'/d_setting/ServConfig.php',
[
$sharedIconPath = WebUtil::resolveRelativePath($sharedIconPath, $servHost); 'serverBasePath'=>$servHost,
$gameImagePath = WebUtil::resolveRelativePath($gameImagePath, $servHost); 'sharedIconPath'=>$sharedIconPath,
$imageRequestPath = WebUtil::resolveRelativePath($gameImagePath . '/../hook/git_pull.php', $servHost); 'gameImagePath'=>$gameImagePath
$imageKeyInstallPath = WebUtil::resolveRelativePath($gameImagePath . '/../hook/InstallKey.php', $servHost); ],
true
$result = Util::generateFileUsingSimpleTemplate( );
__DIR__ . '/templates/ServConfig.orig.php',
ROOT . '/d_setting/ServConfig.php', if ($result !== true) {
[ Json::die([
'serverBasePath' => $servHost, 'result'=>false,
'sharedIconPath' => $sharedIconPath, 'reason'=>$result
'gameImagePath' => $gameImagePath, ]);
'imageRequestPath' => $imageRequestPath, }
'imageRequestKey' => $imageRequestKey,
'serverList' => [ $result = Util::generateFileUsingSimpleTemplate(
['che', '체', 'white'], __dir__.'/templates/common_path.orig.js',
['kwe', '퀘', 'yellow'], ROOT.'/d_shared/common_path.js',
['pwe', '풰', 'orange'], [
['twe', '퉤', 'magenta'], 'serverBasePath'=>$servHost,
['nya', '냐', '#e67e22'], 'sharedIconPath'=>$sharedIconPath,
['pya', '퍄', '#9b59b6'] 'gameImagePath'=>$gameImagePath
] ],
], true
true );
);
$result = Util::generateFileUsingSimpleTemplate(
if ($imageRequestKey) { __dir__.'/templates/menu.orig.json',
@file_get_contents($imageKeyInstallPath . '?key=' . $imageRequestKey); ROOT.'/d_shared/menu.json',
} [],
true
if ($result !== true) { );
Json::die([
'result' => false, if ($result !== true) {
'reason' => $result Json::die([
]); 'result'=>false,
} 'reason'=>$result
]);
$result = Util::generateFileUsingSimpleTemplate( }
__DIR__ . '/templates/common_path.orig.js',
ROOT . '/d_shared/common_path.js',
[ $result = Util::generateFileUsingSimpleTemplate(
'serverBasePath' => $servHost, __dir__.'/templates/common.orig.css',
'sharedIconPath' => $sharedIconPath, ROOT.'/d_shared/common.css',
'gameImagePath' => $gameImagePath [
], 'serverBasePath'=>$servHost,
true 'sharedIconPath'=>$sharedIconPath,
); 'gameImagePath'=>$gameImagePath
],
$result = Util::generateFileUsingSimpleTemplate( true
__DIR__ . '/templates/menu.orig.json', );
ROOT . '/d_shared/menu.json',
[], if ($result !== true) {
true Json::die([
); 'result'=>false,
'reason'=>$result
if ($result !== true) { ]);
Json::die([ }
'result' => false,
'reason' => $result
]); $result = Util::generateFileUsingSimpleTemplate(
} __dir__.'/templates/RootDB.orig.php',
ROOT.'/d_setting/RootDB.php',
[
$result = Util::generateFileUsingSimpleTemplate( 'host'=>$host,
__DIR__ . '/templates/common.orig.css', 'user'=>$username,
ROOT . '/d_shared/common.css', 'password'=>$password,
[ 'dbName'=>$dbName,
'serverBasePath' => $servHost, 'port'=>$port,
'sharedIconPath' => $sharedIconPath, 'globalSalt'=>$globalSalt,
'gameImagePath' => $gameImagePath ]
], );
true
); Util::generateFileUsingSimpleTemplate(
__dir__.'/templates/KakaoKey.orig.php',
if ($result !== true) { ROOT.'/d_setting/KakaoKey.php',
Json::die([ [
'result' => false, ],
'reason' => $result true
]); );
}
if ($result !== true) {
Json::die([
$result = Util::generateFileUsingSimpleTemplate( 'result'=>false,
__DIR__ . '/templates/RootDB.orig.php', 'reason'=>$result
ROOT . '/d_setting/RootDB.php', ]);
[ }
'host' => $host,
'user' => $username, Json::die([
'password' => $password, 'result'=>true,
'dbName' => $dbName, 'reason'=>'success'
'port' => $port, ]);
'globalSalt' => $globalSalt,
]
);
$kakaoRedirectURI = WebUtil::resolveRelativePath('oauth_kakao/oauth.php', $servHost . '/');
Util::generateFileUsingSimpleTemplate(
__DIR__ . '/templates/KakaoKey.orig.php',
ROOT . '/d_setting/KakaoKey.php',
[
'REST_API_KEY' => $kakaoRESTKey,
'ADMIN_KEY' => $kakaoAdminKey,
'REDIRECT_URI' => $kakaoRedirectURI
],
true
);
if ($result !== true) {
Json::die([
'result' => false,
'reason' => $result
]);
}
Json::die([
'result' => true,
'reason' => 'success',
'globalSalt' => $globalSalt
]);
-114
View File
@@ -1,114 +0,0 @@
<?php
namespace sammo;
require(__DIR__ . '/../vendor/autoload.php');
$session = Session::requireLogin([])->setReadOnly();
if ($session->userGrade < 6) {
Json::die([
'result' => false,
'reason' => '관리자 아님'
]);
}
$servHost = Util::getPost('serv_host');
$sharedIconPath = Util::getPost('shared_icon_path');
$gameImagePath = Util::getPost('game_image_path');
if ($servHost) {
if (!$sharedIconPath || $gameImagePath) {
Json::die([
'result' => false,
'reason' => 'serv_host가 지정된 경우, sharedIconPath와 gameImagePath가 모두 지정되어야합니다.'
]);
}
$sharedIconPath = WebUtil::resolveRelativePath($sharedIconPath, $servHost);
$gameImagePath = WebUtil::resolveRelativePath($gameImagePath, $servHost);
$result = Util::generateFileUsingSimpleTemplate(
__DIR__ . '/templates/ServConfig.orig.php',
ROOT . '/d_setting/ServConfig.php',
[
'serverBasePath' => $servHost,
'sharedIconPath' => $sharedIconPath,
'gameImagePath' => $gameImagePath
],
true
);
if ($result !== true) {
Json::die([
'result' => false,
'reason' => $result
]);
}
} else if ($sharedIconPath || $gameImagePath) {
$servHost = ServConfig::$serverWebPath;
if ($sharedIconPath) {
$sharedIconPath = WebUtil::resolveRelativePath($sharedIconPath, $servHost);
} else {
$sharedIconPath = ServConfig::$sharedIconPath;
}
if ($gameImagePath) {
$gameImagePath = WebUtil::resolveRelativePath($gameImagePath, $servHost);
} else {
$gameImagePath = ServConfig::$gameImagePath;
}
$result = Util::generateFileUsingSimpleTemplate(
__DIR__ . '/templates/ServConfig.orig.php',
ROOT . '/d_setting/ServConfig.php',
[
'serverBasePath' => $servHost,
'sharedIconPath' => $sharedIconPath,
'gameImagePath' => $gameImagePath
],
true
);
if ($result !== true) {
Json::die([
'result' => false,
'reason' => $result
]);
}
} else {
$servHost = ServConfig::$serverWebPath;
$sharedIconPath = ServConfig::$sharedIconPath;
$gameImagePath = ServConfig::$gameImagePath;
}
$result = Util::generateFileUsingSimpleTemplate(
__DIR__ . '/templates/common_path.orig.js',
ROOT . '/d_shared/common_path.js',
[
'serverBasePath' => $servHost,
'sharedIconPath' => $sharedIconPath,
'gameImagePath' => $gameImagePath
],
true
);
$result = Util::generateFileUsingSimpleTemplate(
__DIR__ . '/templates/common.orig.css',
ROOT . '/d_shared/common.css',
[
'serverBasePath' => $servHost,
'sharedIconPath' => $sharedIconPath,
'gameImagePath' => $gameImagePath
],
true
);
if ($result !== true) {
Json::die([
'result' => false,
'reason' => $result
]);
}
+4 -19
View File
@@ -14,7 +14,7 @@ CREATE TABLE `system` (
`MDF_DATE` DATETIME NULL DEFAULT NULL, `MDF_DATE` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`NO`) PRIMARY KEY (`NO`)
) )
ENGINE=Aria DEFAULT CHARSET=utf8mb4; ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- 회원 테이블 -- 회원 테이블
CREATE TABLE `member` ( CREATE TABLE `member` (
@@ -45,7 +45,7 @@ CREATE TABLE `member` (
UNIQUE INDEX `kauth_id` (`oauth_id`), UNIQUE INDEX `kauth_id` (`oauth_id`),
INDEX `delete_after` (`delete_after`) INDEX `delete_after` (`delete_after`)
) )
ENGINE=Aria DEFAULT CHARSET=utf8mb4; ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- 로그인 로그 테이블 -- 로그인 로그 테이블
CREATE TABLE `member_log` ( CREATE TABLE `member_log` (
@@ -58,7 +58,7 @@ CREATE TABLE `member_log` (
INDEX `action` (`member_no`, `action_type`, `date`), INDEX `action` (`member_no`, `action_type`, `date`),
INDEX `member` (`member_no`, `date`) INDEX `member` (`member_no`, `date`)
) )
ENGINE=Aria DEFAULT CHARSET=utf8mb4; ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
################### ###################
# KV storage # KV storage
@@ -72,19 +72,4 @@ CREATE TABLE if not exists `storage` (
UNIQUE INDEX `key` (`namespace`, `key`) UNIQUE INDEX `key` (`namespace`, `key`)
) )
COLLATE='utf8mb4_general_ci' COLLATE='utf8mb4_general_ci'
ENGINE=Aria; ENGINE=MyISAM
CREATE TABLE `login_token` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`user_id` INT(11) NOT NULL,
`base_token` VARCHAR(20) NOT NULL COLLATE 'utf8mb4_general_ci',
`reg_ip` VARCHAR(40) NOT NULL COLLATE 'utf8mb4_general_ci',
`reg_date` DATETIME NOT NULL,
`expire_date` DATETIME NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `by_token` (`base_token`),
INDEX `by_date` (`user_id`, `expire_date`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=Aria
;
+1 -3
View File
@@ -3,9 +3,7 @@ CREATE TABLE IF NOT EXISTS `err_log` (
`date` TEXT NOT NULL, `date` TEXT NOT NULL,
`err` TEXT NOT NULL, `err` TEXT NOT NULL,
`errstr` TEXT NOT NULL, `errstr` TEXT NOT NULL,
`errpath` TEXT NOT NULL, `trace` TEXT NOT NULL
`trace` TEXT NOT NULL,
`webuser` TEXT NULL
); );
CREATE INDEX IF NOT EXISTS `date` ON `err_log` ( CREATE INDEX IF NOT EXISTS `date` ON `err_log` (
`date` DESC `date` DESC
-1
View File
@@ -1,7 +1,6 @@
<?php <?php
namespace kakao; namespace kakao;
// @suppress PhanRedefineClass
class KakaoKey{ class KakaoKey{
const REST_KEY = '_tK_REST_API_KEY_'; const REST_KEY = '_tK_REST_API_KEY_';
const ADMIN_KEY = '_tK_ADMIN_KEY_'; const ADMIN_KEY = '_tK_ADMIN_KEY_';
+1 -34
View File
@@ -1,16 +1,9 @@
<?php <?php
namespace sammo; namespace sammo;
//https://hub.packtpub.com/eloquent-without-laravel/
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;
class RootDB class RootDB
{ {
private static $uDB = null; private static $uDB = null;
private static ?Capsule $uIlluminate = null;
private static $host = '_tK_host_'; private static $host = '_tK_host_';
private static $user = '_tK_user_'; private static $user = '_tK_user_';
@@ -18,8 +11,6 @@ class RootDB
private static $dbName = '_tK_dbName_'; private static $dbName = '_tK_dbName_';
private static $port = _tK_port_; private static $port = _tK_port_;
private static $encoding = 'utf8mb4'; private static $encoding = 'utf8mb4';
private static $collation = 'utf8mb4_general_ci';
private static $globalSalt = '_tK_globalSalt_'; private static $globalSalt = '_tK_globalSalt_';
@@ -27,29 +18,6 @@ class RootDB
{ {
} }
public static function illuminate(): Capsule
{
if(self::$uIlluminate !== null){
return self::$uIlluminate;
}
$capsule = new Capsule;
$capsule->addConnection([
'driver' => 'mysql',
'host' => self::$host,
'database' => self::$dbName,
'username' => self::$user,
'password' => self::$password,
'charset' => self::$encoding,
'collation' => self::$collation,
], 'root');
$capsule->setEventDispatcher(new Dispatcher(new Container));
$capsule->bootEloquent();
self::$uIlluminate = $capsule;
return $capsule;
}
/** /**
* DB 객체 생성 * DB 객체 생성
* *
@@ -62,8 +30,7 @@ class RootDB
self::$uDB = new \MeekroDB(self::$host, self::$user, self::$password, self::$dbName, self::$port, self::$encoding); self::$uDB = new \MeekroDB(self::$host, self::$user, self::$password, self::$dbName, self::$port, self::$encoding);
self::$uDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true; self::$uDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true;
self::$uDB->error_handler = function () { self::$uDB->error_handler= function(){};
};
self::$uDB->throw_exception_on_error = true; self::$uDB->throw_exception_on_error = true;
self::$uDB->throw_exception_on_nonsql_error = true; self::$uDB->throw_exception_on_nonsql_error = true;
} }
+45 -74
View File
@@ -1,74 +1,45 @@
<?php <?php
namespace sammo;
namespace sammo;
class ServConfig
class ServConfig {
{ private function __construct()
private function __construct() {
{ }
}
public static $serverWebPath = '_tK_serverBasePath_';
public static $serverWebPath = '_tK_serverBasePath_'; public static $sharedIconPath = '_tK_sharedIconPath_';
public static $sharedIconPath = '_tK_sharedIconPath_'; public static $gameImagePath = "_tK_gameImagePath_";
public static $gameImagePath = "_tK_gameImagePath_";
public static $imageRequestPath = "_tK_imageRequestPath_"; public static function getSharedIconPath(string $filepath='') : string
public static $imageRequestKey = '_tK_imageRequestKey_'; {
private static $serverList = null; if($filepath){
return static::$sharedIconPath."/{$filepath}";
public static function getSharedIconPath(string $filepath = ''): string }
{ return static::$sharedIconPath;
if ($filepath) { }
return static::$sharedIconPath . "/{$filepath}";
} public static function getUserIconPath(string $filepath='') : string
return static::$sharedIconPath; {
} return AppConf::getUserIconPathWeb($filepath);
}
public static function getUserIconPath(string $filepath = ''): string
{ public static function getGameImagePath(string $filepath='') : string
return AppConf::getUserIconPathWeb($filepath); {
} if($filepath){
return static::$gameImagePath."/{$filepath}";
public static function getGameImagePath(string $filepath = ''): string }
{ return static::$gameImagePath;
if ($filepath) { }
return static::$gameImagePath . "/{$filepath}";
}
return static::$gameImagePath; /**
} * 서버 주소 반환. 서버의 경로가 하부 디렉토리인 경우에 하부 디렉토리까지 포함
*
public static function getImagePullURI(): string * @return string
{ */
$now = time(); public static function getServerBasepath() : string
$req_hash = Util::hashPassword(sprintf("%016x", $now), static::$imageRequestKey); {
return static::$imageRequestPath . "?req={$req_hash}&time={$now}"; return self::$serverWebPath;
} }
}
/**
* 서버 설정 반환
*
* @return \sammo\Setting[]
*/
public static function getServerList(): array{
$servKeyList = [/*_tK_serverList_*/];
$servKeyList[] = ['hwe', '훼', 'red'];
if (self::$serverList === null) {
self::$serverList = [];
foreach($servKeyList as [$servKey, $servNick, $servColor]){
self::$serverList[$servKey] = new Setting(ROOT.'/'.$servKey, $servNick, $servColor);
}
}
return self::$serverList;
}
/**
* 서버 주소 반환. 서버의 경로가 하부 디렉토리인 경우에 하부 디렉토리까지 포함
*
* @return string
*/
public static function getServerBasepath(): string
{
return self::$serverWebPath;
}
}
+31 -72
View File
@@ -6,33 +6,38 @@
.img_back {background-image:url('_tK_gameImagePath_/back.jpg'); } .img_back {background-image:url('_tK_gameImagePath_/back.jpg'); }
/* 레거시. */
#bg0 { background-image:url('_tK_gameImagePath_/back_walnut.jpg'); }
#bg1 { background-image:url('_tK_gameImagePath_/back_green.jpg'); }
#bg2 { background-image:url('_tK_gameImagePath_/back_blue.jpg'); }
.map_detail .map_title{ .map_detail .map_title{
background: background:
url('_tK_gameImagePath_/ltitle.jpg') no-repeat left, url('_tK_gameImagePath_/ltitle.jpg') no-repeat left,
url('_tK_gameImagePath_/rtitle.jpg') no-repeat right; url('_tK_gameImagePath_/rtitle.jpg') no-repeat right;
} }
.map_detail.map_spring .map_title_text{ .map_detail.map_spring .map_title_text{
background: background:
url('_tK_gameImagePath_/ad.gif') no-repeat left, url('_tK_gameImagePath_/ad.gif') no-repeat left,
url('_tK_gameImagePath_/spring.gif') no-repeat right; url('_tK_gameImagePath_/spring.gif') no-repeat right;
} }
.map_detail.map_summer .map_title_text{ .map_detail.map_summer .map_title_text{
background: background:
url('_tK_gameImagePath_/ad.gif') no-repeat left, url('_tK_gameImagePath_/ad.gif') no-repeat left,
url('_tK_gameImagePath_/summer.gif') no-repeat right; url('_tK_gameImagePath_/summer.gif') no-repeat right;
} }
.map_detail.map_fall .map_title_text{ .map_detail.map_fall .map_title_text{
background: background:
url('_tK_gameImagePath_/ad.gif') no-repeat left, url('_tK_gameImagePath_/ad.gif') no-repeat left,
url('_tK_gameImagePath_/fall.gif') no-repeat right; url('_tK_gameImagePath_/fall.gif') no-repeat right;
} }
.map_detail.map_winter .map_title_text{ .map_detail.map_winter .map_title_text{
background: background:
url('_tK_gameImagePath_/ad.gif') no-repeat left, url('_tK_gameImagePath_/ad.gif') no-repeat left,
url('_tK_gameImagePath_/winter.gif') no-repeat right; url('_tK_gameImagePath_/winter.gif') no-repeat right;
} }
@@ -83,59 +88,6 @@
background-size: 700px 500px; background-size: 700px 500px;
} }
/*미니체 지도*/
.map_theme_miniche_b.map_spring .map_bglayer1{
background: url('_tK_gameImagePath_/map/che/bg_spring.jpg') no-repeat;
background-size: 700px 500px;
}
.map_theme_miniche_b.map_summer .map_bglayer1{
background: url('_tK_gameImagePath_/map/che/bg_summer.jpg') no-repeat;
background-size: 700px 500px;
}
.map_theme_miniche_b.map_fall .map_bglayer1{
background: url('_tK_gameImagePath_/map/che/bg_fall.jpg') no-repeat;
background-size: 700px 500px;
}
.map_theme_miniche_b.map_winter .map_bglayer1{
background: url('_tK_gameImagePath_/map/che/bg_winter.jpg') no-repeat;
background-size: 700px 500px;
}
.map_theme_miniche_b .map_bgroad{
background: url('_tK_gameImagePath_/map/che/miniche_road.png') no-repeat;
background-size: 700px 500px;
}
/*미니체 지도*/
.map_theme_miniche_clean.map_spring .map_bglayer1{
background: url('_tK_gameImagePath_/map/che/bg_spring.jpg') no-repeat;
background-size: 700px 500px;
}
.map_theme_miniche_clean.map_summer .map_bglayer1{
background: url('_tK_gameImagePath_/map/che/bg_summer.jpg') no-repeat;
background-size: 700px 500px;
}
.map_theme_miniche_clean.map_fall .map_bglayer1{
background: url('_tK_gameImagePath_/map/che/bg_fall.jpg') no-repeat;
background-size: 700px 500px;
}
.map_theme_miniche_clean.map_winter .map_bglayer1{
background: url('_tK_gameImagePath_/map/che/bg_winter.jpg') no-repeat;
background-size: 700px 500px;
}
.map_theme_miniche_clean .map_bgroad{
background: url('_tK_gameImagePath_/map/che/miniche_road.png') no-repeat;
background-size: 700px 500px;
}
/*루드라사움 지도*/ /*루드라사움 지도*/
.map_theme_ludo_rathowm .map_bglayer1{ .map_theme_ludo_rathowm .map_bglayer1{
background: url('_tK_gameImagePath_/map/ludo_rathowm/back.jpg') no-repeat; background: url('_tK_gameImagePath_/map/ludo_rathowm/back.jpg') no-repeat;
@@ -147,21 +99,28 @@
background-size: 700px 500px; background-size: 700px 500px;
} }
.map_theme_ludo_rathowm.map_detail.map_spring .map_title_text{
background:
url('_tK_gameImagePath_/spring.gif') no-repeat right;
}
.map_theme_ludo_rathowm.map_detail.map_summer .map_title_text{
background:
url('_tK_gameImagePath_/summer.gif') no-repeat right;
}
.map_theme_ludo_rathowm.map_detail.map_fall .map_title_text{
background:
url('_tK_gameImagePath_/fall.gif') no-repeat right;
}
.map_theme_ludo_rathowm.map_detail.map_winter .map_title_text{
background:
url('_tK_gameImagePath_/winter.gif') no-repeat right;
}
.world_map.map_theme_ludo_rathowm .map_title .map_title_text::before { .world_map.map_theme_ludo_rathowm .map_title .map_title_text::before {
color:white; color:white;
content:'LP'; content:'LP';
margin-right:1ch; margin-right:1ch;
} }
/*체스판 지도*/
.map_theme_chess .map_bglayer1{
background: url('_tK_gameImagePath_/map/chess/chessboard.png') no-repeat;
background-size: 700px 500px;
}
/*포켓몬 v1 지도*/
.map_theme_pokemon_v1 .map_bglayer1{
background: url('_tK_gameImagePath_/map/pokemon_v1/back_pal8.png') no-repeat;
background-size: 700px 500px;
}
+30
View File
@@ -0,0 +1,30 @@
<?php
namespace sammo;
function MYDB_query($query, $connect)
{
return mysqli_query($connect, $query);
}
function MYDB_num_rows(\mysqli_result $result) : int
{
return mysqli_num_rows($result);
}
/**
* @return mixed[]
*/
function MYDB_fetch_array(\mysqli_result $result)
{
return mysqli_fetch_array($result);
}
function MYDB_fetch_row(\mysqli_result $result)
{
return mysqli_fetch_row($result);
}
function MYDB_error($connect)
{
return mysqli_error($connect);
}
+25 -5
View File
@@ -6,15 +6,35 @@ include "func.php";
$session = Session::requireGameLogin()->setReadOnly(); $session = Session::requireGameLogin()->setReadOnly();
if($session->userGrade < 4) { if($session->userGrade < 4) {
die(requireAdminPermissionHTML()); ?>
<!DOCTYPE html>
<html>
<head>
<title>관리메뉴</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
<body>
관리자가 아닙니다.<br>
<?=banner()?>
</body>
</html>
<?php
exit();
} }
$db = DB::db(); $db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
[$turntime, $tnmt_time] = $gameStor->getValuesAsArray(['turntime','tnmt_time']); [$turntime, $tnmt_time] = $gameStor->getValuesAsArray(['turntime','tnmt_time']);
$plock = $db->queryFirstField('SELECT plock FROM plock'); $query = "select plock from plock";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$plock = MYDB_fetch_array($result);
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@@ -24,15 +44,15 @@ $plock = $db->queryFirstField('SELECT plock FROM plock');
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" /> <meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?> <?=WebUtil::printCSS('../d_shared/common.css')?>
<?= WebUtil::printDist('ts', 'common', true) ?> <?=WebUtil::printCSS('css/common.css')?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
</head> </head>
<body> <body>
<form action=_119_b.php method=post> <form action=_119_b.php method=post>
시간조정 : <input type=text size=3 name=minute><input type=submit name=btn value='분당김'><input type=submit name=btn value='분지연'> 최종갱신 : <?=$turntime?><br> 시간조정 : <input type=text size=3 name=minute><input type=submit name=btn value='분당김'><input type=submit name=btn value='분지연'> 최종갱신 : <?=$turntime?><br>
시간조정 : <input type=text size=3 name=minute2><input type=submit name=btn value='토너분당김'><input type=submit name=btn value='토너분지연'> 토너먼트 : <?=$tnmt_time?><br> 시간조정 : <input type=text size=3 name=minute2><input type=submit name=btn value='토너분당김'><input type=submit name=btn value='토너분지연'> 토너먼트 : <?=$tnmt_time?><br>
봉급지급 : <input type=submit name=btn value='금지급'><input type=submit name=btn value='쌀지급'><br> 봉급지급 : <input type=submit name=btn value='금지급'><input type=submit name=btn value='쌀지급'><br>
: <input type=submit name=btn value='락걸기'><input type=submit name=btn value='락풀기'> 현재 : <?=$plock>0?"동결중":"가동중"?><br> : <input type=submit name=btn value='락걸기'><input type=submit name=btn value='락풀기'> 현재 : <?=$plock['plock']>0?"동결중":"가동중"?><br>
</form> </form>
</body> </body>
</html> </html>
+61 -89
View File
@@ -1,5 +1,4 @@
<?php <?php
namespace sammo; namespace sammo;
include "lib.php"; include "lib.php";
@@ -7,7 +6,7 @@ include "func.php";
$session = Session::requireGameLogin()->setReadOnly(); $session = Session::requireGameLogin()->setReadOnly();
if ($session->userGrade < 4) { if($session->userGrade < 4){
header('location:_119.php'); header('location:_119.php');
die(); die();
} }
@@ -17,102 +16,75 @@ $v->rule('integer', [
'minute', 'minute',
'minutes2' 'minutes2'
]); ]);
if (!$v->validate()) { if(!$v->validate()){
Error($v->errorStr()); Error($v->errorStr());
} }
$btn = Util::getPost('btn'); $btn = Util::getReq('btn');
$minute = Util::getPost('minute', 'int'); $minute = Util::getReq('minute', 'int');
$minute2 = Util::getPost('minute2', 'int'); $minute2 = Util::getReq('minute2', 'int');
extractMissingPostToGlobals();
$db = DB::db(); $db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
switch ($btn) { switch($btn) {
case "분당김": case "분당김":
$locked = false; $gameStor->cacheValues(['turntime', 'starttime', 'tnmt_time']);
for ($i = 0; $i < 10; $i++) { $turntime = (new \DateTimeImmutable($gameStor->turntime))->sub(new \DateInterval("PT{$minute}M"));
if (tryLock()) { $starttime = (new \DateTimeImmutable($gameStor->starttime))->sub(new \DateInterval("PT{$minute}M"));
$locked = true; $tnmt_time = (new \DateTimeImmutable($gameStor->tnmt_time))->sub(new \DateInterval("PT{$minute}M"));
break;
}
usleep(500000);
}
$gameStor->cacheValues(['turntime', 'starttime', 'tnmt_time']); $gameStor->turntime = $turntime->format('Y-m-d H:i:s');
$turntime = (new \DateTimeImmutable($gameStor->turntime))->sub(new \DateInterval("PT{$minute}M")); $gameStor->starttime = $starttime->format('Y-m-d H:i:s');
$starttime = (new \DateTimeImmutable($gameStor->starttime))->sub(new \DateInterval("PT{$minute}M")); $gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
$tnmt_time = (new \DateTimeImmutable($gameStor->tnmt_time))->sub(new \DateInterval("PT{$minute}M"));
$gameStor->turntime = $turntime->format('Y-m-d H:i:s.u'); $db->update('general', [
$gameStor->starttime = $starttime->format('Y-m-d H:i:s'); 'turntime'=>$db->sqleval('DATE_SUB(turntime, INTERVAL %i MINUTE)', $minute)
$gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s'); ], true);
$db->update('auction', [
'expire'=>$db->sqleval('DATE_SUB(expire, INTERVAL %i MINUTE)', $minute)
], true);
break;
case "분지연":
$gameStor->cacheValues(['turntime', 'starttime', 'tnmt_time']);
$turntime = (new \DateTimeImmutable($gameStor->turntime))->add(new \DateInterval("PT{$minute}M"));
$starttime = (new \DateTimeImmutable($gameStor->starttime))->add(new \DateInterval("PT{$minute}M"));
$tnmt_time = (new \DateTimeImmutable($gameStor->tnmt_time))->add(new \DateInterval("PT{$minute}M"));
$db->update('general', [ $gameStor->turntime = $turntime->format('Y-m-d H:i:s');
'turntime' => $db->sqleval('DATE_SUB(turntime, INTERVAL %i MINUTE)', $minute) $gameStor->starttime = $starttime->format('Y-m-d H:i:s');
], true); $gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
$db->update('auction', [
'expire' => $db->sqleval('DATE_SUB(expire, INTERVAL %i MINUTE)', $minute)
], true);
if ($locked) {
unlock();
}
break;
case "분지연":
$locked = false;
for ($i = 0; $i < 5; $i++) {
if (tryLock()) {
$locked = true;
break;
}
usleep(500000);
}
$gameStor->cacheValues(['turntime', 'starttime', 'tnmt_time']);
$turntime = (new \DateTimeImmutable($gameStor->turntime))->add(new \DateInterval("PT{$minute}M"));
$starttime = (new \DateTimeImmutable($gameStor->starttime))->add(new \DateInterval("PT{$minute}M"));
$tnmt_time = (new \DateTimeImmutable($gameStor->tnmt_time))->add(new \DateInterval("PT{$minute}M"));
$gameStor->turntime = $turntime->format('Y-m-d H:i:s.u'); $db->update('general', [
$gameStor->starttime = $starttime->format('Y-m-d H:i:s'); 'turntime'=>$db->sqleval('DATE_ADD(turntime, INTERVAL %i MINUTE)', $minute)
$gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s'); ], true);
$db->update('auction', [
$db->update('general', [ 'expire'=>$db->sqleval('DATE_ADD(expire, INTERVAL %i MINUTE)', $minute)
'turntime' => $db->sqleval('DATE_ADD(turntime, INTERVAL %i MINUTE)', $minute) ], true);
], true); break;
$db->update('auction', [ case "토너분당김":
'expire' => $db->sqleval('DATE_ADD(expire, INTERVAL %i MINUTE)', $minute) $tnmt_time = new \DateTime($gameStor->tnmt_time);
], true); $tnmt_time->sub(new \DateInterval("PT{$minute2}M"));
if ($locked) { $gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
unlock(); break;
} case "토너분지연":
break; $tnmt_time = new \DateTimeImmutable($gameStor->tnmt_time);
case "토너분당김": $tnmt_time->add(new \DateInterval("PT{$minute2}M"));
$tnmt_time = new \DateTime($gameStor->tnmt_time); $gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
$tnmt_time->sub(new \DateInterval("PT{$minute2}M")); break;
$gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s'); case "금지급":
break; processGoldIncome();
case "토너분지연": break;
$tnmt_time = new \DateTimeImmutable($gameStor->tnmt_time); case "쌀지급":
$tnmt_time->add(new \DateInterval("PT{$minute2}M")); processRiceIncome();
$gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s'); break;
break; case "락걸기":
case "금지급": $db->update('plock', ['plock'=>1], true);
processGoldIncome(); break;
break; case "락풀기":
case "쌀지급": $db->update('plock', ['plock'=>0], true);
processRiceIncome(); break;
break;
case "락걸기":
for ($i = 0; $i < 10; $i++) {
if (tryLock()) {
$locked = true;
break;
}
usleep(500000);
}
break;
case "락풀기":
unlock();
break;
} }
header('Location:_119.php', true, 303); header('Location:_119.php');
+27 -4
View File
@@ -7,10 +7,28 @@ include "func.php";
$session = Session::requireGameLogin()->setReadOnly(); $session = Session::requireGameLogin()->setReadOnly();
if($session->userGrade < 5) { if($session->userGrade < 5) {
die(requireAdminPermissionHTML()); ?>
<!DOCTYPE html>
<html>
<head>
<title>관리메뉴</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
<body>
관리자가 아닙니다.<br>
<?=banner()?>
</body>
</html>
<?php
exit();
} }
$db = DB::db(); $db = DB::db();
$connect=$db->get();
$admin = getAdmin(); $admin = getAdmin();
?> ?>
@@ -22,8 +40,7 @@ $admin = getAdmin();
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" /> <meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?> <?=WebUtil::printCSS('../d_shared/common.css')?>
<?= WebUtil::printDist('ts', 'common', true) ?> <?=WebUtil::printCSS('css/common.css')?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
</head> </head>
<body> <body>
<table align=center width=1000 class="tb_layout bg0"> <table align=center width=1000 class="tb_layout bg0">
@@ -39,7 +56,7 @@ $admin = getAdmin();
</tr> </tr>
<tr> <tr>
<td width=110 align=right>시작시간변경</td> <td width=110 align=right>시작시간변경</td>
<td width=285><input type=text size=20 maxlength=20 style=color:white;background-color:black;text-align:right; name=starttime value='<?=substr($admin['starttime'], 0, 19)?>'><input type=submit name=btn value=변경1></td> <td width=285><input type=text size=20 maxlength=20 style=color:white;background-color:black;text-align:right; name=starttime value='<?=$admin['starttime']?>'><input type=submit name=btn value=변경1></td>
<td width=110 align=right>현재도시훈사</td> <td width=110 align=right>현재도시훈사</td>
<td width=285><?=$admin['city_rate']?></td> <td width=285><?=$admin['city_rate']?></td>
</tr> </tr>
@@ -49,6 +66,12 @@ $admin = getAdmin();
<td width=110 align=right>최대 국가</td> <td width=110 align=right>최대 국가</td>
<td width=285><input type=text size=3 maxlength=2 style=color:white;background-color:black;text-align:right; name=maxnation value=<?=$admin['maxnation']?>><input type=submit name=btn value=변경3></td> <td width=285><input type=text size=3 maxlength=2 style=color:white;background-color:black;text-align:right; name=maxnation value=<?=$admin['maxnation']?>><input type=submit name=btn value=변경3></td>
</tr> </tr>
<tr>
<td width=110 align=right></td>
<td width=285></td>
<td width=110 align=right>현재 수입률</td>
<td width=285><?=$admin['gold_rate']?>%</td>
</tr>
<tr> <tr>
<td width=110 align=right>시작 년도</td> <td width=110 align=right>시작 년도</td>
<td width=285><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=startyear value='<?=$admin['startyear']?>'><input type=submit name=btn value=변경4></td> <td width=285><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=startyear value='<?=$admin['startyear']?>'><input type=submit name=btn value=변경4></td>
+45 -27
View File
@@ -22,16 +22,19 @@ if (!$v->validate()) {
Error($v->errorStr()); Error($v->errorStr());
} }
$msg = Util::getPost('msg'); $msg = Util::getReq('msg');
$btn = Util::getPost('btn'); $btn = Util::getReq('btn');
$log = Util::getPost('log'); $log = Util::getReq('log');
$starttime = Util::getPost('starttime', 'string', (new \DateTime())->format('Y-m-d H:i:s')); $starttime = Util::getReq('starttime', 'string', (new \DateTime())->format('Y-m-d H:i:s'));
$maxgeneral = Util::getPost('maxgeneral', 'int', GameConst::$defaultMaxGeneral); $maxgeneral = Util::getReq('maxgeneral', 'int', GameConst::$defaultMaxGeneral);
$maxnation = Util::getPost('maxnation', 'int', GameConst::$defaultMaxNation); $maxnation = Util::getReq('maxnation', 'int', GameConst::$defaultMaxNation);
$startyear = Util::getPost('startyear', 'int', GameConst::$defaultStartYear); $startyear = Util::getReq('startyear', 'int', GameConst::$defaultStartYear);
extractMissingPostToGlobals();
$db = DB::db(); $db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$admin = getAdmin(); $admin = getAdmin();
@@ -40,7 +43,11 @@ switch ($btn) {
$gameStor->msg = $msg; $gameStor->msg = $msg;
break; break;
case "로그쓰기": case "로그쓰기":
pushGlobalHistoryLog(["<R>★</><S>{$log}</>"]); $lognum = $admin['historyindex'] + 1;
if ($lognum >= 29) {
$lognum = 0;
}
pushWorldHistory(["<R>★</><S>{$log}</>"]);
break; break;
case "변경1": case "변경1":
$gameStor->starttime = (new \DateTime($starttime))->format('Y-m-d H:i:s'); $gameStor->starttime = (new \DateTime($starttime))->format('Y-m-d H:i:s');
@@ -62,7 +69,6 @@ switch ($btn) {
case "30분턴": case "30분턴":
case "60분턴": case "60분턴":
case "120분턴": case "120분턴":
$admin = $gameStor->getValues(['turntime', 'turnterm', 'year', 'startyear', 'month']);
switch ($btn) { switch ($btn) {
case "1분턴": $turnterm = 1; break; case "1분턴": $turnterm = 1; break;
case "2분턴": $turnterm = 2; break; case "2분턴": $turnterm = 2; break;
@@ -73,28 +79,40 @@ switch ($btn) {
case "60분턴": $turnterm = 60; break; case "60분턴": $turnterm = 60; break;
case "120분턴": $turnterm = 120; break; case "120분턴": $turnterm = 120; break;
} }
$oldunit = $admin['turnterm'] * 60;
$unit = $turnterm * 60; $unit = $turnterm * 60;
$unitDiff = $unit / $oldunit;
$servTurnTime = new \DateTimeImmutable($admin['turntime']);
foreach ($db->query('SELECT no,turntime FROM general') as $gen) {
$genTurnTime = new \DateTimeImmutable($gen['turntime']);
$timeDiff = TimeUtil::DateIntervalToSeconds($genTurnTime->diff($servTurnTime));
$timeDiff *= $unitDiff;
$newGenTurnTime = $servTurnTime->add(TimeUtil::secondsToDateInterval($timeDiff));
$db->update('general', [
'turntime'=>$newGenTurnTime->format('Y-m-d H:i:s.u')
], 'no=%i', $gen['no']);
}
$turn = ($admin['year'] - $admin['startyear']) * 12 + $admin['month'] - 1; $turn = ($admin['year'] - $admin['startyear']) * 12 + $admin['month'] - 1;
$starttime = $servTurnTime->sub(TimeUtil::secondsToDateInterval($turn * $unit))->format('Y-m-d H:i:s'); $starttime = date("Y-m-d H:i:s", strtotime($admin['turntime']) - $turn * $unit);
$starttime = cutTurn($starttime, $turnterm, false); $starttime = cutTurn($starttime, $turnterm);
$gameStor->turnterm = $turnterm; $gameStor->turnterm = $turnterm;
$gameStor->starttime = $starttime; $gameStor->starttime = $starttime;
pushGlobalHistoryLog(["<R>★</>턴시간이 <C>$btn</>으로 변경됩니다."]); // 턴시간이 길어지는 경우 랜덤턴 배정
if ($turnterm < $admin['turnterm']) {
$query = "select no from general";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$count = MYDB_num_rows($result);
for ($i=0; $i < $count; $i++) {
$gen = MYDB_fetch_array($result);
$turntime = getRandTurn($turnterm);
$query = "update general set turntime='$turntime' where no='{$gen['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
}
// 턴시간이 너무 멀리 떨어진 선수 제대로 보정
} else {
$query = "select no,turntime from general";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$count = MYDB_num_rows($result);
for ($i=0; $i < $count; $i++) {
$gen = MYDB_fetch_array($result);
$num = intdiv((strtotime($gen['turntime']) - strtotime($admin['turntime'])), $unit);
if ($num > 0) {
$gen['turntime'] = date("Y-m-d H:i:s", strtotime($gen['turntime']) - $unit * $num);
$query = "update general set turntime='{$gen['turntime']}' where no='{$gen['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
}
}
}
pushWorldHistory(["<R>★</>턴시간이 <C>$btn</>으로 변경됩니다."]);
break; break;
} }
+105 -119
View File
@@ -1,5 +1,4 @@
<?php <?php
namespace sammo; namespace sammo;
include "lib.php"; include "lib.php";
@@ -7,8 +6,25 @@ include "func.php";
//로그인 검사 //로그인 검사
$session = Session::requireGameLogin()->setReadOnly(); $session = Session::requireGameLogin()->setReadOnly();
if ($session->userGrade < 5) { if($session->userGrade < 5) {
die(requireAdminPermissionHTML()); ?>
<!DOCTYPE html>
<html>
<head>
<title>관리메뉴</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
<body>
관리자가 아닙니다.<br>
<?=banner()?>
</body>
</html>
<?php
exit();
} }
$db = DB::db(); $db = DB::db();
@@ -16,133 +32,103 @@ $db = DB::db();
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>회원관리</title> <title>회원관리</title>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" /> <meta name="viewport" content="width=1024" />
<?= WebUtil::printCSS('../d_shared/common.css') ?> <?=WebUtil::printCSS('../d_shared/common.css')?>
<?= WebUtil::printDist('ts', 'common', true) ?> <?=WebUtil::printCSS('css/common.css')?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
</head> </head>
<body> <body>
<table align=center width=1000 class='tb_layout bg0'> <table align=center width=1000 class='tb_layout bg0'>
<tr> <tr><td> <br><?=backButton()?></td></tr>
<td> <br><?= backButton() ?></td> </table>
</tr> <form name=form1 method=post action=_admin2_submit.php>
</table> <table align=center width=1000 class='tb_layout bg0'>
<form name=form1 method=post action=_admin2_submit.php> <tr>
<table align=center width=1000 class='tb_layout bg0'> <td width=80 align=center>접속제한</td>
<tr> <td width=713 align=center><input type=submit name=btn value='전체 접속허용'><input type=submit name=btn value='전체 접속제한'></td>
<td width=80 align=center>접속제한</td> </tr>
<td width=713 align=center><input type=submit name=btn value='전체 접속허용'><input type=submit name=btn value='전체 접속제한'></td> </table>
</tr> <table align=center width=1000 class='tb_layout bg0'>
</table> <tr>
<table align=center width=1000 class='tb_layout bg0'> <td width=80 align=center rowspan=12>회원선택<br><br><font color=cyan>NPC</font><br><font color=skyblue>NPC유저</font><br><font color=red>접속제한</font><br><b style=background-color:red;>블럭회원</b></td>
<tr> <td width=105 rowspan=12>
<td width=80 align=center rowspan=12>회원선택<br><br> <?php
<font color=cyan>NPC</font><br>
<font color=skyblue>NPC유저</font><br>
<font color=red>접속제한</font><br><b style=background-color:red;>블럭회원</b>
</td>
<td width=105 rowspan=12>
<?php
echo " echo "
<select name=genlist[] size=20 multiple style='color:white;background-color:black;font-size:14px'>"; <select name=genlist[] size=20 multiple style='color:white;background-color:black;font-size:13px'>";
$generalList = $db->query('SELECT `no`, `name`, npc, `block` FROM general ORDER BY npc, binary(`name`)'); $generalList = $db->query('SELECT `no`, `name`, npc, `block` FROM general ORDER BY npc, binary(`name`)');
foreach ($generalList as $general) { foreach($generalList as $general){
$style = "style=;"; $style = "style=;";
if ($general['block'] > 0) { if($general['block'] > 0) { $style .= "background-color:red;"; }
$style .= "background-color:red;"; if($general['npc'] >= 2) { $style .= "color:cyan;"; }
} elseif($general['npc'] == 1) { $style .= "color:skyblue;"; }
$npcColor = getNPCColor($general['npc']); echo "
if($npcColor !== null){
$style .= "color:{$npcColor};";
}
echo "
<option value={$general['no']} $style>{$general['name']}</option>"; <option value={$general['no']} $style>{$general['name']}</option>";
} }
echo " echo "
</select> </select>
</td> </td>
<td width=100 align=center>아이템 지급</td> <td width=100 align=center>아이템 지급</td>
<td width=504> <td width=504>
<select name=weapon size=1 style='color:white;background-color:black;font-size:14px'>"; <select name=weap size=1 style='color:white;background-color:black;font-size:13px'>";
foreach (GameConst::$allItems as $itemCategories) { for($i=0; $i < 27; $i++) {
foreach ($itemCategories as $item => $cnt) { echo "
if ($cnt == 0) {
continue;
}
$itemObj = buildItemClass($item);
if ($itemObj->isBuyable()) {
continue;
}
}
}
for ($i = 0; $i < 27; $i++) {
echo "
<option value={$i}>{$i}</option>"; <option value={$i}>{$i}</option>";
} }
?> ?>
</select> </select>
<input type=submit name=btn value='무기지급'> <input type=submit name=btn value='무기지급'>
<input type=submit name=btn value='책지급'> <input type=submit name=btn value='책지급'>
<input type=submit name=btn value='말지급'> <input type=submit name=btn value='말지급'>
<input type=submit name=btn value='도구지급'> <input type=submit name=btn value='도구지급'>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width=100 align=center>블럭</td> <td width=100 align=center>블럭</td>
<td width=504> <td width=504>
<input type=submit name=btn value='블럭 해제'><input type=submit name=btn value='1단계 블럭'><input type=submit name=btn value='2단계 블럭'><input type=submit name=btn value='3단계 블럭'><input type=submit name=btn value='무한삭턴'><br> <input type=submit name=btn value='블럭 해제'><input type=submit name=btn value='1단계 블럭'><input type=submit name=btn value='2단계 블럭'><input type=submit name=btn value='3단계 블럭'><input type=submit name=btn value='무한삭턴'><br>
1단계:발언권, 2단계:턴블럭 1단계:발언권, 2단계:턴블럭
</td> </td>
</tr> </tr>
<tr> <tr>
<td align=center>강제 사망</td> <td align=center>강제 사망</td>
<td><input type=submit name=btn value='강제 사망'></td> <td><input type=submit name=btn value='강제 사망'></td>
</tr> </tr>
<tr> <tr>
<td align=center>이벤트</td> <td align=center>이벤트</td>
<td><input type=submit name=btn value='특기 부여'><input type=submit name=btn value='공헌치1000'><input type=submit name=btn value='경험치1000'></td> <td><input type=submit name=btn value='특기 부여'><input type=submit name=btn value='공헌치1000'><input type=submit name=btn value='경험치1000'></td>
</tr> </tr>
<tr> <tr>
<td align=center>이벤트2</td> <td align=center>이벤트2</td>
<td><input type=submit name=btn value='보숙10000'><input type=submit name=btn value='궁숙10000'><input type=submit name=btn value='기숙10000'><input type=submit name=btn value='귀숙10000'><input type=submit name=btn value='차숙10000'></td> <td><input type=submit name=btn value='보숙10000'><input type=submit name=btn value='궁숙10000'><input type=submit name=btn value='기숙10000'><input type=submit name=btn value='귀숙10000'><input type=submit name=btn value='차숙10000'></td>
</tr> </tr>
<tr> <tr>
<td align=center>접속제한</td> <td align=center>접속제한</td>
<td><input type=submit name=btn value='접속 허용'><input type=submit name=btn value='접속 제한'></td> <td><input type=submit name=btn value='접속 허용'><input type=submit name=btn value='접속 제한'></td>
</tr> </tr>
<tr> <tr>
<td align=center> 시각 설정</td> <td align=center>턴설정</td>
<td><input type=submit name=btn value='00턴'><input type=submit name=btn value='랜덤턴'></td> <td><input type=submit name=btn value='00턴'><input type=submit name=btn value='랜덤턴'></td>
</tr> </tr>
<tr> <tr>
<td align=center>명령 설정</td> <td align=center>NPC해제</td>
<td><input type=submit name=btn value='하야입력'><input type=submit name=btn value='방랑해산'></td> <td><input type=submit name=btn value='NPC해제'><input type=submit name=btn value='하야입력'><input type=submit name=btn value='방랑해산'><input type=submit name=btn value='NPC설정'></td>
</tr> </tr>
<tr> <tr>
<td align=center>메세지 전달</td> <td align=center>메세지 전달</td>
<td><input type=textarea size=60 maxlength=255 name=msg style=background-color:black;color:white;><input type=submit name=btn value='메세지 전달'></td> <td><input type=textarea size=60 maxlength=255 name=msg style=background-color:black;color:white;><input type=submit name=btn value='메세지 전달'></td>
</tr> </tr>
</table> </table>
</form> </form>
<table align=center width=1000 class='tb_layout bg0'> <table align=center width=1000 class='tb_layout bg0'>
<tr> <tr><td><?=backButton()?></td></tr>
<td><?= backButton() ?></td> <tr><td><?=banner()?> </td></tr>
</tr> </table>
<tr>
<td><?= banner() ?> </td>
</tr>
</table>
</body> </body>
</html>
</html>
+143 -144
View File
@@ -1,355 +1,354 @@
<?php <?php
namespace sammo; namespace sammo;
include "lib.php"; include "lib.php";
include "func.php"; include "func.php";
$btn = Util::getPost('btn'); $btn = Util::getReq('btn');
$item = Util::getPost('item', 'string'); $weap = Util::getReq('weap', 'int');
$genlist = Util::getPost('genlist', 'array_int'); $genlist = Util::getReq('genlist', 'array_int');
$msg = Util::getPost('msg', 'string'); $msg = Util::getReq('msg', 'string');
extractMissingPostToGlobals();
//로그인 검사 //로그인 검사
$session = Session::requireLogin()->loginGame()->setReadOnly(); $session = Session::requireLogin()->loginGame()->setReadOnly();
if ($session->userGrade < 5) { if($session->userGrade < 5) {
header('location:_admin2.php'); header('location:_admin2.php');
} }
$generalID = $session->generalID; $generalID = $session->generalID;
if (!$generalID) { if(!$generalID){
header('location:_admin2.php'); header('location:_admin2.php');
die(); die();
} }
$db = DB::db(); $db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$src = MessageTarget::buildQuick($session->generalID); $src = MessageTarget::buildQuick($session->generalID);
$genObjList = []; switch($btn) {
$env = [];
if ($genlist) {
$genObjList = General::createGeneralObjListFromDB($genlist);
$env = $gameStor->cacheAll();
}
switch ($btn) {
case "전체 접속허용": case "전체 접속허용":
$db->update('general', [ $db->update('general', [
'con' => 0 'con'=>0
], true); ], true);
break; break;
case "전체 접속제한": case "전체 접속제한":
$db->update('general', [ $db->update('general', [
'con' => 1000 'con'=>1000
], true); ], true);
break; break;
case "블럭 해제": case "블럭 해제":
$db->update('general', [ $db->update('general', [
'block' => 0 'block'=>0
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
DB::db()->query('update general set block=0 where no IN %li', $genlist); DB::db()->query('update general set block=0 where no IN %li', $genlist);
break; break;
case "1단계 블럭": case "1단계 블럭":
$date = TimeUtil::now(); $date = date('Y-m-d H:i:s');
$db->update('general', [ $db->update('general', [
'block' => 1, 'block'=>1,
'killturn' => 24 'killturn'=>24
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
$uid = $db->queryFirstColumn('SELECT `owner` FROM general WHERE `no` IN %li', $genlist); $uid = $db->queryFirstColumn('SELECT `owner` FROM general WHERE `no` IN %li', $genlist);
RootDB::db()->update('member', [ RootDB::db()->update('member',[
'block_num' => $db->sqleval('block_num+1'), 'block_num'=>$db->sqleval('block_num+1'),
'block_date' => $date 'block_date'=>$date
], 'id IN %li', $uid); ], 'id IN %li', $uid);
break; break;
case "2단계 블럭": case "2단계 블럭":
$date = TimeUtil::now(); $date = date('Y-m-d H:i:s');
$db->update('general', [ $db->update('general', [
'gold' => 0, 'gold'=>0,
'rice' => 0, 'rice'=>0,
'block' => 2, 'block'=>2,
'killturn' => 24 'killturn'=>24
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist); $uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
RootDB::db()->update('member', [ RootDB::db()->update('member',[
'block_num' => $db->sqleval('block_num+1'), 'block_num'=>$db->sqleval('block_num+1'),
'block_date' => $date 'block_date'=>$date
], 'id IN %li', $uid); ], 'id IN %li', $uid);
break; break;
case "3단계 블럭": case "3단계 블럭":
$date = TimeUtil::now(); $date = date('Y-m-d H:i:s');
$db->update('general', [ $db->update('general', [
'gold' => 0, 'gold'=>0,
'rice' => 0, 'rice'=>0,
'block' => 3, 'block'=>3,
'killturn' => 24 'killturn'=>24
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
$uid = $db->queryFirstColumn('SELECT `owner` from general where no IN %li', $genlist); $uid = $db->queryFirstColumn('SELECT `owner` from general where no IN %li', $genlist);
RootDB::db()->update('member', [ RootDB::db()->update('member',[
'block_num' => $db->sqleval('block_num+1'), 'block_num'=>$db->sqleval('block_num+1'),
'block_date' => $date 'block_date'=>$date
], 'id IN %li', $uid); ], 'id IN %li', $uid);
break; break;
case "무한삭턴": case "무한삭턴":
$db->update('general', [ $db->update('general', [
'killturn' => 8000 'killturn'=>8000
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
break; break;
case "강제 사망": case "강제 사망":
$date = TimeUtil::now(true); $date = date('Y-m-d H:i:s');
$db->update('general', [ $db->update('general', [
'killturn' => 0, 'turn0'=>EncodeCommand(0, 0, 0, 0),
'turntime' => $date, 'killturn'=>0,
'turntime'=>$date,
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
$db->update('general_turn', [
'action' => '휴식',
'arg' => '{}',
'brief' => '휴식',
], 'general_id IN %li AND turn_idx = 0', $genlist);
break; break;
case "특기 부여": case "특기 부여":
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']); [$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
$text = "특기 부여!"; $text = "특기 부여!";
foreach ($db->query("SELECT `no`,leadership,strength,intel,dex1,dex2,dex3,dex4,dex5 FROM general WHERE `no` IN %li", $genlist) as $general) { foreach($db->query("SELECT `no`,leader,power,intel,dex0,dex10,dex20,dex30,dex40 FROM general WHERE `no` IN %li", $genlist) as $general){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($general['no']), $text, new \DateTime(), new \DateTime('9999-12-31'), []); $msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($general['no']), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true); $msg->send(true);
$specialWar = SpecialityHelper::pickSpecialWar($general); $specialWar = SpecialityConst::pickSpecialWar($general);
$db->update('general', [ $db->update('general', [
'specage2' => $db->sqleval('age'), 'specage2'=>$db->sqleval('age'),
'special2' => $specialWar 'special2'=>$specialWar
], 'no=%i', $general['no']); ], 'no=%i', $general['no']);
$specialWarName = buildGeneralSpecialWarClass($specialWar)->getName(); $specialWarName = SpecialityConst::WAR[$specialWar][0];
$josaUl = JosaUtil::pick($specialWarName, '을'); $josaUl = JosaUtil::pick($specialWarName, '을');
$logger = new ActionLogger($general['no'], 0, $year, $month); pushGeneralHistory($general, "<C>●</>{$year}{$month}월:특기 【<b><C>{$specialWarName}</></b>】{$josaUl} 습득");
$logger->pushGeneralHistoryLog("특기 【<b><C>{$specialWarName}</></b>】{$josaUl} 습득"); pushGenLog($general, ["<C>●</>특기 【<b><L>{$specialWarName}</></b>】{$josaUl} 익혔습니다!"]);
$logger->pushGeneralActionLog("특기 【<b><L>{$specialWarName}</></b>】{$josaUl} 익혔습니다!",ActionLogger::PLAIN);
$logger->flush();
} }
break; break;
case "경험치1000": case "경험치1000":
$text = $btn . " 지급!"; $text = $btn." 지급!";
foreach ($genlist as $generalID) { foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []); $msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true); $msg->send(true);
} }
$db->update('general', [ $db->update('general',[
'experience' => $db->sqleval('experience+1000') 'experience'=>$db->sqleval('experience+1000')
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
break; break;
case "공헌치1000": case "공헌치1000":
$text = $btn . " 지급!"; $text = $btn." 지급!";
foreach ($genlist as $generalID) { foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []); $msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true); $msg->send(true);
} }
$db->update('general', [ $db->update('general',[
'dedication' => $db->sqleval('dedication+1000') 'dedication'=>$db->sqleval('dedication+1000')
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
break; break;
case "보숙10000": case "보숙10000":
$text = "보병숙련도+10000 지급!"; $text = "보병숙련도+10000 지급!";
foreach ($genlist as $generalID) { foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []); $msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true); $msg->send(true);
} }
$db->update('general', [ $db->update('general',[
'dex1' => $db->sqleval('dex1+10000') 'dex0'=>$db->sqleval('dex0+10000')
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
break; break;
case "궁숙10000": case "궁숙10000":
$text = "궁병숙련도+10000 지급!"; $text = "궁병숙련도+10000 지급!";
foreach ($genlist as $generalID) { foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []); $msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true); $msg->send(true);
} }
$db->update('general', [ $db->update('general',[
'dex2' => $db->sqleval('dex2+10000') 'dex10'=>$db->sqleval('dex10+10000')
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
break; break;
case "기숙10000": case "기숙10000":
$src = MessageTarget::buildQuick($session->generalID); $src = MessageTarget::buildQuick($session->generalID);
$text = "기병숙련도+10000 지급!"; $text = "기병숙련도+10000 지급!";
foreach ($genlist as $generalID) { foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []); $msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true); $msg->send(true);
} }
$db->update('general', [ $db->update('general',[
'dex3' => $db->sqleval('dex3+10000') 'dex20'=>$db->sqleval('dex20+10000')
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
break; break;
case "귀숙10000": case "귀숙10000":
$src = MessageTarget::buildQuick($session->generalID); $src = MessageTarget::buildQuick($session->generalID);
$text = "귀병숙련도+10000 지급!"; $text = "귀병숙련도+10000 지급!";
foreach ($genlist as $generalID) { foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []); $msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true); $msg->send(true);
} }
$db->update('general', [ $db->update('general',[
'dex4' => $db->sqleval('dex4+10000') 'dex30'=>$db->sqleval('dex30+10000')
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
break; break;
case "차숙10000": case "차숙10000":
$src = MessageTarget::buildQuick($session->generalID); $src = MessageTarget::buildQuick($session->generalID);
$text = "차병숙련도+10000 지급!"; $text = "차병숙련도+10000 지급!";
foreach ($genlist as $generalID) { foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []); $msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true); $msg->send(true);
} }
$db->update('general', [ $db->update('general',[
'dex5' => $db->sqleval('dex5+10000') 'dex40'=>$db->sqleval('dex40+10000')
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
break; break;
case "접속 허용": case "접속 허용":
$db->update('general', [ $db->update('general',[
'con' => 0 'con'=>0
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
break; break;
case "접속 제한": case "접속 제한":
$db->update('general', [ $db->update('general',[
'con' => 1000 'con'=>1000
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
break; break;
case "메세지 전달": case "메세지 전달":
$text = $msg ?? ''; $text = $msg;
foreach ($genlist as $generalID) { foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []); $msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true); $msg->send(true);
} }
break; break;
case "무기지급": case "무기지급":
if ($item == 'None') { if($weap == 0) {
$text = "무기 회수!"; $text = "무기 회수!";
} else { }
$text = getItemName($item) . " 지급!"; else {
$text = getWeapName($weap)." 지급!";
} }
foreach ($genlist as $generalID) { foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []); $msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true); $msg->send(true);
} }
if ($item === 'None') { if($weap == 0){
$db->update('general', [ $db->update('general', [
'weapon' => 'None' 'weap'=>0
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
} else { }
else{
$db->update('general', [ $db->update('general', [
'weapon' => $item 'weap'=>$weap
], '`no` IN %li', $genlist, $item); ], '`no` IN %li AND weap < %i', $genlist, $weap);
} }
break; break;
case "책지급": case "책지급":
if ($item == 'None') { if($weap == 0) {
$text = "책 회수!"; $text = "책 회수!";
} else { }
$text = getItemName($item) . " 지급!"; else {
$text = getBookName($weap)." 지급!";
} }
foreach ($genlist as $generalID) { foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []); $msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true); $msg->send(true);
} }
if ($item == 'None') { if($weap == 0){
$db->update('general', [ $db->update('general', [
'book' => 'None' 'book'=>0
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
} else { }
else{
$db->update('general', [ $db->update('general', [
'book' => $item 'book'=>$weap
], '`no` IN %li', $genlist); ], '`no` IN %li AND book < %i', $genlist, $weap);
} }
break; break;
case "말지급": case "말지급":
if ($item == 'None') { if($weap == 0) {
$text = "말 회수!"; $text = "말 회수!";
} else { }
$text = getItemName($item) . " 지급!"; else {
$text = getHorseName($weap)." 지급!";
} }
foreach ($genlist as $generalID) { foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []); $msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true); $msg->send(true);
} }
if ($item == 'None') { if($weap == 0){
$db->update('general', [ $db->update('general', [
'horse' => 'None' 'horse'=>0
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
} else { }
else{
$db->update('general', [ $db->update('general', [
'horse' => $item 'horse'=>$weap
], '`no` IN %li', $genlist); ], '`no` IN %li AND horse < %i', $genlist, $weap);
} }
break; break;
case "도구지급": case "도구지급":
if ($item == 'None') { if($weap == 0) {
$text = "특수도구 회수!"; $text = "특수도구 회수!";
} else { }
$text = getItemName($item) . " 지급!"; else {
$text = getItemName($weap)." 지급!";
} }
foreach ($genlist as $generalID) { foreach($genlist as $generalID){
$msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []); $msg = new Message(Message::MSGTYPE_PRIVATE, $src, MessageTarget::buildQuick($generalID), $text, new \DateTime(), new \DateTime('9999-12-31'), []);
$msg->send(true); $msg->send(true);
} }
if ($item == 'None') { if($weap == 0){
$db->update('general', [ $db->update('general', [
'item' => 'None' 'item'=>0
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
} else { }
else{
$db->update('general', [ $db->update('general', [
'item' => $item 'item'=>$weap
], '`no` IN %li AND item < %i', $genlist, $item); ], '`no` IN %li AND item < %i', $genlist, $weap);
} }
break; break;
case "NPC해제":
$db->update('general', [
'npc'=>1
], '`no` IN %li', $genlist);
break;
case "하야입력": case "하야입력":
$db->update('general_turn', [ $db->update('general', [
'action' => 'che_하야', 'turn0'=>EncodeCommand(0, 0, 0, 45)
'arg' => '{}', ], '`no` IN %li', $genlist);
'brief' => '하야',
], 'general_id IN %li AND turn_idx = 0', $genlist);
break; break;
case "방랑해산": case "방랑해산":
$db->update('general_turn', [ $db->update('general', [
'action' => 'che_방랑', 'turn0'=>EncodeCommand(0, 0, 0, 47),
'arg' => '{}', 'turn1'=>EncodeCommand(0, 0, 0, 56)
'brief' => '방랑', ], '`no` IN %li', $genlist);
], 'general_id IN %li AND turn_idx = 0', $genlist); break;
$db->update('general_turn', [ case "NPC설정":
'action' => 'che_해산', $db->update('general', [
'arg' => '{}', 'npc'=>2
'brief' => '해산', ], '`no` IN %li', $genlist);
], 'general_id IN %li AND turn_idx = 1', $genlist);
break; break;
case "00턴": case "00턴":
$turnterm = $gameStor->turnterm; $turnterm = $gameStor->turnterm;
foreach ($genlist as $generalID) { foreach($genlist as $generalID){
$turntime = getRandTurn($turnterm); $turntime = getRandTurn($turnterm);
$cutTurn = cutTurn($turntime, $turnterm); $cutTurn = cutTurn($turntime, $turnterm);
$db->update('general', [ $db->update('general', [
'turntime' => $cutTurn 'turntime'=>$curTurn
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
} }
break; break;
case "랜덤턴": case "랜덤턴":
$turnterm = $gameStor->turnterm; foreach($genlist as $generalID){
foreach ($genlist as $generalID) {
$turntime = getRandTurn($turnterm); $turntime = getRandTurn($turnterm);
$db->update('general', [ $db->update('general', [
'turntime' => $turntime 'turntime'=>$turntime
], '`no` IN %li', $genlist); ], '`no` IN %li', $genlist);
} }
break; break;
} }
header('location:_admin2.php'); header('location:_admin2.php');
+115 -105
View File
@@ -1,5 +1,4 @@
<?php <?php
namespace sammo; namespace sammo;
include "lib.php"; include "lib.php";
@@ -7,126 +6,137 @@ include "func.php";
//로그인 검사 //로그인 검사
$session = Session::requireGameLogin()->setReadOnly(); $session = Session::requireGameLogin()->setReadOnly();
if ($session->userGrade < 5) { if($session->userGrade < 5) {
die(requireAdminPermissionHTML()); ?>
<!DOCTYPE html>
<html>
<head>
<title>관리메뉴</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
<body>
관리자가 아닙니다.<br>
<?=banner()?>
</body>
</html>
<?php
exit();
} }
$db = DB::db(); $db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$conlimit = $gameStor->conlimit; $conlimit = $gameStor->conlimit;
$ipGroupList = Util::arrayGroupBy(
$db->query(
'SELECT name,ip,lastconnect,owner,block,substring_index(ip,".",3) as ip_c from general WHERE ip!="" and npc<2'
),
'ip_c'
);
function colorBlockedName($general)
{
if (!$general['blocked']) {
return $general['name'];
}
return "<span style='color:magenta;'>{$general['name']}</span>";
}
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>멀티관리</title> <title>멀티관리</title>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" /> <meta name="viewport" content="width=1024" />
<?= WebUtil::printCSS('../d_shared/common.css') ?> <?=WebUtil::printCSS('../d_shared/common.css')?>
<?= WebUtil::printDist('ts', 'common', true) ?> <?=WebUtil::printCSS('css/common.css')?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
</head> </head>
<body> <body>
<table align=center width=1000 class='tb_layout bg0'> <table align=center width=1000 class='tb_layout bg0'>
<tr> <tr><td> <br><?=backButton()?></td></tr>
<td> <br><?= backButton() ?></td> </table>
</tr> <form name=form1 method=post action=_admin4_submit.php>
</table> <table align=center width=1000 class='tb_layout bg0'>
<form name=form1 method=post action=_admin4_submit.php> <tr>
<table align=center width=1000 class='tb_layout bg0'> <td width=80 align=center rowspan=3>회원선택<br><br><font color=cyan>NPC</font><br><font color=skyblue>NPC유저</font><br><font color=red>접속제한</font><br><b style=background-color:red;>블럭회원</b></td>
<tr> <td width=105 rowspan=3>
<td width=80 align=center rowspan=3>회원선택<br><br> <?php
<font color=cyan>NPC</font><br>
<font color=skyblue>NPC유저</font><br>
<font color=red>접속제한</font><br><b style=background-color:red;>블럭회원</b>
</td>
<td width=105 rowspan=3>
<?php
echo " echo "
<select name=genlist[] size=20 multiple style='color:white;background-color:black;font-size:14px'>"; <select name=genlist[] size=20 multiple style='color:white;background-color:black;font-size:13px'>";
foreach ($db->query('SELECT no,name,npc,block,con from general where ip!=\'\' order by npc,ip') as $general) { foreach($db->query('SELECT no,name,npc,block,con from general where ip!=\'\' order by npc,ip') as $general){
$style = "style=;"; $style = "style=;";
if ($general['block'] > 0) { if($general['block'] > 0) { $style .= "background-color:red;"; }
$style .= "background-color:red;"; if($general['npc'] >= 2) { $style .= "color:cyan;"; }
} elseif($general['npc'] == 1) { $style .= "color:skyblue;"; }
if($general['con'] > $conlimit) { $style .= "color:red;"; }
$npcColor = getNPCColor($general['npc']); echo "
if($npcColor !== null){
$style .= "color:{$npcColor};";
}
echo "
<option value={$general['no']} $style>{$general['name']}</option>"; <option value={$general['no']} $style>{$general['name']}</option>";
} }
echo " echo "
</select>"; </select>";
?> ?>
</td> </td>
<td width=100 align=center>블럭</td> <td width=100 align=center>블럭</td>
<td width=504> <td width=504>
<input type=submit name=btn value='블럭 해제'><input type=submit name=btn value='1단계 블럭'><input type=submit name=btn value='2단계 블럭'><input type=submit name=btn value='3단계 블럭'><input type=submit name=btn value='무한삭턴'><br> <input type=submit name=btn value='블럭 해제'><input type=submit name=btn value='1단계 블럭'><input type=submit name=btn value='2단계 블럭'><input type=submit name=btn value='3단계 블럭'><input type=submit name=btn value='무한삭턴'><br>
1단계:발언권, 2단계:턴블럭 1단계:발언권, 2단계:턴블럭
</td> </td>
</tr> </tr>
<tr> <tr>
<td align=center>강제 사망</td> <td align=center>강제 사망</td>
<td><input type=submit name=btn value='강제 사망'></td> <td><input type=submit name=btn value='강제 사망'></td>
</tr> </tr>
<tr> <tr>
<td align=center>메세지 전달</td> <td align=center>메세지 전달</td>
<td><input type=textarea size=60 maxlength=255 name=msg style=background-color:black;color:white;><input type=submit name=btn value='메세지 전달'></td> <td><input type=textarea size=60 maxlength=255 name=msg style=background-color:black;color:white;><input type=submit name=btn value='메세지 전달'></td>
</tr> </tr>
</table> </table>
<table align=center width=1000 class='tb_layout bg0'> <table align=center width=1000 class='tb_layout bg0'>
<tr> <tr>
<td align=center width=100>장수명</td> <td align=center width=100>장수명</td>
<td align=center width=180>최근로그인</td> <td align=center width=180>최근로그인</td>
<td align=center width=129>IP</td> <td align=center width=129>IP</td>
<td align=center width=100>ID</td> <td align=center width=100>ID</td>
</tr> </tr>
<?php foreach ($ipGroupList as $ipGroupC => $users) : ?> <tr>
<tr> <?php
<td><?= join('<br>', array_map('\sammo\colorBlockedName', $users)) ?></td> $query = "select substring_index(ip,'.',3) as ip2 from general where ip!='' and npc<2 group by ip2 having count(*)>1";
<td><?= join('<br>', array_column($users, 'lastconnect')) ?></td> $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
<td><?= join('<br>', array_column($users, 'ip')) ?></td> $ipCount = MYDB_num_rows($result);
<td><?= join('<br>', array_column($users, 'owner')) ?></td> $genName = "";
</tr> $genDate = "";
<?php endforeach; ?> $genIP = "";
</table> $genID = "";
<?php for($i=0; $i < $ipCount; $i++) {
//NOTE: password의 md5 해시가 같은지 확인하는 방식으로는 앞으로 잡아낼 수 없다. 폐기 $ip = MYDB_fetch_array($result);
?>
</form>
<table align=center width=1000 class='tb_layout bg0'>
<tr>
<td><?= backButton() ?></td>
</tr>
<tr>
<td><?= banner() ?> </td>
</tr>
</table>
</body>
</html> $query = "select name,ip,lastconnect,owner,block from general where ip like '{$ip['ip2']}%' and npc<2 order by ip";
$genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($genResult);
for($k=0; $k < $genCount; $k++) {
$gen = MYDB_fetch_array($genResult);
if($gen['block'] > 0) $genName .= "<font color=magenta>{$gen['name']}</font><br>";
else $genName .= $gen['name']."<br>";
$genDate .= $gen['lastconnect']."<br>";
$genIP .= $gen['ip']."<br>";
$genID .= $gen['owner']."<br>";
}
$genName .= "<br>";
$genDate .= "<br>";
$genIP .= "<br>";
$genID .= "<br>";
}
echo "
<td align=right>$genName</td>
<td>$genDate</td>
<td>$genIP</td>
<td>$genID</td>";
?>
</tr>
</table>
<?php
//NOTE: password의 md5 해시가 같은지 확인하는 방식으로는 앞으로 잡아낼 수 없다. 폐기
?>
</form>
<table align=center width=1000 class='tb_layout bg0'>
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
</body>
</html>
+23 -28
View File
@@ -1,5 +1,4 @@
<?php <?php
namespace sammo; namespace sammo;
include "lib.php"; include "lib.php";
@@ -7,74 +6,69 @@ include "func.php";
//로그인 검사 //로그인 검사
$session = Session::requireGameLogin()->setReadOnly(); $session = Session::requireGameLogin()->setReadOnly();
if ($session->userGrade < 5) { if($session->userGrade < 5) {
header('location:_admin4.php'); header('location:_admin4.php');
die(); die();
} }
$btn = Util::getPost('btn'); $btn = Util::getReq('btn');
$genlist = Util::getPost('genlist', 'array_int'); $genlist = Util::getReq('genlist', 'array_int');
$msg = Util::getPost('msg', 'string', '메시지'); $msg = Util::getReq('msg','string', '메시지');
extractMissingPostToGlobals();
$db = DB::db(); $db = DB::db();
//NOTE: 왜 기능이 admin2와 admin4가 같이 있는가? //NOTE: 왜 기능이 admin2와 admin4가 같이 있는가?
//NOTE: 왜 블럭 시 admin4에선 금쌀을 없애지 않는가? //NOTE: 왜 블럭 시 admin4에선 금쌀을 없애지 않는가?
switch ($btn) { switch($btn) {
case "블럭 해제": case "블럭 해제":
DB::db()->query('update general set block=0 where no IN %li', $genlist); DB::db()->query('update general set block=0 where no IN %li', $genlist);
break; break;
case "1단계 블럭": case "1단계 블럭":
$date = TimeUtil::now(); $date = date('Y-m-d H:i:s');
$db = DB::db(); $db = DB::db();
$db->query('update general set block=1,killturn=24 where no IN %li', $genlist); $db->query('update general set block=1,killturn=24 where no IN %li',$genlist);
//FIXME: subquery로 하는게 더 빠를 듯. //FIXME: subquery로 하는게 더 빠를 듯.
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist); $uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
RootDB::db()->query('update member set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid); RootDB::db()->query('update member set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
break; break;
case "2단계 블럭": case "2단계 블럭":
$date = TimeUtil::now(); $date = date('Y-m-d H:i:s');
$db = DB::db(); $db = DB::db();
$db->query('update general set block=2,killturn=24 where no IN %li', $genlist); $db->query('update general set block=2,killturn=24 where no IN %li',$genlist);
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist); $uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
RootDB::db()->query('update member set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid); RootDB::db()->query('update member set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
break; break;
case "3단계 블럭": case "3단계 블럭":
$date = TimeUtil::now(); $date = date('Y-m-d H:i:s');
$db = DB::db(); $db = DB::db();
$db->query('update general set block=3,killturn=24 where no IN %li', $genlist); $db->query('update general set block=3,killturn=24 where no IN %li',$genlist);
$uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist); $uid = $db->queryFirstColumn('select owner from general where no IN %li', $genlist);
RootDB::db()->query('update member set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid); RootDB::db()->query('update member set block_num=block_num+1,block_date=%s where id IN %ls', $date, $uid);
break; break;
case "무한삭턴": case "무한삭턴":
DB::db()->query('update general set killturn=8000 where no IN %li', $genlist); DB::db()->query('update general set killturn=8000 where no IN %li',$genlist);
break; break;
case "강제 사망": case "강제 사망":
$date = TimeUtil::now(true); $date = date('Y-m-d H:i:s');
$db->update('general', [ DB::db()->query('update general set turn0=%s,killturn=0,turntime=%s where no IN %li',EncodeCommand(0, 0, 0, 0),$date, $genlist);
'killturn' => 0,
'turntime' => $date,
], '`no` IN %li', $genlist);
$db->update('general_turn', [
'action' => '휴식',
'arg' => '{}',
'brief' => '휴식'
], 'general_id IN %li AND turn_idx = 0', $genlist);
break; break;
case "메세지 전달": case "메세지 전달":
$date = TimeUtil::now(); //TODO:새 갠메 시스템으로 변경
$date = date('Y-m-d H:i:s');
$src = MessageTarget::buildQuick($session->generalID); $src = MessageTarget::buildQuick($session->generalID);
foreach($genlist as $generalID){ for($i=0; $i < count($genlist); $i++) {
$msgObj = new Message( $msgObj = new Message(
Message::MSGTYPE_PRIVATE, Message::MSGTYPE_PRIVATE,
$src, $src,
MessageTarget::buildQuick($generalID), MessageTarget::buildQuick($genlist[$i]),
$msg, $msg,
new \DateTime(), new DateTime(),
new \DateTime('9999-12-31'), new \DateTime('9999-12-31'),
[] []
); );
if ($msgObj) { if($msgObj){
$msgObj->send(true); $msgObj->send(true);
} }
} }
@@ -82,3 +76,4 @@ switch ($btn) {
} }
header('location:_admin4.php'); header('location:_admin4.php');
+247 -287
View File
@@ -1,28 +1,47 @@
<?php <?php
namespace sammo; namespace sammo;
include "lib.php"; include "lib.php";
include "func.php"; include "func.php";
$type = Util::getPost('type', 'int', 0); $type = Util::getReq('type', 'int', 0);
$type2 = Util::getPost('type2', 'int', 0); $type2 = Util::getReq('type2', 'int', 0);
if ($type < 0 || $type > 17) { if($type < 0 || $type > 17){
$type = 0; $type = 0;
} }
if ($type2 < 0 || $type2 > 6) { if($type2 < 0 || $type2 > 6){
$type2 = 0; $type2 = 0;
} }
extractMissingPostToGlobals();
//로그인 검사 //로그인 검사
$session = Session::requireGameLogin()->setReadOnly(); $session = Session::requireGameLogin()->setReadOnly();
if ($session->userGrade < 5) { if($session->userGrade < 5) {
die(requireAdminPermissionHTML()); ?>
<!DOCTYPE html>
<html>
<head>
<title>관리메뉴</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
<body>
관리자가 아닙니다.<br>
<?=banner()?>
</body>
</html>
<?php
exit();
} }
$db = DB::db(); $db = DB::db();
$connect=$db->get();
$sel = []; $sel = [];
$sel2 = []; $sel2 = [];
@@ -32,334 +51,275 @@ $sel2[$type2] = "selected";
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>일제정보</title> <title>일제정보</title>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" /> <meta name="viewport" content="width=1024" />
<?= WebUtil::printCSS('../d_shared/common.css') ?> <?=WebUtil::printCSS('../d_shared/common.css')?>
<?= WebUtil::printDist('ts', 'common', true) ?> <?=WebUtil::printCSS('css/common.css')?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
</head> </head>
<body> <body>
<table align=center width=1000 class='tb_layout bg0'> <table align=center width=1000 class='tb_layout bg0'>
<tr> <tr><td> <br><?=closeButton()?></td></tr>
<td> <br><?= closeButton() ?></td> <tr><td>
</tr> <form name=form1 method=post>정렬순서 :
<tr> <select name=type size=1>
<td> <option <?=$sel[0]??''?> value=0>국력</option>
<form name=form1 method=post>정렬순서 : <option <?=$sel[1]??''?> value=1>장수</option>
<select name=type size=1> <option <?=$sel[2]??''?> value=2>기술</option>
<option <?= $sel[0] ?? '' ?> value=0>국</option> <option <?=$sel[3]??''?> value=3>국</option>
<option <?= $sel[1] ?? '' ?> value=1>장수</option> <option <?=$sel[4]??''?> value=4>병량</option>
<option <?= $sel[2] ?? '' ?> value=2>기술</option> <option <?=$sel[5]??''?> value=5>평금</option>
<option <?= $sel[3] ?? '' ?> value=3>국고</option> <option <?=$sel[6]??''?> value=6>평쌀</option>
<option <?= $sel[4] ?? '' ?> value=4>병량</option> <option <?=$sel[7]??''?> value=7>평통</option>
<option <?= $sel[5] ?? '' ?> value=5>평</option> <option <?=$sel[8]??''?> value=8>평</option>
<option <?= $sel[6] ?? '' ?> value=6>평</option> <option <?=$sel[9]??''?> value=9>평</option>
<option <?= $sel[7] ?? '' ?> value=7>평통</option> <option <?=$sel[10]??''?> value=10>평Lv</option>
<option <?= $sel[8] ?? '' ?> value=8>평무</option> <option <?=$sel[11]??''?> value=11>접속률</option>
<option <?= $sel[9] ?? '' ?> value=9>평지</option> <option <?=$sel[12]??''?> value=12>단기접</option>
<option <?= $sel[10] ?? '' ?> value=10>평Lv</option> <option <?=$sel[13]??''?> value=13>보숙</option>
<option <?= $sel[11] ?? '' ?> value=11>접속률</option> <option <?=$sel[14]??''?> value=14>궁숙</option>
<option <?= $sel[12] ?? '' ?> value=12>단기접</option> <option <?=$sel[15]??''?> value=15>기숙</option>
<option <?= $sel[13] ?? '' ?> value=13>보숙</option> <option <?=$sel[16]??''?> value=16>귀숙</option>
<option <?= $sel[14] ?? '' ?> value=14>궁숙</option> <option <?=$sel[17]??''?> value=17>차숙</option>
<option <?= $sel[15] ?? '' ?> value=15>기숙</option> </select>
<option <?= $sel[16] ?? '' ?> value=16>귀숙</option> <select name=type2 size=1>
<option <?= $sel[17] ?? '' ?> value=17>차숙</option> <option <?=$sel2[0]??''?> value=0>국력</option>
</select> <option <?=$sel2[1]??''?> value=1>국가별성향</option>
<select name=type2 size=1> <option <?=$sel2[2]??''?> value=2>국가성향</option>
<option <?= $sel2[0] ?? '' ?> value=0>국력</option> <option <?=$sel2[3]??''?> value=3>장수성격</option>
<option <?= $sel2[1] ?? '' ?> value=1>국가별성향</option> <option <?=$sel2[4]??''?> value=4>장수특기</option>
<option <?= $sel2[2] ?? '' ?> value=2>국가성향</option> <option <?=$sel2[5]??''?> value=5>병종수</option>
<option <?= $sel2[3] ?? '' ?> value=3>장수성격</option> <option <?=$sel2[6]??''?> value=6>기타</option>
<option <?= $sel2[4] ?? '' ?> value=4>장수특기</option> </select>
<option <?= $sel2[5] ?? '' ?> value=5>병종수</option> <input type=submit value='정렬하기'>
<option <?= $sel2[6] ?? '' ?> value=6>기타</option> </form>
</select> <form name=form2 method=post action=_admin5_submit.php>
<input type=submit value='정렬하기'> <select name=nation size=1 style=color:white;background-color:black>";
</form> <option value=0>재야</option>";
<form name=form2 method=post action=_admin5_submit.php> <?php
<select name=nation size=1 style=color:white;background-color:black>"; $query = "select nation,name,color,scout,scoutmsg,gennum from nation order by power";
<option value=0>재야</option>"; $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
<?php $count = MYDB_num_rows($result);
foreach ($db->query('SELECT nation,name,color,scout,gennum from nation order by power DESC') as $nation) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result);
echo " echo "
<option value={$nation['nation']}>{$nation['name']}</option>"; <option value={$nation['nation']}>{$nation['name']}</option>";
} }
?> ?>
</select> </select>
<input type=submit name=btn value='국가변경'> <input type=submit name=btn value='국가변경'>
</form> </form>
</td> </td></tr>
</tr> </table>
</table>
<table align=center width=1600 class="tb_layout bg0"> <table align=center width=1600 class="tb_layout bg0">
<tr class='bg1'> <tr id=bg1>
<td align=center>국명</td> <td align=center>국명</td>
<td align=center>접률</td> <td align=center>접률</td>
<td align=center>단접</td> <td align=center>단접</td>
<td align=center>국력</td> <td align=center>국력</td>
<td align=center>장수</td> <td align=center>단합</td>
<td align=center>속령</td> <td align=center>장수</td>
<td align=center>기술</td> <td align=center>속령</td>
<td align=center>전략</td> <td align=center>기술</td>
<td align=center>국고</td> <td align=center>전략</td>
<td align=center>병량</td> <td align=center>국고</td>
<td align=center>평금</td> <td align=center>병량</td>
<td align=center></td> <td align=center></td>
<td align=center></td> <td align=center></td>
<td align=center></td> <td align=center></td>
<td align=center></td> <td align=center></td>
<td align=center>Lv</td> <td align=center></td>
<td align=center>보숙</td> <td align=center>평Lv</td>
<td align=center></td> <td align=center></td>
<td align=center></td> <td align=center></td>
<td align=center></td> <td align=center></td>
<td align=center></td> <td align=center></td>
<td align=center>총병</td> <td align=center>차숙</td>
<td align=center>인구</td> <td align=center>총병</td>
<td align=center>인구</td> <td align=center>인구</td>
<td align=center>농업</td> <td align=center>인구율</td>
<td align=center></td> <td align=center></td>
<td align=center>치안</td> <td align=center>상업</td>
<td align=center>성벽</td> <td align=center>치안</td>
<td align=center>수비</td> <td align=center>성벽</td>
<td align=center>국명</td> <td align=center>수비</td>
</tr> <td align=center>국명</td>
<?php </tr>
$query = " <?php
$query = "
SELECT SELECT
A.nation, A.nation,
A.name, A.name,
A.power, A.power,
A.chemi,
A.color, A.color,
A.tech, A.tech,
A.strategic_cmd_limit, A.sabotagelimit,
A.gold, A.gold,
A.rice, A.rice,
COUNT(B.nation) AS gennum, COUNT(B.nation) AS gennum,
ROUND(AVG(B.connect), 1) AS connect, ROUND(AVG(B.connect), 1) AS connect,
ROUND(AVG(B.con), 1) AS con, ROUND(AVG(B.con), 1) AS con,
ROUND(AVG(B.dex1)) AS dex1, ROUND(AVG(B.dex0)) AS dex0,
ROUND(AVG(B.dex2)) AS dex2, ROUND(AVG(B.dex10)) AS dex10,
ROUND(AVG(B.dex3)) AS dex3, ROUND(AVG(B.dex20)) AS dex20,
ROUND(AVG(B.dex4)) AS dex4, ROUND(AVG(B.dex30)) AS dex30,
ROUND(AVG(B.dex5)) AS dex5 ROUND(AVG(B.dex40)) AS dex40
FROM nation A, general B FROM nation A, general B
WHERE A.nation=B.nation WHERE A.nation=B.nation
GROUP BY B.nation GROUP BY B.nation
"; ";
switch ($type) { switch($type) {
case 0: case 0: $query .= " order by power desc"; break;
$query .= " order by power desc"; case 1: $query .= " order by gennum desc"; break;
break; case 2: $query .= " order by A.tech desc"; break;
case 1: case 3: $query .= " order by A.gold desc"; break;
$query .= " order by gennum desc"; case 4: $query .= " order by A.rice desc"; break;
break; case 5: $query .= " order by avg(B.gold) desc"; break;
case 2: case 6: $query .= " order by avg(B.rice) desc"; break;
$query .= " order by A.tech desc"; case 7: $query .= " order by avg(B.leader) desc"; break;
break; case 8: $query .= " order by avg(B.power) desc"; break;
case 3: case 9: $query .= " order by avg(B.intel) desc"; break;
$query .= " order by A.gold desc"; case 10: $query .= " order by avg(B.explevel) desc"; break;
break; case 11: $query .= " order by avg(B.connect) desc"; break;
case 4: case 12: $query .= " order by avg(B.con) desc"; break;
$query .= " order by A.rice desc"; case 13: $query .= " order by avg(B.dex0) desc"; break;
break; case 14: $query .= " order by avg(B.dex10) desc"; break;
case 5: case 15: $query .= " order by avg(B.dex20) desc"; break;
$query .= " order by avg(B.gold) desc"; case 16: $query .= " order by avg(B.dex30) desc"; break;
break; case 17: $query .= " order by avg(B.dex40) desc"; break;
case 6: }
$query .= " order by avg(B.rice) desc"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break; $nationCount = MYDB_num_rows($result);
case 7: for($i=0; $i < $nationCount; $i++) {
$query .= " order by avg(B.leadership) desc"; $nation = MYDB_fetch_array($result);
break;
case 8:
$query .= " order by avg(B.strength) desc";
break;
case 9:
$query .= " order by avg(B.intel) desc";
break;
case 10:
$query .= " order by avg(B.explevel) desc";
break;
case 11:
$query .= " order by avg(B.connect) desc";
break;
case 12:
$query .= " order by avg(B.con) desc";
break;
case 13:
$query .= " order by avg(B.dex1) desc";
break;
case 14:
$query .= " order by avg(B.dex2) desc";
break;
case 15:
$query .= " order by avg(B.dex3) desc";
break;
case 16:
$query .= " order by avg(B.dex4) desc";
break;
case 17:
$query .= " order by avg(B.dex5) desc";
break;
}
foreach ($db->query($query) as $nation) {
$gen = $db->queryFirstRow('SELECT COUNT(*) as cnt,
ROUND(AVG(gold)) as avgg,
ROUND(AVG(rice)) as avgr,
SUM(leadership) as leadership, ROUND(AVG(leadership), 1) as avgl,
ROUND(AVG(strength), 1) as avgs,
ROUND(AVG(intel), 1) as avgi,
ROUND(AVG(explevel), 1) as avge,
SUM(crew) as crew
from general where nation=%i', $nation['nation']);
$city = $db->queryFirstRow('SELECT COUNT(*) as cnt, $query = "select COUNT(*) as cnt,
SUM(pop) as pop, SUM(pop_max) as pop_max, ROUND(AVG(gold)) as avgg,
ROUND(SUM(pop)/SUM(pop_max)*100, 2) as rate, ROUND(AVG(rice)) as avgr,
trust, SUM(leader) as leader, ROUND(AVG(leader), 1) as avgl,
ROUND(SUM(agri)/SUM(agri_max)*100, 2) as agri, ROUND(AVG(power), 1) as avgp,
ROUND(SUM(comm)/SUM(comm_max)*100, 2) as comm, ROUND(AVG(intel), 1) as avgi,
ROUND(SUM(secu)/SUM(secu_max)*100, 2) as secu, ROUND(AVG(explevel), 1) as avge,
ROUND(SUM(wall)/SUM(wall_max)*100, 2) as wall, SUM(crew) as crew
ROUND(SUM(def)/SUM(def_max)*100, 2) as def from general where nation='{$nation['nation']}'";
from city where nation=%i', $nation['nation']); $genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($genResult);
echo " $query = "select COUNT(*) as cnt,
SUM(pop) as pop, SUM(pop2) as pop2,
ROUND(SUM(pop)/SUM(pop2)*100, 2) as rate,
ROUND(SUM(agri)/SUM(agri2)*100, 2) as agri,
ROUND(SUM(comm)/SUM(comm2)*100, 2) as comm,
ROUND(SUM(secu)/SUM(secu2)*100, 2) as secu,
ROUND(SUM(wall)/SUM(wall2)*100, 2) as wall,
ROUND(SUM(def)/SUM(def2)*100, 2) as def
from city where nation='{$nation['nation']}'";
$cityResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($cityResult);
echo "
<tr> <tr>
<td align=center style=background-color:{$nation['color']};color:" . newColor($nation['color']) . ";>{$nation['name']}</td> <td align=center style=background-color:{$nation['color']};color:".newColor($nation['color']).";>{$nation['name']}</td>
<td align=center>&nbsp;{$nation['connect']}&nbsp;</td> <td align=center>&nbsp;{$nation['connect']}&nbsp;</td>
<td align=center>&nbsp;{$nation['con']}&nbsp;</td> <td align=center>&nbsp;{$nation['con']}&nbsp;</td>
<td align=center>&nbsp;{$nation['power']}&nbsp;</td> <td align=center>&nbsp;{$nation['power']}&nbsp;</td>
<td align=center>&nbsp;{$nation['chemi']}&nbsp;</td>
<td align=center>&nbsp;{$gen['cnt']}&nbsp;</td> <td align=center>&nbsp;{$gen['cnt']}&nbsp;</td>
<td align=center>&nbsp;{$city['cnt']}&nbsp;</td> <td align=center>&nbsp;{$city['cnt']}&nbsp;</td>
<td align=right>&nbsp;" . sprintf('%.1f', $nation['tech']) . "&nbsp;</td> <td align=center>&nbsp;{$nation['tech']}&nbsp;</td>
<td align=center>&nbsp;{$nation['strategic_cmd_limit']}&nbsp;</td> <td align=center>&nbsp;{$nation['sabotagelimit']}&nbsp;</td>
<td align=center>&nbsp;{$nation['gold']}&nbsp;</td> <td align=center>&nbsp;{$nation['gold']}&nbsp;</td>
<td align=center>&nbsp;{$nation['rice']}&nbsp;</td> <td align=center>&nbsp;{$nation['rice']}&nbsp;</td>
<td align=right>&nbsp;{$gen['avgg']}&nbsp;</td> <td align=center>&nbsp;{$gen['avgg']}&nbsp;</td>
<td align=right>&nbsp;{$gen['avgr']}&nbsp;</td> <td align=center>&nbsp;{$gen['avgr']}&nbsp;</td>
<td align=right>&nbsp;{$gen['avgl']}&nbsp;</td> <td align=center>&nbsp;{$gen['avgl']}&nbsp;</td>
<td align=right>&nbsp;{$gen['avgs']}&nbsp;</td> <td align=center>&nbsp;{$gen['avgp']}&nbsp;</td>
<td align=right>&nbsp;{$gen['avgi']}&nbsp;</td> <td align=center>&nbsp;{$gen['avgi']}&nbsp;</td>
<td align=right>&nbsp;{$gen['avge']}&nbsp;</td> <td align=center>&nbsp;{$gen['avge']}&nbsp;</td>
<td align=right>&nbsp;{$nation['dex1']}&nbsp;</td> <td align=center>&nbsp;{$nation['dex0']}&nbsp;</td>
<td align=right>&nbsp;{$nation['dex2']}&nbsp;</td> <td align=center>&nbsp;{$nation['dex10']}&nbsp;</td>
<td align=right>&nbsp;{$nation['dex3']}&nbsp;</td> <td align=center>&nbsp;{$nation['dex20']}&nbsp;</td>
<td align=right>&nbsp;{$nation['dex4']}&nbsp;</td> <td align=center>&nbsp;{$nation['dex30']}&nbsp;</td>
<td align=right>&nbsp;{$nation['dex5']}&nbsp;</td> <td align=center>&nbsp;{$nation['dex40']}&nbsp;</td>
<td align=right>&nbsp;{$gen['crew']}/{$gen['leadership']}00&nbsp;</td> <td align=center>&nbsp;{$gen['crew']}/{$gen['leader']}00&nbsp;</td>
<td align=center>&nbsp;{$city['pop']}/{$city['pop_max']}&nbsp;</td> <td align=center>&nbsp;{$city['pop']}/{$city['pop2']}&nbsp;</td>
<td align=center>&nbsp;" . sprintf('%.1f', $city['pop'] / Util::valueFit($city['pop_max'], 1) * 100) . "%&nbsp;</td> <td align=center>&nbsp;{$city['rate']}%&nbsp;</td>
<td align=center>&nbsp;{$city['agri']}%&nbsp;</td> <td align=center>&nbsp;{$city['agri']}%&nbsp;</td>
<td align=center>&nbsp;{$city['comm']}%&nbsp;</td> <td align=center>&nbsp;{$city['comm']}%&nbsp;</td>
<td align=center>&nbsp;{$city['secu']}%&nbsp;</td> <td align=center>&nbsp;{$city['secu']}%&nbsp;</td>
<td align=center>&nbsp;{$city['wall']}%&nbsp;</td> <td align=center>&nbsp;{$city['wall']}%&nbsp;</td>
<td align=center>&nbsp;{$city['def']}%&nbsp;</td> <td align=center>&nbsp;{$city['def']}%&nbsp;</td>
<td align=center style=background-color:{$nation['color']};color:" . newColor($nation['color']) . ";>{$nation['name']}</td> <td align=center style=background-color:{$nation['color']};color:".newColor($nation['color']).";>{$nation['name']}</td>
</tr> </tr>
"; ";
} }
?> ?>
</table> </table>
<table align=center width=1000 class='tb_layout bg0'> <table align=center width=1000 class='tb_layout bg0'>
<tr> <tr><td><?=getSabotageLogRecent(20)?></td></tr>
<td><?= getSabotageLogRecent(20) ?></td> </table>
</tr>
</table>
<table align=center width=1760 class="tb_layout bg0"> <table align=center width=1760 class="tb_layout bg0">
<tr class='bg1'> <tr id=bg1>
<td width=30 align=center></td> <td width=30 align=center></td>
<td width=30 align=center></td> <td width=30 align=center></td>
<td width=50 align=center>국가수</td> <td width=50 align=center>국가수</td>
<td width=50 align=center>장수수</td> <td width=50 align=center>장수수</td>
<?php <?php
switch ($type2) { switch($type2) {
default: default:
case 0: case 0: echo "<td width=1600>국력(국력,장수수,도시수,인구/100,최대인구/100,국가자원/100,장수자원/100,능력치,숙련/1000,경험공헌/100)</td>"; break;
echo "<td width=1600>국력(국력,장수수,도시수,인구/100,최대인구/100,국가자원/100,장수자원/100,능력치,숙련/1000,경험공헌/100)</td>"; case 1: echo "<td width=1600>국가별성향</td>"; break;
break; case 2: echo "<td width=1600>국가성향</td>"; break;
case 1: case 3: echo "<td width=1600>장수성격</td>"; break;
echo "<td width=1600>국가별성향</td>"; case 4: echo "<td width=1600>장수특기</td>"; break;
break; case 5: echo "<td width=1600>병종수</td>"; break;
case 2: case 6: echo "<td width=1600>기타</td>"; break;
echo "<td width=1600>국가성향</td>"; }
break; ?>
case 3: </tr>
echo "<td width=1600>장수성격</td>"; <?php
break; $query = "select * from statistic where month=1 or no=1";
case 4: $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
echo "<td width=1600>장수특기</td>"; $count = MYDB_num_rows($result);
break; for($i=0; $i < $count; $i++) {
case 5: $stat = MYDB_fetch_array($result);
echo "<td width=1600>병종수</td>";
break; echo "
case 6:
echo "<td width=1600>기타</td>";
break;
}
?>
</tr>
<?php
foreach ($db->query('SELECT * from statistic where month=1 or no=1') as $stat) {
echo "
<tr> <tr>
<td align=center>{$stat['year']}</td> <td align=center>{$stat['year']}</td>
<td align=center>{$stat['month']}</td> <td align=center>{$stat['month']}</td>
<td align=center>{$stat['nation_count']}</td> <td align=center>{$stat['nation_count']}</td>
<td align=center>{$stat['gen_count']}</td> <td align=center>{$stat['gen_count']}</td>
"; ";
switch ($type2) { switch($type2) {
default: default:
case 0: case 0: echo "<td>{$stat['power_hist']}</td>"; break;
echo "<td>{$stat['power_hist']}</td>"; case 1: echo "<td>{$stat['nation_name']}</td>"; break;
break; case 2: echo "<td>{$stat['nation_hist']}</td>"; break;
case 1: case 3: echo "<td>{$stat['personal_hist']}</td>"; break;
echo "<td>{$stat['nation_name']}</td>"; case 4: echo "<td>{$stat['special_hist']}</td>"; break;
break; case 5: echo "<td>{$stat['crewtype']}</td>"; break;
case 2: case 6: echo "<td>{$stat['etc']}</td>"; break;
echo "<td>{$stat['nation_hist']}</td>"; }
break;
case 3: echo "
echo "<td>{$stat['personal_hist']}</td>";
break;
case 4:
echo "<td>{$stat['special_hist']}</td>";
break;
case 5:
echo "<td>{$stat['crewtype']}</td>";
break;
case 6:
echo "<td>{$stat['etc']}</td>";
break;
}
echo "
</tr> </tr>
"; ";
} }
?> ?>
</table> </table>
<table align=center width=1000 class='tb_layout bg0'> <table align=center width=1000 class='tb_layout bg0'>
<tr> <tr><td><?=closeButton()?></td></tr>
<td><?= closeButton() ?></td> <tr><td><?=banner()?> </td></tr>
</tr> </table>
<tr>
<td><?= banner() ?> </td>
</tr>
</table>
</body> </body>
</html>
</html>
+14 -21
View File
@@ -1,49 +1,42 @@
<?php <?php
namespace sammo; namespace sammo;
include "lib.php"; include "lib.php";
include "func.php"; include "func.php";
$btn = Util::getPost('btn'); $btn = Util::getReq('btn');
$nation = Util::getPost('nation', 'int'); $nation = Util::getReq('nation', 'int');
extractMissingPostToGlobals();
//로그인 검사 //로그인 검사
$session = Session::requireGameLogin()->setReadOnly(); $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID(); $userID = Session::getUserID();
if ($session->userGrade < 5) { if($session->userGrade < 5) {
header('location:_admin5.php'); header('location:_admin5.php');
die(); die();
} }
$db = DB::db(); $db = DB::db();
$connect=$db->get();
switch ($btn) { switch($btn) {
case "국가변경": case "국가변경":
$oldNation = $db->queryFirstField('SELECT nation FROM general WHERE owner=%i', $userID); if($nation == 0) {
if ($nation == 0) {
$db->update('general', [ $db->update('general', [
'nation' => 0, 'nation'=>0,
'officer_level' => 0, 'level'=>0,
'officer_city' => 0
], 'owner=%i', $userID); ], 'owner=%i', $userID);
} else { } else {
$db->update('general', [ $db->update('general', [
'nation' => $nation, 'nation'=>$nation,
'officer_level' => 1, 'level'=>1,
'officer_city' => 0
], 'owner=%i', $userID); ], 'owner=%i', $userID);
$db->update('nation', [
'gennum' => $db->sqleval('gennum + 1')
], 'nation=%i', $oldNation);
}
if ($oldNation != 0) {
$db->update('nation', [
'gennum' => $db->sqleval('gennum - 1')
], 'nation=%i', $oldNation);
} }
break; break;
} }
header('location:_admin5.php'); header('location:_admin5.php');
+111
View File
@@ -0,0 +1,111 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
$type = Util::getReq('type', 'int', 0);
if($type < 0 || $type > 4){
$type = 0;
}
extractMissingPostToGlobals();
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
if($session->userGrade < 5) {
?>
<!DOCTYPE html>
<html>
<head>
<title>관리메뉴</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
<body>
관리자가 아닙니다.<br>
<?=banner()?>
</body>
</html>
<?php
exit();
}
$db = DB::db();
$connect=$db->get();
$sel[$type] = "selected";
?>
<!DOCTYPE html>
<html>
<head>
<title>접속정보</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
<body>
<table align=center width=1000 class='tb_layout bg0'>
<tr><td> <br><?=closeButton()?></td></tr>
<tr><td><form name=form1 method=post>정렬순서 :
<select name=type size=1>
<option <?=$sel[0]??''?> value=0>접속률</option>
<option <?=$sel[1]??''?> value=1>총갱신</option>
<option <?=$sel[2]??''?> value=2>갱신/턴</option>
<option <?=$sel[3]??''?> value=3>총로그인</option>
<option <?=$sel[4]??''?> value=4>갱신/로그인</option>
</select>
<input type=submit value='정렬하기'></form>
</td></tr>
</table>
<table align=center class='tb_layout bg0'>
<tr id=bg1>
<td align=center width=120>장수명</td>
<td align=center width=50>접속률</td>
<td align=center width=40>시작연령</td>
<td align=center width=40>연령</td>
<td align=center width=80>총갱신</td>
<td align=center width=80>갱신/</td>
<td align=center width=80>총로그인</td>
<td align=center width=100>갱신/로그인</td>
</tr>
<?php
switch($type) {
case 0: $query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by connect desc limit 0,30"; break;
case 1: $query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by refcnt desc limit 0,30"; break;
case 2: $query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by ref desc limit 0,30"; break;
case 3: $query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by logcnt desc limit 0,30"; break;
case 4: $query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by log desc limit 0,30"; break;
}
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
for($i=0; $i < $gencount; $i++) {
$gen = MYDB_fetch_array($genresult);
echo "
<tr>
<td align=center>{$gen['name']}</td>
<td align=center>{$gen['connect']}</td>
<td align=center>{$gen['startage']}</td>
<td align=center>{$gen['age']}</td>
<td align=center>".round($gen['refcnt']/2, 1)."</td>
<td align=center>".round($gen['ref']/2,1)."</td>
<td align=center>{$gen['logcnt']}</td>
<td align=center>".round($gen['log']/2,1)."</td>
</tr>";
}
?>
</table>
<table align=center width=1000 class='tb_layout bg0'>
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
</body>
</html>
+127 -159
View File
@@ -1,179 +1,147 @@
<?php <?php
namespace sammo; namespace sammo;
include "lib.php"; include "lib.php";
include "func.php"; include "func.php";
$btn = Util::getPost('btn'); $btn = Util::getReq('btn');
$gen = Util::getPost('gen', 'int', 0); $gen = Util::getReq('gen', 'int', 0);
$reqQueryType = Util::getPost('query_type', 'string', null); $type = Util::getReq('type', 'int', 0);
// $queryTypeText, $reqArgType(0=>None, 1=>AdditionalColumn, 2=>rankVal, 3=>aux), $comp if($type < 0 || $type > 3){
$queryMap = [ $type = 0;
'turntime' => ['최근턴', 0, function ($lhs, $rhs) {
return - ($lhs['turntime'] <=> $rhs['turntime']);
}],
'recent_war' => ['최근전투', 1, function ($lhs, $rhs) {
return - ($lhs['recent_war'] <=> $rhs['recent_war']);
}],
'name' => ['장수명', 0, function ($lhs, $rhs) {
if ($lhs['npc'] !== $rhs['npc']) {
return $lhs['npc'] <=> $rhs['npc'];
}
return $lhs['name'] <=> $rhs['name'];
}],
'warnum' => ['전투수', 2, function ($lhs, $rhs) {
return - ($lhs['warnum'] <=> $rhs['warnum']);
}]
];
if ($reqQueryType === null || !key_exists($reqQueryType, $queryMap)) {
$reqQueryType = Util::array_first_key($queryMap);
} }
extractMissingPostToGlobals();
//로그인 검사 //로그인 검사
$session = Session::requireGameLogin()->setReadOnly(); $session = Session::requireGameLogin()->setReadOnly();
if ($session->userGrade < 5) { if($session->userGrade < 5) {
die(requireAdminPermissionHTML());
}
$db = DB::db();
if ($btn == '정렬하기') {
$gen = 0;
}
[$queryTypeText, $reqArgType, $comp] = $queryMap[$reqQueryType];
if ($reqArgType === 0) {
$generalBasicList = $db->query('SELECT no, name, nation, npc, turntime FROM general');
} else if ($reqArgType === 1) {
$generalBasicList = $db->query('SELECT no, name, nation, npc, turntime, %b FROM general', $reqQueryType);
} else if ($reqArgType === 2) {
$generalBasicList = $db->query(
'SELECT no, name, nation, npc, turntime, value as %b
FROM general LEFT JOIN rank_data
ON general.no = rank_data.general_id
WHERE rank_data.type = %s',
$reqQueryType,
$reqQueryType
);
} else if ($reqArgType === 3) {
$generalBasicList = array_map(function ($arr) {
$arr['aux'] = Json::decode($arr['aux']);
return $arr;
}, $db->query('SELECT no, name, nation, npc, turntime, aux FROM general'));
} else {
throw new \sammo\MustNotBeReachedException();
}
usort($generalBasicList, $comp);
if (!$gen) {
$gen = $generalBasicList[0]['no'];
}
$generalObj = General::createGeneralObjFromDB($gen);
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>로그정보</title> <title>관리메뉴</title>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" /> <meta name="viewport" content="width=1024" />
<?= WebUtil::printCSS('../d_shared/common.css') ?> <?=WebUtil::printCSS('../d_shared/common.css')?>
<?= WebUtil::printDist('ts', 'common', true) ?> <?=WebUtil::printCSS('css/common.css')?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
</head> </head>
<body> <body>
<table align=center width=1000 class='tb_layout bg0'> 관리자가 아닙니다.<br>
<tr> <?=banner()?>
<td> <br><?= closeButton() ?></td>
</tr>
<tr>
<td>
<form name=form1 method=post>
정렬순서 :
<select name='query_type' size=1>
<?php foreach ($queryMap as $queryType => [$queryTypeText,]) : ?>
<option <?= $queryType == $reqQueryType ? 'selected' : '' ?> value='<?= $queryType ?>'><?= $queryTypeText ?></option>
<?php endforeach; ?>
</select>
<input type=submit name=btn value='정렬하기'>
대상장수 :
<select name=gen size=1>
<?php foreach ($generalBasicList as $general) : ?>
<option <?= $gen == $general['no'] ? 'selected' : '' ?> value='<?= $general['no'] ?>'><?= $general['name'] ?> (<?= substr($general['turntime'], 14, 5) ?>)</option>
<?php endforeach; ?>
</select>
<input type=submit name=btn value='조회하기'>
</form>
</td>
</tr>
</table>
<table width=1000 align=center class='tb_layout bg0'>
<tr>
<td width=50% align=center class='bg1'>
<font color=skyblue size=3> </font>
</td>
<td width=50% align=center class='bg1'>
<font color=orange size=3>-</font>
</td>
</tr>
<tr>
<td valign=top>
<?php generalInfo($generalObj);
generalInfo2($generalObj); ?>
</td>
<td valign=top>&nbsp;
</td>
</tr>
<tr>
<td align=center class='bg1'>
<font color=skyblue size=3>개인 기록</font>
</td>
<td align=center class='bg1'>
<font color=orange size=3>전투 기록</font>
</td>
</tr>
<tr>
<td valign=top>
<?= formatHistoryToHTML(getGeneralActionLogRecent($gen, 24)) ?>
</td>
<td valign=top>
<?= formatHistoryToHTML(getBattleDetailLogRecent($gen, 24)) ?>
</td>
</tr>
<tr>
<td align=center class='bg1'>
<font color=skyblue size=3>장수 열전</font>
</td>
<td align=center class='bg1'>
<font color=orange size=3>전투 결과</font>
</td>
</tr>
<tr>
<td valign=top>
<?= formatHistoryToHTML(getGeneralHistoryLogAll($gen)) ?>
</td>
<td valign=top>
<?= formatHistoryToHTML(getBattleResultRecent($gen, 24)) ?>
</td>
</tr>
</table>
<table align=center width=1000 class='tb_layout bg0'>
<tr>
<td><?= closeButton() ?></td>
</tr>
<tr>
<td><?= banner() ?> </td>
</tr>
</table>
</body> </body>
</html>
<?php
exit();
}
</html> $db = DB::db();
$connect=$db->get();
if($btn == '정렬하기') {
$gen = 0;
}
$sel[$type] = "selected";
?>
<!DOCTYPE html>
<html>
<head>
<title>로그정보</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
<body>
<table align=center width=1000 class='tb_layout bg0'>
<tr><td> <br><?=closeButton()?></td></tr>
<tr><td>
<form name=form1 method=post>
정렬순서 :
<select name=type size=1>
<option <?=$sel[0]??''?> value=0>최근턴</option>
<option <?=$sel[1]??''?> value=1>최근전투</option>
<option <?=$sel[2]??''?> value=2>장수명</option>
<option <?=$sel[3]??''?> value=3>전투수</option>
</select>
<input type=submit name=btn value='정렬하기'>
대상장수 :
<select name=gen size=1>
<?php
switch($type) {
case 0: $query = "select no,name from general order by turntime desc"; break;
case 1: $query = "select no,name from general order by recwar desc"; break;
case 2: $query = "select no,name from general order by npc,binary(name)"; break;
case 3: $query = "select no,name from general order by warnum desc"; break;
}
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
// 선택 없으면 맨 처음 장수
if($gen == 0) {
$gen = $general['no'];
}
if($gen == $general['no']) {
echo "
<option selected value={$general['no']}>{$general['name']}</option>";
} else {
echo "
<option value={$general['no']}>{$general['name']}</option>";
}
}
?>
</select>
<input type=submit name=btn value='조회하기'>
</form>
</td></tr>
</table>
<table width=1000 align=center class='tb_layout bg0'>
<tr>
<td width=50% align=center id=bg1><font color=skyblue size=3> </font></td>
<td width=50% align=center id=bg1><font color=orange size=3>-</font></td>
</tr>
<tr>
<td valign=top>
<?php generalInfo($gen); generalInfo2($gen); ?>
</td>
<td valign=top>&nbsp;
</td>
</tr>
<tr>
<td align=center id=bg1><font color=skyblue size=3>개인 기록</font></td>
<td align=center id=bg1><font color=orange size=3>전투 기록</font></td>
</tr>
<tr>
<td valign=top>
<?=getGenLogRecent($gen, 24)?>
</td>
<td valign=top>
<?=getBatLogRecent($gen, 24)?>
</td>
</tr>
<tr>
<td align=center id=bg1><font color=skyblue size=3>장수 열전</font></td>
<td align=center id=bg1><font color=orange size=3>전투 결과</font></td>
</tr>
<tr>
<td valign=top>
<?=getGeneralHistoryAll($gen)?>
</td>
<td valign=top>
<?=getBatResRecent($gen, 24)?>
</td>
</tr>
</table>
<table align=center width=1000 class='tb_layout bg0'>
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More