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
f9bc26e0
Commit
f9bc26e0
authored
Nov 08, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Utils): add `uri-tools`, in progress
parent
c0e724b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
105 additions
and
0 deletions
+105
-0
resources.qrc
tests/resources.qrc
+1
-0
uri-tools.js
tests/ui/scripts/Utils/uri-tools.js
+104
-0
No files found.
tests/resources.qrc
View file @
f9bc26e0
...
...
@@ -131,6 +131,7 @@
<file>
ui/modules/Linphone/Styles/TimelineStyle.qml
</file>
<file>
ui/modules/Linphone/Timeline.qml
</file>
<file>
ui/scripts/Utils/qmldir
</file>
<file>
ui/scripts/Utils/uri-tools.js
</file>
<file>
ui/scripts/Utils/utils.js
</file>
<file>
ui/views/App/Calls/Calls.qml
</file>
<file>
ui/views/App/Calls/StartingCall.qml
</file>
...
...
tests/ui/scripts/Utils/uri-tools.js
0 → 100644
View file @
f9bc26e0
// ===================================================================
// Library to deal with URI.
// ===================================================================
// Level 0. ----------------------------------------------------------
var
URI_PCT_ENCODED
=
'
(%[[:xdigit:]]{2})
'
var
URI_PORT
=
'
([
\\
d]*)
'
var
URI_SCHEME
=
'
([[:alpha:]][[:alnum:]+
\\
-.]*)
'
var
URI_SUB_DELIMS
=
'
[!$&
\'
()*+,;=]
'
var
URI_UNRESERVED
=
'
[[:alnum:]
\\
-._~]
'
// Level 1. ----------------------------------------------------------
var
URI_HOST
=
'
(
'
+
'
(
'
+
URI_UNRESERVED
+
'
|
'
+
URI_PCT_ENCODED
+
'
|
'
+
URI_SUB_DELIMS
+
'
)*
'
+
'
)
'
var
URI_PCHAR
=
'
(
'
+
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_FRAGMENT
=
'
(
'
+
'
(
'
+
URI_PCHAR
+
'
|
'
+
'
[/?]
'
+
'
)*
'
+
'
)
'
var
URI_QUERY
=
'
(
'
+
'
(
'
+
URI_PCHAR
+
'
|
'
+
'
[/?]
'
+
'
)*
'
+
'
)
'
var
URI_SEGMENT
=
'
(
'
+
URI_PCHAR
+
'
*
'
+
'
)
'
var
URI_SEGMENT_NZ
=
'
(
'
+
URI_PCHAR
+
'
+
'
+
'
)
'
// Level 3. ----------------------------------------------------------
var
URI_PATH_ABEMPTY
=
'
(
'
+
'
(
'
+
'
/
'
+
URI_SEGMENT
+
'
)*
'
+
'
)
'
var
URI_PATH_ABSOLUTE
=
'
(
'
+
'
/
'
+
'
(
'
+
URI_SEGMENT_NZ
+
'
(
'
+
'
/
'
+
URI_SEGMENT
+
'
)*
'
+
'
)?
'
+
'
)
'
var
URI_PATH_ROOTLESS
=
'
(
'
+
URI_SEGMENT_NZ
+
'
(
'
+
'
/
'
+
URI_SEGMENT
+
'
)*
'
+
'
)
'
// Level 4. ----------------------------------------------------------
var
URI_HIER_PART
=
'
(
'
+
'
//
'
+
URI_AUTHORITY
+
URI_PATH_ABEMPTY
+
'
|
'
+
URI_PATH_ABSOLUTE
+
'
|
'
+
URI_PATH_ROOTLESS
+
'
)
'
// Level 5. ----------------------------------------------------------
// Regex to match URI. It respects the RFC 3986.
var
URI_REGEX
=
'
(
'
+
URI_SCHEME
+
'
:
'
+
URI_HIER_PART
+
'
(
'
+
'
\\
?
'
+
URI_QUERY
+
'
)?
'
+
'
(
'
+
'
#
'
+
URI_FRAGMENT
+
'
)?
'
+
'
)
'
// ===================================================================
function
test
()
{
console
.
log
(
URI_REGEX
)
}
test
()
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