MyOAExx/Scripts/js/min.js

(开头部分) 134KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

jQuery.cookie = function (key, value, options) {
    if (arguments.length > 1 && String(value) !== "[object Object]") {
        options = jQuery.extend({}, options); if (value === null || value === undefined) { options.expires = -1; }
        if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); t.setDate(t.getDate() + days); }
        value = String(value); return (document.cookie = [encodeURIComponent(key), '=', options.raw ? value : encodeURIComponent(value), options.expires ? '; expires=' + options.expires.toUTCString() : '', options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : ''].join(''));
    }
    options = value || {}; var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent; return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};; (function ($) {
    "use strict"; var console = window.console ? window.console : { log: $.noop, error: function (msg) { $.error(msg); } }; var supportsProp = (('prop' in $.fn) && ('removeProp' in $.fn)); function Wysiwyg() {
        this.controls = {
            bold: { groupIndex: 0, visible: true, tags: ["b", "strong"], css: { fontWeight: "bold" }, tooltip: "Bold", hotkey: { "ctrl": 1, "key": 66 } }, copy: { groupIndex: 8, visible: false, tooltip: "Copy" }, createLink: { groupIndex: 6, visible: true, exec: function () { var self = this; if ($.wysiwyg.controls && $.wysiwyg.controls.link) { $.wysiwyg.controls.link.init(this); } else if ($.wysiwyg.autoload) { $.wysiwyg.autoload.control("wysiwyg.link.js", function () { self.controls.createLink.exec.apply(self); }); } else { console.error("$.wysiwyg.controls.link not defined. You need to include wysiwyg.link.js file"); } }, tags: ["a"], tooltip: "Create link" }, cut: { groupIndex: 8, visible: false, tooltip: "Cut" }, decreaseFontSize: { groupIndex: 9, visible: false, tags: ["small"], tooltip: "Decrease font size", exec: function () { this.decreaseFontSize(); } }, h1: { groupIndex: 7, visible: true, className: "h1", command: ($.browser.msie || $.browser.safari) ? "FormatBlock" : "heading", "arguments": ($.browser.msie || $.browser.safari) ? "<h1>" : "h1", tags: ["h1"], tooltip: "Header 1" }, h2: { groupIndex: 7, visible: true, className: "h2", command: ($.browser.msie || $.browser.safari) ? "FormatBlock" : "heading", "arguments": ($.browser.msie || $.browser.safari) ? "<h2>" : "h2", tags: ["h2"], tooltip: "Header 2" }, h3: { groupIndex: 7, visible: true, className: "h3", command: ($.browser.msie || $.browser.safari) ? "FormatBlock" : "heading", "arguments": ($.browser.msie || $.browser.safari) ? "<h3>" : "h3", tags: ["h3"], tooltip: "Header 3" }, highlight: {
                tooltip: "Highlight", className: "highlight", groupIndex: 1, visible: false, css: { backgroundColor: "rgb(255, 255, 102)" }, exec: function () {
                    var command, node, selection, args; if ($.browser.msie || $.browser.safari) { command = "backcolor"; } else { command = "hilitecolor"; }
                    if ($.browser.msie) { node = this.getInternalRange().parentElement(); } else { selection = this.getInternalSelection(); node = selection.extentNode || selection.focusNode; while (node.style === undefined) { node = node.parentNode; if (node.tagName && node.tagName.toLowerCase() === "body") { return; } } }
                    if (node.style.backgroundColor === "rgb(255, 255, 102)" || node.style.backgroundColor === "#ffff66") { args = "#ffffff"; } else { args = "#ffff66"; }
                    this.editorDoc.execCommand(command, false, args);
                }
            }, html: {
                groupIndex: 10, visible: false, exec: function () {
                    var elementHeight; if (this.options.resizeOptions && $.fn.resizable) { elementHeight = this.element.height(); }
                    if (this.viewHTML) {
                        this.setContent(this.original.value); $(this.original).hide(); this.editor.show(); if (this.options.resizeOptions && $.fn.resizable) {
                            if (elementHeight === this.element.height()) { this.element.height(elementHeight + this.editor.height()); }
                            this.element.resizable($.extend(true, { alsoResize: this.editor }, this.options.resizeOptions));
                        }
                        this.ui.toolbar.find("li").each(function () { var li = $(this); if (li.hasClass("html")) { li.removeClass("active"); } else { li.removeClass('disabled'); } });
                    } else {
                        this.saveContent(); $(this.original).css({ width: this.element.outerWidth() - 6, height: this.element.height() - this.ui.toolbar.height() - 6, resize: "none" }).show(); this.editor.hide(); if (this.options.resizeOptions && $.fn.resizable) {
                            if (elementHeight === this.element.height()) { this.element.height(this.ui.toolbar.height()); }
                            this.element.resizable("destroy");
                        }
                        this.ui.toolbar.find("li").each(function () { var li = $(this); if (li.hasClass("html")) { li.addClass("active"); } else { if (false === li.hasClass("fullscreen")) { li.removeClass("active").addClass('disabled'); } } });
                    }
                    this.viewHTML = !(this.viewHTML);
                }, tooltip: "View source code"
            }, increaseFontSize: { groupIndex: 9, visible: false, tags: ["big"], tooltip: "Increase font size", exec: function () { this.increaseFontSize(); } }, indent: { groupIndex: 2, visible: true, tooltip: "Indent" }, insertHorizontalRule: { groupIndex: 6, visible: true, tags: ["hr"], tooltip: "Insert Horizontal Rule" }, insertImage: { groupIndex: 6, visible: true, exec: function () { var self = this; if ($.wysiwyg.controls && $.wysiwyg.controls.image) { $.wysiwyg.controls.image.init(this); } else if ($.wysiwyg.autoload) { $.wysiwyg.autoload.control("wysiwyg.image.js", function () { self.controls.insertImage.exec.apply(self); }); } else { console.error("$.wysiwyg.controls.image not defined. You need to include wysiwyg.image.js file"); } }, tags: ["img"], tooltip: "Insert image" }, insertOrderedList: { groupIndex: 5, visible: true, tags: ["ol"], tooltip: "Insert Ordered List" }, insertTable: { groupIndex: 6, visible: true, exec: function () { var self = this; if ($.wysiwyg.controls && $.wysiwyg.controls.table) { $.wysiwyg.controls.table(this); } else if ($.wysiwyg.autoload) { $.wysiwyg.autoload.control("wysiwyg.table.js", function () { self.controls.insertTable.exec.apply(self); }); } else { console.error("$.wysiwyg.controls.table not defined. You need to include wysiwyg.table.js file"); } }, tags: ["table"], tooltip: "Insert table" }, insertUnorderedList: { groupIndex: 5, visible: true, tags: ["ul"], tooltip: "Insert Unordered List" }, italic: { groupIndex: 0, visible: true, tags: ["i", "em"], css: { fontStyle: "italic" }, tooltip: "Italic", hotkey: { "ctrl": 1, "key": 73 } }, justifyCenter: { groupIndex: 1, visible: true, tags: ["center"], css: { textAlign: "center" }, tooltip: "Justify Center" }, justifyFull: { groupIndex: 1, visible: true, css: { textAlign: "justify" }, tooltip: "Justify Full" }, justifyLeft: { visible: true, groupIndex: 1, css: { textAlign: "left" }, tooltip: "Justify Left" }, justifyRight: { groupIndex: 1, visible: true, css: { textAlign: "right" }, tooltip: "Justify Right" }, ltr: {
                groupIndex: 10, visible: false, exec: function () {
                    var p = this.dom.getElement("p"); if (!p) { return false; }
                    $(p).attr("dir", "ltr"); return true;
                }, tooltip: "Left to Right"
            }, outdent: { groupIndex: 2, visible: true, tooltip: "Outdent" }, paragraph: { groupIndex: 7, visible: false, className: "paragraph", command: "FormatBlock", "arguments": ($.browser.msie || $.browser.safari) ? "<p>" : "p", tags: ["p"], tooltip: "Paragraph" }, paste: { groupIndex: 8, visible: false, tooltip: "Paste" }, redo: { groupIndex: 4, visible: true, tooltip: "Redo" }, removeFormat: { groupIndex: 10, visible: true, exec: function () { this.removeFormat(); }, tooltip: "Remove formatting" }, rtl: {
                groupIndex: 10, visible: false, exec: function () {
                    var p = this.dom.getElement("p"); if (!p) { return false; }
                    $(p).attr("dir", "rtl"); return true;
                }, tooltip: "Right to Left"
            }, strikeThrough: { groupIndex: 0, visible: true, tags: ["s", "strike"], css: { textDecoration: "line-through" }, tooltip: "Strike-through" }, subscript: { groupIndex: 3, visible: true, tags: ["sub"], tooltip: "Subscript" }, superscript: { groupIndex: 3, visible: true, tags: ["sup"], tooltip: "Superscript" }, underline: { groupIndex: 0, visible: true, tags: ["u"], css: { textDecoration: "underline" }, tooltip: "Underline", hotkey: { "ctrl": 1, "key": 85 } }, undo: { groupIndex: 4, visible: true, tooltip: "Undo" }, code: { visible: true, groupIndex: 6, tooltip: "Code snippet", exec: function () { var range = this.getInternalRange(), common = $(range.commonAncestorContainer), $nodeName = range.commonAncestorContainer.nodeName.toLowerCase(); if (common.parent("code").length) { common.unwrap(); } else { if ($nodeName !== "body") { common.wrap("<code/>"); } } } }
        }; this.defaults = { html: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body style="margin: 3px;">INITIAL_CONTENT</body></html>', debug: false, controls: {}, css: {}, events: {}, autoGrow: false, autoSave: true, brIE: true, formHeight: 270, formWidth: 440, iFrameClass: null, initialContent: "<p></p>", maxHeight: 10000, maxLength: 0, messages: { nonSelection: "Select the text you wish to link" }, toolbarHtml: '<ul role="menu" class="toolbar"></ul>', removeHeadings: false, replaceDivWithP: false, resizeOptions: false, rmUnusedControls: false, rmUnwantedBr: true, tableFiller: "Lorem ipsum", initialMinHeight: null, controlImage: { forceRelativeUrls: false }, controlLink: { forceRelativeUrls: false }, plugins: { autoload: false, i18n: false, rmFormat: { rmMsWordMarkup: false } } }; this.availableControlProperties = ["arguments", "callback", "className", "command", "css", "custom", "exec", "groupIndex", "hotkey", "icon", "tags", "tooltip", "visible"]; this.editor = null; this.editorDoc = null; this.element = null; this.options = {}; this.original = null; this.savedRange = null; this.timers = []; this.validKeyCodes = [8, 9, 13, 16, 17, 18, 19, 20, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46]; this.isDestroyed = false; this.dom = { ie: { parent: null }, w3c: { parent: null } }; this.dom.parent = this; this.dom.ie.parent = this.dom; this.dom.w3c.parent = this.dom; this.ui = {}; this.ui.self = this; this.ui.toolbar = null; this.ui.initialHeight = null; this.dom.getAncestor = function (element, filterTagName) {
            filterTagName = filterTagName.toLowerCase(); while (element && "body" !== element.tagName.toLowerCase()) {
                if (filterTagName === element.tagName.toLowerCase()) { return element; }
                element = element.parentNode;
            }
            return null;
        }; this.dom.getElement = function (filterTagName) { var dom = this; if (window.getSelection) { return dom.w3c.getElement(filterTagName); } else { return dom.ie.getElement(filterTagName); } }; this.dom.ie.getElement = function (filterTagName) {
            var dom = this.parent, selection = dom.parent.getInternalSelection(), range = selection.createRange(), element; if ("Control" === selection.type) { if (1 === range.length) { element = range.item(0); } else { return null; } } else { element = range.parentElement(); }
            return dom.getAncestor(element, filterTagName);
        }; this.dom.w3c.getElement = function (filterTagName) {
            var dom = this.parent, range = dom.parent.getInternalRange(), element; if (!range) { return null; }
            element = range.commonAncestorContainer; if (3 === element.nodeType) { element = element.parentNode; }
            if (element === range.startContainer) { element = element.childNodes[range.startOffset]; }
            return dom.getAncestor(element, filterTagName);
后面还有 907 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。