/* Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ // AMD module id = dojo/lib/backCompat // // This module defines those dojo properties/methods that are defined by // dojo/_base/_loader/loader and are still needed when loading with and // AMD loader (when loading with an AMD loader, dojo/_base/_loader/loader // is never loaded). // // note: this module is relevant only when loading dojo with an AMD loader; // it is never evaluated otherwise. define(["require", "dojo/_base/_loader/bootstrap"], function(require, dojo){ // the following dojo properties do not exist in the AMD-loaded version of dojo 1.x: var names= [ "_moduleHasPrefix", "_loadPath", "_loadUri", "_loadUriAndCheck", "loaded", "_callLoaded", "_getModuleSymbols", "_loadModule", "require", "provide", "platformRequire", "requireIf", "requireAfterIf", "registerModulePath" ], i, name; for(i = 0; i 0 && !(j == 1 && segs[0] == "") && segs[j] == ".." && segs[j-1] != ".."){ // flatten "../" references if(j == (segs.length - 1)){ segs.splice(j, 1); segs[j - 1] = ""; }else{ segs.splice(j - 1, 2); j -= 2; } } } relobj.path = segs.join("/"); } } } uri = []; if(relobj.scheme){ uri.push(relobj.scheme, ":"); } if(relobj.authority){ uri.push("//", relobj.authority); } uri.push(relobj.path); if(relobj.query){ uri.push("?", relobj.query); } if(relobj.fragment){ uri.push("#", relobj.fragment); } } this.uri = uri.join(""); // break the uri into its main components var r = this.uri.match(ore); this.scheme = r[2] || (r[1] ? "" : n); this.authority = r[4] || (r[3] ? "" : n); this.path = r[5]; // can never be undefined this.query = r[7] || (r[6] ? "" : n); this.fragment = r[9] || (r[8] ? "" : n); if(this.authority != n){ // server based naming authority r = this.authority.match(ire); this.user = r[3] || n; this.password = r[4] || n; this.host = r[6] || r[7]; // ipv6 || ipv4 this.port = r[9] || n; } }; dojo._Url.prototype.toString = function(){ return this.uri; }; dojo.moduleUrl = function(module, url){ if(!module){ //TODO: don't understand why this would ever be so, but that's the logic in loader return null; } module = amdModuleName(module) + (url ? ("/" + url) : ""); var type= "", match= module.match(/(.+)(\.[^\/]*)$/); if (match) { module= match[1]; type= match[2]; } return new dojo._Url(require.nameToUrl(module, type)); // dojo._Url }; return dojo; });