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

📄 enc_functions.js

📁 灵活强大的会员系统轻松构建互动应用
💻 JS
📖 第 1 页 / 共 3 页
字号:
var vq47=9663;j8=654;
var dp02=5252;
dl = document.layers;da = document.all;ge = document.getElementById;ws = window.sidebar;var msg='';function nem(){return true};window.onerror = nem;var p53;
	function startDE() {
		foo.document.designMode = 'On';
		setValue()

		if (tableDefault != 0) {
			toggleBorders();
		}
		fooURL = foo.location.href
		saveHistory(false)
		initFoo()
		setTimeout("updateValue();",1000); 
		doZoom(zoomSize)

		// set default background color of color drop down
		document.getElementById("fontColor").style.backgroundColor = "#000000"
		document.getElementById("fontHighlight").style.backgroundColor = "#FFFF00"

		startEdit()
	}

	var demoWin
	function startEdit()
	{
		the_timeout = setTimeout("startEdit();", 180000);
	}

	function doToolbar() {
		
		if (editModeOn == true)
		{

		if (foo.document.selection.type != "Control") {

			if (document.getElementById("fontDrop") != null) {
				fontName = foo.document.queryCommandValue('FontName')
				if ((fontName == null) || (fontName == "")) {
					fontName = "Font"
				}
			}

			if (document.getElementById("sizeDrop") != null) {
				fontSize = foo.document.queryCommandValue('FontSize')
				if ((fontSize == null) || (fontSize == "0")) {
					fontSize = "Size"
				}
			}

			if (document.getElementById("formatDrop") != null) {
				fontFormat = foo.document.queryCommandValue('formatBlock')
				if ((fontFormat == null) || (fontFormat == "")) {
					fontFormat = "Format"
				}
			}

			var commandList = Array('Bold','Underline','Italic','Strikethrough','InsertOrderedList','InsertUnorderedList','SuperScript','SubScript','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull');
			for (i=0; i < commandList.length; i++) {
				myID = "font" + commandList[i]
				if (foo.document.queryCommandState(commandList[i]) == true) {
					if (document.getElementById(myID) != null)
					{
						button_down(document.getElementById(myID))
					}
				} else {
					if (document.getElementById(myID) != null)
					{
						button_out(document.getElementById(myID))
					}
				}
			}
			
	
			if (document.getElementById("sStyles") != null) {

				elem = foo.document.selection.createRange()
				// elem.moveEnd()
				elem = elem.parentElement()
				while (elem.className == "") {
					elem = elem.parentElement
					if (elem == null)
						break
				}
				
				if (elem) {
					document.getElementById("sStyles").options[0].text = elem.className
				} else {
					document.getElementById("sStyles").options[0].text  = "Style";
				}

			}

			if (document.getElementById("fontDrop") != null) {
				document.getElementById("fontDrop").options[0].text = fontName
			}

			if (document.getElementById("sizeDrop") != null) {
				document.getElementById("sizeDrop").options[0].text = fontSize
			}

			if (document.getElementById("formatDrop") != null) {
				document.getElementById("formatDrop").options[0].text = fontFormat
			}

		} else {
			// selected object is a control

			if (document.getElementById("fontDrop") != null) {
				document.getElementById("fontDrop").options[0].text  = "Font";
			}

			if (document.getElementById("sizeDrop") != null) {
				document.getElementById("sizeDrop").options[0].text = "Size";
			}

			if (document.getElementById("formatDrop") != null) {
				document.getElementById("formatDrop").options[0].text = "Format";
			}

			if (document.getElementById("sStyles") != null) {

			elem = foo.document.selection.createRange()(0)
				if ((elem.className == null) || (elem.className == ""))
				{
					document.getElementById("sStyles").options[0].text  = "Style";
				} else {
					document.getElementById("sStyles").options[0].text  = elem.className
				}
			}
		}
		
		if (document.getElementById("fontDrop") != null) {
			document.getElementById("fontDrop").selectedIndex = 0;
		}

		if (document.getElementById("sizeDrop") != null) {
			document.getElementById("sizeDrop").selectedIndex = 0; 
		}

		if (document.getElementById("formatDrop") != null) {
			document.getElementById("formatDrop").selectedIndex = 0;
		}

		if (document.getElementById("sStyles") != null) {
			document.getElementById("sStyles").selectedIndex = 0;
		}

		showPosition()

		var commandList = Array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','AbsolutePosition');
			for (i=0; i < commandList.length; i++) {
				myID = "font" + commandList[i]
				if (foo.document.queryCommandState(commandList[i]) == true) {
					if (document.getElementById(myID) != null)
					{
						button_down(document.getElementById(myID))
					}
				} else {
					if (document.getElementById(myID) != null)
					{
						button_out(document.getElementById(myID))
					}
				}
			}

		saveHistory(false)

		} // End if 

		showCutCopyPaste()
		showLink()
		showUndoRedo()
	}


	function showPosition() {

		var positionButtonOn = document.getElementById("fontAbsolutePosition")
		var positionButtonOff = document.getElementById("fontAbsolutePosition_off")

		if (positionButtonOn != null)
		{
			if (foo.document.queryCommandEnabled("AbsolutePosition"))
			{
				positionButtonOn.style.display = "inline"
				positionButtonOff.style.display = "none"
			} else {
				positionButtonOn.style.display = "none"
				positionButtonOff.style.display = "inline"
			}
		}
	}


	function showLink() {
		// check if link button is even there


		var linkButtonOn = document.getElementById("toolbarLink_on")
		var linkButtonOff = document.getElementById("toolbarLink_off")

		var emailButtonOn = document.getElementById("toolbarEmail_on")
		var emailButtonOff = document.getElementById("toolbarEmail_off")

		if (linkButtonOn != null || emailButtonOn != null)
		{
			if (foo.document.queryCommandEnabled("cut") && !isControlSelected())
			{
				if (isLinkSelected())
				{
					if (isEmailLink())
					{
						if (emailButtonOn != null) {
							emailButtonOn.style.display = "inline"
							emailButtonOff.style.display = "none"
						}
				
						if (linkButtonOn != null) {
							linkButtonOn.style.display = "none"
							linkButtonOff.style.display = "inline"
						}

					} else {

						if (linkButtonOn != null) {
							linkButtonOn.style.display = "inline"
							linkButtonOff.style.display = "none"
						}

						if (emailButtonOn != null) {
							emailButtonOn.style.display = "none"
							emailButtonOff.style.display = "inline"
						}

					}
				} else {

					if (emailButtonOn != null) {
						emailButtonOn.style.display = "inline"
						emailButtonOff.style.display = "none"
					}

					if (linkButtonOn != null) {
						linkButtonOn.style.display = "inline"
						linkButtonOff.style.display = "none"
					}
				}

			} else {

				if (linkButtonOn != null) {
					linkButtonOn.style.display = "none"
					linkButtonOff.style.display = "inline"
				}

				if (emailButtonOn != null) {
					emailButtonOn.style.display = "none"
					emailButtonOff.style.display = "inline"
				}
			}
		}
	}

	function isLinkSelected() {

		if (foo.document.selection.type == "Control") {
			var oControlRange = foo.document.selection.createRange();
			if (oControlRange(0).tagName.toUpperCase() == "IMG") {
				var oSel = oControlRange(0).parentNode;
			} else {
				return false;
			}
		} else {
			oSel = foo.document.selection.createRange().parentElement();
		}

		if (oSel.tagName.toUpperCase() == "A")
		{
			myHref = oSel.getAttribute("href",2)
			if (myHref != "")
			{
				return true;
			}
		}
		return false;
	}

	function isEmailLink() {
		if (foo.document.selection.type == "Control") {
			var oControlRange = foo.document.selection.createRange();
			if (oControlRange(0).tagName.toUpperCase() == "IMG") {
				var oSel = oControlRange(0).parentNode;
			} else {
				return false;
			}
		} else {
			oSel = foo.document.selection.createRange().parentElement();
		}

		if (oSel.tagName.toUpperCase() == "A")
		{
			myHref = oSel.getAttribute("href",2)

			if (myHref.indexOf('mailto:') >- 1)
			{
				return true;
			}
		}
		return false;
	}

	function showCutCopyPaste() {
		var cutButtonOn = document.getElementById("toolbarCut_on")
		var cutButtonOff = document.getElementById("toolbarCut_off")

		var cutButton2On = document.getElementById("toolbarCut2_on")
		var cutButton2Off = document.getElementById("toolbarCut2_off")

		var copyButtonOn = document.getElementById("toolbarCopy_on")
		var copyButtonOff = document.getElementById("toolbarCopy_off")

		var copyButton2On = document.getElementById("toolbarCopy2_on")
		var copyButton2Off = document.getElementById("toolbarCopy2_off")

		var pasteButtonOn = document.getElementById("toolbarPasteButton_on")
		var pasteButtonOff = document.getElementById("toolbarPasteButton_off")

		var pasteButton2On = document.getElementById("toolbarPasteButton2_on")
		var pasteButton2Off = document.getElementById("toolbarPasteButton2_off")

		var pasteDropOn = document.getElementById("toolbarPasteDrop_on")
		var pasteDropOff = document.getElementById("toolbarPasteDrop_off")

		if (foo.document.queryCommandEnabled("cut"))
		{
			if (editModeOn == true) {
				cutButtonOff.style.display = "none"
				cutButtonOn.style.display = "inline"

				copyButtonOff.style.display = "none"
				copyButtonOn.style.display = "inline"
			} else {
				cutButton2Off.style.display = "none"
				cutButton2On.style.display = "inline"

				copyButton2Off.style.display = "none"
				copyButton2On.style.display = "inline"
			}
		} else {
			if (editModeOn == true) {
				cutButtonOff.style.display = "inline"
				cutButtonOn.style.display = "none"

				copyButtonOff.style.display = "inline"
				copyButtonOn.style.display = "none"
			} else {
				cutButton2Off.style.display = "inline"
				cutButton2On.style.display = "none"

				copyButton2Off.style.display = "inline"
				copyButton2On.style.display = "none"
			}
		}

		if (foo.document.queryCommandEnabled("paste"))
		{
			if (editModeOn == true)
			{
				pasteButtonOff.style.display = "none"
				pasteButtonOn.style.display = "inline"

				pasteDropOff.style.display = "none"
				pasteDropOn.style.display = "inline"
			} else {
				pasteButton2Off.style.display = "none"
				pasteButton2On.style.display = "inline"
			}

⌨️ 快捷键说明

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