Changeset 33218 for main

Show
Ignore:
Timestamp:
24.06.2019 17:46:14 (2 months ago)
Author:
wy59
Message:

1. Added Javascript versions of new erase-metadata functions, to work with their recently introduced perl counterparts. Because this feature is now unused but still potentially useful, having been created for a scenario we no longer need, these functions are untested. Other than that they produced no obvious javascript syntax errors when the modified javascript-global-functions.js file got included. 2. Minor, improved a comment.

Location:
main/trunk/greenstone3/web/interfaces/default/js
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/javascript-global-functions.js

    r33045 r33218  
    965965 
    966966    gs.functions._callMetadataServer( 
    967     "removeArchiveMetadata",  
     967    "removeArchivesMetadata",  
    968968    gs.functions.getBasicDataForMetadataServer("remove-archives-metadata", collection, site, documentID, metadataName, null /*metamode*/, metadataValue, null /*prevmetavalue*/, metadataPosition),  
    969969    successResponseFunction, 
     
    10031003} 
    10041004 
     1005 
     1006/*********************************************************** 
     1007* ERASE METADATA FUNCTIONS                                 * 
     1008* Erase all meta in docID (sectionID) that match metaname. * 
     1009***********************************************************/ 
     1010 
     1011gs.functions.eraseImportMetadata = function(collection, site, documentID, metadataName, successResponseFunction, errorResponseFunction) 
     1012{ 
     1013    if( typeof errorResponseFunction === 'undefined' ) { errorResponseFunction = null; } // force error callback to be defined: either null or has value 
     1014     
     1015    gs.functions._callMetadataServer( 
     1016    "eraseImportMetadata",  
     1017    gs.functions.getBasicDataForMetadataServer("erase-import-metadata", collection, site, documentID, metadataName, "override" /*metamode*/, null /*metadataValue*/, null /*prevmetavalue*/, null /*metadataPosition*/),  
     1018    successResponseFunction, 
     1019    errorResponseFunction); 
     1020} 
     1021 
     1022gs.functions.eraseArchivesMetadata = function(collection, site, documentID, metadataName, successResponseFunction, errorResponseFunction) 
     1023{ 
     1024    if( typeof errorResponseFunction === 'undefined' ) { errorResponseFunction = null; } // force error callback to be defined: either null or has value 
     1025     
     1026    gs.functions._callMetadataServer( 
     1027    "eraseArchivesMetadata",  
     1028    gs.functions.getBasicDataForMetadataServer("erase-archives-metadata", collection, site, documentID, metadataName, "override" /*metamode*/, null /*metadataValue*/, null /*prevmetavalue*/, null /*metadataPosition*/),  
     1029    successResponseFunction, 
     1030    errorResponseFunction); 
     1031} 
     1032 
     1033gs.functions.eraseIndexMetadata = function(collection, site, documentID, metadataName, successResponseFunction, errorResponseFunction) 
     1034{ 
     1035    if( typeof errorResponseFunction === 'undefined' ) { errorResponseFunction = null; } // force error callback to be defined: either null or has value 
     1036     
     1037    gs.functions._callMetadataServer( 
     1038    "eraseIndexMetadata",  
     1039    gs.functions.getBasicDataForMetadataServer("erase-metadata", collection, site, documentID, metadataName, "override" /*metamode*/, null /*metadataValue*/, null /*prevmetavalue*/, null /*metadataPosition*/),  
     1040    successResponseFunction, 
     1041    errorResponseFunction); 
     1042} 
     1043 
     1044gs.functions.eraseMetadata = function(collection, site, documentID, metadataName, successResponseFunction, errorResponseFunction) 
     1045{ 
     1046    if( typeof errorResponseFunction === 'undefined' ) { errorResponseFunction = null; } // force error callback to be defined: either null or has value 
     1047     
     1048    var nameArray = ["eraseImportMetadata", "eraseArchivesMetadata", "eraseIndexMetadata"]; 
     1049    var functionArray = ["erase-import-metadata", "erase-archives-metadata", "erase-metadata"]; 
     1050     
     1051    for(var i = 0; i < nameArray.length; i++) 
     1052    { 
     1053        gs.functions._callMetadataServer( 
     1054        nameArray[i], 
     1055        gs.functions.getBasicDataForMetadataServer(functionArray[i], collection, site, documentID, metadataName, "override" /*metamode*/, null /*metadataValue*/, null /*prevmetavalue*/, null /*metadataPosition*/), 
     1056        successResponseFunction, 
     1057        errorResponseFunction); 
     1058    } 
     1059} 
  • main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js

    r33217 r33218  
    1 var mapEnabled = false; // variable to detect when map-scripts have been included into document_scripts.js and classifier_scripts.js 
    2                         // Will be set to true iff we have gps map data that the map can display 
     1var mapEnabled = false; // variable to detect when map-scripts have been included into document_scripts.js and classifier_scripts.js, 
     2                        // in which case this variable will be defined. 
     3                        // It will be furthermore be set to true iff we have gps map data that the map can display, false if map-scripts imported but no map data. 
    34 
    45//var newLat, newLng = 0;