blob: 029b9b590eebaa4c4d534378de5801da8d30941d [file] [log] [blame]
/*jslint vars: true , plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */
/*global $, Folder, ExternalObject, CSXSEvent*/
var bm_eventDispatcher = (function () {
'use strict';
var xLib;
try {
xLib = new ExternalObject('lib:\PlugPlugExternalObject');
} catch (e) { alert("Missing ExternalObject: "); }
function sendEvent(type, data) {
if (xLib) {
if (data && data instanceof Object) {
data = JSON.stringify(data);
}
var eventObj = new CSXSEvent();
eventObj.type = type;
eventObj.data = data || '';
eventObj.dispatch();
}
}
var ob = {
sendEvent : sendEvent
};
return ob;
}());