diff options
| author | Igor Minar | 2010-10-15 21:38:41 -0700 | 
|---|---|---|
| committer | Igor Minar | 2010-10-18 16:24:43 -0700 | 
| commit | 7059579c7499337c7946f3877ce77dd9a04ea22a (patch) | |
| tree | 889a53d787da3ebaa00fc1941d77102e5e5cded3 /src/Angular.js | |
| parent | d0e55bf4465bdfe6660f75d26882bc1d9da9b924 (diff) | |
| download | angular.js-7059579c7499337c7946f3877ce77dd9a04ea22a.tar.bz2 | |
inline all images into css
* embedded images as data URIs
* rake task to generate multipart js file with embeded images for IE
* move images into a separate directory outside of src or css and
  keep them there for reference
* clean up Rakefile and ruby code
* .gitignore update
* don't penalize IE 8+ with an extra request to the ie-compat.js file
Diffstat (limited to 'src/Angular.js')
| -rw-r--r-- | src/Angular.js | 19 | 
1 files changed, 13 insertions, 6 deletions
diff --git a/src/Angular.js b/src/Angular.js index 79557c2c..8cacb9e4 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -32,7 +32,8 @@ var _undefined        = undefined,      PRIORITY          = {'FIRST': PRIORITY_FIRST, 'LAST': PRIORITY_LAST, 'WATCH':PRIORITY_WATCH},      jQuery            = window['jQuery'] || window['$'], // weirdness to make IE happy      _                 = window['_'], -    msie              = !!/(msie) ([\w.]+)/.exec(lowercase(navigator.userAgent)), +    /** holds major version number for IE or NaN for real browsers */ +    msie              = parseInt((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1], 10),      jqLite            = jQuery || jqLiteWrap,      slice             = Array.prototype.slice,      push              = Array.prototype.push, @@ -408,25 +409,31 @@ function toKeyValue(obj) {  function angularInit(config){    if (config.autobind) {      // TODO default to the source of angular.js -    var scope = compile(window.document, _null, {'$config':config}); +    var scope = compile(window.document, _null, {'$config':config}), +        $browser = scope.$inject('$browser'); +      if (config.css) -      scope.$inject('$browser').addCss(config.base_url + config.css); +      $browser.addCss(config.base_url + config.css); +    else if(msie<8) +      $browser.addJs(config.base_url + config.ie_compat, config.ie_compat_id); +      scope.$init();    }  }  function angularJsConfig(document, config) { -  var filename = /^(.*)\/angular(-([^\/]*))?.js(\?[^#]*)?(#(.*))?$/, +  var filename = /^(.*)angular(-([^\/]*))?.js(\?[^#]*)?(#(.*))?$/,        scripts = document.getElementsByTagName("script"),        match;    config = extend({      base_url: '', -    css: '../css/angular.css' +    ie_compat: 'angular-ie-compat.js', +    ie_compat_id: 'ng-ie-compat'    }, config);    for(var j = 0; j < scripts.length; j++) {      match = (scripts[j].src || "").match(filename);      if (match) { -      config.base_url = match[1] + '/'; +      config.base_url = match[1];        extend(config, parseKeyValue(match[6]));        eachAttribute(jqLite(scripts[j]), function(value, name){          if (/^ng:/.exec(name)) {  | 
