Skip to content

Commit

Permalink
Renamed namespace Debug to PivotViewer.Debug to fix conflicts with th…
Browse files Browse the repository at this point in the history
…ird party extensions
  • Loading branch information
pkleef committed Jan 8, 2018
1 parent 619d0c8 commit 9fbe077
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/collectionloader.js
Expand Up @@ -83,7 +83,7 @@ PivotViewer.Models.Loaders.CXMLLoader = PivotViewer.Models.Loaders.ICollectionLo
dataType: "xml",
crossDomain : true,
success: function (xml) {
Debug.Log('CXML loaded');
PivotViewer.Debug.Log('CXML loaded');
var collectionRoot = $(xml).find("Collection")[0];
var maxRelatedLinksLength = 0;
//get namespace local name
Expand Down
2 changes: 1 addition & 1 deletion src/jsonloader.js
Expand Up @@ -23,7 +23,7 @@ PivotViewer.Models.Loaders.JSONLoader = PivotViewer.Models.Loaders.ICollectionLo

var jqXHR = $.getJSON(this.JSONUri)
.done(function(data) {
Debug.Log('JSON loaded');
PivotViewer.Debug.Log('JSON loaded');

if (data.FacetCategories == undefined || data.Items == undefined) {
//Make sure throbber is removed else everyone thinks the app is still running
Expand Down
3 changes: 1 addition & 2 deletions src/namespaces.js
Expand Up @@ -22,5 +22,4 @@ PivotViewer.Models = {};
PivotViewer.Models.Loaders = {};
PivotViewer.Utils = {};
PivotViewer.Views = {};
//Debug
var Debug = Debug || {};
PivotViewer.Debug = {};
22 changes: 11 additions & 11 deletions src/pivotviewer.js
Expand Up @@ -91,10 +91,10 @@
_mapService = "Google";
} else if (options.MapService == "Google" && options.GoogleAPIKey == undefined && defaultOptions.GoogleAPIKey == undefined) {
_mapService = "OpenStreetMap";
Debug.Log('Google maps selected but no API key supplied. Reverting to OpenStreetMaps');
PivotViewer.Debug.Log('Google maps selected but no API key supplied. Reverting to OpenStreetMaps');
} else if (options.MapService == undefined && defaultOptions.MapService == "Google" && options.GoogleAPIKey == undefined && defaultOptions.GoogleAPIKey == undefined) {
_mapService = "OpenStreetMap";
Debug.Log('Google maps selected but no API key supplied. Reverting to OpenStreetMaps');
PivotViewer.Debug.Log('Google maps selected but no API key supplied. Reverting to OpenStreetMaps');
} else
_mapService = "OpenStreetMap";

Expand Down Expand Up @@ -127,10 +127,10 @@
_geocodeService = "Google";
} else if (options.GeocodeService == "Google" && options.GoogleAPIKey == undefined && defaultOptions.GoogleAPIKey == undefined) {
_geocodeService = "Nominatim";
Debug.Log('Google geocode service selected but no API key supplied. Reverting to Nominatim');
PivotViewer.Debug.Log('Google geocode service selected but no API key supplied. Reverting to Nominatim');
} else if (options.GeocodeService == undefined && defaultOptions.GeocodeService == "Google" && options.GoogleAPIKey == undefined && defaultOptions.GoogleAPIKey == undefined) {
_geocodeService = "Nominatim";
Debug.Log('Google geocode service selected but no API key supplied. Reverting to Nominatim');
PivotViewer.Debug.Log('Google geocode service selected but no API key supplied. Reverting to Nominatim');
} else
_geocodeService == "Nominatim";

Expand Down Expand Up @@ -232,14 +232,14 @@
})
.fail (function (jqxhr, textStatus, error) {
var err = textStatus + ", " + error;
Debug.Log ("Getting defaults file failed: " + err);
PivotViewer.Debug.Log ("Getting defaults file failed: " + err);
});
},
show: function () {
Debug.Log('Show');
PivotViewer.Debug.Log('Show');
},
hide: function () {
Debug.Log('Hide');
PivotViewer.Debug.Log('Hide');
}
};

Expand Down Expand Up @@ -917,7 +917,7 @@
if (_viewerState.Facet != null) {
$('.pv-toolbarpanel-sort option[value=' + CleanName(_viewerState.Facet) + ']').prop('selected', 'selected');
_currentSort = $('.pv-toolbarpanel-sort :selected').attr('label');
Debug.Log('current sort ' + _currentSort );
PivotViewer.Debug.Log('current sort ' + _currentSort );
}

//Filters
Expand Down Expand Up @@ -1016,7 +1016,7 @@
var foundItemsCount = [];
var selectedFacets = [];
var sort = $('.pv-toolbarpanel-sort option:selected').attr('label');
Debug.Log('sort ' + sort );
PivotViewer.Debug.Log('sort ' + sort );

if (!changingView)
_selectedItem = "";
Expand Down Expand Up @@ -1972,7 +1972,7 @@
//Sort change
$('.pv-toolbarpanel-sort').on('change', function (e) {
_currentSort = $('.pv-toolbarpanel-sort option:selected').attr('label');
Debug.Log('sort change _currentSort ' + _currentSort );
PivotViewer.Debug.Log('sort change _currentSort ' + _currentSort );
FilterCollection(false);
});
//Facet sort
Expand Down Expand Up @@ -2300,7 +2300,7 @@
$.publish("/PivotViewer/Views/Canvas/Drag", [_mouseMove]);
}
}
catch (err) { Debug.Log(err.message); }
catch (err) { PivotViewer.Debug.Log(err.message); }
});
canvas.on("touchend", function (evt) {
var orig = evt.originalEvent;
Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Expand Up @@ -14,7 +14,7 @@
// GNU General Public License v2 (see COPYING)
//

Debug.Log = function (message) {
PivotViewer.Debug.Log = function (message) {
if (window.console && window.console.log && typeof debug != "undefined" && debug == true) {
window.console.log(message);
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/graphview.js
Expand Up @@ -212,7 +212,7 @@ PivotViewer.Views.GraphView = PivotViewer.Views.TileBasedView.subClass({
if (!Modernizr.canvas)
return;

Debug.Log('Graph View Filtered: ' + currentFilter.length);
PivotViewer.Debug.Log('Graph View Filtered: ' + currentFilter.length);

this.changingView = false;
if (changingView) {
Expand Down
4 changes: 2 additions & 2 deletions src/views/gridview.js
Expand Up @@ -192,7 +192,7 @@ PivotViewer.Views.GridView = PivotViewer.Views.TileBasedView.subClass({
if (!Modernizr.canvas)
return;

Debug.Log('Grid View Filtered: ' + currentFilter.length);
PivotViewer.Debug.Log('Grid View Filtered: ' + currentFilter.length);

this.changingView = false;
if (changingView) {
Expand Down Expand Up @@ -271,7 +271,7 @@ PivotViewer.Views.GridView = PivotViewer.Views.TileBasedView.subClass({
if (!changingFromNonTileView || (changeViewSelectedItem == "")) {
var pt1Timeout = 0;
//zoom out first
Debug.Log("this.currentWidth: " + this.currentWidth + " this.width: " + this.width);
PivotViewer.Debug.Log("this.currentWidth: " + this.currentWidth + " this.width: " + this.width);
var value = $('.pv-toolbarpanel-zoomslider').slider('option', 'value');
if (value > 0) {
this.selected = selectedItem = "";
Expand Down
6 changes: 3 additions & 3 deletions src/views/mapview.js
Expand Up @@ -87,7 +87,7 @@ PivotViewer.Views.MapView = PivotViewer.Views.IPivotViewerView.subClass({
if (!Modernizr.canvas)
return;

Debug.Log('Map View Filtered: ' + currentFilter.length);
PivotViewer.Debug.Log('Map View Filtered: ' + currentFilter.length);

if (changingView) {
$('.pv-viewarea-canvas').fadeOut();
Expand Down Expand Up @@ -652,7 +652,7 @@ PivotViewer.Views.MapView = PivotViewer.Views.IPivotViewerView.subClass({
wkt.read(this.geometryValue.replace('\n', '').replace('\r', '').replace('\t', ''));
} catch (e2) {
if (e2.name === 'WKTError') {
Debug.Log('Wicket could not understand the WKT string you entered. Check that you have parentheses balanced, and try removing tabs and newline characters.');
PivotViewer.Debug.Log('Wicket could not understand the WKT string you entered. Check that you have parentheses balanced, and try removing tabs and newline characters.');
//return;
geometryOK = false;
}
Expand Down Expand Up @@ -849,7 +849,7 @@ PivotViewer.Views.MapView = PivotViewer.Views.IPivotViewerView.subClass({
areaWkt.read(areaValue.replace('\n', '').replace('\r', '').replace('\t', ''));
} catch (e2) {
if (e2.name === 'WKTError') {
Debug.Log('Wicket could not understand the WKT string you entered. Check that you have parentheses balanced, and try removing tabs and newline characters.');
PivotViewer.Debug.Log('Wicket could not understand the WKT string you entered. Check that you have parentheses balanced, and try removing tabs and newline characters.');
//return;
geometryOK = false;
}
Expand Down
6 changes: 3 additions & 3 deletions src/views/mapview2.js
Expand Up @@ -113,7 +113,7 @@ PivotViewer.Views.MapView2 = PivotViewer.Views.IPivotViewerView.subClass({
if (!Modernizr.canvas)
return;

Debug.Log('Map View Filtered: ' + currentFilter.length);
PivotViewer.Debug.Log('Map View Filtered: ' + currentFilter.length);

if (changingView) {
$('.pv-viewarea-canvas').fadeOut();
Expand Down Expand Up @@ -692,7 +692,7 @@ PivotViewer.Views.MapView2 = PivotViewer.Views.IPivotViewerView.subClass({
wkt.read(this.geometryValue.replace('\n', '').replace('\r', '').replace('\t', ''));
} catch (e2) {
if (e2.name === 'WKTError') {
Debug.Log('Wicket could not understand the WKT string you entered. Check that you have parentheses balanced, and try removing tabs and newline characters.');
PivotViewer.Debug.Log('Wicket could not understand the WKT string you entered. Check that you have parentheses balanced, and try removing tabs and newline characters.');
//return;
geometryOK = false;
}
Expand Down Expand Up @@ -901,7 +901,7 @@ PivotViewer.Views.MapView2 = PivotViewer.Views.IPivotViewerView.subClass({
areaWkt.read(areaValue.replace('\n', '').replace('\r', '').replace('\t', ''));
} catch (e2) {
if (e2.name === 'WKTError') {
Debug.Log('Wicket could not understand the WKT string you entered. Check that you have parentheses balanced, and try removing tabs and newline characters.');
PivotViewer.Debug.Log('Wicket could not understand the WKT string you entered. Check that you have parentheses balanced, and try removing tabs and newline characters.');
//return;
geometryOK = false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/views/tableview.js
Expand Up @@ -48,7 +48,7 @@ PivotViewer.Views.TableView = PivotViewer.Views.IPivotViewerView.subClass({
if (!Modernizr.canvas)
return;

Debug.Log('Table View Filtered: ' + currentFilter.length);
PivotViewer.Debug.Log('Table View Filtered: ' + currentFilter.length);

if (changingView) {
$('.pv-viewarea-canvas').fadeOut();
Expand Down Expand Up @@ -96,7 +96,7 @@ PivotViewer.Views.TableView = PivotViewer.Views.IPivotViewerView.subClass({
return 'Table View';
},
CellClick: function (columnId, cells) {
Debug.Log('CellClick');
PivotViewer.Debug.Log('CellClick');
if (columnId == 'pv-key') {
// selected item name need to get the id and publish selected event
//var selectedItemName = cells[0].innerHTML;
Expand Down
2 changes: 1 addition & 1 deletion src/views/timeview.js
Expand Up @@ -40,7 +40,7 @@ PivotViewer.Views.TimeView = PivotViewer.Views.IPivotViewerView.subClass({
if (!Modernizr.canvas)
return;

Debug.Log('Timeline View Filtered: ' + currentFilter.length);
PivotViewer.Debug.Log('Timeline View Filtered: ' + currentFilter.length);

if (changingView) {
$('.pv-viewarea-canvas').fadeOut();
Expand Down

0 comments on commit 9fbe077

Please sign in to comment.