-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EMMR-111 Restore legacy/reusable marginalia listing
- Loading branch information
1 parent
9639fc1
commit c78edb6
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
custom/modules/emmr_transcribe/js/emmr_ckeditor_marginalia.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// On document ready. | ||
jQuery(document).ready(function() { | ||
if (jQuery("#recipe-details-header").length != 0) { | ||
// Recipe node view functionality | ||
// Copy annotations from CKEditor to annotations panel | ||
origin = ".field--name-field-recipe-transcription .trxn-margin"; | ||
destin = "#recipe-anno"; | ||
|
||
// If marginalia found | ||
var margins = jQuery(origin).clone(); | ||
jQuery("<br><br>").appendTo(margins); | ||
if ( jQuery(origin).length != 0 ) { | ||
// If annotations panel not found | ||
if ( jQuery(destin).length === 0 ) { | ||
var anno = "<div class='col-md-2' id='recipe-anno'></div>"; | ||
var parent = "#pages-trans-anno"; | ||
jQuery(anno).appendTo(parent); | ||
} | ||
|
||
// Append marginalia tittle and items | ||
jQuery("<br><p><b>Marginalia</b></p>").appendTo(destin); | ||
jQuery("<div id='marginalia'></div>").appendTo(destin); | ||
destin += " > div#marginalia"; | ||
jQuery(margins).clone().appendTo(destin); | ||
} | ||
} | ||
}); |