Compare commits

...

9 Commits

Author SHA1 Message Date
15f486205d fix bug 2024-05-15 22:41:51 -04:00
98cb84acba Formatting 2024-05-15 22:40:13 -04:00
090fd864b4 fix: various updates
Add jquery-ui
fix uuid validation for other versions
expand queryRef method to include parameters
converted mouseover to click events for embedded links
added additional parameters to openNote and retrieveNote
2024-05-15 22:39:56 -04:00
7506b1156c Add jquery-ui and converted date field to jquery ui datepicker 2024-05-15 22:36:50 -04:00
f19c6c2952 fix: add is defined check 2024-05-15 22:35:59 -04:00
b1e22c7ee5 Add jquery-ui 2024-05-15 22:34:47 -04:00
42ee567ff4 Changed the default target path after login 2024-05-15 22:34:11 -04:00
23c89bdb24 Script to import bible text from JSON file 2024-05-14 09:37:00 -04:00
ee9bc8cf4e Removed unnecessary user 2024-05-14 09:36:24 -04:00
23 changed files with 21228 additions and 228 deletions

26
bin/import-bible.php Normal file
View File

@ -0,0 +1,26 @@
<?php
require __DIR__.'/../vendor/autoload.php';
use Symfony\Component\Uid\Uuid;
$bible = json_decode(file_get_contents(dirname(__DIR__).'/var/esv-bible.json'));
$db = new PDO('sqlite:'.dirname(__DIR__).'/var/data.db');
foreach ($bible as $book => $data) {
$stmt = $db->prepare('INSERT INTO bible (id, book, chapter, verse, content, book_index) VALUES (:id, :book, :chapter, :verse, :content, :book_index)');
foreach ($data->text as $chapter => $verses) {
foreach ($verses as $verse => $text) {
print "{$book} {$chapter}:{$verse}".PHP_EOL;
$stmt->execute([
'id' => Uuid::v4(),
'book' => $book,
'chapter' => $chapter,
'verse' => ($verse + 1),
'content' => $text,
'book_index' => $data->index
]);
}
}
}

View File

@ -21,6 +21,7 @@ security:
login_path: app_login
check_path: app_login
enable_csrf: false
default_target_path: app_home
logout:
path: app_logout
# where to redirect after logout

View File

