It doesn't completely work and it is mostly your code in a jQuery extension so it isn't any better. You would use it like this:
- Code: Select all
$.phpbb.alert(title, message);
$.phpbb.confirm(title, message, callback);
$.phpbb.loading_alert();
You may want to look at some of those functions anyways since I fixed it so that events won't be bound more than once and some $('element') calls are only stored in variables the first time they are called. The most benefit would be for
ajaxify() which I talk about more below.callumacrae wrote: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.
That is incorrect. You have to add the
data-ajax attribute and then add the callback. Most AJAX requests are to modify the page some how so you have to have the callback. Ideally you could do something like this:- Code: Select all
$('#move_forum_down').ajaxify(refresh, callback);
$('#move_forum_up').ajaxify(callback);
refresh would be optional and you could have an options array or something so that you can pass in more arguments. This would allow authors to make a link/form work using ajax and supply a callback all within one spot.callumacrae wrote:Oleg wrote: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?
This is a giant patch with many different commits so it is hard to follow anything that is going on with it unless you watch it very closely. It probably would have been better to break this up into multiple patches.




