Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added structure for the application

  • Loading branch information...
commit 1d611c851cc8a8da9e325760cd2cbbf06a22fa2c 1 parent 4f0bf17
Ignacio Rivas sabarasaba authored
7 .gitignore
View
@@ -9,6 +9,11 @@ Session.vim
/*.sublime-project
*.sublime-workspace
+
+# -- NodeJS files ----------------------------
+
+/node_modules/
+
# -- OS's files ------------------------------
# Windows
Thumbs.db
@@ -28,4 +33,4 @@ $RECYCLE.BIN/
Icon
._*
.Spotlight-V100
-.Trashes
+.Trashes
48 Gruntfile.js
View
@@ -0,0 +1,48 @@
+'use strict';
+
+module.exports = function(grunt) {
+
+ // Project configuration.
+ grunt.initConfig({
+ nodeunit: {
+ files: ['test/**/*_test.js'],
+ },
+ jshint: {
+ options: {
+ jshintrc: '.jshintrc'
+ },
+ gruntfile: {
+ src: 'Gruntfile.js'
+ },
+ lib: {
+ src: ['lib/**/*.js']
+ },
+ test: {
+ src: ['test/**/*.js']
+ },
+ },
+ watch: {
+ gruntfile: {
+ files: '<%= jshint.gruntfile.src %>',
+ tasks: ['jshint:gruntfile']
+ },
+ lib: {
+ files: '<%= jshint.lib.src %>',
+ tasks: ['jshint:lib', 'nodeunit']
+ },
+ test: {
+ files: '<%= jshint.test.src %>',
+ tasks: ['jshint:test', 'nodeunit']
+ },
+ },
+ });
+
+ // These plugins provide necessary tasks.
+ grunt.loadNpmTasks('grunt-contrib-nodeunit');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-watch');
+
+ // Default task.
+ grunt.registerTask('default', ['jshint', 'nodeunit']);
+
+};
22 LICENSE-MIT
View
@@ -0,0 +1,22 @@
+Copyright (c) 2013 Globait UI Developers
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
36 README.md
View
@@ -1,19 +1,27 @@
-ArialLinter
-============
+# arialinter
+
ArialLinter main goal is to provide a simple accesibility linter for HTML documents. Our long-term vision is to enforce accesibility best practices directly into the developer workflow.
-Project status: research
+## Getting Started
+Install the module with: `npm install arialinter`
+
+```javascript
+var arialinter = require('arialinter');
+arialinter.awesome(); // "awesome"
+```
+
+## Documentation
+_(Coming soon)_
+
+## Examples
+_(Coming soon)_
-Milestone 1: parse an HTML5 document and apply 1 rule.
+## Contributing
+In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).
-##Resources:
-* Accessibility
- * http://www.w3.org/TR/WCAG20-TECHS/html.html
- * http://dev.w3.org/html5/alt-techniques/
- * https://dvcs.w3.org/hg/aria-unofficial/raw-file/tip/index.html
- * http://www.openajax.org/member/wiki/Accessibility_-_WCAG20_Validation_Rules
-* NodeJS HTML Parser
- * researching
+## Release History
+_(Nothing yet)_
-##License
-This tool will be released under MIT license
+## License
+Copyright (c) 2013 Globait UI Developers
+Licensed under the MIT license.
35 lib/arialinter.js
View
@@ -0,0 +1,35 @@
+/*
+ * arialinter
+ * https://github.com/globant-ui/arialinter
+ *
+ * Copyright (c) 2013 Globait UI Developers
+ * Licensed under the MIT license.
+ */
+
+'use strict';
+
+
+var jsdom = require('jsdom');
+
+var parsePage = function(callback){
+
+ jsdom.env(
+ 'http://www.imdb.com/name/nm0000365/',
+ ['http://code.jquery.com/jquery.js'],
+ function (err, window){
+ if (!err){
+ window.$('img').each(function(index, item){
+ var has = window.$(this).attr('alt') ? 'does' : 'doesnt';
+
+ console.log('Image ' + index + ' ' + has + ' have ALT attribute.');
+ });
+
+ callback();
+ }
+ }
+ );
+
+};
+
+
+exports.parsePage = parsePage;
34 package.json
View
@@ -0,0 +1,34 @@
+{
+ "name": "arialinter",
+ "description": "ArialLinter main goal is to provide a simple accesibility linter for HTML documents. Our long-term vision is to enforce accesibility best practices directly into the developer workflow.",
+ "version": "0.1.0",
+ "homepage": "https://github.com/globant-ui/arialinter",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/globant-ui/arialinter.git"
+ },
+ "bugs": {
+ "url": "https://github.com/globant-ui/arialinter/issues"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://github.com/globant-ui/arialinter/blob/master/LICENSE-MIT"
+ }
+ ],
+ "main": "lib/arialinter",
+ "engines": {
+ "node": ">= 0.6.0"
+ },
+ "scripts": {
+ "test": "grunt nodeunit"
+ },
+ "devDependencies": {
+ "grunt-contrib-jshint": "~0.1.1",
+ "grunt-contrib-nodeunit": "~0.1.2",
+ "grunt-contrib-watch": "~0.2.0",
+ "grunt": "~0.4.0",
+ "jsdom": ""
+ },
+ "keywords": []
+}
38 test/arialinter_test.js
View
@@ -0,0 +1,38 @@
+'use strict';
+
+var arialinter = require('../lib/arialinter.js');
+
+/*
+ ======== A Handy Little Nodeunit Reference ========
+ https://github.com/caolan/nodeunit
+
+ Test methods:
+ test.expect(numAssertions)
+ test.done()
+ Test assertions:
+ test.ok(value, [message])
+ test.equal(actual, expected, [message])
+ test.notEqual(actual, expected, [message])
+ test.deepEqual(actual, expected, [message])
+ test.notDeepEqual(actual, expected, [message])
+ test.strictEqual(actual, expected, [message])
+ test.notStrictEqual(actual, expected, [message])
+ test.throws(block, [error], [message])
+ test.doesNotThrow(block, [error], [message])
+ test.ifError(value)
+*/
+
+exports['awesome'] = {
+ setUp: function(done) {
+ // setup here
+ done();
+ },
+ 'no args': function(test) {
+ test.expect(1);
+
+ arialinter.parsePage(function(){
+ test.equal('awesome', 'awesome', 'should be awesome.');
+ test.done();
+ });
+ },
+};
Please sign in to comment.
Something went wrong with that request. Please try again.