FCKEdtor部分常用JS功能(原创) - 吾非无心 - 博客园
来源:百度文库 编辑:神马文学网 时间:2024/04/28 05:41:43
FCKEdtor部分常用JS功能(原创)
// JScript 文件
//预览
function preview() {
oFCKeditor.Value=FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML(true);
FCKeditorAPI.GetInstance('FCKeditor1').Preview();
}
//源代码/编辑转换
function viewsrc()
{
var obj=FCKeditorAPI.GetInstance('FCKeditor1');
oFCKeditor.Value=obj.GetXHTML(true);
obj.SwitchEditMode(FCK_EDITMODE_SOURCE);
if(obj.EditMode==FCK_EDITMODE_SOURCE)
{
document.getElementById("btn_src").value="编辑";
document.getElementById("btn_src").title="以所见即所得模块编辑";
}
else
{
document.getElementById("btn_src").value="源代码";
document.getElementById("btn_src").title="以源代码模块编辑";
}
}
//增加编辑区大小
function upsize()
{
var height=oFCKeditor.Height;
if(height<1200)
{
oFCKeditor.Height=oFCKeditor.Height+200;
document.getElementById("FCKeditor1___Frame").height=oFCKeditor.Height;
}
if(oFCKeditor.Height>1000)
document.getElementById("btn_upsize").disabled="disabled";
document.getElementById("btn_downsize").disabled="";
}
//减小编辑区大小
function downsize()
{
var height=oFCKeditor.Height;
if(height>200)
{
oFCKeditor.Height=oFCKeditor.Height-200;
document.getElementById("FCKeditor1___Frame").height=oFCKeditor.Height;
}
if(oFCKeditor.Height<400)
document.getElementById("btn_downsize").disabled="disabled";
document.getElementById("btn_upsize").disabled="";
}
//去除字符串首尾空格
String.prototype.trim = function()
{
// 用正则表达式将前后空格
// 用空字符串替代。
return this.replace(/(^\s*)|(\s*$)/g, "");
}
//重置编辑器(清空)
function resetFCKEditor()
{
FCKeditorAPI.GetInstance('FCKeditor1').SetHTML("");
}
//插入HTML代码到当前位置
function inserthtml()
{
var htmlstr=document.getElementById("insertstr").value;
if(htmlstr.length>2)
{
FCKeditorAPI.GetInstance('FCKeditor1').InsertHtml(htmlstr);
}
document.getElementById("insertstr").value="";
}
// JScript 文件
//预览
function preview() {
oFCKeditor.Value=FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML(true);
FCKeditorAPI.GetInstance('FCKeditor1').Preview();
}
//源代码/编辑转换
function viewsrc()
{
var obj=FCKeditorAPI.GetInstance('FCKeditor1');
oFCKeditor.Value=obj.GetXHTML(true);
obj.SwitchEditMode(FCK_EDITMODE_SOURCE);
if(obj.EditMode==FCK_EDITMODE_SOURCE)
{
document.getElementById("btn_src").value="编辑";
document.getElementById("btn_src").title="以所见即所得模块编辑";
}
else
{
document.getElementById("btn_src").value="源代码";
document.getElementById("btn_src").title="以源代码模块编辑";
}
}
//增加编辑区大小
function upsize()
{
var height=oFCKeditor.Height;
if(height<1200)
{
oFCKeditor.Height=oFCKeditor.Height+200;
document.getElementById("FCKeditor1___Frame").height=oFCKeditor.Height;
}
if(oFCKeditor.Height>1000)
document.getElementById("btn_upsize").disabled="disabled";
document.getElementById("btn_downsize").disabled="";
}
//减小编辑区大小
function downsize()
{
var height=oFCKeditor.Height;
if(height>200)
{
oFCKeditor.Height=oFCKeditor.Height-200;
document.getElementById("FCKeditor1___Frame").height=oFCKeditor.Height;
}
if(oFCKeditor.Height<400)
document.getElementById("btn_downsize").disabled="disabled";
document.getElementById("btn_upsize").disabled="";
}
//去除字符串首尾空格
String.prototype.trim = function()
{
// 用正则表达式将前后空格
// 用空字符串替代。
return this.replace(/(^\s*)|(\s*$)/g, "");
}
//重置编辑器(清空)
function resetFCKEditor()
{
FCKeditorAPI.GetInstance('FCKeditor1').SetHTML("");
}
//插入HTML代码到当前位置
function inserthtml()
{
var htmlstr=document.getElementById("insertstr").value;
if(htmlstr.length>2)
{
FCKeditorAPI.GetInstance('FCKeditor1').InsertHtml(htmlstr);
}
document.getElementById("insertstr").value="";
}
FCKEdtor部分常用JS功能(原创) - 吾非无心 - 博客园
末代知青的幸福生活(二):吾非知青 - D4012工作室 - rhzds - 和讯博客
“人生三层楼”断想(原创) - 吾铭竹的日志 - 网易博客
部分JS限制脚本
【原创】:520-------吾爱归零
中国历代人口-吾行家园-搜狐博客
(原创)多款股票分析软件特色功能杂谈 - 艺彧方舟的日志 - 网易博客
JS 刷新本页、父页、框架 - ie421.NET - 博客园
JS 刷新本页、父页、框架 - ie421.NET - 博客园
CSS+JS滚动图片功能代码
prototype.js常用函数及其用法
prototype.js常用函数及其用法
js验证常用正则表达式集锦
js验证常用正则表达式集锦
40种常用的js代码
常用js脚本收藏集合状态栏脚本
prototype.js常用函数及其用法
一些人们常用却不知道原意的俗语(原创) - dongming07的日志 - 网易博客
BAT文件部分功能
[原创] [原]lvm(逻辑卷管理器)的介绍和常用功能流程实验 - ChinaUnix.net
吾论“友”之道(原创)
JS时间,时段分析 — 功能算法介绍
注册表常用功能
奔腾B50常用功能