CoreStream provides organisations with the technology and support to help them manage risk and compliance more efficiently and effectively.
Unifying the Javascript and CSS code bases was the first order of business, and we added a Bootstrap based front end to the HTML in the latest framework updates. By taking the existing JS and CSS code and combining it in to a smaller, manageable set of external files, we reduced the amount of code substantially, and improved its maintainability. Following DRY (Don't Repeat Yourself) principles and safe namespacing conventions, we shared methods across functionalities, and reduced the overall size of the front end code base by 25%, while more than doubling the available functionality.
We've applied a lot of modern best practice techniques to give the CoreStream platform an excellent and easily managed UI. The primary rules we have applied with this system is to keep the global namespace unpolluted by creating our own namespace for all of CoreStream's Javascript.
// create the root namespace and making sure we're not overwriting it
var code = code || {};
// setup global variables if needed
code.appname = 'rootapp';
///
/// Create namespace for app specific functions, usually in a separate file
///
code.genericgrid = {
// setup variables for use across this namespace
appname : 'genericgrid',
init : function() {
console.log(this.appname); // logs 'genericgrid'
console.log(code.appname); // logs 'rootapp';
}
}
// initialise our namespace safely
jQuery(document).ready(function(){
code.genericgrid.init();
});