├── .gitignore
├── LICENSE
├── README.md
├── app.js
├── app
├── controllers
│ ├── chat.js
│ ├── home.js
│ ├── login.js
│ └── signup.js
├── models
│ ├── chat.js
│ ├── room.js
│ └── user.js
└── views
│ ├── chat.ejs
│ ├── login.ejs
│ ├── message.ejs
│ ├── parts
│ ├── footer.ejs
│ ├── head.ejs
│ └── header.ejs
│ └── signup.ejs
├── chat.gif
├── libs
├── chat.js
└── encrypt.js
├── middlewares
├── auth.js
└── validator.js
├── package.json
└── public
├── css
├── bootstrap.min.css
├── elegant-icons-style.css
└── style.css
├── fonts
├── ElegantIcons.eot
├── ElegantIcons.svg
├── ElegantIcons.ttf
├── ElegantIcons.woff
├── glyphicons-halflings-regular.eot
├── glyphicons-halflings-regular.svg
├── glyphicons-halflings-regular.ttf
├── glyphicons-halflings-regular.woff
└── glyphicons-halflings-regular.woff2
├── js
├── bootstrap.min.js
├── jquery-3.1.1.min.js
├── moment.min.js
├── scriptForChat.js
├── scriptForSignup.js
└── socket.io-1.7.3.js
└── pics
├── favicon.ico
├── mean-bg.jpg
└── mean.png
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | lerna-debug.log*
8 | yarn.lock
9 | package-json.lock
10 |
11 | # Diagnostic reports (https://nodejs.org/api/report.html)
12 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
13 |
14 | # Runtime data
15 | pids
16 | *.pid
17 | *.seed
18 | *.pid.lock
19 |
20 | # Directory for instrumented libs generated by jscoverage/JSCover
21 | lib-cov
22 |
23 | # Coverage directory used by tools like istanbul
24 | coverage
25 | *.lcov
26 |
27 | # nyc test coverage
28 | .nyc_output
29 |
30 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
31 | .grunt
32 |
33 | # Bower dependency directory (https://bower.io/)
34 | bower_components
35 |
36 | # node-waf configuration
37 | .lock-wscript
38 |
39 | # Compiled binary addons (https://nodejs.org/api/addons.html)
40 | build/Release
41 |
42 | # Dependency directories
43 | node_modules/
44 | jspm_packages/
45 |
46 | # TypeScript v1 declaration files
47 | typings/
48 |
49 | # TypeScript cache
50 | *.tsbuildinfo
51 |
52 | # Optional npm cache directory
53 | .npm
54 |
55 | # Optional eslint cache
56 | .eslintcache
57 |
58 | # Optional REPL history
59 | .node_repl_history
60 |
61 | # Output of 'npm pack'
62 | *.tgz
63 |
64 | # Yarn Integrity file
65 | .yarn-integrity
66 |
67 | # dotenv environment variables file
68 | .env
69 | .env.test
70 |
71 | # parcel-bundler cache (https://parceljs.org/)
72 | .cache
73 |
74 | # next.js build output
75 | .next
76 |
77 | # nuxt.js build output
78 | .nuxt
79 |
80 | # vuepress build output
81 | .vuepress/dist
82 |
83 | # Serverless directories
84 | .serverless/
85 |
86 | # FuseBox cache
87 | .fusebox/
88 |
89 | # DynamoDB Local files
90 | .dynamodb/
91 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Vithalreddy.M.B
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Socket.Io Real-time Chat App | A MEAN stack based Real Time chat application
2 |
3 |
4 | ## Description
5 | Socket.IO Realtime Chat App | A MEAN stack based real time chat application
6 |
7 | Lot more features to be added soon.
8 |
9 | ## [MongoDB Chat Schema](https://stackfame.com/mongodb-chat-schema-mongoose-chat-schema-chat-application)
10 |
11 | ## Screen Shots
12 |
13 | 
14 |
15 | ## Features
16 |
17 | ```
18 | 1). Group Chat.
19 | 2). One to One chat.
20 | 3). Chat messages saved in mongodb.
21 | 4). Login / Logout feature.
22 | 5). Shows which User is typing and which user is logged in and logged out.
23 | 6). User connected and disconnected feature.
24 | 7). clean ui and ux.
25 | ```
26 |
27 | ## Prerequisites
28 |
29 | Git
30 |
31 | NodeJs
32 |
33 | Socket.IO
34 |
35 | NPM
36 |
37 | MongoDB
38 |
39 | ## Online demo:
40 | ```
41 | 1). Go to ("http://socketiochatapp.tk/user/signup") link and signup
42 | 2). Login @ ("http://socketiochatapp.tk/user/login")
43 | 3). Chat with group or one-to-one.
44 | ```
45 |
46 | ## Running
47 |
48 | (Note: these instructions are for Ubuntu Linux based OS. Assuming nodejs, npm and mongodb is already installed).
49 |
50 | running mongodb:
51 | ```
52 | 1). Open Terminal and change directory to where mongodb is installed in bin folder.
53 | 2). user@linux: ~/path/to/mongodb/bin $ ./mongod
54 | 3). press enter database server will start.
55 | ```
56 | unzipping and installing dependencies:
57 | ```
58 | 1). Unzip the downloaded file.
59 | 2). Open the extracted folder.
60 | 3). Right click somewhere in folder and select Open in Terminal.
61 | 4). Type Command : npm install and press enter. This will install all dependencies shown in package.json file.
62 | ```
63 | running project:
64 | ```
65 | Step 1: Install all dependencies by : npm install and run node app.js
66 | Step 2: Sign up @ http://localhost:5000/user/signup
67 | Step 3: Now you're good to go.
68 | Step 4: Now Login @http://localhost:5000/user/login
69 | Step 5: Now Chat with your friends real fast powered by socket.IO and Nodejs.
70 |
71 | ```
72 | ## Built With
73 |
74 | OS : Linux Mint
75 |
76 | API Tool : Postman
77 |
78 | Editor : Atom.
79 |
80 | ## Version
81 |
82 | This is first version 1.
83 |
84 | ## My other Projects & My portfolio
85 | [Visit My GitHub Account](https://github.com/vithalreddy "My GitHub Account")
86 |
87 | [MEAN SHOP | A MEAN stack based Ecommerce backend and Frontend Project ](https://github.com/vithalreddy/mean-shop-with-rest-api "MEAN SHOP | A MEAN stack based Ecommerce backend and Frontend Project")
88 |
89 |
90 | [English Premier League Club Matches AngularJS SPA App](https://vithalreddy.github.io/angularjs-epl-footaball-spa-app/#/ "English Premier League Club Matches AngularJS SPA App")
91 |
92 | [Game Of Thrones - All the data from the universe of Ice And Fire you've ever wanted. | An AngularJS SPA APP](https://vithalreddy.github.io/angularjs-game-of-thrones-anapioficeandfire-spa-app/# "Game Of Thrones - All the data from the universe of Ice And Fire you've ever wanted. | An AngularJS SPA APP")
93 |
94 |
95 | ## Contributors
96 |
97 | [Vithalreddy](https://github.com/vithalreddy "My GitHub Account") - [Visit My Blog](https://stackfame.com "Stack FAME")
98 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 | const mongoose = require("mongoose");
3 | const bodyParser = require("body-parser");
4 | const cookieParser = require("cookie-parser");
5 | const session = require("express-session");
6 | const mongoStore = require("connect-mongo")(session);
7 | const methodOverride = require("method-override");
8 | const path = require("path");
9 | const fs = require("fs");
10 | const logger = require("morgan");
11 |
12 | const app = express();
13 | const http = require("http").Server(app);
14 |
15 | //port setup
16 | const port = process.env.PORT || 5000;
17 |
18 | //socket.io
19 | require("./libs/chat.js").sockets(http);
20 |
21 | app.use(logger("dev"));
22 |
23 | //db connection
24 | // const dbPath = "mongodb://localhost/socketChatDB";
25 | const dbPath = `mongodb://github_demo:Pass\#12@ds149511.mlab.com:49511/socketionodejschat`;
26 | mongoose.connect(dbPath, { useNewUrlParser: true });
27 | mongoose.connection.once("open", function() {
28 | console.log("Database Connection Established Successfully.");
29 | });
30 |
31 | //http method override middleware
32 | app.use(
33 | methodOverride(function(req, res) {
34 | if (req.body && typeof req.body === "object" && "_method" in req.body) {
35 | var method = req.body._method;
36 | delete req.body._method;
37 | return method;
38 | }
39 | })
40 | );
41 |
42 | //session setup
43 | const sessionInit = session({
44 | name: "userCookie",
45 | secret: "9743-980-270-india",
46 | resave: true,
47 | httpOnly: true,
48 | saveUninitialized: true,
49 | store: new mongoStore({ mongooseConnection: mongoose.connection }),
50 | cookie: { maxAge: 80 * 80 * 800 }
51 | });
52 |
53 | app.use(sessionInit);
54 |
55 | //public folder as static
56 | app.use(express.static(path.resolve(__dirname, "./public")));
57 |
58 | //views folder and setting ejs engine
59 | app.set("views", path.resolve(__dirname, "./app/views"));
60 | app.set("view engine", "ejs");
61 |
62 | //parsing middlewares
63 | app.use(bodyParser.json({ limit: "10mb", extended: true }));
64 | app.use(bodyParser.urlencoded({ limit: "10mb", extended: true }));
65 | app.use(cookieParser());
66 |
67 | //including models files.
68 | fs.readdirSync("./app/models").forEach(function(file) {
69 | if (file.indexOf(".js")) {
70 | require("./app/models/" + file);
71 | }
72 | });
73 |
74 | //including controllers files.
75 | fs.readdirSync("./app/controllers").forEach(function(file) {
76 | if (file.indexOf(".js")) {
77 | var route = require("./app/controllers/" + file);
78 | //calling controllers function and passing app instance.
79 | route.controller(app);
80 | }
81 | });
82 |
83 | //handling 404 error.
84 | app.use(function(req, res) {
85 | res.status(404).render("message", {
86 | title: "404",
87 | msg: "Page Not Found.",
88 | status: 404,
89 | error: "",
90 | user: req.session.user,
91 | chat: req.session.chat
92 | });
93 | });
94 |
95 | //app level middleware for setting logged in user.
96 |
97 | const userModel = mongoose.model("User");
98 |
99 | app.use(function(req, res, next) {
100 | if (req.session && req.session.user) {
101 | userModel.findOne({ email: req.session.user.email }, function(err, user) {
102 | if (user) {
103 | req.user = user;
104 | delete req.user.password;
105 | req.session.user = user;
106 | delete req.session.user.password;
107 | next();
108 | }
109 | });
110 | } else {
111 | next();
112 | }
113 | }); //end of set Logged In User.
114 |
115 | http.listen(port, function() {
116 | console.log("Chat App started at port :" + port);
117 | });
118 |
--------------------------------------------------------------------------------
/app/controllers/chat.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 | const router = express.Router();
3 |
4 | const auth = require("../../middlewares/auth.js");
5 |
6 | module.exports.controller = function(app) {
7 | //route for chat
8 | app.get("/chat", auth.checkLogin, function(req, res) {
9 | res.render("chat", {
10 | title: "Chat Home",
11 | user: req.session.user,
12 | chat: req.session.chat
13 | });
14 | });
15 |
16 | app.use(router);
17 | }; //Chat controller end.
18 |
--------------------------------------------------------------------------------
/app/controllers/home.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 | const mongoose = require("mongoose");
3 |
4 | const router = express.Router();
5 |
6 | const userModel = mongoose.model("User");
7 |
8 | module.exports.controller = function(app) {
9 | //router for home.
10 | router.get("/", function(req, res) {
11 | res.redirect("/user/login");
12 | });
13 |
14 | app.use(router);
15 | }; //home controller end.
16 |
--------------------------------------------------------------------------------
/app/controllers/login.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 | const mongoose = require("mongoose");
3 |
4 | //middlewares
5 | const auth = require("../../middlewares/auth.js");
6 | const encrypt = require("../../libs/encrypt.js");
7 |
8 | const router = express.Router();
9 |
10 | const userModel = mongoose.model("User");
11 |
12 | module.exports.controller = function(app) {
13 | //route for login
14 | router.get("/login", auth.loggedIn, function(req, res) {
15 | res.render("login", {
16 | title: "User Login",
17 | user: req.session.user,
18 | chat: req.session.chat
19 | });
20 | });
21 |
22 | //route for logout
23 | router.get("/logout", function(req, res) {
24 | delete req.session.user;
25 | res.redirect("/user/login");
26 | });
27 |
28 | //route for login
29 | router.post("/api/v1/login", auth.loggedIn, function(req, res) {
30 | const epass = encrypt.encryptPassword(req.body.password);
31 |
32 | userModel.findOne(
33 | { $and: [{ email: req.body.email }, { password: epass }] },
34 | function(err, result) {
35 | if (err) {
36 | res.render("message", {
37 | title: "Error",
38 | msg: "Some Error Occured During Login.",
39 | status: 500,
40 | error: err,
41 | user: req.session.user,
42 | chat: req.session.chat
43 | });
44 | } else if (result == null || result == undefined || result == "") {
45 | res.render("message", {
46 | title: "Error",
47 | msg: "User Not Found. Please Check Your Username and Password.",
48 | status: 404,
49 | error: "",
50 | user: req.session.user,
51 | chat: req.session.chat
52 | });
53 | } else {
54 | req.user = result;
55 | delete req.user.password;
56 | req.session.user = result;
57 | delete req.session.user.password;
58 | res.redirect("/chat");
59 | }
60 | }
61 | );
62 | });
63 |
64 | app.use("/user", router);
65 | }; // login controller end
66 |
--------------------------------------------------------------------------------
/app/controllers/signup.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 | const mongoose = require("mongoose");
3 | const shortid = require("shortid");
4 |
5 | //middlewares
6 | const auth = require("../../middlewares/auth.js");
7 | const validator = require("../../middlewares/validator.js");
8 | const encrypt = require("../../libs/encrypt.js");
9 |
10 | const router = express.Router();
11 |
12 | const userModel = mongoose.model("User");
13 |
14 | module.exports.controller = function(app) {
15 | //route for signup
16 | router.get("/signup", auth.loggedIn, function(req, res) {
17 | res.render("signup", {
18 | title: "User Signup",
19 | user: req.session.user,
20 | chat: req.session.chat
21 | });
22 | });
23 |
24 | //api to create new user
25 | router.post("/api/v1/signup", auth.loggedIn, validator.emailExist, function(
26 | req,
27 | res
28 | ) {
29 | const today = Date.now();
30 | const id = shortid.generate();
31 | const epass = encrypt.encryptPassword(req.body.password);
32 |
33 | //create user.
34 | const newUser = new userModel({
35 | userId: id,
36 | username: req.body.username,
37 | email: req.body.email,
38 | password: epass,
39 | createdOn: today,
40 | updatedOn: today
41 | });
42 |
43 | newUser.save(function(err, result) {
44 | if (err) {
45 | console.log(err);
46 | res.render("message", {
47 | title: "Error",
48 | msg: "Some Error Occured During Creation.",
49 | status: 500,
50 | error: err,
51 | user: req.session.user,
52 | chat: req.session.chat
53 | });
54 | } else if (result == undefined || result == null || result == "") {
55 | res.render("message", {
56 | title: "Empty",
57 | msg: "User Is Not Created. Please Try Again.",
58 | status: 404,
59 | error: "",
60 | user: req.session.user,
61 | chat: req.session.chat
62 | });
63 | } else {
64 | req.user = result;
65 | delete req.user.password;
66 | req.session.user = result;
67 | delete req.session.user.password;
68 | res.redirect("/chat");
69 | }
70 | });
71 | });
72 |
73 | app.use("/user", router);
74 | }; //signup controller end
75 |
--------------------------------------------------------------------------------
/app/models/chat.js:
--------------------------------------------------------------------------------
1 | const mongoose = require("mongoose");
2 | const Schema = mongoose.Schema;
3 | const chatSchema = new Schema({
4 | msgFrom: { type: String, default: "", required: true },
5 | msgTo: { type: String, default: "", required: true },
6 | msg: { type: String, default: "", required: true },
7 | room: { type: String, default: "", required: true },
8 | createdOn: { type: Date, default: Date.now }
9 | });
10 |
11 | mongoose.model("Chat", chatSchema);
12 |
--------------------------------------------------------------------------------
/app/models/room.js:
--------------------------------------------------------------------------------
1 | const mongoose = require("mongoose");
2 | const Schema = mongoose.Schema;
3 | const roomSchema = new Schema({
4 | name1: { type: String, default: "", required: true },
5 | name2: { type: String, default: "", required: true },
6 | members: [],
7 | lastActive: { type: Date, default: Date.now },
8 | createdOn: { type: Date, default: Date.now }
9 | });
10 |
11 | mongoose.model("Room", roomSchema);
12 |
--------------------------------------------------------------------------------
/app/models/user.js:
--------------------------------------------------------------------------------
1 | const mongoose = require("mongoose");
2 | const Schema = mongoose.Schema;
3 | const userSchema = new Schema({
4 | userId: { type: String, default: "", required: true },
5 | username: { type: String, default: "", required: true },
6 | email: { type: String, default: "", required: true },
7 | password: { type: String, default: "", required: true },
8 | createdOn: { type: Date, default: Date.now },
9 | updatedOn: { type: Date, default: Date.now }
10 | });
11 | mongoose.model("User", userSchema);
12 |
--------------------------------------------------------------------------------
/app/views/chat.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <% include ./parts/head.ejs %>
5 |
6 |
7 | <% include ./parts/header.ejs %>
8 |
9 |
10 |
Wel Come to MEAN Chat, Your Favourite Messaging App!
11 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
Chat Options
24 |
25 |
26 |
For Group Chat Click on Group Button and for One-to-One chat click on Username
27 |
28 |
29 |
32 |
33 |
34 |
35 |
36 |
37 |
Chat Room
38 |
39 |
40 |
Loading..... Please Wait.
41 |
No More Chats To Display.....
42 |
!!...Click On User Or Group Button To Start Chat...!!
43 |
44 |
45 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | <% include ./parts/footer.ejs %>
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/app/views/login.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <% include ./parts/head.ejs %>
5 |
6 |
7 | <% include ./parts/header.ejs %>
8 |
9 |
10 |
11 |
12 |
Sign In to Your Account
13 |
14 |
15 |
26 |
27 |
28 | <% include ./parts/footer.ejs %>
29 |
30 |
31 |
--------------------------------------------------------------------------------
/app/views/message.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <% include ./parts/head.ejs %>
5 |
6 |
7 | <% include ./parts/header.ejs %>
8 |
9 |
10 |
11 | Notifications
12 | <%= msg %>
13 | <%= status %>
14 | <%= error %>
15 |
16 |
17 |
18 | <% include ./parts/footer.ejs %>
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/views/parts/footer.ejs:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/views/parts/head.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <%= title %>
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/views/parts/header.ejs:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/app/views/signup.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <% include ./parts/head.ejs %>
5 |
6 |
7 | <% include ./parts/header.ejs %>
8 |
9 |
10 |
11 |
12 |
Sign Up
13 |
14 |
15 |
39 |
40 |
41 |
42 | <% include ./parts/footer.ejs %>
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/chat.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vithalreddy/nodeJS-socketIO-chat-app/524f38b1fa787f6ff67cb84da24e881006a69867/chat.gif
--------------------------------------------------------------------------------
/libs/chat.js:
--------------------------------------------------------------------------------
1 | const socketio = require("socket.io");
2 | const mongoose = require("mongoose");
3 | const events = require("events");
4 | const _ = require("lodash");
5 | const eventEmitter = new events.EventEmitter();
6 |
7 | //adding db models
8 | require("../app/models/user.js");
9 | require("../app/models/chat.js");
10 | require("../app/models/room.js");
11 |
12 | //using mongoose Schema models
13 | const userModel = mongoose.model("User");
14 | const chatModel = mongoose.model("Chat");
15 | const roomModel = mongoose.model("Room");
16 |
17 | //reatime magic begins here
18 | module.exports.sockets = function(http) {
19 | io = socketio.listen(http);
20 |
21 | //setting chat route
22 | const ioChat = io.of("/chat");
23 | const userStack = {};
24 | let oldChats, sendUserStack, setRoom;
25 | const userSocket = {};
26 |
27 | //socket.io magic starts here
28 | ioChat.on("connection", function(socket) {
29 | console.log("socketio chat connected.");
30 |
31 | //function to get user name
32 | socket.on("set-user-data", function(username) {
33 | console.log(username + " logged In");
34 |
35 | //storing variable.
36 | socket.username = username;
37 | userSocket[socket.username] = socket.id;
38 |
39 | socket.broadcast.emit("broadcast", {
40 | description: username + " Logged In"
41 | });
42 |
43 | //getting all users list
44 | eventEmitter.emit("get-all-users");
45 |
46 | //sending all users list. and setting if online or offline.
47 | sendUserStack = function() {
48 | for (i in userSocket) {
49 | for (j in userStack) {
50 | if (j == i) {
51 | userStack[j] = "Online";
52 | }
53 | }
54 | }
55 | //for popping connection message.
56 | ioChat.emit("onlineStack", userStack);
57 | }; //end of sendUserStack function.
58 | }); //end of set-user-data event.
59 |
60 | //setting room.
61 | socket.on("set-room", function(room) {
62 | //leaving room.
63 | socket.leave(socket.room);
64 | //getting room data.
65 | eventEmitter.emit("get-room-data", room);
66 | //setting room and join.
67 | setRoom = function(roomId) {
68 | socket.room = roomId;
69 | console.log("roomId : " + socket.room);
70 | socket.join(socket.room);
71 | ioChat.to(userSocket[socket.username]).emit("set-room", socket.room);
72 | };
73 | }); //end of set-room event.
74 |
75 | //emits event to read old-chats-init from database.
76 | socket.on("old-chats-init", function(data) {
77 | eventEmitter.emit("read-chat", data);
78 | });
79 |
80 | //emits event to read old chats from database.
81 | socket.on("old-chats", function(data) {
82 | eventEmitter.emit("read-chat", data);
83 | });
84 |
85 | //sending old chats to client.
86 | oldChats = function(result, username, room) {
87 | ioChat.to(userSocket[username]).emit("old-chats", {
88 | result: result,
89 | room: room
90 | });
91 | };
92 |
93 | //showing msg on typing.
94 | socket.on("typing", function() {
95 | socket
96 | .to(socket.room)
97 | .broadcast.emit("typing", socket.username + " : is typing...");
98 | });
99 |
100 | //for showing chats.
101 | socket.on("chat-msg", function(data) {
102 | //emits event to save chat to database.
103 | eventEmitter.emit("save-chat", {
104 | msgFrom: socket.username,
105 | msgTo: data.msgTo,
106 | msg: data.msg,
107 | room: socket.room,
108 | date: data.date
109 | });
110 | //emits event to send chat msg to all clients.
111 | ioChat.to(socket.room).emit("chat-msg", {
112 | msgFrom: socket.username,
113 | msg: data.msg,
114 | date: data.date
115 | });
116 | });
117 |
118 | //for popping disconnection message.
119 | socket.on("disconnect", function() {
120 | console.log(socket.username + " logged out");
121 | socket.broadcast.emit("broadcast", {
122 | description: socket.username + " Logged out"
123 | });
124 |
125 | console.log("chat disconnected.");
126 |
127 | _.unset(userSocket, socket.username);
128 | userStack[socket.username] = "Offline";
129 |
130 | ioChat.emit("onlineStack", userStack);
131 | }); //end of disconnect event.
132 | }); //end of io.on(connection).
133 | //end of socket.io code for chat feature.
134 |
135 | //database operations are kept outside of socket.io code.
136 | //saving chats to database.
137 | eventEmitter.on("save-chat", function(data) {
138 | // var today = Date.now();
139 |
140 | var newChat = new chatModel({
141 | msgFrom: data.msgFrom,
142 | msgTo: data.msgTo,
143 | msg: data.msg,
144 | room: data.room,
145 | createdOn: data.date
146 | });
147 |
148 | newChat.save(function(err, result) {
149 | if (err) {
150 | console.log("Error : " + err);
151 | } else if (result == undefined || result == null || result == "") {
152 | console.log("Chat Is Not Saved.");
153 | } else {
154 | console.log("Chat Saved.");
155 | //console.log(result);
156 | }
157 | });
158 | }); //end of saving chat.
159 |
160 | //reading chat from database.
161 | eventEmitter.on("read-chat", function(data) {
162 | chatModel
163 | .find({})
164 | .where("room")
165 | .equals(data.room)
166 | .sort("-createdOn")
167 | .skip(data.msgCount)
168 | .lean()
169 | .limit(5)
170 | .exec(function(err, result) {
171 | if (err) {
172 | console.log("Error : " + err);
173 | } else {
174 | //calling function which emits event to client to show chats.
175 | oldChats(result, data.username, data.room);
176 | }
177 | });
178 | }); //end of reading chat from database.
179 |
180 | //listening for get-all-users event. creating list of all users.
181 | eventEmitter.on("get-all-users", function() {
182 | userModel
183 | .find({})
184 | .select("username")
185 | .exec(function(err, result) {
186 | if (err) {
187 | console.log("Error : " + err);
188 | } else {
189 | //console.log(result);
190 | for (var i = 0; i < result.length; i++) {
191 | userStack[result[i].username] = "Offline";
192 | }
193 | //console.log("stack "+Object.keys(userStack));
194 | sendUserStack();
195 | }
196 | });
197 | }); //end of get-all-users event.
198 |
199 | //listening get-room-data event.
200 | eventEmitter.on("get-room-data", function(room) {
201 | roomModel.find(
202 | {
203 | $or: [
204 | {
205 | name1: room.name1
206 | },
207 | {
208 | name1: room.name2
209 | },
210 | {
211 | name2: room.name1
212 | },
213 | {
214 | name2: room.name2
215 | }
216 | ]
217 | },
218 | function(err, result) {
219 | if (err) {
220 | console.log("Error : " + err);
221 | } else {
222 | if (result == "" || result == undefined || result == null) {
223 | var today = Date.now();
224 |
225 | newRoom = new roomModel({
226 | name1: room.name1,
227 | name2: room.name2,
228 | lastActive: today,
229 | createdOn: today
230 | });
231 |
232 | newRoom.save(function(err, newResult) {
233 | if (err) {
234 | console.log("Error : " + err);
235 | } else if (
236 | newResult == "" ||
237 | newResult == undefined ||
238 | newResult == null
239 | ) {
240 | console.log("Some Error Occured During Room Creation.");
241 | } else {
242 | setRoom(newResult._id); //calling setRoom function.
243 | }
244 | }); //end of saving room.
245 | } else {
246 | var jresult = JSON.parse(JSON.stringify(result));
247 | setRoom(jresult[0]._id); //calling setRoom function.
248 | }
249 | } //end of else.
250 | }
251 | ); //end of find room.
252 | }); //end of get-room-data listener.
253 | //end of database operations for chat feature.
254 |
255 | //
256 | //
257 |
258 | //to verify for unique username and email at signup.
259 | //socket namespace for signup.
260 | const ioSignup = io.of("/signup");
261 |
262 | let checkUname, checkEmail; //declaring variables for function.
263 |
264 | ioSignup.on("connection", function(socket) {
265 | console.log("signup connected.");
266 |
267 | //verifying unique username.
268 | socket.on("checkUname", function(uname) {
269 | eventEmitter.emit("findUsername", uname); //event to perform database operation.
270 | }); //end of checkUname event.
271 |
272 | //function to emit event for checkUname.
273 | checkUname = function(data) {
274 | ioSignup.to(socket.id).emit("checkUname", data); //data can have only 1 or 0 value.
275 | }; //end of checkUsername function.
276 |
277 | //verifying unique email.
278 | socket.on("checkEmail", function(email) {
279 | eventEmitter.emit("findEmail", email); //event to perform database operation.
280 | }); //end of checkEmail event.
281 |
282 | //function to emit event for checkEmail.
283 | checkEmail = function(data) {
284 | ioSignup.to(socket.id).emit("checkEmail", data); //data can have only 1 or 0 value.
285 | }; //end of checkEmail function.
286 |
287 | //on disconnection.
288 | socket.on("disconnect", function() {
289 | console.log("signup disconnected.");
290 | });
291 | }); //end of ioSignup connection event.
292 |
293 | //database operations are kept outside of socket.io code.
294 | //event to find and check username.
295 | eventEmitter.on("findUsername", function(uname) {
296 | userModel.find(
297 | {
298 | username: uname
299 | },
300 | function(err, result) {
301 | if (err) {
302 | console.log("Error : " + err);
303 | } else {
304 | //console.log(result);
305 | if (result == "") {
306 | checkUname(1); //send 1 if username not found.
307 | } else {
308 | checkUname(0); //send 0 if username found.
309 | }
310 | }
311 | }
312 | );
313 | }); //end of findUsername event.
314 |
315 | //event to find and check username.
316 | eventEmitter.on("findEmail", function(email) {
317 | userModel.find(
318 | {
319 | email: email
320 | },
321 | function(err, result) {
322 | if (err) {
323 | console.log("Error : " + err);
324 | } else {
325 | //console.log(result);
326 | if (result == "") {
327 | checkEmail(1); //send 1 if email not found.
328 | } else {
329 | checkEmail(0); //send 0 if email found.
330 | }
331 | }
332 | }
333 | );
334 | }); //end of findUsername event.
335 |
336 | //
337 | //
338 |
339 | return io;
340 | };
341 |
--------------------------------------------------------------------------------
/libs/encrypt.js:
--------------------------------------------------------------------------------
1 | const crypto = require("crypto");
2 |
3 | module.exports.encryptPassword = function(password) {
4 | var hash = crypto
5 | .createHmac("sha256", password)
6 | .update("9743-980")
7 | .digest("hex");
8 | return hash;
9 | };
10 |
--------------------------------------------------------------------------------
/middlewares/auth.js:
--------------------------------------------------------------------------------
1 | const mongoose = require("mongoose");
2 |
3 | module.exports.checkLogin = function(req, res, next) {
4 | if (!req.user && !req.session.user) {
5 | res.redirect("/user/login");
6 | } else {
7 | next();
8 | }
9 | };
10 |
11 | module.exports.loggedIn = function(req, res, next) {
12 | if (!req.user && !req.session.user) {
13 | next();
14 | } else {
15 | res.redirect("/chat");
16 | }
17 | };
18 |
--------------------------------------------------------------------------------
/middlewares/validator.js:
--------------------------------------------------------------------------------
1 | //requiring dependencies.
2 | const mongoose = require("mongoose");
3 |
4 | const userModel = mongoose.model("User");
5 |
6 | //router level middleware for checking existing user.
7 | module.exports.emailExist = function(req, res, next) {
8 | userModel.findOne({ email: req.body.email }, function(err, result) {
9 | if (err) {
10 | res.render("message", {
11 | title: "Error",
12 | msg: "Some Error Occured During Email Checking.",
13 | status: 500,
14 | error: err,
15 | user: req.session.user
16 | });
17 | } else if (result) {
18 | res.render("message", {
19 | title: "Error",
20 | msg: "User Already Exist",
21 | status: 500,
22 | error: "",
23 | user: req.session.user
24 | });
25 | } else {
26 | next();
27 | }
28 | });
29 | };
30 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nodejs-socketio-chat-app",
3 | "version": "1.5.0",
4 | "description": "A Real Time Chat Application built using Node.js, Express, MongoDB, Socket.io.",
5 | "main": "app.js",
6 | "scripts": {
7 | "start": "node app.js",
8 | "test": "echo \"Error: no test specified\" && exit 1"
9 | },
10 | "repository": {
11 | "type": "git",
12 | "url": "git+https://github.com/vithalreddy/nodeJS-socketIO-chat.git"
13 | },
14 | "keywords": [
15 | "nodejs",
16 | "expressjs",
17 | "mongodb",
18 | "socket.io",
19 | "real-time",
20 | "chat-app"
21 | ],
22 | "author": "VithalReddy",
23 | "license": "MIT",
24 | "bugs": {
25 | "url": "https://github.com/vithalreddy/nodeJS-socketIO-chat/issues"
26 | },
27 | "homepage": "https://github.com/vithalreddy/nodeJS-socketIO-chat#readme",
28 | "dependencies": {
29 | "body-parser": "^1.17.2",
30 | "connect-mongo": "^3.0.0",
31 | "cookie-parser": "^1.4.3",
32 | "ejs": "^2.5.6",
33 | "express": "^4.15.3",
34 | "express-session": "^1.15.3",
35 | "lodash": "^4.17.4",
36 | "method-override": "^3.0.0",
37 | "mongoose": "^5.6.4",
38 | "morgan": "^1.8.1",
39 | "path": "^0.12.7",
40 | "shortid": "^2.2.8",
41 | "socket.io": "^2.0.1"
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/public/css/elegant-icons-style.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'ElegantIcons';
3 | src:url('../fonts/ElegantIcons.eot');
4 | src:url('../fonts/ElegantIcons.eot?#iefix') format('embedded-opentype'),
5 | url('../fonts/ElegantIcons.woff') format('woff'),
6 | url('../fonts/ElegantIcons.ttf') format('truetype'),
7 | url('../fonts/ElegantIcons.svg#ElegantIcons') format('svg');
8 | font-weight: normal;
9 | font-style: normal;
10 | }
11 |
12 | /* Use the following CSS code if you want to use data attributes for inserting your icons */
13 | [data-icon]:before {
14 | font-family: 'ElegantIcons';
15 | content: attr(data-icon);
16 | speak: none;
17 | font-weight: normal;
18 | font-variant: normal;
19 | text-transform: none;
20 | line-height: 1;
21 | -webkit-font-smoothing: antialiased;
22 | -moz-osx-font-smoothing: grayscale;
23 | }
24 |
25 | /* Use the following CSS code if you want to have a class per icon */
26 | /*
27 | Instead of a list of all class selectors,
28 | you can use the generic selector below, but it's slower:
29 | [class*="your-class-prefix"] {
30 | */
31 | .arrow_up, .arrow_down, .arrow_left, .arrow_right, .arrow_left-up, .arrow_right-up, .arrow_right-down, .arrow_left-down, .arrow-up-down, .arrow_up-down_alt, .arrow_left-right_alt, .arrow_left-right, .arrow_expand_alt2, .arrow_expand_alt, .arrow_condense, .arrow_expand, .arrow_move, .arrow_carrot-up, .arrow_carrot-down, .arrow_carrot-left, .arrow_carrot-right, .arrow_carrot-2up, .arrow_carrot-2down, .arrow_carrot-2left, .arrow_carrot-2right, .arrow_carrot-up_alt2, .arrow_carrot-down_alt2, .arrow_carrot-left_alt2, .arrow_carrot-right_alt2, .arrow_carrot-2up_alt2, .arrow_carrot-2down_alt2, .arrow_carrot-2left_alt2, .arrow_carrot-2right_alt2, .arrow_triangle-up, .arrow_triangle-down, .arrow_triangle-left, .arrow_triangle-right, .arrow_triangle-up_alt2, .arrow_triangle-down_alt2, .arrow_triangle-left_alt2, .arrow_triangle-right_alt2, .arrow_back, .icon_minus-06, .icon_plus, .icon_close, .icon_check, .icon_minus_alt2, .icon_plus_alt2, .icon_close_alt2, .icon_check_alt2, .icon_zoom-out_alt, .icon_zoom-in_alt, .icon_search, .icon_box-empty, .icon_box-selected, .icon_minus-box, .icon_plus-box, .icon_box-checked, .icon_circle-empty, .icon_circle-slelected, .icon_stop_alt2, .icon_stop, .icon_pause_alt2, .icon_pause, .icon_menu, .icon_menu-square_alt2, .icon_menu-circle_alt2, .icon_ul, .icon_ol, .icon_adjust-horiz, .icon_adjust-vert, .icon_document_alt, .icon_documents_alt, .icon_pencil, .icon_pencil-edit_alt, .icon_pencil-edit, .icon_folder-alt, .icon_folder-open_alt, .icon_folder-add_alt, .icon_info_alt, .icon_error-oct_alt, .icon_error-circle_alt, .icon_error-triangle_alt, .icon_question_alt2, .icon_question, .icon_comment_alt, .icon_chat_alt, .icon_vol-mute_alt, .icon_volume-low_alt, .icon_volume-high_alt, .icon_quotations, .icon_quotations_alt2, .icon_clock_alt, .icon_lock_alt, .icon_lock-open_alt, .icon_key_alt, .icon_cloud_alt, .icon_cloud-upload_alt, .icon_cloud-download_alt, .icon_image, .icon_images, .icon_lightbulb_alt, .icon_gift_alt, .icon_house_alt, .icon_genius, .icon_mobile, .icon_tablet, .icon_laptop, .icon_desktop, .icon_camera_alt, .icon_mail_alt, .icon_cone_alt, .icon_ribbon_alt, .icon_bag_alt, .icon_creditcard, .icon_cart_alt, .icon_paperclip, .icon_tag_alt, .icon_tags_alt, .icon_trash_alt, .icon_cursor_alt, .icon_mic_alt, .icon_compass_alt, .icon_pin_alt, .icon_pushpin_alt, .icon_map_alt, .icon_drawer_alt, .icon_toolbox_alt, .icon_book_alt, .icon_calendar, .icon_film, .icon_table, .icon_contacts_alt, .icon_headphones, .icon_lifesaver, .icon_piechart, .icon_refresh, .icon_link_alt, .icon_link, .icon_loading, .icon_blocked, .icon_archive_alt, .icon_heart_alt, .icon_star_alt, .icon_star-half_alt, .icon_star, .icon_star-half, .icon_tools, .icon_tool, .icon_cog, .icon_cogs, .arrow_up_alt, .arrow_down_alt, .arrow_left_alt, .arrow_right_alt, .arrow_left-up_alt, .arrow_right-up_alt, .arrow_right-down_alt, .arrow_left-down_alt, .arrow_condense_alt, .arrow_expand_alt3, .arrow_carrot_up_alt, .arrow_carrot-down_alt, .arrow_carrot-left_alt, .arrow_carrot-right_alt, .arrow_carrot-2up_alt, .arrow_carrot-2dwnn_alt, .arrow_carrot-2left_alt, .arrow_carrot-2right_alt, .arrow_triangle-up_alt, .arrow_triangle-down_alt, .arrow_triangle-left_alt, .arrow_triangle-right_alt, .icon_minus_alt, .icon_plus_alt, .icon_close_alt, .icon_check_alt, .icon_zoom-out, .icon_zoom-in, .icon_stop_alt, .icon_menu-square_alt, .icon_menu-circle_alt, .icon_document, .icon_documents, .icon_pencil_alt, .icon_folder, .icon_folder-open, .icon_folder-add, .icon_folder_upload, .icon_folder_download, .icon_info, .icon_error-circle, .icon_error-oct, .icon_error-triangle, .icon_question_alt, .icon_comment, .icon_chat, .icon_vol-mute, .icon_volume-low, .icon_volume-high, .icon_quotations_alt, .icon_clock, .icon_lock, .icon_lock-open, .icon_key, .icon_cloud, .icon_cloud-upload, .icon_cloud-download, .icon_lightbulb, .icon_gift, .icon_house, .icon_camera, .icon_mail, .icon_cone, .icon_ribbon, .icon_bag, .icon_cart, .icon_tag, .icon_tags, .icon_trash, .icon_cursor, .icon_mic, .icon_compass, .icon_pin, .icon_pushpin, .icon_map, .icon_drawer, .icon_toolbox, .icon_book, .icon_contacts, .icon_archive, .icon_heart, .icon_profile, .icon_group, .icon_grid-2x2, .icon_grid-3x3, .icon_music, .icon_pause_alt, .icon_phone, .icon_upload, .icon_download, .social_facebook, .social_twitter, .social_pinterest, .social_googleplus, .social_tumblr, .social_tumbleupon, .social_wordpress, .social_instagram, .social_dribbble, .social_vimeo, .social_linkedin, .social_rss, .social_deviantart, .social_share, .social_myspace, .social_skype, .social_youtube, .social_picassa, .social_googledrive, .social_flickr, .social_blogger, .social_spotify, .social_delicious, .social_facebook_circle, .social_twitter_circle, .social_pinterest_circle, .social_googleplus_circle, .social_tumblr_circle, .social_stumbleupon_circle, .social_wordpress_circle, .social_instagram_circle, .social_dribbble_circle, .social_vimeo_circle, .social_linkedin_circle, .social_rss_circle, .social_deviantart_circle, .social_share_circle, .social_myspace_circle, .social_skype_circle, .social_youtube_circle, .social_picassa_circle, .social_googledrive_alt2, .social_flickr_circle, .social_blogger_circle, .social_spotify_circle, .social_delicious_circle, .social_facebook_square, .social_twitter_square, .social_pinterest_square, .social_googleplus_square, .social_tumblr_square, .social_stumbleupon_square, .social_wordpress_square, .social_instagram_square, .social_dribbble_square, .social_vimeo_square, .social_linkedin_square, .social_rss_square, .social_deviantart_square, .social_share_square, .social_myspace_square, .social_skype_square, .social_youtube_square, .social_picassa_square, .social_googledrive_square, .social_flickr_square, .social_blogger_square, .social_spotify_square, .social_delicious_square, .icon_printer, .icon_calulator, .icon_building, .icon_floppy, .icon_drive, .icon_search-2, .icon_id, .icon_id-2, .icon_puzzle, .icon_like, .icon_dislike, .icon_mug, .icon_currency, .icon_wallet, .icon_pens, .icon_easel, .icon_flowchart, .icon_datareport, .icon_briefcase, .icon_shield, .icon_percent, .icon_globe, .icon_globe-2, .icon_target, .icon_hourglass, .icon_balance, .icon_rook, .icon_printer-alt, .icon_calculator_alt, .icon_building_alt, .icon_floppy_alt, .icon_drive_alt, .icon_search_alt, .icon_id_alt, .icon_id-2_alt, .icon_puzzle_alt, .icon_like_alt, .icon_dislike_alt, .icon_mug_alt, .icon_currency_alt, .icon_wallet_alt, .icon_pens_alt, .icon_easel_alt, .icon_flowchart_alt, .icon_datareport_alt, .icon_briefcase_alt, .icon_shield_alt, .icon_percent_alt, .icon_globe_alt, .icon_clipboard {
32 | font-family: 'ElegantIcons';
33 | speak: none;
34 | font-style: normal;
35 | font-weight: normal;
36 | font-variant: normal;
37 | text-transform: none;
38 | line-height: 1;
39 | -webkit-font-smoothing: antialiased;
40 | }
41 | .arrow_up:before {
42 | content: "\21";
43 | }
44 | .arrow_down:before {
45 | content: "\22";
46 | }
47 | .arrow_left:before {
48 | content: "\23";
49 | }
50 | .arrow_right:before {
51 | content: "\24";
52 | }
53 | .arrow_left-up:before {
54 | content: "\25";
55 | }
56 | .arrow_right-up:before {
57 | content: "\26";
58 | }
59 | .arrow_right-down:before {
60 | content: "\27";
61 | }
62 | .arrow_left-down:before {
63 | content: "\28";
64 | }
65 | .arrow-up-down:before {
66 | content: "\29";
67 | }
68 | .arrow_up-down_alt:before {
69 | content: "\2a";
70 | }
71 | .arrow_left-right_alt:before {
72 | content: "\2b";
73 | }
74 | .arrow_left-right:before {
75 | content: "\2c";
76 | }
77 | .arrow_expand_alt2:before {
78 | content: "\2d";
79 | }
80 | .arrow_expand_alt:before {
81 | content: "\2e";
82 | }
83 | .arrow_condense:before {
84 | content: "\2f";
85 | }
86 | .arrow_expand:before {
87 | content: "\30";
88 | }
89 | .arrow_move:before {
90 | content: "\31";
91 | }
92 | .arrow_carrot-up:before {
93 | content: "\32";
94 | }
95 | .arrow_carrot-down:before {
96 | content: "\33";
97 | }
98 | .arrow_carrot-left:before {
99 | content: "\34";
100 | }
101 | .arrow_carrot-right:before {
102 | content: "\35";
103 | }
104 | .arrow_carrot-2up:before {
105 | content: "\36";
106 | }
107 | .arrow_carrot-2down:before {
108 | content: "\37";
109 | }
110 | .arrow_carrot-2left:before {
111 | content: "\38";
112 | }
113 | .arrow_carrot-2right:before {
114 | content: "\39";
115 | }
116 | .arrow_carrot-up_alt2:before {
117 | content: "\3a";
118 | }
119 | .arrow_carrot-down_alt2:before {
120 | content: "\3b";
121 | }
122 | .arrow_carrot-left_alt2:before {
123 | content: "\3c";
124 | }
125 | .arrow_carrot-right_alt2:before {
126 | content: "\3d";
127 | }
128 | .arrow_carrot-2up_alt2:before {
129 | content: "\3e";
130 | }
131 | .arrow_carrot-2down_alt2:before {
132 | content: "\3f";
133 | }
134 | .arrow_carrot-2left_alt2:before {
135 | content: "\40";
136 | }
137 | .arrow_carrot-2right_alt2:before {
138 | content: "\41";
139 | }
140 | .arrow_triangle-up:before {
141 | content: "\42";
142 | }
143 | .arrow_triangle-down:before {
144 | content: "\43";
145 | }
146 | .arrow_triangle-left:before {
147 | content: "\44";
148 | }
149 | .arrow_triangle-right:before {
150 | content: "\45";
151 | }
152 | .arrow_triangle-up_alt2:before {
153 | content: "\46";
154 | }
155 | .arrow_triangle-down_alt2:before {
156 | content: "\47";
157 | }
158 | .arrow_triangle-left_alt2:before {
159 | content: "\48";
160 | }
161 | .arrow_triangle-right_alt2:before {
162 | content: "\49";
163 | }
164 | .arrow_back:before {
165 | content: "\4a";
166 | }
167 | .icon_minus-06:before {
168 | content: "\4b";
169 | }
170 | .icon_plus:before {
171 | content: "\4c";
172 | }
173 | .icon_close:before {
174 | content: "\4d";
175 | }
176 | .icon_check:before {
177 | content: "\4e";
178 | }
179 | .icon_minus_alt2:before {
180 | content: "\4f";
181 | }
182 | .icon_plus_alt2:before {
183 | content: "\50";
184 | }
185 | .icon_close_alt2:before {
186 | content: "\51";
187 | }
188 | .icon_check_alt2:before {
189 | content: "\52";
190 | }
191 | .icon_zoom-out_alt:before {
192 | content: "\53";
193 | }
194 | .icon_zoom-in_alt:before {
195 | content: "\54";
196 | }
197 | .icon_search:before {
198 | content: "\55";
199 | }
200 | .icon_box-empty:before {
201 | content: "\56";
202 | }
203 | .icon_box-selected:before {
204 | content: "\57";
205 | }
206 | .icon_minus-box:before {
207 | content: "\58";
208 | }
209 | .icon_plus-box:before {
210 | content: "\59";
211 | }
212 | .icon_box-checked:before {
213 | content: "\5a";
214 | }
215 | .icon_circle-empty:before {
216 | content: "\5b";
217 | }
218 | .icon_circle-slelected:before {
219 | content: "\5c";
220 | }
221 | .icon_stop_alt2:before {
222 | content: "\5d";
223 | }
224 | .icon_stop:before {
225 | content: "\5e";
226 | }
227 | .icon_pause_alt2:before {
228 | content: "\5f";
229 | }
230 | .icon_pause:before {
231 | content: "\60";
232 | }
233 | .icon_menu:before {
234 | content: "\61";
235 | }
236 | .icon_menu-square_alt2:before {
237 | content: "\62";
238 | }
239 | .icon_menu-circle_alt2:before {
240 | content: "\63";
241 | }
242 | .icon_ul:before {
243 | content: "\64";
244 | }
245 | .icon_ol:before {
246 | content: "\65";
247 | }
248 | .icon_adjust-horiz:before {
249 | content: "\66";
250 | }
251 | .icon_adjust-vert:before {
252 | content: "\67";
253 | }
254 | .icon_document_alt:before {
255 | content: "\68";
256 | }
257 | .icon_documents_alt:before {
258 | content: "\69";
259 | }
260 | .icon_pencil:before {
261 | content: "\6a";
262 | }
263 | .icon_pencil-edit_alt:before {
264 | content: "\6b";
265 | }
266 | .icon_pencil-edit:before {
267 | content: "\6c";
268 | }
269 | .icon_folder-alt:before {
270 | content: "\6d";
271 | }
272 | .icon_folder-open_alt:before {
273 | content: "\6e";
274 | }
275 | .icon_folder-add_alt:before {
276 | content: "\6f";
277 | }
278 | .icon_info_alt:before {
279 | content: "\70";
280 | }
281 | .icon_error-oct_alt:before {
282 | content: "\71";
283 | }
284 | .icon_error-circle_alt:before {
285 | content: "\72";
286 | }
287 | .icon_error-triangle_alt:before {
288 | content: "\73";
289 | }
290 | .icon_question_alt2:before {
291 | content: "\74";
292 | }
293 | .icon_question:before {
294 | content: "\75";
295 | }
296 | .icon_comment_alt:before {
297 | content: "\76";
298 | }
299 | .icon_chat_alt:before {
300 | content: "\77";
301 | }
302 | .icon_vol-mute_alt:before {
303 | content: "\78";
304 | }
305 | .icon_volume-low_alt:before {
306 | content: "\79";
307 | }
308 | .icon_volume-high_alt:before {
309 | content: "\7a";
310 | }
311 | .icon_quotations:before {
312 | content: "\7b";
313 | }
314 | .icon_quotations_alt2:before {
315 | content: "\7c";
316 | }
317 | .icon_clock_alt:before {
318 | content: "\7d";
319 | }
320 | .icon_lock_alt:before {
321 | content: "\7e";
322 | }
323 | .icon_lock-open_alt:before {
324 | content: "\e000";
325 | }
326 | .icon_key_alt:before {
327 | content: "\e001";
328 | }
329 | .icon_cloud_alt:before {
330 | content: "\e002";
331 | }
332 | .icon_cloud-upload_alt:before {
333 | content: "\e003";
334 | }
335 | .icon_cloud-download_alt:before {
336 | content: "\e004";
337 | }
338 | .icon_image:before {
339 | content: "\e005";
340 | }
341 | .icon_images:before {
342 | content: "\e006";
343 | }
344 | .icon_lightbulb_alt:before {
345 | content: "\e007";
346 | }
347 | .icon_gift_alt:before {
348 | content: "\e008";
349 | }
350 | .icon_house_alt:before {
351 | content: "\e009";
352 | }
353 | .icon_genius:before {
354 | content: "\e00a";
355 | }
356 | .icon_mobile:before {
357 | content: "\e00b";
358 | }
359 | .icon_tablet:before {
360 | content: "\e00c";
361 | }
362 | .icon_laptop:before {
363 | content: "\e00d";
364 | }
365 | .icon_desktop:before {
366 | content: "\e00e";
367 | }
368 | .icon_camera_alt:before {
369 | content: "\e00f";
370 | }
371 | .icon_mail_alt:before {
372 | content: "\e010";
373 | }
374 | .icon_cone_alt:before {
375 | content: "\e011";
376 | }
377 | .icon_ribbon_alt:before {
378 | content: "\e012";
379 | }
380 | .icon_bag_alt:before {
381 | content: "\e013";
382 | }
383 | .icon_creditcard:before {
384 | content: "\e014";
385 | }
386 | .icon_cart_alt:before {
387 | content: "\e015";
388 | }
389 | .icon_paperclip:before {
390 | content: "\e016";
391 | }
392 | .icon_tag_alt:before {
393 | content: "\e017";
394 | }
395 | .icon_tags_alt:before {
396 | content: "\e018";
397 | }
398 | .icon_trash_alt:before {
399 | content: "\e019";
400 | }
401 | .icon_cursor_alt:before {
402 | content: "\e01a";
403 | }
404 | .icon_mic_alt:before {
405 | content: "\e01b";
406 | }
407 | .icon_compass_alt:before {
408 | content: "\e01c";
409 | }
410 | .icon_pin_alt:before {
411 | content: "\e01d";
412 | }
413 | .icon_pushpin_alt:before {
414 | content: "\e01e";
415 | }
416 | .icon_map_alt:before {
417 | content: "\e01f";
418 | }
419 | .icon_drawer_alt:before {
420 | content: "\e020";
421 | }
422 | .icon_toolbox_alt:before {
423 | content: "\e021";
424 | }
425 | .icon_book_alt:before {
426 | content: "\e022";
427 | }
428 | .icon_calendar:before {
429 | content: "\e023";
430 | }
431 | .icon_film:before {
432 | content: "\e024";
433 | }
434 | .icon_table:before {
435 | content: "\e025";
436 | }
437 | .icon_contacts_alt:before {
438 | content: "\e026";
439 | }
440 | .icon_headphones:before {
441 | content: "\e027";
442 | }
443 | .icon_lifesaver:before {
444 | content: "\e028";
445 | }
446 | .icon_piechart:before {
447 | content: "\e029";
448 | }
449 | .icon_refresh:before {
450 | content: "\e02a";
451 | }
452 | .icon_link_alt:before {
453 | content: "\e02b";
454 | }
455 | .icon_link:before {
456 | content: "\e02c";
457 | }
458 | .icon_loading:before {
459 | content: "\e02d";
460 | }
461 | .icon_blocked:before {
462 | content: "\e02e";
463 | }
464 | .icon_archive_alt:before {
465 | content: "\e02f";
466 | }
467 | .icon_heart_alt:before {
468 | content: "\e030";
469 | }
470 | .icon_star_alt:before {
471 | content: "\e031";
472 | }
473 | .icon_star-half_alt:before {
474 | content: "\e032";
475 | }
476 | .icon_star:before {
477 | content: "\e033";
478 | }
479 | .icon_star-half:before {
480 | content: "\e034";
481 | }
482 | .icon_tools:before {
483 | content: "\e035";
484 | }
485 | .icon_tool:before {
486 | content: "\e036";
487 | }
488 | .icon_cog:before {
489 | content: "\e037";
490 | }
491 | .icon_cogs:before {
492 | content: "\e038";
493 | }
494 | .arrow_up_alt:before {
495 | content: "\e039";
496 | }
497 | .arrow_down_alt:before {
498 | content: "\e03a";
499 | }
500 | .arrow_left_alt:before {
501 | content: "\e03b";
502 | }
503 | .arrow_right_alt:before {
504 | content: "\e03c";
505 | }
506 | .arrow_left-up_alt:before {
507 | content: "\e03d";
508 | }
509 | .arrow_right-up_alt:before {
510 | content: "\e03e";
511 | }
512 | .arrow_right-down_alt:before {
513 | content: "\e03f";
514 | }
515 | .arrow_left-down_alt:before {
516 | content: "\e040";
517 | }
518 | .arrow_condense_alt:before {
519 | content: "\e041";
520 | }
521 | .arrow_expand_alt3:before {
522 | content: "\e042";
523 | }
524 | .arrow_carrot_up_alt:before {
525 | content: "\e043";
526 | }
527 | .arrow_carrot-down_alt:before {
528 | content: "\e044";
529 | }
530 | .arrow_carrot-left_alt:before {
531 | content: "\e045";
532 | }
533 | .arrow_carrot-right_alt:before {
534 | content: "\e046";
535 | }
536 | .arrow_carrot-2up_alt:before {
537 | content: "\e047";
538 | }
539 | .arrow_carrot-2dwnn_alt:before {
540 | content: "\e048";
541 | }
542 | .arrow_carrot-2left_alt:before {
543 | content: "\e049";
544 | }
545 | .arrow_carrot-2right_alt:before {
546 | content: "\e04a";
547 | }
548 | .arrow_triangle-up_alt:before {
549 | content: "\e04b";
550 | }
551 | .arrow_triangle-down_alt:before {
552 | content: "\e04c";
553 | }
554 | .arrow_triangle-left_alt:before {
555 | content: "\e04d";
556 | }
557 | .arrow_triangle-right_alt:before {
558 | content: "\e04e";
559 | }
560 | .icon_minus_alt:before {
561 | content: "\e04f";
562 | }
563 | .icon_plus_alt:before {
564 | content: "\e050";
565 | }
566 | .icon_close_alt:before {
567 | content: "\e051";
568 | }
569 | .icon_check_alt:before {
570 | content: "\e052";
571 | }
572 | .icon_zoom-out:before {
573 | content: "\e053";
574 | }
575 | .icon_zoom-in:before {
576 | content: "\e054";
577 | }
578 | .icon_stop_alt:before {
579 | content: "\e055";
580 | }
581 | .icon_menu-square_alt:before {
582 | content: "\e056";
583 | }
584 | .icon_menu-circle_alt:before {
585 | content: "\e057";
586 | }
587 | .icon_document:before {
588 | content: "\e058";
589 | }
590 | .icon_documents:before {
591 | content: "\e059";
592 | }
593 | .icon_pencil_alt:before {
594 | content: "\e05a";
595 | }
596 | .icon_folder:before {
597 | content: "\e05b";
598 | }
599 | .icon_folder-open:before {
600 | content: "\e05c";
601 | }
602 | .icon_folder-add:before {
603 | content: "\e05d";
604 | }
605 | .icon_folder_upload:before {
606 | content: "\e05e";
607 | }
608 | .icon_folder_download:before {
609 | content: "\e05f";
610 | }
611 | .icon_info:before {
612 | content: "\e060";
613 | }
614 | .icon_error-circle:before {
615 | content: "\e061";
616 | }
617 | .icon_error-oct:before {
618 | content: "\e062";
619 | }
620 | .icon_error-triangle:before {
621 | content: "\e063";
622 | }
623 | .icon_question_alt:before {
624 | content: "\e064";
625 | }
626 | .icon_comment:before {
627 | content: "\e065";
628 | }
629 | .icon_chat:before {
630 | content: "\e066";
631 | }
632 | .icon_vol-mute:before {
633 | content: "\e067";
634 | }
635 | .icon_volume-low:before {
636 | content: "\e068";
637 | }
638 | .icon_volume-high:before {
639 | content: "\e069";
640 | }
641 | .icon_quotations_alt:before {
642 | content: "\e06a";
643 | }
644 | .icon_clock:before {
645 | content: "\e06b";
646 | }
647 | .icon_lock:before {
648 | content: "\e06c";
649 | }
650 | .icon_lock-open:before {
651 | content: "\e06d";
652 | }
653 | .icon_key:before {
654 | content: "\e06e";
655 | }
656 | .icon_cloud:before {
657 | content: "\e06f";
658 | }
659 | .icon_cloud-upload:before {
660 | content: "\e070";
661 | }
662 | .icon_cloud-download:before {
663 | content: "\e071";
664 | }
665 | .icon_lightbulb:before {
666 | content: "\e072";
667 | }
668 | .icon_gift:before {
669 | content: "\e073";
670 | }
671 | .icon_house:before {
672 | content: "\e074";
673 | }
674 | .icon_camera:before {
675 | content: "\e075";
676 | }
677 | .icon_mail:before {
678 | content: "\e076";
679 | }
680 | .icon_cone:before {
681 | content: "\e077";
682 | }
683 | .icon_ribbon:before {
684 | content: "\e078";
685 | }
686 | .icon_bag:before {
687 | content: "\e079";
688 | }
689 | .icon_cart:before {
690 | content: "\e07a";
691 | }
692 | .icon_tag:before {
693 | content: "\e07b";
694 | }
695 | .icon_tags:before {
696 | content: "\e07c";
697 | }
698 | .icon_trash:before {
699 | content: "\e07d";
700 | }
701 | .icon_cursor:before {
702 | content: "\e07e";
703 | }
704 | .icon_mic:before {
705 | content: "\e07f";
706 | }
707 | .icon_compass:before {
708 | content: "\e080";
709 | }
710 | .icon_pin:before {
711 | content: "\e081";
712 | }
713 | .icon_pushpin:before {
714 | content: "\e082";
715 | }
716 | .icon_map:before {
717 | content: "\e083";
718 | }
719 | .icon_drawer:before {
720 | content: "\e084";
721 | }
722 | .icon_toolbox:before {
723 | content: "\e085";
724 | }
725 | .icon_book:before {
726 | content: "\e086";
727 | }
728 | .icon_contacts:before {
729 | content: "\e087";
730 | }
731 | .icon_archive:before {
732 | content: "\e088";
733 | }
734 | .icon_heart:before {
735 | content: "\e089";
736 | }
737 | .icon_profile:before {
738 | content: "\e08a";
739 | }
740 | .icon_group:before {
741 | content: "\e08b";
742 | }
743 | .icon_grid-2x2:before {
744 | content: "\e08c";
745 | }
746 | .icon_grid-3x3:before {
747 | content: "\e08d";
748 | }
749 | .icon_music:before {
750 | content: "\e08e";
751 | }
752 | .icon_pause_alt:before {
753 | content: "\e08f";
754 | }
755 | .icon_phone:before {
756 | content: "\e090";
757 | }
758 | .icon_upload:before {
759 | content: "\e091";
760 | }
761 | .icon_download:before {
762 | content: "\e092";
763 | }
764 | .social_facebook:before {
765 | content: "\e093";
766 | }
767 | .social_twitter:before {
768 | content: "\e094";
769 | }
770 | .social_pinterest:before {
771 | content: "\e095";
772 | }
773 | .social_googleplus:before {
774 | content: "\e096";
775 | }
776 | .social_tumblr:before {
777 | content: "\e097";
778 | }
779 | .social_tumbleupon:before {
780 | content: "\e098";
781 | }
782 | .social_wordpress:before {
783 | content: "\e099";
784 | }
785 | .social_instagram:before {
786 | content: "\e09a";
787 | }
788 | .social_dribbble:before {
789 | content: "\e09b";
790 | }
791 | .social_vimeo:before {
792 | content: "\e09c";
793 | }
794 | .social_linkedin:before {
795 | content: "\e09d";
796 | }
797 | .social_rss:before {
798 | content: "\e09e";
799 | }
800 | .social_deviantart:before {
801 | content: "\e09f";
802 | }
803 | .social_share:before {
804 | content: "\e0a0";
805 | }
806 | .social_myspace:before {
807 | content: "\e0a1";
808 | }
809 | .social_skype:before {
810 | content: "\e0a2";
811 | }
812 | .social_youtube:before {
813 | content: "\e0a3";
814 | }
815 | .social_picassa:before {
816 | content: "\e0a4";
817 | }
818 | .social_googledrive:before {
819 | content: "\e0a5";
820 | }
821 | .social_flickr:before {
822 | content: "\e0a6";
823 | }
824 | .social_blogger:before {
825 | content: "\e0a7";
826 | }
827 | .social_spotify:before {
828 | content: "\e0a8";
829 | }
830 | .social_delicious:before {
831 | content: "\e0a9";
832 | }
833 | .social_facebook_circle:before {
834 | content: "\e0aa";
835 | }
836 | .social_twitter_circle:before {
837 | content: "\e0ab";
838 | }
839 | .social_pinterest_circle:before {
840 | content: "\e0ac";
841 | }
842 | .social_googleplus_circle:before {
843 | content: "\e0ad";
844 | }
845 | .social_tumblr_circle:before {
846 | content: "\e0ae";
847 | }
848 | .social_stumbleupon_circle:before {
849 | content: "\e0af";
850 | }
851 | .social_wordpress_circle:before {
852 | content: "\e0b0";
853 | }
854 | .social_instagram_circle:before {
855 | content: "\e0b1";
856 | }
857 | .social_dribbble_circle:before {
858 | content: "\e0b2";
859 | }
860 | .social_vimeo_circle:before {
861 | content: "\e0b3";
862 | }
863 | .social_linkedin_circle:before {
864 | content: "\e0b4";
865 | }
866 | .social_rss_circle:before {
867 | content: "\e0b5";
868 | }
869 | .social_deviantart_circle:before {
870 | content: "\e0b6";
871 | }
872 | .social_share_circle:before {
873 | content: "\e0b7";
874 | }
875 | .social_myspace_circle:before {
876 | content: "\e0b8";
877 | }
878 | .social_skype_circle:before {
879 | content: "\e0b9";
880 | }
881 | .social_youtube_circle:before {
882 | content: "\e0ba";
883 | }
884 | .social_picassa_circle:before {
885 | content: "\e0bb";
886 | }
887 | .social_googledrive_alt2:before {
888 | content: "\e0bc";
889 | }
890 | .social_flickr_circle:before {
891 | content: "\e0bd";
892 | }
893 | .social_blogger_circle:before {
894 | content: "\e0be";
895 | }
896 | .social_spotify_circle:before {
897 | content: "\e0bf";
898 | }
899 | .social_delicious_circle:before {
900 | content: "\e0c0";
901 | }
902 | .social_facebook_square:before {
903 | content: "\e0c1";
904 | }
905 | .social_twitter_square:before {
906 | content: "\e0c2";
907 | }
908 | .social_pinterest_square:before {
909 | content: "\e0c3";
910 | }
911 | .social_googleplus_square:before {
912 | content: "\e0c4";
913 | }
914 | .social_tumblr_square:before {
915 | content: "\e0c5";
916 | }
917 | .social_stumbleupon_square:before {
918 | content: "\e0c6";
919 | }
920 | .social_wordpress_square:before {
921 | content: "\e0c7";
922 | }
923 | .social_instagram_square:before {
924 | content: "\e0c8";
925 | }
926 | .social_dribbble_square:before {
927 | content: "\e0c9";
928 | }
929 | .social_vimeo_square:before {
930 | content: "\e0ca";
931 | }
932 | .social_linkedin_square:before {
933 | content: "\e0cb";
934 | }
935 | .social_rss_square:before {
936 | content: "\e0cc";
937 | }
938 | .social_deviantart_square:before {
939 | content: "\e0cd";
940 | }
941 | .social_share_square:before {
942 | content: "\e0ce";
943 | }
944 | .social_myspace_square:before {
945 | content: "\e0cf";
946 | }
947 | .social_skype_square:before {
948 | content: "\e0d0";
949 | }
950 | .social_youtube_square:before {
951 | content: "\e0d1";
952 | }
953 | .social_picassa_square:before {
954 | content: "\e0d2";
955 | }
956 | .social_googledrive_square:before {
957 | content: "\e0d3";
958 | }
959 | .social_flickr_square:before {
960 | content: "\e0d4";
961 | }
962 | .social_blogger_square:before {
963 | content: "\e0d5";
964 | }
965 | .social_spotify_square:before {
966 | content: "\e0d6";
967 | }
968 | .social_delicious_square:before {
969 | content: "\e0d7";
970 | }
971 | .icon_printer:before {
972 | content: "\e103";
973 | }
974 | .icon_calulator:before {
975 | content: "\e0ee";
976 | }
977 | .icon_building:before {
978 | content: "\e0ef";
979 | }
980 | .icon_floppy:before {
981 | content: "\e0e8";
982 | }
983 | .icon_drive:before {
984 | content: "\e0ea";
985 | }
986 | .icon_search-2:before {
987 | content: "\e101";
988 | }
989 | .icon_id:before {
990 | content: "\e107";
991 | }
992 | .icon_id-2:before {
993 | content: "\e108";
994 | }
995 | .icon_puzzle:before {
996 | content: "\e102";
997 | }
998 | .icon_like:before {
999 | content: "\e106";
1000 | }
1001 | .icon_dislike:before {
1002 | content: "\e0eb";
1003 | }
1004 | .icon_mug:before {
1005 | content: "\e105";
1006 | }
1007 | .icon_currency:before {
1008 | content: "\e0ed";
1009 | }
1010 | .icon_wallet:before {
1011 | content: "\e100";
1012 | }
1013 | .icon_pens:before {
1014 | content: "\e104";
1015 | }
1016 | .icon_easel:before {
1017 | content: "\e0e9";
1018 | }
1019 | .icon_flowchart:before {
1020 | content: "\e109";
1021 | }
1022 | .icon_datareport:before {
1023 | content: "\e0ec";
1024 | }
1025 | .icon_briefcase:before {
1026 | content: "\e0fe";
1027 | }
1028 | .icon_shield:before {
1029 | content: "\e0f6";
1030 | }
1031 | .icon_percent:before {
1032 | content: "\e0fb";
1033 | }
1034 | .icon_globe:before {
1035 | content: "\e0e2";
1036 | }
1037 | .icon_globe-2:before {
1038 | content: "\e0e3";
1039 | }
1040 | .icon_target:before {
1041 | content: "\e0f5";
1042 | }
1043 | .icon_hourglass:before {
1044 | content: "\e0e1";
1045 | }
1046 | .icon_balance:before {
1047 | content: "\e0ff";
1048 | }
1049 | .icon_rook:before {
1050 | content: "\e0f8";
1051 | }
1052 | .icon_printer-alt:before {
1053 | content: "\e0fa";
1054 | }
1055 | .icon_calculator_alt:before {
1056 | content: "\e0e7";
1057 | }
1058 | .icon_building_alt:before {
1059 | content: "\e0fd";
1060 | }
1061 | .icon_floppy_alt:before {
1062 | content: "\e0e4";
1063 | }
1064 | .icon_drive_alt:before {
1065 | content: "\e0e5";
1066 | }
1067 | .icon_search_alt:before {
1068 | content: "\e0f7";
1069 | }
1070 | .icon_id_alt:before {
1071 | content: "\e0e0";
1072 | }
1073 | .icon_id-2_alt:before {
1074 | content: "\e0fc";
1075 | }
1076 | .icon_puzzle_alt:before {
1077 | content: "\e0f9";
1078 | }
1079 | .icon_like_alt:before {
1080 | content: "\e0dd";
1081 | }
1082 | .icon_dislike_alt:before {
1083 | content: "\e0f1";
1084 | }
1085 | .icon_mug_alt:before {
1086 | content: "\e0dc";
1087 | }
1088 | .icon_currency_alt:before {
1089 | content: "\e0f3";
1090 | }
1091 | .icon_wallet_alt:before {
1092 | content: "\e0d8";
1093 | }
1094 | .icon_pens_alt:before {
1095 | content: "\e0db";
1096 | }
1097 | .icon_easel_alt:before {
1098 | content: "\e0f0";
1099 | }
1100 | .icon_flowchart_alt:before {
1101 | content: "\e0df";
1102 | }
1103 | .icon_datareport_alt:before {
1104 | content: "\e0f2";
1105 | }
1106 | .icon_briefcase_alt:before {
1107 | content: "\e0f4";
1108 | }
1109 | .icon_shield_alt:before {
1110 | content: "\e0d9";
1111 | }
1112 | .icon_percent_alt:before {
1113 | content: "\e0da";
1114 | }
1115 | .icon_globe_alt:before {
1116 | content: "\e0de";
1117 | }
1118 | .icon_clipboard:before {
1119 | content: "\e0e6";
1120 | }
1121 |
1122 |
1123 | .glyph {
1124 | float: left;
1125 | text-align: center;
1126 | padding: .75em;
1127 | margin: .4em 1.5em .75em 0;
1128 | width: 6em;
1129 | text-shadow: none;
1130 | }
1131 | .glyph_big {
1132 | font-size: 128px;
1133 | color: #59c5dc;
1134 | float: left;
1135 | margin-right: 20px;
1136 | }
1137 |
1138 | .glyph div { padding-bottom: 10px;}
1139 |
1140 | .glyph input {
1141 | font-family: consolas, monospace;
1142 | font-size: 12px;
1143 | width: 100%;
1144 | text-align: center;
1145 | border: 0;
1146 | box-shadow: 0 0 0 1px #ccc;
1147 | padding: .2em;
1148 | -moz-border-radius: 5px;
1149 | -webkit-border-radius: 5px;
1150 | }
1151 | .centered {
1152 | margin-left: auto;
1153 | margin-right: auto;
1154 | }
1155 | .glyph .fs1 {
1156 | font-size: 2em;
1157 | }
1158 |
1159 |
1160 |
--------------------------------------------------------------------------------
/public/css/style.css:
--------------------------------------------------------------------------------
1 | body{
2 | background-color: #ffffff;
3 | color: #000000;
4 | font-size: 16px;
5 | text-align: center;
6 | align-items: center;
7 | background-image: url('../pics/mean-bg.jpg');
8 | /*background-attachment: fixed;*/
9 | /*background-position: center;*/
10 | }
11 | .badge{
12 | background-color: cyan;
13 | }
14 | #ubtn{
15 | margin-bottom: 10px;
16 | }
17 |
18 | .footer {
19 | background-color: #292c2f;
20 | box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12);
21 | box-sizing: border-box;
22 | width: 100%;
23 | text-align: center;
24 | font: normal 18px sans-serif;
25 | padding: 45px;
26 | margin-top: 50px;
27 | border-top: 5px solid red;
28 | }
29 |
30 | .footer .footer-motto {
31 | color: #8d9093;
32 | font-size: 24px;
33 | margin: 0;
34 | }
35 |
36 | .footer .footer-name {
37 | color: cyan;
38 | font-size: 14px;
39 | margin: 0;
40 | }
41 |
42 | .footer .footer-links {
43 | list-style: none;
44 | font-weight: bold;
45 | color: cyan;
46 | padding: 35px 0 23px;
47 | margin: 0;
48 | }
49 |
50 | .footer .footer-links a {
51 | display: inline-block;
52 | text-decoration: none;
53 | color: inherit;
54 | }
55 |
56 | .panel-primary{
57 | box-shadow: 0 0 30px red;
58 | }
59 | .panel-primary:hover{
60 | box-shadow: 0 0 30px green;
61 | }
62 |
63 |
64 | .login-screen{
65 | background-color: #cccccc;
66 |
67 | }
68 |
69 | .login-box{
70 | margin: auto;
71 | margin-top: 3%;
72 | width: 50%;
73 | border: 2px solid cyan;
74 | border-radius: 10px;
75 | background-color: #19B5FE;
76 | }
77 |
78 |
79 | .login-form,
80 | .product-form{
81 | width: 90%;
82 | margin: auto;
83 | margin-bottom: 10px;
84 | }
85 |
86 | .input-block{
87 | margin: auto;
88 | margin-bottom: 15px;
89 | }
90 |
91 | .input-block p{
92 | text-align: center;
93 | font-weight: bold;
94 | }
95 |
96 | .input-icon{
97 | position: relative;
98 | font-size: 16px;
99 | height: auto;
100 | padding: 10px;
101 | color: #8b9199;
102 | background-color: #ffffff;
103 | }
104 |
105 | .input-box{
106 | position: relative;
107 | font-size: 16px;
108 | height: auto;
109 | padding: 10px;
110 | width: 75%;
111 | border: 0;
112 | background-color: #ffffff;
113 | box-shadow: none;
114 | }
115 |
116 | .boxF{
117 | display: inline-block;
118 | margin: 5px;
119 | border: 2px solid cyan;
120 | font-weight: bold;
121 | }
122 | .boxF:hover{
123 | border: 2px dotted red;
124 | }
125 | .boxN{
126 | padding: 15px;
127 | display: inline-block;
128 | margin: 5px;
129 | border: 2px solid cyan;
130 | font-weight: bold;
131 | background-color: #31B0D5;
132 | color: white;
133 |
134 | }
135 | .boxN:hover {
136 | border: 2px dotted red;
137 |
138 | }
139 | .boxFl{
140 | display: block;
141 | margin: 5px;
142 | border: 2px solid cyan;
143 | font-weight: bold;
144 | text-align: left;
145 | padding: 5px;
146 | }
147 | p{
148 | font-weight: bold;
149 | }
150 |
151 |
152 |
153 | /*styling of chat panel body*/
154 | #scrl1,
155 | #scrl2{
156 | height: 400px;
157 | overflow-y: auto;
158 | }
159 |
160 | #loading,
161 | #noChat,
162 | #chatForm{
163 | display: none;
164 | }
165 |
166 | .input-box-send{
167 | position: relative;
168 | font-size: 16px;
169 | height: auto;
170 | padding: 10px;
171 | width: 75%;
172 | border: 1px solid #000000;
173 | background-color: #ffffff;
174 | box-shadow: none;
175 | }
176 |
177 |
178 | #messages,
179 | #list{
180 | list-style-type: none;
181 | margin: 0;
182 | padding: 0;
183 | margin-bottom: 50px;
184 | }
185 | #messages li,
186 | #list li{
187 | text-align: left;
188 | width: auto;
189 | background: #eee;
190 | padding: 5px 15px;
191 | margin: 10px;
192 | border-radius: 5px;
193 | }
194 |
195 | /*styling for error id tag*/
196 | #error1,
197 | #error2{
198 | color: #e60000;
199 | text-align: center;
200 | margin-top: 10px;
201 | margin-bottom: 5px;
202 | }
203 |
204 | #irf,
205 | #ik,#ik1,#ik2,
206 | #ir,#ir1,#ir2{
207 | display: none;
208 | font-size: 20px;
209 | margin-left: 10px;
210 | }
211 |
212 | #ik,#ik1,#ik2{color: #009900;}
213 | #ir,#ir1,#ir2{color: #e60000;}
214 |
215 | #hell0{
216 | display: block;
217 | background-color: #31B0D5;
218 | color: white;
219 | margin-left: 20%;
220 | margin-right: 20%;
221 | max-height: 100px;
222 | overflow-y:auto;
223 |
224 | }
225 |
--------------------------------------------------------------------------------
/public/fonts/ElegantIcons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vithalreddy/nodeJS-socketIO-chat-app/524f38b1fa787f6ff67cb84da24e881006a69867/public/fonts/ElegantIcons.eot
--------------------------------------------------------------------------------
/public/fonts/ElegantIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vithalreddy/nodeJS-socketIO-chat-app/524f38b1fa787f6ff67cb84da24e881006a69867/public/fonts/ElegantIcons.ttf
--------------------------------------------------------------------------------
/public/fonts/ElegantIcons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vithalreddy/nodeJS-socketIO-chat-app/524f38b1fa787f6ff67cb84da24e881006a69867/public/fonts/ElegantIcons.woff
--------------------------------------------------------------------------------
/public/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vithalreddy/nodeJS-socketIO-chat-app/524f38b1fa787f6ff67cb84da24e881006a69867/public/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/public/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vithalreddy/nodeJS-socketIO-chat-app/524f38b1fa787f6ff67cb84da24e881006a69867/public/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/public/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vithalreddy/nodeJS-socketIO-chat-app/524f38b1fa787f6ff67cb84da24e881006a69867/public/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/public/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vithalreddy/nodeJS-socketIO-chat-app/524f38b1fa787f6ff67cb84da24e881006a69867/public/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/public/js/bootstrap.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap v3.3.7 (http://getbootstrap.com)
3 | * Copyright 2011-2016 Twitter, Inc.
4 | * Licensed under the MIT license
5 | */
6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
--------------------------------------------------------------------------------
/public/js/moment.min.js:
--------------------------------------------------------------------------------
1 | //! moment.js
2 | //! version : 2.18.1
3 | //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
4 | //! license : MIT
5 | //! momentjs.com
6 | !function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return sd.apply(null,arguments)}function b(a){sd=a}function c(a){return a instanceof Array||"[object Array]"===Object.prototype.toString.call(a)}function d(a){return null!=a&&"[object Object]"===Object.prototype.toString.call(a)}function e(a){var b;for(b in a)return!1;return!0}function f(a){return void 0===a}function g(a){return"number"==typeof a||"[object Number]"===Object.prototype.toString.call(a)}function h(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function i(a,b){var c,d=[];for(c=0;c0)for(c=0;c0?"future":"past"];return z(c)?c(b):c.replace(/%s/i,b)}function J(a,b){var c=a.toLowerCase();Hd[c]=Hd[c+"s"]=Hd[b]=a}function K(a){return"string"==typeof a?Hd[a]||Hd[a.toLowerCase()]:void 0}function L(a){var b,c,d={};for(c in a)j(a,c)&&(b=K(c),b&&(d[b]=a[c]));return d}function M(a,b){Id[a]=b}function N(a){var b=[];for(var c in a)b.push({unit:c,priority:Id[c]});return b.sort(function(a,b){return a.priority-b.priority}),b}function O(b,c){return function(d){return null!=d?(Q(this,b,d),a.updateOffset(this,c),this):P(this,b)}}function P(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function Q(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function R(a){return a=K(a),z(this[a])?this[a]():this}function S(a,b){if("object"==typeof a){a=L(a);for(var c=N(a),d=0;d=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function U(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Md[a]=e),b&&(Md[b[0]]=function(){return T(e.apply(this,arguments),b[1],b[2])}),c&&(Md[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function V(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function W(a){var b,c,d=a.match(Jd);for(b=0,c=d.length;b=0&&Kd.test(a);)a=a.replace(Kd,c),Kd.lastIndex=0,d-=1;return a}function Z(a,b,c){ce[a]=z(b)?b:function(a,d){return a&&c?c:b}}function $(a,b){return j(ce,a)?ce[a](b._strict,b._locale):new RegExp(_(a))}function _(a){return aa(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function aa(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ba(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),g(b)&&(d=function(a,c){c[b]=u(a)}),c=0;c=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function ta(a){var b=new Date(Date.UTC.apply(null,arguments));return a<100&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function ua(a,b,c){var d=7+b-c,e=(7+ta(a,0,d).getUTCDay()-b)%7;return-e+d-1}function va(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=ua(a,d,e),j=1+7*(b-1)+h+i;return j<=0?(f=a-1,g=pa(f)+j):j>pa(a)?(f=a+1,g=j-pa(a)):(f=a,g=j),{year:f,dayOfYear:g}}function wa(a,b,c){var d,e,f=ua(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return g<1?(e=a.year()-1,d=g+xa(e,b,c)):g>xa(a.year(),b,c)?(d=g-xa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function xa(a,b,c){var d=ua(a,b,c),e=ua(a+1,b,c);return(pa(a)-d+e)/7}function ya(a){return wa(a,this._week.dow,this._week.doy).week}function za(){return this._week.dow}function Aa(){return this._week.doy}function Ba(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function Ca(a){var b=wa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function Da(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Ea(a,b){return"string"==typeof a?b.weekdaysParse(a)%7||7:isNaN(a)?null:a}function Fa(a,b){return a?c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]:c(this._weekdays)?this._weekdays:this._weekdays.standalone}function Ga(a){return a?this._weekdaysShort[a.day()]:this._weekdaysShort}function Ha(a){return a?this._weekdaysMin[a.day()]:this._weekdaysMin}function Ia(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;d<7;++d)f=l([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(f,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(f,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(f,"").toLocaleLowerCase();return c?"dddd"===b?(e=ne.call(this._weekdaysParse,g),e!==-1?e:null):"ddd"===b?(e=ne.call(this._shortWeekdaysParse,g),e!==-1?e:null):(e=ne.call(this._minWeekdaysParse,g),e!==-1?e:null):"dddd"===b?(e=ne.call(this._weekdaysParse,g),e!==-1?e:(e=ne.call(this._shortWeekdaysParse,g),e!==-1?e:(e=ne.call(this._minWeekdaysParse,g),e!==-1?e:null))):"ddd"===b?(e=ne.call(this._shortWeekdaysParse,g),e!==-1?e:(e=ne.call(this._weekdaysParse,g),e!==-1?e:(e=ne.call(this._minWeekdaysParse,g),e!==-1?e:null))):(e=ne.call(this._minWeekdaysParse,g),e!==-1?e:(e=ne.call(this._weekdaysParse,g),e!==-1?e:(e=ne.call(this._shortWeekdaysParse,g),e!==-1?e:null)))}function Ja(a,b,c){var d,e,f;if(this._weekdaysParseExact)return Ia.call(this,a,b,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;d<7;d++){if(e=l([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function Ka(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Da(a,this.localeData()),this.add(a-b,"d")):b}function La(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Ma(a){if(!this.isValid())return null!=a?this:NaN;if(null!=a){var b=Ea(a,this.localeData());return this.day(this.day()%7?b:b-7)}return this.day()||7}function Na(a){return this._weekdaysParseExact?(j(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysStrictRegex:this._weekdaysRegex):(j(this,"_weekdaysRegex")||(this._weekdaysRegex=ye),this._weekdaysStrictRegex&&a?this._weekdaysStrictRegex:this._weekdaysRegex)}function Oa(a){return this._weekdaysParseExact?(j(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(j(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ze),this._weekdaysShortStrictRegex&&a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Pa(a){return this._weekdaysParseExact?(j(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(j(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ae),this._weekdaysMinStrictRegex&&a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Qa(){function a(a,b){return b.length-a.length}var b,c,d,e,f,g=[],h=[],i=[],j=[];for(b=0;b<7;b++)c=l([2e3,1]).day(b),d=this.weekdaysMin(c,""),e=this.weekdaysShort(c,""),f=this.weekdays(c,""),g.push(d),h.push(e),i.push(f),j.push(d),j.push(e),j.push(f);for(g.sort(a),h.sort(a),i.sort(a),j.sort(a),b=0;b<7;b++)h[b]=aa(h[b]),i[b]=aa(i[b]),j[b]=aa(j[b]);this._weekdaysRegex=new RegExp("^("+j.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")}function Ra(){return this.hours()%12||12}function Sa(){return this.hours()||24}function Ta(a,b){U(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function Ua(a,b){return b._meridiemParse}function Va(a){return"p"===(a+"").toLowerCase().charAt(0)}function Wa(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Xa(a){return a?a.toLowerCase().replace("_","-"):a}function Ya(a){for(var b,c,d,e,f=0;f0;){if(d=Za(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)break;b--}f++}return null}function Za(a){var b=null;if(!Fe[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Be._abbr,require("./locale/"+a),$a(b)}catch(a){}return Fe[a]}function $a(a,b){var c;return a&&(c=f(b)?bb(a):_a(a,b),c&&(Be=c)),Be._abbr}function _a(a,b){if(null!==b){var c=Ee;if(b.abbr=a,null!=Fe[a])y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),c=Fe[a]._config;else if(null!=b.parentLocale){if(null==Fe[b.parentLocale])return Ge[b.parentLocale]||(Ge[b.parentLocale]=[]),Ge[b.parentLocale].push({name:a,config:b}),null;c=Fe[b.parentLocale]._config}return Fe[a]=new C(B(c,b)),Ge[a]&&Ge[a].forEach(function(a){_a(a.name,a.config)}),$a(a),Fe[a]}return delete Fe[a],null}function ab(a,b){if(null!=b){var c,d=Ee;null!=Fe[a]&&(d=Fe[a]._config),b=B(d,b),c=new C(b),c.parentLocale=Fe[a],Fe[a]=c,$a(a)}else null!=Fe[a]&&(null!=Fe[a].parentLocale?Fe[a]=Fe[a].parentLocale:null!=Fe[a]&&delete Fe[a]);return Fe[a]}function bb(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Be;if(!c(a)){if(b=Za(a))return b;a=[a]}return Ya(a)}function cb(){return Ad(Fe)}function db(a){var b,c=a._a;return c&&n(a).overflow===-2&&(b=c[fe]<0||c[fe]>11?fe:c[ge]<1||c[ge]>ea(c[ee],c[fe])?ge:c[he]<0||c[he]>24||24===c[he]&&(0!==c[ie]||0!==c[je]||0!==c[ke])?he:c[ie]<0||c[ie]>59?ie:c[je]<0||c[je]>59?je:c[ke]<0||c[ke]>999?ke:-1,n(a)._overflowDayOfYear&&(bge)&&(b=ge),n(a)._overflowWeeks&&b===-1&&(b=le),n(a)._overflowWeekday&&b===-1&&(b=me),n(a).overflow=b),a}function eb(a){var b,c,d,e,f,g,h=a._i,i=He.exec(h)||Ie.exec(h);if(i){for(n(a).iso=!0,b=0,c=Ke.length;b10?"YYYY ":"YY "),f="HH:mm"+(c[4]?":ss":""),c[1]){var l=new Date(c[2]),m=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][l.getDay()];if(c[1].substr(0,3)!==m)return n(a).weekdayMismatch=!0,void(a._isValid=!1)}switch(c[5].length){case 2:0===i?h=" +0000":(i=k.indexOf(c[5][1].toUpperCase())-12,h=(i<0?" -":" +")+(""+i).replace(/^-?/,"0").match(/..$/)[0]+"00");break;case 4:h=j[c[5]];break;default:h=j[" GMT"]}c[5]=h,a._i=c.splice(1).join(""),g=" ZZ",a._f=d+e+f+g,lb(a),n(a).rfc2822=!0}else a._isValid=!1}function gb(b){var c=Me.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,fb(b),b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b)))))}function hb(a,b,c){return null!=a?a:null!=b?b:c}function ib(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function jb(a){var b,c,d,e,f=[];if(!a._d){for(d=ib(a),a._w&&null==a._a[ge]&&null==a._a[fe]&&kb(a),null!=a._dayOfYear&&(e=hb(a._a[ee],d[ee]),(a._dayOfYear>pa(e)||0===a._dayOfYear)&&(n(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[fe]=c.getUTCMonth(),a._a[ge]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[he]&&0===a._a[ie]&&0===a._a[je]&&0===a._a[ke]&&(a._nextDay=!0,a._a[he]=0),a._d=(a._useUTC?ta:sa).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[he]=24)}}function kb(a){var b,c,d,e,f,g,h,i;if(b=a._w,null!=b.GG||null!=b.W||null!=b.E)f=1,g=4,c=hb(b.GG,a._a[ee],wa(tb(),1,4).year),d=hb(b.W,1),e=hb(b.E,1),(e<1||e>7)&&(i=!0);else{f=a._locale._week.dow,g=a._locale._week.doy;var j=wa(tb(),f,g);c=hb(b.gg,a._a[ee],j.year),d=hb(b.w,j.week),null!=b.d?(e=b.d,(e<0||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f}d<1||d>xa(c,f,g)?n(a)._overflowWeeks=!0:null!=i?n(a)._overflowWeekday=!0:(h=va(c,d,e,f,g),a._a[ee]=h.year,a._dayOfYear=h.dayOfYear)}function lb(b){if(b._f===a.ISO_8601)return void eb(b);if(b._f===a.RFC_2822)return void fb(b);b._a=[],n(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,j=0;for(e=Y(b._f,b._locale).match(Jd)||[],c=0;c0&&n(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length),Md[f]?(d?n(b).empty=!1:n(b).unusedTokens.push(f),da(f,d,b)):b._strict&&!d&&n(b).unusedTokens.push(f);n(b).charsLeftOver=i-j,h.length>0&&n(b).unusedInput.push(h),b._a[he]<=12&&n(b).bigHour===!0&&b._a[he]>0&&(n(b).bigHour=void 0),n(b).parsedDateParts=b._a.slice(0),n(b).meridiem=b._meridiem,b._a[he]=mb(b._locale,b._a[he],b._meridiem),jb(b),db(b)}function mb(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&b<12&&(b+=12),d||12!==b||(b=0),b):b}function nb(a){var b,c,d,e,f;if(0===a._f.length)return n(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ethis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ob(){if(!f(this._isDSTShifted))return this._isDSTShifted;var a={};if(q(a,this),a=qb(a),a._a){var b=a._isUTC?l(a._a):tb(a._a);this._isDSTShifted=this.isValid()&&v(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Pb(){return!!this.isValid()&&!this._isUTC}function Qb(){return!!this.isValid()&&this._isUTC}function Rb(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Sb(a,b){var c,d,e,f=a,h=null;return Bb(a)?f={ms:a._milliseconds,d:a._days,M:a._months}:g(a)?(f={},b?f[b]=a:f.milliseconds=a):(h=Te.exec(a))?(c="-"===h[1]?-1:1,f={y:0,d:u(h[ge])*c,h:u(h[he])*c,m:u(h[ie])*c,s:u(h[je])*c,ms:u(Cb(1e3*h[ke]))*c}):(h=Ue.exec(a))?(c="-"===h[1]?-1:1,f={y:Tb(h[2],c),M:Tb(h[3],c),w:Tb(h[4],c),d:Tb(h[5],c),h:Tb(h[6],c),m:Tb(h[7],c),s:Tb(h[8],c)}):null==f?f={}:"object"==typeof f&&("from"in f||"to"in f)&&(e=Vb(tb(f.from),tb(f.to)),f={},f.ms=e.milliseconds,f.M=e.months),d=new Ab(f),Bb(a)&&j(a,"_locale")&&(d._locale=a._locale),d}function Tb(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function Ub(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function Vb(a,b){var c;return a.isValid()&&b.isValid()?(b=Fb(b,a),a.isBefore(b)?c=Ub(a,b):(c=Ub(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function Wb(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(y(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Sb(c,d),Xb(this,e,a),this}}function Xb(b,c,d,e){var f=c._milliseconds,g=Cb(c._days),h=Cb(c._months);b.isValid()&&(e=null==e||e,f&&b._d.setTime(b._d.valueOf()+f*d),g&&Q(b,"Date",P(b,"Date")+g*d),h&&ja(b,P(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function Yb(a,b){var c=a.diff(b,"days",!0);return c<-6?"sameElse":c<-1?"lastWeek":c<0?"lastDay":c<1?"sameDay":c<2?"nextDay":c<7?"nextWeek":"sameElse"}function Zb(b,c){var d=b||tb(),e=Fb(d,this).startOf("day"),f=a.calendarFormat(this,e)||"sameElse",g=c&&(z(c[f])?c[f].call(this,d):c[f]);return this.format(g||this.localeData().calendar(f,this,tb(d)))}function $b(){return new r(this)}function _b(a,b){var c=s(a)?a:tb(a);return!(!this.isValid()||!c.isValid())&&(b=K(f(b)?"millisecond":b),"millisecond"===b?this.valueOf()>c.valueOf():c.valueOf()9999?X(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):z(Date.prototype.toISOString)?this.toDate().toISOString():X(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function jc(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var a="moment",b="";this.isLocal()||(a=0===this.utcOffset()?"moment.utc":"moment.parseZone",b="Z");var c="["+a+'("]',d=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",e="-MM-DD[T]HH:mm:ss.SSS",f=b+'[")]';return this.format(c+d+e+f)}function kc(b){b||(b=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var c=X(this,b);return this.localeData().postformat(c)}function lc(a,b){return this.isValid()&&(s(a)&&a.isValid()||tb(a).isValid())?Sb({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function mc(a){return this.from(tb(),a)}function nc(a,b){return this.isValid()&&(s(a)&&a.isValid()||tb(a).isValid())?Sb({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function oc(a){return this.to(tb(),a)}function pc(a){var b;return void 0===a?this._locale._abbr:(b=bb(a),null!=b&&(this._locale=b),this)}function qc(){return this._locale}function rc(a){switch(a=K(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function sc(a){return a=K(a),void 0===a||"millisecond"===a?this:("date"===a&&(a="day"),this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms"))}function tc(){return this._d.valueOf()-6e4*(this._offset||0)}function uc(){return Math.floor(this.valueOf()/1e3)}function vc(){return new Date(this.valueOf())}function wc(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function xc(){var a=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}function yc(){return this.isValid()?this.toISOString():null}function zc(){return o(this)}function Ac(){
7 | return k({},n(this))}function Bc(){return n(this).overflow}function Cc(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Dc(a,b){U(0,[a,a.length],0,b)}function Ec(a){return Ic.call(this,a,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Fc(a){return Ic.call(this,a,this.isoWeek(),this.isoWeekday(),1,4)}function Gc(){return xa(this.year(),1,4)}function Hc(){var a=this.localeData()._week;return xa(this.year(),a.dow,a.doy)}function Ic(a,b,c,d,e){var f;return null==a?wa(this,d,e).year:(f=xa(a,d,e),b>f&&(b=f),Jc.call(this,a,b,c,d,e))}function Jc(a,b,c,d,e){var f=va(a,b,c,d,e),g=ta(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Kc(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Lc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function Mc(a,b){b[ke]=u(1e3*("0."+a))}function Nc(){return this._isUTC?"UTC":""}function Oc(){return this._isUTC?"Coordinated Universal Time":""}function Pc(a){return tb(1e3*a)}function Qc(){return tb.apply(null,arguments).parseZone()}function Rc(a){return a}function Sc(a,b,c,d){var e=bb(),f=l().set(d,b);return e[c](f,a)}function Tc(a,b,c){if(g(a)&&(b=a,a=void 0),a=a||"",null!=b)return Sc(a,b,c,"month");var d,e=[];for(d=0;d<12;d++)e[d]=Sc(a,d,c,"month");return e}function Uc(a,b,c,d){"boolean"==typeof a?(g(b)&&(c=b,b=void 0),b=b||""):(b=a,c=b,a=!1,g(b)&&(c=b,b=void 0),b=b||"");var e=bb(),f=a?e._week.dow:0;if(null!=c)return Sc(b,(c+f)%7,d,"day");var h,i=[];for(h=0;h<7;h++)i[h]=Sc(b,(h+f)%7,d,"day");return i}function Vc(a,b){return Tc(a,b,"months")}function Wc(a,b){return Tc(a,b,"monthsShort")}function Xc(a,b,c){return Uc(a,b,c,"weekdays")}function Yc(a,b,c){return Uc(a,b,c,"weekdaysShort")}function Zc(a,b,c){return Uc(a,b,c,"weekdaysMin")}function $c(){var a=this._data;return this._milliseconds=df(this._milliseconds),this._days=df(this._days),this._months=df(this._months),a.milliseconds=df(a.milliseconds),a.seconds=df(a.seconds),a.minutes=df(a.minutes),a.hours=df(a.hours),a.months=df(a.months),a.years=df(a.years),this}function _c(a,b,c,d){var e=Sb(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function ad(a,b){return _c(this,a,b,1)}function bd(a,b){return _c(this,a,b,-1)}function cd(a){return a<0?Math.floor(a):Math.ceil(a)}function dd(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||f<=0&&g<=0&&h<=0||(f+=864e5*cd(fd(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=t(f/1e3),i.seconds=a%60,b=t(a/60),i.minutes=b%60,c=t(b/60),i.hours=c%24,g+=t(c/24),e=t(ed(g)),h+=e,g-=cd(fd(e)),d=t(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function ed(a){return 4800*a/146097}function fd(a){return 146097*a/4800}function gd(a){if(!this.isValid())return NaN;var b,c,d=this._milliseconds;if(a=K(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+ed(b),"month"===a?c:c/12;switch(b=this._days+Math.round(fd(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function hd(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*u(this._months/12):NaN}function id(a){return function(){return this.as(a)}}function jd(a){return a=K(a),this.isValid()?this[a+"s"]():NaN}function kd(a){return function(){return this.isValid()?this._data[a]:NaN}}function ld(){return t(this.days()/7)}function md(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function nd(a,b,c){var d=Sb(a).abs(),e=uf(d.as("s")),f=uf(d.as("m")),g=uf(d.as("h")),h=uf(d.as("d")),i=uf(d.as("M")),j=uf(d.as("y")),k=e<=vf.ss&&["s",e]||e0,k[4]=c,md.apply(null,k)}function od(a){return void 0===a?uf:"function"==typeof a&&(uf=a,!0)}function pd(a,b){return void 0!==vf[a]&&(void 0===b?vf[a]:(vf[a]=b,"s"===a&&(vf.ss=b-1),!0))}function qd(a){if(!this.isValid())return this.localeData().invalidDate();var b=this.localeData(),c=nd(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function rd(){if(!this.isValid())return this.localeData().invalidDate();var a,b,c,d=wf(this._milliseconds)/1e3,e=wf(this._days),f=wf(this._months);a=t(d/60),b=t(a/60),d%=60,a%=60,c=t(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(m<0?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var sd,td;td=Array.prototype.some?Array.prototype.some:function(a){for(var b=Object(this),c=b.length>>>0,d=0;d68?1900:2e3)};var te=O("FullYear",!0);U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),J("week","w"),J("isoWeek","W"),M("week",5),M("isoWeek",5),Z("w",Sd),Z("ww",Sd,Od),Z("W",Sd),Z("WW",Sd,Od),ca(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=u(a)});var ue={dow:0,doy:6};U("d",0,"do","day"),U("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),U("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),U("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),J("day","d"),J("weekday","e"),J("isoWeekday","E"),M("day",11),M("weekday",11),M("isoWeekday",11),Z("d",Sd),Z("e",Sd),Z("E",Sd),Z("dd",function(a,b){return b.weekdaysMinRegex(a)}),Z("ddd",function(a,b){return b.weekdaysShortRegex(a)}),Z("dddd",function(a,b){return b.weekdaysRegex(a)}),ca(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:n(c).invalidWeekday=a}),ca(["d","e","E"],function(a,b,c,d){b[d]=u(a)});var ve="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),we="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),xe="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ye=be,ze=be,Ae=be;U("H",["HH",2],0,"hour"),U("h",["hh",2],0,Ra),U("k",["kk",2],0,Sa),U("hmm",0,0,function(){return""+Ra.apply(this)+T(this.minutes(),2)}),U("hmmss",0,0,function(){return""+Ra.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),U("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),U("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),Ta("a",!0),Ta("A",!1),J("hour","h"),M("hour",13),Z("a",Ua),Z("A",Ua),Z("H",Sd),Z("h",Sd),Z("k",Sd),Z("HH",Sd,Od),Z("hh",Sd,Od),Z("kk",Sd,Od),Z("hmm",Td),Z("hmmss",Ud),Z("Hmm",Td),Z("Hmmss",Ud),ba(["H","HH"],he),ba(["k","kk"],function(a,b,c){var d=u(a);b[he]=24===d?0:d}),ba(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),ba(["h","hh"],function(a,b,c){b[he]=u(a),n(c).bigHour=!0}),ba("hmm",function(a,b,c){var d=a.length-2;b[he]=u(a.substr(0,d)),b[ie]=u(a.substr(d)),n(c).bigHour=!0}),ba("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[he]=u(a.substr(0,d)),b[ie]=u(a.substr(d,2)),b[je]=u(a.substr(e)),n(c).bigHour=!0}),ba("Hmm",function(a,b,c){var d=a.length-2;b[he]=u(a.substr(0,d)),b[ie]=u(a.substr(d))}),ba("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[he]=u(a.substr(0,d)),b[ie]=u(a.substr(d,2)),b[je]=u(a.substr(e))});var Be,Ce=/[ap]\.?m?\.?/i,De=O("Hours",!0),Ee={calendar:Bd,longDateFormat:Cd,invalidDate:Dd,ordinal:Ed,dayOfMonthOrdinalParse:Fd,relativeTime:Gd,months:pe,monthsShort:qe,week:ue,weekdays:ve,weekdaysMin:xe,weekdaysShort:we,meridiemParse:Ce},Fe={},Ge={},He=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ie=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Je=/Z|[+-]\d\d(?::?\d\d)?/,Ke=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Le=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Me=/^\/?Date\((\-?\d+)/i,Ne=/^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d?\d\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(?:\d\d)?\d\d\s)(\d\d:\d\d)(\:\d\d)?(\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\d{4}))$/;a.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),a.ISO_8601=function(){},a.RFC_2822=function(){};var Oe=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var a=tb.apply(null,arguments);return this.isValid()&&a.isValid()?athis?this:a:p()}),Qe=function(){return Date.now?Date.now():+new Date},Re=["year","quarter","month","week","day","hour","minute","second","millisecond"];Db("Z",":"),Db("ZZ",""),Z("Z",_d),Z("ZZ",_d),ba(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Eb(_d,a)});var Se=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var Te=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Ue=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Sb.fn=Ab.prototype,Sb.invalid=zb;var Ve=Wb(1,"add"),We=Wb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Xe=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});U(0,["gg",2],0,function(){return this.weekYear()%100}),U(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Dc("gggg","weekYear"),Dc("ggggg","weekYear"),Dc("GGGG","isoWeekYear"),Dc("GGGGG","isoWeekYear"),J("weekYear","gg"),J("isoWeekYear","GG"),M("weekYear",1),M("isoWeekYear",1),Z("G",Zd),Z("g",Zd),Z("GG",Sd,Od),Z("gg",Sd,Od),Z("GGGG",Wd,Qd),Z("gggg",Wd,Qd),Z("GGGGG",Xd,Rd),Z("ggggg",Xd,Rd),ca(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=u(a)}),ca(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),U("Q",0,"Qo","quarter"),J("quarter","Q"),M("quarter",7),Z("Q",Nd),ba("Q",function(a,b){b[fe]=3*(u(a)-1)}),U("D",["DD",2],"Do","date"),J("date","D"),M("date",9),Z("D",Sd),Z("DD",Sd,Od),Z("Do",function(a,b){return a?b._dayOfMonthOrdinalParse||b._ordinalParse:b._dayOfMonthOrdinalParseLenient}),ba(["D","DD"],ge),ba("Do",function(a,b){b[ge]=u(a.match(Sd)[0],10)});var Ye=O("Date",!0);U("DDD",["DDDD",3],"DDDo","dayOfYear"),J("dayOfYear","DDD"),M("dayOfYear",4),Z("DDD",Vd),Z("DDDD",Pd),ba(["DDD","DDDD"],function(a,b,c){c._dayOfYear=u(a)}),U("m",["mm",2],0,"minute"),J("minute","m"),M("minute",14),Z("m",Sd),Z("mm",Sd,Od),ba(["m","mm"],ie);var Ze=O("Minutes",!1);U("s",["ss",2],0,"second"),J("second","s"),M("second",15),Z("s",Sd),Z("ss",Sd,Od),ba(["s","ss"],je);var $e=O("Seconds",!1);U("S",0,0,function(){return~~(this.millisecond()/100)}),U(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,function(){return 10*this.millisecond()}),U(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),U(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),U(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),U(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),U(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),J("millisecond","ms"),M("millisecond",16),Z("S",Vd,Nd),Z("SS",Vd,Od),Z("SSS",Vd,Pd);var _e;for(_e="SSSS";_e.length<=9;_e+="S")Z(_e,Yd);for(_e="S";_e.length<=9;_e+="S")ba(_e,Mc);var af=O("Milliseconds",!1);U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var bf=r.prototype;bf.add=Ve,bf.calendar=Zb,bf.clone=$b,bf.diff=fc,bf.endOf=sc,bf.format=kc,bf.from=lc,bf.fromNow=mc,bf.to=nc,bf.toNow=oc,bf.get=R,bf.invalidAt=Bc,bf.isAfter=_b,bf.isBefore=ac,bf.isBetween=bc,bf.isSame=cc,bf.isSameOrAfter=dc,bf.isSameOrBefore=ec,bf.isValid=zc,bf.lang=Xe,bf.locale=pc,bf.localeData=qc,bf.max=Pe,bf.min=Oe,bf.parsingFlags=Ac,bf.set=S,bf.startOf=rc,bf.subtract=We,bf.toArray=wc,bf.toObject=xc,bf.toDate=vc,bf.toISOString=ic,bf.inspect=jc,bf.toJSON=yc,bf.toString=hc,bf.unix=uc,bf.valueOf=tc,bf.creationData=Cc,bf.year=te,bf.isLeapYear=ra,bf.weekYear=Ec,bf.isoWeekYear=Fc,bf.quarter=bf.quarters=Kc,bf.month=ka,bf.daysInMonth=la,bf.week=bf.weeks=Ba,bf.isoWeek=bf.isoWeeks=Ca,bf.weeksInYear=Hc,bf.isoWeeksInYear=Gc,bf.date=Ye,bf.day=bf.days=Ka,bf.weekday=La,bf.isoWeekday=Ma,bf.dayOfYear=Lc,bf.hour=bf.hours=De,bf.minute=bf.minutes=Ze,bf.second=bf.seconds=$e,bf.millisecond=bf.milliseconds=af,bf.utcOffset=Hb,bf.utc=Jb,bf.local=Kb,bf.parseZone=Lb,bf.hasAlignedHourOffset=Mb,bf.isDST=Nb,bf.isLocal=Pb,bf.isUtcOffset=Qb,bf.isUtc=Rb,bf.isUTC=Rb,bf.zoneAbbr=Nc,bf.zoneName=Oc,bf.dates=x("dates accessor is deprecated. Use date instead.",Ye),bf.months=x("months accessor is deprecated. Use month instead",ka),bf.years=x("years accessor is deprecated. Use year instead",te),bf.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ib),bf.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ob);var cf=C.prototype;cf.calendar=D,cf.longDateFormat=E,cf.invalidDate=F,cf.ordinal=G,cf.preparse=Rc,cf.postformat=Rc,cf.relativeTime=H,cf.pastFuture=I,cf.set=A,cf.months=fa,cf.monthsShort=ga,cf.monthsParse=ia,cf.monthsRegex=na,cf.monthsShortRegex=ma,cf.week=ya,cf.firstDayOfYear=Aa,cf.firstDayOfWeek=za,cf.weekdays=Fa,cf.weekdaysMin=Ha,cf.weekdaysShort=Ga,cf.weekdaysParse=Ja,cf.weekdaysRegex=Na,cf.weekdaysShortRegex=Oa,cf.weekdaysMinRegex=Pa,cf.isPM=Va,cf.meridiem=Wa,$a("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===u(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=x("moment.lang is deprecated. Use moment.locale instead.",$a),a.langData=x("moment.langData is deprecated. Use moment.localeData instead.",bb);var df=Math.abs,ef=id("ms"),ff=id("s"),gf=id("m"),hf=id("h"),jf=id("d"),kf=id("w"),lf=id("M"),mf=id("y"),nf=kd("milliseconds"),of=kd("seconds"),pf=kd("minutes"),qf=kd("hours"),rf=kd("days"),sf=kd("months"),tf=kd("years"),uf=Math.round,vf={ss:44,s:45,m:45,h:22,d:26,M:11},wf=Math.abs,xf=Ab.prototype;return xf.isValid=yb,xf.abs=$c,xf.add=ad,xf.subtract=bd,xf.as=gd,xf.asMilliseconds=ef,xf.asSeconds=ff,xf.asMinutes=gf,xf.asHours=hf,xf.asDays=jf,xf.asWeeks=kf,xf.asMonths=lf,xf.asYears=mf,xf.valueOf=hd,xf._bubble=dd,xf.get=jd,xf.milliseconds=nf,xf.seconds=of,xf.minutes=pf,xf.hours=qf,xf.days=rf,xf.weeks=ld,xf.months=sf,xf.years=tf,xf.humanize=qd,xf.toISOString=rd,xf.toString=rd,xf.toJSON=rd,xf.locale=pc,xf.localeData=qc,xf.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",rd),xf.lang=Xe,U("X",0,0,"unix"),U("x",0,0,"valueOf"),Z("x",Zd),Z("X",ae),ba("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),ba("x",function(a,b,c){c._d=new Date(u(a))}),a.version="2.18.1",b(tb),a.fn=bf,a.min=vb,a.max=wb,a.now=Qe,a.utc=l,a.unix=Pc,a.months=Vc,a.isDate=h,a.locale=$a,a.invalid=p,a.duration=Sb,a.isMoment=s,a.weekdays=Xc,a.parseZone=Qc,a.localeData=bb,a.isDuration=Bb,a.monthsShort=Wc,a.weekdaysMin=Zc,a.defineLocale=_a,a.updateLocale=ab,a.locales=cb,a.weekdaysShort=Yc,a.normalizeUnits=K,a.relativeTimeRounding=od,a.relativeTimeThreshold=pd,a.calendarFormat=Yb,a.prototype=bf,a});
--------------------------------------------------------------------------------
/public/js/scriptForChat.js:
--------------------------------------------------------------------------------
1 | $ (function(){
2 |
3 | var socket = io('/chat');
4 |
5 | var username = $('#user').val();
6 | var noChat = 0; //setting 0 if all chats histroy is not loaded. 1 if all chats loaded.
7 | var msgCount = 0; //counting total number of messages displayed.
8 | var oldInitDone = 0; //it is 0 when old-chats-init is not executed and 1 if executed.
9 | var roomId;//variable for setting room.
10 | var toUser;
11 |
12 | //passing data on connection.
13 | socket.on('connect',function(){
14 | socket.emit('set-user-data',username);
15 | // setTimeout(function() { alert(username+" logged In"); }, 500);
16 |
17 | socket.on('broadcast',function(data){
18 | document.getElementById("hell0").innerHTML += ''+ data.description +'';
19 | // $('#hell0').append($('').append($(data.description).append($('');
20 | $('#hell0').scrollTop($('#hell0')[0].scrollHeight);
21 |
22 | });
23 |
24 | });//end of connect event.
25 |
26 |
27 |
28 | //receiving onlineStack.
29 | socket.on('onlineStack',function(stack){
30 | $('#list').empty();
31 | $('#list').append($('').append($('').text("Group").css({"font-size":"18px"})));
32 | var totalOnline = 0;
33 | for (var user in stack){
34 | //setting txt1. shows users button.
35 | if(user == username){
36 | var txt1 = $('').text(user).css({"font-size":"18px"});
37 | }
38 | else{
39 | var txt1 = $('