Make nested replies warning in old UI smarter

The warning shown in the old thread UI when the nested replies feature
is enabled in a thread has been improved. Before, it only worked by
checking whether the thread was posted in one of the few forums we knew
nested replies were enabled there. These forums were manually hardcoded
into the extension.

However, now the extension detects whether the thread shown is using
nested replies by inspecting the ViewThread response, just like TW does.

Bug: twpowertools:139
Change-Id: I3470eb600f743f14ca565151c19f333f741c544e
diff --git a/src/contentScripts/communityConsole/main.js b/src/contentScripts/communityConsole/main.js
index bc7988d..34b0f1d 100644
--- a/src/contentScripts/communityConsole/main.js
+++ b/src/contentScripts/communityConsole/main.js
@@ -9,10 +9,9 @@
 import {applyDragAndDropFixIfEnabled} from './dragAndDropFix.js';
 // #!endif
 import InfiniteScroll from './infiniteScroll.js';
-import ThreadPageDesignWarning from './threadPageDesignWarning.js';
 import {unifiedProfilesFix} from './unifiedProfiles.js';
 
-var mutationObserver, options, avatars, infiniteScroll, threadPageDesignWarning;
+var mutationObserver, options, avatars, infiniteScroll;
 
 const watchedNodesSelectors = [
   // App container (used to set up the intersection observer and inject the dark
@@ -189,8 +188,9 @@
       window.TWPTExtraInfo.injectPerForumStatsIfEnabled(node);
     }
 
-    if (node.matches('ec-thread > .page > .material-content > div[role="list"]')) {
-      threadPageDesignWarning.injectWarningIfApplicable(node);
+    if (node.matches(
+            'ec-thread > .page > .material-content > div[role="list"]')) {
+      window.TWPTThreadPageDesignWarning.injectWarningIfApplicable(node);
     }
   }
 }
@@ -227,9 +227,9 @@
   // Initialize classes needed by the mutation observer
   avatars = new AvatarsHandler();
   infiniteScroll = new InfiniteScroll();
-  threadPageDesignWarning = new ThreadPageDesignWarning();
 
-  // autoRefresh and extraInfo are initialized in start.js
+  // autoRefresh, extraInfo and threadPageDesignWarning are initialized in
+  // start.js
 
   // Before starting the mutation Observer, check whether we missed any
   // mutations by manually checking whether some watched nodes already