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

Function extend$f

codebase/sources/dhtmlxscheduler.js:4281–4454  ·  view source on GitHub ↗
(scheduler2)

Source from the content-addressed store, hash-verified

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