Bug 1077611 - Remove platform detection from loop panel & conversation window. r=dmose a=loop-only
authorJared Wein <jwein@mozilla.com>
Thu, 23 Oct 2014 14:11:12 -0400
changeset 235091 ba47f2f2dcf7c627d769c0aa94f3843f86892c63
parent 235090 659774666e93b8c41eda7750392cdcc2830532fb
child 235092 4f042a59a39ea6a34b8623381f31274f0a273f98
push id611
push userraliiev@mozilla.com
push dateMon, 05 Jan 2015 23:23:16 +0000
treeherdermozilla-release@345cd3b9c445 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmose, loop-only
bugs1077611
milestone35.0a2
Bug 1077611 - Remove platform detection from loop panel & conversation window. r=dmose a=loop-only
browser/components/loop/content/js/conversation.js
browser/components/loop/content/js/conversation.jsx
browser/components/loop/content/js/panel.js
browser/components/loop/content/js/panel.jsx
browser/components/loop/content/shared/css/common.css
browser/components/loop/content/shared/js/utils.js
browser/components/loop/ui/ui-showcase.js
browser/components/loop/ui/ui-showcase.jsx
--- a/browser/components/loop/content/js/conversation.js
+++ b/browser/components/loop/content/js/conversation.js
@@ -652,18 +652,16 @@ loop.conversation = (function(mozL10n) {
 
     conversation.set({callId: callId});
 
     window.addEventListener("unload", function(event) {
       // Handle direct close of dialog box via [x] control.
       navigator.mozLoop.releaseCallData(callId);
     });
 
-    document.body.classList.add(loop.shared.utils.getTargetPlatform());
-
     React.renderComponent(AppControllerView({
       localRoomStore: localRoomStore, 
       store: conversationStore, 
       client: client, 
       conversation: conversation, 
       dispatcher: dispatcher, 
       sdk: window.OT}
     ), document.querySelector('#main'));
--- a/browser/components/loop/content/js/conversation.jsx
+++ b/browser/components/loop/content/js/conversation.jsx
@@ -652,18 +652,16 @@ loop.conversation = (function(mozL10n) {
 
     conversation.set({callId: callId});
 
     window.addEventListener("unload", function(event) {
       // Handle direct close of dialog box via [x] control.
       navigator.mozLoop.releaseCallData(callId);
     });
 
-    document.body.classList.add(loop.shared.utils.getTargetPlatform());
-
     React.renderComponent(<AppControllerView
       localRoomStore={localRoomStore}
       store={conversationStore}
       client={client}
       conversation={conversation}
       dispatcher={dispatcher}
       sdk={window.OT}
     />, document.querySelector('#main'));
--- a/browser/components/loop/content/js/panel.js
+++ b/browser/components/loop/content/js/panel.js
@@ -746,17 +746,16 @@ loop.panel = (function(_, mozL10n) {
 
     React.renderComponent(PanelView({
       client: client, 
       notifications: notifications, 
       roomListStore: roomListStore, 
       dispatcher: dispatcher}
     ), document.querySelector("#main"));
 
-    document.body.classList.add(loop.shared.utils.getTargetPlatform());
     document.body.setAttribute("dir", mozL10n.getDirection());
 
     // Notify the window that we've finished initalization and initial layout
     var evtObject = document.createEvent('Event');
     evtObject.initEvent('loopPanelInitialized', true, false);
     window.dispatchEvent(evtObject);
   }
 
--- a/browser/components/loop/content/js/panel.jsx
+++ b/browser/components/loop/content/js/panel.jsx
@@ -746,17 +746,16 @@ loop.panel = (function(_, mozL10n) {
 
     React.renderComponent(<PanelView
       client={client}
       notifications={notifications}
       roomListStore={roomListStore}
       dispatcher={dispatcher}
     />, document.querySelector("#main"));
 
-    document.body.classList.add(loop.shared.utils.getTargetPlatform());
     document.body.setAttribute("dir", mozL10n.getDirection());
 
     // Notify the window that we've finished initalization and initial layout
     var evtObject = document.createEvent('Event');
     evtObject.initEvent('loopPanelInitialized', true, false);
     window.dispatchEvent(evtObject);
   }
 
--- a/browser/components/loop/content/shared/css/common.css
+++ b/browser/components/loop/content/shared/css/common.css
@@ -353,22 +353,16 @@ p {
 .inverse {
   color: #fff;
 }
 
 .light {
   color: rgba(51, 51, 51, .5);
 }
 
-.mac p,
-.windows p,
-.linux p {
-  line-height: 16px;
-}
-
 /* Web panel */
 
 .info-panel {
   border-radius: 4px;
   background: #fff;
   padding: 20px 0;
   border: 1px solid #e7e7e7;
   box-shadow: 0 2px 0 rgba(0, 0, 0, .03);
--- a/browser/components/loop/content/shared/js/utils.js
+++ b/browser/components/loop/content/shared/js/utils.js
@@ -25,36 +25,16 @@ loop.shared.utils = (function(mozL10n) {
    */
   function formatDate(timestamp) {
     var date = (new Date(timestamp * 1000));
     var options = {year: "numeric", month: "long", day: "numeric"};
     return date.toLocaleDateString(navigator.language, options);
   }
 
   /**
-   * Used for adding different styles to the panel
-   * @returns {String} Corresponds to the client platform
-   * */
-  function getTargetPlatform() {
-    var platform="unknown_platform";
-
-    if (navigator.platform.indexOf("Win") !== -1) {
-      platform = "windows";
-    }
-    if (navigator.platform.indexOf("Mac") !== -1) {
-      platform = "mac";
-    }
-    if (navigator.platform.indexOf("Linux") !== -1) {
-      platform = "linux";
-    }
-
-    return platform;
-  }
-
-  /**
    * Used for getting a boolean preference. It will either use the browser preferences
    * (if navigator.mozLoop is defined) or try to get them from localStorage.
    *
    * @param {String} prefName The name of the preference. Note that mozLoop adds
    *                          'loop.' to the start of the string.
    *
    * @return The value of the preference, or false if not available.
    */
@@ -128,12 +108,11 @@ loop.shared.utils = (function(mozL10n) {
     );
   }
 
   return {
     CALL_TYPES: CALL_TYPES,
     Helper: Helper,
     composeCallUrlEmail: composeCallUrlEmail,
     formatDate: formatDate,
-    getTargetPlatform: getTargetPlatform,
     getBoolPreference: getBoolPreference
   };
 })(document.mozL10n || navigator.mozL10n);
--- a/browser/components/loop/ui/ui-showcase.js
+++ b/browser/components/loop/ui/ui-showcase.js
@@ -532,20 +532,17 @@
           iframeHead.appendChild(style.cloneNode(true));
         });
 
       };
     }
   }
 
   window.addEventListener("DOMContentLoaded", function() {
-    var body = document.body;
-    body.className = loop.shared.utils.getTargetPlatform();
-
-    React.renderComponent(App(null), body);
+    React.renderComponent(App(null), document.body);
 
     _renderComponentsInIframes();
 
     // Put the title back, in case views changed it.
     document.title = "Loop UI Components Showcase";
   });
 
 })();
--- a/browser/components/loop/ui/ui-showcase.jsx
+++ b/browser/components/loop/ui/ui-showcase.jsx
@@ -532,20 +532,17 @@
           iframeHead.appendChild(style.cloneNode(true));
         });
 
       };
     }
   }
 
   window.addEventListener("DOMContentLoaded", function() {
-    var body = document.body;
-    body.className = loop.shared.utils.getTargetPlatform();
-
-    React.renderComponent(<App />, body);
+    React.renderComponent(<App />, document.body);
 
     _renderComponentsInIframes();
 
     // Put the title back, in case views changed it.
     document.title = "Loop UI Components Showcase";
   });
 
 })();