Commit graph

138 commits

Author SHA1 Message Date
Kijin Sung
a0606dcf60 Move Rhymix.ajaxForm() to common.js 2025-05-21 14:12:10 +09:00
Kijin Sung
0f554c6d51 Consoliate all debug-related variables under the Rhymix object 2025-05-21 14:07:34 +09:00
Kijin Sung
e7fbeee414 Update rx_ajax to use Rhymix.ajax() underneath 2025-05-21 13:49:31 +09:00
Kijin Sung
688c9ea87c Implement Rhymix.ajax() 2025-05-21 13:36:32 +09:00
Kijin Sung
ba6e6e0490 Simplify FormData detection in exec_json() 2024-10-09 19:59:33 +09:00
Kijin Sung
b598083a8c Replace rx_ajax iframe form submission with proper AJAX using FormData 2024-10-09 17:21:38 +09:00
Kijin Sung
d45c116c56 Patch exec_json() and related functions to support file uploads 2024-10-08 23:25:03 +09:00
Kijin Sung
de1174c3b5 Fix data() name for compatibility with jQuery 3.x 2024-01-20 00:22:12 +09:00
Kijin Sung
0e56669cc4 Show more detailed URL in AJAX error message 2023-12-30 22:02:24 +09:00
Kijin Sung
7a6dad9237 Always send AJAX requests to the same domain as the current page 2023-12-30 21:51:30 +09:00
Kijin Sung
d78b8e8415 Delete .xfsr 2023-11-21 23:48:05 +09:00
Kijin Sung
ad84896b03 Add flag to control which AJAX errors to alert(), but always print them to console 2023-11-21 23:43:50 +09:00
Kijin Sung
7ea912bb6e Add _rx_ajax_compat: XMLRPC field to AJAX requests generated by procFilter(), for improved backward compatibility 2023-10-26 23:08:05 +09:00
Kijin Sung
0fde7eb7e7 Use console.error() instead of console.warn() in Firefox, because it doesn't show stack trace for warnings 2023-08-31 22:59:15 +09:00
Kijin Sung
79dd9ae45e Use console.warn for JS deprecation notices so that the user can see a stack trace 2023-08-30 22:38:41 +09:00
Kijin Sung
06e736178b Support sending all _rx_* POST fields as HTTP headers instead
하위호환성, 부가기능 등을 위한 _rx_* POST 필드가 점점 많아짐에 따라
모두 헤더로 대체할 수 있도록 지원하고, 앞으로 점점 헤더로 바꿀 예정

