summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Controller/PageController.php8
-rw-r--r--app/Functions/FunctionsPrint.php2
-rw-r--r--app/Functions/FunctionsPrintFacts.php16
-rw-r--r--app/Http/Controllers/IndividualController.php2
-rw-r--r--app/Module/GoogleMapsModule.php74
-rw-r--r--app/Module/InteractiveTree/TreeView.php2
-rw-r--r--app/Theme/AbstractTheme.php6
-rw-r--r--edit_interface.php5
-rw-r--r--modules_v3/tree/js/treeview.js4
-rw-r--r--public/assets-2.0.0/js/webtrees.js2
-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
27 files changed, 100 insertions, 119 deletions
diff --git a/app/Controller/PageController.php b/app/Controller/PageController.php
index 37ab372049..b9b389cbd9 100644
--- a/app/Controller/PageController.php
+++ b/app/Controller/PageController.php
@@ -116,14 +116,6 @@ class PageController extends BaseController {
* @return $this
*/
public function pageHeader() {
- // Give Javascript access to some PHP constants
- $this->addInlineJavascript('
- var WT_MODULES_DIR = ' . json_encode(WT_MODULES_DIR) . ';
- var WT_GEDCOM = ' . json_encode($this->tree() ? $this->tree()->getName() : '') . ';
- var textDirection = ' . json_encode(I18N::direction()) . ';
- var WT_LOCALE = ' . json_encode(WT_LOCALE) . ';
- ', self::JS_PRIORITY_HIGH);
-
Theme::theme()->sendHeaders();
echo Theme::theme()->doctype();
echo Theme::theme()->html();
diff --git a/app/Functions/FunctionsPrint.php b/app/Functions/FunctionsPrint.php
index 421ff5cb41..93ebe55d5a 100644
--- a/app/Functions/FunctionsPrint.php
+++ b/app/Functions/FunctionsPrint.php
@@ -506,7 +506,7 @@ class FunctionsPrint {
}
if (!$newRow) {
echo '</select>';
- echo '&nbsp;&nbsp;<input type="button" value="', /* I18N: A button label. */ I18N::translate('add'), "\" onclick=\"return paste_fact('$id', '#newClipboardFact');\"> ";
+ echo '&nbsp;&nbsp;<input type="button" value="', /* I18N: A button label. */ I18N::translate('add'), '" onclick="return paste_fact(\'' . e($WT_TREE->getName()) . '\',\'' . e($id) . '\', \'#newClipboardFact\');"> ';
echo '</form></td></tr>', "\n";
}
}
diff --git a/app/Functions/FunctionsPrintFacts.php b/app/Functions/FunctionsPrintFacts.php
index 2658775204..32a56580f8 100644
--- a/app/Functions/FunctionsPrintFacts.php
+++ b/app/Functions/FunctionsPrintFacts.php
@@ -190,8 +190,8 @@ class FunctionsPrintFacts {
<?= $label ?>
<div class="editfacts">
<?= FontAwesome::linkIcon('edit', I18N::translate('Edit'), ['class' => 'btn btn-link', 'href' => 'edit_interface.php?action=edit&xref=' . $parent->getXref() . '&fact_id=' . $fact->getFactId() . '&ged=' . e($parent->getTree()->getName())]) ?>
- <?= FontAwesome::linkIcon('copy', I18N::translate('Copy'), ['class' => 'btn btn-link', 'href' => '#', 'onclick' => 'return copy_fact("' . $parent->getXref() . '", "' . $fact->getFactId() . '");']) ?>
- <?= 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?') . '", "' . $parent->getXref() . '", "' . $fact->getFactId() . '");']) ?>
+ <?= FontAwesome::linkIcon('copy', I18N::translate('Copy'), ['class' => 'btn btn-link', 'href' => '#', 'onclick' => 'return copy_fact("' . e($parent->getTree()->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");']) ?>
+ <?= 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($parent->getTree()->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");']) ?>
</div>
<?php
} else {
@@ -763,9 +763,9 @@ class FunctionsPrintFacts {
// into a link, and delete it.
// e.g. "1 SOUR my source" becomes "1 SOUR @my source@" which does not exist.
echo FontAwesome::linkIcon('edit', I18N::translate('Edit'), ['class' => 'btn btn-link', 'href' => 'edit_interface.php?action=edit&xref=' . $parent->getXref() . '&fact_id=' . $fact->getFactId() . '&ged=' . e($parent->getTree()->getName())]);
- echo FontAwesome::linkIcon('copy', I18N::translate('Copy'), ['class' => 'btn btn-link', 'href' => '#', 'onclick' => 'return copy_fact("' . $parent->getXref() . '", "' . $fact->getFactId() . '");']);
+ echo FontAwesome::linkIcon('copy', I18N::translate('Copy'), ['class' => 'btn btn-link', 'href' => '#', 'onclick' => 'return copy_fact("' . e($parent->getTree()->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");']);
}
- echo 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?') . '", "' . $parent->getXref() . '", "' . $fact->getFactId() . '");']);
+ echo 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($parent->getTree()->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");']);
} else {
echo GedcomTag::getLabel($factname, $parent);
}
@@ -977,8 +977,8 @@ class FunctionsPrintFacts {
}
echo '<div class="editfacts">';
echo FontAwesome::linkIcon('edit', I18N::translate('Edit'), ['class' => 'btn btn-link', 'href' => 'edit_interface.php?action=edit&xref=' . $parent->getXref() . '&fact_id=' . $fact->getFactId() . '&ged=' . e($parent->getTree()->getName())]);
- echo FontAwesome::linkIcon('copy', I18N::translate('Copy'), ['class' => 'btn btn-link', 'href' => '#', 'onclick' => 'return copy_fact("' . $parent->getXref() . '", "' . $fact->getFactId() . '");']);
- echo 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?') . '", "' . $parent->getXref() . '", "' . $fact->getFactId() . '");']);
+ echo FontAwesome::linkIcon('copy', I18N::translate('Copy'), ['class' => 'btn btn-link', 'href' => '#', 'onclick' => 'return copy_fact("' . e($parent->getTree()->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");']);
+ echo 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($parent->getTree()->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");']);
echo '</div>';
}
} else {
@@ -1110,8 +1110,8 @@ class FunctionsPrintFacts {
} elseif ($can_edit) {
echo GedcomTag::getLabel($factname, $parent);
echo '<div class="editfacts">';
- echo FontAwesome::linkIcon('copy', I18N::translate('Copy'), ['class' => 'btn btn-link', 'href' => '#', 'onclick' => 'return copy_fact("' . $parent->getXref() . '", "' . $fact->getFactId() . '");']);
- echo 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?') . '", "' . $parent->getXref() . '", "' . $fact->getFactId() . '");']);
+ echo FontAwesome::linkIcon('copy', I18N::translate('Copy'), ['class' => 'btn btn-link', 'href' => '#', 'onclick' => 'return copy_fact("' . e($parent->getTree()->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");']);
+ echo 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($parent->getTree()->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");']);
echo '</div>';
} else {
echo GedcomTag::getLabel($factname, $parent);
diff --git a/app/Http/Controllers/IndividualController.php b/app/Http/Controllers/IndividualController.php
index 5184fdef7f..a747b8ccc8 100644
--- a/app/Http/Controllers/IndividualController.php
+++ b/app/Http/Controllers/IndividualController.php
@@ -315,7 +315,7 @@
FontAwesome::linkIcon('delete', I18N::translate('Delete this name'), [
'class' => 'btn btn-link',
'href' => '#',
- 'onclick' => 'return delete_fact("' . I18N::translate('Are you sure you want to delete this fact?') . '", "' . $individual->getXref() . '", "' . $fact->getFactId() . '");',
+ 'onclick' => 'return delete_fact("' . I18N::translate('Are you sure you want to delete this fact?') . '", "' . e($individual->getTree()->getName()) . '", "' . e($individual->getXref()) . '", "' . $fact->getFactId() . '");',
]) .
FontAwesome::linkIcon('edit', I18N::translate('Edit the name'), [
'class' => 'btn btn-link',
diff --git a/app/Module/GoogleMapsModule.php b/app/Module/GoogleMapsModule.php
index 03b3164d59..0688ea5d0b 100644
--- a/app/Module/GoogleMapsModule.php
+++ b/app/Module/GoogleMapsModule.php
@@ -562,193 +562,193 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
// === Create an associative array of GIcons()
var gicons = [];
gicons["1"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon1.png"
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon1.png"
};
gicons["2"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon2.png"
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon2.png"
};
gicons["2L"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon2L.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon2L.png",
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(28, 28)
};
gicons["2R"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon2R.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon2R.png",
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(4, 28)
};
gicons["2Ls"] = {
- url: WT_MODULES_DIR+"googlemap/images/icon2Ls.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon2Ls.png",
size: new google.maps.Size(24, 24),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(22, 22)
};
gicons["2Rs"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon2Rs.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon2Rs.png",
size: new google.maps.Size(24, 24),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(2, 22)
};
gicons["3"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon3.png"
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon3.png"
};
gicons["3L"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon3L.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon3L.png",
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(28, 28)
};
gicons["3R"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon3R.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon3R.png",
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(4, 28)
};
gicons["3Ls"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon3Ls.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon3Ls.png",
size: new google.maps.Size(24, 24),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(22, 22)
};
gicons["3Rs"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon3Rs.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon3Rs.png",
size: new google.maps.Size(24, 24),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(2, 22)
};
gicons["4"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon4.png"
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon4.png"
};
gicons["4L"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon4L.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon4L.png",
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(28, 28)
};
gicons["4R"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon4R.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon4R.png",
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(4, 28)
};
gicons["4Ls"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon4Ls.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon4Ls.png",
size: new google.maps.Size(24, 24),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(22, 22)
};
gicons["4Rs"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon4Rs.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon4Rs.png",
size: new google.maps.Size(24, 24),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(2, 22)
};
gicons["5"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon5.png"
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon5.png"
};
gicons["5L"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon5L.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon5L.png",
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(28, 28)
};
gicons["5R"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon5R.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon5R.png",
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(4, 28)
};
gicons["5Ls"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon5Ls.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon5Ls.png",
size: new google.maps.Size(24, 24),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(22, 22)
};
gicons["5Rs"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon5Rs.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon5Rs.png",
size: new google.maps.Size(24, 24),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(2, 22)
};
gicons["6"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon6.png"
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon6.png"
};
gicons["6L"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon6L.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon6L.png",
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(28, 28)
};
gicons["6R"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon6R.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon6R.png",
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(4, 28)
};
gicons["6Ls"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon6Ls.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon6Ls.png",
size: new google.maps.Size(24, 24),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(22, 22)
};
gicons["6Rs"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon6Rs.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon6Rs.png",
size: new google.maps.Size(24, 24),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(2, 22)
};
gicons["7"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon7.png"
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon7.png"
};
gicons["7L"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon7L.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon7L.png",
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(28, 28)
};
gicons["7R"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon7R.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon7R.png",
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(4, 28)
};
gicons["7Ls"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon7Ls.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon7Ls.png",
size: new google.maps.Size(24, 24),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(22, 22)
};
gicons["7Rs"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon7Rs.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon7Rs.png",
size: new google.maps.Size(24, 24),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(2, 22)
};
gicons["8"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon8.png"
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon8.png"
};
gicons["8L"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon8L.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon8L.png",
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(28, 28)
};
gicons["8R"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon8R.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon8R.png",
size: new google.maps.Size(32, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(4, 28)
};
gicons["8Ls"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon8Ls.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon8Ls.png",
size: new google.maps.Size(24, 24),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(22, 22)
};
gicons["8Rs"] = {
- url: WT_MODULES_DIR + "googlemap/images/icon8Rs.png",
+ url: "<?= WT_MODULES_DIR ?>googlemap/images/icon8Rs.png",
size: new google.maps.Size(24, 24),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(2, 22)
@@ -2787,7 +2787,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
<?php
if ($level < 3 && $record->pl_icon != '') {
echo 'var image = {
- "url" : WT_MODULES_DIR + "googlemap/" + "' . $record->pl_icon . '",
+ "url" : "' . WT_MODULES_DIR . 'googlemap/" + "' . $record->pl_icon . '",
"size" : new google.maps.Size(25, 15),
"origin" : new google.maps.Point(0, 0),
"anchor" : new google.maps.Point(12, 15)
diff --git a/app/Module/InteractiveTree/TreeView.php b/app/Module/InteractiveTree/TreeView.php
index 786b2371dc..6ce8d36122 100644
--- a/app/Module/InteractiveTree/TreeView.php
+++ b/app/Module/InteractiveTree/TreeView.php
@@ -50,7 +50,7 @@ class TreeView {
'individual' => $this->drawPerson($individual, $generations, 0, null, null, true),
]);
- return [$html, 'var ' . $this->name . 'Handler = new TreeViewHandler("' . $this->name . '");'];
+ return [$html, 'var ' . $this->name . 'Handler = new TreeViewHandler("' . $this->name . '", "' . e($individual->getTree()->getName()) . '");'];
}
/**
diff --git a/app/Theme/AbstractTheme.php b/app/Theme/AbstractTheme.php
index 349e40a0c9..9e396e9180 100644
--- a/app/Theme/AbstractTheme.php
+++ b/app/Theme/AbstractTheme.php
@@ -831,7 +831,7 @@ abstract class AbstractTheme {
}
return
- '<div data-pid="' . $individual->getXref() . '" class="person_box_template ' . $personBoxClass . ' box-style1" style="width: ' . $this->parameter('chart-box-x') . 'px; height: ' . $this->parameter('chart-box-y') . 'px">' .
+ '<div data-xref="' . e($individual->getXref()) . '" data-tree="' . e($individual->getTree()->getName()) . '" class="person_box_template ' . $personBoxClass . ' box-style1" style="width: ' . $this->parameter('chart-box-x') . 'px; height: ' . $this->parameter('chart-box-y') . 'px">' .
$icons .
'<div class="chart_textbox" style="max-height:' . $this->parameter('chart-box-y') . 'px;">' .
$thumbnail .
@@ -883,7 +883,7 @@ abstract class AbstractTheme {
}
return
- '<div data-pid="' . $individual->getXref() . '" class="person_box_template ' . $personBoxClass . ' box-style2">' .
+ '<div data-xref="' . e($individual->getXref()) . '" data-tree="' . e($individual->getTree()->getName()) . '" class="person_box_template ' . $personBoxClass . ' box-style2">' .
$icons .
'<div class="chart_textbox" style="max-height:' . $this->parameter('chart-box-y') . 'px;">' .
$thumbnail .
@@ -910,7 +910,7 @@ abstract class AbstractTheme {
}
return
- '<div data-pid="' . $individual->getXref() . '" class="person_box_template ' . $personBoxClass . ' iconz box-style0" style="width: ' . $this->parameter('compact-chart-box-x') . 'px; min-height: ' . $this->parameter('compact-chart-box-y') . 'px">' .
+ '<div data-xref="' . $individual->getXref() . '" class="person_box_template ' . $personBoxClass . ' iconz box-style0" style="width: ' . $this->parameter('compact-chart-box-x') . 'px; min-height: ' . $this->parameter('compact-chart-box-y') . 'px">' .
'<div class="compact_view">' .
$thumbnail .
'<a href="' . e($individual->url()) . '">' .
diff --git a/edit_interface.php b/edit_interface.php
index 0466c8e632..2e644e9578 100644
--- a/edit_interface.php
+++ b/edit_interface.php
@@ -1812,10 +1812,11 @@ function print_indi_form($nextaction, Individual $person = null, Family $family
// For example, to differentiate the two Spanish surnames from an English
// double-barred name.
// Commas *may* be used in other fields, and will form part of the NAME.
- if (WT_LOCALE === "vi" || WT_LOCALE === "hu") {
+ var locale = document.documentElement.lang;
+ if (locale === "vi" || locale === "hu") {
// Default format: /SURN/ GIVN
return trim(npfx+" /"+trim(spfx+" "+surn).replace(/ *, */g, " ")+"/ "+givn.replace(/ *, */g, " ")+" "+nsfx);
- } else if (WT_LOCALE === "zh-Hans" || WT_LOCALE === "zh-Hant") {
+ } else if (locale === "zh-Hans" || locale === "zh-Hant") {
// Default format: /SURN/GIVN
return npfx+"/"+spfx+surn+"/"+givn+nsfx;
} else {
diff --git a/modules_v3/tree/js/treeview.js b/modules_v3/tree/js/treeview.js
index 9a1e5e603a..7ee96603a4 100644
--- a/modules_v3/tree/js/treeview.js
+++ b/modules_v3/tree/js/treeview.js
@@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-function TreeViewHandler(treeview_instance) {
+function TreeViewHandler(treeview_instance, ged) {
var tv = this; // Store "this" for usage within jQuery functions where "this" is not this ;-)
this.treeview = $("#" + treeview_instance + "_in");
@@ -24,7 +24,7 @@ function TreeViewHandler(treeview_instance) {
this.boxWidth = 180; // default family box width
this.boxExpandedWidth = 250; // default expanded family box width
this.cookieDays = 3; // lifetime of preferences memory, in days
- this.ajaxUrl = "module.php?mod=tree&ged=" + encodeURIComponent(WT_GEDCOM) + "&instance=" + treeview_instance + "&mod_action=";
+ this.ajaxUrl = "module.php?mod=tree&ged=" + encodeURIComponent(ged) + "&instance=" + treeview_instance + "&mod_action=";
this.container = this.treeview.parent(); // Store the container element ("#" + treeview_instance + "_out")
this.auto_box_width = false;
diff --git a/public/assets-2.0.0/js/webtrees.js b/public/assets-2.0.0/js/webtrees.js
index f670ad410f..ab28d487cf 100644
--- a/public/assets-2.0.0/js/webtrees.js
+++ b/public/assets-2.0.0/js/webtrees.js
@@ -1 +1 @@
-"use strict";function expand_layer(e){return $("#"+e+"_img").toggleClass("icon-plus icon-minus"),$("#"+e).slideToggle("fast"),$("#"+e+"-alt").toggle(),!1}function accept_changes(e){return $.post("index.php",{route:"accept-changes",xref:e,ged:WT_GEDCOM},function(){location.reload()}),!1}function reject_changes(e){return $.post("index.php",{route:"reject-changes",xref:e,ged:WT_GEDCOM},function(){location.reload()}),!1}function delete_record(e,t,n){return confirm(e)&&$.post("index.php",{route:"delete-record",xref:t,ged:void 0===n?WT_GEDCOM:n},function(){location.reload()}),!1}function delete_fact(e,t,n){return confirm(e)&&$.post("index.php",{route:"delete-fact",xref:t,fact_id:n,ged:WT_GEDCOM},function(){location.reload()}),!1}function copy_fact(e,t){return $.post("index.php",{route:"copy-fact",xref:e,fact_id:t,ged:WT_GEDCOM},function(){location.reload()}),!1}function paste_fact(e,t){return $.post("index.php",{route:"paste-fact",xref:e,fact_id:$(t).val(),ged:WT_GEDCOM},function(){location.reload()}),!1}function delete_user(e,t){return confirm(e)&&$.post("index.php",{route:"delete-user",user_id:t},function(){location.reload()}),!1}function masquerade(e){return $.post("index.php",{route:"masquerade",user_id:e},function(){location.reload()}),!1}function addmedia_links(e,t,n){return pastefield=e,insertRowToTable(t,n),!1}function valid_date(e){var t=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],n=["MUHAR","SAFAR","RABIA","RABIT","JUMAA","JUMAT","RAJAB","SHAAB","RAMAD","SHAWW","DHUAQ","DHUAH"],o=["TSH","CSH","KSL","TVT","SHV","ADR","ADS","NSN","IYR","SVN","TMZ","AAV","ELL"],a=["VEND","BRUM","FRIM","NIVO","PLUV","VENT","GERM","FLOR","PRAI","MESS","THER","FRUC","COMP"],l=["FARVA","ORDIB","KHORD","TIR","MORDA","SHAHR","MEHR","ABAN","AZAR","DEY","BAHMA","ESFAN"],i=e.value,r=i.split("("),s="";if(r.length>1&&(i=r[0],s=r[1]),i=i.toUpperCase(),i=i.replace(/\s+/," "),i=i.replace(/(^\s)|(\s$)/,""),i=i.replace(/(\d)([A-Z])/,"$1 $2"),i=i.replace(/([A-Z])(\d)/,"$1 $2"),i.match(/^Q ([1-4]) (\d\d\d\d)$/)&&(i="BET "+t[3*RegExp.$1-3]+" "+RegExp.$2+" AND "+t[3*RegExp.$1-1]+" "+RegExp.$2),i.match(/^(@#DHIJRI@|HIJRI)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DHIJRI@"+RegExp.$2+n[parseInt(RegExp.$3,10)-1]+RegExp.$4),i.match(/^(@#DJALALI@|JALALI)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DJALALI@"+RegExp.$2+l[parseInt(RegExp.$3,10)-1]+RegExp.$4),i.match(/^(@#DHEBREW@|HEBREW)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DHEBREW@"+RegExp.$2+o[parseInt(RegExp.$3,10)-1]+RegExp.$4),i.match(/^(@#DFRENCH R@|FRENCH)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DFRENCH R@"+RegExp.$2+a[parseInt(RegExp.$3,10)-1]+RegExp.$4),/^([^\d]*)(\d+)[^\d](\d+)[^\d](\d+)$/i.exec(i)){var d=RegExp.$1,c=parseInt(RegExp.$2,10),u=parseInt(RegExp.$3,10),p=parseInt(RegExp.$4,10),f="DMY";"undefined"!=typeof locale_date_format&&("MDY"!==locale_date_format&&"YMD"!==locale_date_format||(f=locale_date_format));var m=(new Date).getFullYear(),h=m%100,g=m-h;"DMY"===f&&c<=31&&u<=12||c>13&&c<=31&&u<=12&&p>31?i=d+c+" "+t[u-1]+" "+(p>=100?p:p<=h?p+g:p+g-100):"MDY"===f&&c<=12&&u<=31||u>13&&u<=31&&c<=12&&p>31?i=d+u+" "+t[c-1]+" "+(p>=100?p:p<=h?p+g:p+g-100):("YMD"===f&&u<=12&&p<=31||p>13&&p<=31&&u<=12&&c>31)&&(i=d+p+" "+t[u-1]+" "+(c>=100?c:c<=h?c+g:c+g-100))}i=i.replace(/^[>]([\w ]+)$/,"AFT $1"),i=i.replace(/^[<]([\w ]+)$/,"BEF $1"),i=i.replace(/^([\w ]+)[-]$/,"FROM $1"),i=i.replace(/^[-]([\w ]+)$/,"TO $1"),i=i.replace(/^[~]([\w ]+)$/,"ABT $1"),i=i.replace(/^[*]([\w ]+)$/,"EST $1"),i=i.replace(/^[#]([\w ]+)$/,"CAL $1"),i=i.replace(/^([\w ]+) ?- ?([\w ]+)$/,"BET $1 AND $2"),i=i.replace(/^([\w ]+) ?~ ?([\w ]+)$/,"FROM $1 TO $2"),i=i.replace(/(JANUARY)/,"JAN"),i=i.replace(/(FEBRUARY)/,"FEB"),i=i.replace(/(MARCH)/,"MAR"),i=i.replace(/(APRIL)/,"APR"),i=i.replace(/(MAY)/,"MAY"),i=i.replace(/(JUNE)/,"JUN"),i=i.replace(/(JULY)/,"JUL"),i=i.replace(/(AUGUST)/,"AUG"),i=i.replace(/(SEPTEMBER)/,"SEP"),i=i.replace(/(OCTOBER)/,"OCT"),i=i.replace(/(NOVEMBER)/,"NOV"),i=i.replace(/(DECEMBER)/,"DEC"),i=i.replace(/(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)\.? (\d\d?)[, ]+(\d\d\d\d)/,"$2 $1 $3"),i=i.replace(/(^| )(\d [A-Z]{3,5} \d{4})/,"$10$2"),s&&(i=i+" ("+s),e.value!==i&&(e.value=i)}function show_submenu(e,t){var n=document.body.scrollWidth+document.documentElement.scrollLeft,o=document.getElementById(e);if(o&&o.style){document.all?n=document.body.offsetWidth:(n=document.body.scrollWidth+document.documentElement.scrollLeft-55,"rtl"===textDirection&&o.offsetLeft+o.offsetWidth+10);for(var a=0,l=o.childNodes.length,i=0;i<l;i++){var r=o.childNodes[i];r.offsetWidth>a+5&&(a=r.offsetWidth)}o.offsetWidth<a&&(o.style.width=a+"px");var s;if((s=document.getElementById(t))&&(o.style.left=s.style.left,o.offsetLeft+o.offsetWidth+10>n)){var d=n-o.offsetWidth;o.style.left=d+"px"}o.offsetLeft<0&&(o.style.left="0px"),o.offsetHeight>500&&(o.style.height="400px",o.style.overflow="auto"),o.style.visibility="visible"}clearTimeout(menutimeouts[e]),menutimeouts[e]=null}function hide_submenu(e){if("number"==typeof menutimeouts[e]){var t=document.getElementById(e);t&&t.style&&(t.style.visibility="hidden"),clearTimeout(menutimeouts[e]),menutimeouts[e]=null}}function timeout_submenu(e){"number"!=typeof menutimeouts[e]&&(menutimeouts[e]=setTimeout("hide_submenu('"+e+"')",100))}function statusDisable(e){var t=document.getElementById(e);t.checked=!1,t.disabled=!0}function statusEnable(e){document.getElementById(e).disabled=!1}function statusChecked(e){document.getElementById(e).checked=!0}function cal_setMonthNames(e,t,n,o,a,l,i,r,s,d,c,u){monthLabels[1]=e,monthLabels[2]=t,monthLabels[3]=n,monthLabels[4]=o,monthLabels[5]=a,monthLabels[6]=l,monthLabels[7]=i,monthLabels[8]=r,monthLabels[9]=s,monthLabels[10]=d,monthLabels[11]=c,monthLabels[12]=u}function cal_setDayHeaders(e,t,n,o,a,l,i){daysOfWeek[0]=e,daysOfWeek[1]=t,daysOfWeek[2]=n,daysOfWeek[3]=o,daysOfWeek[4]=a,daysOfWeek[5]=l,daysOfWeek[6]=i}function cal_setWeekStart(e){e>=0&&e<7&&(weekStart=e)}function calendarWidget(e,t){var n=document.getElementById(e),o=document.getElementById(t);if("visible"===n.style.visibility)return n.style.visibility="hidden",!1;if("show"===n.style.visibility)return n.style.visibility="hide",!1;var a,l=/((\d+ (JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC) )?\d+)/i;return a=l.exec(o.value)?new Date(RegExp.$1):new Date,n.innerHTML=cal_generateSelectorContent(t,e,a),"hidden"===n.style.visibility?(n.style.visibility="visible",!1):"hide"===n.style.visibility&&(n.style.visibility="show",!1)}function cal_generateSelectorContent(e,t,n){var o,a,l='<table border="1"><tr>';for(l+='<td><select class="form-control" id="'+e+'_daySelect" onchange="return cal_updateCalendar(\''+e+"', '"+t+"');\">",o=1;o<32;o++)l+='<option value="'+o+'"',n.getDate()===o&&(l+=' selected="selected"'),l+=">"+o+"</option>";for(l+="</select></td>",l+='<td><select class="form-control" id="'+e+'_monSelect" onchange="return cal_updateCalendar(\''+e+"', '"+t+"');\">",o=1;o<13;o++)l+='<option value="'+o+'"',n.getMonth()+1===o&&(l+=' selected="selected"'),l+=">"+monthLabels[o]+"</option>";for(l+="</select></td>",l+='<td><input class="form-control" type="text" id="'+e+'_yearInput" size="5" value="'+n.getFullYear()+'" onchange="return cal_updateCalendar(\''+e+"', '"+t+"');\" /></td></tr>",l+='<tr><td colspan="3">',l+='<table width="100%">',l+="<tr>",a=weekStart,o=0;o<7;o++)l+="<td ",l+='class="descriptionbox"',l+=">",l+=daysOfWeek[a],l+="</td>",++a>6&&(a=0);l+="</tr>";var i=new Date(n.getFullYear(),n.getMonth(),1),r=i.getDay();r-=weekStart;for(i=i.getTime()-864e5*r+432e5,i=new Date(i),a=0;a<6;a++){for(l+="<tr>",o=0;o<7;o++){l+="<td ",i.getMonth()===n.getMonth()?i.getDate()===n.getDate()?l+='class="descriptionbox"':l+='class="optionbox"':l+='style="background-color:#EAEAEA; border: solid #AAAAAA 1px;"',l+='><a href="#" onclick="return cal_dateClicked(\''+e+"', '"+t+"', "+i.getFullYear()+", "+i.getMonth()+", "+i.getDate()+');">',l+=i.getDate(),l+="</a></td>";var s=i.getTime()+864e5;i=new Date(s)}l+="</tr>"}return l+="</table>",l+="</td></tr>",l+="</table>"}function cal_setDateField(e,t,n,o){var a=document.getElementById(e);return!!a&&(o<10&&(o="0"+o),a.value=o+" "+monthShort[n+1]+" "+t,!1)}function cal_updateCalendar(e,t){var n=document.getElementById(e+"_daySelect");if(!n)return!1;var o=document.getElementById(e+"_monSelect");if(!o)return!1;var a=document.getElementById(e+"_yearInput");if(!a)return!1;var l=parseInt(o.options[o.selectedIndex].value,10);l-=1;var i=new Date(a.value,l,n.options[n.selectedIndex].value);cal_setDateField(e,i.getFullYear(),i.getMonth(),i.getDate());var r=document.getElementById(t);return r?(r.innerHTML=cal_generateSelectorContent(e,t,i),!1):(alert("no dateDiv "+t),!1)}function cal_dateClicked(e,t,n,o,a){return cal_setDateField(e,n,o,a),calendarWidget(t,e),!1}function openerpasteid(e){window.opener.paste_id&&window.opener.paste_id(e),window.close()}function paste_id(e){pastefield.value=e}function pastename(e){nameElement&&(nameElement.innerHTML=e),remElement&&(remElement.style.display="block")}function paste_char(e){document.selection?(pastefield.focus(),document.selection.createRange().text=e):pastefield.selectionStart||0===pastefield.selectionStart?(pastefield.value=pastefield.value.substring(0,pastefield.selectionStart)+e+pastefield.value.substring(pastefield.selectionEnd,pastefield.value.length),pastefield.selectionStart=pastefield.selectionEnd=pastefield.selectionStart+e.length):pastefield.value+=e,"NPFX"!==pastefield.id&&"GIVN"!==pastefield.id&&"SPFX"!==pastefield.id&&"SURN"!==pastefield.id&&"NSFX"!==pastefield.id||updatewholename()}function ilinkitem(e,t,n){return n=void 0===n?WT_GEDCOM:n,window.open("inverselink.php?mediaid="+encodeURIComponent(e)+"&linkto="+encodeURIComponent(t)+"&ged="+encodeURIComponent(n),"_blank",find_window_specs),!1}function persistent_toggle(e,t){var n=document.getElementById(e),o=document.querySelectorAll(t),a=localStorage.getItem(e);if(n){""!==a&&(a="none"),n.checked=""===a;for(var l=0;l<o.length;++l)o[l].style.display=a;n.addEventListener("click",function(){console.log(a),a=""===a?"none":"",localStorage.setItem(e,a);for(var t=0;t<o.length;++t)o[t].style.display=a})}}function valid_lati_long(e,t,n){var o=e.value.toUpperCase();o=o.replace(/(^\s*)|(\s*$)/g,""),o=o.replace(/ /g,":"),o=o.replace(/\+/g,""),o=o.replace(/-/g,n),o=o.replace(/,/g,"."),o=o.replace(/\u00b0/g,":"),o=o.replace(/\u0027/g,":"),o=o.replace(/^([0-9]+):([0-9]+):([0-9.]+)(.*)/g,function(e,t,n,o,a){var l=parseFloat(t);return l+=n/60,l+=o/3600,l=Math.round(1e4*l)/1e4,a+l}),o=o.replace(/^([0-9]+):([0-9]+)(.*)/g,function(e,t,n,o){var a=parseFloat(t);return a+=n/60,a=Math.round(1e4*a)/1e4,o+a}),o=o.replace(/(.*)([N|S|E|W]+)$/g,"$2$1"),o&&o.charAt(0)!==n&&o.charAt(0)!==t&&(o=t+o),e.value=o}function activate_colorbox(e){$.extend($.colorbox.settings,{fixed:!0,current:"",previous:"",next:"",slideshowStart:"",slideshowStop:"",close:""}),e&&$.extend($.colorbox.settings,e),$("body").on("click","a.gallery",function(){$("a[type^=image].gallery").colorbox({photo:!0,maxWidth:"95%",maxHeight:"95%",rel:"gallery",slideshow:!0,slideshowAuto:!1,onComplete:function(){$(".cboxPhoto").unbind("click"),wheelzoom(document.querySelectorAll(".cboxPhoto"))}})})}function autocomplete(e){$(e).each(function(){$(this).typeahead(null,{display:"value",source:new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("value"),queryTokenizer:Bloodhound.tokenizers.whitespace,remote:{url:this.dataset.autocompleteUrl,wildcard:"QUERY"}})})})}function insertTextAtCursor(e,t){var n=e.scrollTop,o=e.selectionStart,a=e.value.substring(0,o),l=e.value.substring(e.selectionEnd,e.value.length);e.value=a+t+l,e.selectionStart=o+t.length,e.selectionEnd=e.selectionStart,e.focus(),e.scrollTop=n}var textDirection=$("html").attr("dir"),pastefield,menutimeouts=[],monthLabels=[];monthLabels[1]="January",monthLabels[2]="February",monthLabels[3]="March",monthLabels[4]="April",monthLabels[5]="May",monthLabels[6]="June",monthLabels[7]="July",monthLabels[8]="August",monthLabels[9]="September",monthLabels[10]="October",monthLabels[11]="November",monthLabels[12]="December";var monthShort=[];monthShort[1]="JAN",monthShort[2]="FEB",monthShort[3]="MAR",monthShort[4]="APR",monthShort[5]="MAY",monthShort[6]="JUN",monthShort[7]="JUL",monthShort[8]="AUG",monthShort[9]="SEP",monthShort[10]="OCT",monthShort[11]="NOV",monthShort[12]="DEC";var daysOfWeek=[];daysOfWeek[0]="S",daysOfWeek[1]="M",daysOfWeek[2]="T",daysOfWeek[3]="W",daysOfWeek[4]="T",daysOfWeek[5]="F",daysOfWeek[6]="S";var weekStart=0;$("body").on("click",".iconz",function(e){function t(){o.parent().css("z-index",100),n(),i.addClass("nameZoom"),l.hide(0,function(){a.slideDown()})}function n(){o.toggleClass(function(){return r+" "+r+"-expanded"})}e.stopPropagation();var o=$(this).closest(".person_box_template"),a=o.find(".inout"),l=o.find(".inout2"),i=o.find(".namedef"),r=o.attr("class").match(/(box-style[0-2])/)[1];a.text().length?o.hasClass(r)?t():function(){a.slideUp(function(){l.show(0),i.removeClass("nameZoom"),n(),o.parent().css("z-index","")})}():(o.css("cursor","progress"),a.load("index.php",{route:"expand-chart-box",xref:o.data("pid"),ged:WT_GEDCOM},function(){o.css("cursor",""),t()})),o.find(".iconz").toggleClass("icon-zoomin icon-zoomout")}),$(function(){$.ajaxSetup({headers:{"X-CSRF-TOKEN":$("meta[name=csrf]").attr("content")}}),$("[data-ajax-url]").each(function(){$(this).load($(this).data("ajaxUrl"))}),$('a[data-toggle="tab"][data-href]').on("show.bs.tab",function(){$(this.getAttribute("href")+":empty").load($(this).data("href"))}),autocomplete("input[data-autocomplete-url]"),$("select.select2").select2({escapeMarkup:function(e){return e}}),$("select.select2").on("select2:unselect",function(e){$(e.delegateTarget).append('<option value="" selected="selected"></option>')}),$.fn.dataTableExt.oSort["text-asc"]=function(e,t){return e.localeCompare(t,document.documentElement.lang,{sensitivity:"base"})},$.fn.dataTableExt.oSort["text-desc"]=function(e,t){return t.localeCompare(e,document.documentElement.lang,{sensitivity:"base"})},$("table.datatables").each(function(){$(this).DataTable(),$(this).show()}),$(".wt-modal-create-record").on("show.bs.modal",function(e){$("form",$(this)).data("element-id",$(e.relatedTarget).data("element-id")),$("form .form-group input:first",$(this)).focus()}),$(".wt-modal-create-record form").on("submit",function(e){e.preventDefault();var t=$(this).data("element-id");alert(123),$.ajax({url:"index.php",type:"POST",data:new FormData(this),async:!1,cache:!1,contentType:!1,processData:!1,success:function(e){$("#"+t).select2().empty().append(new Option(e.text,e.id)).val(e.id).trigger("change")},failure:function(e){alert(e.error_message)}}),this.reset(),$(this).closest(".wt-modal-create-record").modal("hide")}),$(".menu-language").on("click","[data-language]",function(){return $.post("index.php",{route:"language",language:$(this).data("language")},function(){window.location.reload()}),!1}),$(".menu-theme").on("click","[data-theme]",function(){return $.post("index.php",{route:"theme",theme:$(this).data("theme")},function(){window.location.reload()}),!1});var e;$(".wt-osk-trigger").click(function(){e=document.getElementById($(this).data("id")),e.focus(),$(".wt-osk").show()}),$(document).on("focusin",":input",function(){e=this}),$(".wt-osk-script-button").change(function(){$(".wt-osk-script").prop("hidden",!0),$(".wt-osk-script-"+$(this).data("script")).prop("hidden",!1)}),$(".wt-osk-shift-button").click(function(){document.querySelector(".wt-osk-keys").classList.toggle("shifted")}),$(".wt-osk-keys").on("click",".wt-osk-key",function(){var t=$(this).contents().get(0).nodeValue,n=$(".wt-osk-shift-button").hasClass("active"),o=$("sup",this)[0];if(n&&void 0!==o&&(t=o.innerText),null!==e){var a=e.selectionStart,l=e.value,i=l.substring(0,a),r=l.substring(a,l.length);e.value=i+t+r,!1===$(".wt-osk-pin-button").hasClass("active")&&$(".wt-osk").hide()}})}); \ No newline at end of file
+"use strict";function expand_layer(e){return $("#"+e+"_img").toggleClass("icon-plus icon-minus"),$("#"+e).slideToggle("fast"),$("#"+e+"-alt").toggle(),!1}function accept_changes(e,t){return $.post("index.php",{route:"accept-changes",xref:e,ged:t},function(){location.reload()}),!1}function reject_changes(e,t){return $.post("index.php",{route:"reject-changes",xref:e,ged:t},function(){location.reload()}),!1}function delete_record(e,t,n){return confirm(e)&&$.post("index.php",{route:"delete-record",xref:t,ged:n},function(){location.reload()}),!1}function delete_fact(e,t,n,o){return confirm(e)&&$.post("index.php",{route:"delete-fact",xref:n,fact_id:o,ged:t},function(){location.reload()}),!1}function copy_fact(e,t,n){return $.post("index.php",{route:"copy-fact",xref:t,fact_id:n,ged:e},function(){location.reload()}),!1}function paste_fact(e,t,n){return $.post("index.php",{route:"paste-fact",xref:t,fact_id:$(n).val(),ged:e},function(){location.reload()}),!1}function delete_user(e,t){return confirm(e)&&$.post("index.php",{route:"delete-user",user_id:t},function(){location.reload()}),!1}function masquerade(e){return $.post("index.php",{route:"masquerade",user_id:e},function(){location.reload()}),!1}function addmedia_links(e,t,n){return pastefield=e,insertRowToTable(t,n),!1}function valid_date(e){var t=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],n=["MUHAR","SAFAR","RABIA","RABIT","JUMAA","JUMAT","RAJAB","SHAAB","RAMAD","SHAWW","DHUAQ","DHUAH"],o=["TSH","CSH","KSL","TVT","SHV","ADR","ADS","NSN","IYR","SVN","TMZ","AAV","ELL"],a=["VEND","BRUM","FRIM","NIVO","PLUV","VENT","GERM","FLOR","PRAI","MESS","THER","FRUC","COMP"],l=["FARVA","ORDIB","KHORD","TIR","MORDA","SHAHR","MEHR","ABAN","AZAR","DEY","BAHMA","ESFAN"],i=e.value,r=i.split("("),s="";if(r.length>1&&(i=r[0],s=r[1]),i=i.toUpperCase(),i=i.replace(/\s+/," "),i=i.replace(/(^\s)|(\s$)/,""),i=i.replace(/(\d)([A-Z])/,"$1 $2"),i=i.replace(/([A-Z])(\d)/,"$1 $2"),i.match(/^Q ([1-4]) (\d\d\d\d)$/)&&(i="BET "+t[3*RegExp.$1-3]+" "+RegExp.$2+" AND "+t[3*RegExp.$1-1]+" "+RegExp.$2),i.match(/^(@#DHIJRI@|HIJRI)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DHIJRI@"+RegExp.$2+n[parseInt(RegExp.$3,10)-1]+RegExp.$4),i.match(/^(@#DJALALI@|JALALI)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DJALALI@"+RegExp.$2+l[parseInt(RegExp.$3,10)-1]+RegExp.$4),i.match(/^(@#DHEBREW@|HEBREW)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DHEBREW@"+RegExp.$2+o[parseInt(RegExp.$3,10)-1]+RegExp.$4),i.match(/^(@#DFRENCH R@|FRENCH)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DFRENCH R@"+RegExp.$2+a[parseInt(RegExp.$3,10)-1]+RegExp.$4),/^([^\d]*)(\d+)[^\d](\d+)[^\d](\d+)$/i.exec(i)){var d=RegExp.$1,c=parseInt(RegExp.$2,10),u=parseInt(RegExp.$3,10),p=parseInt(RegExp.$4,10),f="DMY";"undefined"!=typeof locale_date_format&&("MDY"!==locale_date_format&&"YMD"!==locale_date_format||(f=locale_date_format));var m=(new Date).getFullYear(),h=m%100,g=m-h;"DMY"===f&&c<=31&&u<=12||c>13&&c<=31&&u<=12&&p>31?i=d+c+" "+t[u-1]+" "+(p>=100?p:p<=h?p+g:p+g-100):"MDY"===f&&c<=12&&u<=31||u>13&&u<=31&&c<=12&&p>31?i=d+u+" "+t[c-1]+" "+(p>=100?p:p<=h?p+g:p+g-100):("YMD"===f&&u<=12&&p<=31||p>13&&p<=31&&u<=12&&c>31)&&(i=d+p+" "+t[u-1]+" "+(c>=100?c:c<=h?c+g:c+g-100))}i=i.replace(/^[>]([\w ]+)$/,"AFT $1"),i=i.replace(/^[<]([\w ]+)$/,"BEF $1"),i=i.replace(/^([\w ]+)[-]$/,"FROM $1"),i=i.replace(/^[-]([\w ]+)$/,"TO $1"),i=i.replace(/^[~]([\w ]+)$/,"ABT $1"),i=i.replace(/^[*]([\w ]+)$/,"EST $1"),i=i.replace(/^[#]([\w ]+)$/,"CAL $1"),i=i.replace(/^([\w ]+) ?- ?([\w ]+)$/,"BET $1 AND $2"),i=i.replace(/^([\w ]+) ?~ ?([\w ]+)$/,"FROM $1 TO $2"),i=i.replace(/(JANUARY)/,"JAN"),i=i.replace(/(FEBRUARY)/,"FEB"),i=i.replace(/(MARCH)/,"MAR"),i=i.replace(/(APRIL)/,"APR"),i=i.replace(/(MAY)/,"MAY"),i=i.replace(/(JUNE)/,"JUN"),i=i.replace(/(JULY)/,"JUL"),i=i.replace(/(AUGUST)/,"AUG"),i=i.replace(/(SEPTEMBER)/,"SEP"),i=i.replace(/(OCTOBER)/,"OCT"),i=i.replace(/(NOVEMBER)/,"NOV"),i=i.replace(/(DECEMBER)/,"DEC"),i=i.replace(/(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)\.? (\d\d?)[, ]+(\d\d\d\d)/,"$2 $1 $3"),i=i.replace(/(^| )(\d [A-Z]{3,5} \d{4})/,"$10$2"),s&&(i=i+" ("+s),e.value!==i&&(e.value=i)}function show_submenu(e,t){var n=document.body.scrollWidth+document.documentElement.scrollLeft,o=document.getElementById(e);if(o&&o.style){document.all?n=document.body.offsetWidth:(n=document.body.scrollWidth+document.documentElement.scrollLeft-55,"rtl"===textDirection&&o.offsetLeft+o.offsetWidth+10);for(var a=0,l=o.childNodes.length,i=0;i<l;i++){var r=o.childNodes[i];r.offsetWidth>a+5&&(a=r.offsetWidth)}o.offsetWidth<a&&(o.style.width=a+"px");var s;if((s=document.getElementById(t))&&(o.style.left=s.style.left,o.offsetLeft+o.offsetWidth+10>n)){var d=n-o.offsetWidth;o.style.left=d+"px"}o.offsetLeft<0&&(o.style.left="0px"),o.offsetHeight>500&&(o.style.height="400px",o.style.overflow="auto"),o.style.visibility="visible"}clearTimeout(menutimeouts[e]),menutimeouts[e]=null}function hide_submenu(e){if("number"==typeof menutimeouts[e]){var t=document.getElementById(e);t&&t.style&&(t.style.visibility="hidden"),clearTimeout(menutimeouts[e]),menutimeouts[e]=null}}function timeout_submenu(e){"number"!=typeof menutimeouts[e]&&(menutimeouts[e]=setTimeout("hide_submenu('"+e+"')",100))}function statusDisable(e){var t=document.getElementById(e);t.checked=!1,t.disabled=!0}function statusEnable(e){document.getElementById(e).disabled=!1}function statusChecked(e){document.getElementById(e).checked=!0}function cal_setMonthNames(e,t,n,o,a,l,i,r,s,d,c,u){monthLabels[1]=e,monthLabels[2]=t,monthLabels[3]=n,monthLabels[4]=o,monthLabels[5]=a,monthLabels[6]=l,monthLabels[7]=i,monthLabels[8]=r,monthLabels[9]=s,monthLabels[10]=d,monthLabels[11]=c,monthLabels[12]=u}function cal_setDayHeaders(e,t,n,o,a,l,i){daysOfWeek[0]=e,daysOfWeek[1]=t,daysOfWeek[2]=n,daysOfWeek[3]=o,daysOfWeek[4]=a,daysOfWeek[5]=l,daysOfWeek[6]=i}function cal_setWeekStart(e){e>=0&&e<7&&(weekStart=e)}function calendarWidget(e,t){var n=document.getElementById(e),o=document.getElementById(t);if("visible"===n.style.visibility)return n.style.visibility="hidden",!1;if("show"===n.style.visibility)return n.style.visibility="hide",!1;var a,l=/((\d+ (JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC) )?\d+)/i;return a=l.exec(o.value)?new Date(RegExp.$1):new Date,n.innerHTML=cal_generateSelectorContent(t,e,a),"hidden"===n.style.visibility?(n.style.visibility="visible",!1):"hide"===n.style.visibility&&(n.style.visibility="show",!1)}function cal_generateSelectorContent(e,t,n){var o,a,l='<table border="1"><tr>';for(l+='<td><select class="form-control" id="'+e+'_daySelect" onchange="return cal_updateCalendar(\''+e+"', '"+t+"');\">",o=1;o<32;o++)l+='<option value="'+o+'"',n.getDate()===o&&(l+=' selected="selected"'),l+=">"+o+"</option>";for(l+="</select></td>",l+='<td><select class="form-control" id="'+e+'_monSelect" onchange="return cal_updateCalendar(\''+e+"', '"+t+"');\">",o=1;o<13;o++)l+='<option value="'+o+'"',n.getMonth()+1===o&&(l+=' selected="selected"'),l+=">"+monthLabels[o]+"</option>";for(l+="</select></td>",l+='<td><input class="form-control" type="text" id="'+e+'_yearInput" size="5" value="'+n.getFullYear()+'" onchange="return cal_updateCalendar(\''+e+"', '"+t+"');\" /></td></tr>",l+='<tr><td colspan="3">',l+='<table width="100%">',l+="<tr>",a=weekStart,o=0;o<7;o++)l+="<td ",l+='class="descriptionbox"',l+=">",l+=daysOfWeek[a],l+="</td>",++a>6&&(a=0);l+="</tr>";var i=new Date(n.getFullYear(),n.getMonth(),1),r=i.getDay();r-=weekStart;for(i=i.getTime()-864e5*r+432e5,i=new Date(i),a=0;a<6;a++){for(l+="<tr>",o=0;o<7;o++){l+="<td ",i.getMonth()===n.getMonth()?i.getDate()===n.getDate()?l+='class="descriptionbox"':l+='class="optionbox"':l+='style="background-color:#EAEAEA; border: solid #AAAAAA 1px;"',l+='><a href="#" onclick="return cal_dateClicked(\''+e+"', '"+t+"', "+i.getFullYear()+", "+i.getMonth()+", "+i.getDate()+');">',l+=i.getDate(),l+="</a></td>";var s=i.getTime()+864e5;i=new Date(s)}l+="</tr>"}return l+="</table>",l+="</td></tr>",l+="</table>"}function cal_setDateField(e,t,n,o){var a=document.getElementById(e);return!!a&&(o<10&&(o="0"+o),a.value=o+" "+monthShort[n+1]+" "+t,!1)}function cal_updateCalendar(e,t){var n=document.getElementById(e+"_daySelect");if(!n)return!1;var o=document.getElementById(e+"_monSelect");if(!o)return!1;var a=document.getElementById(e+"_yearInput");if(!a)return!1;var l=parseInt(o.options[o.selectedIndex].value,10);l-=1;var i=new Date(a.value,l,n.options[n.selectedIndex].value);cal_setDateField(e,i.getFullYear(),i.getMonth(),i.getDate());var r=document.getElementById(t);return r?(r.innerHTML=cal_generateSelectorContent(e,t,i),!1):(alert("no dateDiv "+t),!1)}function cal_dateClicked(e,t,n,o,a){return cal_setDateField(e,n,o,a),calendarWidget(t,e),!1}function openerpasteid(e){window.opener.paste_id&&window.opener.paste_id(e),window.close()}function paste_id(e){pastefield.value=e}function pastename(e){nameElement&&(nameElement.innerHTML=e),remElement&&(remElement.style.display="block")}function paste_char(e){document.selection?(pastefield.focus(),document.selection.createRange().text=e):pastefield.selectionStart||0===pastefield.selectionStart?(pastefield.value=pastefield.value.substring(0,pastefield.selectionStart)+e+pastefield.value.substring(pastefield.selectionEnd,pastefield.value.length),pastefield.selectionStart=pastefield.selectionEnd=pastefield.selectionStart+e.length):pastefield.value+=e,"NPFX"!==pastefield.id&&"GIVN"!==pastefield.id&&"SPFX"!==pastefield.id&&"SURN"!==pastefield.id&&"NSFX"!==pastefield.id||updatewholename()}function ilinkitem(e,t,n){return window.open("inverselink.php?mediaid="+encodeURIComponent(e)+"&linkto="+encodeURIComponent(t)+"&ged="+encodeURIComponent(n),"_blank",find_window_specs),!1}function persistent_toggle(e,t){var n=document.getElementById(e),o=document.querySelectorAll(t),a=localStorage.getItem(e);if(n){""!==a&&(a="none"),n.checked=""===a;for(var l=0;l<o.length;++l)o[l].style.display=a;n.addEventListener("click",function(){console.log(a),a=""===a?"none":"",localStorage.setItem(e,a);for(var t=0;t<o.length;++t)o[t].style.display=a})}}function valid_lati_long(e,t,n){var o=e.value.toUpperCase();o=o.replace(/(^\s*)|(\s*$)/g,""),o=o.replace(/ /g,":"),o=o.replace(/\+/g,""),o=o.replace(/-/g,n),o=o.replace(/,/g,"."),o=o.replace(/\u00b0/g,":"),o=o.replace(/\u0027/g,":"),o=o.replace(/^([0-9]+):([0-9]+):([0-9.]+)(.*)/g,function(e,t,n,o,a){var l=parseFloat(t);return l+=n/60,l+=o/3600,l=Math.round(1e4*l)/1e4,a+l}),o=o.replace(/^([0-9]+):([0-9]+)(.*)/g,function(e,t,n,o){var a=parseFloat(t);return a+=n/60,a=Math.round(1e4*a)/1e4,o+a}),o=o.replace(/(.*)([N|S|E|W]+)$/g,"$2$1"),o&&o.charAt(0)!==n&&o.charAt(0)!==t&&(o=t+o),e.value=o}function activate_colorbox(e){$.extend($.colorbox.settings,{fixed:!0,current:"",previous:"",next:"",slideshowStart:"",slideshowStop:"",close:""}),e&&$.extend($.colorbox.settings,e),$("body").on("click","a.gallery",function(){$("a[type^=image].gallery").colorbox({photo:!0,maxWidth:"95%",maxHeight:"95%",rel:"gallery",slideshow:!0,slideshowAuto:!1,onComplete:function(){$(".cboxPhoto").unbind("click"),wheelzoom(document.querySelectorAll(".cboxPhoto"))}})})}function autocomplete(e){$(e).each(function(){$(this).typeahead(null,{display:"value",source:new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("value"),queryTokenizer:Bloodhound.tokenizers.whitespace,remote:{url:this.dataset.autocompleteUrl,wildcard:"QUERY"}})})})}function insertTextAtCursor(e,t){var n=e.scrollTop,o=e.selectionStart,a=e.value.substring(0,o),l=e.value.substring(e.selectionEnd,e.value.length);e.value=a+t+l,e.selectionStart=o+t.length,e.selectionEnd=e.selectionStart,e.focus(),e.scrollTop=n}var textDirection=$("html").attr("dir"),pastefield,menutimeouts=[],monthLabels=[];monthLabels[1]="January",monthLabels[2]="February",monthLabels[3]="March",monthLabels[4]="April",monthLabels[5]="May",monthLabels[6]="June",monthLabels[7]="July",monthLabels[8]="August",monthLabels[9]="September",monthLabels[10]="October",monthLabels[11]="November",monthLabels[12]="December";var monthShort=[];monthShort[1]="JAN",monthShort[2]="FEB",monthShort[3]="MAR",monthShort[4]="APR",monthShort[5]="MAY",monthShort[6]="JUN",monthShort[7]="JUL",monthShort[8]="AUG",monthShort[9]="SEP",monthShort[10]="OCT",monthShort[11]="NOV",monthShort[12]="DEC";var daysOfWeek=[];daysOfWeek[0]="S",daysOfWeek[1]="M",daysOfWeek[2]="T",daysOfWeek[3]="W",daysOfWeek[4]="T",daysOfWeek[5]="F",daysOfWeek[6]="S";var weekStart=0;$("body").on("click",".iconz",function(e){function t(){o.parent().css("z-index",100),n(),i.addClass("nameZoom"),l.hide(0,function(){a.slideDown()})}function n(){o.toggleClass(function(){return r+" "+r+"-expanded"})}e.stopPropagation();var o=$(this).closest(".person_box_template"),a=o.find(".inout"),l=o.find(".inout2"),i=o.find(".namedef"),r=o.attr("class").match(/(box-style[0-2])/)[1];a.text().length?o.hasClass(r)?t():function(){a.slideUp(function(){l.show(0),i.removeClass("nameZoom"),n(),o.parent().css("z-index","")})}():(o.css("cursor","progress"),a.load("index.php",{route:"expand-chart-box",xref:o.data("xref"),ged:o.data("tree")},function(){o.css("cursor",""),t()})),o.find(".iconz").toggleClass("icon-zoomin icon-zoomout")}),$(function(){$.ajaxSetup({headers:{"X-CSRF-TOKEN":$("meta[name=csrf]").attr("content")}}),$("[data-ajax-url]").each(function(){$(this).load($(this).data("ajaxUrl"))}),$('a[data-toggle="tab"][data-href]').on("show.bs.tab",function(){$(this.getAttribute("href")+":empty").load($(this).data("href"))}),autocomplete("input[data-autocomplete-url]"),$("select.select2").select2({escapeMarkup:function(e){return e}}),$("select.select2").on("select2:unselect",function(e){$(e.delegateTarget).append('<option value="" selected="selected"></option>')}),$.fn.dataTableExt.oSort["text-asc"]=function(e,t){return e.localeCompare(t,document.documentElement.lang,{sensitivity:"base"})},$.fn.dataTableExt.oSort["text-desc"]=function(e,t){return t.localeCompare(e,document.documentElement.lang,{sensitivity:"base"})},$("table.datatables").each(function(){$(this).DataTable(),$(this).show()}),$(".wt-modal-create-record").on("show.bs.modal",function(e){$("form",$(this)).data("element-id",$(e.relatedTarget).data("element-id")),$("form .form-group input:first",$(this)).focus()}),$(".wt-modal-create-record form").on("submit",function(e){e.preventDefault();var t=$(this).data("element-id");$.ajax({url:"index.php",type:"POST",data:new FormData(this),async:!1,cache:!1,contentType:!1,processData:!1,success:function(e){$("#"+t).select2().empty().append(new Option(e.text,e.id)).val(e.id).trigger("change")},failure:function(e){alert(e.error_message)}}),this.reset(),$(this).closest(".wt-modal-create-record").modal("hide")}),$(".menu-language").on("click","[data-language]",function(){return $.post("index.php",{route:"language",language:$(this).data("language")},function(){window.location.reload()}),!1}),$(".menu-theme").on("click","[data-theme]",function(){return $.post("index.php",{route:"theme",theme:$(this).data("theme")},function(){window.location.reload()}),!1});var e;$(".wt-osk-trigger").click(function(){e=document.getElementById($(this).data("id")),e.focus(),$(".wt-osk").show()}),$(document).on("focusin",":input",function(){e=this}),$(".wt-osk-script-button").change(function(){$(".wt-osk-script").prop("hidden",!0),$(".wt-osk-script-"+$(this).data("script")).prop("hidden",!1)}),$(".wt-osk-shift-button").click(function(){document.querySelector(".wt-osk-keys").classList.toggle("shifted")}),$(".wt-osk-keys").on("click",".wt-osk-key",function(){var t=$(this).contents().get(0).nodeValue,n=$(".wt-osk-shift-button").hasClass("active"),o=$("sup",this)[0];if(n&&void 0!==o&&(t=o.innerText),null!==e){var a=e.selectionStart,l=e.value,i=l.substring(0,a),r=l.substring(a,l.length);e.value=i+t+r,!1===$(".wt-osk-pin-button").hasClass("active")&&$(".wt-osk").hide()}})}); \ No newline at end of file
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;