Kathleen Garner, strategic customer success manager at Appriss Retail, highlights how AI helps retailers foster collaboration with law enforcement in the fight against ORC.
if (window.BEJSSDKObserver === undefined) {
(function(BEJSSDKObserver, $, undefined) {
var observer = void 0;
var listeners = [];
var readySet = [];
var doc = window.document;
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
function checkSelector(selector, fn, indexList) {
var elements = doc.querySelectorAll(selector);
for (var i = 0, len = elements.length; i < len; i++) {
/* -1 means all instances */
if (indexList != -1 && !(i in indexList)) {
continue;
}
var element = elements[i];
for (var j = 0; j < readySet.length; j++) {
if (readySet[j] == element.className || readySet[j] == element.id) {
return;
}
}
if (element.className) {
readySet.push(element.className);
}
if (element.id) {
readySet.push(element.id);
}
if (!element.ready || MutationObserver==null) {
element.ready = true;
fn.call(element, element);
}
}
}
function checkListeners() {
listeners.forEach(function (listener) {
return checkSelector(listener.selector, listener.fn, listener.indexList);
});
}
function removeListener(selector, fn) {
var i = listeners.length;
while (i--) {
var listener = listeners[i];
if (listener.selector === selector && listener.fn === fn) {
listeners.splice(i, 1);
if (!listeners.length && observer) {
observer.disconnect();
observer = null;
}
}
}
}
/**
* Fire event on first js selector
* @param selector string to watch on
* @param fn callback function
* @param index_list can be undefined which means only first one
* or -1 which means all
* or a list of allowable indexes
*/
BEJSSDKObserver.jsElementReady = function(selector, fn, index_list) {
if (index_list === undefined) {
index_list = [];
index_list.push(0);
}
if (MutationObserver != null) {
if (!observer) {
observer = new MutationObserver(checkListeners);
observer.observe(doc.documentElement, {
childList: true,
subtree: true
});
}
listeners.push({ selector: selector, fn: fn, indexList: index_list });
} else {
/* <= IE8 */
if (!document.addEventListener) {
/* log("<=IE8 attachEvent assignment"); */
document.addEventListener = document.attachEvent;
}
document.addEventListener("DOMContentLoaded", function(event) {
var elements = doc.querySelectorAll(selector);
for (var i = 0, len = elements.length; i < len; i++) {
/* -1 means all instances */
if (index_list != -1 && !(i in index_list)) {
continue;
}
var element = elements[i];
element.ready = true;
fn.call(element, element);
}
});
}
checkSelector(selector, fn, index_list);
return function () {
return removeListener(selector, fn);
};
};
}(window.BEJSSDKObserver = window.BEJSSDKObserver || {}));
}
var jsElementReady = window.BEJSSDKObserver.jsElementReady;
if (window.BELinkBlockGenerator === undefined) {
(function(BELinkBlockGenerator, $, undefined) {
BELinkBlockGenerator.MAXIMUM_HEADLINE_LENGTH = 100;
BELinkBlockGenerator.MAXIMUM_DESC_LENGTH = 200;
BELinkBlockGenerator.IND_LINK_BLOCK_TYPE_URL_TYPE = 0;
BELinkBlockGenerator.IND_LINK_BLOCK_TYPE_HEADLINE_TYPE = 1;
BELinkBlockGenerator.IND_LINK_BLOCK_TYPE_DESCRIPTION_TYPE = 2;
BELinkBlockGenerator.IND_LINK_BLOCK_TYPE_IMAGE_TYPE = 3;
BELinkBlockGenerator.REPLACEMENT_STRATEGY_OVERWRITE = 0;
BELinkBlockGenerator.REPLACEMENT_STRATEGY_POST_APPEND_ELEMENT = 1;
BELinkBlockGenerator.REPLACEMENT_STRATEGY_PRE_APPEND_ELEMENT = 2;
BELinkBlockGenerator.REPLACEMENT_STRATEGY_PRE_APPEND_PARENT = 3;
BELinkBlockGenerator.setMaximumHeadlineLength = function(length) {
BELinkBlockGenerator.MAXIMUM_HEADLINE_LENGTH = length;
};
BELinkBlockGenerator.setMaximumDescriptionLength = function(length) {
BELinkBlockGenerator.MAXIMUM_DESC_LENGTH = length;
};
BELinkBlockGenerator.generateIndividualLinks = function(parentElement, linkStructure, link) {
var link_level_element_tag = linkStructure[0];
var link_level_element = document.createElement(link_level_element_tag);
var link_attribute_dictionary = linkStructure[1];
var allowable_elements = linkStructure[2];
var children_link_structures = linkStructure[3];
for (var link_attribute_key in link_attribute_dictionary) {
link_level_element.setAttribute(link_attribute_key, link_attribute_dictionary[link_attribute_key]);
}
var added_something = false;
if (allowable_elements.indexOf(BELinkBlockGenerator.IND_LINK_BLOCK_TYPE_URL_TYPE)>=0) {
link_level_element.setAttribute('href', link.url);
added_something = true;
}
if (allowable_elements.indexOf(BELinkBlockGenerator.IND_LINK_BLOCK_TYPE_HEADLINE_TYPE)>=0 && link.h1) {
var headline_text = link.h1;
if (headline_text.length > BELinkBlockGenerator.MAXIMUM_HEADLINE_LENGTH) {
headline_text = headline_text.substring(0, BELinkBlockGenerator.MAXIMUM_HEADLINE_LENGTH) + '...';
}
var text_node = document.createTextNode(headline_text);
link_level_element.appendChild(text_node);
added_something = true;
}
if (allowable_elements.indexOf(BELinkBlockGenerator.IND_LINK_BLOCK_TYPE_DESCRIPTION_TYPE)>=0 && link.desc) {
var desc_text = link.desc;
if (desc_text.length > BELinkBlockGenerator.MAXIMUM_DESC_LENGTH) {
desc_text = desc_text.substring(0, BELinkBlockGenerator.MAXIMUM_DESC_LENGTH) + '...';
}
var text_node = document.createTextNode(desc_text);
link_level_element.appendChild(text_node);
added_something = true;
}
if (allowable_elements.indexOf(BELinkBlockGenerator.IND_LINK_BLOCK_TYPE_IMAGE_TYPE)>=0 && link.image) {
link_level_element.setAttribute('src', link.image);
added_something = true;
}
/**
don't emit for empty links, desc, headline, image
except for parent structures where allowable_length=0
*/
if (!added_something && allowable_elements.length != 0) {
return;
}
/* go depth first */
for (var childrenIndex=0; childrenIndex Kathleen Garner, strategic customer success manager at Appriss Retail, highlights how AI helps retailers foster collaboration with law enforcement in the fight against ORC.Federal Policies, AI and Supporting Law Enforcement: Retailers Fight Back Against ORC