Changeset 33100 for main/trunk


Ignore:
Timestamp:
2019-05-21T18:45:25+12:00 (5 years ago)
Author:
wy59
Message:

Removed debugging and tidied up the format.

File:
1 edited

Legend:

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

    r33099 r33100  
    3838    this.resizable = false;
    3939    this.dontResize = false;
    40    
    4140
    4241    this.shapeOptions = {
     
    182181}
    183182
    184 
    185183// Ensure only unique labels are added to our autocomplete list
    186184MapEditor.prototype.addToAutocompleteLabelsList = function (newLabel) {
    187    
    188185    if (newLabel !== "" && !global_autocompleteLabelsList.includes(newLabel)) {
    189186        // add to autocomplete list and sort alphabetically
     
    191188        global_autocompleteLabelsList.sort();       
    192189    }
    193 
    194     console.log("the added new label to global autocomplete array:"); console.log(global_autocompleteLabelsList);
    195190}
    196191
     
    827822
    828823    this.mapEditorHistory.presentOverlayPush();
    829    
    830824   
    831825    // DO NOT assign "this.autocompleteLabelsList = keys(local_labels_hashmap);"
     
    840834    // https://stackoverflow.com/questions/929776/merging-objects-associative-arrays
    841835    // We've decided to use the jQuery based suggested solution for merging hashmaps:
    842     // $.extend(obj1, obj2); means obj1 = obj1 + obj2. Overwriting any existing properties in obj1 with new values in obj2.
    843 
    844     console.log("@@@@ Adding local contents to global: "); console.log(local_labels_hashmap);
    845     console.log("@@@@ global map before: "); console.log(global_labels_hashmap);
    846    
    847 
     836    // $.extend(obj1, obj2); means obj1 = obj1 + obj2. Note: it additionally overwrites any existing properties in obj1 with new values in obj2.
    848837    $.extend(global_labels_hashmap, local_labels_hashmap);
    849838
    850     console.log("@@@@ global map after: "); console.log(global_labels_hashmap);
    851 
    852839    // important to empty our global autocomplete labels list array
    853     //See https://stackoverflow.com/questions/1232040/how-do-i-empty-an-array-in-javascript
    854     // and https://www.jstips.co/en/javascript/two-ways-to-empty-an-array/
     840    // See https://stackoverflow.com/questions/1232040/how-do-i-empty-an-array-in-javascript
     841    // and https://www.jstips.co/en/javascript/two-ways-to-empty-an-array/
    855842    global_autocompleteLabelsList.length = 0;
    856843   
    857844    var keys = Object.keys(global_labels_hashmap);
    858845    global_autocompleteLabelsList.push.apply(global_autocompleteLabelsList, keys); // addAll keys to our global_autocompleteLabelsList (turns map's keys into array)
    859 
    860     console.log("@@@@ global ARRAY after setting to global map: "); console.log(global_autocompleteLabelsList);
    861846    global_autocompleteLabelsList.sort();   
    862847}
     
    902887    }
    903888}
    904 
    905889
    906890// Having got our unique (set) of descriptions/labels, we're ready to set it up as the source for our autocomplete list
Note: See TracChangeset for help on using the changeset viewer.