Skip to content

Commit

Permalink
Remove all console logging unless it
Browse files Browse the repository at this point in the history
s an error message
  • Loading branch information
laurenwalker committed Dec 28, 2017
1 parent b97ca36 commit 9be7c27
Show file tree
Hide file tree
Showing 20 changed files with 15 additions and 141 deletions.
7 changes: 0 additions & 7 deletions src/js/collections/ObjectFormats.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ define(['jquery', 'underscore', 'backbone', 'x2js', 'models/formats/ObjectFormat

model: ObjectFormat,

/* Create a new ObjectFormats collection */
initialize: function() {
console.log("ObjectFormats.initialize() called.");

},

/*
* The constructed URL of the collection
* (/cn/v2/formats)
Expand All @@ -43,7 +37,6 @@ define(['jquery', 'underscore', 'backbone', 'x2js', 'models/formats/ObjectFormat

/* Parse the XML response from the CN */
parse: function(response) {
console.log("ObjectFormats.parse() called.");

// If the collection is already parsed, just return it
if ( typeof response === "object" ) return response;
Expand Down
7 changes: 0 additions & 7 deletions src/js/collections/Units.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ define(["jquery", "underscore", "backbone", "x2js", "models/metadata/eml211/EMLU
return unit.get("_name").charAt(0).toUpperCase() + unit.get("_name").slice(1);
},

/* Create a new Units collection */
initialize: function() {
console.log("Units.initialize() called.");

},

/*
* The URL of the EML unit Dictionary
*/
Expand All @@ -38,7 +32,6 @@ define(["jquery", "underscore", "backbone", "x2js", "models/metadata/eml211/EMLU

/* Parse the XML response */
parse: function(response) {
console.log("Units.parse() called.");

// If the collection is already parsed, just return it
if ( typeof response === "object" ) return response;
Expand Down
7 changes: 0 additions & 7 deletions src/js/models/DataONEObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ define(['jquery', 'underscore', 'backbone', 'uuid', 'collections/ObjectFormats',
* Overload Backbone.Model.fetch, so that we can set custom options for each fetch() request
*/
fetch: function(options){
console.log("Fetching " + this.get("id"));

if ( ! options ) var options = {};
else var options = _.clone(options);
Expand Down Expand Up @@ -250,7 +249,6 @@ define(['jquery', 'underscore', 'backbone', 'uuid', 'collections/ObjectFormats',
* It deserializes the incoming XML from the /meta REST endpoint and converts it into JSON.
*/
parse: function(response){
// console.log("Parsing " + this.get("id"));

// If the response is XML
if( (typeof response == "string") && response.indexOf("<") == 0 ) {
Expand Down Expand Up @@ -508,7 +506,6 @@ define(['jquery', 'underscore', 'backbone', 'uuid', 'collections/ObjectFormats',
return xhr;
},
success: function(model, response, xhr){
console.log('yay, DataONEObject has been saved');

model.set("numSaveAttempts", 0);
model.set("uploadStatus", "c");
Expand Down Expand Up @@ -1057,7 +1054,6 @@ define(['jquery', 'underscore', 'backbone', 'uuid', 'collections/ObjectFormats',
var current = e.loaded;

var Percentage = (current * 100)/max;
console.log(Percentage);


if(Percentage >= 100)
Expand Down Expand Up @@ -1462,8 +1458,6 @@ define(['jquery', 'underscore', 'backbone', 'uuid', 'collections/ObjectFormats',
};
/* Show progress */
reader.onprogress = function(event) {
// console.log('Loaded ' + event.loaded + ' of ' + event.total);
// console.log('Processed ' + (offset + event.loaded) + ' of ' + file.size);
};
/* Handle load finish */
reader.onloadend = function(event) {
Expand All @@ -1489,7 +1483,6 @@ define(['jquery', 'underscore', 'backbone', 'uuid', 'collections/ObjectFormats',
_seek();
break;
case "SHA-1":
console.log("Generating SHA-1 checksum");
// TODO: Support SHA-1
// break;
default:
Expand Down
11 changes: 1 addition & 10 deletions src/js/models/PackageModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ define(['jquery', 'underscore', 'backbone', 'uuid', 'md5', 'rdflib', 'models/Sol
* Deserialize a Package from OAI-ORE RDF XML
*/
parse: function(response, options) {
console.log("DataPackage: parse() called.")

//Save the raw XML in case it needs to be used later
this.set("objectXML", $.parseHTML(response));
Expand Down Expand Up @@ -372,7 +371,6 @@ define(['jquery', 'underscore', 'backbone', 'uuid', 'md5', 'rdflib', 'models/Sol
processData: false,
data: formData,
success: function(response){
console.log('yay');
},
error: function(data){
console.log("error updating system metadata");
Expand All @@ -397,9 +395,6 @@ define(['jquery', 'underscore', 'backbone', 'uuid', 'md5', 'rdflib', 'models/Sol
var checksum = md5(mapXML);
this.set("checksum", checksum);

console.log("new package id: " + this.get("id"));
console.log(mapXML);

var requestSettings = {
url: MetacatUI.appModel.get("objectServiceUrl"),
type: "PUT",
Expand All @@ -408,7 +403,6 @@ define(['jquery', 'underscore', 'backbone', 'uuid', 'md5', 'rdflib', 'models/Sol
processData: false,
data: formData,
success: function(response){
console.log("yay, map is updated");
},
error: function(data){
console.log("error udpating object");
Expand Down Expand Up @@ -617,9 +611,7 @@ define(['jquery', 'underscore', 'backbone', 'uuid', 'md5', 'rdflib', 'models/Sol
}, this);

xmlString = xmlString.replace(/systemmetadata/g, "systemMetadata");

console.log(xmlString);


return xmlString;
},

Expand Down Expand Up @@ -1318,7 +1310,6 @@ define(['jquery', 'underscore', 'backbone', 'uuid', 'md5', 'rdflib', 'models/Sol

//Check authority of the Metadata SolrResult model instead
checkAuthority: function(){
console.log("check auth of package");

//Call the auth service
var authServiceUrl = MetacatUI.appModel.get('authServiceUrl');
Expand Down
1 change: 0 additions & 1 deletion src/js/models/formats/ObjectFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ define(['jquery', 'underscore', 'backbone'], function($, _, Backbone) {

/* No op - Formats are read only */
save: function() {
console.log("Object format is read only. Not implemented");

return false;
}
Expand Down
12 changes: 3 additions & 9 deletions src/js/models/metadata/eml211/EML211.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,7 @@ define(['jquery', 'underscore', 'backbone', 'uuid',
}

}

console.log(modelJSON);


return modelJSON;
},

Expand Down Expand Up @@ -723,9 +721,7 @@ define(['jquery', 'underscore', 'backbone', 'uuid',
//Camel-case the XML
var emlString = "";
_.each(eml, function(rootEMLNode){ emlString += this.formatXML(rootEMLNode); }, this);

console.log(emlString);


return emlString;
},

Expand Down Expand Up @@ -916,9 +912,7 @@ define(['jquery', 'underscore', 'backbone', 'uuid',
catch(error){
//Reset the identifier since we didn't actually update the object
this.resetID();

console.log("error during EML.save(): ", error);


this.set("uploadStatus", "e");
this.trigger("error");
this.trigger("cancelSave");
Expand Down
4 changes: 2 additions & 2 deletions src/js/models/metadata/eml211/EMLProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ define(['jquery', 'underscore', 'backbone', "models/DataONEObject", "models/meta
// We only replace <paras> because <funding> is an EMLText module
// instance and can contain other content we don't want to remove
// when serializing
$(fundingNode).children("para").remove(); console.log("Clearing out funding paras before adding the latest ones!");
$(fundingNode).children("para").remove();
}

_.each(this.get('funding'), function(f) {
Expand All @@ -124,7 +124,7 @@ define(['jquery', 'underscore', 'backbone', "models/DataONEObject", "models/meta
} else {
if (fundingNode.length !== 0) {
// Remove all funding <para>s
$(fundingNode).children("para").remove(); console.log("Clearing out funding paras cause none were set.")
$(fundingNode).children("para").remove();
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/js/models/metadata/eml211/EMLTemporalCoverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,6 @@ define(['jquery', 'underscore', 'backbone', 'models/DataONEObject'],
if (this.isGreaterTime(beginDate, endDate, beginTime, endTime))
errors.beginTime = "The begin time must be before the end time."

console.log(errors);

if(Object.keys(errors).length)
return errors;
else
Expand Down
1 change: 0 additions & 1 deletion src/js/themes/arctic/routers/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ function ($, _, Backbone) {
},

renderSignInSuccess: function(){
console.log("renderSignInSuccess");
$("body").html("Sign-in successful.");
setTimeout(window.close, 1000);
},
Expand Down
34 changes: 4 additions & 30 deletions src/js/views/AnnotatorView.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ define(['jquery',

// showing the viewer show the concepts with labels, definitions and audit info
this.$el.annotator('subscribe', 'annotationViewerShown', function(viewer, annotations) {
console.log("annotationViewerShown: " + viewer);

$(viewer.element).find(".annotator-tag").each(function(index, element) {
var conceptUri = $(element).html();
Expand Down Expand Up @@ -429,9 +428,7 @@ define(['jquery',
},

preRenderAnnotations : function(annotations) {

console.log("preRenderAnnotations");


var uris = [];

//look up the concept details in a batch
Expand All @@ -453,12 +450,9 @@ define(['jquery',
},

renderAnnotations : function(annotations) {

console.log("renderAnnotations");


// keep from duplicating
if (this.rendered) {
console.log("renderAnnotations already called");
return;
}
this.rendered = true;
Expand All @@ -469,11 +463,9 @@ define(['jquery',
});

// only want to show the manual annotations
console.log("All annotation count: " + annotations.length);
annotations = _.filter(annotations, function(ann){
return (ann.field == "sem_annotation");
});
console.log("Filtered for sem_annotation: " + annotations.length);

//Now extract the rejeced annotations
var rejectedAnnotations = _.filter(annotations, function(ann){
Expand Down Expand Up @@ -526,9 +518,6 @@ define(['jquery',

// figure out the annotation being selected
var annotationId = $(event.target).attr("data-id");

console.log("hover trigger for target: " + event.target);
console.log("hover trigger for annotation: " + annotationId);

// trigger as if a hover on highlighted region
var highlight = $("[data-annotation-id='" + annotationId + "']");
Expand Down Expand Up @@ -583,9 +572,7 @@ define(['jquery',
},

renderAnnotation: function(annotationModel) {

console.log("renderAnnotation");


var canEdit =
_.contains(annotationModel.get("permissions").admin, MetacatUI.appUserModel.get("username"))
||
Expand All @@ -597,9 +584,7 @@ define(['jquery',
var highlight = $("[data-annotation-id='" + annotationModel.get("id") + "']");
var section = $(highlight).closest(".tab-pane").children(".annotation-container");
var tab = $(highlight).closest(".tab-pane");
//console.log("tab: " + tab);
var tabControl = $("a[href='#" + $(tab).attr("id") + "'");
//console.log("tabControl: " + tabControl);
var icons = $(tabControl).find(".icon-tag");
if ($(icons).size() == 0) {
tabControl.prepend("<i class='icon-tag'></i>")
Expand All @@ -611,10 +596,6 @@ define(['jquery',
console.log("Highlights not completed yet - cannot render annotation");
return;
}

//console.log("Rendering annotation: " + annotationModel.get("id"));
//console.log("Rendering annotation");


//Render the annotation tag itself
var annotationTag = $.parseHTML(this.annotationTemplate({
Expand Down Expand Up @@ -690,7 +671,6 @@ define(['jquery',
flagAnnotation : function(e) {

var annotationId = $(e.target).attr("data-id");
console.log("deleting annotation id: " + annotationId);
var view = $('#metadata-container').data("annotator-view");
var annotations = view.$el.data('annotator').plugins.Store.annotations;
var annotation = _.findWhere(annotations, {id: annotationId});
Expand All @@ -704,7 +684,6 @@ define(['jquery',

deleteAnnotation : function(e) {
var annotationId = $(e.target).attr("data-id");
console.log("deleting annotation id: " + annotationId);
var view = $('#metadata-container').data("annotator-view");
var annotations = view.$el.data('annotator').plugins.Store.annotations;
var annotation = _.findWhere(annotations, {id: annotationId});
Expand Down Expand Up @@ -791,7 +770,6 @@ define(['jquery',

annotationStored : function(annotation) {

console.log("annotationStored");
var view = $('#metadata-container').data("annotator-view");

// add the data id to this
Expand All @@ -804,22 +782,18 @@ define(['jquery',

annotationUpdated : function(annotation) {

console.log("annotationUpdated");
var view = $('#metadata-container').data("annotator-view");
view.reindexPid(annotation, false);

},

// reindex when an annotation is updated
reindexPid : function(annotation, isDelete) {

console.log("reindexPid");


var view = $('#metadata-container').data("annotator-view");

// re load the annotations
var annotations = view.$el.data('annotator').plugins.Store.annotations;
console.log("annotations length: " + annotations.length);
if (isDelete) {
annotations = _.reject(annotations, function(a) {
return annotation.id == a.id;
Expand Down
7 changes: 1 addition & 6 deletions src/js/views/DataCatalogView.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,22 +372,17 @@ define(['jquery',
},

jumpUp : function() {

//console.log("Jumping UP!");


// re-root the tree at the parent concept of the root
var tree = $("[data-category='annotation'] .expand-collapse-control").data().popoverContent.find("#bioportal-tree").data("NCBOTree");
var options = tree.options();
var startingRoot = options.startingRoot;
//console.log("startingRoot: " + startingRoot);

if (startingRoot == "http://ecoinformatics.org/oboe/oboe.1.2/oboe-core.owl#MeasurementType") {
console.log("Already at top of tree");
return false;
}

var parentId = $("a[data-id='"+ encodeURIComponent(startingRoot) + "'").attr("data-subclassof");
console.log("parentId: " + parentId);

// re-root
$.extend(options, {startingRoot: parentId});
Expand Down
Loading

0 comments on commit 9be7c27

Please sign in to comment.