MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / extend$f

Function extend$f

codebase/sources/dhtmlxscheduler.es.js:4277–4450  ·  view source on GitHub ↗
(scheduler2)

Source from the content-addressed store, hash-verified

4275 return result;
4276}
4277function extend$f(scheduler2) {
4278 scheduler2.Promise = typeof window !== "undefined" ? window.Promise : Promise;
4279 function createConfig(method, args) {
4280 var result = { method };
4281 if (args.length === 0) {
4282 throw new Error("Arguments list of query is wrong.");
4283 }
4284 if (args.length === 1) {
4285 if (typeof args[0] === "string") {
4286 result.url = args[0];
4287 result.async = true;
4288 } else {
4289 result.url = args[0].url;
4290 result.async = args[0].async || true;
4291 result.callback = args[0].callback;
4292 result.headers = args[0].headers;
4293 }
4294 if (method === "POST" || "PUT") {
4295 if (args[0].data) {
4296 if (typeof args[0].data !== "string") {
4297 result.data = serialize$1(args[0].data);
4298 } else {
4299 result.data = args[0].data;
4300 }
4301 } else {
4302 result.data = "";
4303 }
4304 }
4305 return result;
4306 }
4307 result.url = args[0];
4308 switch (method) {
4309 case "GET":
4310 case "DELETE":
4311 result.callback = args[1];
4312 result.headers = args[2];
4313 break;
4314 case "POST":
4315 case "PUT":
4316 if (args[1]) {
4317 if (typeof args[1] !== "string") {
4318 result.data = serialize$1(args[1]);
4319 } else {
4320 result.data = args[1];
4321 }
4322 } else {
4323 result.data = "";
4324 }
4325 result.callback = args[2];
4326 result.headers = args[3];
4327 break;
4328 }
4329 return result;
4330 }
4331 scheduler2.ajax = { cache: true, method: "get", serializeRequestParams: serialize$1, parse: function(data) {
4332 if (typeof data !== "string")
4333 return data;
4334 var obj;

Callers 1

factoryMethodFunction · 0.70

Calls 4

createConfigFunction · 0.70
parseMethod · 0.65
callEventMethod · 0.65
bindMethod · 0.65

Tested by

no test coverage detected