Repository: syncthing/syncthing
File: gui/default/syncthing/core/syncthingController.js (JavaScript)

Code before:
                textarea.style.position = "fixed";
                textarea.style.opacity = "0";
                textarea.textContent = text;
                textarea.select();
                try {
                    document.execCommand("copy");
                    return alert(success);
                }
                catch (ex) {
                    return alert(failure);
                }
                finally {
                    event.currentTarget.removeChild(textarea);
                }
            }
            return alert(failure);
        };

        $scope.shareDeviceIdBy = function(channel) {
            var body = $translate.instant("You have been invited to connect with {%name%} using Syncthing!", {name: $scope.currentDevice.name}) + "\r\n\r\n" + $translate.instant("Accept the invitation by adding a new device using the following ID.") + $translate.instant("If unsure what to do, continue reading below.") + "\r\n\r\n" + $scope.currentDevice.id + "\r\n\r\n" + $translate.instant("Syncthing is a continuous file synchronization program.") + $translate.instant("It synchronizes files between two or more computers in real time, safely protected from prying eyes.") + $translate.instant("Your data is your data alone and you deserve to choose where it is stored, whether it is shared with some third party, and how it's transmitted over the internet.") + "\r\n\r\n" + $translate.instant("For more information about Syncthing please visit https://syncthing.net.");

            if (channel == 'email') {
                var subject = $translate.instant("Invitation to connect with {%name%} using Syncthing", {name: $scope.currentDevice.name});
                location.href = "mailto:?subject=" + encodeURIComponent(subject) + "&body=" + encodeURIComponent(body);
            } else if (channel == 'sms') {
                location.href = "sms://;?&body=" + encodeURIComponent(body);
            }
        }
    })
    .directive('shareTemplate', function () {
        return {
            templateUrl: 'syncthing/core/editShareTemplate.html',
            scope: {
                selected: '=',
                encryptionPasswords: '=',
                id: '@',
                label: '@',
                folderType: '@',
                untrusted: '=',
            },
            link: function(scope, elem, attrs) {
                var plain = false;
                scope.togglePasswordVisibility = function() {
                    scope.plain = !scope.plain;
                };
            },
        }
    });


Review comment (suggestion):
The body is currently at least over 600 bytes long, depending on the device name.  That's 4 SMS messages already.  I think it should be shortened, leaving out the "If unsure what to do..." part and the paragraph below.  Also a much shorter sentence for the homepage link.

Right here I think you have a stray `&` character before the `body` parameter.

Code after:
                'ppc64': '64-bit PowerPC',
                'ppc64le': '64-bit PowerPC (LE)',
                'mips': '32-bit MIPS',
                'mipsle': '32-bit MIPS (LE)',
                'mips64': '64-bit MIPS',
                'mips64le': '64-bit MIPS (LE)',
                'riscv64': '64-bit RISC-V',
                's390x': '64-bit z/Architecture',
            }[$scope.version.arch] || $scope.version.arch;

            return $scope.version.version + ', ' + os + ' (' + arch + ')';
        };

        $scope.versionBase = function () {
            if (!$scope.version.version) {
                return '';
            }
            var version = $scope.version.version;
            var pos = version.indexOf('-');
            if (pos > 0) {
                version = version.slice(0, pos);
            }
            return version;
        };

        $scope.docsURL = function (path) {
            var url = 'https://docs.syncthing.net';
            if (!path) {
                // Undefined or null should become a valid string.
                path = '';
            }
            var hash = path.indexOf('#');
            if (hash != -1) {
                url += '/' + path.slice(0, hash);
                url += '?version=' + $scope.versionBase();
                url += path.slice(hash);
            } else {
                url += '/' + path;
                url += '?version=' + $scope.versionBase();
            }
            return url;
        };

        $scope.inputTypeFor = function (key, value) {
            if (key.substr(0, 1) === '_') {
                return 'skip';
            }
            if (value === null) {
                return 'null';
            }
            if (typeof value === 'number') {