Sha256: 4d2de5d46cd9ce4564e83cb450031277fb28ddd6c08b8b3b0766ab0b8991412d

Contents?: true

Size: 1.85 KB

Versions: 24

Compression:

Stored size: 1.85 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            Portions ©2008-2011 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

// sc_require("system/browser");

SC.setupBodyClassNames = function() {
  var el = document.body ;
  if (!el) return ;
  var browser, platform, shadows, borderRad, classNames, style;
  browser = SC.browser.current ;
  platform = SC.browser.windows ? 'windows' : SC.browser.mac ? 'mac' : 'other-platform' ;
  style = document.documentElement.style;
  shadows = (style.MozBoxShadow !== undefined) || 
                (style.webkitBoxShadow !== undefined) ||
                (style.oBoxShadow !== undefined) ||
                (style.boxShadow !== undefined);
  
  borderRad = (style.MozBorderRadius !== undefined) || 
              (style.webkitBorderRadius !== undefined) ||
              (style.oBorderRadius !== undefined) ||
              (style.borderRadius !== undefined);
  
  classNames = el.className ? el.className.split(' ') : [] ;
  if(shadows) classNames.push('box-shadow');
  if(borderRad) classNames.push('border-rad');
  classNames.push(browser) ;
  if (browser === 'chrome') classNames.push('safari');
  classNames.push(platform) ;
  
  var ieVersion = parseInt(SC.browser.msie,10);
  if (ieVersion) {
    if (ieVersion === 7) {
      classNames.push('ie7');
    } 
    else if (ieVersion === 8) {
      classNames.push('ie8');
    }
    else if (ieVersion === 9) {
      classNames.push('ie9');
    }
  }
  
  if (SC.browser.mobileSafari) classNames.push('mobile-safari') ;
  if ('createTouch' in document) classNames.push('touch');
  el.className = classNames.join(' ') ;
} ;

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
sproutcore-1.5.0-java lib/frameworks/sproutcore/frameworks/bootstrap/system/loader.js
sproutcore-1.5.0 lib/frameworks/sproutcore/frameworks/bootstrap/system/loader.js
sproutcore-1.5.0.rc.2 lib/frameworks/sproutcore/frameworks/bootstrap/system/loader.js
sproutcore-1.5.0.rc.1 lib/frameworks/sproutcore/frameworks/bootstrap/system/loader.js