tinymce.util.URI

This class handles parsing, modification and serialization of URI/URL strings.

Constructors

name summary defined by
URI() Constructs a new URI instance. tinymce.util.URI

Methods

name summary defined by
getURI() Returns the full URI of the internal structure. tinymce.util.URI
isSameOrigin() Determine whether the given URI has the same origin as this URI. Based on RFC-6454. Supports default ports for protocols listed in DEFAULT_PORTS. Unsupported protocols will fail safe: they won't match, if the port specifications differ. tinymce.util.URI
setPath() Sets the internal path part of the URI. tinymce.util.URI
toAbsPath() Converts a relative path into a absolute path. tinymce.util.URI
toAbsolute() Converts the specified URI into a absolute URI based on the current URI instance location. tinymce.util.URI
toRelPath() Converts a absolute path into a relative path. tinymce.util.URI
toRelative() Converts the specified URI into a relative URI based on the current URI instance location. tinymce.util.URI

Constructors

URI

public constructor function URI(url:String, settings:Object)

Constructs a new URI instance.

Parameters

Methods

getURI

getURI(noProtoHost:Boolean)

Returns the full URI of the internal structure.

Parameters

isSameOrigin

isSameOrigin(uri:tinymce.util.URI):Boolean

Determine whether the given URI has the same origin as this URI. Based on RFC-6454. Supports default ports for protocols listed in DEFAULT_PORTS. Unsupported protocols will fail safe: they won't match, if the port specifications differ.

Parameters
Return value

setPath

setPath(path:string)

Sets the internal path part of the URI.

Parameters

toAbsPath

toAbsPath(base:String, path:String)

Converts a relative path into a absolute path.

Parameters

toAbsolute

toAbsolute(uri:String, noHost:Boolean):String

Converts the specified URI into a absolute URI based on the current URI instance location.

Examples
// Converts an relative URL to an absolute URL url will be http://www.site.com/dir/somedir/somefile.htm
var url = new tinymce.util.URI('http://www.site.com/dir/').toAbsolute('somedir/somefile.htm');
Parameters
Return value

toRelPath

toRelPath(base:String, path:String)

Converts a absolute path into a relative path.

Parameters

toRelative

toRelative(uri:String):String

Converts the specified URI into a relative URI based on the current URI instance location.

Examples
// Converts an absolute URL to an relative URL url will be somedir/somefile.htm
var url = new tinymce.util.URI('http://www.site.com/dir/').toRelative('http://www.site.com/dir/somedir/somefile.htm');
Parameters
Return value

Can't find what you're looking for? Let us know.

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.