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

Code before:
                        $translate.instant("To accept the invitation, add a new device using the ID below."),
                        deviceID,
                        $translate.instant("Syncthing is a continuous file synchronization program. It synchronizes files between two or more computers in real time, safely protected from prying eyes. 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."),
                        footer
                    ].join('\r\n\r\n');
                    break;
                case "sms":
                    params.heading = $translate.instant("Share by SMS");
                    params.icon = "fa fa-comments-o";
                    // SMS is limited to 160 characters (non-Unicode), so we keep
                    // it as short as possible, e.g. by stripping hyphens from
                    // device ID. The current minimum length is around 140 chars,
                    // but some room is required for longer sharing device names.
                    params.body = [
                        title,
                        deviceID.replace(/-/g, ''),
                        footer
                    ].join('\n\n');
                    break;
                default:
            }
            $scope.shareDeviceParams = params;
            $('#share-device-confirmation').modal('show');
        };

        $scope.shareDevice = function () {
            switch ($scope.shareDeviceParams.type) {
                case 'email':
                    location.href = 'mailto:?subject=' + encodeURIComponent($scope.shareDeviceParams.subject) + '&body=' + encodeURIComponent($scope.shareDeviceParams.body);
                    break;
                case 'sms':
                    location.href = 'sms://;?&body=' + encodeURIComponent($scope.shareDeviceParams.body);
                    break;
                default:
            }
        }

        $scope.showTooltip = function (newTooltip) {
            var e = event.currentTarget;
            var oldTooltip = e.getAttribute('data-original-title');

            e.setAttribute('data-original-title', newTooltip);
            $(e).tooltip('show');
            if (oldTooltip) {
                e.setAttribute('data-original-title', oldTooltip);
            } else {
                e.removeAttribute('data-original-title');
            }
        };

        $scope.copyToClipboard = function (content) {

Review comment (suggestion):
`shareDeviceMessage()` maybe?  Just from the function name, I'd expect this to do something like `shareFolderWithDevice()` does.

Code after:
                return 'skip';
            }
            return 'text';
        };

        $scope.themeName = function (theme) {
            var translation = $translate.instant("theme-name-" + theme);
            if (translation.indexOf("theme-name-") == 0) {
                // Fall back to simple Title Casing on missing translation
                translation = theme.toLowerCase().replace(/(?:^|\s)\S/g, function (a) {
                    return a.toUpperCase();
                });
            }
            return translation;
        };

        $scope.modalLoaded = function () {
            // once all modal elements have been processed
            if ($('modal').length === 0) {
                // pseudo main. called on all definitions assigned
                initController();
            }
        };

        $scope.toggleUnits = function () {
            $scope.metricRates = !$scope.metricRates;
            try {
                window.localStorage["metricRates"] = $scope.metricRates;
            } catch (exception) { }
        };

        $scope.sizeOf = function (dict) {
            if (dict === undefined) {
                return 0;
            }
            return Object.keys(dict).length;
        };

        $scope.has = function (array, element) {
            return array.indexOf(element) >= 0;
        };

        $scope.dismissNotification = function (id) {
            var idx = $scope.config.options.unackedNotificationIDs.indexOf(id);
            if (idx > -1) {
                $scope.config.options.unackedNotificationIDs.splice(idx, 1);
                $scope.saveConfig();
            }
        };

        $scope.abbreviatedError = function (addr) {