1111 *
1212 */
1313
14- _global . HTMLCSAuditor = new function ( )
14+ var HTMLCSAuditor = new function ( )
1515{
1616 var _prefix = 'HTMLCS-' ;
1717 var _screen = '' ;
@@ -151,7 +151,7 @@ _global.HTMLCSAuditor = new function()
151151 var header = _doc . createElement ( 'div' ) ;
152152 header . className = _prefix + 'header' ;
153153 header . innerHTML = 'HTML_CodeSniffer by Squiz' ;
154- header . setAttribute ( 'title' , _global . HTMLCS . getTranslation ( "auditor_using_standard" ) + standard ) ;
154+ header . setAttribute ( 'title' , HTMLCS . getTranslation ( "auditor_using_standard" ) + standard ) ;
155155
156156 var dragging = false ;
157157 var prevX = 0 ;
@@ -210,7 +210,7 @@ _global.HTMLCSAuditor = new function()
210210
211211 var closeIcon = _doc . createElement ( 'div' ) ;
212212 closeIcon . className = _prefix + 'close' ;
213- closeIcon . setAttribute ( 'title' , _global . HTMLCS . getTranslation ( "auditor_close" ) ) ;
213+ closeIcon . setAttribute ( 'title' , HTMLCS . getTranslation ( "auditor_close" ) ) ;
214214 closeIcon . onmousedown = function ( ) {
215215 self . close . call ( self ) ;
216216 } ;
@@ -245,25 +245,25 @@ _global.HTMLCSAuditor = new function()
245245 var divider = ',  <span class="' + _prefix + 'divider"></span>' ;
246246
247247 if ( errors > 0 ) {
248- var typeName = _global . HTMLCS . getTranslation ( "auditor_errors" ) ;
248+ var typeName = HTMLCS . getTranslation ( "auditor_errors" ) ;
249249 if ( errors === 1 ) {
250- typeName = _global . HTMLCS . getTranslation ( "auditor_error" ) ;
250+ typeName = HTMLCS . getTranslation ( "auditor_error" ) ;
251251 }
252252 leftContents . push ( '<strong>' + errors + '</strong> ' + typeName ) ;
253253 }
254254
255255 if ( warnings > 0 ) {
256- var typeName = _global . HTMLCS . getTranslation ( "auditor_warnings" ) ;
256+ var typeName = HTMLCS . getTranslation ( "auditor_warnings" ) ;
257257 if ( warnings === 1 ) {
258- typeName = _global . HTMLCS . getTranslation ( "auditor_warning" ) ;
258+ typeName = HTMLCS . getTranslation ( "auditor_warning" ) ;
259259 }
260260 leftContents . push ( '<strong>' + warnings + '</strong> ' + typeName ) ;
261261 }
262262
263263 if ( notices > 0 ) {
264- var typeName = _global . HTMLCS . getTranslation ( "auditor_notices" ) ;
264+ var typeName = HTMLCS . getTranslation ( "auditor_notices" ) ;
265265 if ( notices === 1 ) {
266- typeName = _global . HTMLCS . getTranslation ( "auditor_notice" ) ;
266+ typeName = HTMLCS . getTranslation ( "auditor_notice" ) ;
267267 }
268268 leftContents . push ( '<strong>' + notices + '</strong> ' + typeName ) ;
269269 }
@@ -333,7 +333,7 @@ _global.HTMLCSAuditor = new function()
333333 lineageHomeLink . href = 'javascript:' ;
334334
335335 var lineageHomeSpan = _doc . createElement ( 'span' ) ;
336- lineageHomeSpan . innerHTML = _global . HTMLCS . getTranslation ( "auditor_home" ) ;
336+ lineageHomeSpan . innerHTML = HTMLCS . getTranslation ( "auditor_home" ) ;
337337 lineageHomeLink . appendChild ( lineageHomeSpan ) ;
338338
339339 lineageHomeLink . onmousedown = function ( ) {
@@ -347,8 +347,8 @@ _global.HTMLCSAuditor = new function()
347347 var lineageReportLink = _doc . createElement ( 'a' ) ;
348348 lineageReportLink . className = _prefix + 'lineage-link' ;
349349 lineageReportLink . href = 'javascript:' ;
350- lineageReportLink . innerHTML = _global . HTMLCS . getTranslation ( "auditor_report" ) ;
351- lineageReportLink . setAttribute ( 'title' , _global . HTMLCS . getTranslation ( "auditor_back_to_report" ) ) ;
350+ lineageReportLink . innerHTML = HTMLCS . getTranslation ( "auditor_report" ) ;
351+ lineageReportLink . setAttribute ( 'title' , HTMLCS . getTranslation ( "auditor_back_to_report" ) ) ;
352352
353353 lineageReportLink . onmousedown = function ( ) {
354354 var list = _doc . querySelectorAll ( '.HTMLCS-inner-wrapper' ) [ 0 ] ;
@@ -363,7 +363,7 @@ _global.HTMLCSAuditor = new function()
363363 // Issue Count item.
364364 var lineageTotalsItem = _doc . createElement ( 'li' ) ;
365365 lineageTotalsItem . className = _prefix + 'lineage-item' ;
366- lineageTotalsItem . innerHTML = _global . HTMLCS . getTranslation ( "auditor_issue" ) + ' ' + issue + ' ' + _global . HTMLCS . getTranslation ( "auditor_of" ) + ' ' + totalIssues ;
366+ lineageTotalsItem . innerHTML = HTMLCS . getTranslation ( "auditor_issue" ) + ' ' + issue + ' ' + HTMLCS . getTranslation ( "auditor_of" ) + ' ' + totalIssues ;
367367
368368 lineageHomeItem . appendChild ( lineageHomeLink ) ;
369369 lineageReportItem . appendChild ( lineageReportLink ) ;
@@ -375,7 +375,7 @@ _global.HTMLCSAuditor = new function()
375375 var buttonGroup = _doc . createElement ( 'div' ) ;
376376 buttonGroup . className = _prefix + 'button-group' ;
377377
378- var prevButton = buildSummaryButton ( _prefix + 'button-previous-issue' , 'previous' , _global . HTMLCS . getTranslation ( "auditor_previous_issue" ) , function ( target ) {
378+ var prevButton = buildSummaryButton ( _prefix + 'button-previous-issue' , 'previous' , HTMLCS . getTranslation ( "auditor_previous_issue" ) , function ( target ) {
379379 var newIssue = Number ( issue ) - 1 ;
380380
381381 if ( newIssue >= 1 ) {
@@ -391,7 +391,7 @@ _global.HTMLCSAuditor = new function()
391391 } //end if
392392 } ) ;
393393
394- var nextButton = buildSummaryButton ( _prefix + 'button-next-issue' , 'next' , _global . HTMLCS . getTranslation ( "auditor_next_issue" ) , function ( target ) {
394+ var nextButton = buildSummaryButton ( _prefix + 'button-next-issue' , 'next' , HTMLCS . getTranslation ( "auditor_next_issue" ) , function ( target ) {
395395 var newIssue = Number ( issue ) + 1 ;
396396
397397 if ( newIssue <= _messages . length ) {
@@ -489,7 +489,7 @@ _global.HTMLCSAuditor = new function()
489489 useStandardDiv . id = _prefix + 'settings-use-standard' ;
490490
491491 var useStandardLabel = _doc . createElement ( 'label' ) ;
492- useStandardLabel . innerHTML = _global . HTMLCS . getTranslation ( "auditor_standards" ) + ':' ;
492+ useStandardLabel . innerHTML = HTMLCS . getTranslation ( "auditor_standards" ) + ':' ;
493493 useStandardLabel . setAttribute ( 'for' , _prefix + 'settings-use-standard-select' ) ;
494494
495495 var useStandardSelect = _doc . createElement ( 'select' ) ;
@@ -519,11 +519,11 @@ _global.HTMLCSAuditor = new function()
519519
520520 var issueCountHelpDiv = _doc . createElement ( 'div' ) ;
521521 issueCountHelpDiv . id = _prefix + 'settings-issue-count-help' ;
522- issueCountHelpDiv . innerHTML = _global . HTMLCS . getTranslation ( "auditor_select_types" ) ;
522+ issueCountHelpDiv . innerHTML = HTMLCS . getTranslation ( "auditor_select_types" ) ;
523523
524524 var viewReportDiv = _doc . createElement ( 'div' ) ;
525525 viewReportDiv . id = _prefix + 'settings-view-report' ;
526- viewReportDiv . innerHTML = _global . HTMLCS . getTranslation ( "auditor_view_report" ) ;
526+ viewReportDiv . innerHTML = HTMLCS . getTranslation ( "auditor_view_report" ) ;
527527
528528 viewReportDiv . onclick = function ( ) {
529529 if ( / d i s a b l e d / . test ( this . className ) === false ) {
@@ -576,23 +576,23 @@ _global.HTMLCSAuditor = new function()
576576 levelCountDiv . className = 'HTMLCS-tile-text' ;
577577
578578 if ( level == "error" ) {
579- levelName = _global . HTMLCS . getTranslation ( 'auditor_error' ) ;
579+ levelName = HTMLCS . getTranslation ( 'auditor_error' ) ;
580580 if ( msgCount !== 1 ) {
581- levelName = _global . HTMLCS . getTranslation ( 'auditor_errors' ) ;
581+ levelName = HTMLCS . getTranslation ( 'auditor_errors' ) ;
582582 }
583583 }
584584
585585 if ( level == "warning" ) {
586- levelName = _global . HTMLCS . getTranslation ( 'auditor_warning' ) ;
586+ levelName = HTMLCS . getTranslation ( 'auditor_warning' ) ;
587587 if ( msgCount !== 1 ) {
588- levelName = _global . HTMLCS . getTranslation ( 'auditor_warnings' ) ;
588+ levelName = HTMLCS . getTranslation ( 'auditor_warnings' ) ;
589589 }
590590 }
591591
592592 if ( level == "notice" ) {
593- levelName = _global . HTMLCS . getTranslation ( 'auditor_notice' ) ;
593+ levelName = HTMLCS . getTranslation ( 'auditor_notice' ) ;
594594 if ( msgCount !== 1 ) {
595- levelName = _global . HTMLCS . getTranslation ( 'auditor_notices' ) ;
595+ levelName = HTMLCS . getTranslation ( 'auditor_notices' ) ;
596596 }
597597 }
598598 var content = '<strong>' + msgCount + '</strong> ' + levelName ;
@@ -822,20 +822,20 @@ _global.HTMLCSAuditor = new function()
822822
823823 var msgElementSourceInner = _doc . createElement ( 'div' ) ;
824824 msgElementSourceInner . className = _prefix + 'issue-source-inner-u2p' ;
825- var msg = _global . HTMLCS . getTranslation ( 'auditor_unable_to_point' ) ;
825+ var msg = HTMLCS . getTranslation ( 'auditor_unable_to_point' ) ;
826826
827827 if ( message . element . nodeName === '#document' ) {
828- msg = _global . HTMLCS . getTranslation ( 'auditor_applies_entire_document' ) ;
828+ msg = HTMLCS . getTranslation ( 'auditor_applies_entire_document' ) ;
829829 } else if ( message . element . ownerDocument === null ) {
830- msg = _global . HTMLCS . getTranslation ( 'auditor_unable_to_point_removed' ) ;
830+ msg = HTMLCS . getTranslation ( 'auditor_unable_to_point_removed' ) ;
831831 } else {
832832 var body = message . element . ownerDocument . getElementsByTagName ( 'body' ) [ 0 ] ;
833833 if ( HTMLCS . util . isInDocument ( message . element ) === false ) {
834- msg += _global . HTMLCS . getTranslation ( 'auditor_unable_to_point_entire' ) ;
834+ msg += HTMLCS . getTranslation ( 'auditor_unable_to_point_entire' ) ;
835835 } else if ( HTMLCS . util . contains ( body , message . element ) === false ) {
836- msg = _global . HTMLCS . getTranslation ( 'auditor_unable_to_point_outside' ) ;
836+ msg = HTMLCS . getTranslation ( 'auditor_unable_to_point_outside' ) ;
837837 } else {
838- msg += ' ' + _global . HTMLCS . getTranslation ( 'auditor_unable_to_point_outside' ) ;
838+ msg += ' ' + HTMLCS . getTranslation ( 'auditor_unable_to_point_outside' ) ;
839839 }
840840 }
841841
@@ -865,9 +865,9 @@ _global.HTMLCSAuditor = new function()
865865 msgElementSourceHeader . className = _prefix + 'issue-source-header' ;
866866
867867 var msgSourceHeaderText = _doc . createElement ( 'strong' ) ;
868- msgSourceHeaderText . innerHTML = _global . HTMLCS . getTranslation ( "auditor_code_snippet" ) ;
868+ msgSourceHeaderText . innerHTML = HTMLCS . getTranslation ( "auditor_code_snippet" ) ;
869869
870- var btnPointTo = buildSummaryButton ( _prefix + 'button-point-to-element-' + id , 'pointer' , _global . HTMLCS . getTranslation ( "auditor_point_to_element" ) , function ( ) {
870+ var btnPointTo = buildSummaryButton ( _prefix + 'button-point-to-element-' + id , 'pointer' , HTMLCS . getTranslation ( "auditor_point_to_element" ) , function ( ) {
871871 self . pointToElement ( message . element ) ;
872872 } ) ;
873873
@@ -960,7 +960,7 @@ _global.HTMLCSAuditor = new function()
960960 var msgElementSourceInner = _doc . createElement ( 'div' ) ;
961961 msgElementSourceInner . className = _prefix + 'issue-source-not-supported' ;
962962
963- var nsText = _global . HTMLCS . getTranslation ( 'auditor_unsupported_browser' ) ;
963+ var nsText = HTMLCS . getTranslation ( 'auditor_unsupported_browser' ) ;
964964
965965 msgElementSourceInner . appendChild ( _doc . createTextNode ( nsText ) ) ;
966966 msgElementSource . appendChild ( msgElementSourceInner ) ;
@@ -989,7 +989,7 @@ _global.HTMLCSAuditor = new function()
989989 var pageNum = _doc . createElement ( 'span' ) ;
990990 pageNum . className = _prefix + 'page-number' ;
991991 // pageNum.innerHTML = 'Page ' + page + ' of ' + totalPages;
992- pageNum . innerHTML = _global . HTMLCS . getTranslation ( "auditor_page" ) + ' ' + page + ' ' + _global . HTMLCS . getTranslation ( "auditor_of" ) + ' ' + totalPages ;
992+ pageNum . innerHTML = HTMLCS . getTranslation ( "auditor_page" ) + ' ' + page + ' ' + HTMLCS . getTranslation ( "auditor_of" ) + ' ' + totalPages ;
993993 navDiv . appendChild ( pageNum ) ;
994994
995995 var next = _doc . createElement ( 'span' ) ;
@@ -1015,7 +1015,7 @@ _global.HTMLCSAuditor = new function()
10151015 }
10161016
10171017 pageNum . innerHTML = '' ;
1018- pageNum . appendChild ( document . createTextNode ( _global . HTMLCS . getTranslation ( "auditor_page" ) + ' ' + _page + ' ' + _global . HTMLCS . getTranslation ( "auditor_of" ) + ' ' + totalPages ) ) ;
1018+ pageNum . appendChild ( document . createTextNode ( HTMLCS . getTranslation ( "auditor_page" ) + ' ' + _page + ' ' + HTMLCS . getTranslation ( "auditor_of" ) + ' ' + totalPages ) ) ;
10191019
10201020 var issueList = _doc . querySelectorAll ( '.HTMLCS-issue-list' ) [ 0 ] ;
10211021 issueList . style . marginLeft = ( ( _page - 1 ) * - 300 ) + 'px' ;
@@ -1034,7 +1034,7 @@ _global.HTMLCSAuditor = new function()
10341034 }
10351035
10361036 pageNum . innerHTML = '' ;
1037- pageNum . appendChild ( document . createTextNode ( _global . HTMLCS . getTranslation ( "auditor_page" ) + ' ' + _page + ' ' + _global . HTMLCS . getTranslation ( "auditor_of" ) + ' ' + totalPages ) ) ;
1037+ pageNum . appendChild ( document . createTextNode ( HTMLCS . getTranslation ( "auditor_page" ) + ' ' + _page + ' ' + HTMLCS . getTranslation ( "auditor_of" ) + ' ' + totalPages ) ) ;
10381038
10391039 var issueList = _doc . querySelectorAll ( '.HTMLCS-issue-list' ) [ 0 ] ;
10401040 issueList . style . marginLeft = ( ( _page - 1 ) * - 300 ) + 'px' ;
@@ -2189,3 +2189,5 @@ _global.HTMLCSAuditor = new function()
21892189 } ;
21902190
21912191} ;
2192+
2193+ module . exports . HTMLCSAuditor = HTMLCSAuditor ;
0 commit comments