<div class="content">
<div class="resizable-textarea">
<span>{literal}
- <textarea name="embd_code" id="embd_code" class="form-textarea textarea-processed"><script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
-<script type="text/javascript" src="{/literal}{php}echo $widget_controller_path;{/php}{literal}?widgetId={/literal}{php}echo $wid_id;{/php}{literal}"></script>
-<script>
- $( document ).ready(function() {
- $('#widgetwci').html(wciwidgetcode);
- });
-</script>
-<div id='widgetwci'></div></textarea>{/literal}
+ <textarea name="embd_code" id="embd_code" class="form-textarea textarea-processed"><script type="text/javascript">
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+ DOMContentLoaded = function() {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ onReady();
+ };
+} else if ( document.attachEvent ) {
+ DOMContentLoaded = function() {
+ // Make sure body exists, at least, in case IE gets a little overzealous
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ onReady();
+ }
+ };
+}
+if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ setTimeout( onReady, 1 );
+}
+
+// Mozilla, Opera and webkit support this event
+if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", onReady, false );
+ // If IE event model is used
+} else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent("onreadystatechange", DOMContentLoaded);
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", onReady );
+}
+
+function onReady( ) {
+ document.getElementById('widgetwci').innerHTML = wciwidgetcode;
+}
+</script>
+<div id='widgetwci'></div></textarea>{/literal}
<div class="grippie" style="margin-right: 18px;"></div>
</span>
</div>
border:1px solid #96C0E7;
background-color: {/literal}{$wciform.color_widget_bg}{literal}; /* background color */
border-color:{/literal}{$wciform.color_border}{literal}; /* border color */
- background: {/literal}{if $wciform.image}url('{$wciform.image}'){/if}{literal}; /* background image */
}
.crm-wci-widget.thin {
{/if}
{$wciform.title}
</h5>
+ {if $wciform.image}
+ <div style="text-align: center;">
+ <img src='{$wciform.image}' style="margin: 0 auto;"/>
+ </div>
+ {/if}
<div class="crm-amounts">
<div id="crm_wid_{$wciform.widgetId}_amt_hi" class="crm-amount-high"></div>
<div id="crm_wid_{$wciform.widgetId}_amt_low" class="crm-amount-low"></div>