1// this function scans the page for divs containing the class xwidget 2// and triggers the constructor for the widget type 3// the widget type is derived from the id (e.g. imageSlider_001) 4function xaraSwidgets_processPage() 5{ 6 $('.xwidget').each(function() { 7 8 // the id of the div on the page 9 var componentID = $(this).attr('id'); 10 11 // the component 'type' - used to trigger the correct component constructor 12 var componentType = componentID.replace(/_\d+$/gi, ""); 13 14 // the component data - accessed using the id 15 var componentData = window['local_' + componentID + '_data']; 16 17 // do we have any remotely injected data? in which case use that 18 if(window['remote_' + componentID + '_data']) 19 { 20 componentData = window['remote_' + componentID + '_data']; 21 } 22 23 // this actually calls the constructor for the component based on the component type 24 // this has already been included in the page by the componentID_config.js include 25 26 window['xaraSwidgets_' + componentType + 'Constructor'](componentID, componentData); 27 28 }); 29} 30 31// this will compile the source code with the properties provided 32function xaraSwidgets_compileTemplate(templateCode, templateVariables) 33{ 34 var html = '' + templateCode; 35 36 for(var prop in templateVariables) 37 { 38 html = html.replace(RegExp('{' + prop + '}', 'g'), templateVariables[prop]); 39 } 40 41 return html; 42} 43 44function xaraSwidgets_tohtml(str) 45{ 46 return $("<p>").text(str).html().replace(RegExp("\n", "g"), "<br/>"); 47} 48 49// this is the entry point! 50if(window._xw_preview) 51{ 52 $(function(){xaraSwidgets_processPage();}); 53}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.