Commits

Ben Buchanan committed f53b434

Clean up the js file a bit

  • Participants
  • Parent commits b71c76c

Comments (0)

Files changed (1)

chrome/aui-debug.js

         console.log("AUI Debug: AUI Not Detected - if it's meant to be here, it's VERY broken!");
         return;
     }
-    // console.log("Running isItBroken");
+
     var option = options || {};
     var brokenThings = [
         {
     // Test for aui items not contained in a group
     $(".aui-item").each(function(i) {
         if ( $(this).parent(".aui-group").length === 0) {
-
             console.warn("AUI debug ERROR  :", ".aui-item should be in a group", this);
-
-            // brokenThings.push({
-            //     "selector" :    $(this),
-            //     "selectorMessage" :    ".aui-item",
-            //     "error":        "aui-item should be in a group",
-            //     "severity":     "error",
-            //     "type":         "block"
-            // });
         }
     });
 
     // Test for aui icons
     $(".aui-icon").each(function(i) {
         if ( !$(this).text().length && !$(this).parent().text().length ) {
-
             console.warn("AUI debug ERROR  :", "Icon and Parent both missing accessible text", this);
-
-            // brokenThings.push({
-            //     "selector" :    $(this),
-            //     "selectorMessage" :    ".aui-icon",
-            //     "error":        "Icon and Parent both missing accessible text",
-            //     "severity":     "warning",
-            //     "type":         "block"
-            // });
         }
     });
 
             $(btSelecter).attr("data-auidebug-error", btMessage);
         }
 
-
-        // if (btType === 'block') {
-        //     console.log("should be block " + btType);
-        // } else if (btType === 'body') {
-        //     console.log("should be body " + btType);
-        // } else if (btType === 'inline') {
-        //     console.log("should be inline " + btType);
-        // } else if (btType === 'hidden') {
-        //     console.log("should be hidden " + btType);
-        // } else {
-        //     console.log("we have no idea " + btType);
-        // }
-
         if ( btOverlays ) {
 
             $.each( $(btSelecter), function() {
                     elwidth = $(this).width(),
                     elposition = "absolute";
 
-                // todo: work out why this wouldn't honour the type
                 console.log($(this).prop("tagName"));
 
                 if ( $(this).prop("tagName") == "BODY") {
     console.clear();
 }
 
-function debugDatShit() {
-    console.log("Running debug");
-    isItAUI({ "showClasses" : true });
-    isItBroken({ "showErrors" : true });
-}
-
-// window.onload = function () {
-    // isItAUI({ "showClasses" : true });
-    // isItBroken({ "showErrors" : true });
-    // debugDatShit();
-    // cleanUp();
-// };
-
-
 if ( window.location.protocol == "file:" ) {
 
     console.log("ERROR: published AUI Debugger does not work for local files, please view via http/s.");
 jQuery(document).ready( function() {
 
     jQuery("#aui-debug-all").click( function(e) {
-        // chrome.tabs.executeScript(null, {code: 'cleanUp()' });
         chrome.tabs.executeScript(null, {code: 'isItAUI({ "showClasses" : true })' });
         chrome.tabs.executeScript(null, {code: 'isItBroken({ "showErrors" : true, "btOverlays": true })' });
     });
     jQuery("#aui-debug-isItAUI").click( function(e) {
-        // chrome.tabs.executeScript(null, {code: 'cleanUp()' });
         chrome.tabs.executeScript(null, {code: 'isItAUI({ "showClasses" : true })' });
     });
     jQuery("#aui-debug-isItBroken").click( function(e) {
-        // chrome.tabs.executeScript(null, {code: 'cleanUp()' });
         chrome.tabs.executeScript(null, {code: 'isItBroken({ "showErrors" : true, "btOverlays": true })' });
     });
     jQuery("#aui-debug-reset").click( function(e) {