|
|
@ -9,6 +9,7 @@
|
|
|
|
//清空上次查选的痕迹
|
|
|
|
//清空上次查选的痕迹
|
|
|
|
editor.firstForSR = 0;
|
|
|
|
editor.firstForSR = 0;
|
|
|
|
editor.currentRangeForSR = null;
|
|
|
|
editor.currentRangeForSR = null;
|
|
|
|
|
|
|
|
|
|
|
|
//给tab注册切换事件
|
|
|
|
//给tab注册切换事件
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* tab点击处理事件
|
|
|
|
* tab点击处理事件
|
|
|
@ -33,7 +34,6 @@ function clickHandler( tabHeads,tabBodys,obj ) {
|
|
|
|
body.style.zIndex = 200;
|
|
|
|
body.style.zIndex = 200;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -50,17 +50,20 @@ function switchTab( tabParentId ) {
|
|
|
|
if (head.className === "focus") clickHandler(tabHeads, tabBodys, head);
|
|
|
|
if (head.className === "focus") clickHandler(tabHeads, tabBodys, head);
|
|
|
|
head.onclick = function () {
|
|
|
|
head.onclick = function () {
|
|
|
|
clickHandler(tabHeads, tabBodys, this);
|
|
|
|
clickHandler(tabHeads, tabBodys, this);
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$G('searchtab').onmousedown = function(){
|
|
|
|
$G('searchtab').onclick = function () {
|
|
|
|
$G('search-msg').innerHTML = '';
|
|
|
|
$G('search-msg').innerHTML = '';
|
|
|
|
$G('replace-msg').innerHTML = ''
|
|
|
|
$G('replace-msg').innerHTML = '';
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//是否区分大小写
|
|
|
|
//是否区分大小写
|
|
|
|
function getMatchCase(id) {
|
|
|
|
function getMatchCase(id) {
|
|
|
|
return $G(id).checked ? true : false;
|
|
|
|
return $G(id).checked ? true : false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//查找
|
|
|
|
//查找
|
|
|
|
$G("nextFindBtn").onclick = function (txt, dir, mcase) {
|
|
|
|
$G("nextFindBtn").onclick = function (txt, dir, mcase) {
|
|
|
|
var findtxt = $G("findtxt").value, obj;
|
|
|
|
var findtxt = $G("findtxt").value, obj;
|
|
|
@ -76,10 +79,9 @@ $G("nextFindBtn").onclick = function (txt, dir, mcase) {
|
|
|
|
var bk = editor.selection.getRange().createBookmark();
|
|
|
|
var bk = editor.selection.getRange().createBookmark();
|
|
|
|
$G('search-msg').innerHTML = lang.getEnd;
|
|
|
|
$G('search-msg').innerHTML = lang.getEnd;
|
|
|
|
editor.selection.getRange().moveToBookmark(bk).select();
|
|
|
|
editor.selection.getRange().moveToBookmark(bk).select();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$G("nextReplaceBtn").onclick = function (txt, dir, mcase) {
|
|
|
|
$G("nextReplaceBtn").onclick = function (txt, dir, mcase) {
|
|
|
|
var findtxt = $G("findtxt1").value, obj;
|
|
|
|
var findtxt = $G("findtxt1").value, obj;
|
|
|
|
if (!findtxt) {
|
|
|
|
if (!findtxt) {
|
|
|
@ -92,6 +94,7 @@ $G("nextReplaceBtn").onclick = function (txt, dir, mcase) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
frCommond(obj);
|
|
|
|
frCommond(obj);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$G("preFindBtn").onclick = function (txt, dir, mcase) {
|
|
|
|
$G("preFindBtn").onclick = function (txt, dir, mcase) {
|
|
|
|
var findtxt = $G("findtxt").value, obj;
|
|
|
|
var findtxt = $G("findtxt").value, obj;
|
|
|
|
if (!findtxt) {
|
|
|
|
if (!findtxt) {
|
|
|
@ -106,6 +109,7 @@ $G("preFindBtn").onclick = function (txt, dir, mcase) {
|
|
|
|
$G('search-msg').innerHTML = lang.getStart;
|
|
|
|
$G('search-msg').innerHTML = lang.getStart;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$G("preReplaceBtn").onclick = function (txt, dir, mcase) {
|
|
|
|
$G("preReplaceBtn").onclick = function (txt, dir, mcase) {
|
|
|
|
var findtxt = $G("findtxt1").value, obj;
|
|
|
|
var findtxt = $G("findtxt1").value, obj;
|
|
|
|
if (!findtxt) {
|
|
|
|
if (!findtxt) {
|
|
|
@ -118,6 +122,7 @@ $G("preReplaceBtn").onclick = function (txt, dir, mcase) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
frCommond(obj);
|
|
|
|
frCommond(obj);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//替换
|
|
|
|
//替换
|
|
|
|
$G("repalceBtn").onclick = function () {
|
|
|
|
$G("repalceBtn").onclick = function () {
|
|
|
|
var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj,
|
|
|
|
var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj,
|
|
|
@ -136,6 +141,7 @@ $G("repalceBtn").onclick = function () {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
frCommond(obj);
|
|
|
|
frCommond(obj);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//全部替换
|
|
|
|
//全部替换
|
|
|
|
$G("repalceAllBtn").onclick = function () {
|
|
|
|
$G("repalceAllBtn").onclick = function () {
|
|
|
|
var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj,
|
|
|
|
var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj,
|
|
|
@ -157,8 +163,10 @@ $G("repalceAllBtn").onclick = function () {
|
|
|
|
$G('replace-msg').innerHTML = lang.countMsg.replace("{#count}", num);
|
|
|
|
$G('replace-msg').innerHTML = lang.countMsg.replace("{#count}", num);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//执行
|
|
|
|
//执行
|
|
|
|
var frCommond = function (obj) {
|
|
|
|
var frCommond = function (obj) {
|
|
|
|
return editor.execCommand("searchreplace", obj);
|
|
|
|
return editor.execCommand("searchreplace", obj);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
switchTab("searchtab");
|
|
|
|
|
|
|
|
|
|
|
|
switchTab("searchtab"); //注释代码
|