Browse Source

기본 스킨 IE에서 메뉴 안 눌리는 버그 수정

Surplus_Up (2DU) 7 năm trước cách đây
mục cha
commit
a78885e499

+ 1 - 0
views/neo_yousoro/index.html

@@ -5,6 +5,7 @@
         <link rel="stylesheet" href="/views/main_css/main.css">
         <link rel="stylesheet" href="/views/neo_yousoro/css/main.css">
         <script src="/views/neo_yousoro/js/main.js"></script>
+        <script src="/views/neo_yousoro/js/skin_set.js"></script>
         <link   rel="stylesheet"
                 href="https://use.fontawesome.com/releases/v5.2.0/css/all.css"
                 integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ"

+ 0 - 70
views/neo_yousoro/js/main.js

@@ -1,37 +1,3 @@
-// 쿠키 생성
-function setCookie(name, value, expiredays) {
-    var cookie = name + "=" + escape(value) + "; path=/;"
-    if (typeof expiredays != 'undefined') {
-        var todayDate = new Date();
-        todayDate.setDate(todayDate.getDate() + expiredays);
-        cookie += "expires=" + todayDate.toGMTString() + ";"
-    }
-    document.cookie = cookie;
-}
- 
-// 쿠키 획득
-function getCookie(name) {
-    name += "=";
-    var cookie = document.cookie;
-    var startIdx = cookie.indexOf(name);
-    if (startIdx != -1) {
-        startIdx += name.length;
-        var endIdx = cookie.indexOf(";", startIdx);
-        if (endIdx == -1) {
-            endIdx = cookie.length;
-            return unescape(cookie.substring(startIdx, endIdx));
-        }
-    }
-    return null;
-}
- 
-// 쿠키 삭제
-function deleteCookie(name) {
-    setCookie(name, "", -1);
-}
-
-// http://vip00112.tistory.com/33
-
 function opening(data) {
     var element = document.getElementById(data);
     if(element.style.display == 'none') {
@@ -39,40 +5,4 @@ function opening(data) {
     } else {
         element.style.display = 'none';
     }
-}
-
-function get_post() {
-    check = document.getElementById('strike');
-    if(check.checked == true) {
-        setCookie("set_strike", "1");
-    } else {
-        deleteCookie("set_strike");
-    }
-    
-    window.location.reload(true);
-}
-
-head_data = document.querySelector('head');
-if(getCookie("set_strike") == "1") {
-    head_data.innerHTML += '<style>s { display: none; }';
-}
-
-window.onload = function () {
-    if(window.location.pathname == '/skin_set') {
-        document.getElementById("main_top").innerHTML = '<h1>skin setting</h1>';
-        data = document.getElementById("main_data")
-        
-        set_data = {};
-        if(getCookie("set_strike") == "1") {
-            set_data["strike"] = "checked";
-        } 
-        
-        data.innerHTML =    `
-                            <input ` + set_data["strike"] + ` type="checkbox" id="strike" name="strike" value="strike"> remove strikethrough
-                            <hr>
-                            <button onclick="get_post();">Save</button>
-                            `;
-                            
-        document.title = document.title.replace(/.*(\- .*)$/, "skin setting $1");
-    }
 }

+ 69 - 0
views/neo_yousoro/js/skin_set.js

@@ -0,0 +1,69 @@
+// 쿠키 생성
+function setCookie(name, value, expiredays) {
+    var cookie = name + "=" + escape(value) + "; path=/;"
+    if (typeof expiredays != 'undefined') {
+        var todayDate = new Date();
+        todayDate.setDate(todayDate.getDate() + expiredays);
+        cookie += "expires=" + todayDate.toGMTString() + ";"
+    }
+    document.cookie = cookie;
+}
+ 
+// 쿠키 획득
+function getCookie(name) {
+    name += "=";
+    var cookie = document.cookie;
+    var startIdx = cookie.indexOf(name);
+    if (startIdx != -1) {
+        startIdx += name.length;
+        var endIdx = cookie.indexOf(";", startIdx);
+        if (endIdx == -1) {
+            endIdx = cookie.length;
+            return unescape(cookie.substring(startIdx, endIdx));
+        }
+    }
+    return null;
+}
+ 
+// 쿠키 삭제
+function deleteCookie(name) {
+    setCookie(name, "", -1);
+}
+
+// http://vip00112.tistory.com/33
+
+function get_post() {
+    check = document.getElementById('strike');
+    if(check.checked == true) {
+        setCookie("set_strike", "1");
+    } else {
+        deleteCookie("set_strike");
+    }
+    
+    window.location.reload(true);
+}
+
+head_data = document.querySelector('head');
+if(getCookie("set_strike") == "1") {
+    head_data.innerHTML += '<style>s { display: none; }';
+}
+
+window.onload = function () {
+    if(window.location.pathname == '/skin_set') {
+        document.getElementById("main_top").innerHTML = '<h1>skin setting</h1>';
+        data = document.getElementById("main_data")
+        
+        set_data = {};
+        if(getCookie("set_strike") == "1") {
+            set_data["strike"] = "checked";
+        } 
+        
+        data.innerHTML =    `
+                            <input ` + set_data["strike"] + ` type="checkbox" id="strike" name="strike" value="strike"> remove strikethrough
+                            <hr>
+                            <button onclick="get_post();">Save</button>
+                            `;
+                            
+        document.title = document.title.replace(/.*(\- .*)$/, "skin setting $1");
+    }
+}