Ignore:
Timestamp:
2019-03-02T19:41:08+13:00 (5 years ago)
Author:
ak19
Message:

Save and rebuild works with map, but as with save shortcut key on map editor, the metamode ends up as accumulate still in doc.xml. Some other issues (not related to saveandrebuild) need fixing up like a popup about unsaved changes appearing even after save and rebuild has finished and possibly more things).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/map-scripts-editor.js

    r32837 r32838  
    111111        console.log(enableMessage);
    112112       
    113        
     113        // Comment out following section in entirety -- from "e=e" to end of "if(e)" -- if
     114        // you don't want to see the popup about changes that haven't been saved yet
    114115        e = e || window.event;
    115116        // For IE and Firefox
     
    126127            }               
    127128        }
     129       
    128130    }
    129131}
     
    332334    //Keyboard shortcuts           
    333335    var mapAndControls = document.getElementById("map-and-controls-" + this.id);
    334     console.log("@@@@ initMapEditor. mapAndControls: " + mapAndControls);
     336    console.log("@@@@ initMapEditor. mapAndControls: ", mapAndControls);
    335337   
    336338    //Sets shift as unpressed
     
    399401    var site_name = gs.xsltParams.site_name;
    400402    var nodeID = this.id; // documentID, hopefully contains section ID too
    401     var metaname = "GPS.mapOverlay";
    402    
     403    var metaname = gps_metadata_name;
     404       
    403405    // collection, site, documentID, metadataName, metadataPosition, responseFunction
    404406    gs.functions.getArchivesMetadata(collection, site_name, nodeID, metaname, 0, function(responseText){
     
    660662    console.log("Save pressed");
    661663   
    662     var json_overlays = ShapesUtil.overlayToJSON(this.overlays);
     664    var json_overlays = JSON.stringify(ShapesUtil.overlayToJSON(this.overlays));   
     665    that.savedOverlays = json_overlays; // save the old version to compare with future changes
    663666    var collection = gs.cgiParams.c;
    664667    var site_name = gs.xsltParams.site_name;
     
    667670   
    668671    // collection, site, documentID, metadataName, metadataPosition, metadataValue, prevMetadataValue, metamode, responseFunction   
    669     gs.functions.setArchivesMetadata(collection, site_name, nodeID, metaname, 0, JSON.stringify(json_overlays), null, "override", function(){
     672    gs.functions.setArchivesMetadata(collection, site_name, nodeID, metaname, 0, json_overlays, null, "override", function(){
    670673            console.log("SAVED");
    671674        }
    672675    );
    673676   
    674     gs.functions.getArchivesMetadata(collection, site_name, nodeID, metaname, 0, function(responseText){
     677    /*gs.functions.getArchivesMetadata(collection, site_name, nodeID, metaname, 0, function(responseText){
    675678            var JSONString = responseText.getValue();
    676679            that.savedOverlays = JSONString;
    677680        }
    678     ); 
     681    );*/
     682   
    679683   
    680684}
Note: See TracChangeset for help on using the changeset viewer.