[RFC|Merged] AJAX

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.1/Ascraeus branch. Everything listed in this forum will be available in phpBB 3.1.
Post Reply
User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: [RFC] AJAX

Post by nickvergessen »

Why not reuse the "delete" cross Image
Member of the Development-TeamNo Support via PM

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] AJAX

Post by callumacrae »

Couple more things to be AJAXified:

- Voting in polls
- Adding / removing PM recipients
Made by developers, for developers!
My blog

wGEric
Registered User
Posts: 521
Joined: Wed Jun 11, 2003 2:07 am
Contact:

Re: [RFC] AJAX

Post by wGEric »

I suggest changing phpBB/assets/javascript/core.js to be a jQuery plugin. It would make it easier to implement into new areas. You are introducing another "framework" that people will have to figure out when most are already familiar with jQuery. So instead of this

Code: Select all

$('[data-ajax]').each(function() {
	var fn = ($(this).data('ajax') !== 'true') ? $(this).data('ajax') : null;
	phpbb.ajaxify({selector: this}, $(this).data('refresh') !== undefined, fn);
});
it would be this

Code: Select all

$('[data-ajax]').ajaxify();
Then the plugin would loop through each item and grab all of the data needed from the data attributes.
Eric

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] AJAX

Post by callumacrae »

"<wGEric> IMO it would simplify things for mod authors"

In 99% of cases, they just have to use the data-ajax attribute on their element, and everything will be done for them. In the other 1% (where exceptions are required), the code you specified wouldn't work anyway.

I don't think this should be a jQuery plugin, as it isn't really related to jQuery. I do think that the alerts and parse_querystring should be jQuery plugins, but Oleg wouldn't let me :P
Made by developers, for developers!
My blog

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: [RFC] AJAX

Post by naderman »

callumacrae wrote:I do think that the alerts and parse_querystring should be jQuery plugins, but Oleg wouldn't let me :P
Explain? He probably brought up an argument against it, and didn't just "not let you".

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] AJAX

Post by callumacrae »

naderman wrote:
callumacrae wrote:I do think that the alerts and parse_querystring should be jQuery plugins, but Oleg wouldn't let me :P
Explain? He probably brought up an argument against it, and didn't just "not let you".
https://github.com/phpbb/phpbb3/pull/336#r98092
Made by developers, for developers!
My blog

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC] AJAX

Post by Oleg »

I still have reservations about the giant switch statement over the entire phpbb ui. Surely this can't be the best way of doing anything, although I have not spent enough time thinking about it to propose an alternative.

Were translations-related concerns addressed?

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] AJAX

Post by callumacrae »

Oleg wrote:I still have reservations about the giant switch statement over the entire phpbb ui. Surely this can't be the best way of doing anything, although I have not spent enough time thinking about it to propose an alternative.
What do you mean by the giant switch statement?
Oleg wrote:Were translations-related concerns addressed?
Lack of translation abilities have been worked around, yes.
Made by developers, for developers!
My blog

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC] AJAX

Post by Oleg »

callumacrae wrote: What do you mean by the giant switch statement?
https://github.com/callumacrae/phpbb3/b ... le/ajax.js would be an example.
callumacrae wrote: Lack of translation abilities have been worked around, yes.
How?

I must say I would have preferred having documentation and explanations of changes instead of having to figure that out the hard way. After multiple hours spent reading the diff I'm starting to see what it is doing. I do expect all points that I requested to be documented be documented.

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] AJAX

Post by callumacrae »

Oleg wrote:
callumacrae wrote: What do you mean by the giant switch statement?
https://github.com/callumacrae/phpbb3/b ... le/ajax.js would be an example.
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.
Oleg wrote:
callumacrae wrote: Lack of translation abilities have been worked around, yes.
How?

I must say I would have preferred having documentation and explanations of changes instead of having to figure that out the hard way. After multiple hours spent reading the diff I'm starting to see what it is doing. I do expect all points that I requested to be documented be documented.
The language entries are stored in data attributes. What specifically don't you understand?
Made by developers, for developers!
My blog

Post Reply