mirror of
https://github.com/syncthing/syncthing.git
synced 2026-05-14 10:06:52 -04:00
gui: Add copy to clipboard, share by email, and share by SMS buttons to device IDs (fixes #2771, ref #3868) Add buttons to allow for simpler sharing device IDs with others. The first one copies the ID to clipboard (trying to use three different methods, depending on the browser). The second one triggers a mailto link with prefilled subject and body. The third one triggers an sms link with prefilled body. The short description of Syncthing included in the latter part of the body is a direct copy from the description at the official website https://syncthing.net. Issue #3868 is referred here, because the copy to clipboard button offers an alternative method for IE11 users to actually be able to copy device IDs without having to select it manually (which doesn't work). Signed-off-by: Tomasz Wilczyński <twilczynski@naver.com>
36 lines
2.0 KiB
HTML
36 lines
2.0 KiB
HTML
<modal id="share-device-id-dialog" status="warning" icon="{{shareDeviceIdParams.icon}}" heading="{{shareDeviceIdParams.heading}}" large="{{ shareDeviceIdParams.method == 'email' ? 'yes' : 'no' }}" closeable="yes">
|
|
<div class="modal-body" ng-switch="shareDeviceIdParams.method">
|
|
<p>
|
|
<span translate>The following text will automatically be inserted into a new message.</span>
|
|
<span>
|
|
<span ng-switch-when="email">
|
|
<span translate>Your email app should open to let you choose the recipient and send it from your own address.</span>
|
|
</span>
|
|
<span ng-switch-when="sms">
|
|
<span translate>Your SMS app should open to let you choose the recipient and send it from your own number.</span>
|
|
</span>
|
|
</span>
|
|
<span translate>You can also copy and paste the text into a new message manually.</span>
|
|
</p>
|
|
<div ng-switch-when="email">
|
|
<hr>
|
|
<h5 translate>Subject:</h5>
|
|
<pre style="word-break: normal; white-space: pre-wrap;">{{shareDeviceIdParams.subject}}<button type="button" class="btn btn-default pull-right" ng-click="copyToClipboard($event, shareDeviceIdParams.subject)" tooltip data-original-title="{{ 'Copy' | translate }}">
|
|
<span class="fa fa-clone"></span>
|
|
</button></pre>
|
|
<h5 translate>Body:</h5>
|
|
</div>
|
|
<pre style="word-break: normal; white-space: pre-wrap;">{{shareDeviceIdParams.body}}<button type="button" class="btn btn-default pull-right" ng-click="copyToClipboard($event, shareDeviceIdParams.body)" tooltip data-original-title="{{ 'Copy' | translate }}">
|
|
<span class="fa fa-clone"></span>
|
|
</button></pre>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary btn-sm" ng-click="shareDeviceId()">
|
|
<span class="{{shareDeviceIdParams.icon}}"></span> <span translate>Share</span>
|
|
</button>
|
|
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
|
|
<span class="fas fa-times"></span> <span translate>Cancel</span>
|
|
</button>
|
|
</div>
|
|
</modal>
|