Skip to content

Commit

Permalink
jQuery migration for document pages
Browse files Browse the repository at this point in the history
  • Loading branch information
iccole committed Dec 13, 2024
1 parent 1d7e7cf commit 039f89a
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 57 deletions.
110 changes: 55 additions & 55 deletions pn-site/js/titledate.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
$(document).ready(function(){

$("#controls input").click(
function() {
if (this.checked) {
$("."+this.name).show();
if (this.name == "transcription") {
$(".image").css('width','50%');
$(".translation").css('width','50%');
}
} else {
$("."+this.name).hide();
if (this.name == "transcription") {
$(".image").css('width','100%');
$(".translation").css('width','100%');
}
}
}
);
var showEditHistory = function(){
hideAllHistory();
$("#edit-history-list").show("blind", 250);
$("#edit-history").unbind("click");
$("#edit-history").bind("click", hideEditHistory);
}

var hideEditHistory = function(){
if(!($("#edit-history-list").css("display") == "none")) {$("#edit-history-list").hide("blind", 250); }
$("#edit-history").unbind("click");
$("#edit-history").bind("click", showEditHistory);
}

var showAllHistory = function(){

hideEditHistory();
$("#all-history-list").show("blind", 250);
$("#all-history").unbind("click");
$("#all-history").bind("click", hideAllHistory);
}
var hideAllHistory = function(){
if(!($("#all-history-list").css("display") == "none")) { $("#all-history-list").hide("blind", 250); }
$("#all-history").unbind("click");
$("#all-history").bind("click", showAllHistory);
}

$("#edit-history").bind("click", showEditHistory);
$("#all-history").bind("click", showAllHistory);
$(document).ready(function () {

$("#controls input").on('click', (e) => {
const target = e.currentTarget;
if (target.checked) {
$("." + target.name).show();
if (target.name == "transcription") {
$(".image").css('width', '50%');
$(".translation").css('width', '50%');
}
} else {
$("." + target.name).hide();
if (target.name == "transcription") {
$(".image").css('width', '100%');
$(".translation").css('width', '100%');
}
}
}
);

var showEditHistory = function () {

hideAllHistory();
$("#edit-history-list").show("blind", 250);
$("#edit-history").off("click");
$("#edit-history").on("click", hideEditHistory);

}

var hideEditHistory = function () {

if (!($("#edit-history-list").css("display") == "none")) { $("#edit-history-list").hide("blind", 250); }
$("#edit-history").off("click");
$("#edit-history").on("click", showEditHistory);
}

var showAllHistory = function () {

hideEditHistory();
$("#all-history-list").show("blind", 250);
$("#all-history").off("click");
$("#all-history").on("click", hideAllHistory);

}

var hideAllHistory = function () {

if (!($("#all-history-list").css("display") == "none")) { $("#all-history-list").hide("blind", 250); }
$("#all-history").off("click");
$("#all-history").on("click", showAllHistory);

}

$("#edit-history").on("click", showEditHistory);
$("#all-history").on("click", showAllHistory);

});
7 changes: 5 additions & 2 deletions pn-xslt/MakeHTML.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@
<!-- cascading stylesheets -->
<link rel="stylesheet" href="{$cssbase}/yui/reset-fonts-grids.css" type="text/css" media="screen" title="no title" charset="utf-8"/>
<link rel="stylesheet" href="{$cssbase}/master.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<link rel="stylesheet" href="{$cssbase}/custom-theme/jquery-ui-1.14.1.min.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<link rel="stylesheet" href="{$cssbase}/custom-theme/jquery-ui-dul-theme-shim.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<xsl:if test="$image">
<link rel="stylesheet" href="{$cssbase}/imageviewer.css" type="text/css" />
</xsl:if>
Expand Down Expand Up @@ -200,8 +202,9 @@
<xsl:call-template name="title-references"/>
</title>
<!-- scripts -->
<script src="{$jsbase}/jquery-1.5.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="{$jsbase}/jquery-ui-1.8.14.custom.min.js" type="text/javascript" charset="utf-8"></script>
<script src="{$jsbase}/jquery-3.7.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="{$jsbase}/jquery-migrate-3.5.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="{$jsbase}/jquery-ui-1.14.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="{$jsbase}/jquery.bubblepopup.v2.1.5.min.js" type="text/javascript" charset="utf-8"></script>
<xsl:if test="$image">
<script src="{$jsbase}/imageviewer.js" type="text/javascript" charset="utf-8"></script>
Expand Down

0 comments on commit 039f89a

Please sign in to comment.