PageSourceSearch

https://spo.go.kr/applex_wdigm_html5/applet/ui/js/jquery.alerts.js

js spo.go.kr collected 2026-09-24 08:29:14 UTC 8,741 bytes, 249 lines download raw bytes

1// WDIGM jQuery Alert Dialogs Plugin
2//
3// Version 1.0
4//
5// Product by 2gu™
6//
7// Usage:
8//		jAlert( message, [title, callback] )
9//		jConfirm( message, [title, callback] )
10//		jPrompt( message, [value, title, callback] )
11// 
12
13jQuery.noConflict();
14(function($) {
15	
16	$.alerts = {		
17		// These properties can be read/written by accessing $.alerts.propertyName from your scripts at any time		
18		verticalOffset: -75,				// vertical offset of the dialog from center screen, in pixels
19		horizontalOffset: 0,				// horizontal offset of the dialog from center screen, in pixels/
20		repositionOnResize: true,			// re-centers the dialog on window resize
21		overlayOpacity: .1,					// transparency level of overlay
22		overlayColor: '#FFF',				// base color of overlay
23		draggable: true,					// make the dialogs draggable (requires UI Draggables plugin)
24		okButton: " í™•인 ",         // text for the OK button
25		cancelButton: ' ì·¨ì†Œ ',  	// text for the Cancel button
26		dialogClass: null,					// if specified, this class will be applied to all dialogs
27		
28		// Public methods
29		
30		alert: function(message, title, version, callback) {
31			if( title == null ) title = 'Alert';
32			$.alerts._show(title, version, message, null, 'alert', function(result) {
33				if( callback ) callback(result);
34			});
35		},
36		
37		confirm: function(message, title, version, callback) {
38			if( title == null ) title = 'Confirm';
39			$.alerts._show(title, version, message, null, 'confirm', function(result) {
40				if( callback ) callback(result);
41			});
42		},
43			
44		prompt: function(message, value, title, version, callback) {
45			if( title == null ) title = 'Prompt';
46			$.alerts._show(title, version, message, value, 'prompt', function(result) {
47				if( callback ) callback(result);
48			});
49		},
50		// Private methods
51		
52		_show: function(title, version, msg, value, type, callback) {
53			
54			$.alerts._hide();
55			$.alerts._overlay('show');
56			
57			$("BODY").append(				
58			  '<div id="popup_container">' +
59			  '<p id="popup_title"><span style="color:blue">PrivacyScanner</span> <span style="color:red">Filter</span> '+version+'</p>' +
60			  '<p id="skp_win"></p>' +
61			  	'<div id="popup_content">' +			  	
62			  		'<div id="popup_information">'+title+'<span style="color:blue"><br>개인정보 및 금칙어</span> <span style="color:red">삭제</span> 후 다시 작성 바랍니다.</div><br>' +			  		
63			  		'<div id="popup_resinfo"></div><br>'+
64			  		'<table width="450" class="tbl_style1">' +  /* table test */
65						'<TR><TH width="150" align="center"> 구분</TH>' +
66						'<TH width="100" align="center"> 검출항목 </TH>' +
67						'<TH width="180" align="center"> 검출내용</TH></TR>' +
68						'<TR><TD colspan="3">' +
69						'<div id="popup_message" style="border:0px solid c3c3c3; height:200px; overflow-y:scroll;"></div>' +
70						'</TD></TR>' +
71					'</table>'+			  					  		
72			  	'</div>' +			  	
73			  	'<div id="popup_button"></div>' +
74			  	'<br>' +
75			  '</div>');
76			
77			if( $.alerts.dialogClass ) $("#popup_container").addClass($.alerts.dialogClass);
78			
79			// IE6 Fix 
80			//var pos = ($.browser.msie && parseInt($.browser.version) <= 6 ) ? 'fixed' : 'absolute'; 
81			
82			$("#popup_container").css({
83				position: 'absolute',	// fixed, absolute, relative
84				zIndex: 99000,
85				padding: 0,
86				margin: 0
87			});
88			
89			//$("#popup_title").text("PrivacyScanner-Filter 5.0.1");
90			$("#popup_content").addClass(type);
91			//$("#popup_information").text(title);    				// information
92			$("#popup_resinfo").text("개인정보 및 금칙어 검출 결과:");			// result info
93			$("#popup_message").text(msg);							// result
94			$("#popup_message").html( $("#popup_message").text().replace(/\n/g, '<br />') );
95			
96			$("#popup_container").css({
97				minWidth: $("#popup_container").outerWidth(),
98				maxWidth: $("#popup_container").outerWidth()
99			});
100
101			$("#popup_title").dblclick(function() {
102				var x;
103				var person=prompt("글쓰기를 허용하려면 password를 입력하세요","");
104
105				if (person!=null){
106					x= person;
107				}
108				if(x=="rltnfwldnjs"){
109					def_skip = false;
110				} else {
111				}
112			});
113			
114			$.alerts._reposition();
115			$.alerts._maintainPosition(true);
116			
117			switch( type ) {
118				case 'alert':
119					$("#popup_button").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /></div>');
120					$("#popup_ok").click( function() {						
121						$.alerts._hide();
122						//location.reload();
123						callback(true);
124					});
125					$("#popup_ok").focus().keypress( function(e) {
126						if( e.keyCode == 13 || e.keyCode == 27 ) $("#popup_ok").trigger('click');
127					});
128				break;
129				case 'confirm':
130					$("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>');
131					$("#popup_ok").click( function() {
132						$.alerts._hide();
133						if( callback ) callback(true);
134					});
135					$("#popup_cancel").click( function() {
136						$.alerts._hide();
137						if( callback ) callback(false);
138					});
139					$("#popup_ok").focus();
140					$("#popup_ok, #popup_cancel").keypress( function(e) {
141						if( e.keyCode == 13 ) $("#popup_ok").trigger('click');
142						if( e.keyCode == 27 ) $("#popup_cancel").trigger('click');
143					});
144				break;
145				case 'prompt':
146					$("#popup_message").append('<br /><input type="text" size="30" id="popup_prompt" />').after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>');
147					$("#popup_prompt").width( $("#popup_message").width() );
148					$("#popup_ok").click( function() {
149						var val = $("#popup_prompt").val();
150						$.alerts._hide();
151						if( callback ) callback( val );
152					});
153					$("#popup_cancel").click( function() {
154						$.alerts._hide();
155						if( callback ) callback( null );
156					});
157					$("#popup_prompt, #popup_ok, #popup_cancel").keypress( function(e) {
158						if( e.keyCode == 13 ) $("#popup_ok").trigger('click');
159						if( e.keyCode == 27 ) $("#popup_cancel").trigger('click');
160					});
161					if( value ) $("#popup_prompt").val(value);
162					$("#popup_prompt").focus().select();
163				break;
164			}
165			
166			// Make draggable
167			if( $.alerts.draggable ) {
168				try {
169					$("#popup_container").draggable({ handle: $("#popup_title") });
170					$("#popup_title").css({ cursor: 'move' });
171				} catch(e) { /* requires jQuery UI draggables */ }
172			}
173		},
174		
175		_hide: function() {
176			$("#popup_container").remove();
177			$.alerts._overlay('hide');
178			$.alerts._maintainPosition(false);
179		},
180		
181		_overlay: function(status) {
182			switch( status ) {
183				case 'show':
184					$.alerts._overlay('hide');
185					$("BODY").append('<div id="popup_overlay"></div>');
186					$("#popup_overlay").css({
187						position: 'absolute',	// absolute, relative, fixed
188						zIndex: 99000,
189						top: '0px',
190						left: '0px',
191						width: '100%',
192						height: $(document).height(),
193						background: $.alerts.overlayColor,
194						opacity: $.alerts.overlayOpacity
195					});
196				break;
197				case 'hide':
198					$("#popup_overlay").remove();
199				break;
200			}
201		},
202		
203		_reposition: function() {
204			var top = Math.abs((($(window).height() / 2) - ($("#popup_container").outerHeight() / 2)) + $.alerts.verticalOffset);
205			var left = Math.abs((($(window).width() / 2) - ($("#popup_container").outerWidth() / 2)) + $.alerts.horizontalOffset);
206			
207			if( top < 0 ) top = 0;
208			if( left < 0 ) left = 0;
209			
210			// IE6 fix
211			//if( $.browser.msie && parseInt($.browser.version) <= 6 ) top = top + $(window).scrollTop();
212			
213			$("#popup_container").css({
214				top: top + 'px',
215				left: left + 'px'
216			});
217			$("#popup_overlay").height( $(document).height() );			
218		},
219		
220		_maintainPosition: function(status) {
221			if( $.alerts.repositionOnResize ) {
222				switch(status) {
223					case true:
224						$(window).bind('resize', function() {
225							$.alerts._reposition();
226						});
227					break;
228					case false:
229						$(window).unbind('resize');
230					break;
231				}
232			}
233		}		
234	}
235	
236	// Shortuct functions
237	jAlert = function(message, title, version, callback) {
238		return $.alerts.alert(message, title, version, callback);		
239	}
240	
241	jConfirm = function(message, title, version, callback) {
242		$.alerts.confirm(message, title, version, callback);
243	};
244		
245	jPrompt = function(message, value, title, version, callback) {
246		$.alerts.prompt(message, value, title, version, callback);
247	};
248	
249})(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.