mirror of
https://github.com/thelounge/thelounge
synced 2025-02-16 13:18:24 +00:00
Convert constants.js to commonjs
This commit is contained in:
parent
86341f063c
commit
4a345eb6d9
11 changed files with 15 additions and 10 deletions
|
@ -9,6 +9,7 @@
|
||||||
# Ignore client folder as it's being built into public/ folder
|
# Ignore client folder as it's being built into public/ folder
|
||||||
# except for the specified files which are used by the server
|
# except for the specified files which are used by the server
|
||||||
client/**
|
client/**
|
||||||
|
!client/js/constants.js
|
||||||
!client/js/helpers/ircmessageparser/findLinks.js
|
!client/js/helpers/ircmessageparser/findLinks.js
|
||||||
!client/js/helpers/ircmessageparser/cleanIrcMessage.js
|
!client/js/helpers/ircmessageparser/cleanIrcMessage.js
|
||||||
!client/index.html.tpl
|
!client/index.html.tpl
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
const constants = require("../js/constants");
|
||||||
import throttle from "lodash/throttle";
|
import throttle from "lodash/throttle";
|
||||||
import constants from "../js/constants";
|
|
||||||
import storage from "../js/localStorage";
|
import storage from "../js/localStorage";
|
||||||
|
|
||||||
import Sidebar from "./Sidebar.vue";
|
import Sidebar from "./Sidebar.vue";
|
||||||
|
|
|
@ -68,12 +68,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
const constants = require("../js/constants");
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import Username from "./Username.vue";
|
import Username from "./Username.vue";
|
||||||
import LinkPreview from "./LinkPreview.vue";
|
import LinkPreview from "./LinkPreview.vue";
|
||||||
import ParsedMessage from "./ParsedMessage.vue";
|
import ParsedMessage from "./ParsedMessage.vue";
|
||||||
import MessageTypes from "./MessageTypes";
|
import MessageTypes from "./MessageTypes";
|
||||||
import constants from "../js/constants";
|
|
||||||
|
|
||||||
MessageTypes.ParsedMessage = ParsedMessage;
|
MessageTypes.ParsedMessage = ParsedMessage;
|
||||||
MessageTypes.LinkPreview = LinkPreview;
|
MessageTypes.LinkPreview = LinkPreview;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import constants from "../js/constants";
|
const constants = require("../js/constants");
|
||||||
import Message from "./Message.vue";
|
import Message from "./Message.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
<script>
|
<script>
|
||||||
require("intersection-observer");
|
require("intersection-observer");
|
||||||
|
|
||||||
import constants from "../js/constants";
|
const constants = require("../js/constants");
|
||||||
import clipboard from "../js/clipboard";
|
import clipboard from "../js/clipboard";
|
||||||
import socket from "../js/socket";
|
import socket from "../js/socket";
|
||||||
import Message from "./Message.vue";
|
import Message from "./Message.vue";
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
const constants = require("./constants");
|
||||||
|
|
||||||
import Mousetrap from "mousetrap";
|
import Mousetrap from "mousetrap";
|
||||||
import {Textcomplete, Textarea} from "textcomplete";
|
import {Textcomplete, Textarea} from "textcomplete";
|
||||||
import fuzzy from "fuzzy";
|
import fuzzy from "fuzzy";
|
||||||
|
|
||||||
import emojiMap from "./helpers/simplemap.json";
|
import emojiMap from "./helpers/simplemap.json";
|
||||||
import constants from "./constants";
|
|
||||||
import store from "./store";
|
import store from "./store";
|
||||||
|
|
||||||
export default enableAutocomplete;
|
export default enableAutocomplete;
|
||||||
|
|
|
@ -26,7 +26,8 @@ const timeFormats = {
|
||||||
msgWithSeconds: "HH:mm:ss",
|
msgWithSeconds: "HH:mm:ss",
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
// This file is required by server, can't use es6 export
|
||||||
|
module.exports = {
|
||||||
colorCodeMap,
|
colorCodeMap,
|
||||||
commands: [],
|
commands: [],
|
||||||
condensedTypes,
|
condensedTypes,
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
const constants = require("./constants");
|
||||||
|
|
||||||
import Vue from "vue";
|
import Vue from "vue";
|
||||||
import VueRouter from "vue-router";
|
import VueRouter from "vue-router";
|
||||||
|
|
||||||
|
@ -12,7 +14,6 @@ import Help from "../components/Windows/Help.vue";
|
||||||
import Changelog from "../components/Windows/Changelog.vue";
|
import Changelog from "../components/Windows/Changelog.vue";
|
||||||
import NetworkEdit from "../components/Windows/NetworkEdit.vue";
|
import NetworkEdit from "../components/Windows/NetworkEdit.vue";
|
||||||
import RoutedChat from "../components/RoutedChat.vue";
|
import RoutedChat from "../components/RoutedChat.vue";
|
||||||
import constants from "./constants";
|
|
||||||
import store from "./store";
|
import store from "./store";
|
||||||
|
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import constants from "../constants";
|
const constants = require("../constants");
|
||||||
import socket from "../socket";
|
import socket from "../socket";
|
||||||
|
|
||||||
socket.on("commands", function(commands) {
|
socket.on("commands", function(commands) {
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
const constants = require("./constants");
|
||||||
|
|
||||||
import Vue from "vue";
|
import Vue from "vue";
|
||||||
import store from "./store";
|
import store from "./store";
|
||||||
import App from "../components/App.vue";
|
import App from "../components/App.vue";
|
||||||
import localetime from "./helpers/localetime";
|
import localetime from "./helpers/localetime";
|
||||||
import storage from "./localStorage";
|
import storage from "./localStorage";
|
||||||
import {router, navigate} from "./router";
|
import {router, navigate} from "./router";
|
||||||
import constants from "./constants";
|
|
||||||
import socket from "./socket";
|
import socket from "./socket";
|
||||||
|
|
||||||
Vue.filter("localetime", localetime);
|
Vue.filter("localetime", localetime);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const expect = require("chai").expect;
|
const expect = require("chai").expect;
|
||||||
const constants = require("../../../client/js/constants").default;
|
const constants = require("../../../client/js/constants");
|
||||||
|
|
||||||
describe("client-side constants", function() {
|
describe("client-side constants", function() {
|
||||||
describe(".colorCodeMap", function() {
|
describe(".colorCodeMap", function() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue