Improve quote and note rendering.

This commit is contained in:
kor 2018-08-12 04:31:55 +12:00
parent 1a7f864492
commit 90021ad3cc
2 changed files with 41 additions and 7 deletions

View File

@ -1416,7 +1416,7 @@ SEE
MARRIAGE
QOTE
>'Child of divorce, professional who dealt with divorcing couples for many years, Adult who went through a divorce, remarried and volunteer counseling/mentoring for couples today.
> 'Child of divorce, professional who dealt with divorcing couples for many years, Adult who went through a divorce, remarried and volunteer counseling/mentoring for couples today.
& Here are the most common mistakes I've seen (my own as well as collectively) in the failed and struggling marriages I've seen:
& One or both spouses have unresolved childhood baggage issues that will rear its head in their adult relationships. Examples of these include (but not limited to) physical or emotional abuse/neglect in the home; sexual abuse; one or both parents had substance abuse/addiction issues; one or both partners came from a divorced or single parent household. Among the many reasons why this is such a significant factor is if you grow up in a dysfunctional environment, you have no idea how dysfunctional and unhealthy it really is. To you, its normal, it is all you've ever known. So if Mom and Dad resolved conflict by getting drunk, yelling at each other and then not speaking for days, guess what you have a chance of modeling as an adult in your own relationships?
& Understanding what "marriage as a priority" really means. When you get married, your marriage has to be the main priority in your life. Not your career, not your spouse (i.e. don't put them on a pedestal), not your kids, not your hobbies or your personal fitness. The fact is, when you get married, you no longer get to call all of the shots. Gotten used to staying up all night playing XBOX with your boys on weekends? Not going to work in a marriage for an extended period of time. You're going to have to accept the fact that if you want to have a healthy marriage, compromise is your new word of the day. In some cases you may have to give things up entirely, or learn to say "no for now." While this often tends to be more of a struggle for men, women can also struggle with this issue. I'm not saying that getting married means giving up you completely, or kiss all of your favorite activities goodbye. What I am saying is, if you want your marriage to be healthy, you now have someone else in your life who gets an equal (not dominant--equal) say in how you spend your free time.
@ -1575,13 +1575,11 @@ OVEN
NOTE
> Oven close to bed, then bench with sink can be cut diagonal
& Build right to edge (including counter lip)
&
& ENO
> ENO
& Height (400 - 470)
& Width (504 - 517)
& Depth (410 - 418)
&
& GAS
> GAS
& Height (470)
& Width (530)
& Depth (310)

View File

@ -246,7 +246,7 @@ function View()
{
if (typeof value.NOTE !== 'undefined')
{
entry += `<div class="note"><i class="fas fa-sticky-note textIcon"></i>${value.NOTE}</div>`;
entry += this.buildArrayElement(value.NOTE, "note", "fas fa-sticky-note textIcon");
}
}
@ -255,7 +255,7 @@ function View()
{
if (typeof value.QOTE !== 'undefined')
{
entry += `<div class="quote"><i class="fas fa-comment textIcon"></i>${value.QOTE}</div>`;
entry += this.buildArrayElement(value.QOTE, "quote", "fas fa-comment textIcon");
}
}
@ -488,6 +488,42 @@ function View()
this.menu.innerHTML += menuContent;
}
this.buildArrayElement = function(data, className, iconName)
{
let result = '';
if (Array.isArray(data))
{
for (var i in data)
{
if (data[i] == "& ")
{
// blank line, do nothing
}
else if (data[i].substring(0, 2) == "> ")
{
// New item
result += `<div class="${className}"><i class="${iconName}"></i>${data[i].substring(2)}</div>`;
}
else if (data[i].substring(0, 2) == "& ")
{
// New line in current item
result += `<div class="${className}">${data[i].substring(2)}</div>`;
}
else
{
// Handle unformatted
result += `<div class="${className}"><i class="${iconName}"></i>${data[i]}</div>`;
}
}
}
else
{
// Handle not array
result += `<div class="${className}"><i class="${iconName}"></i>${data}</div>`;
}
return result;
}
// HELPER
String.prototype.to_properCase = function()
{