Feature #1355

RCP: X.X, add an Edition to Concordance hyperlink

Added by Matthieu Decorde over 4 years ago. Updated 12 months ago.

Status:Closed Start date:05/21/2015
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:UI / Link / Command Spent time: -
Target version:TXM 0.7.8

Description

Allow user to link a sequence of words from an edition page to its concordance.

Solution 1 - implemented in TXM 0.7.7 beta2

- get the words sequence string from the browser selection
- build a CQP query with that sequence
- call concordance

Use the "evaluate" SWT browser Javascript API method with the following Javascript code:

static String SCRIPT01 = "var html = \"\";"+
            "if (typeof window.getSelection != \"undefined\") {"+
                "var sel = window.getSelection();"+
                "if (sel.rangeCount) {"+
                    "var container = document.createElement(\"div\");"+
                    "for (var i = 0, len = sel.rangeCount; i < len; ++i) {"+
                        "container.appendChild(sel.getRangeAt(i).cloneContents());"+
                    "}"+
                    "html = container.innerHTML;"+
                "}"+
            "} else if (typeof document.selection != \"undefined\") {"+
                "if (document.selection.type == \"Text\") {"+
                    "html = document.selection.createRange().htmlText;"+
                "}" +
            "}" +
            "return html";

Solution 1 bis

Do the same thing with the SynopticEditionEditor.

implemented for TXM 0.7.8


Related issues

related to Feature #1843: RCP: X.X, add an Edition to Concordance hyperlink New 05/21/2015

History

#1 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#2 Updated by Matthieu Decorde over 4 years ago

  • % Done changed from 0 to 20

#3 Updated by Matthieu Decorde over 4 years ago

  • Target version changed from TXM 0.7.8 to TXM 0.8.0a (split/restructuration)

#4 Updated by Matthieu Decorde over 3 years ago

  • Description updated (diff)

#5 Updated by Matthieu Decorde over 3 years ago

  • Description updated (diff)
  • Target version changed from TXM 0.8.0a (split/restructuration) to TXM 0.7.8

#6 Updated by Matthieu Decorde over 3 years ago

  • % Done changed from 20 to 70

only the first edition can call the SendToConcordance command

#7 Updated by Matthieu Decorde over 3 years ago

  • Description updated (diff)

#8 Updated by Sebastien Jacquot over 2 years ago

I confirm it works only in the first edition.
Also the context menu entry should not be active/visible if no text is selected (eg. when clicking on a facs image).

#9 Updated by Sebastien Jacquot 12 months ago

  • Status changed from New to Closed
  • % Done changed from 70 to 100

Also available in: Atom PDF