aboutsummaryrefslogtreecommitdiffstats
path: root/src/Browser.js
diff options
context:
space:
mode:
authorIgor Minar2010-10-15 21:38:41 -0700
committerIgor Minar2010-10-18 16:24:43 -0700
commit7059579c7499337c7946f3877ce77dd9a04ea22a (patch)
tree889a53d787da3ebaa00fc1941d77102e5e5cded3 /src/Browser.js
parentd0e55bf4465bdfe6660f75d26882bc1d9da9b924 (diff)
downloadangular.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/Browser.js')
-rw-r--r--src/Browser.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Browser.js b/src/Browser.js
index aa80ef47..dcdc0a73 100644
--- a/src/Browser.js
+++ b/src/Browser.js
@@ -188,11 +188,26 @@ function Browser(location, document, head, XHR, $log) {
};
- self.addCss = function(url) {
+ /**
+ * Adds a stylesheet tag to the head.
+ */
+ self.addCss = function(/**string*/url) {
var link = jqLite(rawDocument.createElement('link'));
link.attr('rel', 'stylesheet');
link.attr('type', 'text/css');
link.attr('href', url);
head.append(link);
};
+
+
+ /**
+ * Adds a script tag to the head.
+ */
+ self.addJs = function(/**string*/url, /**string*/dom_id) {
+ var script = jqLite(rawDocument.createElement('script'));
+ script.attr('type', 'text/javascript');
+ script.attr('src', url);
+ if (dom_id) script.attr('id', dom_id);
+ head.append(script);
+ };
}