This repository has been archived by the owner on Oct 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 173
Stories/dt/linkcount #8 #12
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
51a3cae
Added stopwordChecker and rewritten helper functions to be more generic
terw-dan 4e3f8cd
Moved helper functions to helper object and added first regex-array f…
terw-dan 8b38530
Merge branch 'stories/DT/keywordDensity' into stories/DT/stopWords
terw-dan 603b683
Merge branch 'stories/DT/stopWords' into stories/DT/fleschReading
terw-dan 6081cc3
refactored init function and keyword density
terw-dan 1b66659
fix return of stripspaces function
terw-dan 340ca96
call string helper for regex in keyword density check.
terw-dan 0ca579b
refactored headingtagschecker
terw-dan c1cd19e
first commit for syllable counter
terw-dan 7c3df4a
updated regexes for syllable count
terw-dan 1d642cd
updated regexstringbuilder to accept option to disable word boundaries
terw-dan 7a5d20a
update for regular expressions for syllable count + added new jasmine…
terw-dan 9ed757d
moved syllable config to config.js
terw-dan 054b4c1
added flesch kincaid reading function and spec and refactored the syl…
terw-dan 182c672
output flesh reading result + added 1 jasmine spec.
terw-dan e0bd0a0
added grunt tasks for js validation/building
terw-dan 12ec150
fixed some missing semicolons in analyzer.js
terw-dan 845a69c
fixed some styling and variable declarations
terw-dan 697962a
gruntfile for minifying analyzer.js
terw-dan 4b5217c
updated specs to validate JSlint. (missing semicolon's and ' in stead…
terw-dan 8aedfd4
updated spec for link counter.
terw-dan efeae6f
added test for link counts, fixed external/internal count
terw-dan a32419b
changed naming of functions to increase the consistency across the di…
terw-dan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"boss": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"eqnull": true, | ||
"es3": true, | ||
"immed": true, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"quotmark": "single", | ||
"sub": true, | ||
"strict": true, | ||
"undef": true, | ||
"unused": true, | ||
|
||
"node": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"preset": "jquery" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Gruntfile.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"boss": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"eqnull": true, | ||
|
||
|
||
"immed": true, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"quotmark": "double", | ||
"sub": true, | ||
"strict": false, | ||
|
||
"undef": false, | ||
"unused": true, | ||
"funcscope": false, | ||
"browser": true, | ||
"jquery": false, | ||
|
||
"globals": { | ||
"exports": true, | ||
"module": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/*jslint es5: false */ | ||
module.exports = function(grunt) { | ||
'use strict'; | ||
|
||
//require('time-grunt')(grunt); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would remove this line, because it seems it's not needed anymore? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed the comment tags. We actually do want to time grunt, so this needs to be included. |
||
|
||
// Define project configuration | ||
var project = { | ||
paths: { | ||
get config() { | ||
return this.grunt + 'config/'; | ||
}, | ||
grunt: 'grunt/', | ||
js: 'js/' | ||
|
||
}, | ||
files: { | ||
js: [ | ||
'js/*.js', | ||
'!js/*.min.js', | ||
'spec/*.js', | ||
'!spec/*.min.js' | ||
], | ||
|
||
get config() { | ||
return project.paths.config + '*.js'; | ||
}, | ||
grunt: 'Gruntfile.js' | ||
}, | ||
pkg: grunt.file.readJSON( 'package.json' ) | ||
}; | ||
|
||
// Load Grunt configurations and tasks | ||
require( 'load-grunt-config' )(grunt, { | ||
configPath: require( 'path' ).join( process.cwd(), project.paths.config ), | ||
data: project | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Grunt aliases | ||
--- | ||
# Build everything | ||
build: | ||
- 'build:js' | ||
# Build JavaScript from assets to production | ||
'build:js': | ||
- 'uglify' | ||
# Check health of the project | ||
check: | ||
- 'jshint' | ||
- 'jsonlint' | ||
- 'jsvalidate' | ||
# Default task | ||
default: | ||
- check | ||
- build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// https://github.com/jscs-dev/grunt-jscs | ||
module.exports = { | ||
options: { | ||
config: '.jscsrc' | ||
}, | ||
plugin: { | ||
files: { | ||
src: [ | ||
'js/analyzer.js' | ||
] | ||
} | ||
}, | ||
grunt: { | ||
options: { | ||
// We have no control over task names that use underscores | ||
requireCamelCaseOrUpperCaseIdentifiers: 'ignoreProperties' | ||
}, | ||
files: { | ||
src: [ | ||
'<%= files.grunt %>', | ||
'<%= files.config %>' | ||
] | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// https://github.com/gruntjs/grunt-contrib-jshint | ||
module.exports = { | ||
plugin: { | ||
options: { | ||
jshintrc: '.jshintrc' | ||
}, | ||
src: '<%= files.js %>' | ||
}, | ||
grunt: { | ||
options: { | ||
jshintrc: '.gruntjshintrc' | ||
}, | ||
src: [ | ||
'<%= files.grunt %>', | ||
'<%= files.config %>' | ||
] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// https://github.com/brandonramirez/grunt-jsonlint | ||
module.exports = { | ||
all: { | ||
src: [ | ||
'.gruntjshintrc', | ||
'.jscsrc', | ||
'.jshintrc', | ||
'composer.json', | ||
'package.json' | ||
] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// https://github.com/ariya/grunt-jsvalidate | ||
module.exports = { | ||
options: { | ||
verbose: true | ||
}, | ||
plugin: { | ||
files: { | ||
src: 'js/analyzer.js' | ||
} | ||
}, | ||
grunt: { | ||
files: { | ||
src: [ | ||
'<%= files.grunt %>', | ||
'<%= files.config %>' | ||
] | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// https://github.com/gruntjs/grunt-contrib-uglify | ||
module.exports = { | ||
'wordpres-seo': { | ||
options: { | ||
preserveComments: 'some', | ||
report: 'gzip' | ||
}, | ||
files: [{ | ||
expand: true, | ||
cwd: 'js', | ||
src: [ | ||
'*.js', | ||
'!*.min.js' | ||
], | ||
dest: 'js', | ||
ext: '.min.js', | ||
extDot: 'first', | ||
isFile: true | ||
}] | ||
} | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should use single quote's instead of double ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since in JavaScript there is no real difference between singles and doubles I decided to do everything with doubles, so if there is singlequote in a textstring it doesn't have to be escaped.