Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Commit

Permalink
add minified files
Browse files Browse the repository at this point in the history
  • Loading branch information
terw-dan committed Sep 23, 2015
1 parent 576b327 commit 116bdfd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
36 changes: 24 additions & 12 deletions dist/yoast-seo.js
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,14 @@ YoastSEO.App.prototype.runAnalyzer = function() {
}

this.pageAnalyzer.runQueue();
this.scoreFormatter = new YoastSEO.ScoreFormatter( this );
this.scoreFormatter = new YoastSEO.ScoreFormatter(
this.pageAnalyzer.analyzeScorer.__score,
this.pageAnalyzer.analyzeScorer.__totalScore,
this.config.targets.output,
this.config.targets.overall,
this.rawData.keyword,
this.callbacks
);

if ( this.config.dynamicDelay ) {
this.endTime();
Expand Down Expand Up @@ -2132,13 +2139,14 @@ YoastSEO = ( "undefined" === typeof YoastSEO ) ? {} : YoastSEO;
* @param {YoastSEO.App} args
* @constructor
*/
YoastSEO.ScoreFormatter = function( args ) {
this.scores = args.pageAnalyzer.analyzeScorer.__score;
this.overallScore = args.pageAnalyzer.analyzeScorer.__totalScore;
this.outputTarget = args.config.targets.output;
this.overallTarget = args.config.targets.overall;
YoastSEO.ScoreFormatter = function( scores, overallScore, outputTarget, overallTarget, keyword, callbacks ) {
this.scores = scores;
this.overallScore = overallScore;
this.outputTarget = outputTarget;
this.overallTarget = overallTarget;
this.totalScore = 0;
this.refObj = args;
this.keyword = keyword;
this.callbacks = callbacks;
this.outputScore();
this.outputOverallScore();
};
Expand Down Expand Up @@ -2188,23 +2196,27 @@ YoastSEO.ScoreFormatter.prototype.sortScores = function() {
YoastSEO.ScoreFormatter.prototype.outputOverallScore = function() {
var overallTarget = document.getElementById( this.overallTarget );
overallTarget.className = "overallScore " + this.scoreRating( Math.round( this.overallScore ) );
if ( this.refObj.rawData.keyword === "" ) {
overallTarget.className = "overallScore " + this.scoreRating( 0 );
if ( this.keyword === "" ) {
overallTarget.className = "overallScore " + this.scoreRating( "na" );
}
this.refObj.callbacks.saveScores( this.overallScore );
this.callbacks.saveScores( this.overallScore );
};

/**
* retuns a string that is used as a CSSclass, based on the numeric score
* retuns a string that is used as a CSSclass, based on the numeric score or the NA string
* @param score
* @returns scoreRate
*/
YoastSEO.ScoreFormatter.prototype.scoreRating = function( score ) {
var scoreRate;
switch ( score ) {
case 0:
case "na":
scoreRate = "na";
break;
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
scoreRate = "poor";
Expand Down
Loading

0 comments on commit 116bdfd

Please sign in to comment.