r8135 보완

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@8136 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-03-07 07:06:07 +00:00
parent 086f2ea882
commit 49185f2401
2 changed files with 1 additions and 185 deletions

View file

@ -4628,184 +4628,6 @@ xe.XE_UndoRedo = $.Class({
});
//}
//{
/**
* @fileOverview This file contains Xpress plugin that takes care of the operations related to Find/Replace
* @name hp_XE_FindReplacePlugin.js
*/
xe.XE_FindReplacePlugin = $.Class({
name : "XE_FindReplacePlugin",
oEditingWindow : null,
oFindReplace : null,
oUILayer : null,
bFindMode : true,
$init : function(oAppContainer){
this._assignHTMLObjects(oAppContainer);
},
_assignHTMLObjects : function(oAppContainer){
oAppContainer = $.$(oAppContainer) || document;
this.oEditingWindow = $("IFRAME", oAppContainer).get(0);
this.oUILayer = $("DIV.xpress_xeditor_findAndReplace_layer", oAppContainer).get(0);
var oTmp = $("LI", this.oUILayer).get();
this.oFindTab = oTmp[0];
this.oReplaceTab = oTmp[1];
oTmp = $(".container > .bx", this.oUILayer).get();
this.oFindInputSet = oTmp[0];
this.oReplaceInputSet = oTmp[1];
this.oFindInput_Keyword = $("INPUT", this.oFindInputSet).get(0);
oTmp = $("INPUT", this.oReplaceInputSet).get();
this.oReplaceInput_Original = oTmp[0];
this.oReplaceInput_Replacement = oTmp[1];
this.oFindNextButton = $("BUTTON.find_next", this.oUILayer).get(0);
this.oCancelButton = $("BUTTON.cancel", this.oUILayer).get(0);
this.oReplaceButton = $("BUTTON.replace", this.oUILayer).get(0);
this.oReplaceAllButton = $("BUTTON.replace_all", this.oUILayer).get(0);
this.aCloseButtons = $("BUTTON.close", this.oUILayer).get();
this.aCloseButtons[this.aCloseButtons.length] = this.oCancelButton;
},
$ON_MSG_APP_READY : function(){
// the right document will be available only when the src is completely loaded
if(this.oEditingWindow && this.oEditingWindow.tagName == "IFRAME")
this.oEditingWindow = this.oEditingWindow.contentWindow;
this.oFindReplace = new xe.FindReplace(this.oEditingWindow);
if(!this.oFindReplace.bBrowserSupported){
this.oApp.exec("DISABLE_UI", ["find_replace"]);
return;
}
for(var i=0; i<this.aCloseButtons.length; i++){
var func = $.fnBind(this.oApp.exec, this.oApp, "HIDE_DIALOG_LAYER", [this.oUILayer]);
$(this.aCloseButtons[i]).bind("click", func);
}
$(this.oFindTab).bind("mousedown", $.fnBind(this.oApp.exec, this.oApp, "SHOW_FIND", []));
$(this.oReplaceTab).bind("mousedown", $.fnBind(this.oApp.exec, this.oApp, "SHOW_REPLACE", []));
$(this.oFindNextButton).bind("click", $.fnBind(this.oApp.exec, this.oApp, "FIND", []));
$(this.oReplaceButton).bind("click", $.fnBind(this.oApp.exec, this.oApp, "REPLACE", []));
$(this.oReplaceAllButton).bind("click", $.fnBind(this.oApp.exec, this.oApp, "REPLACE_ALL", []));
this.oApp.exec("REGISTER_UI_EVENT", ["findAndReplace", "click", "SHOW_FIND_REPLACE_LAYER"]);
},
$ON_SHOW_ACTIVE_LAYER : function(){
this.oApp.exec("HIDE_DIALOG_LAYER", [this.oUILayer]);
},
$ON_SHOW_FIND_REPLACE_LAYER : function(){
this.oApp.exec("SHOW_DIALOG_LAYER", [this.oUILayer]);
this.oApp.exec("POSITION_TOOLBAR_LAYER", [this.oUILayer]);
this.oApp.exec("HIDE_CURRENT_ACTIVE_LAYER", []);
},
$ON_SHOW_FIND : function(){
this.bFindMode = true;
$(this.oFindTab).addClass("on");
$(this.oReplaceTab).removeClass("on");
$(this.oFindNextButton).removeClass("normal");
$(this.oFindNextButton).addClass("strong");
this.oFindInputSet.style.display = "block";
this.oReplaceInputSet.style.display = "none";
this.oReplaceButton.style.display = "none";
this.oReplaceAllButton.style.display = "none";
$(this.oUILayer).removeClass("replace");
$(this.oUILayer).addClass("find");
this.oFindInput_Keyword.value = this.oReplaceInput_Original.value;
},
$ON_SHOW_REPLACE : function(){
this.bFindMode = false;
$(this.oFindTab).removeClass("on");
$(this.oReplaceTab).addClass("on");
$(this.oFindNextButton).removeClass("strong");
$(this.oFindNextButton).addClass("normal");
this.oFindInputSet.style.display = "none";
this.oReplaceInputSet.style.display = "block";
this.oReplaceButton.style.display = "inline";
this.oReplaceAllButton.style.display = "inline";
$(this.oUILayer).removeClass("find");
$(this.oUILayer).addClass("replace");
this.oReplaceInput_Original.value = this.oFindInput_Keyword.value;
},
$ON_FIND : function(){
var sKeyword;
if(this.bFindMode)
sKeyword = this.oFindInput_Keyword.value;
else
sKeyword = this.oReplaceInput_Original.value;
switch(this.oFindReplace.find(sKeyword, false)){
case 1:
alert(this.oApp.$MSG("XE_FindReplace.keywordNotFound"));
break;
case 2:
alert(this.oApp.$MSG("XE_FindReplace.keywordMissing"));
break;
}
},
$ON_REPLACE : function(){
var sOriginal = this.oReplaceInput_Original.value;
var sReplacement = this.oReplaceInput_Replacement.value;
this.oApp.exec("RECORD_UNDO_BEFORE_ACTION", ["REPLACE"]);
var iReplaceResult = this.oFindReplace.replace(sOriginal, sReplacement, false);
this.oApp.exec("RECORD_UNDO_AFTER_ACTION", ["REPLACE"]);
switch(iReplaceResult){
case 1:
case 3:
alert(this.oApp.$MSG("XE_FindReplace.keywordNotFound"));
break;
case 4:
alert(this.oApp.$MSG("XE_FindReplace.keywordMissing"));
break;
}
},
$ON_REPLACE_ALL : function(){
var sOriginal = this.oReplaceInput_Original.value;
var sReplacement = this.oReplaceInput_Replacement.value;
this.oApp.exec("RECORD_UNDO_BEFORE_ACTION", ["REPLACE ALL"]);
var iReplaceAllResult = this.oFindReplace.replaceAll(sOriginal, sReplacement, false);
this.oApp.exec("RECORD_UNDO_AFTER_ACTION", ["REPLACE ALL"]);
if(iReplaceAllResult<0){
alert(this.oApp.$MSG("XE_FindReplace.keywordMissing"));
}else{
alert(this.oApp.$MSG("XE_FindReplace.replaceAllResultP1")+iReplaceAllResult+this.oApp.$MSG("XE_FindReplace.replaceAllResultP2"));
}
}
});
//}
//{
/**
* @fileOverview This file contains Xpress plugin that takes care of the operations related to hyperlink
* @name hp_XE_Hyperlink.js
@ -5230,12 +5052,7 @@ var oMessageMap = {
'XE_EditingAreaManager.onExit' : '%uB0B4%uC6A9%uC774%20%uBCC0%uACBD%uB418%uC5C8%uC2B5%uB2C8%uB2E4.',
'XE_FontColor.invalidColorCode' : '%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff',
'XE_BGColor.invalidColorCode' : '%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff',
'XE_Hyperlink.invalidURL' : '%uC785%uB825%uD558%uC2E0%20URL%uC774%20%uC62C%uBC14%uB974%uC9C0%20%uC54A%uC2B5%uB2C8%uB2E4.',
'XE_FindReplace.keywordMissing' : '%uCC3E%uC73C%uC2E4%20%uB2E8%uC5B4%uB97C%20%uC785%uB825%uD574%20%uC8FC%uC138%uC694.',
'XE_FindReplace.keywordNotFound' : '%uCC3E%uC73C%uC2E4%20%uB2E8%uC5B4%uAC00%20%uC5C6%uC2B5%uB2C8%uB2E4.',
'XE_FindReplace.replaceAllResultP1' : '%uC77C%uCE58%uD558%uB294%20%uB0B4%uC6A9%uC774%20%uCD1D%20',
'XE_FindReplace.replaceAllResultP2' : '%uAC74%20%uBC14%uB00C%uC5C8%uC2B5%uB2C8%uB2E4.',
'XE_FindReplace.notSupportedBrowser' : '%uD604%uC7AC%20%uC0AC%uC6A9%uD558%uACE0%20%uACC4%uC2E0%20%uBE0C%uB77C%uC6B0%uC800%uC5D0%uC11C%uB294%20%uC0AC%uC6A9%uD558%uC2E4%uC218%20%uC5C6%uB294%20%uAE30%uB2A5%uC785%uB2C8%uB2E4.%5Cn%uC774%uC6A9%uC5D0%20%uBD88%uD3B8%uC744%20%uB4DC%uB824%20%uC8C4%uC1A1%uD569%uB2C8%uB2E4.'
'XE_Hyperlink.invalidURL' : '%uC785%uB825%uD558%uC2E0%20URL%uC774%20%uC62C%uBC14%uB974%uC9C0%20%uC54A%uC2B5%uB2C8%uB2E4.'
};
xe.XpressCore.oMessageMap = oMessageMap;
/**

View file

@ -90,7 +90,6 @@ function editorStart_xe(editor_sequence, primary_key, content_key, editor_height
oEditor.registerPlugin(new xe.XE_UndoRedo());
oEditor.registerPlugin(new xe.XE_Table(elAppContainer));
oEditor.registerPlugin(new xe.XE_Hyperlink(elAppContainer));
oEditor.registerPlugin(new xe.XE_FindReplacePlugin(elAppContainer));
oEditor.registerPlugin(new xe.XE_FormatWithSelectUI(elAppContainer));
oEditor.registerPlugin(new xe.XE_SCharacter(elAppContainer));
}