It has already been cleaned up: https://github.com/igorw/phpbb3/blob/fe ... le/ajax.jshanakin wrote: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 alternativescallumacrae wrote: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:https://github.com/callumacrae/phpbb3/b ... le/ajax.js would be an example.callumacrae wrote: What do you mean by the giant switch statement?
[RFC|Merged] AJAX
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: [RFC] AJAX
Re: [RFC] AJAX
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
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
- imkingdavid
- Registered User
- Posts: 1050
- Joined: Thu Jul 30, 2009 12:06 pm
Re: [RFC] AJAX
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.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?
Re: [RFC] AJAX
Also not sure what alll is using ajax but the editing of a post could be a huge benifit if it were via ajax
Re: [RFC] AJAX
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.
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.
Re: [RFC] AJAX
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 iteratorsigorw 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.
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: [RFC] AJAX
ok then is it storing to a tr, what if that tr changes? then the name has to change lolcallumacrae wrote:I would guess that tr =<tr>
?
>_<
Re: [RFC|Merged] AJAX
Regarding the quickedit feature, how would it best be implemented, a pop up text editor or an inline version?
There is a text here !
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: [RFC|Merged] AJAX
I would prefer inline._hsr wrote:Regarding the quickedit feature, how would it best be implemented, a pop up text editor or an inline version?