PageSourceSearch

https://sinchon517.com/js/module/latest.js

js sinchon517.com collected 2026-09-26 15:33:47 UTC 27,285 bytes, 622 lines download raw bytes

1(function (jQuery) {
2
3	$doc = $(document);
4
5	window.onload = function(){
6		setLanguage(LANG);
7	}
8	$(function() {
9		if(typeof LANG == 'undefined') LANG = getLanguage();
10	});
11
12
13	var latestURL = function() {
14		var last_url_str = '';
15		if(PAGE_MODE == 'c') last_url_str = '/'+CONFIG_URL+'config/page';
16		else last_url_str = (PAGE_MODE=='s') ? '' : '/render';
17
18		return last_url_str;	
19	}
20
21	var latestRow = function(latest_id, row, num, loop, data_type, data_type2, settings, fpage, fview, total, view_level,namemask) {
22		var last_url = latestURL();
23		var ua = window.navigator.userAgent.toLowerCase(),
24			checkIE = (ua.indexOf('MSIE ') > 0 || (window.navigator.appName == 'Netscape' && navigator.userAgent.search('Trident') != -1)) ? true : false;
25
26		var $loop = $(loop).removeClass('active'),
27			last_href = (data_type == 'forum') ? last_url + '/forum/view/' + row.id : last_url + '/gallery_page/view/' + row.id,
28			empty = (row.title == '' && row.content == '') ? true : false,
29			icon_notice = (row.option == 'N') ? '<i class="latest-notice-icon cl-icon notice01" aria-hidden="true"></i> ' : '',
30			icon_secret = (row.option == 'S') ? '<i class="latest-secret-icon cl-icon lock02" aria-hidden="true"></i> ' : '',
31			icon_new = (row.new) ? '<img src="https://storage.googleapis.com/i.addblock.net/icon/icon_new_forum.png" title="new" alt="new">' : '';
32
33		var latestEL = $('.element[data-id="' + latest_id + '"]'),
34			elsetting = (typeof settings != 'undefined' && settings) ? $.parseJSON(settings) : {},
35			max_title	= (typeof elsetting.max_title != 'undefined' && elsetting.max_title) ? elsetting.max_title : ((checkIE) ? 70 : 250),
36			max_cont	= (typeof elsetting.max_cont != 'undefined' && elsetting.max_cont) ? elsetting.max_cont : ((checkIE) ? 150 : 400);
37			/* max unit - byte*/
38
39		var checkLogin = false;
40		if (PAGE_MODE == 'c') {
41			checkLogin = true;
42	    } else {
43	    	var umemberActivate = Number(property.UMEMBER_ACTIVATE);
44			var umember = property.UMEMBER;
45			checkLogin = umember.check_login;
46			if(umemberActivate == 0 && umember.id_type == 'creatorlink') { //creatorlink login
47	            checkLogin = (umember.id !== undefined && umember.id)? true : false; 
48	        }
49	    }
50        
51		if(data_type == 'forum' && data_type2 == 'qna') {
52			var n = total+num+1;
53			var page_num = 1;
54			var last_page = Math.ceil(total/fview);
55			for(var i = 1; i<=last_page; i++) {
56				if(fview*i >= n) {
57					page_num = i;
58					break;
59				}
60			}
61			
62			// $.forum.setForumCookie(row.id,page_num,'','','');
63			last_href = (view_level != 'A' && !checkLogin)? last_url + '/forum/view/' + row.id : last_url + '/' + fpage;
64		}
65		if($loop.find('.latest-post-list-title').length > 0) {
66			var checkNew = ($loop.find('.latest-post-list-new').length > 0) ? true : false,
67				checkTitle_Comment = ($loop.find('.latest-post-list-comment').prev('.latest-post-list-title').length > 0) ? true : false,
68				checkTitle_New = (	$loop.find('.latest-post-list-new').prev('.latest-post-list-comment').length > 0 ||
69									$loop.find('.latest-post-list-new').prev('.latest-post-list-title').length > 0
70								) ? true : false,
71				checkTitleinNew = ($loop.find('.latest-post-list-title .latest-post-list-new').length > 0) ? true : false,
72				new_str = (checkTitleinNew) ? $loop.find('.latest-post-list-title .latest-post-list-new').outerHTML() : '',
73				checkNewPos = ($loop.find('.latest-post-list-new').prev('.latest-post-list-title').length > 0) ? true : false; // new 앞에 title 오는지 여부 체크
74
75			var title_str = (row.title.length > 0) ? cutStrInBytes(row.title,max_title) : '',
76				title_href = (data_type == 'forum' && (empty || title_str == '')) ? '<a href="javascript:;" class="deleted">' + $.lang[LANG]['board.post.deleted'] + '</a>' : '<a href="' + last_href + '">' + title_str + '</a> ';
77
78			$loop.find('.latest-post-list-title').html(icon_notice + icon_secret + title_href).attr({'data-option':row.option,'data-id':row.id});
79			if(data_type == 'forum' && data_type2 == 'qna') {
80				$loop.find('.latest-post-list-title > a').attr({'data-page':page_num,'data-forum-type':data_type2, 'data-user-link':last_href});
81			}
82			
83			if(checkNew) {
84				if(checkTitleinNew) $loop.find('.latest-post-list-title').append($(new_str).html(icon_new).outerHTML());
85				else $loop.find('.latest-post-list-new').html(icon_new);
86				
87				var checkLatestComment = (!$loop.find('.latest-post-list-comment').hasClass('hide') && row.comment) ? true : false,
88					checkLatestNew = (!$loop.find('.latest-post-list-new').hasClass('hide') && ((!empty && title_str) && icon_new)) ? true : false,
89					lc_w = (checkTitle_Comment && checkLatestComment) ? parseInt(row.
89comment.toString().length) * 10 : 0,
90					add_pd = 0;
91
92				if(checkTitle_Comment && checkLatestComment) add_pd+= (30 + lc_w);
93				if(checkTitle_New && checkLatestNew) add_pd+= 40;
94
95				if(add_pd > 0) {
96					$loop.find('.latest-post-list-title').css('padding-right',add_pd+'px');
97
98					var add_ml = add_pd - 5;
99					if($('.element[data-id="'+ latest_id +'"]').hasClass('modoo')) add_ml = 0;
100					if(checkTitle_Comment && checkLatestComment) {
101						$loop.find('.latest-post-list-comment').css('margin-left','-'+add_ml+'px');
102						add_ml -= (15 + lc_w);
103					}
104					if(checkTitle_New && checkLatestNew) {
105						const disabledFields = elsetting.field_disable ?? [];
106						const isCommentDisabled = !disabledFields.includes('comment');
107
108						if(isCommentDisabled && row.comment == 0 && !checkNewPos) add_ml = add_ml + 25;
109						$loop.find('.latest-post-list-new').css('margin-left','-'+add_ml+'px');
110						// console.log(row.comment );
111						// console.log(elsetting.field_disable);
112						// console.log(add_ml);
113					}
114				}
115			}
116
117			// if(row.depth>0 && row.option!='N') {
118				// $loop.find('.latest-post-list-title').addClass('reply');
119				// $loop.find('.latest-post-list-title').prepend('<span class="latest-post-list-reply-name">' + row.reply_name + '</span>');
120			// }
121		}
122
123
124		if($loop.find('.latest-post-list-cont').length > 0) {
125				var row_cont = row.cont.replace(/<span class=\"fr-file\"[^>]*>((\n|\r|.)*?)<\/span>/gim,' ');
126
127				var cont_txt = (row.cont.length > 0) ? row_cont.replace(/(<([^>]+)>)/ig,'') : '',
128				cont_str = (cont_txt.length > 0) ? cutStrInBytes(cont_txt,max_cont) : '',
129				cont_href = (cont_str == '') ? '<a href="javascript:;" class="deleted"></a>' : '<a href="' + last_href + '">' + cont_str + '</a>';
130
131			$loop.find('.latest-post-list-cont').html(cont_href).attr('data-option',row.option).attr('data-id',row.id);
132		}
133
134
135		if($loop.find('.latest-post-list-thumb').length > 0) {
136			var lfolder = $('.element[data-id="' + latest_id + '"]').attr('data-width'),
137				thumb_empty = (typeof row.thumb != 'undefined' && row.thumb && row.thumb != 0) ? false : true,
138				content_noimage_img = (thumb_empty && row.content_noimage_img) ? setResizeImageFolder(lfolder,row.content_noimage_img) : row.content_noimage_img,
139				thumb_src = (thumb_empty) ? ((row.content_noimage_img) ? content_noimage_img : 'https://storage.googleapis.com/i.addblock.net/icon/noimage_' + lfolder +'.png') : row.thumb.replace('\/60\/','\/' + lfolder + '\/'),
140				thumb_href = (row.cont == '') ? '<a href="javascript:;" class="deleted"></a>' : '<a class="latest_thumb_a" href="' + last_href + '"></a>';
141
142			$loop.find('.latest-post-list-thumb img').attr('src',thumb_src);
143			if($loop.find('.latest-post-list-thumb .latest_thumb_a').length==0) $loop.find('.latest-post-list-thumb img').wrap(thumb_href);
144			else $loop.find('.latest-post-list-thumb .latest_thumb_a').attr('href',last_href);
145
146			$loop.find('.latest-post-list-thumb img').attr('alt',row.title);
147
148			if(thumb_empty) {
149				$loop.find('.latest-post-list-thumb').addClass('empty').attr('data-option',row.option).attr('data-id',row.id);
150				$loop.find('.latest-post-list-thumb.empty .noimage_text').remove();
151				if(!row.content_noimage_img) {
152					var text = '<p class="noimage_text noselect">no image</p>';
153					if($loop.find('.latest-post-list-thumb .noimage_text').length==0) $loop.find('.latest-post-list-thumb.empty').append(text);
154				}
155			} else $loop.find('.latest-post-list-thumb').removeClass('empty').attr('data-option',row.option).attr('data-id',row.id);
156			
157			if(!$loop.find('.latest-post-list-thumb img').attr('src').includes('noimage')) $loop.find('.latest-post-list-thumb .noimage_text').remove();
158		}
159
160		var check_modoo = $('.dsgn-body').hasClass('modoo'),
161			fm_name_str;
162
163		if (check_modoo) {
164			if (namemask === 'ON') {
165				var name = row.fm_name.trim();
166				var len = name.length;
167				var cnt = len > 5 ? 5 : len === 2 || len === 1 ? 3 : len;
168				var mask = '***';
169				var masked_name = len === 2
170					? name.replace(/(.{1})(.*?)$/su, '$1' + mask)
171					: name.replace(/(.{2})(.*?)$/su, '$1' + mask);
172				fm_name_str = `<span class="writer">${masked_name}</span><span class="date _registerTime" data-register-time="2023-06-29 16:57:13">${row.date}</span>`;
173			} else {
174				fm_name_str = `<span class="writer">${row.fm_name}</span><span class="date _registerTime" data-register-time="2023-06-29 16:57:13">${row.date}</span>`;
175			}
176		} else {
177			fm_name_str = `${row.date}`;
178		}
179
180
181
182
183			
184		$loop.find('.latest-post-list-date').html(fm_name_str);
185		
186		if(row.comment > 0) $loop.find('.latest-post-list-comment').text(row.comment);
187		else $loop.find('.latest-post-list-comment').text('');
188
189		if(row.hit > 0) $loop.find('.latest-post-list-hit').text(row.hit);
190		else $loop.find('.latest-post-list-hit').text('');
191
192		if($loop.find('.latest-post-list-cate').length > 0) {
193			if(row.cate) {
194				$loop.find('.latest-post-list-cate').removeClass('empty');
195				if(data_type == 'gallery') {
196					var $cate = $loop.find('.latest-post-list-cate').children().clone(),
197						replace_cate = '',
198						g_cate = row.cate.replace(/\|/g,'').replace(/\,/g,', '),
199						g_cate_arr = g_cate.split(',');
200
201					$.each(g_cate_arr, function(i,v) {
202						replace_cate += $cate.text(v).prop('outerHTML');
203					});
204					$loop.find('.latest-post-list-cate').html(replace_cate);
205				} else {
206					$loop.find('.latest-post-list-cate li').text(row.cate);
207				}
208			} else {
209				$loop.find('.latest-post-list-cate li').text('').parent().addClass('empty');
210			}
211		}
212
213		return $loop[0].outerHTML;
214	}
215
216	$.latest = {
217		init: function(latest_id, latest_data) {
218			var L_SID = (typeof SID == 'undefined') ? property.SID : SID,
219				// L_ONE = (typeof ONE == 'undefined') ? property.ONE : ONE,
220				L_PAGE = (typeof PAGE == 'undefined') ? property.PAGE : PAGE,
221				L_PUBLISH = (typeof property == 'undefined') ? false : property.PUBLISH,
222				L_VALIDPLAN = (typeof VALIDPLAN == 'undefined') ? property.VALIDPLAN : VALIDPLAN,
223				L_VALIDTYPE = (typeof VALIDTYPE == 'undefined') ? property.VALIDTYPE : VALIDTYPE;
224			var is_templates = checkTemplateSite(L_SID);
225
226			var $latest_el = $('.element[data-id="' + latest_id + '"]'),
227				post_view = (typeof $latest_el.find('[data-loop="true"]').attr('data-view') == 'undefined') ? 5 : $latest_el.find('[data-loop="true"]').attr('data-view');
228
229			if(PAGE_MODE != 'c' && !is_templates && (!L_VALIDPLAN || L_VALIDTYPE == 'PK')) {
230				$latest_el.html('').addClass('hide');
231				return false;
232			}
233
234			if($.isEmptyObject(latest_data)) {
235				$latest_el.addClass('latest-sample-block');
236				$latest_el.find('.latest-table-loop').removeClass('latest-table-empty');
237				$latest_el.find('.latest-post-empty').remove();
238
239				if(PAGE_MODE == 'c') {
240					$.ajax({
241						url: '/template/element/type/get/seq/' + latest_id,
242						dataType: 'json',
243						type: 'POST',
244						data: { sid : L_SID, use : 'latest' },
245						async: false,
246						cache: false,
247						success: function(data) {
248							checkError(data);
249							var tableSet = $.latest.setTableColumn(latest_id,latest_data,data[0]);
250							tableSet.then(function() {
251								$.latest.initLatestBlock(latest_id,data[0]['elsettings']);
252							});
253
254							// before code :: sample table 1 < connected table 2, field error
255							// var blockSet = $.latest.initLatestBlock(latest_id,data[0]['elsettings']);
256							// blockSet.then(function() {
257							// 	$.latest.setTableColumn(latest_id,latest_data,data[0]);
258							// });
259						}
260					});
261				} else {
262
263					var el_idx = $('.element[data-id="' + latest_id + '"]').attr('data-el').replace('el_',''),
264						el_target = (typeof property.CONTENTS['el'+latest_id] != 'undefined') ? property.CONTENTS['el'+latest_id]['element'] : property.pageContent[L_PAGE][el_idx];
265					
266					if(typeof  el_target['elsettings'] != 'undefined') {
267						var tableSet = $.latest.setTableColumn(latest_id,latest_data,el_target);
268						tableSet.then(function() {
269							$.latest.initLatestBlock(latest_id,el_target['elsettings']);
270						});
271						// before code :: sample table 1 < connected table 2, field error
272						// var blockSet = $.latest.initLatestBlock(latest_id,el_target['elsettings']);
273						// blockSet.then(function() {
274						// 	$.latest.setTableColumn(latest_id,latest_data,el_target);
275						// });
276					}
277				}
278
279			} else {
280				$latest_el.removeClass('latest-sample-block');
281
282				$.ajax({
283					url: '/template/latest/',
284					dataType: 'json',
285					type: 'POST',
286					data: { sid : L_SID, type : 'get', latest_id : latest_id, view : post_view, latest_data : latest_data, publish : L_PUBLISH },
287					async: false,
288					cache: false,
289					success: function(r_data) {
290						var _latest_data = latest_data;
291
292						if($.isEmptyObject(r_data['data'])) {
293							_latest_data = new Array();
294							var tableSet = $.latest.setTableColumn(latest_id,_latest_data,r_data['empty_data']);
295							tableSet.then(function() {
296								$.latest.initLatestBlock(latest_id,r_data['empty_data']['elsettings']);
297							});
298
299							// before code :: sample table 1 < connected table 2, field error
300							// var blockSet = $.latest.initLatestBlock(latest_id,r_data['empty_data']['elsettings']);
301							// blockSet.then(function() {
302							// 	$.latest.setTableColumn(latest_id,_latest_data,r_data['empty_data']);
303							// });
304						} else { 
305
306							if(typeof r_data['empty_data']['drop_data'] != 'undefined') { //delete table data(drop)
307
308								var temp_data = new Array(),
309									drop_idx = 0;
310
311								$.each(_latest_data, function(i,o) {
312									if(typeof o != 'undefined') {
313										var check_key = o['type']+o['seq'];
314										if(typeof r_data['empty_data']['drop_data'][check_key] == 'undefined') {
315											temp_data.push(o);
316											temp_data[drop_idx]['idx'] = drop_idx;
317											drop_idx++;
318										}
319									}
320								});
321								_latest_data = temp_data;
322							}
323
324							$.each(r_data['data'], function(i,o) {
325								
326								$namemask = (typeof o['namemask_display'] != 'undefined') ? o['namemask_display'] : '';
327								
328								if(i == 0) {
329									var tableSet = $.latest.setTableColumn(latest_id,_latest_data,o);
330									tableSet.then(function() {
331										$.latest.initLatestBlock(latest_id,o.elsettings);
332									}).then(function() {
333										
334										$.latest.update(latest_id,post_view,i,o,$namemask);
335									});
336
337									// before code :: sample table 1 < connected table 2, field error
338									// var blockSet = $.latest.initLatestBlock(latest_id,o.elsettings);
339									// blockSet.then(function() {
340									// 	$.latest.setTableColumn(latest_id,_latest_data,o);
341									// }).then(function() {
342									// 	$.latest.update(latest_id,post_view,i,o);
343									// });
344								} else {
345									
346									$.latest.update(latest_id,post_view,i,o,$namemask);
347								}
348							});
349
350						}
351						
352
353					}
354				});
355
356			}
357
358
359		},
360		initLatestBlock: function(latest_id, settings) {
361		    var df_block = $.Deferred();
362
363			var $latest_el = $('.dsgn-body .element[data-id="' + latest_id + '"]'),
364				elsetting = (typeof settings != 'undefined' && settings) ? $.parseJSON(settings) : {},
365				latest_color = (typeof elsetting.latest_color != 'undefined' && elsetting.latest_color) ? elsetting.latest_color : 'black',
366				field_disable = (typeof elsetting.field_disable != 'undefined' && !$.isEmptyObject(elsetting.field_disable)) ? elsetting.field_disable : [],
367				field_listSet = ['title', 'cont', 'cate', 'date', 'comment', 'new', 'hit'];
368
369			if($latest_el.find('.latest-table[style="outline: rgb(71, 137, 231) dashed 1px;"]').length) {
370				$latest_el.find('.latest-table[style="outline: rgb(71, 137, 231) dashed 1px;"]').removeAttr('style');
371			}
372			
373			// SET - Color mode
374			$latest_el.attr('data-latest-color',latest_color);
375
376			// SET - Field disable
377			$.each(field_listSet, function(i,v) {
378				if($.inArray(v,field_disable) > -1) {
379					$latest_el.find('.latest-post-list-'+v).each(function() { $(this).removeAttr('style').addClass('hide'); });
380				} else {
381					$latest_el.find('.latest-post-list-'+v).each(function() { $(this).removeAttr('style').removeClass('hide'); });
382				}
383			});
384
385			if($.inArray('header', field_disable) > -1) {
386                $latest_el.find('.lt-header').addClass('hide');
387            }
388
389			if(typeof elsetting.latest_data != 'object' && $.isEmptyObject(elsetting.latest_data)) {
390				if($latest_el.find('.latest-post-list-new').length > 0) $.latest.setFieldPosition($latest_el);
391			}
392
393			df_block.resolve();
394			return df_block.promise();
395		},
396		setTableColumn: function(latest_id, latest_data, el_data) {
397
398		    var df_column = $.Deferred();
399
400		    /*
401				*[data-loop="true"][data-view="1~15"][data-draw-type="col|line"][data-draw-col="col-lg,col
401-md,col-sm,col-xs"]
402			- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
403				[data-view="1~15"] : number of post : Table of .latest-post lenght
404				[data-draw-type="col|line"] : col  - Align Table Horizontally
405												 line - Align Table Vertical
406				[data-draw-col="col-lg,col-md,col-sm,col-xs"] : draw type=col  - .latest-table class
407												 				   draw type=line - .latest-post  class
408			*/
409			var colval = ['',12,6,4,3,15,2],
410				default_col_set = [[1,1,1,1],[2,2,2,1],[3,3,2,1],[4,4,2,2],[5,5,2,1]];
411
412			var $latest_el = $('.dsgn-body .element[data-id="' + latest_id + '"]'),
413				sample_el_tag = (typeof el_data['eltag'] != 'undefined') ? htmlspecialchars_decode(el_data['eltag'],'ENT_QUOTES') : el_data.source,
414				$sample_el = $(sample_el_tag).hasClass($latest_el.attr('data-name')) ? $(sample_el_tag) : $latest_el,
415				post_view = $latest_el.find('[data-loop="true"]').attr('data-view');
416
417			/* SET - Table block name reset */
418			$latest_el.find('.latest-table-header').each(function(i) { 
419				$(this).find('.lt-header').text('Title');
420			});
421
422
423			/*
424				SET - Table number
425			- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
426				Table Delete or Add
427			*/
428			var sample_table = $sample_el.find('[data-loop="true"] .latest-table').eq(0).clone();
429			sample_table.find('.latest-table-loop').removeClass('latest-table-empty').find('.latest-post-empty').remove();
430
431			setPanelTranslate(sample_table);
432
433			if($.isEmptyObject(latest_data) || 
434				(!$.isEmptyObject(latest_data) && (latest_data.length < $latest_el.find('[data-loop="true"] .latest-table').length) ) ) {
435				var table_set_idx = ($.isEmptyObject(latest_data)) ? 0 : latest_data.length-1;
436
437				$latest_el.find('[data-loop="true"]').children('.latest-table:gt('+ (table_set_idx) +')').each(function(i) {
438					$(this).remove();
439				});
440
441				if($.isEmptyObject(latest_data)) {
442					$latest_el.addClass('latest-sample-block');
443					$latest_el.find('[data-loop="true"]').html($sample_el.find('[data-loop="true"]').html());
444					$.latest.initLatestBlock(latest_id,el_data['elsettings']);
445				}
446
447			} else if ($latest_el.find('[data-loop="true"] .latest-table').length < latest_data.length) {
448
449				$.each(latest_data, function(i,o) {
450					if($latest_el.find('[data-loop="true"] .latest-table').eq(i).length == 0) {
451						$latest_el.find('[data-loop="true"]').append('\n	\t'+sample_table.prop('outerHTML')+'\n');
452					}
453				});
454			}
455
456			/*
457				SET - Column class
458			- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
459				[draw-type='col']  .latest-table
460				[draw-type='line'] .latest-post
461			*/
462			var draw_type = $latest_el.find('[data-loop="true"]').attr('data-draw-type'),
463				draw_col = $latest_el.find('[data-loop="true"]').attr('data-draw-col'),
464				draw_col_target = (draw_type == 'col') ? 'latest-table' : 'latest-post',
465				col = (typeof draw_col != 'undefined' && draw_col) ? draw_col.split(',') : new Array(),
466				col_change = (draw_type == 'col') ? true : false;
467
468			if(col.length == 0) {
469				switch(draw_type) {
470					case 'col':
471						col = ($.isEmptyObject(latest_data)) ? default_col_set[0] : default_col_set[latest_data.length - 1];
472						break;
473
474					case 'line':
475						var post_size = [0,0,1,2,3,4,3,3,4,3,4,3,3,4,3,4];
476						col = default_col_set[post_size[post_view]];
477
478						$latest_el.find('[data-loop="true"] .latest-table .latest-table-loop').each(function() {
479							if($(this).find('.latest-post').length > post_view) {
480								col_change = true;
481								$(this).find('.latest-post:gt('+ (post_view-1) +')').each(function(i) {
482									$(this).remove();
483								});
484							} else if($(this).find('.latest-post').length < post_view) {
485								col_change = true;
486								var latest_table_post =  $(this).find('.latest-post').eq(0).clone();
487								for(var n_i = $(this).find('.latest-post').length; n_i < post_view; n_i++) {
488									$(this).append('\n	\t'+latest_table_post.prop('outerHTML') +' \n');
489								}
490							}
491						});
492						break;
493
494					case 'layout':
495						break;
496
497					default:
498						return false;
499						break;
500				}
501			} else {
502				if(draw_type == 'col' && $latest_el.find('[data-loop="true"] .latest-table').length != latest_data.length) col_change = true;
503			}
504
505			
506			if(!$.isEmptyObject(latest_data) && draw_type != 'layout') {
507				var col_class = 'col-xs-' + colval[col[3]] + ' col-sm-' + colval[col[2]] + ' col-md-' + colval[col[1]] + ' col-lg-' + colval[col[0]],
508					$col_target = $latest_el.find('[data-loop="true"] .'+draw_col_target);
509
510				$col_target.each(function(i) {
511					var org_class = $(this).attr('class').split(' '),
512						new_class = '';
513
514					$.each(org_class, function(i,v) {
515						if(v.indexOf('col-') == -1) new_class += v + ' ';
516					});
517					new_class = new_class + col_class;
518					$(this).removeClass().addClass(new_class);
519				});
520			}
521
522
523			// SET - Table header
524			// var table_headers = $latest_el.find('.latest-table-header').map(function(i) { return $(this).prop('outerHTML'); }).get();
525			// $.each(table_headers, function(i,v) {
526			// 	$latest_el.find('.latest-table-header').eq(i).replaceWith(v);
527			// });
528
529
530			df_column.resolve();
531			return df_column.promise();
532		},
533		setFieldPosition: function(latest_el) {
534			if($(latest_el).length == 0) return;
535
536			var $latest_el = $(latest_el),
537				checkNew = ($latest_el.find('[data-loop="true"] .latest-post-list-new').length > 0) ? true : false;
538			if(!checkNew) return;
539			
540			var checkTitle_Comment = ($latest_el.find('[data-loop="true"] .latest-post-list-comment').prev('.latest-post-list-title').length > 0) ? true : false,
541				checkTitle_New = (	$latest_el.find('[data-loop="true"] .latest-post-list-new').prev('.latest-post-list-comment').length > 0 ||
542									$latest_el.find('[data-loop="true"] .latest-post-list-new').prev('.latest-post-list-title').length > 0
543								) ? true : false;
544			if(!checkTitle_Comment && !checkTitle_New) return;
545
546			$latest_el.find('[data-loop="true"] .latest-post').each(function() {
547				var checkLatestComment = (	!$(this).find('.latest-post-list-comment').hasClass('hide') &&
548											$(this).find('.latest-post-list-comment').text().length > 0
549										) ? true : false,
550					checkLatestNew = (	!$(this).find('.latest-post-list-new').hasClass('hide') &&
551										$(this).find('.latest-post-list-new img').length > 0
552									) ? true : false,
553					lc_w = (checkTitle_Comment && checkLatestComment) ? parseInt($(this).find('.latest-post-list-comment').text().length) * 10 : 0,
554					add_pd = 0;
555
556				if(checkTitle_Comment && checkLatestComment) add_pd+= (30 + lc_w);
557				if(checkTitle_New && checkLatestNew) add_pd+= 40;
558
559				if(add_pd > 0) {
560					$(this).find('.latest-post-list-title').css('padding-right',add_pd+'px');
561
562					var add_ml = add_pd - 5;
563					if($(latest_el.selector).hasClass('modoo')) add_ml = 0;
564					if(checkTitle_Comment && checkLatestComment) {
565						$(this).find('.latest-post-list-comment').css('margin-left','-'+add_ml+'px');
566						add_ml -= (15 + lc_w);
567					}
568					if(checkTitle_New && checkLatestNew) {
569						$(this).find('.latest-post-list-new').css('margin-left','-'+add_ml+'px');
570					}
571				}
572			});
573
574		},
575		update: function(latest_id,post_view,data_idx,data,namemask) {
576			// elsetting = (typeof settings != 'undefined' && settings) ? $.parseJSON(settings) : {},
577			var $latest_el = $('.dsgn-body .element[data-id="' + latest_id + '"]'),
578				$latest_table =  $latest_el.find('[data-loop="true"] .latest-table').eq(data_idx),
579				latest_table_header = $latest_table.find('.latest-table-header').clone().prop('outerHTML'),
580				latest_table_loop = $latest_table.find('.latest-table-loop').clone().html('').removeClass('latest-table-empty').prop('outerHTML'),
581				loop = $latest_table.find('.latest-post').eq(0).clone().prop('outerHTML'),
582				check_modoo = $('.dsgn-body').hasClass('modoo'),
583				modoo_more_btn = (check_modoo) ? `
584				<a data-user-link="/${data.fpage}" href="/${data.fpage}" class="summary_btn_more"><span class="text">${$.lang[LANG]['config.loadmore']}</span><span class="icon nicon_forward2"><span class="blind">이동</span></span></a>
585				` : '';
586
587			if(data.total == 0) {
588				var msg = (data.msg) ? data.msg : $.lang[LANG]['board.no-posts'],
589					post_empty_class = $latest_table.find('.latest-table-header').attr('class').replace('latest-table-header',''),
590					$latest_post_empty = $latest_table.find('.latest-post-empty'),
591					check_display_none = new Array('page-off','undefined');
592
593				$latest_table.find('.latest-table-header .lt-header').html('<a href="/'+ data.fpage +'" data-user-link="/' + data.fpage + '" data-lt-header="true">' + data.blockname + '</a>'+modoo_more_btn);
594				if($.inArray(data.msg,check_display_none) == -1) {
595					$latest_table.attr({'data-idx': data_idx, 'data-pid': data.seq, 'data-type': data.type});
596				}
597				
598				if($latest_post_empty.length > 0) {
599					$latest_post_empty.text(msg);
600				} else {
601					$latest_table.find('.latest-table-loop').addClass('latest-table-empty').prepend('<div class="latest-post-empty ' + post_empty_class + '">' + msg + '</div>');
602				}
603
604			} else {
605				$latest_table.html('');
606				$latest_table.attr({'data-idx': data_idx, 'data-pid': data.seq, 'data-type': data.type});
607
608				$.each(data.list, function(i,v) {
609					var num = data.total - (post_view - i);
610					if(i == 0) {
611						$latest_table.append('\n' + latest_table_header + '\n	\t' + latest_table_loop + '\n');
612						$latest_table.find('.latest-table-header .lt-header').html('<a href="/'+ data.fpage +'" data-user-link="/' + data.fpage + '" data-lt-header="true">' + data.blockname + '</a>'+modoo_more_btn);
613					}
614					$latest_table.find('.latest-table-loop').append('\n    \t' + latestRow(latest_id, v, num, loop, data.type, data.type2, data.elsettings, data.fpage, Number(data.view_cnt), data.list.length, data.view_level,namemask) + '\n');
615				});
616			}
617
618
619
620		},
621	}
622})(jQuery);

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.