PageSourceSearch

https://www.hkolympic.org/wp-content/plugins/eclass-integration/pu…on-academic-year-term-api.js?ver=2019.06.28

js hkolympic.org collected 2026-10-02 11:45:22 UTC 1,669 bytes, 69 lines download raw bytes

1jQuery(function($){
2	'use strict';
3
4	window.AcademicYearTermApi = function AcademicYearTermApi(){
5
6		//// Private var START ////
7		var _self = this;
8		var _onDataLoadFuncs = [];
9		//// Private var END ////
10		
11		//// Public var START ////
12		this.isLoading = false;
13		//// Public var END ////
14		
15		
16		//// Private func START ////
17		var _onDataLoad = function(){
18			$.each(_onDataLoadFuncs, function(index, func){
19				func(_self.data);
20			});
21		}
22		//// Private func END ////
23		
24
25		//// Public func START ////
26		this.onDataLoad = function(func){
27			if(typeof(func) == 'function'){
28				_onDataLoadFuncs.push(func);
29			}else{
30				throw new TypeError('func must be a function');
31			}
32		}; // End onDataLoad()
33		
34		this.loadData = function(callback){
35			_self.isLoading = true;
36			var deferred = $.Deferred();
37			
38			var data = {
39	            'action':'eclass_academic_year_term_api',
40	            '_ajax_nonce':ECLASS_ACADEMIC_YEAR_TERM_API._ajax_nonce
41	        };
42			
43		    $.ajax({
44		        url: ECLASS_ACADEMIC_YEAR_TERM_API.url,
45		        type: 'get',
46		        data: data,
47		        complete : function(){
48		        	_self.isLoading = false;
49		        },
50		        success: function( response ) {
51		        	if(!response){
52		        		deferred.reject(response);
53		        		return;
54		        	}
55		        	
56		        	if(typeof(callback) == 'function'){
57		        		callback(response);
58		        	}
59		        	deferred.resolve(response);
60		        },
61		    });
62		    
63		    return deferred.promise();
64		}; // End loadData()
65		//// Public func END ////
66	}; // End class AcademicYearTermApi
67	
68    
69});

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.