Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix annotations in texts #534

Merged
merged 5 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controller/window/text/TextFacsimileSplitView.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Ext.define('EdiromOnline.controller.window.text.TextFacsimileSplitView', {
onAnnotationsVisibilityChange: function(view, visible) {
var me = this;

if(visible)
if(visible && view.getActivePage() !== null)
window.doAJAXRequest('data/xql/getAnnotationsInText.xql',
'GET',
{
Expand Down
6 changes: 4 additions & 2 deletions app/view/window/text/TextFacsimileSplitView.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ Ext.define('EdiromOnline.view.window.text.TextFacsimileSplitView', {
var me = this;
var annos = Ext.query('#' + me.id + '_textCont span.annotation');
Ext.Array.each(annos, function(anno) {
Ext.get(anno).hide();
var a = Ext.get(anno);
a.setVisibilityMode(Ext.Element.DISPLAY);
a.hide();
});
},

Expand Down Expand Up @@ -411,7 +413,7 @@ Ext.define('EdiromOnline.view.window.text.TextFacsimileSplitView', {

getActivePage: function() {
var me = this;
return me.activePage.get('id');
return (typeof me.activePage !== 'undefined' && me.activePage !== null?me.activePage.get('id'):null);
},

setChapters: function (chapters) {
Expand Down
12 changes: 7 additions & 5 deletions app/view/window/text/TextView.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Ext.define('EdiromOnline.view.window.text.TextView', {
var me = this;

if(me.annotationsLoaded) {
var annos = Ext.query('#' + me.id + '_textCont span.annotation');
var annos = Ext.query('#' + me.id + '_textCont div.annotation');
Ext.Array.each(annos, function(anno) {
Ext.get(anno).show();
});
Expand All @@ -130,8 +130,7 @@ Ext.define('EdiromOnline.view.window.text.TextView', {

me.annotationsLoaded = true;

var tpl = Ext.DomHelper.createTemplate('<span id="{0}" class="annotation {1} {2} {3}" data-edirom-annot-id="{3}"></span>');

var tpl = Ext.DomHelper.createTemplate('<div class="annotation"><div id="{0}" class="annotIcon {1} {2} {3}" data-edirom-annot-id="{3}"></div></div>');
tpl.compile();

annotations.each(function(annotation) {
Expand Down Expand Up @@ -221,9 +220,11 @@ Ext.define('EdiromOnline.view.window.text.TextView', {

hideAnnotations: function() {
var me = this;
var annos = Ext.query('#' + me.id + '_textCont span.annotation');
var annos = Ext.query('#' + me.id + '_textCont div.annotation');
Ext.Array.each(annos, function(anno) {
Ext.get(anno).hide();
var a = Ext.get(anno);
a.setVisibilityMode(Ext.Element.DISPLAY);
a.hide();
});
},

Expand All @@ -243,6 +244,7 @@ Ext.define('EdiromOnline.view.window.text.TextView', {
me.annotMenu = Ext.create('Ext.button.Button', {
text: getLangString('view.window.text.TextView_annotMenu'),
indent: false,
cls: 'menuButton',
menu : {
items: [
me.toggleAnnotationVisibility
Expand Down
2 changes: 0 additions & 2 deletions packages/eoTheme/sass/etc/freidi-textView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,6 @@ $underlineColor: #333333;
}
}
}

span.note {display: none;}

i.inline-comment {
position: relative;
Expand Down
14 changes: 13 additions & 1 deletion resources/css/todo.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ body {
margin-right: 2em;
}

.textViewContent span.note::before {
content: none;
}

.textViewContent span.note::after {
content: none;
}

.textViewContent span.note div.annotation {
display: inline-block;
}

#ediromToolbar .x-btn.insetButton.x-btn-default-toolbar-small {
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #dddddd), color-stop(30%, #c3c3c3), color-stop(65%, #b8b8b8), color-stop(100%, #a0a0a0));
background-image: -webkit-linear-gradient(top, #dddddd, #c3c3c3 30%, #b8b8b8 65%, #a0a0a0);
Expand Down Expand Up @@ -93,7 +105,7 @@ span.musicalSymbol {

.ediromWindow .annotation {
z-index: 10;
display: flex !important;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
Expand Down