-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(service): Add settings for Youbube, such as autoplay. (close #33)
- Loading branch information
Showing
6 changed files
with
97 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ mode=$2 | |
|
||
if [ -z "$mode" ] | ||
then | ||
mode="pwa" | ||
mode="spa" | ||
fi | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Uri utils | ||
* | ||
* @author Xman | ||
* @date 2019.10.17 | ||
*/ | ||
|
||
/** | ||
* 获取指定参数的值 | ||
*/ | ||
export const getQueryStringItem = (uri, key) => { | ||
let reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)') | ||
let str = uri.substr(uri.indexOf('?') + 1) | ||
let r = str.match(reg) | ||
if (r != null) { | ||
return unescape(r[2]) | ||
} else { | ||
return null | ||
} | ||
} | ||
|
||
/** | ||
* 更新指定参数的值 | ||
*/ | ||
export const updateQueryStringItem = (uri, key, value) => { | ||
if (!uri || !value) { | ||
return uri | ||
} | ||
let re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i') | ||
let separator = uri.indexOf('?') !== -1 ? '&' : '?' | ||
if (uri.match(re)) { | ||
return uri.replace(re, '$1' + key + '=' + value + '$2') | ||
} else { | ||
return uri + separator + key + '=' + value | ||
} | ||
} |