Skip to content

Commit

Permalink
6.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
scottjpearson committed Nov 22, 2023
1 parent e2cd510 commit 04814f2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
9 changes: 9 additions & 0 deletions Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,15 @@ public static function log($mssg, $pid = FALSE) {
CareerDev::log($mssg, $pid);
}

public static function getBase64($relativeURL) {
$relativeURL = preg_replace("/^\//", "", $relativeURL);
$filename = __DIR__."/".$relativeURL;
if (file_exists($filename)) {
return FileManagement::getBase64OfFile($filename, mime_content_type($filename));
}
return "";
}

public static function getInstitutions($pid = NULL, $searchOnly = TRUE) {
return CareerDev::getInstitutions($pid, $searchOnly);
}
Expand Down
2 changes: 1 addition & 1 deletion CareerDev.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CareerDev {
public static $passedModule = NULL;

public static function getVersion() {
return "6.2.2";
return "6.2.3";
}

public static function getLockFile($pid) {
Expand Down
12 changes: 6 additions & 6 deletions hooks/surveyHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
echo "<script src='".Application::link("js/jquery.sweet-modal.min.js")."&".CareerDev::getVersion()."'></script>\n";
?>
<script>
const checkedImg = "<?= Application::link("wrangler/checked.png") ?>";
const uncheckedImg = "<?= Application::link("wrangler/unchecked.png") ?>";
const omittedImg = "<?= Application::link("wrangler/omitted.png") ?>";
const checkedImg = "<?= Application::getBase64("wrangler/checked.png") ?>";
const uncheckedImg = "<?= Application::getBase64("wrangler/unchecked.png") ?>";
const omittedImg = "<?= Application::getBase64("wrangler/omitted.png") ?>";
const surveyPrefix = "<?= $prefix ?>";

// in case of multiple surveys
Expand All @@ -103,9 +103,9 @@ function getLoadingImageUrlOverride() {
$('#publications_wrangler').html(html);
$('#publications_wrangler').show();
if ($('#surveyinstructions').length > 0) {
$('#surveyinstructions').prepend('<img align="right" src="<?= Application::link("img/flight_tracker_logo_small.png") ?>">');
$('#surveyinstructions').prepend('<img align="right" src="<?= Application::getBase64("img/flight_tracker_logo_small.png") ?>">');
} else {
$('#surveytitlelogo').append('<img src="<?= Application::link("img/flight_tracker_logo_small.png") ?>"><br>');
$('#surveytitlelogo').append('<img src="<?= Application::getBase64("img/flight_tracker_logo_small.png") ?>"><br>');
}
});
</script>
Expand All @@ -119,7 +119,7 @@ function makeCheckboxes($coll, $img, $divId, $style = "") {
$html = "";
$html .= "<div id='$divId'$styleFiller>\n";
$certifyPubURL = Application::link("wrangler/certifyPub.php")."&NOAUTH";
$imgURL = Application::link("/wrangler/".$img.".png");
$imgURL = Application::getBase64("/wrangler/".$img.".png");
foreach ($coll->getCitations() as $citationObj) {
$pmid = $citationObj->getPMID();
$citationLink = $citationObj->getCitationWithLink(FALSE, TRUE);
Expand Down
6 changes: 2 additions & 4 deletions js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ function changeCheckboxValue(ob, url) {
const state = $(ob).attr('alt')
const pmid = $(ob).parent().attr('id').replace(/^PMID/, "")
const recordId = $("[name=record_id]").val()
const originatingDiv = $(ob).attr('data-original');
// const originatingDiv = $(ob).attr('data-original');

const params = getUrlVars()
const hash = params['s']
Expand Down Expand Up @@ -1167,9 +1167,7 @@ function changeCheckboxValue(ob, url) {
$(obDiv).show()
$('#'+newDiv+'Count').html(parseInt($('#'+newDiv+'Count').html(), 10) + 1)
}
if (originatingDiv) {
$("#"+originatingDiv+"Count").html(parseInt($('#'+originatingDiv+'Count').html(), 10) - 1)
} else if (oldDiv) {
if (oldDiv) {
$("#"+oldDiv+"Count").html(parseInt($('#'+oldDiv+'Count').html(), 10) - 1)
}
// enqueue();
Expand Down

0 comments on commit 04814f2

Please sign in to comment.