Changeset 342 for trunk/zoo-project/zoo-api/js/ZOO-api.js
- Timestamp:
- Oct 12, 2011, 1:13:15 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-api/js/ZOO-api.js
r278 r342 331 331 return ZOO.String.isNumeric(value) ? parseFloat(value) : value; 332 332 } 333 }; 334 335 /** 336 * Class: ZOO.Class 337 * Object for creating CLASS 338 */ 339 ZOO.Class = function() { 340 var len = arguments.length; 341 var P = arguments[0]; 342 var F = arguments[len-1]; 343 var C = typeof F.initialize == "function" ? 344 F.initialize : 345 function(){ P.prototype.initialize.apply(this, arguments); }; 346 347 if (len > 1) { 348 var newArgs = [C, P].concat( 349 Array.prototype.slice.call(arguments).slice(1, len-1), F); 350 ZOO.inherit.apply(null, newArgs); 351 } else { 352 C.prototype = F; 353 } 354 return C; 355 }; 356 /** 357 * Function: create 358 * Function for creating CLASS 359 */ 360 ZOO.Class.create = function() { 361 return function() { 362 if (arguments && arguments[0] != ZOO.Class.isPrototype) { 363 this.initialize.apply(this, arguments); 364 } 365 }; 366 }; 367 /** 368 * Function: inherit 369 * Function for inheriting CLASS 370 */ 371 ZOO.Class.inherit = function (P) { 372 var C = function() { 373 P.call(this); 374 }; 375 var newArgs = [C].concat(Array.prototype.slice.call(arguments)); 376 ZOO.inherit.apply(null, newArgs); 377 return C.prototype; 378 }; 379 /** 380 * Function: inherit 381 * Function for inheriting CLASS 382 */ 383 ZOO.inherit = function(C, P) { 384 var F = function() {}; 385 F.prototype = P.prototype; 386 C.prototype = new F; 387 var i, l, o; 388 for(i=2, l=arguments.length; i<l; i++) { 389 o = arguments[i]; 390 if(typeof o === "function") { 391 o = o.prototype; 392 } 393 ZOO.Util.extend(C.prototype, o); 394 } 395 }; 396 /** 397 * Class: ZOO.Util 398 * Object for utilities 399 */ 400 ZOO.Util = ZOO.Util || {}; 401 /** 402 * Function: extend 403 * Function for extending object 404 */ 405 ZOO.Util.extend = function(destination, source) { 406 destination = destination || {}; 407 if (source) { 408 for (var property in source) { 409 var value = source[property]; 410 if (value !== undefined) { 411 destination[property] = value; 412 } 413 } 414 } 415 return destination; 333 416 }; 334 417 … … 6124 6207 */ 6125 6208 'complex': function(identifier,data) { 6126 var input = new XML('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier><wps:Data><wps:ComplexData><![CDATA['+data.value+']]></wps:ComplexData></wps:Data></wps:Input>'); 6127 input.*::Data.*::ComplexData.@mimeType = data.mimetype ? data.mimetype : 'application/json'; 6209 var input = new XML('<wps:Input xmlns:wps="'+this.namespaces['wps']+'"><ows:Identifier xmlns:ows="'+this.namespaces['ows']+'">'+identifier+'</ows:Identifier>'+(data.value?'<wps:Data><wps:ComplexData><![CDATA['+data.value+']]></wps:ComplexData></wps:Data>':(data.xlink?'<wps:Reference xmlns:xlink="'+this.namespaces['xlink']+'" xlink:href="'+data.xlink+'" mimeType="'+data.mimeType+'" />':''))+'</wps:Input>'); 6210 if(data.xlink) 6211 input.*::Reference.@mimeType = data.mimetype ? data.mimetype : 'application/json'; 6212 else 6213 input.*::Data.*::ComplexData.@mimeType = data.mimetype ? data.mimetype : 'application/json'; 6128 6214 if (data.encoding) 6129 6215 input.*::Data.*::ComplexData.@encoding = data.encoding;
Note: See TracChangeset
for help on using the changeset viewer.