Discuz.Web/javascript/dnteditor.js

(开头部分) 13KB

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


var DNTeditor = function(instanceName, width, height, value) 
{
    // Properties
    this.InstanceName = instanceName;
    this.Width = width || '100%';
    this.Height = height || '200';
    this.Value = value || '';
    this.BasePath = '/';
    this.RedundancyHeight = undefined;
    this.Style = '';
    this.CheckBrowser = true;
    this.DisplayErrors = true;
    this.EnableSafari = false; 	// This is a temporary property, while Safari support is under development.
    this.EnableOpera = false; 	// This is a temporary property, while Opera support is under development.
    this.Basic = false;
    this.IsAutoSave = true;
    //this.Config			= new Object() ;

    // Events
    this.OnError = null; // function( source, errorNumber, errorDescription )
    this.OnChange = null;
}

DNTeditor.prototype.Create = function()
{
    document.write(this.CreateHtml());
    this._SetValue();
}

DNTeditor.prototype._SetValue = function() 
{
    var iframe = document.getElementById(this.InstanceName + "___Frame");
    var value = this.Value;
    var style = this.Style;
    var width = this.Width;
    var height = this.Height;
    var basic = this.Basic;
    var isAutoSave = this.IsAutoSave;
    var onchange = this.OnChange;
    var redundancyheight = this.RedundancyHeight;
    iframe.onload = function() {
        InitializeEditor(iframe, value, style, width, height, basic, isAutoSave, onchange, redundancyheight);
    };
    iframe.onreadystatechange = function() {
    if (this.readyState == 'complete') {
            InitializeEditor(iframe, value, style, width, height, basic, isAutoSave, onchange, redundancyheight);
        }
    };

}

function InitializeEditor(iframe, value, style, width, height, basic, isAutoSave, onchange, redundancyheight) 
{
    if (redundancyheight == undefined)
        redundancyheight = 170;
    else if (is_moz)
        redundancyheight += 100;
    if (style != '') {
	    iframe.contentWindow.document.getElementById('editorcss').href = style;
后面还有 350 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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