Rename more es6 files to js

This commit is contained in:
Robin Ward 2020-03-24 16:32:56 -04:00
parent 4876884fd1
commit a11938d58d
5 changed files with 12 additions and 7 deletions

View File

@ -1,11 +1,11 @@
// discourse-skip-module
(function() {
var ps = require("preload-store").default;
var preloadedDataElement = document.getElementById("data-preloaded");
var setupData = document.getElementById("data-discourse-setup").dataset;
const ps = require("preload-store").default;
const preloadedDataElement = document.getElementById("data-preloaded");
const setupData = document.getElementById("data-discourse-setup").dataset;
if (preloadedDataElement) {
var preloaded = JSON.parse(preloadedDataElement.dataset.preloaded);
const preloaded = JSON.parse(preloadedDataElement.dataset.preloaded);
Object.keys(preloaded).forEach(function(key) {
ps.store(key, JSON.parse(preloaded[key]));
@ -34,7 +34,7 @@
Discourse.start();
Discourse.set("assetVersion", setupData.assetVersion);
let Session = require("discourse/models/session").default;
const Session = require("discourse/models/session").default;
Session.currentProp(
"disableCustomCSS",
setupData.disableCustomCss === "true"

View File

@ -1,5 +1,5 @@
// discourse-skip-module
(function() {
var wizard = require("wizard/wizard").default.create();
const wizard = require("wizard/wizard").default.create();
wizard.start();
})();

View File

@ -42,7 +42,12 @@ class DiscourseJsProcessor
relative_path.start_with?("app/assets/javascripts/select-kit/") ||
relative_path.start_with?("app/assets/javascripts/wizard/") ||
relative_path.start_with?("app/assets/javascripts/discourse-common/") ||
relative_path.start_with?("app/assets/javascripts/ember-addons/")
relative_path.start_with?("app/assets/javascripts/ember-addons/") ||
relative_path == "app/assets/javascripts/preload-store.js" ||
relative_path == "app/assets/javascripts/preload-application-data.js" ||
relative_path == "app/assets/javascripts/wizard-start.js" ||
relative_path == "app/assets/javascripts/onpopstate-handler.js" ||
relative_path == "app/assets/javascripts/discourse.js"
end
def self.skip_module?(data)