Changeset 34102 for main


Ignore:
Timestamp:
2020-04-16T07:39:40+12:00 (4 years ago)
Author:
kjdon
Message:

there were issues in chrome with sending a post request to the document from the verify page for fast view documents. when downloading them, it sends a new request back, but because its a post, it has to come from cache, but there was no cache version, so got a cache miss. Have modified the form - on submit we do an ajax call with the erification params, this sets up the user/document as verified in URLFilter, and just returns from there (rather than doing a redirect to the doc). then the verify page redirects to the document.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/verify.xsl

    r33755 r34102  
    6060        }
    6161        function enableSubmit() {
    62           if (document.getElementById('acceptTerms').checked && (!use_recaptcha || recaptcha_complete)) {
    63             document.getElementById('submitVerification').disabled = false;
    64           } else {
    65              document.getElementById('submitVerification').disabled = true;
    66           }
     62        if (document.getElementById('acceptTerms').checked && (!use_recaptcha || recaptcha_complete)) {
     63         
     64        document.getElementById('submitVerification').disabled = false;
     65        } else {
     66        document.getElementById('submitVerification').disabled = true;
    6767        }
     68        }
     69        function submitForm() {
     70          $.ajax({
     71            url:$('#verifyform').attr('action'),
     72            type: 'POST',
     73            data: $('#verifyform').serialize(),
     74            success: function(){
     75            window.location.href='</xsl:text><xsl:value-of select="$URL"/><xsl:text disable-output-escaping="yes">';
     76            }
     77            });
     78   
     79            }
    6880          </xsl:text></script>
    69           <input type="submit" autocomplete="off" id="submitVerification" value="Submit" disabled="true"/>
     81          <input type="button" onclick="submitForm()" autocomplete="off" id="submitVerification" value="Submit" disabled="true"/> 
    7082        </form>
    7183      </div>
    7284    </xsl:template>
    7385
    74 
    75 
    7686</xsl:stylesheet> 
    7787
Note: See TracChangeset for help on using the changeset viewer.