@@ -279,12 +279,6 @@ a.linkButton {
|
||||
width: 8.25em;
|
||||
height: 11em;
|
||||
}
|
||||
.star {
|
||||
font-weight: bold;
|
||||
}
|
||||
.star span {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
.footer {
|
||||
padding: 3em;
|
||||
color: #413;
|
||||
@@ -295,6 +289,9 @@ a.linkButton {
|
||||
.footer .version {
|
||||
font-size: 0.7em;
|
||||
}
|
||||
.footer .github {
|
||||
margin: 1em 0 0 0.5em;
|
||||
}
|
||||
[class^="icon-"]:before,
|
||||
[class*=" icon-"]:before {
|
||||
vertical-align: baseline;
|
||||
|
||||
@@ -37,6 +37,11 @@ yltApp.run(['$rootScope', '$location', function($rootScope, $location) {
|
||||
$rootScope.$on('$routeChangeSuccess', function(){
|
||||
ga('send', 'pageview', {'page': $location.path()});
|
||||
});
|
||||
|
||||
// GitHub star button (asynchronously loaded iframe)
|
||||
window.addEventListener('load', function() {
|
||||
window.document.getElementById('ghbtn').src = 'http://ghbtns.com/github-btn.html?user=gmetais&repo=YellowLabTools&type=star&count=true&size=large';
|
||||
});
|
||||
}]);
|
||||
|
||||
yltApp.config(['$routeProvider', '$locationProvider',
|
||||
|
||||
@@ -234,14 +234,6 @@ a.linkButton {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.star {
|
||||
font-weight: bold;
|
||||
span {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
padding: 3em;
|
||||
color: #413;
|
||||
@@ -251,6 +243,9 @@ a.linkButton {
|
||||
.version {
|
||||
font-size: 0.7em;
|
||||
}
|
||||
.github {
|
||||
margin: 1em 0 0 0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
[class^="icon-"]:before, [class*=" icon-"]:before {
|
||||
|
||||
+2
-1
@@ -50,8 +50,9 @@
|
||||
<div id="header"><h1>Yellow Lab <span class="icon-lab"></span> Tools</h1></div>
|
||||
<div id="body" ng-view autoscroll="true"></div>
|
||||
<div class="footer">
|
||||
<a href="/about">Learn more</a><br>If you like <b>Yellow Lab Tools</b>, <a href="https://github.com/gmetais/YellowLabTools" target="_blank" class="star">give it a <span>★</span> on GitHub</a>!<br>
|
||||
<span class="version">@@version</span>
|
||||
<br><a href="/about">More about Yellow Lab Tools</a><br>
|
||||
<div class="github"><iframe id="ghbtn" frameborder="0" scrolling="0" width="145px" height="30px"></iframe></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -151,6 +151,9 @@ var OffendersHelpers = function() {
|
||||
};
|
||||
|
||||
this.cssOffenderPattern = function(offender) {
|
||||
// Remove any line breaks
|
||||
offender = offender.replace(/(\r\n|\n|\r)/gm, '');
|
||||
|
||||
var parts = /^(.*) (?:<([^ \(]*)>|\[inline CSS\]) @ (\d+):(\d+)$/.exec(offender);
|
||||
|
||||
if (!parts) {
|
||||
|
||||
@@ -121,7 +121,7 @@ var FileMinifier = function() {
|
||||
});
|
||||
|
||||
} else {
|
||||
debug('Not minfiable type or already minified');
|
||||
debug('Not minifiable type or already minified');
|
||||
deferred.resolve(entry);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ var zlib = require('zlib');
|
||||
var GzipCompressor = function() {
|
||||
|
||||
function compressFile(entry) {
|
||||
debug('Entering compressFile');
|
||||
return gzipUncompressedFile(entry)
|
||||
|
||||
.then(gzipOptimizedFile);
|
||||
@@ -41,7 +42,7 @@ var GzipCompressor = function() {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
debug('Compression not needed');
|
||||
deferred.resolve(entry);
|
||||
}
|
||||
|
||||
@@ -73,6 +74,7 @@ var GzipCompressor = function() {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
debug('Compressing optimized file not needed');
|
||||
deferred.resolve(entry);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ var WeightChecker = function() {
|
||||
.then(gzipCompressor.compressFile)
|
||||
|
||||
.then(function(newEntry) {
|
||||
debug('File %s - Redownloaded, optimized, minified, compressed: done', entry.url);
|
||||
callback(null, newEntry);
|
||||
})
|
||||
|
||||
@@ -439,7 +440,9 @@ var WeightChecker = function() {
|
||||
isCompressed = true;
|
||||
tally();
|
||||
}).on('error', function(err) {
|
||||
debug('Error while decoding %s', requestOptions.url);
|
||||
debug(err);
|
||||
callback(err);
|
||||
});
|
||||
|
||||
res.on('data', function (data) {
|
||||
@@ -459,7 +462,9 @@ var WeightChecker = function() {
|
||||
isCompressed = true;
|
||||
tally();
|
||||
}).on('error', function(err) {
|
||||
debug('Error while decoding %s', requestOptions.url);
|
||||
debug(err);
|
||||
callback(err);
|
||||
});
|
||||
|
||||
res.on('data', function (data) {
|
||||
@@ -489,6 +494,8 @@ var WeightChecker = function() {
|
||||
})
|
||||
|
||||
.on('error', function(err) {
|
||||
debug('Error while downloading %s', requestOptions.url);
|
||||
debug(err);
|
||||
callback(err);
|
||||
});
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "yellowlabtools",
|
||||
"version": "1.7.2",
|
||||
"version": "1.7.3",
|
||||
"description": "Online tool to audit a webpage for performance and front-end quality issues",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -299,6 +299,17 @@ describe('offendersHelpers', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('should handle line breaks inside the string', function() {
|
||||
var result = offendersHelpers.cssOffenderPattern('.card-mask-wrap { -moz-transform: translate3d(0, \n-288px\n, 0) } // was required by firefox 15 and earlier [inline CSS] @ 29:3');
|
||||
|
||||
result.should.deep.equal({
|
||||
css: '.card-mask-wrap { -moz-transform: translate3d(0, -288px, 0) } // was required by firefox 15 and earlier',
|
||||
file: null,
|
||||
line: 29,
|
||||
column: 3
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('fileWithSizePattern', function() {
|
||||
|
||||
Reference in New Issue
Block a user