mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-26 17:10:11 -04:00
FEATURE: Add options to hide paragraphs and para headings
This commit is contained in:
parent
2542da4ac0
commit
5a54a1a803
@ -22,7 +22,7 @@ passage .passage-text {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
text-indent: 1em;
|
//text-indent: 1em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ import { Component, EventEmitter, Output, Input, OnInit, ElementRef } from '@ang
|
|||||||
import { OpenData, CardItem } from '../../pages/search/search';
|
import { OpenData, CardItem } from '../../pages/search/search';
|
||||||
import { BiblePassageResult, BibleService, BiblePassage, BibleVerse, HashTable, Paragraph } from '../../services/bible-service';
|
import { BiblePassageResult, BibleService, BiblePassage, BibleVerse, HashTable, Paragraph } from '../../services/bible-service';
|
||||||
import { Reference } from '../../libs/Reference';
|
import { Reference } from '../../libs/Reference';
|
||||||
|
import { ProfileService } from '../../services/profile-service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'passage',
|
selector: 'passage',
|
||||||
@ -27,7 +28,7 @@ export class Passage implements OnInit
|
|||||||
data: BiblePassageResult;
|
data: BiblePassageResult;
|
||||||
ref: Reference;
|
ref: Reference;
|
||||||
|
|
||||||
constructor(private bibleService: BibleService, private elementRef: ElementRef)
|
constructor(private bibleService: BibleService, private elementRef: ElementRef, private profileService: ProfileService)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,11 +177,19 @@ export class Passage implements OnInit
|
|||||||
getParas(ch: BiblePassage)
|
getParas(ch: BiblePassage)
|
||||||
{
|
{
|
||||||
// group the verses into paragraphs.
|
// group the verses into paragraphs.
|
||||||
|
|
||||||
// create an initial paragraph to hold verses that might come before a paragraph.
|
// create an initial paragraph to hold verses that might come before a paragraph.
|
||||||
let para: BiblePara = { p: { h: '', p: 0 }, vss: [] };
|
let para: BiblePara = { p: { h: '', p: 0 }, vss: [] };
|
||||||
let paras: BiblePara[] = [];
|
let paras: BiblePara[] = [];
|
||||||
|
|
||||||
|
// if you aren't showing paragraphs, stick em all in the same paragraph.
|
||||||
|
if (!this.profileService.profile().show_paragraphs)
|
||||||
|
{
|
||||||
|
para.vss = ch.vss;
|
||||||
|
paras.push(para);
|
||||||
|
return paras;
|
||||||
|
}
|
||||||
|
|
||||||
// for each verse in the chapter, break them into paragraphs.
|
// for each verse in the chapter, break them into paragraphs.
|
||||||
for (let v of ch.vss)
|
for (let v of ch.vss)
|
||||||
{
|
{
|
||||||
|
@ -44,6 +44,15 @@
|
|||||||
<ion-label>Show Verse #'s</ion-label>
|
<ion-label>Show Verse #'s</ion-label>
|
||||||
<ion-toggle color="dark" [(ngModel)]="this.profileService.profile().show_verse_numbers" (ionChange)="save()"></ion-toggle>
|
<ion-toggle color="dark" [(ngModel)]="this.profileService.profile().show_verse_numbers" (ionChange)="save()"></ion-toggle>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Show Paragraphs</ion-label>
|
||||||
|
<ion-toggle color="dark" [(ngModel)]="profileService.profile().show_paragraphs" (ionChange)="save()"></ion-toggle>
|
||||||
|
</ion-item>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Show Paragraph Headings</ion-label>
|
||||||
|
<ion-toggle color="dark" [(ngModel)]="profileService.profile().show_paragraph_headings" (ionChange)="save()"></ion-toggle>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
<ion-list-header>Adjust Text</ion-list-header>
|
<ion-list-header>Adjust Text</ion-list-header>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
@ -65,9 +74,6 @@
|
|||||||
<ion-item>
|
<ion-item>
|
||||||
<button ion-button (click)="profileService.logout()">Logout</button>
|
<button ion-button (click)="profileService.logout()">Logout</button>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item>
|
|
||||||
<button ion-button (click)="profileService.Refresh()">Refresh</button>
|
|
||||||
</ion-item>
|
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
</ion-menu>
|
</ion-menu>
|
||||||
|
@ -9,10 +9,7 @@
|
|||||||
<ion-content padding>
|
<ion-content padding>
|
||||||
<ng-template [ngIf]="profileService.profile()">
|
<ng-template [ngIf]="profileService.profile()">
|
||||||
<h4>Search Settings</h4>
|
<h4>Search Settings</h4>
|
||||||
<ion-item>
|
|
||||||
<button ion-button (click)="profileService.reset()">Reset Settings</button>
|
|
||||||
</ion-item>
|
|
||||||
|
|
||||||
<ng-template [ngIf]="!profileService.currentUser()">
|
<ng-template [ngIf]="!profileService.currentUser()">
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<button ion-button (click)="profileService.authenticate()">Login With Google</button>
|
<button ion-button (click)="profileService.authenticate()">Login With Google</button>
|
||||||
@ -43,6 +40,14 @@
|
|||||||
<ion-label>Each Verse on New Line</ion-label>
|
<ion-label>Each Verse on New Line</ion-label>
|
||||||
<ion-toggle color="dark" [(ngModel)]="profileService.profile().verses_on_new_line" (ionChange)="save()"></ion-toggle>
|
<ion-toggle color="dark" [(ngModel)]="profileService.profile().verses_on_new_line" (ionChange)="save()"></ion-toggle>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Show Paragraphs</ion-label>
|
||||||
|
<ion-toggle color="dark" [(ngModel)]="profileService.profile().show_paragraphs" (ionChange)="save()"></ion-toggle>
|
||||||
|
</ion-item>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Show Paragraph Headings</ion-label>
|
||||||
|
<ion-toggle color="dark" [(ngModel)]="profileService.profile().show_paragraph_headings" (ionChange)="save()"></ion-toggle>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
<h4>Adjust Text</h4>
|
<h4>Adjust Text</h4>
|
||||||
<ion-list>
|
<ion-list>
|
||||||
|
@ -30,6 +30,8 @@ export type User = {
|
|||||||
saved_pages: SavedPage[],
|
saved_pages: SavedPage[],
|
||||||
verses_on_new_line: boolean,
|
verses_on_new_line: boolean,
|
||||||
show_verse_numbers: boolean,
|
show_verse_numbers: boolean,
|
||||||
|
show_paragraphs: boolean,
|
||||||
|
show_paragraph_headings: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SavedPage = {
|
export type SavedPage = {
|
||||||
@ -131,10 +133,6 @@ export class ProfileService
|
|||||||
if (!user.saved_pages) user.saved_pages = [];
|
if (!user.saved_pages) user.saved_pages = [];
|
||||||
if (!user.items) user.items = [];
|
if (!user.items) user.items = [];
|
||||||
|
|
||||||
// merge the items so you don't loose anything.
|
|
||||||
if (this.profile().items.length > 0)
|
|
||||||
user.items.concat(this.localProfile.items);
|
|
||||||
|
|
||||||
// merge the saved pages so you don't loose those either
|
// merge the saved pages so you don't loose those either
|
||||||
if (this.profile().saved_pages.length > 0)
|
if (this.profile().saved_pages.length > 0)
|
||||||
user.saved_pages.concat(this.localProfile.saved_pages);
|
user.saved_pages.concat(this.localProfile.saved_pages);
|
||||||
@ -142,6 +140,7 @@ export class ProfileService
|
|||||||
// don't sync things that don't make sense.
|
// don't sync things that don't make sense.
|
||||||
this.profile().uid = user.uid;
|
this.profile().uid = user.uid;
|
||||||
this.profile().username = user.username;
|
this.profile().username = user.username;
|
||||||
|
this.profile().saved_pages = user.saved_pages;
|
||||||
|
|
||||||
// We only save the local change here since this is an update from our remote profile.
|
// We only save the local change here since this is an update from our remote profile.
|
||||||
this.localSave();
|
this.localSave();
|
||||||
@ -253,6 +252,8 @@ export class ProfileService
|
|||||||
this.profile().saved_pages = [];
|
this.profile().saved_pages = [];
|
||||||
this.profile().verses_on_new_line = true;
|
this.profile().verses_on_new_line = true;
|
||||||
this.profile().show_verse_numbers = true;
|
this.profile().show_verse_numbers = true;
|
||||||
|
this.profile().show_paragraph_headings = true;
|
||||||
|
this.profile().show_paragraphs = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
reset()
|
reset()
|
||||||
@ -282,15 +283,19 @@ export class ProfileService
|
|||||||
return {
|
return {
|
||||||
username: DEFAULT_USER_NAME,
|
username: DEFAULT_USER_NAME,
|
||||||
uid: null,
|
uid: null,
|
||||||
strongs_modal: true,
|
|
||||||
clear_search_after_query: false,
|
|
||||||
items: [],
|
|
||||||
append_to_bottom: false,
|
|
||||||
insert_next_to_item: false,
|
|
||||||
font_size: 10,
|
font_size: 10,
|
||||||
saved_pages: [],
|
saved_pages: [],
|
||||||
verses_on_new_line: true,
|
items: [],
|
||||||
|
|
||||||
|
strongs_modal: true,
|
||||||
|
clear_search_after_query: false,
|
||||||
|
append_to_bottom: false,
|
||||||
|
insert_next_to_item: false,
|
||||||
|
|
||||||
|
verses_on_new_line: false,
|
||||||
show_verse_numbers: true,
|
show_verse_numbers: true,
|
||||||
|
show_paragraphs: true,
|
||||||
|
show_paragraph_headings: true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user