Code Search for Developers
 
 
  

fck_find.html from crlove at Krugle


Show fck_find.html syntax highlighted

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2006 Frederico Caldeira Knabben
 * 
 * Licensed under the terms of the GNU Lesser General Public License:
 * 		http://www.opensource.org/licenses/lgpl-license.php
 * 
 * For further information visit:
 * 		http://www.fckeditor.net/
 * 
 * "Support Open Source software. What about a donation today?"
 * 
 * File Name: fck_find.html
 * 	"Find" dialog window.
 * 
 * File Authors:
 * 		Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta content="noindex, nofollow" name="robots" />
	<script type="text/javascript">

var oEditor = window.parent.InnerDialogLoaded() ;

function OnLoad()
{
	// Whole word is available on IE only.
	if ( oEditor.FCKBrowserInfo.IsIE )
		document.getElementById('divWord').style.display = '' ;

	// First of all, translate the dialog box texts.
	oEditor.FCKLanguageManager.TranslatePage( document ) ;

	window.parent.SetAutoSize( true ) ;
}

function btnStat(frm)
{
	document.getElementById('btnFind').disabled =
		( document.getElementById('txtFind').value.length == 0 ) ;
}

function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll )
{
	for ( var i = 0 ; i < parentNode.childNodes.length ; i++ )
	{
		var oNode = parentNode.childNodes[i] ;
		if ( oNode.nodeType == 3 )
		{
			var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ;
			if ( oNode.nodeValue != sReplaced )
			{
				oNode.nodeValue = sReplaced ;
				if ( ! replaceAll )
					return true ;
			}
		}
		else
		{
			if ( ReplaceTextNodes( oNode, regex, replaceValue ) )
				return true ;
		}
	}
	return false ;
}

function GetRegexExpr()
{
	if ( document.getElementById('chkWord').checked )
		var sExpr = '\\b' + document.getElementById('txtFind').value + '\\b' ;
	else
		var sExpr = document.getElementById('txtFind').value ;

	return sExpr ;
}

function GetCase()
{
	return ( document.getElementById('chkCase').checked ? '' : 'i' ) ;
}

function Ok()
{
	if ( document.getElementById('txtFind').value.length == 0 )
		return ;

	if ( oEditor.FCKBrowserInfo.IsIE )
		FindIE() ;
	else
		FindGecko() ;
}

var oRange ;

if ( oEditor.FCKBrowserInfo.IsIE )
	oRange = oEditor.FCK.EditorDocument.body.createTextRange() ;

function FindIE()
{
	var iFlags = 0 ;

	if ( chkCase.checked )
		iFlags = iFlags | 4 ;

	if ( chkWord.checked )
		iFlags = iFlags | 2 ;

	var bFound = oRange.findText( document.getElementById('txtFind').value, 1, iFlags ) ;

	if ( bFound )
	{
		oRange.scrollIntoView() ;
		oRange.select() ;
		oRange.collapse(false) ;
		oLastRangeFound = oRange ;
	}
	else
	{
		oRange = oEditor.FCK.EditorDocument.body.createTextRange() ;
		alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
	}
}

function FindGecko()
{
	var bCase = document.getElementById('chkCase').checked ;
	var bWord = document.getElementById('chkWord').checked ;

	// window.find( searchString, caseSensitive, backwards, wrapAround, wholeWord, searchInFrames, showDialog ) ;
	oEditor.FCK.EditorWindow.find( document.getElementById('txtFind').value, bCase, false, false, bWord, false, false ) ;

}

function FindGecko()
{
	var bCase = document.getElementById('chkCase').checked ;
	var bWord = document.getElementById('chkWord').checked ;

	// window.find( searchString, caseSensitive, backwards, wrapAround, wholeWord, searchInFrames, showDialog ) ;
	if ( !oEditor.FCK.EditorWindow.find( document.getElementById('txtFind').value, bCase, false, false, bWord, false, false ) )
		alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
}
	</script>
</head>
<body onload="OnLoad()" scroll="no" style="overflow: hidden">
	<table cellspacing="3" cellpadding="2" width="100%" border="0">
		<tr>
			<td nowrap="nowrap">
				<label for="txtFind" fcklang="DlgReplaceFindLbl">
					Find what:</label>&nbsp;
			</td>
			<td width="100%">
				<input id="txtFind" style="width: 100%" tabindex="1" type="text" />
			</td>
			<td>
				<input id="btnFind" style="padding-right: 5px; padding-left: 5px" onclick="Ok();"
					type="button" value="Find" fcklang="DlgFindFindBtn" />
			</td>
		</tr>
		<tr>
			<td valign="bottom" colspan="3">
				&nbsp;<input id="chkCase" tabindex="3" type="checkbox" /><label for="chkCase" fcklang="DlgReplaceCaseChk">Match
					case</label>
				<br />
				<div id="divWord" style="display: none">
					&nbsp;<input id="chkWord" tabindex="4" type="checkbox" /><label for="chkWord" fcklang="DlgReplaceWordChk">Match
					whole word</label>
				</div>
			</td>
		</tr>
	</table>
</body>
</html>




See more files for this project here

crlove

Online psychological-test-based friend-making system.

Project homepage: http://sourceforge.net/projects/crlove
Programming language(s): Java,JavaScript,Ruby,XML
License: other

  common/
    images/
      locked.gif
      reset.gif
      unlocked.gif
    fck_dialog_common.css
    fck_dialog_common.js
    fcknumericfield.htc
    moz-bindings.xml
  fck_about/
    lgpl.html
    logo_fckeditor.gif
    logo_fredck.gif
  fck_docprops/
    fck_document_preview.html
  fck_flash/
    fck_flash.js
    fck_flash_preview.html
  fck_image/
    fck_image.js
    fck_image_preview.html
  fck_link/
    fck_link.js
  fck_select/
    fck_select.js
  fck_spellerpages/
    spellerpages/
      server-scripts/
        spellchecker.cfm
        spellchecker.php
        spellchecker.pl
      blank.html
      controlWindow.js
      controls.html
      spellChecker.js
      spellchecker.html
      spellerStyle.css
      wordWindow.js
  fck_template/
    images/
      template1.gif
      template2.gif
      template3.gif
  fck_universalkey/
    00.gif
    data.js
    diacritic.js
    dialogue.js
    fck_universalkey.css
    keyboard_layout.gif
    multihexa.js
  fck_about.html
  fck_anchor.html
  fck_button.html
  fck_checkbox.html
  fck_colorselector.html
  fck_docprops.html
  fck_find.html
  fck_flash.html
  fck_form.html
  fck_hiddenfield.html
  fck_image.html
  fck_link.html
  fck_listprop.html
  fck_paste.html
  fck_radiobutton.html
  fck_replace.html
  fck_select.html
  fck_smiley.html
  fck_source.html
  fck_specialchar.html
  fck_spellerpages.html
  fck_table.html
  fck_tablecell.html
  fck_template.html
  fck_textarea.html
  fck_textfield.html
  fck_universalkey.html