Sha256: eafed7159338a0d9692971168ef5ffc8d6790d6dd3cbd53f0459dd28ae27fec4
Contents?: true
Size: 876 Bytes
Versions: 12
Compression:
Stored size: 876 Bytes
Contents
(function (tree) { tree.URL = function (val, paths) { if (val.data) { this.attrs = val; } else { // Add the base path if the URL is relative and we are in the browser if (typeof(window) !== 'undefined' && !/^(?:https?:\/\/|file:\/\/|data:|\/)/.test(val.value) && paths.length > 0) { val.value = paths[0] + (val.value.charAt(0) === '/' ? val.value.slice(1) : val.value); } this.value = val; this.paths = paths; } }; tree.URL.prototype = { toCSS: function () { return "url(" + (this.attrs ? 'data:' + this.attrs.mime + this.attrs.charset + this.attrs.base64 + this.attrs.data : this.value.toCSS()) + ")"; }, eval: function (ctx) { return this.attrs ? this : new(tree.URL)(this.value.eval(ctx), this.paths); } }; })(require('../tree'));
Version data entries
12 entries across 12 versions & 1 rubygems