diff --git a/.gitignore b/.gitignore
index e212594..1cad67b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
-
node_modules
+src/public/main.js
\ No newline at end of file
diff --git a/gulpfile.js b/gulpfile.js
new file mode 100644
index 0000000..62b7658
--- /dev/null
+++ b/gulpfile.js
@@ -0,0 +1,14 @@
+var gulp = require('gulp');
+var uglify = require('gulp-uglify');
+
+gulp.task('watch', function() {
+ gulp.watch('src/js/main.js', ['build']);
+});
+
+gulp.task('build', ['uglify']);
+
+gulp.task('uglify', function() {
+ gulp.src('src/js/main.js')
+ .pipe(uglify())
+ .pipe(gulp.dest('src/public'));
+});
\ No newline at end of file
diff --git a/package.json b/package.json
index 59c8dfa..86088b4 100644
--- a/package.json
+++ b/package.json
@@ -9,6 +9,8 @@
"express": "^4.13.3",
"express-session": "^1.12.1",
"express-socket.io-session": "^1.3.1",
+ "gulp": "^3.9.0",
+ "gulp-uglify": "^1.5.1",
"mustache-express": "^1.2.2",
"serve-favicon": "^2.3.0",
"shortid": "^2.2.4",
diff --git a/src/public/main.js b/src/public/main.js
deleted file mode 100644
index 3ff15a3..0000000
--- a/src/public/main.js
+++ /dev/null
@@ -1 +0,0 @@
-var fs=window.RequestFileSystem||window.webkitRequestFileSystem;$(function(){function e(e){var n="";n+=1===e.numUsers?"There's 1 participant":"There are "+e.numUsers+" participants",a(n)}function n(){R=window.username,fs?fs(window.TEMPORARY,100,a.bind(a,"WARNING: Your browser is not in incognito mode!"),a.bind(a,"Your browser is in incognito mode.")):console.log("no fs"),R&&(A.show(),D=C.focus(),U.emit("add user",R))}function t(){var e=C.val();e=l(e),e&&J&&(C.val(""),s({username:R,message:e}),U.emit("new message",o(e)))}function o(e){return CryptoJS.AES.encrypt(e,k.val()).toString()}function i(e){return CryptoJS.AES.decrypt(e,k.val()).toString(CryptoJS.enc.Utf8)||e}function a(e,n){var t,o=n&&n.html===!0||!1;t=o?$("
").addClass("log").html(e):$("").addClass("log").text(e),u(t,n)}function s(e,n){var t=f(e);n=n||{},0!==t.length&&(n.fade=!1,t.remove());var o=$('').text(e.username).css("color",d(e.username)),i=$('').text(e.message),a=e.typing?"typing":"",s=$('').data("username",e.username).addClass(a).append(o,i);u(s,n)}function r(e){e.typing=!0,e.message="is typing",s(e)}function c(e){f(e).fadeOut(function(){$(this).remove()})}function u(e,n){var t=$(e);n||(n={}),"undefined"==typeof n.fade&&(n.fade=!0),"undefined"==typeof n.prepend&&(n.prepend=!1),n.fade&&t.hide().fadeIn(y),n.prepend?S.prepend(t):S.append(t),S[0].scrollTop=S[0].scrollHeight}function l(e){return $("").text(e).text()}function p(){J&&(F||(F=!0,U.emit("typing")),I=(new Date).getTime(),setTimeout(function(){var e=(new Date).getTime(),n=e-I;n>=h&&F&&(U.emit("stop typing"),F=!1)},h))}function f(e){return $(".typing.message").filter(function(n){return $(this).data("username")===e.username})}function d(e){for(var n=7,t=0;tCopy link to share';a(t,{prepend:!0,html:!0}),t="This chatroom is destroyed after all participants exit. Chat history is client side only and not persistent.",a(t),e(n)}),U.on("new message",function(e){m||(g++,favicon.badge(g)),e.message=i(e.message),s(e)}),U.on("user joined",function(n){a(n.username+" joined"),e(n)}),U.on("user left",function(n){a(n.username+" left"),e(n),c(n)}),U.on("typing",function(e){r(e)}),U.on("stop typing",function(e){c(e)}),U.on("first",function(){$(".modal").modal("show")}),n(),$("span.key-btn").click(function(){$("#key-modal").modal("show")}),window.onfocus=function(){m=!0,g=0,favicon.reset()},window.onblur=function(){m=!1},E.on("success",function(e){$(e.trigger).tooltip({title:"Copied!",trigger:"manual",placement:"auto"}),$(e.trigger).tooltip("show"),setTimeout(function(){$(e.trigger).tooltip("hide")},2e3),e.clearSelection()}),E.on("error",function(e){$(e.trigger).tooltip({title:"Press ⌘C to copy",trigger:"manual",placement:"auto"}),$(e.trigger).tooltip("show"),setTimeout(function(){$(e.trigger).tooltip("hide")},2e3)})}});
\ No newline at end of file