', {'class': 'fa fa-spinner fa-pulse'}).appendTo($div);
+
+ $spinner.hide();
+ var displayName = obj[USERNAME_KEY] || '';
+ $input.val(displayName);
+
+ // When the display name is changed (enter or button clicked)
+ var todo = function () {
+ displayName = $input.val();
+ obj[USERNAME_KEY] = displayName;
+ $spinner.show();
+ Cryptpad.whenRealtimeSyncs(store.info.realtime, function () {
+ $spinner.hide();
+ $ok.show();
+ });
+ };
+ $input.on('keyup', function (e) {
+ if ($input.val() !== displayName) { $ok.hide(); }
+ if (e.which === 13) { todo(); }
+ });
+ $save.click(todo);
+
+ // On remote change
+ var onChange = function () {
+ if (obj[USERNAME_KEY] !== $input.val()) {
+ $input.val(obj[USERNAME_KEY]);
+ $input.focusout();
+ }
+ };
+ onRefresh(onChange);
+
+ return $div;
+ };
+
+ var createResetDrive = function (obj) {
+ var $div = $('', {'class': 'resetDrive'});
+ var $label = $('