Index: reference/jquery-plugins/select2-4.0.13/src/scss/theme/default/layout.scss =================================================================== diff -u -rd4cc210eef3c63f46a7de2e7f2d96b3099520225 -raecefeabc79f6e368b3817187af7954ff86ece24 --- reference/jquery-plugins/select2-4.0.13/src/scss/theme/default/layout.scss (.../layout.scss) (revision d4cc210eef3c63f46a7de2e7f2d96b3099520225) +++ reference/jquery-plugins/select2-4.0.13/src/scss/theme/default/layout.scss (.../layout.scss) (revision aecefeabc79f6e368b3817187af7954ff86ece24) @@ -176,17 +176,18 @@ } // --- jstree 설정 -- // -function jsTreeBuild(jsTreeBox, armsServiceName) { +function jsTreeBuild(jQueryElementID, serviceNameForURL) { + console.log("href: " + $(location).attr("href")); console.log("protocol: " + $(location).attr("protocol")); console.log("host: " + $(location).attr("host")); console.log("pathname: " + $(location).attr("pathname")); console.log("search: " + $(location).attr("search")); console.log("hostname: " + $(location).attr("hostname")); console.log("port: " + $(location).attr("port")); - var isDevelopingToRoute = "/auth-user"; + var authCheckURL = "/auth-user"; - $(jsTreeBox) + $(jQueryElementID) .bind("before.jstree", function (e, data) { $("#alog").append(data.func + "
"); $("li:not([rel='drive']).jstree-open > a > .jstree-icon").css( @@ -317,7 +318,7 @@ ajax: { // the URL to fetch the data url: - isDevelopingToRoute + "/api/arms/" + armsServiceName + "/getChildNode.do", + authCheckURL + "/api/arms/" + serviceNameForURL + "/getChildNode.do", // the `data` function is executed in the instance's scope // the parameter is the node being loaded // (may be -1, 0, or undefined when loading the root nodes) @@ -341,7 +342,7 @@ // Same as above - the `ajax` config option is actually jQuery's AJAX object ajax: { url: - isDevelopingToRoute + "/api/arms/" + armsServiceName + "/searchNode.do", + authCheckURL + "/api/arms/" + serviceNameForURL + "/searchNode.do", // You get the search string as a parameter data: function (str) { return { @@ -416,7 +417,7 @@ }) .bind("create.jstree", function (e, data) { $.post( - isDevelopingToRoute + "/api/arms/" + armsServiceName + "/addNode.do", + authCheckURL + "/api/arms/" + serviceNameForURL + "/addNode.do", { ref: data.rslt.parent.attr("id").replace("node_", "").replace("copy_", ""), c_position: data.rslt.position, @@ -438,7 +439,7 @@ } ); } - jsTreeBuild(jsTreeBox, armsServiceName); + jsTreeBuild(jQueryElementID, serviceNameForURL); } ); }) @@ -448,7 +449,7 @@ async: false, type: "POST", url: - isDevelopingToRoute + "/api/arms/" + armsServiceName + "/removeNode.do", + authCheckURL + "/api/arms/" + serviceNameForURL + "/removeNode.do", data: { c_id: this.id.replace("node_", "").replace("copy_", ""), }, @@ -462,14 +463,14 @@ } ); } - jsTreeBuild(jsTreeBox, armsServiceName); + jsTreeBuild(jQueryElementID, serviceNameForURL); }, }); }); }) .bind("rename.jstree", function (e, data) { $.post( - isDevelopingToRoute + "/api/arms/" + armsServiceName + "/alterNode.do", + authCheckURL + "/api/arms/" + serviceNameForURL + "/alterNode.do", { c_id: data.rslt.obj.attr("id").replace("node_", "").replace("copy_", ""), c_title: data.rslt.new_name, @@ -488,13 +489,13 @@ } ); } - jsTreeBuild(jsTreeBox, armsServiceName); + jsTreeBuild(jQueryElementID, serviceNameForURL); } ); }) .bind("set_type.jstree", function (e, data) { $.post( - isDevelopingToRoute + "/api/arms/" + armsServiceName + "/alterNodeType.do", + authCheckURL + "/api/arms/" + serviceNameForURL + "/alterNodeType.do", { c_id: data.rslt.obj.attr("id").replace("node_", "").replace("copy_", ""), c_title: data.rslt.new_name, @@ -510,7 +511,7 @@ } ); } - jsTreeBuild(jsTreeBox, armsServiceName); + jsTreeBuild(jQueryElementID, serviceNameForURL); } ); }) @@ -519,7 +520,7 @@ $.ajax({ async: false, type: "POST", - url: isDevelopingToRoute + "/api/arms/" + armsServiceName + "/moveNode.do", + url: authCheckURL + "/api/arms/" + serviceNameForURL + "/moveNode.do", data: { c_id: $(this).attr("id").replace("node_", "").replace("copy_", ""), ref: @@ -549,7 +550,7 @@ } ); } - jsTreeBuild(jsTreeBox, armsServiceName); + jsTreeBuild(jQueryElementID, serviceNameForURL); }, }); }); @@ -566,81 +567,20 @@ switch (this.id) { case "add_default": case "add_folder": - $(jsTreeBox).jstree("create", null, "last", { + $(jQueryElementID).jstree("create", null, "last", { attr: { rel: this.id.toString().replace("add_", ""), }, }); break; case "search": - $(jsTreeBox).jstree("search", document.getElementById("text").value); + $(jQueryElementID).jstree("search", document.getElementById("text").value); break; case "text": break; default: - $(jsTreeBox).jstree(this.id); + $(jQueryElementID).jstree(this.id); break; } }); } - -// regist new service -function registNewServie(serviceName, treeBox) { - var refNum; - var checkedService = $(treeBox).find("a.jstree-clicked").parent(); - checkedService.attr("rel") === "default" - ? (refNum = checkedService.parent().closest("li")) - : (refNum = checkedService); - var positionIndex = refNum.children().find("li").length; - refNum = refNum.attr("id").replace("node_", "").replace("copy_", ""); - - if ( - !$("#prepended-input").val() || - $("#prepended-input").val().trim() === "" - ) { - alert("Please write service name!"); - $("#prepended-input").focus(); - } else { - $.ajax({ - url: `/auth-user/api/arms/${serviceName}/addNode.do`, - type: "POST", - data: { - ref: refNum, - c_position: positionIndex, - c_title: $("#prepended-input").val(), - c_type: "default", - }, - statusCode: { - 200: function () { - jsTreeBuild(treeBox, serviceName); - }, - }, - }); - } -} - -function updateServie(serviceName, treeBox) { - var checkedService = $(treeBox).find("a.jstree-clicked").parent(); - if ( - !$("#prepended-input").val() || - $("#prepended-input").val().trim() === "" - ) { - alert("Please write service name!"); - $("#prepended-input").focus(); - } else { - $.ajax({ - url: `/auth-user/api/arms/${serviceName}/alterNode.do`, - type: "POST", - data: { - c_id: checkedService.attr("id").replace("node_", "").replace("copy_", ""), - c_title: $("#prepended-input").val(), - c_type: checkedService.attr("rel"), - }, - statusCode: { - 200: function () { - jsTreeBuild(treeBox, serviceName); - }, - }, - }); - } -} \ No newline at end of file Index: arms/js/pdService.js =================================================================== diff -u -r138a24ac310666a5b594a5f5f2e2846eed5b62dd -raecefeabc79f6e368b3817187af7954ff86ece24 --- arms/js/pdService.js (.../pdService.js) (revision 138a24ac310666a5b594a5f5f2e2846eed5b62dd) +++ arms/js/pdService.js (.../pdService.js) (revision aecefeabc79f6e368b3817187af7954ff86ece24) @@ -31,13 +31,6 @@ pageChecker(); setSideMenu("sidebar_menu_product", "sidebar_menu_product_manage"); - //서비스 등록 - $(".btn-info").on("click", function () { - var index = $("label.btn-sm.active").index(); - index === 0 - ? registNewServie("pdservice", "#demo") - : updateServie("pdservice", "#demo"); - }); makeReviewList([ { Index: arms/js/pdServiceModify.js =================================================================== diff -u -r138a24ac310666a5b594a5f5f2e2846eed5b62dd -raecefeabc79f6e368b3817187af7954ff86ece24 --- arms/js/pdServiceModify.js (.../pdServiceModify.js) (revision 138a24ac310666a5b594a5f5f2e2846eed5b62dd) +++ arms/js/pdServiceModify.js (.../pdServiceModify.js) (revision aecefeabc79f6e368b3817187af7954ff86ece24) @@ -16,13 +16,6 @@ }; $(function () { - //서비스 등록 - $(".btn-info").on("click", function () { - var index = $("label.btn-sm.active").index(); - index === 0 - ? registNewServie("pdservice", "#demo") - : updateServie("pdservice", "#demo"); - }); makeReviewList([ { Index: arms/js/pdVersionServiceRegist.js =================================================================== diff -u -r69fe57ca5defa495d913766c6824be673e88f7ef -raecefeabc79f6e368b3817187af7954ff86ece24 --- arms/js/pdVersionServiceRegist.js (.../pdVersionServiceRegist.js) (revision 69fe57ca5defa495d913766c6824be673e88f7ef) +++ arms/js/pdVersionServiceRegist.js (.../pdVersionServiceRegist.js) (revision aecefeabc79f6e368b3817187af7954ff86ece24) @@ -1,12 +1,6 @@ $(function () { setSideMenu("sidebar_menu_product", "sidebar_menu_product_version_regist"); jsTreeBuild("#productTree", "pdversion"); - $(".btn-info").click(function () { - var index = $("label.btn-sm.active").index(); - index === 0 - ? registNewServie("pdversion", "#productTree") - : updateServie("pdversion", "#productTree"); - }); }); // --- 에디터 설정 --- //