#29759 removed jquery. moved image to below heading
authorJagadedes <jagadees.pillai@zyxware.com>
Wed, 29 Oct 2014 06:08:37 +0000 (11:38 +0530)
committerJagadedes <jagadees.pillai@zyxware.com>
Wed, 29 Oct 2014 06:08:37 +0000 (11:38 +0530)
templates/CRM/Wci/Form/CreateWidget.tpl
templates/CRM/Wci/Page/wciwidget.tpl

index 82765f2d880cd727410693e5e502d1c16026b0db..d43f6de2085f5e77641c139e1b0ddea04fee1bc2 100644 (file)
     <div class="content">
       <div class="resizable-textarea">
         <span>{literal}
-          <textarea name="embd_code" id="embd_code" class="form-textarea textarea-processed">&lt;script src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt;
-&lt;script type="text/javascript" src="{/literal}{php}echo $widget_controller_path;{/php}{literal}?widgetId={/literal}{php}echo $wid_id;{/php}{literal}"&gt;&lt;/script&gt;
-&lt;script&gt;
-  $( document ).ready(function() {
-    $('#widgetwci').html(wciwidgetcode);
-  });
-&lt;/script&gt;
-&lt;div id='widgetwci'&gt;&lt;/div&gt;</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>
index bec44d5d4f2101b7f5759d601dbfc1e9213b7112..6ee3e24d68478bc6cb53415f11a90cdee0f6fe31 100644 (file)
@@ -11,7 +11,6 @@
         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>