Built motion from commit (unavailable).|2.4.2
[motion2.git] / server / files / chat / iframe.js
index 383bc5f..0340b05 100644 (file)
@@ -3,17 +3,26 @@
     var iframe = document.createElement('iframe');
     // Attributes
     iframe['id'] = 'motion-chat-iframe';
-    iframe['src'] = '{{{remote}}}/snippet?location=' + btoa(window.location.host) + '&version=1.0.13&{{{query}}}';
+    iframe['src'] = '{{{remote}}}/snippet?location=' + btoa(window.location.host) + '&version=1.0.14&{{{query}}}';
 
     var alignment = "<%=alignment%>";
     var verticalAlignment = "<%=verticalAlignment%>";
+
     var link_mobile = document.createElement('link');
     link_mobile.href = '{{{remote}}}/snippet/styles/mobile.css?version=1.0.13';
     link_mobile.rel = 'stylesheet';
-    document.getElementsByTagName('head')[0].appendChild(link_mobile);
+    link_mobile.type = "text/css";
+
+    var link = document.createElement('link');
+    link.href = '{{{remote}}}/snippet/styles/vendor.css?version=1.0.13';
+    link.rel = 'stylesheet';
+    link.type = "text/css";
+
+    iframe.appendChild(link_mobile);
 
     <% if (alignment == 'bottom_right') { -%> // Bottom, right
     iframe.className = 'motion-chat-iframe-bottom_right';
+    verticalAlignment = 0;
     <% } else if (alignment == 'right') { -%> // Right
     iframe.className = 'motion-chat-iframe-right';
     iframe.style['top'] = verticalAlignment + '%';
@@ -24,6 +33,8 @@
     div_tab.className = 'motion-chat-div-right';
     var tab_status = 0;
 
+    iframe.appendChild(link);
+
     <% } else if (alignment == 'left') { -%> // Left   
     iframe.className = 'motion-chat-iframe-left';
     iframe.style['top'] = verticalAlignment + '%';
     div_tab.className = 'motion-chat-div-left';
     div_tab['id'] = 'motion-chat-iframe-tab';
     var tab_status = 0;
-    <% } -%> document.body.appendChild(iframe);
+
+    iframe.appendChild(link);
+
+    <% } -%>
+    document.body.appendChild(iframe);
     <% if (alignment == 'right') { -%> // Bottom, right
     topChat_set(iframe_h, verticalAlignment);
     document.body.appendChild(div_tab);
             tab_status = 0;
             iframe_h = topIframe_calc();
             topIframe_set(iframe_h);
-            topChat_set(iframe_h, verticalAlignment);
+            if (typeof div_tab != "undefined") topChat_set(iframe_h, verticalAlignment);
         }, false);
     }
 
     window.addEventListener("resize", function(event) {
         var iframe_h = topIframe_calc();
         topIframe_set(iframe_h);
-        topChat_set(iframe_h, verticalAlignment);
+        if (typeof div_tab != "undefined") topChat_set(iframe_h, verticalAlignment);
     });
 
     function topIframe_calc() {