-
Notifications
You must be signed in to change notification settings - Fork 265
Introduce smc_Request #8884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce smc_Request #8884
Conversation
|
Can you also add the logic for handling JSON? |
|
Almost like we need a response type, to make it easier to avoid rendering http themes. |
smc_Request.fetch(url)
.then(res => res.json())
.then(function(jsonArray) { /* ... */ }); |
Fair enough. Mentioned because of the static function just for handling xml. |
|
right, that's because there is no quick built in function call
…On Tue, Aug 26, 2025 at 8:17 PM Jeremy D ***@***.***> wrote:
*jdarwood007* left a comment (SimpleMachines/SMF#8884)
<#8884 (comment)>
smc_Request.fetch(url)
.then(res => res.json())
.then(function(jsonArray) { /* ... */ });
Fair enough. Mentioned because of the static function just for handling
xml.
—
Reply to this email directly, view it on GitHub
<#8884 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADJNN67M6MDJBEJW5RWS233PUPOBAVCNFSM6AAAAACE2BU2T6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMRWGYYDEOJQHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
jdarwood007
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good.
However, I can't complete a quick edit. All I did was click quick edit and then save. Never completes the save.
|
I just got the upgrader to work for me. I'll test this now.
…On Wed, Sep 10, 2025 at 6:10 PM Jeremy D ***@***.***> wrote:
***@***.**** commented on this pull request.
The code looks good.
However, I can't complete a quick edit. All I did was click quick edit and
then save. Never completes the save.
—
Reply to this email directly, view it on GitHub
<#8884 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADJNN57XBZP2OA4PS74STD3SDDZ7AVCNFSM6AAAAACE2BU2T6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTEMBYGMZTMMZYGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Oh I see what's going on. It sends an object, which this new userland code treats as JSON. We must send a string so it sends the proper header. |
|
That works but the Jump to never loads |
|
With your jumpto changes, can that JavaScript now be called with a defer? Some JS goals I had were to move everything into defer and use the calls for inline JavaScript to send them to the bottom of the page. Then look at doing noonce on all scripts and CSS. One step at a time would be if JS is getting updated, can it be deferred, which makes the later steps easier to accomplish later. |
Co-authored-by: Jeremy D <jdarwood007@users.noreply.github.com>
|
I was planning to defer scripts in a future PR, but I decided to defer topic.js here 9ece101 so you would be able to see that each individual call in the templates would need to be deferred as well. |
|
That's fine. As long as we are making the right progress towards where we can make that step happen more easily without rewriting them again. The ultimate goal for our JS in my mind is that our libraries can be loaded in the head with async, and the calls that set up the logic in the app are deferred until the end. |
|
Safe to review again or do you have more incoming? |
|
go ahead
…On Sat, Sep 13, 2025 at 4:42 PM Jeremy D ***@***.***> wrote:
*jdarwood007* left a comment (SimpleMachines/SMF#8884)
<#8884 (comment)>
Safe to review again or do you have more incoming?
—
Reply to this email directly, view it on GitHub
<#8884 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADJNN33KIPQN5YNMM3XXFD3SSTWRAVCNFSM6AAAAACE2BU2T6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEOBYHE3DINJYGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Two issue.
|
|
AJAX refactor: Replaced all jQuery
$.ajaxcalls with the Fetch API and Promises.smc_Requestclass with staticfetchandfetchXMLmethods, supporting timeouts and credential options.getServerResponse,getXMLDocument, andsendXMLDocumentnow use Fetch and return Promises, calling callbacks if provided.Improved error handling: Uses
Promise.rejectand catches network errors; callbacks receivefalseon failure.Popup and menu handling:
reqOverlayDivandsmc_PopupMenunow usefetchand native DOM methods instead of jQuery for content loading and event handling.