diff --git a/Server/lib/Gruntfile.js b/Server/lib/Gruntfile.js deleted file mode 100644 index 96cefcf17..000000000 --- a/Server/lib/Gruntfile.js +++ /dev/null @@ -1,84 +0,0 @@ -const LICENSE = [ - "Rule the words! KKuTu Online", - "Copyright (C) 2017 JJoriping(op@jjo.kr)", - "", - "This program is free software: you can redistribute it and/or modify", - "it under the terms of the GNU General Public License as published by", - "the Free Software Foundation, either version 3 of the License, or", - "(at your option) any later version.", - "", - "This program is distributed in the hope that it will be useful,", - "but WITHOUT ANY WARRANTY; without even the implied warranty of", - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the", - "GNU General Public License for more details.", - "", - "You should have received a copy of the GNU General Public License", - "along with this program. If not, see ." -].join('\n'); - -var File = require('fs'); - -const LIST = [ - "global", - - "in_login", - "in_game_kkutu", - "in_game_kkutu_help", - "in_admin", - "in_portal", - "in_loginfail" -]; -const KKUTU_LIST = [ - "Web/lib/kkutu/head.js", - "Web/lib/kkutu/ready.js", - "Web/lib/kkutu/rule_classic.js", - "Web/lib/kkutu/rule_jaqwi.js", - "Web/lib/kkutu/rule_crossword.js", - "Web/lib/kkutu/rule_typing.js", - "Web/lib/kkutu/rule_hunmin.js", - "Web/lib/kkutu/rule_daneo.js", - "Web/lib/kkutu/rule_sock.js", - "Web/lib/kkutu/body.js", - "Web/lib/kkutu/tail.js" -]; - -module.exports = function(grunt){ - var i, files = {}, cons = {}; - var KKUTU = "Web/public/js/in_game_kkutu.min.js"; - - for(i in LIST){ - files["Web/public/js/"+LIST[i]+".min.js"] = "Web/lib/"+LIST[i]+".js"; - } - files[KKUTU] = KKUTU_LIST; - - grunt.initConfig({ - uglify: { - options: { - banner: "/**\n" + LICENSE + "\n*/\n\n" - }, - build: { - files: files - } - }, - concat: { - basic: { - src: KKUTU_LIST, - dest: "Web/lib/in_game_kkutu.js" - } - } - }); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-concat'); - - grunt.registerTask('default', ['concat', 'uglify']); - grunt.registerTask('pack', 'Log', function(){ - var done = this.async(); - var url = __dirname + "/" + KKUTU; - - File.readFile(url, function(err, res){ - File.writeFile(url, "(function(){" + res.toString() + "})();", function(err, res){ - done(); - }); - }) - }); -}; \ No newline at end of file diff --git a/Server/lib/Web/lib/global.js b/Server/lib/Web/lib/global.js index 8f2b3032a..9d6e4237f 100644 --- a/Server/lib/Web/lib/global.js +++ b/Server/lib/Web/lib/global.js @@ -20,8 +20,6 @@ * 볕뉘 수정사항: * getCookie 코드오류로 인한 코드 수정 */ -var global = {}; -var L; (function(){ var size; @@ -85,9 +83,9 @@ var L; var explSize; var gn = $("#gn-content").html() || ""; - global.profile = $("#profile").html(); - if(global.profile) global.profile = JSON.parse(global.profile); - else global.profile = {}; + globalThis.profile = $("#profile").html(); + if(globalThis.profile) globalThis.profile = JSON.parse(globalThis.profile); + else globalThis.profile = {}; $.cookie('test', "good"); if($.cookie('test') != "good"){ @@ -120,8 +118,8 @@ var L; // 계정 if($.cookie('lc') == "") $.cookie('lc', "ko_KR"); - if(global.profile.token){ - $("#account-info").html(global.profile.title || global.profile.name).on('click', function(e){ + if(globalThis.profile.token){ + $("#account-info").html(globalThis.profile.title || globalThis.profile.name).on('click', function(e){ if(confirm(L['ASK_LOGOUT'])) requestLogout(e); }); }else{ @@ -137,8 +135,8 @@ var L; /*if($.cookie('forlogout')){ requestLogout(); }*/ - global.watchInput($("#quick-search-tf")); - (global.expl = function($mother){ + globalThis.watchInput($("#quick-search-tf")); + (globalThis.expl = function($mother){ var $q = $mother ? $mother.find(".expl") : $(".expl"); $q.parent().addClass("expl-mother").on('mouseenter', function(e){ @@ -177,8 +175,8 @@ var L; var i, c = 0; $ac.empty(); - global['wl-'+cid] = res.list.slice(0, 10); - global['wi-'+cid] = -1; + globalThis['wl-'+cid] = res.list.slice(0, 10); + globalThis['wi-'+cid] = -1; for(i in res.list){ if(c++ >= 10) break; $ac.append($("
") @@ -205,7 +203,7 @@ var L; } _setTimeout(onWatchInput, 200, $o, prev); } - global.watchInput = function($tf){ + globalThis.watchInput = function($tf){ var cid = $tf.attr('id'); $tf.after($("
") @@ -221,21 +219,21 @@ var L; var list; if(!dir) return; - if(!(list = global['wl-'+cid])) return; - if(global['wi-'+cid] == -1) if(dir == -1) dir = 0; + if(!(list = globalThis['wl-'+cid])) return; + if(globalThis['wi-'+cid] == -1) if(dir == -1) dir = 0; $(".autocomp-select").removeClass("autocomp-select"); - global['wi-'+cid] += dir; - if(global['wi-'+cid] < 0) global['wi-'+cid] += list.length; - if(global['wi-'+cid] >= list.length) global['wi-'+cid] = 0; + globalThis['wi-'+cid] += dir; + if(globalThis['wi-'+cid] < 0) globalThis['wi-'+cid] += list.length; + if(globalThis['wi-'+cid] >= list.length) globalThis['wi-'+cid] = 0; - $("#aci-" + list[global['wi-'+cid]]._id).addClass("autocomp-select"); + $("#aci-" + list[globalThis['wi-'+cid]]._id).addClass("autocomp-select"); e.preventDefault(); }); return _setTimeout(onWatchInput, 200, $tf, $tf.val()); }; - global.zeroPadding = function(num, len){ var s = num.toString(); return "000000000000000".slice(0, Math.max(0, len - s.length)) + s; }; - global.onPopup = function(url){ + globalThis.zeroPadding = function(num, len){ var s = num.toString(); return "000000000000000".slice(0, Math.max(0, len - s.length)) + s; }; + globalThis.onPopup = function(url){ location.href = url; }; })(); \ No newline at end of file diff --git a/Server/lib/Web/lib/in_game_kkutu.js b/Server/lib/Web/lib/in_game_kkutu.js index 4c01c206b..4f51f049a 100644 --- a/Server/lib/Web/lib/in_game_kkutu.js +++ b/Server/lib/Web/lib/in_game_kkutu.js @@ -1,3 +1,21 @@ +/** +Rule the words! KKuTu Online +Copyright (C) 2017 JJoriping(op@jjo.kr) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ +(function(){ /** * Rule the words! KKuTu Online * Copyright (C) 2017 JJoriping(op@jjo.kr) @@ -4788,4 +4806,5 @@ function yell(msg){ */ delete window.WebSocket; -delete window.setInterval; \ No newline at end of file +delete window.setInterval; +})(); \ No newline at end of file diff --git a/Server/lib/Web/public/js/global.min.js b/Server/lib/Web/public/js/global.min.js index 24b667a1b..b8b9886d4 100644 --- a/Server/lib/Web/public/js/global.min.js +++ b/Server/lib/Web/public/js/global.min.js @@ -1,20 +1,17 @@ -/** -Rule the words! KKuTu Online -Copyright (C) 2017 JJoriping(op@jjo.kr) - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - - -var global={},L;!function(){function a(a,b,c){var d=new Date;d.setDate(d.getDate()+c),cookies=a+"="+escape(b)+"; path=/ ",void 0!==c&&(cookies+=";expires="+d.toGMTString()+";"),document.cookie=cookies}function b(a){for(var a=a+"=",b=decodeURIComponent(document.cookie).split(";"),c=[],d=0;d0?c[1]:"")}function c(a){f[0],f[1];location.href="/login"}function d(a){location.href="/logout"}function e(a,b){var c=a.attr("id"),d=$("#ac-"+c);a.val()!=b&&((b=a.val())?$.get("http://jjo.kr/search?q="+encodeURI(b),function(b){var e,f=0;d.empty(),global["wl-"+c]=b.list.slice(0,10),global["wi-"+c]=-1;for(e in b.list){if(f++>=10)break;d.append($("
").attr("id","aci-"+b.list[e]._id).addClass("autocomp-item ellipse").html(b.list[e].profile.name).on("click",function(a){location.href="http://jjo.kr/users/"+$(a.currentTarget).attr("id").slice(4)}))}f?(d.show(),a.css("border-bottom-left-radius",0)):(d.hide(),a.css("border-bottom-left-radius",""))}):(d.hide(),a.css("border-bottom-left-radius",""))),g(e,200,a,b)}var f,g=setTimeout;$.prototype.hotkey=function(a,b){var c=$(this);return(a||$(window)).on("keydown",function(a){a.shiftKey||a.keyCode==b&&(c.trigger("click"),a.preventDefault())}),c},$.prototype.color=function(a){return $(this).css({color:a})},$.prototype.bgColor=function(a){return $(this).css({"background-color":a})},$.cookie=function(c,d){if(void 0===d)return b(c);a(c,d)},$(document).ready(function(a){var b,e=$("#global-notice").hide(),h=$("#gn-content").html()||"";if(global.profile=$("#profile").html(),global.profile?global.profile=JSON.parse(global.profile):global.profile={},$.cookie("test","good"),"good"!=$.cookie("test")?e.html(h="쿠키 사용이 차단되어 있습니다. 로그인 관련 기능이 제한됩니다.
제한을 풀기 위해서는 브라우저 설정에서 쿠키 사용을 허용하도록 설정해야 합니다.
"+h):$.cookie("test",""),h.length>1&&e.show(),e.on("click",function(a){e.hide()}),$(window).on("resize",function(a){f=[$(window).width(),$(window).height()],$("#Middle").css("margin-left",Math.max(0,.5*f[0]-500)),$("#Bottom").width(f[0])}).on("mousemove",function(a){null!=b&&$(".expl-active").css({left:Math.min(a.clientX+5,f[0]-b[0]-12),top:Math.min(a.clientY+23,f[1]-b[1]-12)})}).trigger("resize"),$("#quick-search-btn").on("click",function(a){var b;$("#quick-search-btn").hasClass("searching")||((b=$(".autocomp-select").html())&&$("#quick-search-tf").val(b),$("#quick-search-btn").addClass("searching").html($("").addClass("fa fa-spin fa-spinner")),location.href="http://jjo.kr?q="+encodeURI($("#quick-search-tf").val()))}).hotkey($("#quick-search-tf"),13),""==$.cookie("lc")&&$.cookie("lc","ko_KR"),global.profile.token)$("#account-info").html(global.profile.title||global.profile.name).on("click",function(a){confirm(L.ASK_LOGOUT)&&d(a)});else{if(window.FB)try{FB.logout()}catch(a){g(function(){FB.logout()},1e3)}$("#account-info").html(L.LOGIN).on("click",c)}global.watchInput($("#quick-search-tf")),(global.expl=function(a){(a?a.find(".expl"):$(".expl")).parent().addClass("expl-mother").on("mouseenter",function(a){var c=$(a.currentTarget).children(".expl");b=[c.width(),c.height()],$(".expl-active").removeClass("expl-active"),c.addClass("expl-active")}).on("mouseleave",function(a){$(a.currentTarget).children(".expl").removeClass("expl-active")})})()}),global.watchInput=function(a){var b=a.attr("id");return a.after($("
").addClass("autocomp").attr("id","ac-"+b).css({"margin-top":a.outerHeight(),width:a.outerWidth()-6}).hide()).on("keydown",function(a){var c,d=38==a.keyCode?-1:40==a.keyCode?1:0;d&&(c=global["wl-"+b])&&(-1==global["wi-"+b]&&-1==d&&(d=0),$(".autocomp-select").removeClass("autocomp-select"),global["wi-"+b]+=d,global["wi-"+b]<0&&(global["wi-"+b]+=c.length),global["wi-"+b]>=c.length&&(global["wi-"+b]=0),$("#aci-"+c[global["wi-"+b]]._id).addClass("autocomp-select"),a.preventDefault())}),g(e,200,a,a.val())},global.zeroPadding=function(a,b){var c=a.toString();return"000000000000000".slice(0,Math.max(0,b-c.length))+c},global.onPopup=function(a){location.href=a}}(); \ No newline at end of file +/*! + * Rule the words! KKuTu Online + * Copyright (C) 2017 JJoriping(op@jjo.kr) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */!function(){var o,t=setTimeout;function e(t){o[0],o[1],location.href="/login"}function i(o,e){var l=o.attr("id"),n=$("#ac-"+l);o.val()!=e&&((e=o.val())?$.get("http://jjo.kr/search?q="+encodeURI(e),(function(t){var e,i=0;for(e in n.empty(),globalThis["wl-"+l]=t.list.slice(0,10),globalThis["wi-"+l]=-1,t.list){if(i++>=10)break;n.append($("
").attr("id","aci-"+t.list[e]._id).addClass("autocomp-item ellipse").html(t.list[e].profile.name).on("click",(function(o){location.href="http://jjo.kr/users/"+$(o.currentTarget).attr("id").slice(4)})))}i?(n.show(),o.css("border-bottom-left-radius",0)):(n.hide(),o.css("border-bottom-left-radius",""))})):(n.hide(),o.css("border-bottom-left-radius",""))),t(i,200,o,e)}$.prototype.hotkey=function(o,t){var e=$(this);return(o||$(window)).on("keydown",(function(o){o.shiftKey||o.keyCode==t&&(e.trigger("click"),o.preventDefault())})),e},$.prototype.color=function(o){return $(this).css({color:o})},$.prototype.bgColor=function(o){return $(this).css({"background-color":o})},$.cookie=function(o,t){if(void 0===t)return function(o){o+="=";for(var t=decodeURIComponent(document.cookie).split(";"),e=[],i=0;i0?e[1]:"")}(o);var e,i,l,n;e=o,i=t,(n=new Date).setDate(n.getDate()+l),cookies=e+"="+escape(i)+"; path=/ ",void 0!==l&&(cookies+=";expires="+n.toGMTString()+";"),document.cookie=cookies},$(document).ready((function(i){var l,n=$("#global-notice").hide(),a=$("#gn-content").html()||"";if(globalThis.profile=$("#profile").html(),globalThis.profile?globalThis.profile=JSON.parse(globalThis.profile):globalThis.profile={},$.cookie("test","good"),"good"!=$.cookie("test")?n.html(a="쿠키 사용이 차단되어 있습니다. 로그인 관련 기능이 제한됩니다.
제한을 풀기 위해서는 브라우저 설정에서 쿠키 사용을 허용하도록 설정해야 합니다.
"+a):$.cookie("test",""),a.length>1&&n.show(),n.on("click",(function(o){n.hide()})),$(window).on("resize",(function(t){o=[$(window).width(),$(window).height()],$("#Middle").css("margin-left",Math.max(0,.5*o[0]-500)),$("#Bottom").width(o[0])})).on("mousemove",(function(t){null!=l&&$(".expl-active").css({left:Math.min(t.clientX+5,o[0]-l[0]-12),top:Math.min(t.clientY+23,o[1]-l[1]-12)})})).trigger("resize"),$("#quick-search-btn").on("click",(function(o){var t;$("#quick-search-btn").hasClass("searching")||((t=$(".autocomp-select").html())&&$("#quick-search-tf").val(t),$("#quick-search-btn").addClass("searching").html($("").addClass("fa fa-spin fa-spinner")),location.href="http://jjo.kr?q="+encodeURI($("#quick-search-tf").val()))})).hotkey($("#quick-search-tf"),13),""==$.cookie("lc")&&$.cookie("lc","ko_KR"),globalThis.profile.token)$("#account-info").html(globalThis.profile.title||globalThis.profile.name).on("click",(function(o){confirm(L.ASK_LOGOUT)&&(location.href="/logout")}));else{if(window.FB)try{FB.logout()}catch(i){t((function(){FB.logout()}),1e3)}$("#account-info").html(L.LOGIN).on("click",e)}globalThis.watchInput($("#quick-search-tf")),(globalThis.expl=function(o){(o?o.find(".expl"):$(".expl")).parent().addClass("expl-mother").on("mouseenter",(function(o){var t=$(o.currentTarget).children(".expl");l=[t.width(),t.height()],$(".expl-active").removeClass("expl-active"),t.addClass("expl-active")})).on("mouseleave",(function(o){$(o.currentTarget).children(".expl").removeClass("expl-active")}))})()})),globalThis.watchInput=function(o){var e=o.attr("id");return o.after($("
").addClass("autocomp").attr("id","ac-"+e).css({"margin-top":o.outerHeight(),width:o.outerWidth()-6}).hide()).on("keydown",(function(o){var t,i=38==o.keyCode?-1:40==o.keyCode?1:0;i&&(t=globalThis["wl-"+e])&&(-1==globalThis["wi-"+e]&&-1==i&&(i=0),$(".autocomp-select").removeClass("autocomp-select"),globalThis["wi-"+e]+=i,globalThis["wi-"+e]<0&&(globalThis["wi-"+e]+=t.length),globalThis["wi-"+e]>=t.length&&(globalThis["wi-"+e]=0),$("#aci-"+t[globalThis["wi-"+e]]._id).addClass("autocomp-select"),o.preventDefault())})),t(i,200,o,o.val())},globalThis.zeroPadding=function(o,t){var e=o.toString();return"000000000000000".slice(0,Math.max(0,t-e.length))+e},globalThis.onPopup=function(o){location.href=o}}(); \ No newline at end of file diff --git a/Server/lib/Web/public/js/in_admin.min.js b/Server/lib/Web/public/js/in_admin.min.js index 9caf129da..ef7a1bdad 100644 --- a/Server/lib/Web/public/js/in_admin.min.js +++ b/Server/lib/Web/public/js/in_admin.min.js @@ -1,20 +1,17 @@ -/** -Rule the words! KKuTu Online -Copyright (C) 2017 JJoriping(op@jjo.kr) - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - - -!function(){function a(a,b,c){return $("").attr("id",a).css("width",f[b]).val(c)}function b(b,c,d,e,f){return a("word-"+[b,c,d,e].join("-"),e,f)}function c(a,b,c){var e=["wa",a,b,c].join("-")+"-";return $("").append($("