47 |
47 |
import org.txm.utils.logger.Log;
|
48 |
48 |
|
49 |
49 |
public class EditionPanel extends BrowserViewer implements ISelectionProvider {
|
50 |
|
|
|
50 |
|
51 |
51 |
private ProgressListener progressListener;
|
52 |
52 |
|
53 |
53 |
// private List<String> wordids;
|
... | ... | |
121 |
121 |
// "elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
|
122 |
122 |
// "elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
|
123 |
123 |
"} catch (e) { };"; //$NON-NLS-1$
|
124 |
|
|
|
124 |
|
125 |
125 |
public static final String highlightscriptRuleFast = "sheet.insertRule(\"#%s {background-color:rgba(%s,%s,%s,%s);}\", 0);"; //$NON-NLS-1$
|
126 |
126 |
|
127 |
127 |
public static final String colorscriptRuleFast = "sheet.insertRule(\"#%s {color:rgba(%s,%s,%s,%s);}\", 0);"; //$NON-NLS-1$
|
... | ... | |
281 |
281 |
super(parent, style);
|
282 |
282 |
this.synopticEditionEditor = synopticEditionEditor;
|
283 |
283 |
this.editionName = editionName;
|
284 |
|
// this.currentEdition = edition;
|
285 |
|
// this.currentText = currentEdition.getText();
|
|
284 |
// this.currentEdition = edition;
|
|
285 |
// this.currentText = currentEdition.getText();
|
286 |
286 |
|
287 |
287 |
File functionsFile = null;
|
288 |
288 |
try {
|
... | ... | |
302 |
302 |
|
303 |
303 |
progressListener = new ProgressListener() {
|
304 |
304 |
|
|
305 |
private CommandLink cmdLink;
|
|
306 |
private EditionLink editionLink;
|
|
307 |
|
305 |
308 |
@Override
|
306 |
309 |
public void changed(ProgressEvent event) {}
|
307 |
310 |
|
308 |
311 |
@Override
|
309 |
312 |
public void completed(ProgressEvent event) {
|
310 |
313 |
|
|
314 |
cmdLink = new CommandLink(synopticEditionEditor, getBrowser());
|
|
315 |
editionLink = new EditionLink(synopticEditionEditor, getBrowser());
|
311 |
316 |
Log.finest("EditionPanel " + currentEdition.getName() + " reload " + getCurrentPage().getName());
|
312 |
317 |
Object rez = evaluate("return typeof sheet;"); //$NON-NLS-1$
|
313 |
318 |
if ("undefined".equals(rez)) { //$NON-NLS-1$
|
... | ... | |
395 |
400 |
// s = String.format(highlightscriptRule, wordid, composite.r, composite.g, composite.b, composite.a);
|
396 |
401 |
s = "try { document.getElementById(\"" + wordid + "\").style.backgroundColor=\"rgba(" + composite.r + "," + composite.g + "," + composite.b + "," + composite.a + ")\";" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
|
397 |
402 |
+
|
398 |
|
// "elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
|
399 |
|
// "elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
|
400 |
|
// "elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
|
401 |
|
// "elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
|
|
403 |
// "elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
|
|
404 |
// "elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
|
|
405 |
// "elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
|
|
406 |
// "elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
|
402 |
407 |
"} catch (e) { };"; //$NON-NLS-1$
|
403 |
408 |
}
|
404 |
409 |
else {
|
... | ... | |
478 |
483 |
// s = String.format(highlightscriptRule, wordid, composite.r, composite.g, composite.b, composite.a);
|
479 |
484 |
s = "try { document.getElementById(\"" + wordid + "\").style.fontWeight=\"" + fontWeightPerWordIDS.get(wordid) + "\";" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
480 |
485 |
+
|
481 |
|
// "elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
|
482 |
|
// "elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
|
483 |
|
// "elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
|
484 |
|
// "elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
|
|
486 |
// "elt.style.paddingLeft=\"3px\";" + //$NON-NLS-1$
|
|
487 |
// "elt.style.paddingRight=\"3px\";" + //$NON-NLS-1$
|
|
488 |
// "elt.style.paddingTop=\"1px\";" + //$NON-NLS-1$
|
|
489 |
// "elt.style.paddingBottom=\"1px\";" + //$NON-NLS-1$
|
485 |
490 |
"} catch (e) { };"; //$NON-NLS-1$
|
486 |
491 |
// s = String.format(highlightscriptRule, wordid, composite.r, composite.g, composite.b, composite.a);
|
487 |
492 |
// s = "try { var elt = document.getElementById(\"" + wordid + "\");" + //$NON-NLS-1$ //$NON-NLS-2$
|
... | ... | |
627 |
632 |
getBrowser().addKeyListener(kListener);
|
628 |
633 |
|
629 |
634 |
getBrowser().addProgressListener(progressListener);
|
630 |
|
new CommandLink(synopticEditionEditor, getBrowser());
|
631 |
|
new EditionLink(synopticEditionEditor, getBrowser());
|
632 |
635 |
}
|
633 |
636 |
|
634 |
637 |
/**
|
... | ... | |
1140 |
1143 |
+ "\n}" //$NON-NLS-1$
|
1141 |
1144 |
// +"alert('result='+all)"
|
1142 |
1145 |
+ "\nreturn all;"; //$NON-NLS-1$
|
1143 |
|
|
|
1146 |
|
1144 |
1147 |
// System.out.println(functions);
|
1145 |
1148 |
// System.out.println(SCRIPT02_getspans);
|
1146 |
1149 |
|
... | ... | |
1436 |
1439 |
+ "sel.addRange(range);\n" //$NON-NLS-1$
|
1437 |
1440 |
+ "\n" //$NON-NLS-1$
|
1438 |
1441 |
+ "return null;"; //$NON-NLS-1$
|
1439 |
|
|
|
1442 |
|
1440 |
1443 |
// System.out.println("Eval...\n"+SCRIPT02_expand);
|
1441 |
1444 |
evaluate(SCRIPT02_expand);
|
1442 |
1445 |
return;
|