index.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * 编码规范检测
  3. * @author 赵先烈
  4. */
  5. module.exports = (function () {
  6. let _loadStaticFiles = function () {
  7. Tarp.require('../static/js/utils');
  8. window.MSG_TYPE = Tarp.require('../static/js/msg_type');
  9. Tarp.require('../code-standards/fcp-fl');
  10. Tarp.require('../code-standards/css/fcp-css-analytic');
  11. Tarp.require('../code-standards/css/fcp-css');
  12. Tarp.require('../code-standards/html/fcp-html-analytic');
  13. Tarp.require('../code-standards/html/fcp-html-doctype');
  14. Tarp.require('../code-standards/html/fcp-html');
  15. Tarp.require('../code-standards/js/fcp-js');
  16. Tarp.require('../code-standards/fcp-tabs');
  17. Tarp.require('../code-standards/fcp-main');
  18. Tarp.require('../static/vendor/jquery/jquery.extend.js');
  19. Tarp.require('../static/vendor/jquery/jquery-ui.min.js');
  20. if (!jQuery('#_fehelper_jq_ui_css_')[0]) {
  21. let jqUiCss = chrome.extension.getURL('static/vendor/jquery/jquery-ui.min.css');
  22. jQuery('<link id="_fehelper_jq_ui_css_" href="' + jqUiCss + '" rel="stylesheet" type="text/css" />').appendTo('head');
  23. let fcpCss = chrome.extension.getURL('code-standards/index.css');
  24. jQuery('<link id="_fehelper_fcp_css_" href="' + fcpCss + '" rel="stylesheet" type="text/css" />').appendTo('head');
  25. }
  26. };
  27. let _helperInit = function () {
  28. _loadStaticFiles();
  29. baidu.fcphelper.initStaticFile();
  30. };
  31. let _helperDetect = function () {
  32. baidu.fcphelper.initHtml(function () {
  33. baidu.fcphelper.detect();
  34. });
  35. };
  36. return {
  37. init: _helperInit,
  38. detect: _helperDetect
  39. };
  40. })();