📄 xmenu.js
字号:
// **********************************************************//// Copyright 2002-2003 Sebastian Werner// http://sebastian-werner.net//// Licensed under://// Attribution-NonCommercial-ShareAlike License 1.0// by CreativeCommon (http://creativecommons.org)//// Key License Terms:// * Attribution.// The licensor permits others to copy, distribute,// display, and perform the work. In return, licensees// must give the original author credit.// * Noncommercial.// The licensor permits others to copy, distribute,// display, and perform the work. In return, licensees// may not use the work for commercial purposes -- unless// they get the licensor's permission.// * Share Alike.// The licensor permits others to distribute derivative// works only under a license identical to the one that// governs the licensor's work.//// for details visit:// http://creativecommons.org/licenses/by-nc-sa/1.0///// **********************************************************// **********************************************************// MENU// **********************************************************function xMenu(config){ this.__initproperties = function() { this.obj.className = this.config.get("class"); this.map() this.css.position = "absolute"; this.css.width = "auto"; this.css.height = "auto"; this.css.zIndex = "1"; this.frame = new xObject(new xHash("tagname", "ul")); this.append(this.frame) this.content = new Array(); this.config.set("arrowdistance", 18); } // Funktion zum Hinzuf黦en eines Seperators this.addSeperator = function() { // Preparing new entry var pos = this.content.length; this.content[pos] = new Array(); this.content[pos]["type"] = "seperator"; this.content[pos]["tag"] = new xObject(new xHash("tagname", "li")); this.content[pos]["line"] = new xObject(new xHash("tagname", "div")); // Klasse anwenden this.content[pos]["tag"].setClass("seperator"); this.content[pos]["line"].setClass("seperator"); // Linie und Tag kombinieren this.content[pos]["line"].map(this.content[pos]["tag"]) // Element in Frame integrieren this.frame.append(this.content[pos]["tag"]) } // Funktion zum Hinzuf黦en eines neuen Eintrages this.addEntry = function(config, submenu) { // Preparing new entry var pos = this.content.length; this.content[pos] = new Array(); this.content[pos].config = config; _debug.msg("AddEntry " + pos + ": " + this.content[pos].config.get("text")) this.content[pos]["type"] = "entry"; // Create Elements this.content[pos]["tag"] = new xObject(new xHash("tagname", "li")); this.content[pos]["link"] = new xObject(new xHash("tagname", "a")); this.content[pos]["menu"] = submenu; // Disable focus border this.content[pos]["link"].obj.onfocus = function(event) { if (this.blur) this.blur(); } // Link und Tag kombinieren this.content[pos]["link"].map(this.content[pos]["tag"]) // Set cursor to default this.content[pos]["link"].css.cursor = "default"; // this.content[pos]["link"].obj.href="javascript://"; this.content[pos]["link"].obj.href=this.content[pos].config.get("href"); // Element in Frame integrieren this.frame.append(this.content[pos]["tag"]) // Text vorbereiten this.content[pos]["text"] = new xObject(new xHash("tagname", "span")); this.content[pos]["text"].obj.paddingRight = "4px"; this.content[pos]["text"].append(document.createTextNode(config.get("text"))); if (this.content[pos]["menu"] != null && typeof(this.content[pos]["menu"]) != "undefined") { // Bei Event Submen
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -