scrat-swig
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -30,4 +30,4 @@ 'use strict' | ||
function Resource(path){ | ||
this.collect = {} | ||
this.script = [] | ||
this._collect = {} | ||
this._script = [] | ||
this._loaded = {} | ||
@@ -84,3 +84,3 @@ this._pagelets = {} | ||
Resource.prototype.addScript = function(code){ | ||
this.js.push(code) | ||
this._script.push(code) | ||
} | ||
@@ -131,6 +131,6 @@ | ||
} | ||
if(!this.collect[res.type]){ | ||
this.collect[res.type] = [] | ||
if(!this._collect[res.type]){ | ||
this._collect[res.type] = [] | ||
} | ||
this.collect[res.type].push(this.uri(res.uri)) | ||
this._collect[res.type].push(this.uri(res.uri)) | ||
return res | ||
@@ -186,13 +186,13 @@ } | ||
var html = '' | ||
if(this.collect.js && this.collect.js.length){ | ||
if(this._collect.js && this._collect.js.length){ | ||
var left = '<script src="' + this.comboPattern | ||
var right = '"></script>\n' | ||
var split = this.combo ? ',' : false | ||
html += join(this.collect.js, left, right, split) | ||
html += join(this._collect.js, left, right, split) | ||
} | ||
if(this.script.length){ | ||
if(this._script.length){ | ||
if(this.combo){ | ||
html += '<script>' + join(this.script, '!function(){', '}();') + '</script>\n' | ||
html += '<script>' + join(this._script, '!function(){', '}();') + '</script>\n' | ||
} else { | ||
html += join(this.script, '<script>' + '!function(){', '}();</script>\n') | ||
html += join(this._script, '<script>' + '!function(){', '}();</script>\n') | ||
} | ||
@@ -213,3 +213,3 @@ } | ||
var split = this.combo ? ',' : false | ||
html += join(this.collect.css, left, right, split) | ||
html += join(this._collect.css, left, right, split) | ||
} | ||
@@ -228,5 +228,5 @@ return html | ||
html : this._pagelets, | ||
js : this.collect.js, | ||
css : this.collect.css, | ||
script: this.script | ||
js : this._collect.js, | ||
css : this._collect.css, | ||
script: this._script | ||
}) | ||
@@ -233,0 +233,0 @@ } else { |
{ | ||
"name": "scrat-swig", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Extensions of swig for scrat", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
13182