mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
#19603892 XpressEditor에서 찾기/바꾸기 기능 제거
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@8135 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cc89c6650e
commit
086f2ea882
2 changed files with 0 additions and 220 deletions
|
|
@ -302,45 +302,6 @@
|
|||
</div>
|
||||
<!-- /특수문자 레이어 -->
|
||||
</li>
|
||||
<li class="find xpress_xeditor_ui_findAndReplace">
|
||||
<button type="button" title="{$lang->cmd_find}"><span>{$lang->cmd_find}</span></button>
|
||||
<!-- 찾기 바꾸기 레이어 -->
|
||||
<div class="layer find xpress_xeditor_findAndReplace_layer" style="display:none">
|
||||
<!-- class="layer find" | class="layer replace"-->
|
||||
<h3>{$lang->edit->search_replace}</h3>
|
||||
<button type="button" class="close" title="{$lang->edit->close_search_replace}"><span>{$lang->edit->close_search_replace}</span></button>
|
||||
<div class="menu_tab">
|
||||
<ul class="layer_tab">
|
||||
<li class="tab1"><a href="#find" onclick="return false">{$lang->cmd_find}</a></li>
|
||||
<li class="tab2"><a href="#replace" onclick="return false">{$lang->cmd_replace}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="bx" id="find">
|
||||
<fieldset>
|
||||
<label for="keyword1">{$lang->edit->search_words}</label>
|
||||
<input id="keyword1" name="" type="text" />
|
||||
</fieldset>
|
||||
<span class="cap"></span> </div>
|
||||
<div class="bx" id="replace">
|
||||
<fieldset>
|
||||
<label for="keyword2">{$lang->edit->search_words}</label>
|
||||
<input id="keyword2" name="" type="text" />
|
||||
<br />
|
||||
<label for="keyword3">{$lang->edit->replace_words}</label>
|
||||
<input id="keyword3" name="" type="text" />
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn_area">
|
||||
<button type="button" class="find_next" title="{$lang->edit->next_search_words}"><span>{$lang->edit->next_search_words}</span></button>
|
||||
<button type="button" class="replace" title="{$lang->cmd_replace}"><span>{$lang->cmd_replace}</span></button>
|
||||
<button type="button" class="replace_all" title="{$lang->edit->replace_all}"><span>{$lang->edit->replace_all}</span></button>
|
||||
</div>
|
||||
<button type="button" class="close" title="{$lang->edit->close_search_replace}"><span>{$lang->edit->close_search_replace}</span></button>
|
||||
</div>
|
||||
<!-- /찾기 바꾸기 레이어 -->
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="table">
|
||||
|
|
|
|||
|
|
@ -1897,187 +1897,6 @@ xe.DOMFix = new ($.Class({
|
|||
return aResult;
|
||||
}
|
||||
}))();
|
||||
/**
|
||||
* @fileOverview This file contains a function that takes care of various operations related to find and replace
|
||||
* @name N_FindReplace.js
|
||||
*/
|
||||
xe.FindReplace = $.Class({
|
||||
sKeyword : "",
|
||||
window : null,
|
||||
document : null,
|
||||
bBrowserSupported : false,
|
||||
|
||||
// true if End Of Contents is reached during last execution of find
|
||||
bEOC : false,
|
||||
|
||||
$init : function(win){
|
||||
this.window = win;
|
||||
this.document = this.window.document;
|
||||
|
||||
if(this.document.domain != this.document.location.hostname){
|
||||
if($.browser.mozilla && $.browser.nVersion < 3){
|
||||
this.bBrowserSupported = false;
|
||||
this.find = function(){return 3};
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.bBrowserSupported = true;
|
||||
},
|
||||
|
||||
// 0: found
|
||||
// 1: not found
|
||||
// 2: keyword required
|
||||
// 3: browser not supported
|
||||
find : function(sKeyword, bCaseMatch, bBackwards, bWholeWord){
|
||||
var bSearchResult, bFreshSearch;
|
||||
|
||||
this.window.focus();
|
||||
|
||||
if(!sKeyword) return 2;
|
||||
|
||||
// try find starting from current cursor position
|
||||
this.bEOC = false;
|
||||
bSearchResult = this.findNext(sKeyword, bCaseMatch, bBackwards, bWholeWord);
|
||||
if(bSearchResult) return 0;
|
||||
|
||||
// end of the contents could have been reached so search again from the beginning
|
||||
this.bEOC = true;
|
||||
bSearchResult = this.findNew(sKeyword, bCaseMatch, bBackwards, bWholeWord);
|
||||
|
||||
if(bSearchResult) return 0;
|
||||
|
||||
return 1;
|
||||
},
|
||||
|
||||
findNew : function (sKeyword, bCaseMatch, bBackwards, bWholeWord){
|
||||
this.findReset();
|
||||
return this.findNext(sKeyword, bCaseMatch, bBackwards, bWholeWord);
|
||||
},
|
||||
|
||||
findNext : function(sKeyword, bCaseMatch, bBackwards, bWholeWord){
|
||||
var bSearchResult;
|
||||
bCaseMatch = bCaseMatch || false;
|
||||
bWholeWord = bWholeWord || false;
|
||||
bBackwards = bBackwards || false;
|
||||
|
||||
if(this.window.find){
|
||||
var bWrapAround = false;
|
||||
return this.window.find(sKeyword, bCaseMatch, bBackwards, bWrapAround, bWholeWord);
|
||||
}
|
||||
|
||||
// IE solution
|
||||
if(this.document.body.createTextRange){
|
||||
var iOption = 0;
|
||||
if(bBackwards) iOption += 1;
|
||||
if(bWholeWord) iOption += 2;
|
||||
if(bCaseMatch) iOption += 4;
|
||||
|
||||
this.window.focus();
|
||||
this._range = this.document.selection.createRangeCollection().item(0);
|
||||
this._range.collapse(false);
|
||||
bSearchResult = this._range.findText(sKeyword, 1, iOption);
|
||||
|
||||
this._range.select();
|
||||
return bSearchResult;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
findReset : function() {
|
||||
if (this.window.find){
|
||||
this.window.getSelection().removeAllRanges();
|
||||
return;
|
||||
}
|
||||
|
||||
// IE solution
|
||||
if(this.document.body.createTextRange){
|
||||
this._range = this.document.body.createTextRange();
|
||||
this._range.collapse(true);
|
||||
this._range.select();
|
||||
}
|
||||
},
|
||||
|
||||
// 0: replaced & next word found
|
||||
// 1: replaced & next word not found
|
||||
// 2: not replaced & next word found
|
||||
// 3: not replaced & next word not found
|
||||
// 4: sOriginalWord required
|
||||
replace : function(sOriginalWord, Replacement, bCaseMatch, bBackwards, bWholeWord){
|
||||
if(!sOriginalWord) return 4;
|
||||
|
||||
var oSelection = new xe.XpressRange(this.window);
|
||||
oSelection.setFromSelection();
|
||||
|
||||
bCaseMatch = bCaseMatch || false;
|
||||
var bMatch, selectedText = oSelection.toString();
|
||||
if(bCaseMatch)
|
||||
bMatch = (selectedText == sOriginalWord);
|
||||
else
|
||||
bMatch = (selectedText.toLowerCase() == sOriginalWord.toLowerCase());
|
||||
|
||||
if(!bMatch)
|
||||
return this.find(sOriginalWord, bCaseMatch, bBackwards, bWholeWord)+2;
|
||||
|
||||
if(typeof Replacement == "function"){
|
||||
// the returned oSelection must contain the replacement
|
||||
oSelection = Replacement(oSelection);
|
||||
}else{
|
||||
oSelection.pasteHTML(Replacement);
|
||||
}
|
||||
|
||||
// force it to find the NEXT occurance of sOriginalWord
|
||||
oSelection.select();
|
||||
|
||||
return this.find(sOriginalWord, bCaseMatch, bBackwards, bWholeWord);
|
||||
},
|
||||
|
||||
// returns number of replaced words
|
||||
// -1 : if original word is not given
|
||||
replaceAll : function(sOriginalWord, Replacement, bCaseMatch, bWholeWord){
|
||||
if(!sOriginalWord) return -1;
|
||||
|
||||
var bBackwards = false;
|
||||
|
||||
var iReplaceResult;
|
||||
var iResult = 0;
|
||||
var win = this.window;
|
||||
var oSelection = new xe.XpressRange(this.window);
|
||||
oSelection.setFromSelection();
|
||||
var sBookmark = oSelection.placeStringBookmark();
|
||||
|
||||
this.bEOC = false;
|
||||
while(!this.bEOC){
|
||||
iReplaceResult = this.replace(sOriginalWord, Replacement, bCaseMatch, bBackwards, bWholeWord);
|
||||
if(iReplaceResult == 0 || iReplaceResult == 1) iResult++;
|
||||
}
|
||||
|
||||
var startingPointReached = function(){
|
||||
var oCurSelection = new xe.XpressRange(win);
|
||||
oCurSelection.setFromSelection();
|
||||
|
||||
oSelection.moveToBookmark(sBookmark);
|
||||
var pos = oSelection.compareBoundaryPoints(xe.W3CDOMRange.START_TO_END, oCurSelection);
|
||||
|
||||
if(pos == 1) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
iReplaceResult = 0;
|
||||
this.bEOC = false;
|
||||
while(!startingPointReached() && iReplaceResult == 0 && !this.bEOC){
|
||||
iReplaceResult = this.replace(sOriginalWord, Replacement, bCaseMatch, bBackwards, bWholeWord);
|
||||
if(iReplaceResult == 0 || iReplaceResult == 1) iResult++;
|
||||
}
|
||||
|
||||
oSelection.moveToBookmark(sBookmark);
|
||||
oSelection.select();
|
||||
oSelection.removeStringBookmark(sBookmark);
|
||||
|
||||
return iResult;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @fileOverview This file contains a function that takes care of the draggable layers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue