To start, there are some custom standard functions applied to some HTML elements.
Every website loads in a bwcore.js file. It includes a number of commonly used functions and provides a stable basis for all websites. We have included FastClick to speed up response times for touches as clicks on mobile devices and isMobile.
This object contains many useful variables about the web page, elements, window and mouse.
This object contains many useful variables about the web page, elements, window and mouse.
Strip HTML tags, but allow some
Example
var strippedString = bwcFunctions.stripTags(input,allowed);
A deep overwriting of arrays to replicate PHP's array_replace_recursive function in Javascript (http://brett-zamir.me)
Example
var newArray = bwcFunctions.array_replace_recursive(inputArray,anotherArray);
Get a cookie's value by it's name
Example
var cookieValue = bwcFunctions.getCookieByName("cookieName");
Gets Performance.now() if - returns floating point milliseconds since that particular page started to load. If unavailable it falls back to a predefined Date().getTime() variable saved at the script's load point subtracting the current Date().getTime() variable.
Example
var nowMS = bwcFunctions.getNow();
Trims text to it's container and appends a tail. It is automatically run on any elements with the class ellipsis
Example Auto HTML
<div>
<span class="ellipsis">
A string which may be too wide for the container
</span>
</div>
Example Javascript
ellipsis(redoEllipsis,className,restoreCharacters);
The fastest way to replace HTML inside an element.
Example
replaceHtml(domElement,newHTML);
This object handles displaying banner notification and errors at the top of your web page when configured in your layout class.
This object was used to keep fixed elements within a client's window when scrolling. This has been deprecated due to lacking mobile support responsiveness.