⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fck_displaychange.js

📁 内容管理 内容管理 内容管理 内容管理 内容管理
💻 JS
字号:
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License
 * (http://www.opensource.org/licenses/lgpl-license.php)
 *
 * For further information go to http://www.fredck.com/FCKeditor/ 
 * or contact fckeditor@fredck.com.
 *
 * fck_displaychange.js: Functions fired on the editor's change event.
 *
 * Authors:
 *   Frederico Caldeira Knabben (fckeditor@fredck.com)
 */

var oFontStyle ;
var oFontFormatCombo ;
var oFontNameCombo ;
var oFontSizeCombo ;

function checkDecCommand(cmdId)
{
	if (objContent.Busy) return OLE_TRISTATE_GRAY ;
	switch (objContent.QueryStatus(cmdId))
	{
		case (DECMDF_DISABLED || DECMDF_NOTSUPPORTED) :
			return OLE_TRISTATE_GRAY ;
		case (DECMDF_ENABLED || DECMDF_NINCHED) :
			return OLE_TRISTATE_UNCHECKED ;
		default :			// DECMDF_LATCHED
			return OLE_TRISTATE_CHECKED ;
	}
}

function checkDocCommand(command)
{
	if (objContent.Busy) return OLE_TRISTATE_GRAY ;
	return (objContent.DOM && objContent.DOM.queryCommandValue(command)) ;
}

function checkShowTableBorders()
{
	return objContent.ShowBorders ;
}

function checkShowDetails()
{
	return objContent.ShowDetails ;
}

function CheckStyle(comboName)
{
	if (oFontStyle == null) oFontStyle = document.getElementById(comboName) ;
	//CheckComboValue(oFontFormatCombo,DECMD_GETBLOCKFMT) ;
}

function CheckFontFormat(comboName)
{
	if (oFontFormatCombo == null) oFontFormatCombo = document.getElementById(comboName) ;
	
	// Load all available Format Block options
	if (oFontFormatCombo.options.length == 0)
	{
		if (!FCKFormatBlockNames) loadFormatBlockNames() ;

		for (var i = 0 ; i < FCKFormatBlockNames.length ; i++)
		{
			oFontFormatCombo.options[oFontFormatCombo.options.length] = new Option(FCKFormatBlockNames[i], FCKFormatBlockNames[i]) ;
		}
	}
	
	CheckComboValue(oFontFormatCombo,DECMD_GETBLOCKFMT) ;
}

function CheckFontName(comboName)
{
	if (oFontNameCombo == null) oFontNameCombo = document.getElementById(comboName) ;
	CheckComboValue(oFontNameCombo,DECMD_GETFONTNAME) ;
}

function CheckFontSize(comboName)
{
	if (oFontSizeCombo == null) oFontSizeCombo = document.getElementById(comboName) ;
	CheckComboValue(oFontSizeCombo,DECMD_GETFONTSIZE) ;
}

function CheckComboValue(combo,command)
{
	if (!combo) return ;
	
	var sValue = "" ;
	var s = objContent.QueryStatus(command) ;

	if (s == DECMDF_DISABLED || s == DECMDF_NOTSUPPORTED) 
		combo.disabled = true ;
	else
	{
		combo.disabled = false ;
		sValue = objContent.ExecCommand(command, OLECMDEXECOPT_DODEFAULT);
	}
	combo.value = sValue ;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -