Skip to content
Browse files

Deleted duplicated task file

  • Loading branch information...
1 parent 93c739b commit 2d95af6c59b2a6420e74c68067e7fbcbe15403a7 @sabarasaba sabarasaba committed Mar 21, 2013
Showing with 27 additions and 51 deletions.
  1. +1 −0 index.js
  2. +26 −10 lib/arialinter.js
  3. +0 −41 tasks/arialinter.js
View
1 index.js
@@ -0,0 +1 @@
+module.exports = require('./lib/cli/node');
View
36 lib/arialinter.js
@@ -21,20 +21,11 @@ ArialLinter.prototype = (function() {
initialize: function(uri, callback) {
var that = this;
this.dom = undefined;
- this.rules = [];
this.Reporter = Reporter;
this.formatters = {};
// Add rules
- this.rules.push(RuleFactory.makeRule('validalttext'));
- this.rules.push(RuleFactory.makeRule('frametitle'));
- this.rules.push(RuleFactory.makeRule('htmllang'));
- this.rules.push(RuleFactory.makeRule('belement'));
- this.rules.push(RuleFactory.makeRule('blinkelement'));
- this.rules.push(RuleFactory.makeRule('marqueeelement'));
- this.rules.push(RuleFactory.makeRule('fontelement'));
- this.rules.push(RuleFactory.makeRule('ielement'));
- this.rules.push(RuleFactory.makeRule('uelement'));
+ this.initRules();
// Add formatters
this.addFormatter(require('./formatters/text'));
@@ -50,6 +41,31 @@ ArialLinter.prototype = (function() {
});
},
+ initRules: function(){
+ this.rules = [];
+
+ this.rules.push(RuleFactory.makeRule('validalttext'));
+ this.rules.push(RuleFactory.makeRule('frametitle'));
+ this.rules.push(RuleFactory.makeRule('htmllang'));
+ this.rules.push(RuleFactory.makeRule('belement'));
+ this.rules.push(RuleFactory.makeRule('blinkelement'));
+ this.rules.push(RuleFactory.makeRule('marqueeelement'));
+ this.rules.push(RuleFactory.makeRule('fontelement'));
+ this.rules.push(RuleFactory.makeRule('ielement'));
+ this.rules.push(RuleFactory.makeRule('uelement'));
+ },
+
+ getRules: function() {
+ var len = this.rules.length;
+ var r = [];
+
+ for (var x = 0; x < len; x++) {
+ r.push(this.rules[x].name);
+ }
+
+ return r;
+ },
+
addFormatter: function(formatter) {
this.formatters[formatter.id] = formatter;
},
View
41 tasks/arialinter.js
@@ -1,41 +0,0 @@
-/*
- * grunt-arialinter
- * https://github.com/globant-ui/arialinter
- *
- * Copyright (c) 2012 Globant UI Developers
- * Licensed under the MIT license.
- */
-
-
-var ArialLinter = require('../lib/arialinter.js').ArialLinter;
-var async = require('async');
-
-
-module.exports = function(grunt) {
- 'use strict';
-
- grunt.registerMultiTask('arialinter', 'ArialLinter provides a simple accesibility linter for HTML documents.', function() {
-
- // Tell grunt this task is asynchronous.
- var done = this.async();
-
- var linter = new ArialLinter();
- var x = 0;
-
- async.each(this.data, function(uri, callback) {
- linter.initialize(uri, function() {
- x++;
-
- if (linter.evaluate()){
- grunt.log.write('The HTML of the file ' + x + ' seems to be valid according the WCAG 2.0 spec.\n');
- callback();
- } else {
- grunt.warn('The HTML of the file ' + x + ' doenst seem to be valid according the WCAG 2.0 spec.\n');
- callback();
- }
- });
- }, function() {
- done();
- });
- });
-};

0 comments on commit 2d95af6

Please sign in to comment.
Something went wrong with that request. Please try again.