summaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2018-04-13 21:47:37 +0100
committerGreg Roach <fisharebest@webtrees.net>2018-04-13 22:21:42 +0100
commit30ac035edf08f651ee34358ff44f0a7fe1b398ce (patch)
treee97af9d8d857d32809a64d0e1fc177fa5bf30435 /resources
parent50d1b3f21fcacd362de03c65d1693aae400d9317 (diff)
downloadwebtrees-30ac035edf08f651ee34358ff44f0a7fe1b398ce.tar.gz
webtrees-30ac035edf08f651ee34358ff44f0a7fe1b398ce.tar.bz2
webtrees-30ac035edf08f651ee34358ff44f0a7fe1b398ce.zip
Remove global Javascript variables
Diffstat (limited to 'resources')
-rw-r--r--resources/assets/js/webtrees.js36
-rw-r--r--resources/views/family-page-menu.php2
-rw-r--r--resources/views/family-page.php4
-rw-r--r--resources/views/gedcom-record-page-menu.php2
-rw-r--r--resources/views/gedcom-record-page.php4
-rw-r--r--resources/views/individual-page-menu.php2
-rw-r--r--resources/views/individual-page.php4
-rw-r--r--resources/views/layouts/default.php8
-rw-r--r--resources/views/media-page-menu.php10
-rw-r--r--resources/views/media-page.php6
-rw-r--r--resources/views/note-page-menu.php2
-rw-r--r--resources/views/note-page.php4
-rw-r--r--resources/views/repository-page-menu.php2
-rw-r--r--resources/views/repository-page.php4
-rw-r--r--resources/views/source-page-menu.php2
-rw-r--r--resources/views/source-page.php4
-rw-r--r--resources/views/timeline-chart.php2
17 files changed, 43 insertions, 55 deletions
diff --git a/resources/assets/js/webtrees.js b/resources/assets/js/webtrees.js
index b77f66edab..6b6c5d3079 100644
--- a/resources/assets/js/webtrees.js
+++ b/resources/assets/js/webtrees.js
@@ -15,9 +15,6 @@
'use strict';
-// "rtl" on right-to-left pages.
-var textDirection = $('html').attr('dir');
-
function expand_layer (sid) {
$('#' + sid + '_img').toggleClass('icon-plus icon-minus');
$('#' + sid).slideToggle('fast');
@@ -26,11 +23,11 @@ function expand_layer (sid) {
}
// Accept the changes to a record - and reload the page
-function accept_changes (xref) {
+function accept_changes(xref, ged) {
$.post('index.php', {
route: 'accept-changes',
xref: xref,
- ged: WT_GEDCOM,
+ ged: ged,
},
function () {
location.reload();
@@ -39,11 +36,11 @@ function accept_changes (xref) {
}
// Reject the changes to a record - and reload the page
-function reject_changes (xref) {
+function reject_changes (xref, ged) {
$.post('index.php', {
route: 'reject-changes',
xref: xref,
- ged: WT_GEDCOM,
+ ged: ged,
},
function () {
location.reload();
@@ -57,7 +54,7 @@ function delete_record (message, xref, gedcom) {
$.post('index.php', {
route: 'delete-record',
xref: xref,
- ged: typeof gedcom === 'undefined' ? WT_GEDCOM : gedcom,
+ ged: gedcom,
},
function () {
location.reload();
@@ -67,28 +64,28 @@ function delete_record (message, xref, gedcom) {
}
// Delete a fact - and reload the page
-function delete_fact (message, xref, fact_id) {
+function delete_fact (message, ged, xref, fact_id) {
if (confirm(message)) {
$.post('index.php', {
route: 'delete-fact',
xref: xref,
fact_id: fact_id,
- ged: WT_GEDCOM,
+ ged: ged
},
- function () {
- location.reload();
- });
+ function () {
+ location.reload();
+ });
}
return false;
}
// Copy a fact to the clipboard
-function copy_fact (xref, fact_id) {
+function copy_fact (ged, xref, fact_id) {
$.post('index.php', {
route: 'copy-fact',
xref: xref,
fact_id: fact_id,
- ged: WT_GEDCOM,
+ ged: ged,
},
function () {
location.reload();
@@ -97,12 +94,12 @@ function copy_fact (xref, fact_id) {
}
// Paste a fact from the clipboard
-function paste_fact (xref, element) {
+function paste_fact (ged, xref, element) {
$.post('index.php', {
route: 'paste-fact',
xref: xref,
fact_id: $(element).val(), // element is the <select> containing the option
- ged: WT_GEDCOM,
+ ged: ged,
},
function () {
location.reload();
@@ -269,7 +266,7 @@ function show_submenu (elementid, parentid) {
pagewidth = document.body.offsetWidth;
} else {
pagewidth = document.body.scrollWidth + document.documentElement.scrollLeft - 55;
- if (textDirection === 'rtl') {
+ if (document.documentElement.dir === 'rtl') {
boxright = element.offsetLeft + element.offsetWidth + 10;
}
}
@@ -617,7 +614,6 @@ function paste_char (value) {
}
function ilinkitem (mediaid, type, ged) {
- ged = (typeof ged === 'undefined') ? WT_GEDCOM : ged;
window.open('inverselink.php?mediaid=' + encodeURIComponent(mediaid) + '&linkto=' + encodeURIComponent(type) + '&ged=' + encodeURIComponent(ged), '_blank', find_window_specs);
return false;
}
@@ -799,7 +795,7 @@ $('body').on('click', '.iconz', function (e) {
if (!inout.text().length) {
wrapper.css('cursor', 'progress');
- inout.load('index.php', {route: 'expand-chart-box', xref: wrapper.data('pid'), ged: WT_GEDCOM}, function () {
+ inout.load('index.php', {route: 'expand-chart-box', xref: wrapper.data('xref'), ged: wrapper.data('tree')}, function () {
wrapper.css('cursor', '');
showDetails();
});
diff --git a/resources/views/family-page-menu.php b/resources/views/family-page-menu.php
index ac340a702e..14a1fa0933 100644
--- a/resources/views/family-page-menu.php
+++ b/resources/views/family-page-menu.php
@@ -25,7 +25,7 @@
<div class="dropdown-divider"></div>
- <a class="dropdown-item menu-fam-del" href="#" onclick="return delete_record('<?= I18N::translate('Deleting the family will unlink all of the individuals from each other but will leave the individuals in place. Are you sure you want to delete this family?') ?>', '<?= e($record->getXref()) ?>', '<?= $record->getXref() ?>');">
+ <a class="dropdown-item menu-fam-del" href="#" onclick="return delete_record('<?= I18N::translate('Deleting the family will unlink all of the individuals from each other but will leave the individuals in place. Are you sure you want to delete this family?') ?>', '<?= e($record->getXref()) ?>', '<?= e($record->getXref()) ?>', '<?= e($record->getTree()->getName()) ?>');">
<?= I18N::translate('Delete') ?>
</a>
diff --git a/resources/views/family-page.php b/resources/views/family-page.php
index db9531e964..36495c2c5b 100644
--- a/resources/views/family-page.php
+++ b/resources/views/family-page.php
@@ -8,13 +8,13 @@
<?php if ($record->isPendingDeletion()): ?>
<?php if (Auth::isModerator($record->getTree())): ?>
- <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This family has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . $record->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $record->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
+ <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This family has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php elseif (Auth::isEditor($record->getTree())): ?>
<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This family has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php endif ?>
<?php elseif ($record->isPendingAddition()): ?>
<?php if (Auth::isModerator($record->getTree())): ?>
- <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This family has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . $record->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $record->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' ) . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
+ <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This family has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' ) . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php elseif (Auth::isEditor($record->getTree())): ?>
<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This family has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php endif ?>
diff --git a/resources/views/gedcom-record-page-menu.php b/resources/views/gedcom-record-page-menu.php
index b198920554..f9a19f4a64 100644
--- a/resources/views/gedcom-record-page-menu.php
+++ b/resources/views/gedcom-record-page-menu.php
@@ -9,7 +9,7 @@
<?= I18N::translate('edit') ?>
</button>
<div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
- <a class="dropdown-item menu-indi-del" href="#" onclick="return delete_record('<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($record->getFullName())) ?>', '<?= $record->getXref() ?>');">
+ <a class="dropdown-item menu-indi-del" href="#" onclick="return delete_record('<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($record->getFullName())) ?>', '<?= e($record->getXref()) ?>', '<?= e($record->getTree()->getName()) ?>');">
<?= I18N::translate('Delete') ?>
</a>
diff --git a/resources/views/gedcom-record-page.php b/resources/views/gedcom-record-page.php
index 3c57002441..10bc0b9230 100644
--- a/resources/views/gedcom-record-page.php
+++ b/resources/views/gedcom-record-page.php
@@ -7,13 +7,13 @@
<?php if ($record->isPendingDeletion()): ?>
<?php if (Auth::isModerator($record->getTree())): ?>
- <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This record has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . $record->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $record->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
+ <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This record has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php elseif (Auth::isEditor($record->getTree())): ?>
<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This record has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php endif ?>
<?php elseif ($record->isPendingAddition()): ?>
<?php if (Auth::isModerator($record->getTree())): ?>
- <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This record has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . $record->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $record->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
+ <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This record has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php elseif (Auth::isEditor($record->getTree())): ?>
<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This record has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php endif ?>
diff --git a/resources/views/individual-page-menu.php b/resources/views/individual-page-menu.php
index 7428875a4f..0c45c4569f 100644
--- a/resources/views/individual-page-menu.php
+++ b/resources/views/individual-page-menu.php
@@ -33,7 +33,7 @@
<?php endif ?>
- <a class="dropdown-item menu-indi-del" href="#" onclick="return delete_record('<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($individual->getFullName())) ?>', '<?= $individual->getXref() ?>');">
+ <a class="dropdown-item menu-indi-del" href="#" onclick="return delete_record('<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($individual->getFullName())) ?>', '<?= e($individual->getXref()) ?>', '<?= e($individual->getTree()->getName()) ?>');">
<?= I18N::translate('Delete') ?>
</a>
diff --git a/resources/views/individual-page.php b/resources/views/individual-page.php
index 572e91ff87..6598585997 100644
--- a/resources/views/individual-page.php
+++ b/resources/views/individual-page.php
@@ -6,13 +6,13 @@
<?php if ($individual->isPendingDeletion()): ?>
<?php if (Auth::isModerator($individual->getTree())): ?>
- <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This individual has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . $individual->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $individual->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
+ <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This individual has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php elseif (Auth::isEditor($individual->getTree())): ?>
<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This individual has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php endif ?>
<?php elseif ($individual->isPendingAddition()): ?>
<?php if (Auth::isModerator($individual->getTree())): ?>
- <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This individual has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . $individual->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $individual->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' ) . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
+ <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This individual has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($individual->getXref()) . '\', \'' . e($individual->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($individual->getXref()) . '\', \'' . e($individual->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' ) . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php elseif (Auth::isEditor($individual->getTree())): ?>
<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This individual has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php endif ?>
diff --git a/resources/views/layouts/default.php b/resources/views/layouts/default.php
index 210f470108..44e313a5e3 100644
--- a/resources/views/layouts/default.php
+++ b/resources/views/layouts/default.php
@@ -10,14 +10,6 @@
<?= $theme_footer_container ?>
- <script>
- // Global constants
- var WT_MODULES_DIR = <?= json_encode(WT_MODULES_DIR) ?>;
- var WT_GEDCOM = <?= json_encode($tree ? $tree->getName() : '') ?>;
- var textDirection = <?= json_encode(I18N::direction()) ?>;
- var WT_LOCALE = <?= json_encode(WT_LOCALE) ?>;
- </script>
-
<script src="<?= e(WT_ASSETS_URL . 'js/vendor.js') ?>"></script>
<script src="<?= e(WT_ASSETS_URL . 'js/webtrees.js') ?>"></script>
diff --git a/resources/views/media-page-menu.php b/resources/views/media-page-menu.php
index fb83567c1c..4c69a5859b 100644
--- a/resources/views/media-page-menu.php
+++ b/resources/views/media-page-menu.php
@@ -12,22 +12,22 @@
<div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
<?php if (Module::getModuleByName('GEDFact_assistant')): ?>
- <a class="dropdown-item menu-obje-link" href="#" onclick="return ilinkitem('<?= e($record->getXref()) ?>','manage');">
+ <a class="dropdown-item menu-obje-link" href="#" onclick="return ilinkitem('<?= e($record->getXref()) ?>','manage','<?= e($record->getTree()->getName()) ?>');">
<?= I18N::translate('Manage the links') ?>
</a>
<?php else: ?>
- <a class=dropdown-item menu-obje-link-indi" href="#" onclick="return ilinkitem('<?= e($record->getXref()) ?>','person');">
+ <a class=dropdown-item menu-obje-link-indi" href="#" onclick="return ilinkitem('<?= e($record->getXref()) ?>','person','<?= e($record->getTree()->getName()) ?>');">
<?= I18N::translate('Link this media object to an individual') ?>
</a>
- <a class="dropdown-item menu-obje-link-fam" href="#" onclick="return ilinkitem('<?= e($record->getXref()) ?>','family');">
+ <a class="dropdown-item menu-obje-link-fam" href="#" onclick="return ilinkitem('<?= e($record->getXref()) ?>','family','<?= e($record->getTree()->getName()) ?>');">
<?= I18N::translate('Link this media object to a family') ?>
</a>
- <a class="dropdown-item menu-obje-link-sour" href="#" onclick="return ilinkitem('<?= e($record->getXref()) ?>','source');">
+ <a class="dropdown-item menu-obje-link-sour" href="#" onclick="return ilinkitem('<?= e($record->getXref()) ?>','source','<?= e($record->getTree()->getName()) ?>');">
<?= I18N::translate('Link this media object to a source') ?>
</a>
<?php endif ?>
- <a class="dropdown-item menu-obje-del" href="#" onclick="return delete_record('<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($record->getFullName())) ?>', '<?= $record->getXref() ?>');">
+ <a class="dropdown-item menu-obje-del" href="#" onclick="return delete_record('<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($record->getFullName())) ?>', '<?= e($record->getXref()) ?>', '<?= e($record->getTree()->getName()) ?>');">
<?= I18N::translate('Delete') ?>
</a>
diff --git a/resources/views/media-page.php b/resources/views/media-page.php
index a673a88f58..29f9050f96 100644
--- a/resources/views/media-page.php
+++ b/resources/views/media-page.php
@@ -10,13 +10,13 @@
<?php if ($media->isPendingDeletion()): ?>
<?php if (Auth::isModerator($media->getTree())): ?>
- <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This media object has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . $media->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $media->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
+ <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This media object has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php elseif (Auth::isEditor($media->getTree())): ?>
<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This media object has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php endif ?>
<?php elseif ($media->isPendingAddition()): ?>
<?php if (Auth::isModerator($media->getTree())): ?>
- <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This media object has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . $media->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $media->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' ) . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
+ <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This media object has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' ) . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php elseif (Auth::isEditor($media->getTree())): ?>
<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This media object has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php endif ?>
@@ -75,7 +75,7 @@
<div class="editfacts">
<?= FontAwesome::linkIcon('edit', I18N::translate('Edit'), ['class' => 'btn btn-link', 'href' => '#', 'data-toggle' => 'modal', 'data-target' => '#wt-ajax-modal', 'data-href' => route('edit-media-file', ['ged' => $media->getTree()->getName(), 'xref' => $media->getXref(), 'fact_id' => $media_file->factId()])]) ?>
<?php if (count($media->mediaFiles()) > 1): ?>
- <?= FontAwesome::linkIcon('delete', I18N::translate('Delete'), ['class' => 'btn btn-link', 'href' => '#', 'onclick' => 'return delete_fact("' . I18N::translate('Are you sure you want to delete this fact?') . '", "' . $media->getXref() . '", "' . $media_file->factId() . '");']) ?>
+ <?= FontAwesome::linkIcon('delete', I18N::translate('Delete'), ['class' => 'btn btn-link', 'href' => '#', 'onclick' => 'return delete_fact("' . I18N::translate('Are you sure you want to delete this fact?') . '", "' . e($media->gettree->getName()) . '", , "' . e($media->getXref()) . '", "' . $media_file->factId() . '");']) ?>
<?php endif ?>
</div>
<?php endif ?>
diff --git a/resources/views/note-page-menu.php b/resources/views/note-page-menu.php
index 0dbd57858b..f95ad87031 100644
--- a/resources/views/note-page-menu.php
+++ b/resources/views/note-page-menu.php
@@ -9,7 +9,7 @@
<?= I18N::translate('edit') ?>
</button>
<div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
- <a class="dropdown-item menu-note-del" href="#" onclick="return delete_record('<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($record->getFullName())) ?>', '<?= $record->getXref() ?>');">
+ <a class="dropdown-item menu-note-del" href="#" onclick="return delete_record('<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($record->getFullName())) ?>', '<?= e($record->getXref()) ?>', '<?= e($record->getTree()->getName()) ?>');">
<?= I18N::translate('Delete') ?>
</a>
diff --git a/resources/views/note-page.php b/resources/views/note-page.php
index 56713059a2..e516c49f3d 100644
--- a/resources/views/note-page.php
+++ b/resources/views/note-page.php
@@ -8,13 +8,13 @@
<?php if ($note->isPendingDeletion()): ?>
<?php if (Auth::isModerator($note->getTree())): ?>
- <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This note has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . $note->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $note->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
+ <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This note has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($note->getXref()) . '\', \'' . e($note->getTree()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($note->getXref()) . '\', \'' . e($note->getTree()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php elseif (Auth::isEditor($note->getTree())): ?>
<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This note has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php endif ?>
<?php elseif ($note->isPendingAddition()): ?>
<?php if (Auth::isModerator($note->getTree())): ?>
- <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This note has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . $note->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $note->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
+ <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This note has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($note->getXref()) . '\', \'' . e($note->getTree()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($note->getXref()) . '\', \'' . e($note->getTree()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php elseif (Auth::isEditor($note->getTree())): ?>
<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This note has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php endif ?>
diff --git a/resources/views/repository-page-menu.php b/resources/views/repository-page-menu.php
index 731553fda7..73419cf7a1 100644
--- a/resources/views/repository-page-menu.php
+++ b/resources/views/repository-page-menu.php
@@ -9,7 +9,7 @@
<?= I18N::translate('edit') ?>
</button>
<div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
- <a class="dropdown-item menu-repo-del" href="#" onclick="return delete_record('<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($record->getFullName())) ?>', '<?= $record->getXref() ?>');">
+ <a class="dropdown-item menu-repo-del" href="#" onclick="return delete_record('<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($record->getFullName())) ?>', '<?= e($record->getXref()) ?>', '<?= e($record->getTree()->getName()) ?>');">
<?= I18N::translate('Delete') ?>
</a>
diff --git a/resources/views/repository-page.php b/resources/views/repository-page.php
index 0de0c6ed06..d94c7c4ef3 100644
--- a/resources/views/repository-page.php
+++ b/resources/views/repository-page.php
@@ -7,13 +7,13 @@
<?php if ($repository->isPendingDeletion()): ?>
<?php if (Auth::isModerator($repository->getTree())): ?>
- <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This repository has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . $repository->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $repository->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
+ <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This repository has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($repository->getXref()) . '\', \'' . e($repository->getTree()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($repository->getXref()) . '\', \'' . e($repository->getTree()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php elseif (Auth::isEditor($repository->getTree())): ?>
<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This repository has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php endif ?>
<?php elseif ($repository->isPendingAddition()): ?>
<?php if (Auth::isModerator($repository->getTree())): ?>
- <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This repository has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . $repository->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $repository->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' ) . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
+ <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This repository has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $repository->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' ) . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php elseif (Auth::isEditor($repository->getTree())): ?>
<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This repository has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php endif ?>
diff --git a/resources/views/source-page-menu.php b/resources/views/source-page-menu.php
index cdb5838d63..3315facc35 100644
--- a/resources/views/source-page-menu.php
+++ b/resources/views/source-page-menu.php
@@ -9,7 +9,7 @@
<?= I18N::translate('edit') ?>
</button>
<div class="dropdown-menu dropdown-menu-right wt-page-menu-items" aria-labelledby="page-menu">
- <a class="dropdown-item menu-sour-del" href="#" onclick="return delete_record('<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($record->getFullName())) ?>', '<?= $record->getXref() ?>');">
+ <a class="dropdown-item menu-sour-del" href="#" onclick="return delete_record('<?= I18N::translate('Are you sure you want to delete “%s”?', strip_tags($record->getFullName())) ?>', '<?= e($record->getXref()) ?>', '<?= e($record->getTree()->getName()) ?>');">
<?= I18N::translate('Delete') ?>
</a>
diff --git a/resources/views/source-page.php b/resources/views/source-page.php
index e1a6cb7b12..5d8870aa57 100644
--- a/resources/views/source-page.php
+++ b/resources/views/source-page.php
@@ -8,13 +8,13 @@
<?php if ($source->isPendingDeletion()): ?>
<?php if (Auth::isModerator($source->getTree())): ?>
- <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This source has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . $source->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $source->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
+ <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This source has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($source->getXref()) . '\', \'' . e($source->getTree()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($source->getXref()) . '\', \'' . e($source->getTree()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php elseif (Auth::isEditor($source->getTree())): ?>
<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This source has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php endif ?>
<?php elseif ($source->isPendingAddition()): ?>
<?php if (Auth::isModerator($source->getTree())): ?>
- <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This source has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . $source->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $source->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' ) . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
+ <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This source has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($record->getXref()) . '\', \'' . e($record->getTree()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $source->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' ) . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php elseif (Auth::isEditor($source->getTree())): ?>
<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This source has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
<?php endif ?>
diff --git a/resources/views/timeline-chart.php b/resources/views/timeline-chart.php
index 6019ba63f1..eb8eebe60d 100644
--- a/resources/views/timeline-chart.php
+++ b/resources/views/timeline-chart.php
@@ -80,7 +80,7 @@
}
document.onmousemove = function (e) {
- var textDirection = document.querySelector("html").dir;
+ var textDirection = document.documentElement.dir;
if (ob === null) {
return true;