CSRF 토큰은 예전부터 X-CSRF-Token 헤더를 지원했음
2023-08-27 23:32:31 +09:00
Kijin Sung
907750ff79 Fix #2108 use error callback function if AJAX transmission fails for any reason 2023-04-30 22:29:37 +09:00
Kijin Sung
f6209202bf Add deprecation notice to exec_xml() 2023-04-30 22:09:52 +09:00
Kijin Sung
a4905ab65a Fix #2109 update error message for exec_html() 2023-04-30 22:06:25 +09:00
Kijin Sung
703b04ca97 Remove unnecessary whitespace in common JS files 2023-04-30 22:05:43 +09:00
Kijin Sung
de7bf0a0a6 Automatically retry AJAX request with new CSRF token if token error is returned
다른 탭에서 로그아웃했다가 다시 로그인한 후 exec_json을 시도하는 등,
사용자가 보기에는 정상적인 상황인데도 보안정책(CSRF) 오류가 발생할 수 있음.
이 때 자연스럽게 토큰을 갱신한 후 요청을 다시 전송하도록 개선함.
2022-10-20 16:58:26 +09:00
Kijin Sung
fd8a4ff37d AJAX 오류 발생시 ERR_* 코드가 있다면 표시 (e4e252c1b4 보완) 2022-10-20 15:55:14 +09:00
Kijin Sung
c86015c282 Fix incorrect console message 2021-09-29 02:17:12 +09:00
Kijin Sung
1f1e01917e Support success and error callbacks in rx_ajax submissions using iframe 2021-09-13 10:57:55 +09:00
Kijin Sung
583604b845 Fix #1690 remove exec_html() that hasn't worked for 5 years anyway 2021-04-26 15:52:16 +09:00
Kijin Sung
91b03795dc Fix rx_ajax not working when a form contains file uploads 2021-02-24 11:02:29 +09:00
Kijin Sung
ca5d90fd07 Make rx_ajax forms more customizable 2021-02-02 16:04:53 +09:00
Kijin Sung
64baf4e8e3 Remove ssl_actions and add rewrite_level to inline JS 2021-01-20 23:53:58 +09:00
Kijin Sung
c588d02a22 Remove deprecated xeVid JS variable 2020-07-03 00:54:20 +09:00
Webstack
7830e2f8f4 #1311 exec_json 에서 callback_error 의 반환값에 따라 alert 하지 않도록 수정 2020-06-11 17:02:04 +09:00
Kijin Sung
953faecd55 Detect AJAX abort due to page unload #1280 2020-05-21 20:53:49 +09:00
Kijin Sung
9042e4110c Fix #1249 hide waiting message and leaving warning by default 2020-03-19 00:21:06 +09:00
Kijin Sung
f304283fd5 Fix #1249 hide waiting message from crawlers 2020-03-19 00:20:34 +09:00
conory
3efc2a6b13 _rx_ajax_form 파라미터로 폼 제출 종류를 구분할 수 있도록 변경 2019-12-30 11:51:16 +09:00
conory
085b74b7db rx_ajax 사용시 XE_VALIDATOR_MESSAGE 대신 rhymix_alert만 표시
일관성 유지
2019-12-29 18:55:43 +09:00
conory
b3068758ef for unit test 2019-12-26 23:36:44 +09:00
conory
40e35a9451 add rhymix_alert 2019-12-26 21:04:09 +09:00
conory
9e6005ccbc form rx_ajax 사용시 XE_VALIDATOR_MESSAGE 세션을 이용한 메세지 표시가 되지 않는 문제 수정 2019-12-25 23:01:37 +09:00
Kijin Sung
0f6c1edc68 Support success and error callbacks in rx_ajax forms 2019-10-10 02:36:03 +09:00
Kijin Sung
2385a62b95 Fix duplicate definition of request_info 2019-10-10 02:28:18 +09:00
Kijin Sung
4e6607c1c3 Automatically add method=POST and enctype=multipart/form-data to iframe submissions 2019-10-10 02:27:11 +09:00
Kijin Sung
69611520c3 Support submitting arbitrary forms by AJAX or IFRAME 2019-10-10 01:56:38 +09:00
Kijin Sung
f12cf74dda Revert "다른 프레임워크와 css 충돌을 피하기 위해 rhymix.less의 class/id 이름에 prefix 처리"
This reverts commit b1cb1f3f34.
2018-08-04 20:56:24 +09:00
conory
b1cb1f3f34 다른 프레임워크와 css 충돌을 피하기 위해 rhymix.less의 class/id 이름에 prefix 처리
변경전의 xe.less 파일도 rhymix.less와 함께 load 하여 호환정 유지

CSS 충돌 예)
bootstrap의 .btn
사용 예)
bootstrap 사용시엔 {Context::unloadBasicFiles('xe')}으로 unload 시키면 문제없음
2018-08-03 19:45:30 +09:00
Kijin Sung
20177f9f41 Use strict mode in xml_handler.js 2017-07-02 00:53:06 +09:00
Kijin Sung
af408a57cc Apply new xml2json from XE 1.8.40
XE 1.8.40에서 업데이트된 xml2json 라이브러리를 가져와 라이믹스에 맞게 수정한다.
라이믹스에서는 exec_xml() 함수를 사용하더라도 실제로는 JSON으로 요청하므로
일부 서드파티 자료에서 XML을 반환하는 경우만 처리해 주면 된다.

평소 거의 사용하지 않는 xml2json을 기본으로 로딩하지 않고
서드파티 자료가 예기치 않게 XML을 반환했을 때만 비동기식으로 로딩하여
처리하도록 한다. 또한 xml2json이 파이어폭스에서 파싱 오류를 발생시키는 문제를
해결하기 위해 github.com/dkdndes/x2js/issues/32 패치를 적용한다.
2017-06-03 00:08:44 +09:00
Kijin Sung
f0d52f8a91 Fix escaped XML content: cf. xpressengine/xe-core#2042 2017-04-10 10:06:34 +09:00
Kijin Sung
e82e3fb18c Implement isSameOrigin() to simplify origin determination 2017-03-06 15:11:45 +09:00
Kijin Sung
14300cbcc3 Insert CSRF token into every AJAX request 2017-03-06 14:47:42 +09:00
Kijin Sung
b3fb993f73 Insert CSRF token in all AJAX requests via exec_xml(), exec_json(), exec_html()
일단 공식적으로 지원하는 AJAX 함수 3종에 CSRF 토큰을 삽입해 본다.
추후 체크 방식을 변경하거나 보안을 더욱 강화할 경우 X-CSRF-Token 헤더와 비교할 수도 있다.
일반 폼 제출이나 임의의 AJAX 요청에도 CSRF 토큰을 삽입하는 것은 다음 커밋에...
2017-03-06 11:51:38 +09:00