-
☆ A M B ☆
- 211 Posts
hello all, I'm currently on road block, been trying to accomplish something for the past 24 hours without 'ideal results'. So I though I would share my situation in case this gives ideas on further improving Quip to allow more flexibility in its implementation.
I'm talking specifically about threaded comments. As you probably know, using threaded comments requires an additional page with another quip call. This quip call then takes the parameters of your original quip call in order to process the right settings.
My problem with this approach is that I personally find it "non-ideal" that the surfer is sent to another page in order to submit a reply to an existing comment, so I was looking for a way to allow this functionality without leaving the original page.
I accomplish this with ease simply by using a blank template on my Quip Reply page and using "prettyPhoto" jquery plugin for a nice overlay on top of the existing page. This results in a better experience (in my opinion) as the original page is still on the background.
This works perfectly except that when the quip comment is accepted, then the original comments page loads on the overlay, so I end up with the same page both on the overlay as well as the background.
I've tried numerous ways around this, including:
1) Forcing a refresh if the requested page is within the overlay (this is how I have it now).
2) Automatically closing the overlay when Quip accepts a comment (this didn't work so well, for some reason I couldn't consistently get the right output from the variable "quip_approved". Sometimes it would report 0 when it should have been 1 and vice-versa, I tested all cache settings)
The above two where my best attempts but ultimately they don't feel reliable. My current solution to force the redirect if the page is within the overlay (iframe) works pretty well with the exception that the page needs to fully load before the javascript gets executed. This is a browser behavior in Chrome (as far as I have tested), it doesn't seem to respect the order in which my script is placed as I placed this at the very top of the HTML document hoping it wouldn't need to load before it redirected but it still loaded the entire page before it executed. So this makes that solution "non reliable" as the page fully loads before the overlay is closed.
So here is what I think would make things easier when customizing Quip implementation:
1) A way to specify a target window where to load when redirecting after a successful comment has been submitted (this would make things so much simpler).
2) Perhaps a way to integrate Quip using ajax calls instead of redirecting between pages.
3) Making event handlers more accessible in order to make more custom integration. So if I had a way to check when there is an error in the form, or if the form was accepted and so on, then perhaps people would be able to be more creative in their integration. I know this is there already (somewhat), it can be accomplished with the error placeholders and some output modifiers, but it didn't feel precise (at least to me) and like I said before, the success variable wasn't always reporting correctly for some strange reason (I suspect some cache weirdness).
I apologize if any of my sentences make no sense, I'm not a programmer, I just copy/paste a lot =).
I appreciate any input.