live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
AJAX Quick Reply
« on September 28th, 2013, 12:38 AM »
Plugin discussion will commence in 3... 2...
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

agent47

  • Now I see the changes you're talking about.
  • Posts: 115

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: AJAX Quick Reply
« Reply #3, on September 28th, 2013, 07:49 AM »
(Didn't show as working, but obviously worked. Posting this from desktop.)
:edit: There's a JS bug.
Re: AJAX Quick Reply
« Reply #5, on September 28th, 2013, 11:57 AM »
Just FYI -- it's a bug in Wedge itself; an undefined constant. It should be defined, though, so this must execute before it's defined, or something... I don't have time to work on Wedge today, I was hoping to have an Internet connection outside where I'm supposed to be but there isn't, so I'm just saying hi while stopping by my house. I'll be back in a few hours... And might be able to fix that. In the meantime, be assured that all your posts ARE sent, they just don't show up without a page refresh.

Also, John -- not crucial or anything, but I've noticed that something like half of your plugin's JS is taken straight from Wedge's infinite scrolling code... Which isn't freely available to use anywhere. It's perfectly fine if you want the plugin to actually be core in Wedge (and I'd love for it to be), but other than that, you just can't release it with a free license. I'm supposed to 'protect' our codebase, otherwise anyone can do anything with it, and I don't want that. Not while I'm deep into the project anyway!

Oh, and to finish: I'm still undecided on whether the infinite scrolling code will use Ajax or an iframe.
iframes are good because they solve all JavaScript issues; they make it more complicated to handle form elements though (it'll mostly be with the moderation checkboxes, so I can add some code to account for them), and auto-resizing when the iframe is resized. (Most people on the net do it by, ahem, resizing after the onload event... Which is silly, because to be very precise, you'll need a setInterval to update it whenever it's needed. So if you're loading 10 pages in one go, it means that, for instance, you'll get 10 events that run on your tab, each fighting to get iframe size data. A one-second interval seems okay, but maybe not in all situations.
Ajax is good because it solves all of the iframe issues... See the pattern? :P But it also causes any JavaScript on the page to be duplicated and executed twice, which causes trouble, just look at the quick board selector which would need fixing.
I think that doing quick reply with an iframe would be best, actually, even if infinite scrolling keeps using Ajax.

But one funny thing... If you send a quick reply on page 5 when there are 10 pages in the topic, will the reply appear on page 5? If yes, if you then scroll down, and trigger infinite scrolling, you'll get your page 10 post lost between pages 5 and 6... ;)

Okay, gotta go, I'm super late...
Re: AJAX Quick Reply
« Reply #6, on September 28th, 2013, 09:51 PM »
Just for the story-- I was at a garage sale today... We made a total of about 70 bucks, about 10 bucks per hour. Considering it took days to prepare the sale, and a $30 investment in material needed for transport, in the end it was horribly not worth it. Plus, we saw an indecent amount of rude[1] passersby who'd just browse through stuff, ask for prices, and leave without saying anything, even after we said hello, thank you, good bye etc...
I hadn't made a garage sale in a few years. I don't think I'll ever have one again. My trashcan is more polite and doesn't force me to stay somewhere for 7 hours with nothing else to do than despair.
 1. And no, that's not because I'm in France........... Oh, wait, maybe it is :P

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: AJAX Quick Reply
« Reply #7, on September 29th, 2013, 07:02 AM »
Quote
Wedge's infinite scrolling code... Which isn't freely available to use
NOW you tell me! But I don't care if it's core or not.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: AJAX Quick Reply
« Reply #8, on September 29th, 2013, 05:10 PM »
Quote from live627 on September 29th, 2013, 07:02 AM
Quote
Wedge's infinite scrolling code... Which isn't freely available to use
NOW you tell me!
Err... Have you never worked with SMF before..? SMF has a policy of not allowing their own code to find itself inside external modifications... It led to many problems, too.
Quote from live627 on September 29th, 2013, 07:02 AM
But I don't care if it's core or not.
Well, making it core ensures that I can fix it immediately, if a major Wedge change breaks it...

agent47

  • Now I see the changes you're talking about.
  • Posts: 115
Re: AJAX Quick Reply
« Reply #9, on October 1st, 2013, 11:12 AM »Last edited on October 1st, 2013, 11:18 AM
Testing via Nexus
Me love Wedge. Me want to wedge Wedge in butt!

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: AJAX Quick Reply
« Reply #12, on October 3rd, 2013, 01:23 AM »
I disabled it because of the undefined constant. It's only temporary.
Do you have the problem, locally..?

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670

Nao

  • Dadman with a boy
  • Posts: 16,079