Automatic Reply Preview

Automatic Reply Preview Final

No permission to download

Bloodcinder

Well-known member
Bloodcinder submitted a new resource:

Automatic Reply Preview - Automatically preview replies/edits after More Options without having to click Preview button.

Automatic Reply Preview add-on for Xenforo
by Bloodcinder

When this add-on is enabled, users will be automatically shown a preview after clicking "More Options" beneath the quick reply or inline editor. The default XenForo behavior would require them to manually click the "Preview" button, so this saves a step.

For support or suggestions, please post in the discussion thread.

Read more about this resource...
 
I don't know until somebody confirms for me, but my best guess is yes. It makes a change to one template. That template was upgraded in 1.4, and I doubt it was upgraded again in 1.5. If you install it and it does/doesn't work, that will confirm it, but it won't hurt anything if it doesn't work; it will simply fail to do anything at all.
 
That's hard for me to understand. The template modification occurs on the server and is definitely being applied to your pages. When typing a quick reply post that actually has some text in it and then picking "More Options," the add-on forces the new post page to simulate a click of the Preview button. It does so using JQuery and is as browser-independent as JQuery itself, and XF 1.5 still uses the same version of JQuery. I can't imagine how there is a per-browser issue related to 1.5. The issue must be unrelated to 1.5 itself and probably has to do with certain browsers that do not correctly support JQuery. I couldn't diagnose that without knowing the specific browser versions people are using. They also have to have JavaScript enabled.

EDIT: There are some bug reports from 3 or 4 years ago about my particular JQuery technique not working in Firefox and some other browsers. If their browsers are really outdated, that can explain it.
 
Here's a provisional fix. It might or might not change anything. Try installing this 1.0.2 version of the add-on to replace the version you already have and let me know if you notice a difference in the affected browsers.
 

Attachments

Last edited:
Then here's an alternative 1.0.3 version that does things completely differently and might be more likely to work. Again, if one of these fixes the problem, let me know, but I'm kind of guessing here because I can't directly troubleshoot the issue. I can only provide alternatives that may accidentally fix the problem.
 

Attachments

Thanks, will have a try with this tomorrow. I do have an alternative idea of what might be the problem (and it might be on my end)--perhaps something is server-cached and Firefox doesn't recognize that a "new" version is available, while Chrome does? I was using the latest release of Firefox, so it shouldn't be a problem with old browsers.
 
If the server is using really aggressive caching that only causes problems with a specific browser, that's possible, but it seems very unlikely. I'm almost certain it's a known issue without JavaScript (not just JQuery) calls DOM events in Firefox. That is to say, it's almost definitely the case that I can't fix the add-on because the problem is out of my hands. However, it's possible that if I can find out what particular browsers it's not working for then I can reverse engineer a solution.
 
Ok, attempted both versions and getting the same issue on both old and all-updated versions of Firefox. I'm still suspicious of aggressive caching.
 
There's one troubleshooting step you can do for me, if you know how to use the JavaScript console in your browser. If so, contact me via PM on your forum and I'll show you what to paste in the console to try to get it to work in the browser that doesn't seem to be supporting.
 
Great little add-on, exactly what I was looking for.
Unfortunately, it's not working with Firefox (including 1.0.3 attached in #9).

However, here's a fix that worked for me: instead of $(document).ready(function()), use $(window).on("load", function()) as listener.

Add to the bottom of template editor_js_setup just before the closing </script>:
JavaScript:
$(window).on("load", function() {
    $("input.button.PreviewButton").trigger("click");
});
 
Back
Top Bottom