Skip to content

Commit

Permalink
adding a linktotarget button #84 (c)
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Aug 6, 2019
1 parent 844539e commit 30aa893
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions flat/script/flat.editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2194,6 +2194,13 @@ function addlinkrefs(index, ho_index) {
}
}

function linktotarget() {
}

function getlinktotarget(annotation, structureelement) {
//build a query to link to the specified element
}

function editor_submit(addtoqueue) {
/* Submit the annotations prepared in the editor dialog */

Expand Down
8 changes: 8 additions & 0 deletions flat/script/flat.viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ function renderstructure(structureelement, norecurse, noheader, extended) {
if ((annotation.type == "su") && (extended)) {
s = s + "<div class=\"opentreeview\" title=\"Show in Tree Viewer\" onclick=\"treeview('" + annotation.id + "')\"></div>";
}
if ((extended) && (linkselector >= 0)) {
//this is actually an editor feature
s = s + "<div class=\"linktotarget\" title=\"Link to this annotation\" onclick=\"linktotarget(" + getlinktotarget(annotation, structureelement) + ")\"></div>";
}
s = s + "</th><td>";
s = s + renderannotation(annotation, false, extended);
s = s + "</td></tr>";
Expand All @@ -509,6 +513,10 @@ function renderstructure(structureelement, norecurse, noheader, extended) {
if (((substructure.type == "morpheme") || (substructure.type == "phoneme")) && (extended)) {
s = s + "<div class=\"opentreeview\" title=\"Show in Tree Viewer\" onclick=\"treeview_structure('" + substructure.id + "')\"></div>";
}
if ((extended) && (linkselector >= 0)) {
//this is actually an editor feature
s = s + "<div class=\"linktotarget\" title=\"Link to this annotation\" onclick=\"linktotarget(" + getlinktotarget(substructure, structureelement) + ")\"></div>";
}
s += "</th><td>";
s += renderannotation(substructure, false, extended); //renders class
s += renderstructure(substructure, false, true, extended);
Expand Down
9 changes: 9 additions & 0 deletions flat/style/flat.viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,15 @@ div.opentreeview {
min-height: 34px;
cursor: pointer;
}
div.linktotarget {
background: url(linktarget.png);
background-size: 48px 34px;
width: 48px;
height: 34px;
min-width: 48px;
min-height: 34px;
cursor: pointer;
}
div#document span.seqnr {
float: left;
display: inline-block;
Expand Down
Binary file added flat/style/linktarget.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 30aa893

Please sign in to comment.