PageSourceSearch

https://cdn.psschool.in.th/assets/js/script.js

js psschool.in.th collected 2026-10-01 23:53:55 UTC 4,383 bytes, 186 lines download raw bytes

1$(document).ready(function() {
2	//$(".fancybox").fancybox(fancybox_option);
3});
4
5function open_url(url)
6{
7	location.href=url;
8}
9
10function dialog()
11{
12	var ret;
13	var _title = arguments[0];
14	var _message = arguments[1];
15	var _icon = arguments[2];
16	var _modal = arguments[3];
17	var _callback_ok = arguments[4];
18	var _callback_cancel = arguments[5];
19
20	var _fancybox_option = new Object();
21
22	_fancybox_option = {
23		minWidth   : 250,
24		maxWidth   : 1000,
25		maxHeight  : 650,
26		autoSize   : true,
27		closeClick : false,
28		fitToView  : false,
29		closeBtn   : true
30	}
31
32	_fancybox_option.afterShow = function(){
33		$('#fancybox_dialog_confirm_btn').click(function(){
34			if(_callback_ok != undefined)
35				_callback_ok.call(this,ret);
36			dialog_close();
37		});
38
39		$('#fancybox_dialog_cancel_btn').click(function(){
40			if(_callback_cancel != undefined)
41				_callback_cancel.call(this,ret);
42			dialog_close();
43		});
44	}
45
46	if(_modal == true)
47	{
48		_fancybox_option.modal = true;
49		$(".fancybox").fancybox(_fancybox_option);
50	}else{
51		_fancybox_option.closeBtn = true;
52		_fancybox_option.modal = false;
53		$(".fancybox").fancybox(_fancybox_option);
54	}
55
56	var dialog_btn = '#fancybox_dialog_btn';
57	var dialog_box = '#fancybox_dialog_box';
58
59	$(dialog_btn).attr('href',dialog_box);
60	$(dialog_btn).removeClass('fancybox.ajax');
61	$(dialog_box+' .fancybox-dialog-title-text').html(_title);
62	$(dialog_box+' .fancybox-dialog-detail').html(_message);
63	$(dialog_box+' .fancybox-dialog-title-icon').attr('class','fancybox-dialog-title-icon icon-'+_icon);
64	$(dialog_btn).trigger('click');
65}
66
67function dialog_ajax()
68{
69	var _url = arguments[0];
70	var _data = arguments[1];
71	var _modal = arguments[2];
72
73	var dataString = "";
74
75	_fancybox_option = {
76		minWidth   : 400,
77		maxWidth   : 1000,
78		maxHeight  : 650,
79		autoSize   : true,
80		closeClick : false,
81		fitToView  : false,
82		closeBtn   : true
83	}
84
85	if(_data != undefined)
86	{ 
87		dataString ='?data='+encodeURIComponent(JSON.stringify(_data)); 
88	}
89
90	if(_modal == true)
91	{
92		_fancybox_option.modal = true;
93		$(".fancybox").fancybox(_fancybox_option);
94	}else{
95		_fancybox_option.closeBtn = true;
96		_fancybox_option.modal = false;
97		$(".fancybox").fancybox(_fancybox_option);
98	}
99
100	var dialog_btn = '#fancybox_dialog_btn';
101
102	$(dialog_btn).attr('href',_url+''+dataString);
103	$(dialog_btn).addClass('fancybox.ajax');
104	$(dialog_btn).trigger('click');
105}
106
107function dialog_close()
108{
109	$.fancybox.close();
110}
111
112function show_alert(_message,_object)
113{
114	dialog_warnning('แจ้งเตือน',_message,_object,false);
115}
116
117function show_confirm(_message,_callback_confirm,_callback_cancel)
118{
119	_message += '<p></p><div style="text-align:left" class="img-responsive"><button class="btn btn-sm btn-primary" id="fancybox_dialog_confirm_btn">ตกลง</button> <button class="btn btn-sm btn-info" id="fancybox_dialog_cancel_btn">ยกเลิก</button></div>'
120	dialog_info('ยืนยัน',_message,undefined,true,_callback_confirm,_callback_cancel);
121}
122
123function show_delete(_message,_callback_confirm,_callback_cancel)
124{
125	_message += '<p></p><div style="text-align:right"><button class="btn btn-sm btn-default" id="fancybox_dialog_confirm_btn">ตกลง</button> <button class="btn btn-sm btn-default" id="fancybox_dialog_cancel_btn">ยกเลิก</button></div>'
126	dialog_danger('ลบ',_message,undefined,true,_callback_confirm,_callback_cancel);
127}
128
129function show_loading(_message){
130	dialog_normal('Loding... Please wait.',_message,undefined,true);
131}
132
133function dialog_warnning(_title,_message,_object,_modal)
134{
135	dialog(_title,_message,'warnning',_modal);
136
137	if(_object != undefined)
138	{
139		_object.focus();	
140	}
141
142}
143
144function dialog_danger(_title,_message,_object,_modal,_callback_confirm,_callback_cancel)
145{
146	dialog(_title,_message,'danger',_modal,_callback_confirm,_callback_cancel);
147
148	if(_object != undefined)
149	{
150		_object.focus();	
151	}
152
153}
154
155function dialog_info(_title,_message,_object,_modal,_callback_confirm,_callback_cancel)
156{
157	dialog(_title,_message,'info',_modal,_callback_confirm,_callback_cancel);
158
159	if(_object != undefined)
160	{
161		_object.focus();	
162	}
163
164}
165
166function dialog_success(_title,_message,_object,_modal)
167{
168	dialog(_title,_message,'success',_modal);
169
170	if(_object != undefined)
171	{
172		_object.focus();	
173	}
174
175}
176
177function dialog_normal(_title,_message,_object,_modal)
178{
179	dialog(_title,_message,'normal',_modal);
180
181	if(_object != undefined)
182	{
183		_object.focus();	
184	}
185
186}

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.