Subversion Repositories Applications.papyrus

Rev

Rev 1688 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1688 Rev 1921
Line 17... Line 17...
17
	this.popUpUrl = 'fck_spellerpages/spellerpages/spellchecker.html';		// by FredCK
17
	this.popUpUrl = 'fck_spellerpages/spellerpages/spellchecker.html';		// by FredCK
18
	this.popUpName = 'spellchecker';
18
	this.popUpName = 'spellchecker';
19
//	this.popUpProps = "menu=no,width=440,height=350,top=70,left=120,resizable=yes,status=yes";	// by FredCK
19
//	this.popUpProps = "menu=no,width=440,height=350,top=70,left=120,resizable=yes,status=yes";	// by FredCK
20
	this.popUpProps = null ;																	// by FredCK
20
	this.popUpProps = null ;																	// by FredCK
21
//	this.spellCheckScript = '/speller/server-scripts/spellchecker.php';		// by FredCK
21
//	this.spellCheckScript = '/speller/server-scripts/spellchecker.php';		// by FredCK
22
	this.spellCheckScript = 'server-scripts/spellchecker.php';				// by FredCK
-
 
23
	//this.spellCheckScript = '/cgi-bin/spellchecker.pl';
22
	//this.spellCheckScript = '/cgi-bin/spellchecker.pl';
Line 24... Line 23...
24
 
23
 
25
	// values used to keep track of what happened to a word
24
	// values used to keep track of what happened to a word
26
	this.replWordFlag = "R";	// single replace
25
	this.replWordFlag = "R";	// single replace
Line 130... Line 129...
130
	// set as ignored
129
	// set as ignored
131
	if( this._setAsIgnored( ti, wi, this.ignrWordFlag )) {
130
	if( this._setAsIgnored( ti, wi, this.ignrWordFlag )) {
132
		this.currentWordIndex++;
131
		this.currentWordIndex++;
133
		this._spellcheck();
132
		this._spellcheck();
134
	}
133
	}
-
 
134
	return true;
135
}
135
}
Line 136... Line 136...
136
 
136
 
137
function ignoreAll() {
137
function ignoreAll() {
138
	var wi = this.currentWordIndex;
138
	var wi = this.currentWordIndex;
Line 167... Line 167...
167
	}
167
	}
Line 168... Line 168...
168
 
168
 
169
	// finally, move on
169
	// finally, move on
170
	this.currentWordIndex++;
170
	this.currentWordIndex++;
-
 
171
	this._spellcheck();
171
	this._spellcheck();
172
	return true;
Line 172... Line 173...
172
}
173
}
173
 
174
 
174
function replaceWord() {
175
function replaceWord() {
Line 181... Line 182...
181
	if( !this.wordWin.getTextVal( ti, wi )) {
182
	if( !this.wordWin.getTextVal( ti, wi )) {
182
		alert( 'Error: "Not in dictionary" text is missing' );
183
		alert( 'Error: "Not in dictionary" text is missing' );
183
		return false;
184
		return false;
184
	}
185
	}
185
	if( !this.controlWin.replacementText ) {
186
	if( !this.controlWin.replacementText ) {
186
		return;
187
		return false ;
187
	}
188
	}
188
	var txt = this.controlWin.replacementText;
189
	var txt = this.controlWin.replacementText;
189
	if( txt.value ) {
190
	if( txt.value ) {
190
		var newspell = new String( txt.value );
191
		var newspell = new String( txt.value );
191
		if( this._setWordText( ti, wi, newspell, this.replWordFlag )) {
192
		if( this._setWordText( ti, wi, newspell, this.replWordFlag )) {
192
			this.currentWordIndex++;
193
			this.currentWordIndex++;
193
			this._spellcheck();
194
			this._spellcheck();
194
		}
195
		}
195
	}
196
	}
-
 
197
	return true;
196
}
198
}
Line 197... Line 199...
197
 
199
 
198
function replaceAll() {
200
function replaceAll() {
199
	var ti = this.currentTextIndex;
201
	var ti = this.currentTextIndex;
Line 206... Line 208...
206
	if( !s_word_to_repl ) {
208
	if( !s_word_to_repl ) {
207
		alert( 'Error: "Not in dictionary" text is missing' );
209
		alert( 'Error: "Not in dictionary" text is missing' );
208
		return false;
210
		return false;
209
	}
211
	}
210
	var txt = this.controlWin.replacementText;
212
	var txt = this.controlWin.replacementText;
211
	if( !txt.value ) return;
213
	if( !txt.value ) return false;
212
	var newspell = new String( txt.value );
214
	var newspell = new String( txt.value );
Line 213... Line 215...
213
 
215
 
214
	// set this word as a "replace all" word. 
216
	// set this word as a "replace all" word.
Line 230... Line 232...
230
	}
232
	}
Line 231... Line 233...
231
	
233
 
232
	// finally, move on
234
	// finally, move on
233
	this.currentWordIndex++;
235
	this.currentWordIndex++;
-
 
236
	this._spellcheck();
234
	this._spellcheck();
237
	return true;
Line 235... Line 238...
235
}
238
}
236
 
239
 
237
function terminateSpell() {
240
function terminateSpell() {
Line 284... Line 287...
284
}
287
}
Line 285... Line 288...
285
 
288
 
286
function undo() {
289
function undo() {
287
	// skip if this is the first word!
290
	// skip if this is the first word!
288
	var ti = this.currentTextIndex;
291
	var ti = this.currentTextIndex;
Line 289... Line 292...
289
	var wi = this.currentWordIndex
292
	var wi = this.currentWordIndex;
290
	
293
 
Line 291... Line 294...
291
	if( this.wordWin.totalPreviousWords( ti, wi ) > 0 ) {
294
	if( this.wordWin.totalPreviousWords( ti, wi ) > 0 ) {
Line 316... Line 319...
316
		// if we got back to the first word then set the Undo button back to disabled
319
		// if we got back to the first word then set the Undo button back to disabled
317
		if( this.wordWin.totalPreviousWords( text_idx, idx ) == 0 ) {
320
		if( this.wordWin.totalPreviousWords( text_idx, idx ) == 0 ) {
318
			this.controlWin.disableUndo();
321
			this.controlWin.disableUndo();
319
		}
322
		}
Line -... Line 323...
-
 
323
 
320
	
324
		var i, j, origSpell ;
321
		// examine what happened to this current word.
325
		// examine what happened to this current word.
322
		switch( this.wordFlags[text_idx][idx] ) {
326
		switch( this.wordFlags[text_idx][idx] ) {
323
			// replace all: go through this and all the future occurances of the word 
327
			// replace all: go through this and all the future occurances of the word
324
			// and revert them all to the original spelling and clear their flags
328
			// and revert them all to the original spelling and clear their flags
325
			case this.replAllFlag :
329
			case this.replAllFlag :
326
				for( var i = text_idx; i < this.wordWin.textInputs.length; i++ ) {
330
				for( i = text_idx; i < this.wordWin.textInputs.length; i++ ) {
327
					for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) {
331
					for( j = 0; j < this.wordWin.totalWords( i ); j++ ) {
328
						if(( i == text_idx && j >= idx ) || i > text_idx ) {
332
						if(( i == text_idx && j >= idx ) || i > text_idx ) {
329
							var origSpell = this.wordWin.originalSpellings[i][j];
333
							origSpell = this.wordWin.originalSpellings[i][j];
330
							if( origSpell == preReplSpell ) {
334
							if( origSpell == preReplSpell ) {
331
								this._setWordText ( i, j, origSpell, undefined );
335
								this._setWordText ( i, j, origSpell, undefined );
332
							}
336
							}
333
						}
337
						}
Line 336... Line 340...
336
				break;
340
				break;
Line 337... Line 341...
337
				
341
 
338
			// ignore all: go through all the future occurances of the word 
342
			// ignore all: go through all the future occurances of the word
339
			// and clear their flags
343
			// and clear their flags
340
			case this.ignrAllFlag :
344
			case this.ignrAllFlag :
341
				for( var i = text_idx; i < this.wordWin.textInputs.length; i++ ) {
345
				for( i = text_idx; i < this.wordWin.textInputs.length; i++ ) {
342
					for( var j = 0; j < this.wordWin.totalWords( i ); j++ ) {
346
					for( j = 0; j < this.wordWin.totalWords( i ); j++ ) {
343
						if(( i == text_idx && j >= idx ) || i > text_idx ) {
347
						if(( i == text_idx && j >= idx ) || i > text_idx ) {
344
							var origSpell = this.wordWin.originalSpellings[i][j];
348
							origSpell = this.wordWin.originalSpellings[i][j];
345
							if( origSpell == preReplSpell ) {
349
							if( origSpell == preReplSpell ) {
346
								this.wordFlags[i][j] = undefined; 
350
								this.wordFlags[i][j] = undefined;
347
							}
351
							}
348
						}
352
						}
Line 453... Line 457...
453
			}	
457
			}
454
		}
458
		}
455
	}
459
	}
456
	return inputs;
460
	return inputs;
457
}
461
}
458
 
-