@ -49,11 +49,9 @@ function setHeight() {
notePreview = document.querySelector('#notePreview');
notePreview.style.height = (window.innerHeight - 50) + 'px';
date = document.querySelector('#noteDate');
dt = new Date();
date.value = dt.getFullYear() + '-' +
((dt.getMonth() < 9) ? '0' + (dt.getMonth() + 1) : (dt.getMonth() + 1)) + '-' +
(dt.getDate() < 10 ? '0' + dt.getDate() : dt.getDate());
if ($('#noteDate')) {
$('#noteDate').datepicker();
}
setTimeout(saveNote, saveTimeout);
}
@ -137,22 +135,20 @@ function validateNote() {
const title = document.querySelector('#noteTitle');
const id = document.querySelector('#noteId');
const psg = document.querySelector('#passage');
const user = document.querySelector('#user');
if (!isUuidV4Valid(id.value)) { return false; }
if (!isUuidValid(id.value)) { return false; }
if (!title.value.length) { return false; }
if (!date.value) { return false; }
if (!parseInt(speaker.value)) { return false; }
if (!parseInt(series.value)) { return false; }
if (!psg.value) { return false; }
if (!note.value.length) { return false; }
if (!user.value) { return false; }
return true;
}
function isUuidV4Valid(uuid) {
const regex = /^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[8|9|a|b][a-f0-9]{3}-[a-f0-9]{12}$/i;
function isUuidValid(uuid) {
const regex = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[8|9|a|b][a-f0-9]{3}-[a-f0-9]{12}$/i;
return regex.test(uuid);
}
@ -305,19 +301,25 @@ function closeRef() {
refQuery.style.display = 'none';
}
function queryRef() {
var input = document.querySelector('#refQuery #search');
var type = document.querySelector('#referenceType');
var book = document.querySelector('#referenceBook');
function queryRef(type = null, book = null, input = null) {
if (!input) {
var input = document.querySelector('#refQuery #search').value;
}
if (!type) {
var type = document.querySelector('#referenceType').value;
}
if (!book) {
var book = document.querySelector('#referenceBook').value;
}
fetch('/index.php/retrieve-reference', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
'type': type.value,
'book': book.value,
'reference': input.value,
'type': type,
'book': book,
'reference': input,
})
})
.then(response => response.json())
@ -568,9 +570,9 @@ function findLinks() {
var links = document.querySelector('#notePreview').querySelectorAll('a');
for (var i = 0; i < links.length; i++) {
links[i].addEventListener('mouseover', function (e) {
links[i].addEventListener('click', function (e) {
e.preventDefault();
if (!this.href.contains('notes\.rkprather\.com')) {
if (!this.href.includes('get-passage')) {
return;
}
var passage = this.href.split('/');
@ -599,7 +601,7 @@ function findLinks() {
showPassage(
e,
"<button onclick='closePopup()'>Close</button>&nbsp;&nbsp;" +
"<button onclick=\"getRef('" + book + "', '" + cv + "')\">Open Ref</button><br/>" +
"<button onclick=\"queryRef('bible', '" + book + "', '" + cv + "')\">Open Ref</button><br/>" +
result);
});
});
@ -610,9 +612,9 @@ function findRefLinks() {
var links = document.querySelector('#ref').querySelectorAll('a');
for (var i = 0; i < links.length; i++) {
links[i].addEventListener('mouseover', function (e) {
links[i].addEventListener('click', function (e) {
e.preventDefault();
if (!this.href.contains('get-passage')) {
if (!this.href.includes('get-passage')) {
return;
}
var passage = this.href.split('/');
@ -641,7 +643,7 @@ function findRefLinks() {
showPassage(
e,
"<button onclick='closePopup()'>Close</button>&nbsp;&nbsp;" +
"<button onclick=\"getRef('" + book + "', '" + cv + "')\">Open Ref</button><br/>" +
"<button onclick=\"queryRef('bible', '" + book + "', '" + cv + "')\">Open Ref</button><br/>" +
result);
});
});
@ -669,7 +671,7 @@ function closePopup() {
popup.style.display = 'none';
}
function openNote() {
function openNote(openSidebar = true) {
const noteList = document.querySelector('#note-list');
const refs = document.querySelector('#ref');
@ -681,10 +683,12 @@ function openNote() {
refs.style.display = 'none';
}
document.querySelector('.toggle').click();
if (openSidebar) {
document.querySelector('.toggle').click();
}
}
function retrieveNote(id) {
function retrieveNote(id, runOpen = true) {
fetch('/index.php/get-note', {
method: 'POST',
header: {
@ -696,23 +700,26 @@ function retrieveNote(id) {
})
.then(response => response.json())
.then(result => {
var dt = new Date(result.date);
var dt = new Date(result.date.date);
document.querySelector('#notes').value = result.text;
document.querySelector('#passage').value = result.passage;
document.querySelector('#series').value = result.series.id;
document.querySelector('#speaker').value = result.speaker.id;
document.querySelector('#noteTitle').value = result.title;
document.querySelector('#noteDate').value = dt.getFullYear() + '-' +
(dt.getMonth() < 9 ? '0' + (dt.getMonth() + 1) : (dt.getMonth() + 1)) + '-' +
(dt.getDate() < 10 ? '0' + dt.getDate() : dt.getDate());
document.querySelector('#noteDate').value = '';
document.querySelector('#noteDate').value =
(dt.getMonth() < 9 ? '0' + (dt.getMonth() + 1) : (dt.getMonth() + 1)) + '/' +
(dt.getDate() < 10 ? '0' + dt.getDate() : dt.getDate()) + '/' +
dt.getFullYear();
document.querySelector('#noteId').value = result.id;
if (result.references) {
references = result.references;
if (result.refs) {
references = result.refs;
}
const list = document.querySelector('#ref-list');
list.innerHTML = '';
var newList = null;
for (var x in references) {
var newList = document.createElement('li');
@ -722,7 +729,9 @@ function retrieveNote(id) {
list.appendChild(newList);
}
openNote();
if (runOpen) {
openNote(false);
}
});
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -0,0 +1,886 @@
/*!
* jQuery UI CSS Framework 1.13.3
* https://jqueryui.com
*
* Copyright OpenJS Foundation and other contributors
* Released under the MIT license.
* https://jquery.org/license
*
* https://api.jqueryui.com/category/theming/
*/
.ui-draggable-handle {
-ms-touch-action: none;
touch-action: none;
}
/* Layout helpers
----------------------------------*/
.ui-helper-hidden {
display: none;
}
.ui-helper-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.ui-helper-reset {
margin: 0;
padding: 0;
border: 0;
outline: 0;
line-height: 1.3;
text-decoration: none;
font-size: 100%;
list-style: none;
}
.ui-helper-clearfix:before,
.ui-helper-clearfix:after {
content: "";
display: table;
border-collapse: collapse;
}
.ui-helper-clearfix:after {
clear: both;
}
.ui-helper-zfix {
width: 100%;
height: 100%;
top: 0;
left: 0;
position: absolute;
opacity: 0;
-ms-filter: "alpha(opacity=0)"; /* support: IE8 */
}
.ui-front {
z-index: 100;
}
/* Interaction Cues
----------------------------------*/
.ui-state-disabled {
cursor: default !important;
pointer-events: none;
}
/* Icons
----------------------------------*/
.ui-icon {
display: inline-block;
vertical-align: middle;
margin-top: -.25em;
position: relative;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
}
.ui-widget-icon-block {
left: 50%;
margin-left: -8px;
display: block;
}
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.ui-resizable {
position: relative;
}
.ui-resizable-handle {
position: absolute;
font-size: 0.1px;
display: block;
-ms-touch-action: none;
touch-action: none;
}
.ui-resizable-disabled .ui-resizable-handle,
.ui-resizable-autohide .ui-resizable-handle {
display: none;
}
.ui-resizable-n {
cursor: n-resize;
height: 7px;
width: 100%;
top: -5px;
left: 0;
}
.ui-resizable-s {
cursor: s-resize;
height: 7px;
width: 100%;
bottom: -5px;
left: 0;
}
.ui-resizable-e {
cursor: e-resize;
width: 7px;
right: -5px;
top: 0;
height: 100%;
}
.ui-resizable-w {
cursor: w-resize;
width: 7px;
left: -5px;
top: 0;
height: 100%;
}
.ui-resizable-se {
cursor: se-resize;
width: 12px;
height: 12px;
right: 1px;
bottom: 1px;
}
.ui-resizable-sw {
cursor: sw-resize;
width: 9px;
height: 9px;
left: -5px;
bottom: -5px;
}
.ui-resizable-nw {
cursor: nw-resize;
width: 9px;
height: 9px;
left: -5px;
top: -5px;
}
.ui-resizable-ne {
cursor: ne-resize;
width: 9px;
height: 9px;
right: -5px;
top: -5px;
}
.ui-selectable {
-ms-touch-action: none;
touch-action: none;
}
.ui-selectable-helper {
position: absolute;
z-index: 100;
border: 1px dotted black;
}
.ui-sortable-handle {
-ms-touch-action: none;
touch-action: none;
}
.ui-accordion .ui-accordion-header {
display: block;
cursor: pointer;
position: relative;
margin: 2px 0 0 0;
padding: .5em .5em .5em .7em;
font-size: 100%;
}
.ui-accordion .ui-accordion-content {
padding: 1em 2.2em;
border-top: 0;
overflow: auto;
}
.ui-autocomplete {
position: absolute;
top: 0;
left: 0;
cursor: default;
}
.ui-menu {
list-style: none;
padding: 0;
margin: 0;
display: block;
outline: 0;
}
.ui-menu .ui-menu {
position: absolute;
}
.ui-menu .ui-menu-item {
margin: 0;
cursor: pointer;
/* support: IE10, see #8844 */
list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
}
.ui-menu .ui-menu-item-wrapper {
position: relative;
padding: 3px 1em 3px .4em;
}
.ui-menu .ui-menu-divider {
margin: 5px 0;
height: 0;
font-size: 0;
line-height: 0;
border-width: 1px 0 0 0;
}
.ui-menu .ui-state-focus,
.ui-menu .ui-state-active {
margin: -1px;
}
/* icon support */
.ui-menu-icons {
position: relative;
}
.ui-menu-icons .ui-menu-item-wrapper {
padding-left: 2em;
}
/* left-aligned */
.ui-menu .ui-icon {
position: absolute;
top: 0;
bottom: 0;
left: .2em;
margin: auto 0;
}
/* right-aligned */
.ui-menu .ui-menu-icon {
left: auto;
right: 0;
}
.ui-button {
padding: .4em 1em;
display: inline-block;
position: relative;
line-height: normal;
margin-right: .1em;
cursor: pointer;
vertical-align: middle;
text-align: center;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
/* Support: IE <= 11 */
overflow: visible;
}
.ui-button,
.ui-button:link,
.ui-button:visited,
.ui-button:hover,
.ui-button:active {
text-decoration: none;
}
/* to make room for the icon, a width needs to be set here */
.ui-button-icon-only {
width: 2em;
box-sizing: border-box;
text-indent: -9999px;
white-space: nowrap;
}
/* no icon support for input elements */
input.ui-button.ui-button-icon-only {
text-indent: 0;
}
/* button icon element(s) */
.ui-button-icon-only .ui-icon {
position: absolute;
top: 50%;
left: 50%;
margin-top: -8px;
margin-left: -8px;
}
.ui-button.ui-icon-notext .ui-icon {
padding: 0;
width: 2.1em;
height: 2.1em;
text-indent: -9999px;
white-space: nowrap;
}
input.ui-button.ui-icon-notext .ui-icon {
width: auto;
height: auto;
text-indent: 0;
white-space: normal;
padding: .4em 1em;
}
/* workarounds */
/* Support: Firefox 5 - 40 */
input.ui-button::-moz-focus-inner,
button.ui-button::-moz-focus-inner {
border: 0;
padding: 0;
}
.ui-controlgroup {
vertical-align: middle;
display: inline-block;
}
.ui-controlgroup > .ui-controlgroup-item {
float: left;
margin-left: 0;
margin-right: 0;
}
.ui-controlgroup > .ui-controlgroup-item:focus,
.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus {
z-index: 9999;
}
.ui-controlgroup-vertical > .ui-controlgroup-item {
display: block;
float: none;
width: 100%;
margin-top: 0;
margin-bottom: 0;
text-align: left;
}
.ui-controlgroup-vertical .ui-controlgroup-item {
box-sizing: border-box;
}
.ui-controlgroup .ui-controlgroup-label {
padding: .4em 1em;
}
.ui-controlgroup .ui-controlgroup-label span {
font-size: 80%;
}
.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item {
border-left: none;
}
.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item {
border-top: none;
}
.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content {
border-right: none;
}
.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content {
border-bottom: none;
}
/* Spinner specific style fixes */
.ui-controlgroup-vertical .ui-spinner-input {
/* Support: IE8 only, Android < 4.4 only */
width: 75%;
width: calc( 100% - 2.4em );
}
.ui-controlgroup-vertical .ui-spinner .ui-spinner-up {
border-top-style: solid;
}
.ui-checkboxradio-label .ui-icon-background {
box-shadow: inset 1px 1px 1px #ccc;
border-radius: .12em;
border: none;
}
.ui-checkboxradio-radio-label .ui-icon-background {
width: 16px;
height: 16px;
border-radius: 1em;
overflow: visible;
border: none;
}
.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,
.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon {
background-image: none;
width: 8px;
height: 8px;
border-width: 4px;
border-style: solid;
}
.ui-checkboxradio-disabled {
pointer-events: none;
}
.ui-datepicker {
width: 17em;
padding: .2em .2em 0;
display: none;
}
.ui-datepicker .ui-datepicker-header {
position: relative;
padding: .2em 0;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
position: absolute;
top: 2px;
width: 1.8em;
height: 1.8em;
}
.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover {
top: 1px;
}
.ui-datepicker .ui-datepicker-prev {
left: 2px;
}
.ui-datepicker .ui-datepicker-next {
right: 2px;
}
.ui-datepicker .ui-datepicker-prev-hover {
left: 1px;
}
.ui-datepicker .ui-datepicker-next-hover {
right: 1px;
}
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
display: block;
position: absolute;
left: 50%;
margin-left: -8px;
top: 50%;
margin-top: -8px;
}
.ui-datepicker .ui-datepicker-title {
margin: 0 2.3em;
line-height: 1.8em;
text-align: center;
}
.ui-datepicker .ui-datepicker-title select {
font-size: 1em;
margin: 1px 0;
}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
width: 45%;
}
.ui-datepicker table {
width: 100%;
font-size: .9em;
border-collapse: collapse;
margin: 0 0 .4em;
}
.ui-datepicker th {
padding: .7em .3em;
text-align: center;
font-weight: bold;
border: 0;
}
.ui-datepicker td {
border: 0;
padding: 1px;
}
.ui-datepicker td span,
.ui-datepicker td a {
display: block;
padding: .2em;
text-align: right;
text-decoration: none;
}
.ui-datepicker .ui-datepicker-buttonpane {
background-image: none;
margin: .7em 0 0 0;
padding: 0 .2em;
border-left: 0;
border-right: 0;
border-bottom: 0;
}
.ui-datepicker .ui-datepicker-buttonpane button {
float: right;
margin: .5em .2em .4em;
cursor: pointer;
padding: .2em .6em .3em .6em;
width: auto;
overflow: visible;
}
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
float: left;
}
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi {
width: auto;
}
.ui-datepicker-multi .ui-datepicker-group {
float: left;
}
.ui-datepicker-multi .ui-datepicker-group table {
width: 95%;
margin: 0 auto .4em;
}
.ui-datepicker-multi-2 .ui-datepicker-group {
width: 50%;
}
.ui-datepicker-multi-3 .ui-datepicker-group {
width: 33.3%;
}
.ui-datepicker-multi-4 .ui-datepicker-group {
width: 25%;
}
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
border-left-width: 0;
}
.ui-datepicker-multi .ui-datepicker-buttonpane {
clear: left;
}
.ui-datepicker-row-break {
clear: both;
width: 100%;
font-size: 0;
}
/* RTL support */
.ui-datepicker-rtl {
direction: rtl;
}
.ui-datepicker-rtl .ui-datepicker-prev {
right: 2px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next {
left: 2px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-prev:hover {
right: 1px;
left: auto;
}
.ui-datepicker-rtl .ui-datepicker-next:hover {
left: 1px;
right: auto;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane {
clear: right;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
float: left;
}
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
.ui-datepicker-rtl .ui-datepicker-group {
float: right;
}
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
border-right-width: 0;
border-left-width: 1px;
}
/* Icons */
.ui-datepicker .ui-icon {
display: block;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
left: .5em;
top: .3em;
}
.ui-dialog {
position: absolute;
top: 0;
left: 0;
padding: .2em;
outline: 0;
}
.ui-dialog .ui-dialog-titlebar {
padding: .4em 1em;
position: relative;
}
.ui-dialog .ui-dialog-title {
float: left;
margin: .1em 0;
white-space: nowrap;
width: 90%;
overflow: hidden;
text-overflow: ellipsis;
}
.ui-dialog .ui-dialog-titlebar-close {
position: absolute;
right: .3em;
top: 50%;
width: 20px;
margin: -10px 0 0 0;
padding: 1px;
height: 20px;
}
.ui-dialog .ui-dialog-content {
position: relative;
border: 0;
padding: .5em 1em;
background: none;
overflow: auto;
}
.ui-dialog .ui-dialog-buttonpane {
text-align: left;
border-width: 1px 0 0 0;
background-image: none;
margin-top: .5em;
padding: .3em 1em .5em .4em;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
float: right;
}
.ui-dialog .ui-dialog-buttonpane button {
margin: .5em .4em .5em 0;
cursor: pointer;
}
.ui-dialog .ui-resizable-n {
height: 2px;
top: 0;
}
.ui-dialog .ui-resizable-e {
width: 2px;
right: 0;
}
.ui-dialog .ui-resizable-s {
height: 2px;
bottom: 0;
}
.ui-dialog .ui-resizable-w {
width: 2px;
left: 0;
}
.ui-dialog .ui-resizable-se,
.ui-dialog .ui-resizable-sw,
.ui-dialog .ui-resizable-ne,
.ui-dialog .ui-resizable-nw {
width: 7px;
height: 7px;
}
.ui-dialog .ui-resizable-se {
right: 0;
bottom: 0;
}
.ui-dialog .ui-resizable-sw {
left: 0;
bottom: 0;
}
.ui-dialog .ui-resizable-ne {
right: 0;
top: 0;
}
.ui-dialog .ui-resizable-nw {
left: 0;
top: 0;
}
.ui-draggable .ui-dialog-titlebar {
cursor: move;
}
.ui-progressbar {
height: 2em;
text-align: left;
overflow: hidden;
}
.ui-progressbar .ui-progressbar-value {
margin: -1px;
height: 100%;
}
.ui-progressbar .ui-progressbar-overlay {
background: url("data:image/gif;base64,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");
height: 100%;
-ms-filter: "alpha(opacity=25)"; /* support: IE8 */
opacity: 0.25;
}
.ui-progressbar-indeterminate .ui-progressbar-value {
background-image: none;
}
.ui-selectmenu-menu {
padding: 0;
margin: 0;
position: absolute;
top: 0;
left: 0;
display: none;
}
.ui-selectmenu-menu .ui-menu {
overflow: auto;
overflow-x: hidden;
padding-bottom: 1px;
}
.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
font-size: 1em;
font-weight: bold;
line-height: 1.5;
padding: 2px 0.4em;
margin: 0.5em 0 0 0;
height: auto;
border: 0;
}
.ui-selectmenu-open {
display: block;
}
.ui-selectmenu-text {
display: block;
margin-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
}
.ui-selectmenu-button.ui-button {
text-align: left;
white-space: nowrap;
width: 14em;
}
.ui-selectmenu-icon.ui-icon {
float: right;
margin-top: 0;
}
.ui-slider {
position: relative;
text-align: left;
}
.ui-slider .ui-slider-handle {
position: absolute;
z-index: 2;
width: 1.2em;
height: 1.2em;
cursor: pointer;
-ms-touch-action: none;
touch-action: none;
}
.ui-slider .ui-slider-range {
position: absolute;
z-index: 1;
font-size: .7em;
display: block;
border: 0;
background-position: 0 0;
}
/* support: IE8 - See #6727 */
.ui-slider.ui-state-disabled .ui-slider-handle,
.ui-slider.ui-state-disabled .ui-slider-range {
filter: inherit;
}
.ui-slider-horizontal {
height: .8em;
}
.ui-slider-horizontal .ui-slider-handle {
top: -.3em;
margin-left: -.6em;
}
.ui-slider-horizontal .ui-slider-range {
top: 0;
height: 100%;
}
.ui-slider-horizontal .ui-slider-range-min {
left: 0;
}
.ui-slider-horizontal .ui-slider-range-max {
right: 0;
}
.ui-slider-vertical {
width: .8em;
height: 100px;
}
.ui-slider-vertical .ui-slider-handle {
left: -.3em;
margin-left: 0;
margin-bottom: -.6em;
}
.ui-slider-vertical .ui-slider-range {
left: 0;
width: 100%;
}
.ui-slider-vertical .ui-slider-range-min {
bottom: 0;
}
.ui-slider-vertical .ui-slider-range-max {
top: 0;
}
.ui-spinner {
position: relative;
display: inline-block;
overflow: hidden;
padding: 0;
vertical-align: middle;
}
.ui-spinner-input {
border: none;
background: none;
color: inherit;
padding: .222em 0;
margin: .2em 0;
vertical-align: middle;
margin-left: .4em;
margin-right: 2em;
}
.ui-spinner-button {
width: 1.6em;
height: 50%;
font-size: .5em;
padding: 0;
margin: 0;
text-align: center;
position: absolute;
cursor: default;
display: block;
overflow: hidden;
right: 0;
}
/* more specificity required here to override default borders */
.ui-spinner a.ui-spinner-button {
border-top-style: none;
border-bottom-style: none;
border-right-style: none;
}
.ui-spinner-up {
top: 0;
}
.ui-spinner-down {
bottom: 0;
}
.ui-tabs {
position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
padding: .2em;
}
.ui-tabs .ui-tabs-nav {
margin: 0;
padding: .2em .2em 0;
}
.ui-tabs .ui-tabs-nav li {
list-style: none;
float: left;
position: relative;
top: 0;
margin: 1px .2em 0 0;
border-bottom-width: 0;
padding: 0;
white-space: nowrap;
}
.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
float: left;
padding: .5em 1em;
text-decoration: none;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
margin-bottom: -1px;
padding-bottom: 1px;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
cursor: text;
}
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
cursor: pointer;
}
.ui-tabs .ui-tabs-panel {
display: block;
border-width: 0;
padding: 1em 1.4em;
background: none;
}
.ui-tooltip {
padding: 8px;
position: absolute;
z-index: 9999;
max-width: 300px;
}
body .ui-tooltip {
border-width: 2px;
}

File diff suppressed because it is too large Load Diff

19070
public/theme/assets/js/jquery-ui.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,262 +1,262 @@
/*
Editorial by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
Editorial by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
*/
(function($) {
(function ($) {
var $window = $(window),
$head = $('head'),
$body = $('body');
var $window = $(window),
$head = $('head'),
$body = $('body');
// Breakpoints.
breakpoints({
xlarge: [ '1281px', '1680px' ],
large: [ '981px', '1280px' ],
medium: [ '737px', '980px' ],
small: [ '481px', '736px' ],
xsmall: [ '361px', '480px' ],
xxsmall: [ null, '360px' ],
'xlarge-to-max': '(min-width: 1681px)',
'small-to-xlarge': '(min-width: 481px) and (max-width: 1680px)'
});
// Breakpoints.
breakpoints({
xlarge: ['1281px', '1680px'],
large: ['981px', '1280px'],
medium: ['737px', '980px'],
small: ['481px', '736px'],
xsmall: ['361px', '480px'],
xxsmall: [null, '360px'],
'xlarge-to-max': '(min-width: 1681px)',
'small-to-xlarge': '(min-width: 481px) and (max-width: 1680px)'
});
// Stops animations/transitions until the page has ...
// Stops animations/transitions until the page has ...
// ... loaded.
$window.on('load', function() {
window.setTimeout(function() {
$body.removeClass('is-preload');
}, 100);
});
// ... loaded.
$window.on('load', function () {
window.setTimeout(function () {
$body.removeClass('is-preload');
}, 100);
});
// ... stopped resizing.
var resizeTimeout;
// ... stopped resizing.
var resizeTimeout;
$window.on('resize', function() {
$window.on('resize', function () {
// Mark as resizing.
$body.addClass('is-resizing');
// Mark as resizing.
$body.addClass('is-resizing');
// Unmark after delay.
clearTimeout(resizeTimeout);
// Unmark after delay.
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
$body.removeClass('is-resizing');
}, 100);
resizeTimeout = setTimeout(function () {
$body.removeClass('is-resizing');
}, 100);
});
});
// Fixes.
// Fixes.
// Object fit images.
if (!browser.canUse('object-fit')
|| browser.name == 'safari')
$('.image.object').each(function() {
// Object fit images.
if (!browser.canUse('object-fit')
|| browser.name == 'safari')
$('.image.object').each(function () {
var $this = $(this),
$img = $this.children('img');
var $this = $(this),
$img = $this.children('img');
// Hide original image.
$img.css('opacity', '0');
// Hide original image.
$img.css('opacity', '0');
// Set background.
$this
.css('background-image', 'url("' + $img.attr('src') + '")')
.css('background-size', $img.css('object-fit') ? $img.css('object-fit') : 'cover')
.css('background-position', $img.css('object-position') ? $img.css('object-position') : 'center');
// Set background.
$this
.css('background-image', 'url("' + $img.attr('src') + '")')
.css('background-size', $img.css('object-fit') ? $img.css('object-fit') : 'cover')
.css('background-position', $img.css('object-position') ? $img.css('object-position') : 'center');
});
});
// Sidebar.
var $sidebar = $('#sidebar'),
$sidebar_inner = $sidebar.children('.inner');
// Sidebar.
var $sidebar = $('#sidebar'),
$sidebar_inner = $sidebar.children('.inner');
// Inactive by default on <= large.
breakpoints.on('<=large', function() {
$sidebar.addClass('inactive');
});
// Inactive by default on <= large.
breakpoints.on('<=large', function () {
$sidebar.addClass('inactive');
});
breakpoints.on('>large', function() {
$sidebar.removeClass('inactive');
});
breakpoints.on('>large', function () {
$sidebar.removeClass('inactive');
});
// Hack: Workaround for Chrome/Android scrollbar position bug.
if (browser.os == 'android'
&& browser.name == 'chrome')
$('<style>#sidebar .inner::-webkit-scrollbar { display: none; }</style>')
.appendTo($head);
// Hack: Workaround for Chrome/Android scrollbar position bug.
if (browser.os == 'android'
&& browser.name == 'chrome')
$('<style>#sidebar .inner::-webkit-scrollbar { display: none; }</style>')
.appendTo($head);
// Toggle.
$('<a href="#sidebar" class="toggle">Toggle</a>')
.appendTo($sidebar)
.on('click', function(event) {
// Toggle.
$('<a href="#sidebar" class="toggle">Toggle</a>')
.appendTo($sidebar)
.on('click', function (event) {
// Prevent default.
event.preventDefault();
event.stopPropagation();
// Prevent default.
event.preventDefault();
event.stopPropagation();
// Toggle.
$sidebar.toggleClass('inactive');
// Toggle.
$sidebar.toggleClass('inactive');
});
});
// Events.
// Events.
// Link clicks.
$sidebar.on('click', 'a', function(event) {
// Link clicks.
$sidebar.on('click', 'a', function (event) {
// >large? Bail.
if (breakpoints.active('>large'))
return;
// >large? Bail.
if (breakpoints.active('>large'))
return;
// Vars.
var $a = $(this),
href = $a.attr('href'),
target = $a.attr('target');
// Vars.
var $a = $(this),
href = $a.attr('href'),
target = $a.attr('target');
// Prevent default.
event.preventDefault();
event.stopPropagation();
// Prevent default.
event.preventDefault();
event.stopPropagation();
// Check URL.
if (!href || href == '#' || href == '')
return;
// Check URL.
if (!href || href == '#' || href == '')
return;
// Hide sidebar.
$sidebar.addClass('inactive');
// Hide sidebar.
$sidebar.addClass('inactive');
// Redirect to href.
setTimeout(function() {
// Redirect to href.
setTimeout(function () {
if (target == '_blank')
window.open(href);
else
window.location.href = href;
if (target == '_blank')
window.open(href);
else
window.location.href = href;
}, 500);
}, 500);
});
});
// Prevent certain events inside the panel from bubbling.
$sidebar.on('click touchend touchstart touchmove', function(event) {
// Prevent certain events inside the panel from bubbling.
$sidebar.on('click touchend touchstart touchmove', function (event) {
// >large? Bail.
if (breakpoints.active('>large'))
return;
// >large? Bail.
if (breakpoints.active('>large'))
return;
// Prevent propagation.
event.stopPropagation();
// Prevent propagation.
event.stopPropagation();
});
});
// Hide panel on body click/tap.
$body.on('click touchend', function(event) {
// Hide panel on body click/tap.
$body.on('click touchend', function (event) {
// >large? Bail.
if (breakpoints.active('>large'))
return;
// >large? Bail.
if (breakpoints.active('>large'))
return;
// Deactivate.
$sidebar.addClass('inactive');
// Deactivate.
$sidebar.addClass('inactive');
});
});
// Scroll lock.
// Note: If you do anything to change the height of the sidebar's content, be sure to
// trigger 'resize.sidebar-lock' on $window so stuff doesn't get out of sync.
// Scroll lock.
// Note: If you do anything to change the height of the sidebar's content, be sure to
// trigger 'resize.sidebar-lock' on $window so stuff doesn't get out of sync.
$window.on('load.sidebar-lock', function() {
$window.on('load.sidebar-lock', function () {
var sh, wh, st;
var sh, wh, st;
// Reset scroll position to 0 if it's 1.
if ($window.scrollTop() == 1)
$window.scrollTop(0);
// Reset scroll position to 0 if it's 1.
if ($window.scrollTop() == 1)
$window.scrollTop(0);
$window
.on('scroll.sidebar-lock', function() {
$window
.on('scroll.sidebar-lock', function () {
var x, y;
var x, y;
// <=large? Bail.
if (breakpoints.active('<=large')) {
// <=large? Bail.
if (breakpoints.active('<=large')) {
$sidebar_inner
.data('locked', 0)
.css('position', '')
.css('top', '');
$sidebar_inner
.data('locked', 0)
.css('position', '')
.css('top', '');
return;
return;
}
}
// Calculate positions.
x = Math.max(sh - wh, 0);
y = Math.max(0, $window.scrollTop() - x);
// Calculate positions.
x = Math.max(sh - wh, 0);
y = Math.max(0, $window.scrollTop() - x);
// Lock/unlock.
if ($sidebar_inner.data('locked') == 1) {
// Lock/unlock.
if ($sidebar_inner.data('locked') == 1) {
if (y <= 0)
$sidebar_inner
.data('locked', 0)
.css('position', '')
.css('top', '');
else
$sidebar_inner
.css('top', -1 * x);
if (y <= 0)
$sidebar_inner
.data('locked', 0)
.css('position', '')
.css('top', '');
else
$sidebar_inner
.css('top', -1 * x);
}
else {
}
else {
if (y > 0)
$sidebar_inner
.data('locked', 1)
.css('position', 'fixed')
.css('top', -1 * x);
if (y > 0)
$sidebar_inner
.data('locked', 1)
.css('position', 'fixed')
.css('top', -1 * x);
}
}
})
.on('resize.sidebar-lock', function() {
})
.on('resize.sidebar-lock', function () {
// Calculate heights.
wh = $window.height();
sh = $sidebar_inner.outerHeight() + 30;
// Calculate heights.
wh = $window.height();
sh = $sidebar_inner.outerHeight() + 30;
// Trigger scroll.
$window.trigger('scroll.sidebar-lock');
// Trigger scroll.
$window.trigger('scroll.sidebar-lock');
})
.trigger('resize.sidebar-lock');
})
.trigger('resize.sidebar-lock');
});
});
// Menu.
var $menu = $('#menu'),
$menu_openers = $menu.children('ul').find('.opener');
// Menu.
var $menu = $('#menu'),
$menu_openers = $menu.children('ul').find('.opener');
// Openers.
$menu_openers.each(function() {
// Openers.
$menu_openers.each(function () {
var $this = $(this);
var $this = $(this);
$this.on('click', function(event) {
$this.on('click', function (event) {
// Prevent default.
event.preventDefault();
// Prevent default.
event.preventDefault();
// Toggle.
$menu_openers.not($this).removeClass('active');
$this.toggleClass('active');
// Toggle.
$menu_openers.not($this).removeClass('active');
$this.toggleClass('active');
// Trigger resize (sidebar lock).
$window.triggerHandler('resize.sidebar-lock');
// Trigger resize (sidebar lock).
$window.triggerHandler('resize.sidebar-lock');
});
});
});
});
})(jQuery);

View File

@ -16,6 +16,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Uid\Uuid;
class AjaxController extends AbstractController
{
@ -268,18 +269,15 @@ class AjaxController extends AbstractController
if (!$note) {
$note = new Note();
$note->setId($data->id);
$uuid = Uuid::fromString($data->id);
$note->setId($uuid);
}
$refs = json_decode(json_encode($data->refs), true);
$series = $emi->getRepository(Series::class)->find($data->series);
$speaker = $emi->getRepository(Speaker::class)->find($data->speaker);
$user = $emi->getRepository(User::class)->findBy(['email' => $data->user]);
if (is_array($user)) {
$user = $user[0];
}
$user = $this->getUser();
$note->setUser($user)
->setTitle($data->title)
@ -330,12 +328,14 @@ class AjaxController extends AbstractController
$verse = Bible::findVerse($passage);
$verseArr = [];
if (is_bool($verse)) {
if (is_bool($verse) && $verse === false) {
$verseArr[0] = 1;
$verseArr[1] = 176;
} elseif (is_int($verse)) {
$verseArr[0] = $verse;
$verseArr[1] = $verse;
} else {
$verseArr = $verse;
}
$ret = $emi->getRepository(Bible::class)->findRange($bible, $verseArr);

View File

@ -4,6 +4,8 @@
{% block stylesheets %}
<link href="/theme/assets/css/main.css" rel="stylesheet" />
<link href='/theme/assets/css/jquery-ui.theme.css' rel='stylesheet' />
<link href='/theme/assets/css/jquery-ui.structure.css' rel='stylesheet' />
<link href='/css/style.css' rel='stylesheet' />
{% endblock %}
@ -11,6 +13,7 @@
<script src='/js/data.js'></script>
<script src='/js/script.js'></script>
<script src="/theme/assets/js/jquery.min.js"></script>
<script src='/theme/assets/js/jquery-ui.js'></script>
<script src="/theme/assets/js/browser.min.js"></script>
<script src="/theme/assets/js/breakpoints.min.js"></script>
<script src="/theme/assets/js/util.js"></script>
@ -33,7 +36,7 @@
<button onclick='increaseFont()'><i class='fa fa-plus'></i></button>&nbsp;
<button onclick='decreaseFont()'><i class='fa fa-minus'></i></button>
</div>
<div id="ref" style='font-size:12pt'></div>
<div id="ref"></div>
<div id='note-list'>
<table>
<thead>
@ -72,7 +75,7 @@
<div id='fields-container'>
<input type="hidden" id="noteId" value="{{ id }}" />
<input type="text" id="noteTitle" placeholder="Title..." />
<input type='date' id='noteDate' onchange='textDirty=true;saved=false;' />
<input type='text' id='noteDate' onchange='textDirty=true;saved=false;' />
<input type='text' id='newSpeaker' placeholder='Name...' onkeyup='saveSpeaker(event)' style='display:none;' />
<select id="speaker" onchange='newSpeaker()'>
<option value=0>-- Speaker --</option>

View File

@ -29,7 +29,7 @@
<li><a href='#' onclick='openNote()'>Open Note</a></li>
<li><a href="#" onclick="saveNote()">Save Note</a></li>
<li><a href='#' onclick='discardNote()'>Delete Note</a></li>
{% if isAdmin %}
{% if isAdmin is defined and isAdmin %}
<li><a href='/index.php/reference-editor'>Reference Editor</a></li>
{% endif %}
<li><a href='#' onclick="openRef()">Open Reference</a></li>
@ -51,7 +51,7 @@
<div class="mini-posts">
{% for n in app.user.notes %}
<article>
<a href="#">{{ n.title }}</a>
<a href="#" onclick="retrieveNote('{{ n.id }}');openNote();">{{ n.title }}</a>
<p>{{ n.passage }}</p>
</article>
{% endfor %}