Rebased on develop, the only conflict was with the temporary jquery reference, and fixed whitespace: https://github.com/p/phpbb3/compare/dev ... ure%2Fajax
Actually my whitespace commit is too aggressive, ignore it for now.
Without php json extension installed, I am told that "request timed out" whenever I try to do anything (tried reordering forums in acp). First, this is not true. Distinguish between the client side not receiving a response and receiving a response that it does not understand.
Second, the actual error should be logged in error log so that the admin knows what the problem is and can fix it.
Check if json extension is installed and if it is not installed, don't ajax-enable any page elements as none of them will work.
The "loading" message shows up on the very bottom of everything after all normal page markup. It took me a while to notice it there. What I see is a black overlay with nothing on it until the "request timed out" box appears.
Once a request "times out" that information box stays visible forever. After I installed json extension I was repeatedly moving forums up and down. At some point one of the requests "timed out" and now every time that black overlay appears it appears with the "request timed out" box in it, even though subsequent requests work fine.
Please compile a list of everything that has been ajaxified so far and put it in the first post in this topic. Right now I can only see this information in the list of commits.
There is still html in .js files. All markup should be moved into templates.
The flickering that happens when I move forums is annoying. How about waiting a certain time before showing the loading overlay, say 500 ms. If the action completes in less time don't show the overlay at all.
[RFC|Merged] AJAX
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: [RFC] AJAX
So? phpBB 3.1 requires PHP 5.2, and the json extension is packaged by default in 5.2. If someone is attempting to be clever by installed as few extensions as possible, that's their problem, imo.Oleg wrote:Without php json extension installed, I am told that "request timed out" whenever I try to do anything (tried reordering forums in acp). First, this is not true. Distinguish between the client side not receiving a response and receiving a response that it does not understand.
Oleg wrote:There is still html in .js files. All markup should be moved into templates.
document.createElement
has been in JavaScript longer than event listeners. JavaScript was designed for stuff like this, please realise that separation of logic isn't best absolutely everywhere.What happens if I tell it to take 500ms and the request takes 510ms? There will still be an annoying flickering.Oleg wrote:The flickering that happens when I move forums is annoying. How about waiting a certain time before showing the loading overlay, say 500 ms. If the action completes in less time don't show the overlay at all.
Re: [RFC] AJAX
You are not getting anywhere by restating this repeatedly.callumacrae wrote: So? phpBB 3.1 requires PHP 5.2, and the json extension is packaged by default in 5.2. If someone is attempting to be clever by installed as few extensions as possible, that's their problem, imo.
If you're going to make an actual argument, please make it. Otherwise move html into templates.callumacrae wrote: this, please realise that separation of logic isn't best absolutely everywhere.
The first request, maybe. Subsequent requests, probably not. Make a hidden config setting for the waiting time, then board admin will be able to set it appropriately for their board.callumacrae wrote: What happens if I tell it to take 500ms and the request takes 510ms? There will still be an annoying flickering.
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: [RFC] AJAX
No, a counter-argument. Except that you haven't made an actual argument, either. I see absolutely no advantage of moving it, short of HUR DUR A BOOK SAID TO KEEP EVERYTHING SEPARATE (the arguments for which are invalid in this context - if you actually have anything, please enlighten me.)Oleg wrote:If you're going to make an actual argument, please make it. Otherwise move html into templates.callumacrae wrote: this, please realise that separation of logic isn't best absolutely everywhere.
The request time usually depends on the user, not the board.Oleg wrote:The first request, maybe. Subsequent requests, probably not. Make a hidden config setting for the waiting time, then board admin will be able to set it appropriately for their board.callumacrae wrote: What happens if I tell it to take 500ms and the request takes 510ms? There will still be an annoying flickering.
Re: [RFC] AJAX
Lacking an argument to the contrary, markup goes in the templates.callumacrae wrote: No, a counter-argument. Except that you haven't made an actual argument, either. I see absolutely no advantage of moving it, short of HUR DUR A BOOK SAID TO KEEP EVERYTHING SEPARATE (the arguments for which are invalid in this context - if you actually have anything, please enlighten me.)
Do the 500 ms variant like I initially said, we'll see how well it works.callumacrae wrote: The request time usually depends on the user, not the board.
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: [RFC] AJAX
It's easier to have it in the JavaScript, as moving it to the template would involve large changes and it would be very tricky to make the page work when javascript is disabled.Oleg wrote:Lacking an argument to the contrary, markup goes in the templates.
Re: [RFC] AJAX
I understand that you will have to do more work to improve the architecture, but the current version is not acceptable.
If the html/js mix is needed for the last 2/3 of the functionality as discussed in our last irc conversation, you can split the first 1/3 out and fix the functionality issues (json, loading, etc.) into a separate pull request. I estimate the result will be sufficiently useful by itself to be merged.
If the html/js mix is needed for the last 2/3 of the functionality as discussed in our last irc conversation, you can split the first 1/3 out and fix the functionality issues (json, loading, etc.) into a separate pull request. I estimate the result will be sufficiently useful by itself to be merged.
Re: [RFC] AJAX
phpBB should simply require the json extension. All that is needed is an install check, and once we have those, a check in the ACP. You don't need to dynamically check it, because it should always be available on any sane installation of php.
Re: [RFC] AJAX
Congrats on having the largest pull request yet. Is it the first one to break 100 commits?
We still need a list of ajaxified things for testing.
We still need a list of ajaxified things for testing.
Re: [RFC] AJAX
That's a horrible piece of code, but there is no way around it without rewriting the buttons / removing support for users with js disabled. I still don't understand what you mean by giant switch statement.callumacrae wrote:Oleg wrote:https://github.com/callumacrae/phpbb3/b ... le/ajax.js would be an example.callumacrae wrote: What do you mean by the giant switch statement?
That could totaly be cleaned up, I agree with oleg take another look at this if i ever manage to get my computer back up and running I will attempt to provide some alternatives