<% # ========================================================================== # Project: SproutCore - JavaScript Application Framework # Copyright: ©2006-2011 Strobe Inc. and contributors. # Portions ©2008-2010 Apple Inc. All rights reserved. # License: Licensed under MIT license (see license.js) # ========================================================================== # # IMPORTANT: This bootstrap code is DEPRECATED. Instead see the bootstrap # framework in sproutcore for all new apps. # -%> <% content_for('bootstrap') do %> var SC = SC || { BUNDLE_INFO: {}, LAZY_INSTANTIATION: {} }; SC.browser = (function() { // THIS CODE IS DEPRECATED AND IS NO LONGER MAINTAINED var userAgent = navigator.userAgent.toLowerCase(); var version = (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1] ; var browser = { version: version, safari: (/webkit/).test( userAgent ) ? version : 0, opera: (/opera/).test( userAgent ) ? version : 0, msie: (/msie/).test( userAgent ) && !(/opera/).test( userAgent ) ? version : 0, mozilla: (/mozilla/).test( userAgent ) && !(/(compatible|webkit)/).test( userAgent ) ? version : 0, mobileSafari: (/apple.*mobile.*safari/).test(userAgent) ? version : 0, windows: !!(/(windows)/).test(userAgent), mac: !!((/(macintosh)/).test(userAgent) || (/(mac os x)/).test(userAgent)), language: ((navigator.language || navigator.browserLanguage).split('-', 1)[0]) }; browser.current = (browser.msie) ? 'msie' : (browser.mozilla) ? 'mozilla' : (browser.safari) ? 'safari' : (browser.opera) ? 'opera' : 'unknown' ; return browser ; })(); SC.bundleDidLoad = function(bundle) { var info = this.BUNDLE_INFO[bundle] ; if (!info) info = this.BUNDLE_INFO[bundle] = {} ; info.loaded = true ; }; SC.bundleIsLoaded = function(bundle) { var info = this.BUNDLE_INFO[bundle] ; return info ? !!info.loaded : false ; }; SC.loadBundle = function() { throw "SC.loadBundle(): SproutCore is not loaded."; }; SC.setupBodyClassNames = function() { var el = document.body ; var browser, platform, shadows, borderRad, classNames; if (!el) return ; browser = SC.browser.current ; platform = (SC.browser.windows) ? 'windows' : (SC.browser.mac) ? 'mac' : 'other-platform' ; shadows = (document.documentElement.style.MozBoxShadow !== undefined) || (document.documentElement.style.webkitBoxShadow !== undefined) || (document.documentElement.style.oBoxShadow !== undefined) || (document.documentElement.style.boxShadow !== undefined); borderRad = (document.documentElement.style.MozBorderRadius !== undefined) || (document.documentElement.style.webkitBorderRadius !== undefined) || (document.documentElement.style.oBorderRadius !== undefined) || (document.documentElement.style.borderRadius !== undefined); classNames = (el.className) ? el.className.split(' ') : [] ; if(shadows) classNames.push('box-shadow'); if(borderRad) classNames.push('border-rad'); classNames.push(browser) ; classNames.push(platform) ; if (SC.browser.mobileSafari) classNames.push('mobile-safari') ; el.className = classNames.join(' ') ; } ; <% end %> <% content_for('setup_body_class_names') do %> if (SC.setupBodyClassNames) SC.setupBodyClassNames() ; <% end -%>