Skip to content

Commit

Permalink
Merge branch 'release/0.4.27'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Jan 11, 2020
2 parents f166ecc + d295653 commit 1639671
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [0.4.27] - 2019-01-11
### Added
- Support Web Share Target API

## [0.4.26] - 2019-01-11
### Changed
- Update dependencies
Expand Down Expand Up @@ -186,7 +190,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
### Added
- First release

[Unreleased]: https://github.com/nwtgck/piping-ui-web/compare/v0.4.26...HEAD
[Unreleased]: https://github.com/nwtgck/piping-ui-web/compare/v0.4.27...HEAD
[0.4.27]: https://github.com/nwtgck/piping-ui-web/compare/v0.4.26...v0.4.27
[0.4.26]: https://github.com/nwtgck/piping-ui-web/compare/v0.4.25...v0.4.26
[0.4.25]: https://github.com/nwtgck/piping-ui-web/compare/v0.4.24...v0.4.25
[0.4.24]: https://github.com/nwtgck/piping-ui-web/compare/v0.4.23...v0.4.24
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "piping-ui",
"version": "0.4.26",
"version": "0.4.27",
"private": true,
"author": "Ryo Ota <[email protected]> (https://github.com/nwtgck)",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
"start_url": "./index.html",
"display": "standalone",
"background_color": "#000000",
"theme_color": "#5A98E3"
"theme_color": "#5A98E3",
"share_target": {
"action": "index.html"
}
}
12 changes: 10 additions & 2 deletions src/components/PipingUI.vue
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ function randomStr(len: number, chars: ReadonlyArray<string>){
return Array.from(randomArr).map(n => chars[n % chars.length]).join('');
}
// Text from Web Share Target API
function getShareTargetText(): string | null {
return new URL(window.location.toString()).searchParams.get("text");
}
@Component({
components: {
DataUploader,
Expand All @@ -259,8 +264,11 @@ export default class PipingUI extends Vue {
private serverUrl: string = defaultServerUrls[0];
private secretPath: string = "";
private isTextMode: boolean = false;
private inputText: string = '';
private isTextMode: boolean = getShareTargetText() !== null;
private inputText: string = (() => {
const shareTargetText = getShareTargetText();
return shareTargetText === null ? '' : shareTargetText;
})();
private files: FilePondFile[] = [];
private serverUrlHistory: string[] = [];
private secretPathHistory: string[] = [];
Expand Down

0 comments on commit 1639671

Please sign in to comment.