Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
6b19193f
Commit
6b19193f
authored
Nov 08, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Utils/uri-tools): in progress
parent
0d40db41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
39 deletions
+17
-39
uri-tools.js
tests/ui/scripts/Utils/uri-tools.js
+17
-39
No files found.
tests/ui/scripts/Utils/uri-tools.js
View file @
6b19193f
...
...
@@ -20,32 +20,25 @@ var URI_HOST = '(' +
'
)*
'
+
'
)
'
var
URI_PCHAR
=
'
(
'
+
var
URI_PCHAR
=
'
(
?:
'
+
URI_UNRESERVED
+
'
|
'
+
URI_PCT_ENCODED
+
'
|
'
+
URI_SUB_DELIMS
+
'
|
'
+
'
[:@]
'
+
'
)
'
var
URI_USERINFO
=
'
(
'
+
'
(
'
+
URI_UNRESERVED
+
'
|
'
+
URI_PCT_ENCODED
+
'
|
'
+
URI_SUB_DELIMS
+
'
|
'
+
'
:
'
+
'
)*
'
+
'
)
'
var
URI_USERINFO
=
'
(?:
'
+
URI_UNRESERVED
+
'
|
'
+
URI_PCT_ENCODED
+
'
|
'
+
URI_SUB_DELIMS
+
'
|
'
+
'
:
'
+
'
)*
'
// Level 2. ----------------------------------------------------------
var
URI_AUTHORITY
=
'
(
'
+
'
(
'
+
URI_USERINFO
+
'
@
'
+
'
)?
'
+
URI_HOST
+
'
(
'
+
'
:
'
+
URI_PORT
+
'
)?
'
+
'
)
'
var
URI_AUTHORITY
=
'
(?:
'
+
URI_USERINFO
+
'
@
'
+
'
)?
'
+
URI_HOST
+
'
(?:
'
+
'
:
'
+
URI_PORT
+
'
)?
'
var
URI_FRAGMENT
=
'
(?:
'
+
URI_PCHAR
+
...
...
@@ -62,21 +55,17 @@ var URI_SEGMENT_NZ = URI_PCHAR + '+'
// Level 3. ----------------------------------------------------------
var
URI_PATH_ABEMPTY
=
'
(
'
+
'
(
'
+
'
/
'
+
URI_SEGMENT
+
'
)*
'
+
'
)
'
var
URI_PATH_ABEMPTY
=
'
(
?:
'
+
'
/
'
+
URI_SEGMENT
+
'
)*
'
var
URI_PATH_ABSOLUTE
=
'
(
'
+
'
/
'
+
'
(
'
+
URI_SEGMENT_NZ
+
'
(
'
+
'
/
'
+
URI_SEGMENT
+
'
)*
'
+
'
)?
'
+
'
)
'
var
URI_PATH_ABSOLUTE
=
'
/
'
+
'
(?:
'
+
URI_SEGMENT_NZ
+
'
(?:
'
+
'
/
'
+
URI_SEGMENT
+
'
)*
'
+
'
)?
'
var
URI_PATH_ROOTLESS
=
'
(
'
+
URI_SEGMENT_NZ
+
'
(
'
+
'
/
'
+
URI_SEGMENT
+
'
)*
'
+
'
)
'
var
URI_PATH_ROOTLESS
=
URI_SEGMENT_NZ
+
'
(?:
'
+
'
/
'
+
URI_SEGMENT
+
'
)*
'
// Level 4. ----------------------------------------------------------
var
URI_HIER_PART
=
'
(
'
+
var
URI_HIER_PART
=
'
(
?:
'
+
'
//
'
+
URI_AUTHORITY
+
URI_PATH_ABEMPTY
+
'
|
'
+
URI_PATH_ABSOLUTE
+
'
|
'
+
URI_PATH_ROOTLESS
+
...
...
@@ -100,8 +89,7 @@ function test () {
}
test
()
/*
/* TODO: Supports:
hier-part = "//" authority path-abempty
/ path-absolute
/ path-rootless
...
...
@@ -118,10 +106,6 @@ test()
/ path-noscheme
/ path-empty
scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
authority = [ userinfo "@" ] host [ ":" port ]
userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
host = IP-literal / IPv4address / reg-name
IP-literal = "[" ( IPv6address / IPvFuture ) "]"
...
...
@@ -156,18 +140,12 @@ test()
/ path-rootless ; begins with a segment
/ path-empty ; zero characters
path-abempty = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty = 0<pchar>
segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
; non-zero-length segment without any colon ":"
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
reserved = gen-delims / sub-delims
gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
*/
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment