Révision 1915

tmp/org.txm.groovy.core/src/java/ExecJS.groovy (revision 1915)
1
import org.txm.edition.rcp.editors.*
2
/*
3
script = """sheet.insertRule("#w_a01_390 {background-color:rgba(249,208,208,1.0);}", 1);
4
sheet.insertRule("#w_a01_470 {background-color:rgba(249,208,208,1.0);}", 1);
5
sheet.insertRule("#w_a01_262 {background-color:rgba(249,208,208,1.0);}", 1);
6
sheet.insertRule("#w_a01_289 {background-color:rgba(249,208,208,1.0);}", 1);
7
sheet.insertRule("#w_a01_421 {background-color:rgba(249,208,208,1.0);}", 1);
8
sheet.insertRule("#w_a01_213 {background-color:rgba(249,208,208,1.0);}", 1);
9
sheet.insertRule("#w_a01_166 {background-color:rgba(249,208,208,1.0);}", 1);
10
sheet.insertRule("#w_a01_342 {background-color:rgba(249,208,208,1.0);}", 1);
11
sheet.insertRule("#w_a01_546 {background-color:rgba(249,208,208,1.0);}", 1);
12
sheet.insertRule("#w_a01_589 {background-color:rgba(249,208,208,1.0);}", 1);
13
sheet.insertRule("#w_a01_504 {background-color:rgba(249,160,160,1.0);}", 1);
14
sheet.insertRule("#w_a01_637 {background-color:rgba(249,208,208,1.0);}", 1);
15
*/
16
script = """
17

  
18
//alert(sheet.cssRules[0].selectorText);
19
//alert(sheet.cssRules[0].style.cssText);
20
//alert(sheet.cssRules[0].style.length);
21
//alert(sheet.cssRules[0].style.parentRule);
22

  
23
for (var i=0; i < document.styleSheets.length; i++){
24
	var styleSheet = document.styleSheets[i];
25
	alert(styleSheet.cssRules.length)
26
/*	for (var j=0; j < styleSheet.cssRules.length; j++){
27
		alert(styleSheet.cssRules[j].style.cssText)
28
	}
29
*/
30
}
31
//alert("SHEET="+sheet.cssRules.length)
32
//document.head.appendChild(style);
33
"""
34
/*
35

  
36
 */
37
if (!(editor.getClass().getName().equals(")org.txm.edition.rcp.editors.SynopticEditionEditor"))) {
38
	println "Editor is not an edition: "+editor+". Use the F12 key binding to run the macro."
39
	return
40
}
41
monitor.syncExec(new Runnable() {
42
	public void run() {
43
		panel = editor.editionPanels["default"]
44
		
45
		println "Execute result: "+panel.execute(script)
46
}});
47

  
tmp/org.txm.edition.rcp/res/js/functions.js (revision 1915)
133 133
var sheet = null;
134 134
try {
135 135
	var style = document.createElement("style");
136
	style.appendChild(document.createTextNode(""));
136
	try { style.appendChild(document.createTextNode("")); } catch (e) {};
137 137
	document.head.appendChild(style);
138 138
	sheet = style.sheet;
139 139
} catch (e) {
140
	sheet = 'error'
140
	sheet = 'error';
141 141
}
142 142

  
143 143
//try {
tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java (revision 1915)
186 186
					+"\nvar sheet = null;" //$NON-NLS-1$
187 187
					+"\ntry{" //$NON-NLS-1$
188 188
					+"\n	var style = document.createElement(\"style\");" //$NON-NLS-1$
189
					+"\n	style.appendChild(document.createTextNode(\"\"));"//webkit hack //$NON-NLS-1$
189
					+"\n	try { style.appendChild(document.createTextNode(\"\")); } catch (e) {};"//webkit hack //$NON-NLS-1$
190 190
					+"\n	document.head.appendChild(style);" //$NON-NLS-1$
191 191
					+"\n	sheet = style.sheet;" //$NON-NLS-1$
192 192
					+"\n} catch(e) {sheet='error'}" //$NON-NLS-1$
......
264 264
			@Override
265 265
			public void completed(ProgressEvent event) {
266 266
				
267
				//				System.out.println("EditionPanel "+currentEdition.getName()+" reload "+getCurrentPage().getName());
267
				//System.out.println("EditionPanel "+currentEdition.getName()+" reload "+getCurrentPage().getName());
268 268
				Object rez = evaluate("return typeof sheet"); //$NON-NLS-1$
269 269
				if ("undefined".equals(rez)) {
270 270
					if (!execute(functions)) { // build the sheet if not present in the HTML DOM //$NON-NLS-1$
......
275 275
				// do something before the highlight is done
276 276
				for (ProgressListener pl : beforeHighlighListeners) { pl.completed(event);}
277 277

  
278
				
278 279
				//System.out.println("highlight: "+highlightedColorPerWordIDS);
279 280
				StringBuilder buffer = new StringBuilder();
280 281
				//buffer.append("alert(\"\"+sheet);\n");
......
291 292
						Log.fine("JS execution error (delete cssRules) with="+buffer);
292 293
					}
293 294
				}
295
				
296
				
294 297
				buffer = new StringBuilder();
295 298

  
296 299
				String firstWord = currentPage.getWordId();
......
359 362
						Log.fine("JS execution (highlight) error with="+buffer);
360 363
					}
361 364
				}
365
				
366
				
362 367
				buffer = new StringBuilder();
363 368

  
364 369
				//				for (String wordidslist : highlightedColorSpans.keySet()) {
......
405 410
						Log.fine("JS execution (color) error with="+buffer);
406 411
					}
407 412
				}
413
				
414
				
408 415
				buffer = new StringBuilder();
409 416

  
410 417
				for (String wordid : fontSizePerWordIDS.keySet()) {
......
447 454
						Log.fine("JS execution (font) error with="+buffer);
448 455
					}
449 456
				}
457
				
458
				
450 459
				buffer = new StringBuilder();
451 460

  
452 461
				if (focusedWordID != null) {
......
462 471
						Log.fine("JS execution (focus) error with="+buffer);
463 472
					}
464 473
				}
474
				
475
				
465 476
				buffer = new StringBuilder();
466 477

  
467 478
				if (highlightedAreas != null) {
tmp/TXMReleasePlugins.site/site.xml (revision 1915)
3 3
   <description name="TXM Extensions - RELEASE" url="http://txm.textometrie.org/updates/plugins">
4 4
      This update site contains the Release plugins for TXM
5 5
   </description>
6
   <feature url="features/org.txm.backtomedia.feature_1.0.0.1771.jar" id="org.txm.backtomedia.feature" version="1.0.0.1771">
6
   <feature url="features/org.txm.backtomedia.feature_1.0.0.1906.jar" id="org.txm.backtomedia.feature" version="1.0.0.1906">
7 7
      <category name="Commands"/>
8 8
   </feature>
9
   <feature url="features/org.txm.wordcloud.feature_1.0.0.1771.jar" id="org.txm.wordcloud.feature" version="1.0.0.1771">
9
   <feature url="features/org.txm.wordcloud.feature_1.0.0.1906.jar" id="org.txm.wordcloud.feature" version="1.0.0.1906">
10 10
      <category name="Commands"/>
11 11
   </feature>
12
   <feature url="features/org.txm.treetagger.binaries.feature_1.0.0.1771.jar" id="org.txm.treetagger.binaries.feature" version="1.0.0.1771" os="" ws="">
12
   <feature url="features/org.txm.treetagger.binaries.feature_1.0.0.1906.jar" id="org.txm.treetagger.binaries.feature" version="1.0.0.1906" os="" ws="">
13 13
      <category name="Annotation"/>
14 14
   </feature>
15
   <feature url="features/org.txm.treetagger.models.feature_1.0.0.1771.jar" id="org.txm.treetagger.models.feature" version="1.0.0.1771">
15
   <feature url="features/org.txm.treetagger.models.feature_1.0.0.1906.jar" id="org.txm.treetagger.models.feature" version="1.0.0.1906">
16 16
      <category name="Annotation"/>
17 17
   </feature>
18
   <feature url="features/org.txm.annotation.urs.feature_1.0.0.1771.jar" id="org.txm.annotation.urs.feature" version="1.0.0.1771">
18
   <feature url="features/org.txm.annotation.urs.feature_1.0.0.1906.jar" id="org.txm.annotation.urs.feature" version="1.0.0.1906">
19 19
      <category name="Annotation"/>
20 20
   </feature>
21
   <feature url="features/org.txm.tigersearch.feature_1.0.0.1771.jar" id="org.txm.tigersearch.feature" version="1.0.0.1771">
21
   <feature url="features/org.txm.tigersearch.feature_1.0.0.1906.jar" id="org.txm.tigersearch.feature" version="1.0.0.1906">
22 22
      <category name="Annotation"/>
23 23
   </feature>
24 24
   <category-def name="Commands" label="Commands"/>
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/AssistedQueryWidget.java (revision 1915)
78 78
		this.se = se;
79 79
		
80 80
		magicstick = new Button(this, SWT.PUSH);
81
		magicstick.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
82
				false, false));
81
		magicstick.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
83 82
		magicstick.setImage(IImageKeys.getImage(IImageKeys.ACTION_ASSISTQUERY));
84 83
		magicstick.setToolTipText(TXMUIMessages.openTheQueryAssistant);
85 84
		magicstick.addSelectionListener(new SelectionListener() {

Formats disponibles : Unified diff