📄 edit1.asp
字号:
text = text + '<img class="btnImage" src="'+this.resourcePath+this.icon+'" width="25" height="24" alt="'+this.label+'" title="'+this.label+'" onClick="HyperTextArea.getArea(\''+ this.area.name +'\').getControl(\''+this.name+'\').execute()">';
text = text + '</div></td>';
return text;
}
this.execute = function(){
this.area.formatText(this.command,this.option);
}
}
function Button(name,icon,title,methodName){
this.name=name;
this.getRenderedText = function(){
text = '<td><div id="'+name+'">'
text = text + '<img class="btnImage" src="'+this.resourcePath+icon+'" width="25" height="24" alt="'+title+'" title="'+title+'" onClick="HyperTextArea.getArea(\''+ this.area.name +'\').'+methodName+'()">';
text = text + '</div></td>';
return text;
}
}
function Spacer(name){
this.name = name
this.getRenderedText = function(){
return '<td> </td>'
}
}
function Toolbar(name, isFirstToolbar){
this.name = name
this.isFirstToolbar = isFirstToolbar||false;
this.getRenderedText = function(){
this.area.toolbarNames[this.area.toolbarNames.length] = this.name;
text = '<table id="' + this.name + '_' + this.area.name + '" cellpadding="1" cellspacing="0"><tr>'
if(this.isFirstToolbar){
text = '</tr></table>\n' + text;
}
return text;
}
}
function Menu(name,cmd){
this.name = name;
this.cmd = cmd;
this.area = null;
this.items = new Array();
this.addItem = function(value,lable){
this.items[this.items.length] = new MenuItem(value,lable);
}
this.addItems = function(){
for (i=0;i<arguments.length;i=i+2){
this.addItem(arguments[i],arguments[i+1]);
}
}
this.getRenderedText = function(){
text = "<td><select name='"+this.name+"' id='"+this.name+"_"+this.area.name+"' onchange='HyperTextArea.getArea(\""+ this.area.name +"\").select(this,\""+this.cmd+"\");'>\n";
for (i=0;i<this.items.length;i++){
thisItem = this.items[i]
text = text + "<option value='"+thisItem.value+"'>"+thisItem.lable+"</option>\n";
}
text = text + "</select></td>";
return text;
}
}
function MenuItem(value,lable){
this.value = value;
this.lable = lable;
}
HyperTextArea.areas = new Array();
HyperTextArea.getArea = function(name){
return HyperTextArea.areas[name];
}
HyperTextArea.activeArea = null;
HyperTextArea.about = function(){
var area;
for(i in HyperTextArea.areas){
area = HyperTextArea.getArea(i);
break;
}
window.open(area.resourcePath + "about.html");
}
HyperTextArea.updateAllAreas = function(){
//iterate over all areas and call update
for(i in HyperTextArea.areas){
area = HyperTextArea.areas[i];
area.update();
}
}
HyperTextArea.forms = new Array();
function getOffsetTop(elm) {
var mOffsetTop = elm.offsetTop;
var mOffsetParent = elm.offsetParent;
while(mOffsetParent){
mOffsetTop += mOffsetParent.offsetTop;
mOffsetParent = mOffsetParent.offsetParent;
}
return mOffsetTop;
}
function getOffsetLeft(elm) {
var mOffsetLeft = elm.offsetLeft;
var mOffsetParent = elm.offsetParent;
while(mOffsetParent) {
mOffsetLeft += mOffsetParent.offsetLeft;
mOffsetParent = mOffsetParent.offsetParent;
}
return mOffsetLeft;
}
function kb_handler(evt, rte) {
//contributed by Anti Veeranna (thanks Anti!)
if (evt.ctrlKey) {
var key = String.fromCharCode(evt.charCode).toLowerCase();
var cmd = '';
switch (key) {
case 'b': cmd = "bold"; break;
case 'i': cmd = "italic"; break;
case 'u': cmd = "underline"; break;
};
if (cmd) {
evt.target.ownerDocument.execCommand(cmd,false,true);
// stop the event bubble
evt.preventDefault();
evt.stopPropagation();
}
}
}
function stripWordHTML(oldString) {
var newString = oldString;
//清理word,excel里面复制过来的table html垃圾代码
newString = newString.replace("x:str", "");
newString = newString.replace("border=0", "border=1");
newString = newString.replace(/<(\w[^>]*) style="([^"]*)"/gi, "<$1")
newString = newString.replace(/<\/?SPAN[^>]*>/gi, "" ); //Remove all SPAN tags
newString = newString.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;// Remove Lang attributes
newString = newString.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");// Remove Class attributes
//newString = newString.replace(/'/g, "'");
//trim string
newString = trim(newString);
return newString;
}
function stripHTML(oldString) {
var newString = oldString.replace(/(<([^>]+)>)/ig,"");
//replace carriage returns and line feeds
newString = escape(newString)
newString = newString.replace("%0D%0A"," ");
newString = newString.replace("%0A"," ");
newString = newString.replace("%0D"," ");
newString = unescape(newString)
//trim string
newString = trim(newString);
return newString;
}
function trim(inputString) {
// Removes leading and trailing spaces from the passed string. Also removes
// consecutive spaces and replaces it with one space. If something besides
// a string is passed in (null, custom object, etc.) then return the input.
if (typeof inputString != "string") { return inputString; }
var retValue = inputString;
var ch = retValue.substring(0, 1);
while (ch == " ") { // Check for spaces at the beginning of the string
retValue = retValue.substring(1, retValue.length);
ch = retValue.substring(0, 1);
}
ch = retValue.substring(retValue.length-1, retValue.length);
while (ch == " ") { // Check for spaces at the end of the string
retValue = retValue.substring(0, retValue.length-1);
ch = retValue.substring(retValue.length-1, retValue.length);
}
while (retValue.indexOf(" ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); // Again, there are two spaces in each of the strings
}
return retValue; // Return the trimmed string back to the user
}
function getPaletteAsString(){
hexArray = new Array("00","55","AA","FF");
out = "";
out2 = "";
line = ""
row = 1;
count = 1;
for(i=hexArray.length-1;i>=0;i--){
val0 = hexArray[i];
for(j=hexArray.length-1;j>=0;j--){
val1 = hexArray[j];
for(k=hexArray.length-1;k>=0;k--){
val2 = hexArray[k];
hexVal = val0+val1+val2;
line = line + "\n <td id='#"+hexVal+"' bgcolor='#"+hexVal+"' width='15' height='15' onmouseover='this.style.border=\"1px dotted white\"' onclick='area.setColor(this.id)'><img width='1' height='1'></td>";
if(count==1 || (row % 2) == 0){
if(((count - 1) % 8) == 0){
out = out + "\n<tr>";
row++
}
out = out + line;
if((count % 8) == 0){
out = out + "\n</tr>";
}
}else{
if(((count - 1) % 8) == 0){
out2 = out2 + "\n<tr>";
row++
}
out2 = out2 + line;
if((count % 8) == 0){
out2 = out2 + "\n</tr>";
}
}
line = "";
count++;
}
}
}
out = '<table cellpadding="0" cellspacing="1" border="1" align="center">' + out + out2 + "</table>";
return out;
}
function getTableDialogAsString(){
out = '<html><body><form name="tableDialog">';
out = out + '<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#BDD7F7"><tr><td>';
out = out + '<table width="100%" cellpadding="2" cellspacing="2" border="0" bgcolor="#FFFFFF">';
out = out + '<tr bgcolor="#eff7ff">';
out = out + '<td colspan=2 align=center><font size=2px>插入表格</font></td>';
out = out + '</tr>';
out = out + '<tr bgcolor="#ffffde">';
out = out + '<td align=center><font size=2px>行数:</font></td><td align=center><font size=2px>列数:</font></td>';
out = out + '</tr>';
out = out + '<tr bgcolor="#ffffde">';
out = out + '<td align=center><input type="text" name="rows" size="7" value="3"/></td>';
out = out + '<td align=center><input type="text" name="cols" size="7" value="3"/></td>';
out = out + '<tr bgcolor="#ffffde">';
out = out + '<td colspan=2 align=center><input type="button" name="button" value="确定" onclick="window.opener.HyperTextArea.activeArea.insertTable(this.form.rows.value,this.form.cols.value,2,2,true);self.close()"/> <input type="button" name="cancel" value="取消" onclick="self.close()"/></td>';
out = out + '</tr>';
out = out + '</table>';
out = out + '</td></tr></table>';
out = out + '</form></body></html>';
return out;
}
function enableDesignMode(areaName){
try{
if (document.all) {
frames[areaName].document.designMode = "On";
}else{
contentDocument = document.getElementById(areaName).contentDocument;
contentDocument.designMode = "on";
}
self.status = "";
area.setContent(area.html)
}catch(e){
//attempt to recover from any exceptions
exp = "enableDesignMode('"+areaName+"')";
area = HyperTextArea.getArea(areaName);
area.designModeRetryCount++
self.status = "Error in setting designMode property on attempt number "+ area.designModeRetryCount +". Retrying.";
if(area.designModeRetryCount <= 10){
t = setTimeout(exp,100);
}else{
self.status = areaName + " failed to initialize properly";
throw e;
}
}
}
function onHyperTextAreaLoad(areaName) {
self.status = "attempting to set designMode property";
area = HyperTextArea.getArea(areaName);
area.cpWindow = frames['cp' + areaName].window;
//enables the area to determine what form it belongs to
area.form = document.getElementById("hdn"+areaName).form;
//attaches to the forms submit handler only once
formAlreadyStored = false;
for(i=0;i<HyperTextArea.forms.length;i++){
if(area.form == HyperTextArea.forms[i]){
formAlreadyStored = true;
break;
}
}
if(!formAlreadyStored){
onSubmitFunc = area.form.onsubmit;
area.form.onsubmit = function(){
HyperTextArea.updateAllAreas();
if(onSubmitFunc){
onSubmitFunc();
}
}
HyperTextArea.forms[HyperTextArea.forms.length] = area.form;
}
area.setContent(area.html)
if (document.all) {
cp = frames["cp" + areaName];
cp.document.write(getPaletteAsString());
} else {
cp = document.getElementById("cp"+areaName);
d = cp.contentDocument;
d.open();
d.write(getPaletteAsString());
d.close()
}
enableDesignMode(areaName);
area.setContent(area.html)
}
//-->
</script>
<script>
var details = '<%=changechr(rs("content"))%>';
area = new HyperTextArea("area1", details, 450, 200,"");
</script>
</div>
<textarea style="display:none" name="p_z_Z_Details" cols=50 rows=10></textarea>
<table width="100%" cellPadding="0" cellSpacing="0" border="0">
<tr>
<td class="S"> <font color="#FF0000">您可直接从word、excel中将现成资料拷贝过来,经过优化后可能会与原内容不同,请您发布前先点击“预览这条商业信息”确认。</font>
<br><SPAN
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -