Author Topic: Preview button in Reply page  (Read 1712 times)

0 Members and 1 Guest are viewing this topic.

Offline Tirea Aean

  • The Blue One
  • Olo'eyktan Anawm
  • Palulukan Makto
  • *****
  • *
  • *
  • *
  • Posts: 9679
  • nv Eywa'eveng
  • Karma: 240
  • Oeri ran lu srung
    • Tirea Aean
Preview button in Reply page
« on: October 16, 2014, 11:45:39 am »
I've been seeing reports all around that when using Firefox or Safari, the Preview button inside the Reply page is broken.

Oel tse'a fìkxeyeyti:

Code: [Select]
junk after document element index.php:14
TypeError: XMLDoc.getElementsByTagName(...)[0] is undefined

Nìsung tsatsenge lu pxaya kxeyey alahe:

Code: [Select]
GET http://s.learnnavi.org/js/jquery-1.10.2.min.js [HTTP/1.1 403 Forbidden 50ms]
GET http://s.learnnavi.org/js/inline-audio.js [HTTP/1.1 403 Forbidden 44ms]
GET http://s.learnnavi.org/js/jquery-animate-css-rotate-scale.js [HTTP/1.1 403 Forbidden 56ms]
GET http://www.learnnavi.org/images/facebookicon.png [HTTP/1.1 403 Forbidden 54ms]
GET http://www.learnnavi.org/images/twittericon.png [HTTP/1.1 403 Forbidden 84ms]
GET http://www.learnnavi.org/images/youtubeicon.png [HTTP/1.1 403 Forbidden 64ms]
GET http://s.learnnavi.org/tos_link.jpg [HTTP/1.1 403 Forbidden 56ms]
GET http://www.learnnavi.org/images/logo.png [HTTP/1.1 403 Forbidden 75ms]
GET http://files.learnnavi.org/images/LNF_Logo.jpg [HTTP/1.1 403 Forbidden 69ms]
GET http://www.learnnavi.org/downloads/LAL.jpg [HTTP/1.1 403 Forbidden 116ms]

The JavaScript function previewPost() called onclick "preview" button is this:

Code: (JavaScript) [Select]
function previewPost() {
    if (window.XMLHttpRequest) {
        // Opera didn't support setRequestHeader() before 8.01.
        if (typeof(window.opera) != "undefined") {
            var test = new XMLHttpRequest();
            if (typeof(test.setRequestHeader) != "function")
                return submitThisOnce(document.forms.postmodify);
        }
        // !!! Currently not sending poll options and option checkboxes.
        var i, x = new Array();
        var textFields = ["subject", "message", "icon", "guestname", "email", "evtitle", "question", "topic"];
        var numericFields = [
            "board", "topic", "num_replies",
            "eventid", "calendar", "year", "month", "day",
            "poll_max_votes", "poll_expire", "poll_change_vote", "poll_hide"
        ];
        var checkboxFields = [
            "ns",
        ];

        for (i in textFields)
            if (document.forms.postmodify.elements[textFields[i]])
                x[x.length] = textFields[i] + "=" + escape(textToEntities(document.forms.postmodify[textFields[i]].value.replace(/&#/g, "&#"))).replace(/\+/g, "%2B");
        for (i in numericFields)
            if (document.forms.postmodify.elements[numericFields[i]] && typeof(document.forms.postmodify[numericFields[i]].value) != "undefined")
                x[x.length] = numericFields[i] + "=" + parseInt(document.forms.postmodify.elements[numericFields[i]].value);
        for (i in checkboxFields)
            if (document.forms.postmodify.elements[checkboxFields[i]] && document.forms.postmodify.elements[checkboxFields[i]].checked)
                x[x.length] = checkboxFields[i] + "=" + document.forms.postmodify.elements[checkboxFields[i]].value;

        sendXMLDocument(smf_scripturl + "?action=post2" + (current_board ? ";board=" + current_board : "") + (make_poll ? ";poll" : "") + ";preview;xml", x.join("&"), onDocSent);

        document.getElementById("preview_section").style.display = "";
        setInnerHTML(document.getElementById("preview_subject"), txt_preview_title);
        setInnerHTML(document.getElementById("preview_body"), txt_preview_fetch);

        return false;
    } else
        return submitThisOnce(document.forms.postmodify);
}

(disregard all those added </i> at the end which the forum seems to have added in when parsing the syntax highlighting... O.o)

The forum has been working as-is for ages (unless something was changed somewhere?) so I think this is a problem in these respective browsers. The problem does not exist when using Google Chrome or Opera Browser.

Learn Na'vi Discord Chat: https://discord.gg/WF6qcmv

Offline Wllìm

  • Taronyu
  • ****
  • Posts: 507
  • nl Netherlands
  • Karma: 47
    • Wimiso (weptsenge oeyä)
Re: Preview button in Reply page
« Reply #1 on: October 16, 2014, 12:02:12 pm »
Irayo ma Tirea Aean for opening this thread :)

Interestingly, it looks like Chrome refreshes the page when clicking Preview, while Firefox tries the preview in-place, which apparently fails now. I have no idea at all why Chrome and Firefox behave differently here :(
Stress practiceNoun declensionsVerb infixes •  Weather forecasts in Na'viKDE nìNa'viMy Na'vi blog
Seykxel sì nitram! Ngal rolun fì'upxaret aketsuktse'a! :D

Offline Tirea Aean

  • The Blue One
  • Olo'eyktan Anawm
  • Palulukan Makto
  • *****
  • *
  • *
  • *
  • Posts: 9679
  • nv Eywa'eveng
  • Karma: 240
  • Oeri ran lu srung
    • Tirea Aean
Re: Preview button in Reply page
« Reply #2 on: October 16, 2014, 12:06:45 pm »
Irayo ma Tirea Aean for opening this thread :)

Interestingly, it looks like Chrome refreshes the page when clicking Preview, while Firefox tries the preview in-place, which apparently fails now. I have no idea at all why Chrome and Firefox behave differently here :(

Maybe Chrome has the fallback of refreshing the page with the values if it fails to do it in place. Or not. I'm not 100% certain.

Learn Na'vi Discord Chat: https://discord.gg/WF6qcmv

Offline Tìtstewan

  • LearnNavi Zeykoyu
  • Toruk Makto
  • Palulukan Makto
  • *****
  • *
  • *
  • Posts: 9733
  • de Germany
  • Karma: 318
  • Ke lu oeru kea krr krrtalun!
    • My YouTube Channel
Re: Preview button in Reply page
« Reply #3 on: October 16, 2014, 12:27:07 pm »
Do you can take a look at the browser console of chrome to see what it report?
Internet Explorer works but if I open the IE's browser console, I get this:

and everything is blocked...

EDIT:
From the 90k2 thread...
Testing stuff with Opera as it base on the same engine like Google Chrome...

....

It works? Yes!



Forum preview work?

Firefox: no tested
Internet Explorer: yes tested (but in console mode it won't work...)
Chrome: yes (mentiond in some posts)
Safari: no (read that in the shout box)
Opera: yes tested

Right... Does anybody know why Chrome does the "refresh-on-preview" thing? It seems that is the reason that Firefox doesn't work and Chrome does...
Opera do the same thing (?)

-----

The mistake appears only on the separate post page, not in the quick reply nor in the PM page.


Oh, this is interesting. If I look at the HTTP response that the server returns after the preview call, I see this:

Code: (html) [Select]
<div>
<table border="0" width="80%" cellspacing="0" align="center" cellpadding="4" class="tborder">
<tr class="titlebg">
<td>An Error Has Occurred!</td>
</tr>
<tr class="windowbg">
<td style="padding: 3ex;">
Your session timed out while posting.  Please go back and try again.
</td>
</tr>
</table>
</div>
<div align="center" style="margin-top: 2ex;"><a href="javascript:history.go(-1)">Back</a></div>

-->
An Error Has Occurred!
Your session timed out while posting.  Please go back and try again.
« Last Edit: October 16, 2014, 12:33:52 pm by Tìtstewan »

-| Dict-Na'vi.com | Na'viteri Files | FAQ | LM | Puk Pxaw 'Rrta | Kem si fu kem rä'ä si, ke lu tìfmi. |-

Offline Kemaweyan

  • Eywatsyìp
  • ******
  • *
  • Posts: 14675
  • ua Ukraine
  • Karma: 239
  • Swirä letxon
Re: Preview button in Reply page
« Reply #4 on: October 16, 2014, 12:41:36 pm »
There is an error in Opera too, but preview works.

Code: [Select]
Uncaught exception: TypeError: 'XMLDoc.getElementsByTagName' is not a function
Nìrangal frapo tsirvun pivlltxe nìNa'vi :D

Offline Tirea Aean

  • The Blue One
  • Olo'eyktan Anawm
  • Palulukan Makto
  • *****
  • *
  • *
  • *
  • Posts: 9679
  • nv Eywa'eveng
  • Karma: 240
  • Oeri ran lu srung
    • Tirea Aean
Re: Preview button in Reply page
« Reply #5 on: October 16, 2014, 01:28:43 pm »
Testing Reply Preview on Chrome OS 38 Stable.

There was one error before the entire page refreshed. Upon refresh, no errors.

The error was:


Uncaught TypeError: undefined is not a fuction


It only appears in the console for that split second before the page refresh, so further investigation is nearly impossible. Even attempts to stop the page before it refreshes fail. There's not much more I can do to investigate this particular error here.

Learn Na'vi Discord Chat: https://discord.gg/WF6qcmv

Offline Vawmataw

  • Palulukan Makto
  • *****
  • *
  • Posts: 5748
  • nv Eywa'eveng
  • Karma: 96
Re: Preview button in Reply page
« Reply #6 on: October 17, 2014, 08:30:03 am »
What I get with Mozilla Firefox on Ubuntu:
Quote from: What does the Firefox say?
données incompréhensibles après l'élément de document                                              index.php:14
TypeError: XMLDoc.getElementsByTagName(...)[0] is undefined                                      post2:310
Code: [Select]
<div>
<table border="0" width="80%" cellspacing="0" align="center" cellpadding="4" class="tborder">
<tr class="titlebg">
<td>An Error Has Occurred!</td>
</tr>
<tr class="windowbg">
<td style="padding: 3ex;">
Sorry, you cannot post new topics in this board.
</td>
</tr>
</table>
</div>
<div align="center" style="margin-top: 2ex;"><a href="javascript:history.go(-1)">Back</a></div>
</div>
« Last Edit: October 17, 2014, 08:53:49 am by Vawmataw »

Offline Wllìm

  • Taronyu
  • ****
  • Posts: 507
  • nl Netherlands
  • Karma: 47
    • Wimiso (weptsenge oeyä)
Re: Preview button in Reply page
« Reply #7 on: October 17, 2014, 11:31:05 am »
I like how they translated junk as données incompréhensibles ;D



Has Chrome always refreshed the entire page when requesting a preview? If not, the refreshing could be a result of the problem.
Stress practiceNoun declensionsVerb infixes •  Weather forecasts in Na'viKDE nìNa'viMy Na'vi blog
Seykxel sì nitram! Ngal rolun fì'upxaret aketsuktse'a! :D

Offline Tirea Aean

  • The Blue One
  • Olo'eyktan Anawm
  • Palulukan Makto
  • *****
  • *
  • *
  • *
  • Posts: 9679
  • nv Eywa'eveng
  • Karma: 240
  • Oeri ran lu srung
    • Tirea Aean
Re: Preview button in Reply page
« Reply #8 on: October 17, 2014, 12:05:22 pm »
Has Chrome always refreshed the entire page when requesting a preview? If not, the refreshing could be a result of the problem.

I can't really remember. I want to say I do remember experiencing the behavior of a live preview where it jumps up to the anchor and not a refresh. But I can't say that with certainty. I thought of that earlier, what if Chrome refreshes the page and passes the data to the refreshed page in attempt to make it work despite the error at hand.

Learn Na'vi Discord Chat: https://discord.gg/WF6qcmv

Offline Tìtstewan

  • LearnNavi Zeykoyu
  • Toruk Makto
  • Palulukan Makto
  • *****
  • *
  • *
  • Posts: 9733
  • de Germany
  • Karma: 318
  • Ke lu oeru kea krr krrtalun!
    • My YouTube Channel
Re: Preview button in Reply page
« Reply #9 on: October 18, 2014, 10:15:22 am »
I can't really remember.
Maybe, you can test this by this way: write yourself a PM and do in the PM mode a preview and you can see how chrome is doing it.

-| Dict-Na'vi.com | Na'viteri Files | FAQ | LM | Puk Pxaw 'Rrta | Kem si fu kem rä'ä si, ke lu tìfmi. |-

Offline Vawmataw

  • Palulukan Makto
  • *****
  • *
  • Posts: 5748
  • nv Eywa'eveng
  • Karma: 96
Re: Preview button in Reply page
« Reply #10 on: October 18, 2014, 10:44:13 pm »
Test cheap low quality browser on android
 :o Page reloads and function works.

Offline Tirea Aean

  • The Blue One
  • Olo'eyktan Anawm
  • Palulukan Makto
  • *****
  • *
  • *
  • *
  • Posts: 9679
  • nv Eywa'eveng
  • Karma: 240
  • Oeri ran lu srung
    • Tirea Aean
Re: Preview button in Reply page
« Reply #11 on: October 18, 2014, 10:47:51 pm »
I can't really remember.
Maybe, you can test this by this way: write yourself a PM and do in the PM mode a preview and you can see how chrome is doing it.

It reloads on the PM page too. Except no error messages there.

Learn Na'vi Discord Chat: https://discord.gg/WF6qcmv

Offline Wllìm

  • Taronyu
  • ****
  • Posts: 507
  • nl Netherlands
  • Karma: 47
    • Wimiso (weptsenge oeyä)
Re: Preview button in Reply page
« Reply #12 on: October 19, 2014, 04:17:34 am »
For me, in Firefox, the page reloads as well on preview for PMs. :o
Stress practiceNoun declensionsVerb infixes •  Weather forecasts in Na'viKDE nìNa'viMy Na'vi blog
Seykxel sì nitram! Ngal rolun fì'upxaret aketsuktse'a! :D

Offline Tìtstewan

  • LearnNavi Zeykoyu
  • Toruk Makto
  • Palulukan Makto
  • *****
  • *
  • *
  • Posts: 9733
  • de Germany
  • Karma: 318
  • Ke lu oeru kea krr krrtalun!
    • My YouTube Channel
Re: Preview button in Reply page
« Reply #13 on: October 19, 2014, 06:03:54 am »
 ???
(because of those shocked smileys) Why you are shocked?

Don't remember me how FF did the preview on the normal post page... The PM page reloads for me too.
I still wondering why the PM preview works but not the standard preview page. :-\

-| Dict-Na'vi.com | Na'viteri Files | FAQ | LM | Puk Pxaw 'Rrta | Kem si fu kem rä'ä si, ke lu tìfmi. |-

Offline Wllìm

  • Taronyu
  • ****
  • Posts: 507
  • nl Netherlands
  • Karma: 47
    • Wimiso (weptsenge oeyä)
Re: Preview button in Reply page
« Reply #14 on: October 19, 2014, 06:58:16 am »
???
(because of those shocked smileys) Why you are shocked?
Because Firefox doesn't reload on the previews for the posting page ???
Stress practiceNoun declensionsVerb infixes •  Weather forecasts in Na'viKDE nìNa'viMy Na'vi blog
Seykxel sì nitram! Ngal rolun fì'upxaret aketsuktse'a! :D

Offline Tìtstewan

  • LearnNavi Zeykoyu
  • Toruk Makto
  • Palulukan Makto
  • *****
  • *
  • *
  • Posts: 9733
  • de Germany
  • Karma: 318
  • Ke lu oeru kea krr krrtalun!
    • My YouTube Channel
Re: Preview button in Reply page
« Reply #15 on: October 19, 2014, 12:58:28 pm »
I can't remember me, because I havn't spent attention how FF is doing the preview. :-X

But, I remember me, we had once a similar error:
Quote
Code: (JavaScript) [Select]
{if
(typeof $.props['transform']=='undefined'&&(arg=='transform'||(typeof arg=='object'&&typeof arg['transform']!='undefined')))
--> TypeError: $.props is undefined[/size]
This was that code for the rotate function for Neytiri in the /Spam. The thing was, the code [$.props] no longer exists. It has been split into [$.attrFix] and [$.propFix].

So, it could be possible, that the function [XMLDoc.getElementsByTagName(...)[0]] has been changed to something else, doesn't it? ??? :-\

-| Dict-Na'vi.com | Na'viteri Files | FAQ | LM | Puk Pxaw 'Rrta | Kem si fu kem rä'ä si, ke lu tìfmi. |-

Offline Wllìm

  • Taronyu
  • ****
  • Posts: 507
  • nl Netherlands
  • Karma: 47
    • Wimiso (weptsenge oeyä)
Re: Preview button in Reply page
« Reply #16 on: October 19, 2014, 03:13:35 pm »
No, I don't think so since it is a very widely used JavaScript function. See here, every browser supports it already for a very long time. ;)
Stress practiceNoun declensionsVerb infixes •  Weather forecasts in Na'viKDE nìNa'viMy Na'vi blog
Seykxel sì nitram! Ngal rolun fì'upxaret aketsuktse'a! :D

Offline Blue Elf

  • Palulukan Makto
  • *****
  • *
  • *
  • Posts: 5482
  • cz Czech Republic
  • Karma: 112
    • My attempt for blog
Re: Preview button in Reply page
« Reply #17 on: October 20, 2014, 02:05:57 pm »
What is interesting - it doesn't work in FF 20.0 and 31.0, in both it worked before. FF wasn't updated, so why it suddenly doesn't work? Looks like update on the server!
Oe lu skxawng skxakep. Slä oe nerume mi.
"Oe tasyätxaw ulte koren za'u oehu" (Limonádový Joe)


Offline `Eylan Ayfalulukanä

  • Palulukan Makto
  • *****
  • *
  • *
  • Posts: 4701
  • us United States
  • Karma: 44
  • Palulukan alu Kenya 06/23/1996 - 01/15/2017
    • The Lionlamb website
Re: Preview button in Reply page
« Reply #18 on: October 20, 2014, 03:58:46 pm »
Fì'pamrel lu tìfmetok

I'm not sure Firefox reloads when it previews, but I seem to recall it does. Of course, not it is not trying to reload.

The fact that three different browsers experience the issue (I didn't try IE) tells me the problem is probably in the forum.

In other news: Back from a week at a place that had no internet service. (But they had a six month old liger cub :) )

Yawey ngahu!
pamrel si ro [email protected]

Offline Toruk Makto

  • LearnNavi Admin
  • Toruk Makto
  • Palulukan Makto
  • *****
  • *
  • Posts: 6041
  • us United States
  • Karma: 212
  • . Txepsiyu Markì .
    • Learn Na'vi
Re: Preview button in Reply page
« Reply #19 on: October 29, 2014, 10:49:03 am »
I think I have the preview problem fixed. Can someone confirm, please?

Lì’fyari leNa’vi ’Rrtamì, vay set ’almong a fra’u zera’u ta ngrrpongu
Na'vi Dictionary: http://eanaeltu.learnnavi.org/dicts/NaviDictionary.pdf

 

Become LearnNavi's friend on Facebook Follow LearnNavi on Twitter! Watch LearnNavi's videos on YouTube

SMF 2.0.15 | SMF © 2017, Simple Machines
Privacy Policy
| XHTML | RSS | WAP2 | Site Rules

LearnNavi is not affiliated with the official Avatar website,
James Cameron, or the Twentieth Century-Fox Film Corporation.
All trademarks and servicemarks are the properties of their respective owners.
Images in the LearnNavi.org Forums and Gallery may not be used without permission.

LearnNavi Affiliates:
ToS

LearnNavi is the community to learn Na'vi, the Avatar Language
"A place where real friendships are made." -Paul Frommer

AvatarMeet | Learn Na'vi Forum | Learn Na'vi Wiki | Na'viteri

LearnNavi