PageSourceSearch

https://member.segye.com/resources/js/member/common_2017.js

js segye.com collected 2026-10-01 10:23:59 UTC 11,735 bytes, 226 lines download raw bytes

1function ReplyCount(cnt) {
2    var contact = (cnt == "" ? "0" : cnt);
3    $("#replyCount").append(contact);
4}
5
6var segye = segye || {};
7segye.searchStart = false;
8
9segye.init = function() {
10	$(document).ready(function() {
11		
12		//totalMenu
13		$('#wrapMenu .btnTotal').click(function(){
14			$(this).toggleClass('on');
15			$('#totalMenu').stop().slideToggle(0);
16			$('.menuMask').stop().fadeToggle(0);
17		});
18		$('.menuMask').click(function(){
19			$(this).stop().hide(0).removeAttr('style');
20			$('#totalMenu').stop().hide(0).removeAttr('style');
21			$('#wrapMenu .btnTotal').removeClass('on').removeAttr('style');
22
23			$('.totalService').removeClass('active');
24			$('.totalService .btnView').removeAttr('style');
25		});
26
27		//footer-familySite
28		$('#wrapFooter .familySite i').click(function(){
29			var hasAct = $(this).parent().hasClass('active');
30			if( hasAct==false ){
31				$('#wrapFooter .familySite .cont').removeClass('active');
32				$(this).parent().addClass('active');
33			}else{
34				$(this).parent().removeClass('active');
35			}
36		});
37
38		$('.footer_open_down').css('display', 'none');
39		//$('.searchbox').css('display', 'none');
40		$("#searchWord").change(function() {
41			segye.searchStart = true;
42		});
43		$('div.sideNews').mouseenter(function() {
44			$(this).find('div.connec_article01').css('display', 'block');
45		});
46		$('div.sideNews').mouseleave(function() {
47			$(this).find('div.connec_article01').css('display', 'none');
48		});
49
50		// 메인 로그인,로그아웃 처리 
51		//$(".login").on("mouseover", function(){$('#login').css('display','block');$('#loginbox_close').css('display','block'); $('#login_view').css('display','block');$('#loginbox_close_view').css('display','block'); });
52		//$(".login_on").on("mouseover", function(){$('#logout').css('display','block'); $('#loginbox_close').css('display','block');$('#logout_view').css('display','block'); $('#loginbox_close_view').css('display','block');});
53		$(".login").on("click", function(){
54			$('#login').toggle();
55			$('#loginbox_close').toggle(); 
56			$('#login_view').toggle();
57			$('#loginbox_close_view').toggle(); 
58		});
59		$(".login_on").on("click", function(){
60			$('#logout').toggle(); 
61			$('#loginbox_close').toggle();
62			$('#logout_view').toggle(); 
63			$('#loginbox_close_view').toggle();
64		});
65		$(".loginbox_close").on("click", function(){$('#login').css('display','none');$('#logout').css('display','none');$('#loginbox_close').css('display','none');$('#login_view').css('display','none');$('#logout_view').css('display','none');$('#loginbox_close_view').css('display','none');  })
66
67    });
68}
69
70/** footer 관련 */
71segye.openFooterGNB = function() {
72    $('#footer .footer_open_down').slideToggle('fast');
73}
74
75segye.closeFooterGNB = function() {
76    $('#footer .footer_open_down').slideToggle('fast');
77    //segye.closeTopGNB();
78}
79/** footer 관련 */
80
81/** header 관련 */
82segye.openTopGNB = function() {
83    $('#topMenu .footer_open_down').css('display', 'block');
84    $('.main_navi_all').css('display', 'none');
85    $('.main_navi_close').css('display', 'block');
86    if($('#login').is(':visible')) {
87        $('#login').hide();  $('#loginbox_close').hide();
88    }
89}
90segye.closeTopGNB = function() {
91    $('#topMenu .footer_open_down').css('display', 'none');
92    $('.main_navi_close').css('display', 'none');
93    $('.main_navi_all').css('display', 'block');
94}
95/** header 관련 */
96
97segye.serachClick = function() {
98	 document.searchform.submit();
99     $("#searchWord").val("");
100}
101
102segye.viewShowGNB = function() {
103    $('.listOpen2').toggle();
104}
105segye.viewCloseGNB = function() {
106    $('.listOpen2').css("display", "none");
107}
108segye.viewSearchClick = function() {
109    $('.searchbox2').toggle('fast', function() {
110        $("#searchWord").val("");
111    });
112    $('a.search').toggleClass('searchclose');
113}
114segye.fontLarger = function() {
115    console.log('폰트 크게');
116}
117segye.fontSmaller = function() {
118    console.log('폰트 작게');
119}
120var chFont = ['14px', '15px', '16px', '17px', '18px', '19px', '20px', '21px', '22px'];
121var dfFont = 3;
122segye.changeFsize = function(fs) {
123    var obj = $('.news_text');
124    var fsize = dfFont;
125    if (fs == 'flarge') fsize += 1;
126    else
127        fsize -= 1;
128    if (fsize < 0) {
129        alert('더이상 작아지지 않습니다.');
130        fsize = 0;
131    }
132    if (fsize > 8) {
133        alert('더이상 커지지 않습니다.');
134        fsize = 8;
135    }
136    dfFont = fsize;
137    $('.news_text').css('font-size', chFont[fsize]);
138    $('.news_photo').css('font-size', chFont[fsize]);
139}
140segye.shareMailPop = function() {
141    var html = '';
142    html += '<div id="mailWrap" style="float:left; width:100%; font-family:나눔고딕, Nanum Gothic, sans-serif;">';
143    html += '   <div class="atop_logo" style="height:37px;margin:20px 0 20px 0;padding-left:15px;border-bottom:2px solid #1da948;">';
144    html += '     <a href="" target="_blank"><img src="http://img.segye.com/static/segye/resources/images/logo.png" width="107px" border="0" style="vertical-align:bottom;"/></a>&nbsp;&nbsp;';
145//    html += '     <a href="" target="_blank"><img src="http://img2.segye.com/static/segye/resources/images/logo.png" width="107px" border="0" style="vertical-align:bottom;"/></a>&nbsp;&nbsp;';
146    html += '         <span style="font-size:17px; font-weight:600; color:#444;">E메일 공유</span>';
147    html += '     <a class="close" href="javascript:;" onclick="javascript:segye.shareMailPopClose();" style="float:right;margin-right:20px;width:20px;border:1px solid #ccc;text-align:center;text-decoration:none;">X</a></h2>';
148    html += '   </div>';
149    html += '   <div class="ae_area" style="width:677px;margin:15px; border:1px #CCC solid; padding:10px 0 10px 0; border-radius:5px;">';
150    html += '      <form name="" method="POST" action="" style="padding:0 14px;">';
151    html += '         <fieldset style="border:0;">';
152    html += '            <legend></legend>';
153    html += '            <h3 class="sub_title" style="color:#1da948;width:100%; height:26px; margin:5px 10px 0 0;font-size:15px;font-weight:600;">보내는 뉴스</h3>';
154    html += '            <div class="ae_tpa" style="float:left;width:607px;height:106px;border:0;oveflow:hidden;margin:0 0 25px 0;padding:20px;background-color:#f5f6f8;border:1px #e1e1e1 solid;">';
155    html += '                 <div class="ab_ttl" style="float:left;width:608px;height:27px;padding:0;margin:0;letter-spacing:-1px;font-weight:600;font-size:24px; line-height:29px;overflow:hidden;"><a href="$!{siteUrl}/$!{news.link}">$!{title}</a></div>';
156    html += '                 <div class="ab_cnt" style="float:left;width:608px;padding:0;margin:15px 0 0 0 ;font-size:14px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;word-wrap:break-word;word-break:break-all;line-height:1.5em;height:4.5em; color:#555;">';
157    html += '                      기사 내용 들어갈 부분';
158    html += '                 </div>';
159    html += '            </div>';
160    html += '            <h3 class="sub_title" style="color:#1da948;width:100%; height:26px; margin:5px 10px 0 0;font-size:15px;font-weight:600;">보내는 메시지</h3>';
161    html += '            <span class="txt_num" style="float:right; color:#666; font-size:12px; height:13px; width:35px; margin:4px 0 0 0;">0/200</span>';
162    html += '            <textarea name="msg" onkeyup="inputLimit(this, event);" class="input_box" title="보내는 메시지 입력" placeholder="보내는 메시지 입력" style="width:642px; height:100px; margin:8px 0 0 0; color:#666;border:1px solid #e1e1e1;font-family:나눔고딕, Nanum Gothic, sans-serif; font-size:12px; padding:5px 0 0 5px;"></textarea>';
163    html += '            <br><br>';
164    html += '            <h3 class="sub_title" style="color:#1da948;width:100%; height:26px; margin:5px 10px 0 0;font-size:15px;font-weight:600;">보내는 사람</h3>';
165    html += '            <input type="text" class="aText" onkeyup="inputLimit(this, event);" placeholder="보내는 사람 이름" title="보내는 사람 이름 입력" style="width:635px;height:20px;margin:0 0 0 0px;padding:5px 5px 0 5px;border:1px solid #e1e1e1;font-size:12px;">';
166    html += '            <div class="s_txt" style="color:#F00;font-size:13px;margin:5px 0 5px 0;"></div>';
167    html += '            <input type="text" class="aText" onkeyup="inputLimit(this, event);" placeholder="보내는 사람 이메일" title="보내는 사람 이메일 입력" style="width:635px;height:20px;margin:0 0 0 0px;padding:5px 5px 0 5px;border:1px solid #e1e1e1;font-size:12px;">';
168    html += '                      <br><br>';
169    html += '            <h3 class="sub_title" style="color:#1da948;width:100%; height:26px; margin:5px 10px 0 0;font-size:15px;font-weight:600;">받는 사람<span class="txt_ex" style="float:right; color:#666; font-size:12px; height:13px; width:328px; margin:4px 0 0 0; font-weight:normal !important;">받는 사람이 여러 명일 경우 쉼표(,)로 구분해주세요. (최대 10명)</span></h3>';
170    html += '            <input type="text" class="aText receiverAddress" onkeyup="inputLimit(this, event);" placeholder="받는 사람 E메일 입력" title="받는 사람 이메일 입력" style="width:635px;height:20px;margin:0 0 0 0px;padding:5px 5px 0 5px;border:1px solid #e1e1e1;font-size:12px;">';
171    html += '            <div class="s_txt" style="color:#F00;font-size:13px;margin:5px 0 5px 0;">&apos;@&apos;를 포함해서 유효한 이메일 주소를 입력해주세요.</div>';
172    html += '            <br /><br />';
173//    html += '            <div style="text-align:center;"><a href=""><img src="http://img2.segye.com/static/segye/resources/images/btn_send.png" width="165" height="40" border="0"></a></div>';
174    html += '            <div style="text-align:center;"><a href=""><img src="http://img.segye.com/static/segye/resources/images/btn_send.png" width="165" height="40" border="0"></a></div>';
175    html += '          </fieldset>';
176    html += '       </form>';
177    html += '    </div>';
178    html += ' </div>';
179    $('#sharePopupLayer').html(html);
180    $('#sharePopupLayer').toggle();
181    $('#mailWrap').show();
182    $('#sharePopupLayer').draggable();
183}
184segye.shareMailPopClose = function() {
185    $('#sharePopupLayer').toggle();
186}
187segye.PhotoResize = function(img, maxWidth, maxHeight) {
188    if (img.width / img.height > maxWidth / maxHeight) {
189        img.width = maxWidth;
190        img.height = img.height * maxWidth / img.width;
191    } else {
192        img.height = maxHeight;
193        img.width = img.width * maxHeight / img.height;
194    }
195}
196segye.init();
197
198function getCookie(name) { 
199	var cookieName = name + "=";
200	var cookie_start = 0;
201		while ( cookie_start <= document.cookie.length ) { 
202	   var cookie_end = (cookie_start+cookieName.length); 
203			if ( document.cookie.substring( cookie_start, cookie_end ) == cookieName) { 
204				if ((lastChrCookie=document.cookie.indexOf(";", cookie_end)) == -1) 
205					lastChrCookie = document.cookie.length;
206					 return decodeURI(document.cookie.substring(cookie_end, lastChrCookie));
207				}
208					cookie_start = document.cookie.indexOf(" ", cookie_start ) + 1; 
209				 if ( cookie_start == 0 )
210					 break; 
211				 } 
212			 return "";
213}
214/** ************************************************************ */
215/** *********************** 회원가입 관련 JS ********************** */
216function MC_eregID(str) {
217    var reg = RegExp("^[a-zA-Z0-9\_\-]{2,30}$");
218    return reg.test(str);
219}
220
221function MC_eregEmail(str) {
222    var reg = RegExp(/^[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*\.[a-zA-Z]{2,3}$/i);
223    return reg.test(str);
224}
225/** *********************** 회원가입 관련 JS ********************** */
226/** ************************************************************ */

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.