Ignore:
Timestamp:
2017-03-28T17:04:10+13:00 (7 years ago)
Author:
ak19
Message:

Next incremental change to adding user comments in GS3. This time to make the get-meta-array and set-meta-array functions be called asynchronously from user_comments.js (these operations can be called synchronously by any others wishing to tuse them, and do so by default). user_comments.js chooses to call get-meta-array and even set-meta-array asynchronously by passing in the appropriate flag to make the ajax calls asynchronous. To protect against any overlapping read/write issues and mutliple submit comments (set-meta-array calls) from being fired off with overlap, the submit button gets disabled until the set-meta-array call has returned and its callback is called. Similarly, the submit button is disabled until the page has finished loading existing user comments (get-meta-array call).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/layouts/usercomments.xsl

    r31542 r31543  
    4848      </div>
    4949     
    50       <input type="submit" onclick="addUserComment(document.AddUserCommentForm.username.value, document.AddUserCommentForm.comment.value, document.AddUserCommentForm.d.value, document); return false;"><xsl:attribute name="value"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'usercomments.submit')"/></xsl:attribute></input>
     50      <input type="submit" id="usercommentSubmitButton" onclick="addUserComment(document.AddUserCommentForm.username.value, document.AddUserCommentForm.comment.value, document.AddUserCommentForm.d.value, document); return false;"><xsl:attribute name="value"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'usercomments.submit')"/></xsl:attribute></input>
    5151      <label id="usercommentfeedback"><xsl:comment>Text to prevent empty tags from becoming self-closing tags</xsl:comment></label>
    5252
Note: See TracChangeset for help on using the changeset viewer.