Ignore:
Timestamp:
2019-03-07T20:51:46+13:00 (5 years ago)
Author:
ak19
Message:

javascript-global-functions' local function callMetadataServer() now renamed to _callMetadataServer() and takes and extra parameter BEFORE existing last parameter opts. The extra parameter is errorResponseFunction, which if not null is called on an ajax error if using jQuery mode to do ajax (errorResponseFunction is not used by gsajaxapi yet). All functions that call _callMetadataServer() now also take an extra last param, errorResponseFunction, and force it to null if undefined. It is always the last param for these public functions, so that the existing method calls from outside the file will continue to work. Tested getting and setting regular meta with the doceditor and mapeditor: saving and reloading saved data still works. Not tested set/getMetaArrays used by usercomments, but the changes haven't been drastic or complicated, so shouldn't have broken anything in those 2 functions either.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/gsajaxapi.js

    r31542 r32873  
    243243    // that we want to dynamically update when the async post process has finished
    244244   
     245    // NOTE: if passing in an error callback function *separate* from success callback (i.e. if current callback param won't check xmlHttp.status == 200)
     246    // then see https://stackoverflow.com/questions/1442425/detect-xhr-error-is-really-due-to-browser-stop-or-click-to-new-page
     247    // and https://stackoverflow.com/questions/8866761/xmlhttprequest-ajax-error
     248   
    245249    var typeof_callback = typeof(callback);
    246250    if ((typeof_callback == "string") || (typeof_callback == "number") || (typeof_callback == "boolean")) {
Note: See TracChangeset for help on using the changeset viewer.