assetgraph
Advanced tools
@@ -154,3 +154,2 @@ /** | ||
}, this); | ||
var incomingRelations = this.findRelations({to: asset}); | ||
this.findRelations({from: asset}, true).forEach(function (outgoingRelation) { | ||
@@ -163,11 +162,9 @@ this.removeRelation(outgoingRelation); | ||
}, this); | ||
if (incomingRelations.length) { | ||
incomingRelations.forEach(function (incomingRelation) { | ||
if (detachIncomingRelations) { | ||
this.detachAndRemoveRelation(incomingRelation); | ||
} else { | ||
this.removeRelation(incomingRelation); | ||
} | ||
}, this); | ||
} | ||
this.findRelations({to: asset}).forEach(function (incomingRelation) { | ||
if (detachIncomingRelations) { | ||
this.detachAndRemoveRelation(incomingRelation); | ||
} else { | ||
this.removeRelation(incomingRelation); | ||
} | ||
}, this); | ||
var affectedRelations = [].concat(this._objInBaseAssetPaths[asset.id]); | ||
@@ -452,3 +449,4 @@ affectedRelations.forEach(function (affectedRelation) { | ||
} | ||
if (!relation.to.isInline) { | ||
// if (relation.to.isInline) won't work because relation.to might be unresolved and thus not an assets.Asset instance: | ||
if (relation.to.url) { | ||
var relativeUrl = urlTools.buildRelativeUrl(this.getBaseAssetForRelation(relation).url, relation.to.url); | ||
@@ -455,0 +453,0 @@ if (relation.href !== relativeUrl) { |
@@ -109,3 +109,5 @@ var util = require('util'), | ||
from: this, | ||
to: node.tokens[node.tokens.length - 1], | ||
to: { | ||
url: node.tokens[node.tokens.length - 1] | ||
}, | ||
node: node, | ||
@@ -112,0 +114,0 @@ sectionName: sectionName |
@@ -95,3 +95,5 @@ var util = require('util'), | ||
from: this, | ||
to: cssRule.href, | ||
to: { | ||
url: cssRule.href | ||
}, | ||
parentRule: parentRuleOrStylesheet, | ||
@@ -109,3 +111,5 @@ cssRule: cssRule | ||
from: this, | ||
to: urlMatch[2], | ||
to: { | ||
url: urlMatch[2] | ||
}, | ||
parentRule: parentRuleOrStylesheet, | ||
@@ -126,3 +130,5 @@ cssRule: cssRule, | ||
from: this, | ||
to: urlMatch[2], | ||
to: { | ||
url: urlMatch[2] | ||
}, | ||
parentRule: parentRuleOrStylesheet, | ||
@@ -142,3 +148,5 @@ cssRule: cssRule, | ||
from: this, | ||
to: alphaImageLoaderMatch[2], | ||
to: { | ||
url: alphaImageLoaderMatch[2] | ||
}, | ||
parentRule: parentRuleOrStylesheet, | ||
@@ -145,0 +153,0 @@ cssRule: cssRule, |
@@ -107,3 +107,5 @@ var util = require('util'), | ||
from: this, | ||
to: this.parseTree.documentElement.getAttribute('manifest'), | ||
to: { | ||
url: this.parseTree.documentElement.getAttribute('manifest') | ||
}, | ||
node: this.parseTree.documentElement | ||
@@ -126,3 +128,5 @@ })); | ||
from: this, | ||
to: node.getAttribute('src'), | ||
to: { | ||
url: node.getAttribute('src') | ||
}, | ||
node: node | ||
@@ -157,3 +161,5 @@ })); | ||
from: this, | ||
to: node.getAttribute('href'), | ||
to: { | ||
url: node.getAttribute('href') | ||
}, | ||
node: node | ||
@@ -164,3 +170,5 @@ })); | ||
from: this, | ||
to: node.getAttribute('href'), | ||
to: { | ||
url: node.getAttribute('href') | ||
}, | ||
node: node | ||
@@ -182,3 +190,5 @@ })); | ||
from: this, | ||
to: node.getAttribute('src'), | ||
to: { | ||
url: node.getAttribute('src') | ||
}, | ||
node: node | ||
@@ -191,3 +201,5 @@ })); | ||
from: this, | ||
to: href, | ||
to: { | ||
url: href | ||
}, | ||
node: node | ||
@@ -199,3 +211,5 @@ })); | ||
from: this, | ||
to: node.getAttribute('src'), | ||
to: { | ||
url: node.getAttribute('src') | ||
}, | ||
node: node | ||
@@ -206,3 +220,5 @@ })); | ||
from: this, | ||
to: node.getAttribute('src'), | ||
to: { | ||
url: node.getAttribute('src') | ||
}, | ||
node: node | ||
@@ -213,3 +229,5 @@ })); | ||
from: this, | ||
to: node.getAttribute('src'), | ||
to: { | ||
url: node.getAttribute('src') | ||
}, | ||
node: node | ||
@@ -221,3 +239,5 @@ })); | ||
from: this, | ||
to: node.getAttribute('src'), | ||
to: { | ||
url: node.getAttribute('src') | ||
}, | ||
node: node | ||
@@ -229,3 +249,5 @@ })); | ||
from: this, | ||
to: node.getAttribute('poster'), | ||
to: { | ||
url: node.getAttribute('poster') | ||
}, | ||
node: node | ||
@@ -237,3 +259,5 @@ })); | ||
from: this, | ||
to: node.getAttribute('src'), | ||
to: { | ||
url: node.getAttribute('src') | ||
}, | ||
node: node | ||
@@ -244,3 +268,5 @@ })); | ||
from: this, | ||
to: node.getAttribute('src'), | ||
to: { | ||
url: node.getAttribute('src') | ||
}, | ||
node: node | ||
@@ -251,3 +277,5 @@ })); | ||
from: this, | ||
to: node.getAttribute('data'), | ||
to: { | ||
url: node.getAttribute('data') | ||
}, | ||
node: node, | ||
@@ -259,3 +287,5 @@ attributeName: 'data' | ||
from: this, | ||
to: node.getAttribute('value'), | ||
to: { | ||
url: node.getAttribute('value') | ||
}, | ||
node: node, | ||
@@ -270,3 +300,5 @@ attributeName: 'value' | ||
from: this, | ||
to: node.getAttribute(attributeName), | ||
to: { | ||
url: node.getAttribute(attributeName) | ||
}, | ||
node: node, | ||
@@ -280,3 +312,5 @@ attributeName: attributeName | ||
from: this, | ||
to: node.getAttribute('src'), | ||
to: { | ||
url: node.getAttribute('src') | ||
}, | ||
node: node | ||
@@ -283,0 +317,0 @@ })); |
@@ -96,3 +96,5 @@ var util = require('util'), | ||
from: this, | ||
to: node[2][0][1], | ||
to: { | ||
url: node[2][0][1] | ||
}, | ||
node: node, | ||
@@ -109,3 +111,5 @@ detachableNode: detachableNode, | ||
from: this, | ||
to: node[2][0][1], | ||
to: { | ||
url: node[2][0][1] | ||
}, | ||
node: node, | ||
@@ -154,3 +158,6 @@ parentNode: stack[stack.length - 1] | ||
from: this, | ||
to: stringNode[1].replace('.', ':').replace(/\./g, '/') + '.js', // Replace first . with : and the rest with / | ||
to: { | ||
// Replace first . with : and the rest with / | ||
url: stringNode[1].replace('.', ':').replace(/\./g, '/') + '.js' | ||
}, | ||
node: stringNode | ||
@@ -197,3 +204,6 @@ })); | ||
from: this, | ||
to: stringNode[1].replace('.', ':').replace(/\./g, '/') + '.js', // Replace first . with : and the rest with / | ||
to: { | ||
// Replace first . with : and the rest with / | ||
url: stringNode[1].replace('.', ':').replace(/\./g, '/') + '.js' | ||
}, | ||
extRequireStatParentNode: stack[stack.length - 1], | ||
@@ -200,0 +210,0 @@ extRequireStatNode: node, |
@@ -5,3 +5,3 @@ { | ||
"repository": "git://github.com/One-com/assetgraph.git", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"maintainers": [ | ||
@@ -8,0 +8,0 @@ { |
530533
0.39%12274
0.43%