Merge branch 'soon'

pull/1/head
ansuz 8 years ago
commit d8ca7963dc

@ -107,6 +107,9 @@ define(function () {
It's important that you modify just the string, and not the variable name which is used to access its content.
For instance, changing `_languageName` to `_language_name` would make the string `'Pirate'` inaccessible to the rest of the codebase.
If a key is not found in your translation, the default English version of that key will be used.
This is to make sure that buttons and other interface elements are not empty, but it's obviously not ideal.
## Verifying Your Translations
It's advisable to save your translation file frequently, and reload Cryptpad in your browser to check that there are no errors in your translation file.

@ -72,6 +72,23 @@ define([
});
};
var getLastName = module.getLastName = function (cb) {
Cryptpad.getAttribute('username', function (err, userName) {
cb(err, userName || '');
});
};
var setName = module.setName = function (uname, cb) {
if (typeof(uname) !== 'string') {
return void cb(new Error('expected string'));
}
uname = Cryptpad.fixHTML(uname.trim()).slice(0, 32);
Cryptpad.setAttribute('username', uname, function (err, data) {
if (err) { return void cb(err); }
cb(void 0, uname);
});
};
module.Wizard = Wizard;
// special UI elements
@ -825,6 +842,10 @@ define([
setEditable(true);
return;
// shortcircuiting before all of this code since it's not quite the
// behaviour we want, and it's a bit of work to make it Do The Right Thing
if (First) {
// assume the first user to the poll wants to be the administrator...
@ -840,39 +861,33 @@ define([
module.activeColumn = '';
var promptForName = function () {
// HERE
Cryptpad.prompt(Messages.promptName, "", function (name, ev) {
if (name === null) {
name = '';
}
if (!module.isEditable) { return; }
var followUp = function (name) {
if (!name) { return; }
var id = module.activeColumn = coluid();
Cryptpad.setPadAttribute('column', id, function (err) {
if (err) {
console.error("Couldn't remember your column id");
return;
}
console.log(id);
if (err) { return void console.error("Couldn't remember your column id"); }
makeUser(module.rt.proxy, id, name).focus().val(name);
makeUserEditable(id, true);
});
};
getLastName(function (err, uname) {
if (!uname) {
return void Cryptpad.prompt(Messages.promptName, "", function (name, ev) {
if (!(name || module.isEditable)) { return; }
followUp(name);
});
}
followUp(uname);
});
};
if (column === null) {
//console.log("Looks like you're new to this poll, why don't you make a column");
promptForName();
return;
}
if (column === null) { return void promptForName(); }
// column might be defined, but that column might have been deleted...
if (proxy.table.colsOrder.indexOf(column) === -1) {
promptForName();
return;
}
if (proxy.table.colsOrder.indexOf(column) === -1) { return void promptForName(); }
});
};

Loading…
Cancel
Save