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 callumacrae » Sat Feb 25, 2012 2:59 pm

hanakin wrote:
callumacrae wrote:
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.


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

It has already been cleaned up: https://github.com/igorw/phpbb3/blob/fe ... le/ajax.js
"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 hanakin » Sun Feb 26, 2012 4:19 am

ahh looks much better, one note though please use strict naming convention for all variables/functions, something that is very descriptive as that is a huge issue with the JS we currently have like the "DE" function WTF?

specifically el and tr wtf? I am guessing el is supposed to be element and tr is maybe row? Thr code needs to be istantly understandable by the devs or contributors to the software making us take the time to analyse all the code and piece together what the hell those are or do is not fun for anyone

plus the end result should be a minified anyway so the added few bytes for descriptive names will not really increase the file size in the long run, also not to be nit piccky but check the english for your comments lol
hanakin
Registered User
 
Posts: 173
Joined: Sat Dec 25, 2010 9:02 pm

Re: [RFC] AJAX

Postby imkingdavid » Sun Feb 26, 2012 5:37 pm

hanakin wrote:ahh looks much better, one note though please use strict naming convention for all variables/functions, something that is very descriptive as that is a huge issue with the JS we currently have like the "DE" function WTF?

IIRC, de() is for toggling display, although I didn't know what it was for at first either until I actually looked to see. Probably short for "display element" or something. But I agree that we should not be lazy in naming functions. In the PHP portion we don't have functions like de(), so we shouldn't do so in Javascript either.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.
User avatar
imkingdavid
Development Team
Development Team
 
Posts: 902
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] AJAX

Postby hanakin » Mon Feb 27, 2012 9:25 am

Also not sure what alll is using ajax but the editing of a post could be a huge benifit if it were via ajax
hanakin
Registered User
 
Posts: 173
Joined: Sat Dec 25, 2010 9:02 pm

Re: [RFC] AJAX

Postby igorw » Mon Feb 27, 2012 10:28 am

Yes, 'dE' is quite bad. 'el' and 'tr' are pretty obvious in context I think.

Anyway, we should not add any more ajaxified things before the ajax PR is merged. It is more important that we have some infrastructure for adding ajaxification. The stuff provided by the AJAX PR plus hooks will make it really easy for extensions to add that kind of behaviour.
User avatar
igorw
Registered User
 
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: [RFC] AJAX

Postby hanakin » Mon Feb 27, 2012 10:52 am

igorw wrote:Yes, 'dE' is quite bad. 'el' and 'tr' are pretty obvious in context I think.

Anyway, we should not add any more ajaxified things before the ajax PR is merged. It is more important that we have some infrastructure for adding ajaxification. The stuff provided by the AJAX PR plus hooks will make it really easy for extensions to add that kind of behaviour.


el possibly but tr is still a little obscure and I still say that we should use a strict naming convention for everything the only exception would be for iterators
hanakin
Registered User
 
Posts: 173
Joined: Sat Dec 25, 2010 9:02 pm

Re: [RFC] AJAX

Postby callumacrae » Mon Feb 27, 2012 1:20 pm

I would guess that tr = <tr>?

>_<
"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 hanakin » Mon Feb 27, 2012 5:01 pm

callumacrae wrote:I would guess that tr = <tr>?

>_<


ok then is it storing to a tr, what if that tr changes? then the name has to change lol
hanakin
Registered User
 
Posts: 173
Joined: Sat Dec 25, 2010 9:02 pm

Re: [RFC|Merged] AJAX

Postby _hsr » Sat Mar 31, 2012 12:30 pm

Regarding the quickedit feature, how would it best be implemented, a pop up text editor or an inline version?
There is a text here !
_hsr
Registered User
 
Posts: 42
Joined: Mon Mar 26, 2012 7:06 am

Re: [RFC|Merged] AJAX

Postby callumacrae » Sat Mar 31, 2012 12:34 pm

_hsr wrote:Regarding the quickedit feature, how would it best be implemented, a pop up text editor or an inline version?

I would prefer inline.
"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: No registered users and 7 guests