//**************************************************************** // akc-widget-2-test.js // 4/17/2014 // A test file // // Modeled after akc-widget1.js // See also akc-widget.js instead. // // This will be kept in a URL // Use this URL to include it to test your stuff // // Use script, src=the following url, close script // URL: /akc/display?url=DisplayNoteBodyURL&reportId=4796&ownerUserId=satya //**************************************************************** var AKC; if (!AKC) { AKC = {}; } (function () { //Interface //A class to facilitate akc widgets //Note this is not a function but a class AKC.AkcTestWidget1 = AkcTestWidget1; //Implementations function AkcTestWidget1(divElement, inDivData, inAsIsDivXML) { //this.that = this; //alert(inDivId); //alert(this.targetDivId); //private function function populateTargetDiv(innerHtmlString) { console.log("populating target div"); $(divElement).html(innerHtmlString); } populateTargetDiv("Begining my run"); this.populate = function() { alert("hi, I am here"); var escapedHTML = escapeHTML(inAsIsDivXML); populateTargetDiv("
" + escapedHTML + ""); $(divElement).show(); alert("finish"); } }//end-of-AkcWidget AKC.escapeHTML=escapeHTML; function escapeHTML(text) { var chr = { '"': '"', '&': '&', '<': '<', '>': '>' }; function abc(a) { return chr[a]; } return text.replace(/[\"&<>]/g, abc); } })(); //eof-file /* ****************************************************** * Expected div structure * * *