Merge pull request #973 from thelounge/xpaw/use-require
Use require() instead of import in client code
This commit is contained in:
commit
4363ef4abe
@ -1,3 +0,0 @@
|
|||||||
---
|
|
||||||
parserOptions:
|
|
||||||
sourceType: module
|
|
@ -1,3 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
// Generates a string from "color-1" to "color-32" based on an input string
|
// Generates a string from "color-1" to "color-32" based on an input string
|
||||||
module.exports = function(str) {
|
module.exports = function(str) {
|
||||||
var hash = 0;
|
var hash = 0;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
var diff;
|
var diff;
|
||||||
|
|
||||||
module.exports = function(a, opt) {
|
module.exports = function(a, opt) {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
module.exports = function(a, b, opt) {
|
module.exports = function(a, b, opt) {
|
||||||
a = a.toString();
|
a = a.toString();
|
||||||
b = b.toString();
|
b = b.toString();
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
module.exports = function(time) {
|
module.exports = function(time) {
|
||||||
return new Date(time).toLocaleDateString();
|
return new Date(time).toLocaleDateString();
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
module.exports = function(time) {
|
module.exports = function(time) {
|
||||||
return new Date(time).toLocaleString();
|
return new Date(time).toLocaleString();
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
module.exports = function(mode) {
|
module.exports = function(mode) {
|
||||||
var modes = {
|
var modes = {
|
||||||
"~": "owner",
|
"~": "owner",
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import Handlebars from "handlebars/runtime";
|
"use strict";
|
||||||
import URI from "urijs";
|
|
||||||
|
const Handlebars = require("handlebars/runtime");
|
||||||
|
const URI = require("urijs");
|
||||||
|
|
||||||
module.exports = function(text) {
|
module.exports = function(text) {
|
||||||
text = Handlebars.Utils.escapeExpression(text);
|
text = Handlebars.Utils.escapeExpression(text);
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
module.exports = function(count) {
|
module.exports = function(count) {
|
||||||
if (count < 1000) {
|
if (count < 1000) {
|
||||||
return count;
|
return count;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
module.exports = function(context) {
|
module.exports = function(context) {
|
||||||
return window.JSON.stringify(context);
|
return window.JSON.stringify(context);
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
module.exports = function(time) {
|
module.exports = function(time) {
|
||||||
time = new Date(time);
|
time = new Date(time);
|
||||||
var h = time.getHours();
|
var h = time.getHours();
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
module.exports = function(count) {
|
module.exports = function(count) {
|
||||||
return count + " " + (count === 1 ? "user" : "users");
|
return count + " " + (count === 1 ? "user" : "users");
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple slideout menu implementation.
|
* Simple slideout menu implementation.
|
||||||
*/
|
*/
|
||||||
export default function slideoutMenu(viewport, menu) {
|
module.exports = function slideoutMenu(viewport, menu) {
|
||||||
var touchStartPos = null;
|
var touchStartPos = null;
|
||||||
var touchCurPos = null;
|
var touchCurPos = null;
|
||||||
var touchStartTime = 0;
|
var touchStartTime = 0;
|
||||||
@ -98,4 +100,4 @@ export default function slideoutMenu(viewport, menu) {
|
|||||||
return menuIsOpen;
|
return menuIsOpen;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
@ -1,18 +1,20 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
// vendor libraries
|
// vendor libraries
|
||||||
import "jquery-ui/ui/widgets/sortable";
|
require("jquery-ui/ui/widgets/sortable");
|
||||||
import $ from "jquery";
|
const $ = require("jquery");
|
||||||
import io from "socket.io-client";
|
const io = require("socket.io-client");
|
||||||
import Mousetrap from "mousetrap";
|
const Mousetrap = require("mousetrap");
|
||||||
import URI from "urijs";
|
const URI = require("urijs");
|
||||||
|
|
||||||
// our libraries
|
// our libraries
|
||||||
import "./libs/jquery/inputhistory";
|
require("./libs/jquery/inputhistory");
|
||||||
import "./libs/jquery/stickyscroll";
|
require("./libs/jquery/stickyscroll");
|
||||||
import "./libs/jquery/tabcomplete";
|
require("./libs/jquery/tabcomplete");
|
||||||
import helpers_parse from "./libs/handlebars/parse";
|
const helpers_parse = require("./libs/handlebars/parse");
|
||||||
import helpers_roundBadgeNumber from "./libs/handlebars/roundBadgeNumber";
|
const helpers_roundBadgeNumber = require("./libs/handlebars/roundBadgeNumber");
|
||||||
import slideoutMenu from "./libs/slideout";
|
const slideoutMenu = require("./libs/slideout");
|
||||||
import templates from "../views";
|
const templates = require("../views");
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
var path = window.location.pathname + "socket.io/";
|
var path = window.location.pathname + "socket.io/";
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
actions: {
|
actions: {
|
||||||
action: require("./actions/action.tpl"),
|
action: require("./actions/action.tpl"),
|
||||||
|
@ -74,6 +74,7 @@ let config = {
|
|||||||
|
|
||||||
if (process.env.NODE_ENV === "production") {
|
if (process.env.NODE_ENV === "production") {
|
||||||
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
|
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
|
||||||
|
sourceMap: true,
|
||||||
comments: false
|
comments: false
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user