|
@ -2,6 +2,7 @@ var BNPChrome = angular |
|
|
.module("BNPChrome", []) |
|
|
.module("BNPChrome", []) |
|
|
.factory("parse", function () { |
|
|
.factory("parse", function () { |
|
|
const parser = function (input, level, depthOverride) { |
|
|
const parser = function (input, level, depthOverride) { |
|
|
|
|
|
chrome.extension.getBackgroundPage().console.debug(`In parser: Attempting Parse %s/%s`, level, depthOverride); |
|
|
const depth = depthOverride || 3; |
|
|
const depth = depthOverride || 3; |
|
|
if (level > depth) return input; |
|
|
if (level > depth) return input; |
|
|
|
|
|
|
|
@ -19,10 +20,21 @@ var BNPChrome = angular |
|
|
|
|
|
|
|
|
if (typeof input === "string") { |
|
|
if (typeof input === "string") { |
|
|
try { |
|
|
try { |
|
|
|
|
|
chrome.extension.getBackgroundPage().console.debug("In parser: Attempting String Parse"); |
|
|
input = parser(JSON.parse(input), level ? level + 1 : 1, depth); |
|
|
input = parser(JSON.parse(input), level ? level + 1 : 1, depth); |
|
|
return input; |
|
|
return input; |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
// not a stringified node
|
|
|
// not a stringified node
|
|
|
|
|
|
// could be URL Encoded
|
|
|
|
|
|
try { |
|
|
|
|
|
chrome.extension.getBackgroundPage().console.debug("In parser: Attempting URL Decode", decodeURI(input), level, depth); |
|
|
|
|
|
input = parser(decodeURI(input), level ? level + 1 : 1, depth); |
|
|
|
|
|
return input; |
|
|
|
|
|
} catch(e) { |
|
|
|
|
|
// not url encoded
|
|
|
|
|
|
chrome.extension.getBackgroundPage().console.debug("In parser: Could Not Decode"); |
|
|
|
|
|
return input; |
|
|
|
|
|
} |
|
|
return input; |
|
|
return input; |
|
|
} |
|
|
} |
|
|
} else if (typeof input === "object") { |
|
|
} else if (typeof input === "object") { |
|
@ -32,7 +44,7 @@ var BNPChrome = angular |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
// unless there is a datatype I'm not checking for....
|
|
|
// unless there is a datatype I'm not checking for....
|
|
|
// console.log('shouldnt get here')
|
|
|
|
|
|
|
|
|
chrome.extension.getBackgroundPage().console.debug('In parser: Data Type Unaccounted For'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return input; |
|
|
return input; |
|
@ -74,7 +86,7 @@ var BNPChrome = angular |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
}) |
|
|
}) |
|
|
.directive("resizableColumns", function ($parse) { |
|
|
|
|
|
|
|
|
.directive("resizableColumns", function () { |
|
|
return { |
|
|
return { |
|
|
link: function (scope, element, attrs) { |
|
|
link: function (scope, element, attrs) { |
|
|
const options = { minWidth: 5 }; |
|
|
const options = { minWidth: 5 }; |
|
@ -116,7 +128,7 @@ var BNPChrome = angular |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
}) |
|
|
}) |
|
|
.directive("scrollToNew", function ($parse) { |
|
|
|
|
|
|
|
|
.directive("scrollToNew", function () { |
|
|
return function (scope, element, attrs) { |
|
|
return function (scope, element, attrs) { |
|
|
if (scope.scrollToNew && scope.$last) { |
|
|
if (scope.scrollToNew && scope.$last) { |
|
|
const $container = $(element).parents(".data-container").first(); |
|
|
const $container = $(element).parents(".data-container").first(); |
|
@ -137,7 +149,7 @@ var BNPChrome = angular |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
}).directive('ngRightClick', function($parse) { |
|
|
|
|
|
|
|
|
}).directive('ngRightClick', function() { |
|
|
return function(scope, element, attrs) { |
|
|
return function(scope, element, attrs) { |
|
|
element.bind('contextmenu', function(event) { |
|
|
element.bind('contextmenu', function(event) { |
|
|
scope.$apply(function() { |
|
|
scope.$apply(function() { |
|
|