Skip to content
Snippets Groups Projects
Commit ee7b187c authored by klorpa's avatar klorpa
Browse files

PunctuationFix

parent 502375b1
No related branches found
No related tags found
1 merge request!5531Punctuation Fix
......@@ -7,8 +7,8 @@ App.FindSlave = {};
* @returns {boolean}
*/
App.FindSlave._fragmentSearch = function(haystacks, needles) {
const hs = haystacks.join(" ");
return needles.every((needle) => { return needle.test(hs); });
const hs = haystacks.join(" ");
return needles.every((needle) => { return needle.test(hs); });
};
/**
......@@ -17,12 +17,12 @@ App.FindSlave._fragmentSearch = function(haystacks, needles) {
* @returns {number[]}
*/
App.FindSlave._slaveIndices = function(predicate) {
return V.slaves.reduce((acc, slave, ind) => {
if (predicate(createReadonlyProxy(slave))) {
acc.push(ind);
}
return acc;
}, []);
return V.slaves.reduce((acc, slave, ind) => {
if (predicate(createReadonlyProxy(slave))) {
acc.push(ind);
}
return acc;
}, []);
};
/**
......@@ -31,9 +31,9 @@ App.FindSlave._slaveIndices = function(predicate) {
* @returns {DocumentFragment}
*/
App.FindSlave.searchByName = function(query) {
const needles = query.split(" ").map((needle) => { return new RegExp(needle, "i"); });
const indices = this._slaveIndices((slave) => { return this._fragmentSearch([slave.slaveName, slave.slaveSurname, slave.birthName, slave.birthSurname], needles); });
return App.UI.SlaveList.render.listDOM(indices, [], App.UI.SlaveList.SlaveInteract.stdInteract);
const needles = query.split(" ").map((needle) => { return new RegExp(needle, "i"); });
const indices = this._slaveIndices((slave) => { return this._fragmentSearch([slave.slaveName, slave.slaveSurname, slave.birthName, slave.birthSurname], needles); });
return App.UI.SlaveList.render.listDOM(indices, [], App.UI.SlaveList.SlaveInteract.stdInteract);
};
/**
......@@ -42,9 +42,9 @@ App.FindSlave.searchByName = function(query) {
* @returns {DocumentFragment}
*/
App.FindSlave.searchByBackground = function(query) {
const needles = query.split(" ").map((needle) => { return new RegExp(needle, "i"); });
const indices = this._slaveIndices((slave) => { return this._fragmentSearch([slave.career, slave.origin], needles); });
return App.UI.SlaveList.render.listDOM(indices, [], App.UI.SlaveList.SlaveInteract.stdInteract);
const needles = query.split(" ").map((needle) => { return new RegExp(needle, "i"); });
const indices = this._slaveIndices((slave) => { return this._fragmentSearch([slave.career, slave.origin], needles); });
return App.UI.SlaveList.render.listDOM(indices, [], App.UI.SlaveList.SlaveInteract.stdInteract);
};
/**
......@@ -53,7 +53,7 @@ App.FindSlave.searchByBackground = function(query) {
* @returns {DocumentFragment}
*/
App.FindSlave.searchByExpression = function(query) {
const pred = new Function("slave", "return (" + query + ");");
const indices = runWithReadonlyProxy(() => { return this._slaveIndices(pred); });
return App.UI.SlaveList.render.listDOM(indices, [], App.UI.SlaveList.SlaveInteract.stdInteract);
const pred = new Function("slave", "return (" + query + ");");
const indices = runWithReadonlyProxy(() => { return this._slaveIndices(pred); });
return App.UI.SlaveList.render.listDOM(indices, [], App.UI.SlaveList.SlaveInteract.stdInteract);
};
......@@ -4,29 +4,29 @@
After spending a minute trying to remember some details about one of your slaves, you sit down behind your desk and tell $assistantName that you need to locate a particular slave's records.<br><br>
"Certainly, <<= properMaster()>>. What can you tell me about them?"<br><br>
"Certainly, <<= properMaster()>>. What can you tell me about them?"<br><br>
"They're called something like:
<<textbox "_nameSearch" "" autofocus>>
<<link "Locate">>
<<script>>$('#slaveList').empty().append(App.FindSlave.searchByName(State.temporary.nameSearch));<</script>>
<<script>>$('#slaveList').empty().append(App.FindSlave.searchByName(State.temporary.nameSearch));<</script>>
<</link>>
<br>//(Enter a fragment of their nickname, name, surname, birth name, or birth surname)//<br><br>
"In the past, they were:
<<textbox "_backgroundSearch" "">>
<<link "Locate">>
<<script>>$('#slaveList').empty().append(App.FindSlave.searchByBackground(State.temporary.backgroundSearch));<</script>>
<<script>>$('#slaveList').empty().append(App.FindSlave.searchByBackground(State.temporary.backgroundSearch));<</script>>
<</link>>
<br>//(Enter a fragment of their origin or past job, for example, "shelter" or "lawyer")//<br><br>
"Their data should meet this condition:
<<textbox "_dataSearch" "">>
<<link "Locate">>
<<script>>$('#slaveList').empty().append(App.FindSlave.searchByExpression(State.temporary.dataSearch));<</script>>
<<script>>$('#slaveList').empty().append(App.FindSlave.searchByExpression(State.temporary.dataSearch));<</script>>
<</link>>
<br>//(Enter a conditional expression which evaluates to true for the slave you want to find, such as "slave.physicalAge >= 18 && slave.physicalAge < 21")// <br><br>
<span id="slaveList">
/* results list gets populated here by jQuery */
/* results list gets populated here by jQuery */
</span>
......@@ -93,9 +93,9 @@
<<set $enduringRep *= .5>>
<<elseif ($personalAttention == "upkeep")>>
<<if $PC.belly >= 5000>>
You spend your free time hustling around your penthouse, cleaning and making sure everything is in order. You manage to reduce your upkeep by 20%. Your <<if $PC.preg > 0>>pregnancy<<else>>big belly<</if>> slows you down some<<if $PC.counter.birthMaster > 0>>, but you're used to working around it.<</if>>
You spend your free time hustling around your penthouse, cleaning and making sure everything is in order. You manage to reduce your upkeep by 20%. Your <<if $PC.preg > 0>>pregnancy<<else>>big belly<</if>> slows you down some<<if $PC.counter.birthMaster > 0>>, but you're used to working around it<</if>>.
<<else>>
You spend your free time hustling around your penthouse, cleaning and making sure everything is in order. You manage to reduce your upkeep by 25%. <<if $PC.counter.birthMaster > 0>>This is much easier to do without a big baby bump in the way.<</if>>
You spend your free time hustling around your penthouse, cleaning and making sure everything is in order. You manage to reduce your upkeep by 25%.<<if $PC.counter.birthMaster > 0>> This is much easier to do without a big baby bump in the way.<</if>>
<</if>>
<<elseif ($personalAttention == "proclamation")>>
/* handled after this if chain */
......@@ -407,7 +407,7 @@
<</if>>
<<set $SecExp.proclamation.cooldown = 4, $personalAttention = "business">>
<<else>>
As you currently lack the minimum amount of your chosen proclamation currency, $SecExp.proclamation.currency, it woudld be unwise to attempt execution of your $SecExp.proclamation.type this week.
As you currently lack the minimum amount of your chosen proclamation currency, $SecExp.proclamation.currency, it would be unwise to attempt execution of your $SecExp.proclamation.type this week.
<</if>>
<</if>>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment