/* ****************************************************** * 7/15/2013 * use this for server * use akc-widget-collection-1.js for serverside * releies on akc-widget-collection.js for research * * /item/4603 * **************************************************** * * Widgets added so far * **************************************************** * TextAdBox1Widget (tab1t-) * SocialAdBox1Widget (sab1t-) * Banner1Widget (sb1t-) * Banner2Widget (sb2t-) * * Expected div structure * ****************************************************
* ****************************************************** */ /* ****************************************************** * TextAdBox1Widget * Uses client side data ****************************************************** */ //Client side test function akcExpand_TextAdBox1WidgetL_function(divObject) { var templateUrl = "text-ad-box1-template.html"; akcExpand_ClientSideData_Generic("TextAdBox1WidgetL",divObject,templateUrl); } //Server side function akcExpand_TextAdBox1Widget_function(divObject) { var templateUrl = "/akc/display?url=DisplayNoteBodyURL&reportId=4600"; akcExpand_ClientSideData_Generic("TextAdBox1Widget",divObject,templateUrl); } //Server side function akcExpand_SocialAdBox1Widget_function(divObject) { var templateUrl = "/akc/display?url=DisplayNoteBodyURL&reportId=4605"; akcExpand_ClientSideData_Generic("SocialAdBox1Widget",divObject,templateUrl); } //Server side function akcExpand_Banner1Widget_function(divObject) { var templateUrl = "/akc/display?url=DisplayNoteBodyURL&reportId=4606"; akcExpand_ClientSideData_Generic("Banner1Widget",divObject,templateUrl); } function akcExpand_Banner2Widget_function(divObject) { var templateUrl = "/akc/display?url=DisplayNoteBodyURL&reportId=4611"; akcExpand_ClientSideData_Generic("Banner2Widget",divObject,templateUrl); } /* ****************************************************** * Specific expand functions will call the following * by passing the template url * make this part of a fixed js page and remove it from here ****************************************************** */ function akcExpand_ClientSideData_Generic(widgetName, divObject, templateUrl) { dalert("I am in clientwidget for: " + widgetName); //Get the inner html of your div var expandDivData = $(divObject).html(); //dataxml = "" + expandDivData + ""; dataxml = expandDivData; dalert(dataxml); dataxmlobj = $.parseXML(dataxml); var dataObj = AKC.getJSONAtNode2(dataxmlobj,"script"); dalert(JSON.stringify(dataObj)); var menuWidget = new AKC.AkcWidgetClientOnly(templateUrl,divObject,dataObj); //populate the menu widget menuWidget.populate(); } function dalert(message) { //alert(message); }