1/** 2 * Created by sasaki on 2016/12/15. 3 * 4 * jQueryå¿ è¦ 5 */ 6 7if ( 8 window.location.host !== 'cp.coreserver.jp' && 9 window.location.host !== 'cp2.coreserver.jp' && 10 window.location.host !== 'cp.xrea.com' && 11 window.location.host !== 'cp2.xrea.com' 12) { 13 $("html").hide(); 14} 15 16// ã°ãã¼ãã«ãã¼ã ã¹ãã¼ã¹ 17var API = API || {}; 18 19//Server class ã³ã³ã¹ãã©ã¯ã¿ 20API.Server = function (server,url,params) { 21 server = server || 'os1.xrea.com'; 22 url = url || '/server/spec'; 23 params = params || {}; 24 // this.servers_list = servers_list || ''; 25 26 this.setServer(server); 27 this.setUrl(url); 28 this.setParams(params); 29 30}; 31API.Server.prototype.setServer = function(server) 32{ 33 if (server) { 34 this.server = server; 35 } 36}; 37API.Server.prototype.setUrl = function(url) 38{ 39 if (url) { 40 this.url = url; 41 } 42}; 43API.Server.prototype.setParams = function(params) 44{ 45 if (params) { 46 this.params = params; 47 } 48}; 49API.Server.prototype.request = function(callback,errorCallback,alwaysCallback) 50{ 51 //$.support.cors = true;//IE9 52 53 //console.log(this.params); 54 var api_host = "api-"; 55 56 if(this.server.startsWith("v2")) { 57 api_host = "api.api-"; 58 } 59 60 $.ajax({ 61 type: 'POST', 62 url: "https://"+api_host+this.server+this.url+"/", 63 data: this.params, 64 // data:JSON.stringify(this.params), 65 //crossDomain: true, 66 //contentType: 'text/plain', 67 contentType: 'application/x-www-form-urlencoded', 68 timeout: 150000, 69 dataType: 'json' 70 }).done(function(data,textStatus,jqXHR) { 71 //console.log(data,textStatus,jqXHR); 72 data.status_code = parseInt(data.status_code); 73 data.error_code = parseInt(data.error_code); 74 if (data.status_code!==200) { 75 //alert("Response Error. ("+data.status_code+")"); 76 } 77 if (typeof(callback)==='function') { 78 callback(data); 79 } 80 }).fail(function(jqXHR,textStatus,errorThrown) { 81 //console.log(jqXHR,textStatus,errorThrown); 82 alert("Server Error. Please try again later."); 83 if (typeof(errorCallback)==='function') { 84 errorCallback(jqXHR); 85 } 86 }).always(function () { 87 //console.log("always"); 88 if (typeof(alwaysCallback)==='function') { 89 alwaysCallback(); 90 } 91 }); 92 return true; 93}; 94
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.