UNPKG

jive-sdk

Version:

Node.js SDK for Jive Software to assist with the development of add-ons

56 lines (45 loc) 2.09 kB
/**************************************************** * This file should load AFTER view.js or container.js, or whichever .js file that defines the onReady, onContainer and onViewer * * Note: This implmentation has been provided for convenience, developers are not required to use this pattern. * * SEE: Tile API & Development FAQ - https://community.jivesoftware.com/docs/DOC-185776 ****************************************************/ //************************************************************************ //NOTE: CALLED AS SOON AS THE FULL CONTEXT IS RESOLVED //************************************************************************ function onReady(tileConfig,tileOptions,viewer,container) { if ( typeof tileConfig === "string" ) { tileConfig = JSON.parse(config); } // end if var json = tileConfig || { "pushData": "Not initialized" }; // populate the input dialog with config data $("#config_val").val( json["pushData"]); $("#btn_submit").click( function() { // update config data from input dialog json["pushData"] = $("#config_val").val(); // send config to service jive.tile.close(json, {} ); }); app.resize(); } // end function //************************************************************************ //NOTE: CALLED AS SOON AS THE CONFIG IS RESOLVED //************************************************************************ function onConfig(tileConfig,tileOptions) { console.log('onConfig',tileConfig,tileOptions); } // end function //************************************************************************ //NOTE: CALLED AS SOON AS THE CONTAINER IS RESOLVED //************************************************************************ function onContainer(container) { console.log('onContainer',container); } // end function //************************************************************************ //NOTE: CALLED AS SOON AS THE VIEWER IS RESOLVED //************************************************************************ function onViewer(viewer) { console.log('onViewer',viewer); } // end function