phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

[RFC|Merged] AJAX

These requests for comments 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.

Re: [RFC] AJAX

Postby nickvergessen » Sat Sep 24, 2011 11:54 pm

Why not reuse the "delete" cross Image
cheers nickvergessen :geek:
Member of phpBB Development-Team
No Support via PM — My MODs for phpBB 3.0.x
User avatar
nickvergessen
Development Team
Development Team
 
Posts: 350
Joined: Sun Oct 07, 2007 11:54 am
Location: Esslingen, Germany

Re: [RFC] AJAX

Postby callumacrae » Fri Oct 14, 2011 5:37 am

Couple more things to be AJAXified:

- Voting in polls
- Adding / removing PM recipients
"In JavaScript, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders"
—Douglas Crockford

View my MOD, phpBB Mobile
User avatar
callumacrae
Website Team
Website Team
 
Posts: 883
Joined: Tue Apr 27, 2010 9:37 am
Location: England

Re: [RFC] AJAX

Postby wGEric » Sat Oct 15, 2011 2:58 pm

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
wGEric
Registered User
 
Posts: 506
Joined: Wed Jun 11, 2003 2:07 am

Re: [RFC] AJAX

Postby callumacrae » Sat Oct 15, 2011 4:55 pm

"<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
"In JavaScript, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders"
—Douglas Crockford

View my MOD, phpBB Mobile
User avatar
callumacrae
Website Team
Website Team
 
Posts: 883
Joined: Tue Apr 27, 2010 9:37 am
Location: England

Re: [RFC] AJAX

Postby naderman » Sat Oct 15, 2011 5:29 pm

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".
www.naderman.de
Move your forum to Forumatic - we'll take care of maintenance & spam
User avatar
naderman
Development Team Leader
Development Team Leader
 
Posts: 1650
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany

Re: [RFC] AJAX

Postby callumacrae » Sat Oct 15, 2011 5:41 pm

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
"In JavaScript, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders"
—Douglas Crockford

View my MOD, phpBB Mobile
User avatar
callumacrae
Website Team
Website Team
 
Posts: 883
Joined: Tue Apr 27, 2010 9:37 am
Location: England

Re: [RFC] AJAX

Postby Oleg » Tue Oct 18, 2011 6:34 am

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?
Oleg
3.1 Release Manager
3.1 Release Manager
 
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am

Re: [RFC] AJAX

Postby callumacrae » Tue Oct 18, 2011 7:16 am

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.
"In JavaScript, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders"
—Douglas Crockford

View my MOD, phpBB Mobile
User avatar
callumacrae
Website Team
Website Team
 
Posts: 883
Joined: Tue Apr 27, 2010 9:37 am
Location: England

Re: [RFC] AJAX

Postby Oleg » Fri Oct 21, 2011 6:25 am

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.
Oleg
3.1 Release Manager
3.1 Release Manager
 
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am

Re: [RFC] AJAX

Postby callumacrae » Fri Oct 21, 2011 3:19 pm

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?
"In JavaScript, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders"
—Douglas Crockford

View my MOD, phpBB Mobile
User avatar
callumacrae
Website Team
Website Team
 
Posts: 883
Joined: Tue Apr 27, 2010 9:37 am
Location: England

Previous Next

Return to [3.1/Ascraeus] Merged RFCs

Who is online

Users browsing this forum: Bing [Bot] and 4 guests