Вход Регистрация
Файл: mailist/wys/jscripts/tiny_mce/plugins/devkit/jscripts/devkit.js
Строк: 927
<?php
var devkit parent.tinyMCE.plugins['devkit'], logEnabled trueflip falsebook null;

function 
init() {
    var 
logidocument.forms[0];

    
devkit._winLoaded true;

    
log tinyMCE.log;

    for (
i=0i<log.lengthi++)
        
debug(log[i]);

    
f.logfilter.value devkit._logFilter;
}

function 
changeFilter(f) {
    
devkit._logFilter f;
}

function 
toggleLog(s) {
    
logEnabled s;
}

function 
toggleFlip() {
    
document.getElementById('flipbtn').src flip 'images/flip_down.gif' 'images/flip_up.gif';

    if (
flip)
        
parent.document.getElementById('devkit').className 'devkitup';
    else
        
parent.document.getElementById('devkit').className 'devkitdown';

    
flip = !flip;
}

function 
debug(s) {
    var 
dln;

    if (!
logEnabled || !new RegExp(devkit._logFilter'gi').test(s))
        return;

    
document;
    
d.getElementById('log');
    
d.createElement('span');

    
n.innerHTML tinyMCE.xmlEncode(s);

    
l.appendChild(n);
    
l.scrollTop l.scrollHeight;
}

function 
renderInfo() {
    var 
se document.getElementById('info'), nsninst''selrnginstCount 0rc;

    
+= '<h2>Browser info:</h2>';

    
+= '<table border="0" cellpadding="0" cellspacing="0" class="data">';
    
+= addRenderInfo('navigator.userAgent'navigator.userAgent);
    
+= addRenderInfo('navigator.appName'navigator.appName);
    
+= addRenderInfo('navigator.platform'navigator.platform);
    
+= addRenderInfo('navigator.language'navigator.language'bspec');
    
+= addRenderInfo('navigator.browserLanguage'navigator.browserLanguage'bspec');
    
+= addRenderInfo('navigator.systemLanguage'navigator.systemLanguage'bspec');
    
+= addRenderInfo('navigator.userLanguage'navigator.userLanguage'bspec');
    
+= addRenderInfo('opera.buildNumber("inconspicuous")'typeof(opera) != 'undefined' && opera.buildNumber opera.buildNumber('inconspicuous') : null'bspec');
    
+= addRenderInfo('window.innerWidth'parent.window.innerWidth'bspec');
    
+= addRenderInfo('window.innerHeight'parent.window.innerHeight'bspec');
    
+= addRenderInfo('document.body.offsetWidth'parent.document.body.offsetWidth);
    
+= addRenderInfo('document.body.offsetHeight'parent.document.body.offsetHeight);
    
+= addRenderInfo('screen.width'screen.width);
    
+= addRenderInfo('screen.height'screen.height);
    
+= addRenderInfo('screen.availWidth'screen.availWidth);
    
+= addRenderInfo('screen.availHeight'screen.availHeight);
    
+= addRenderInfo('screen.colorDepth'screen.colorDepth);
    
+= addRenderInfo('screen.pixelDepth'screen.pixelDepth'bspec');
    
+= addRenderInfo('document.contentType'document.contentType'bspec');
    
+= '</table>';

    
+= '<h2>TinyMCE_Engine info:</h2>';

    
+= '<table border="0" cellpadding="0" cellspacing="0" class="data">';
    
+= addRenderInfo('baseURL'tinyMCE.baseURL);
    
+= addRenderInfo('selectedInstance.editorId'tinyMCE.selectedInstance tinyMCE.selectedInstance.editorId null);
    
+= addRenderInfo('selectedElement.nodeName'tinyMCE.selectedElement tinyMCE.selectedElement.nodeName null'dep');
    
+= addRenderInfo('loadedFiles',tinyMCE.loadedFiles.join(','));
    
+= addRenderInfo('isMSIE'tinyMCE.isMSIE);
    
+= addRenderInfo('isMSIE5'tinyMCE.isMSIE5);
    
+= addRenderInfo('isMSIE5_0'tinyMCE.isMSIE5_0);
    
+= addRenderInfo('isMSIE7'tinyMCE.isMSIE7);
    
+= addRenderInfo('isGecko'tinyMCE.isGecko);
    
+= addRenderInfo('isSafari'tinyMCE.isSafari);
    
+= addRenderInfo('isOpera'tinyMCE.isOpera);
    
+= addRenderInfo('isMac'tinyMCE.isMac);
    
+= addRenderInfo('isNS7'tinyMCE.isNS7);
    
+= addRenderInfo('isNS71'tinyMCE.isNS71);
    
+= addRenderInfo('idCounter'tinyMCE.idCounter);
    
+= addRenderInfo('currentConfig'tinyMCE.currentConfig);
    
+= addRenderInfo('majorVersion'tinyMCE.majorVersion);
    
+= addRenderInfo('minorVersion'tinyMCE.minorVersion);
    
+= addRenderInfo('releaseDate'tinyMCE.releaseDate);
    
+= addRenderInfo('documentBasePath'tinyMCE.documentBasePath);
    
+= addRenderInfo('documentURL'tinyMCE.documentURL);
    
+= '</table>';

    for (
n in tinyMCE.instances) {
        
inst tinyMCE.instances[n];

        if (!
tinyMCE.isInstance(inst))
            continue;

        
sel inst.selection.getSel();
        
rng inst.selection.getRng();

        
+= '<h2>TinyMCE_Control(' + (instCount++) + ') id: ' inst.editorId '</h2>';
        
+= '<table border="0" cellpadding="0" cellspacing="0" class="data">';

        
+= addRenderInfo('editorId'inst.editorId);
        
+= addRenderInfo('visualAid'inst.visualAid);
        
+= addRenderInfo('foreColor'inst.foreColor);
        
+= addRenderInfo('backColor'inst.backColor);
        
+= addRenderInfo('formTargetElementId'inst.formTargetElementId);
        
+= addRenderInfo('formElement'inst.formElement inst.formElement.nodeName null);
        
+= addRenderInfo('oldTargetElement'inst.oldTargetElement inst.oldTargetElement.nodeName null);
        
+= addRenderInfo('linkElement'inst.linkElement inst.linkElement.nodeName null'dep');
        
+= addRenderInfo('imgElement'inst.imgElement inst.imgElement.nodeName null'dep');
        
+= addRenderInfo('selectedNode'inst.selectedNode inst.selectedNode.nodeName null'dep');
        
+= addRenderInfo('targetElement'inst.targetElement inst.targetElement.nodeName null);
        
+= addRenderInfo('getBody().nodeName'inst.getBody() ? inst.getBody().nodeName null);
        
+= addRenderInfo('getBody().getAttribute("id")'inst.getBody() ? inst.getBody().getAttribute("id") : null);
        
+= addRenderInfo('getDoc().location'inst.getDoc() ? inst.getDoc().location null);
        
+= addRenderInfo('startContent'inst.startContent);
        
+= addRenderInfo('isHidden()'inst.isHidden());
        
+= addRenderInfo('isDirty()'inst.isDirty());
        
+= addRenderInfo('undoRedo.undoLevels.length'inst.undoRedo.undoLevels.length);
        
+= addRenderInfo('undoRedo.undoIndex'inst.undoRedo.undoIndex);
        
+= addRenderInfo('selection.getSelectedHTML()'inst.selection.getSelectedHTML());
        
+= addRenderInfo('selection.isCollapsed()'inst.selection.isCollapsed() || 'false');
        
+= addRenderInfo('selection.getSelectedText()'inst.selection.getSelectedText());
        
+= addRenderInfo('selection.getFocusElement().nodeName'inst.selection.getFocusElement().nodeName);
        
+= addRenderInfo('selection.getFocusElement().outerHTML'tinyMCE.getOuterHTML(inst.selection.getFocusElement()));

        if ((
tinyMCE.isGecko || tinyMCE.isOpera) && sel && rng) {
            
+= addRenderInfo('selection.getSel().anchorNode.nodeName'sel.anchorNode sel.anchorNode.nodeName null'bspec');
            
+= addRenderInfo('selection.getSel().anchorOffset'sel.anchorOffset'bspec');
            
+= addRenderInfo('selection.getSel().focusNode.nodeName'sel.focusNode sel.focusNode.nodeName null'bspec');
            
+= addRenderInfo('selection.getSel().focusOffset'sel.focusOffset'bspec');
            
+= addRenderInfo('selection.getRng().startContainer.nodeName'rng.startContainer rng.startContainer.nodeName null'bspec');
            
+= addRenderInfo('selection.getRng().startOffset'rng.startOffset'bspec');
            
+= addRenderInfo('selection.getRng().endContainer.nodeName'rng.endContainer rng.endContainer.nodeName null'bspec');
            
+= addRenderInfo('selection.getRng().endOffset'rng.endOffset'bspec');
        }

        if (
typeof(rng.item) != 'undefined' || typeof(rng.htmlText) != 'undefined') {
            if (!
rng.item) {
                
+= addRenderInfo('selection.getSel().type'sel.type'bspec');
                
+= addRenderInfo('selection.getRng().htmlText'rng.htmlText'bspec');
                
+= addRenderInfo('selection.getRng().text'rng.text'bspec');
            } else
                
+= addRenderInfo('selection.getRng().item(0).nodeName'rng.item(0).nodeName'bspec');
        }

        
+= '</table>';
    }

    
+= '<p>Fields marked in <strong class="bspec">gray</strong> is not cross browser and should be used with care.</p>';
    
+= '<p>Fields marked <strong class="dep">red</strong> are marked deprecated and will be removed in the future.</p><br />';

    
se.innerHTML h;
}

function 
addRenderInfo(nvc) {
    return 
'<tr><td' + (' class="' '"' '')+ '>' '</td><td><input type="text" value="' tinyMCE.xmlEncode(!= null ? ('' v).replace(/[rn]/g'') : 'null') + '" /></td></tr>';
}

function 
renderSettings() {
    var 
se document.getElementById('settings'), nsninst''v;

    for (
n in tinyMCE.instances) {
        
inst tinyMCE.instances[n];

        if (!
tinyMCE.isInstance(inst))
            continue;

        
+= '<h2>Instance id: ' inst.editorId '</h2>';
        
+= '<table border="0" cellpadding="0" cellspacing="0" class="data">';

        for (
sn in inst.settings) {
            
inst.settings[sn];

            
+= '<tr><td class="col1">' tinyMCE.xmlEncode(sn) + '</td><td><input type="text" value="' tinyMCE.xmlEncode(v) + '" /></td></tr>';
        }

        
+= '</table>';
    }

    
se.innerHTML h;
}

function 
renderContent() {
    var 
se document.getElementById('content'), ninst'';

    for (
n in tinyMCE.instances) {
        
inst tinyMCE.instances[n];

        if (!
tinyMCE.isInstance(inst))
            continue;

        
+= '<h2>Instance id: ' inst.editorId '</h2>';

        
+= '<h3>Start content - inst.startContent:</h3>';
        
+= '<div>' tinyMCE.xmlEncode(inst.startContent) + '</div>';

        
+= '<h3>Raw content - inst.getBody().innerHTML or inst.getHTML(true):</h3>';
        
+= '<div>' tinyMCE.xmlEncode(inst.getHTML(true)) + '</div>';

        
+= '<h3>Cleaned content - inst.getHTML():</h3>';
        
+= '<div>' tinyMCE.xmlEncode(inst.getHTML()) + '</div>';

        if (
inst.serializedHTML) {
            
+= '<h3>Serialized HTML content - inst.serializedHTML:</h3>';
            
+= '<div>' tinyMCE.xmlEncode(inst.serializedHTML) + '</div>';
        }
    }

    
se.innerHTML h;
}

function 
renderCommandStates() {
    var 
se document.getElementById('command_states'), ninst''vex;
    var 
cmds = new Array('2D-Position','AbsolutePosition','BackColor','BlockDirLTR','BlockDirRTL','Bold','BrowseMode','Copy','CreateBookmark','CreateLink','Cut','Delete','DirLTR','DirRTL','EditMode','enableInlineTableEditing','enableObjectResizing','FontName','FontSize','ForeColor','FormatBlock','Indent','InsertButton','InsertFieldset','InsertHorizontalRule','InsertIFrame','InsertImage','InsertInputButton','InsertInputCheckbox','InsertInputFileUpload','InsertInputHidden','InsertInputImage','InsertInputPassword','InsertInputRadio','InsertInputReset','InsertInputSubmit','InsertInputText','InsertMarquee','InsertOrderedList','InsertParagraph','InsertSelectDropdown','InsertSelectListbox','InsertTextArea','InsertUnorderedList','Italic','JustifyCenter','JustifyFull','JustifyLeft','JustifyNone','JustifyRight','LiveResize','MultipleSelection','Open','Outdent','OverWrite','Paste','PlayImage','Redo','Refresh','RemoveFormat','SaveAs','SelectAll','SizeToControl','SizeToControlHeight','SizeToControlWidth','Stop','StopImage','StrikeThrough','styleWithCSS','Subscript','Superscript','UnBookmark','Underline','Undo','Unlink','Unselect'), i;

    for (
n in tinyMCE.instances) {
        
inst tinyMCE.instances[n];

        if (!
tinyMCE.isInstance(inst))
            continue;

        
+= '<h2>Instance id: ' inst.editorId '</h2>';
        
+= '<table border="0" cellpadding="0" cellspacing="0" class="data">';

        for (
i=0i<cmds.lengthi++) {
            
null;

            try {
                
tinyMCE.isGecko || inst.getDoc().queryCommandSupported(cmds[i]);
                
inst.queryCommandState(cmds[i]) : 'Not supported';
            } catch (
ex) {
                
'Not supported';
            }

            
+= '<tr><td><input type="text" value="' tinyMCE.xmlEncode(cmds[i]) + '" /></td><td><input type="text" value="' tinyMCE.xmlEncode(v) + '" /></td></tr>';
        }

        
+= '</table>';
    }

    
se.innerHTML h;
}

function 
renderUndoRedo() {
    var 
se document.getElementById('undo_redo'), instn''ileiddur;
    var 
document.forms[0];    

    if (
tinyMCE.undoLevels) {
        
le tinyMCE.undoLevels;

        
+= '<h2>Global undo/redo</h2>';
        
+= '<table border="0" cellpadding="0" cellspacing="0" width="50%" class="data">';
        
+= '<tr><td>undoLevels.length</td><td>' le.length '</td></tr>';
        
+= '<tr><td>undoIndex</td><td>' tinyMCE.undoIndex '</td></tr>';
        
+= '</table>';

        for (
i=0i<le.lengthi++)
            
+= '<h3>Level: ' ', Instance: ' + (le[i] ? le[i].editorId 'null') + '</h3>';
    }

    for (
n in tinyMCE.instances) {
        
inst tinyMCE.instances[n];

        if (!
tinyMCE.isInstance(inst))
            continue;

        
ur inst.undoRedo;
        
le ur.undoLevels;

        
+= '<hr /><h2>Instance id: ' inst.editorId '</h2>';
        
+= '<table border="0" cellpadding="0" cellspacing="0" width="50%" class="data">';
        
+= '<tr><td>undoLevels.length</td><td>' le.length '</td></tr>';
        
+= '<tr><td>undoIndex</td><td>' ur.undoIndex '</td></tr>';
        
+= '<tr><td>typingUndoIndex</td><td>' ur.typingUndoIndex '</td></tr>';
        
+= '<tr><td>undoRedo</td><td>' ur.undoRedo '</td></tr>';
        
+= '</table>';

        for (
i=0i<le.lengthi++) {
            
+= '<h3>Level: ' + (!le[i].bookmark "" " [bookmark]") + '</h3>';
            
+= '<div class="undodata">' tinyMCE.xmlEncode(le[i].content) + '</div>';

            if (
&& f.undo_diff.checked) {
                
diff_main(le[i-1].content.replace(/[rn]+/g'') : nullle[i].content.replace(/[rn]+/g''), false);
                
diff_cleanup_semantic(d);
                
+= '<h3>Diff ' + (i-1) + ',' '</h3><div class="undodata">' diff_prettyhtml(d) + '</div>';
            }
        }
    }

    
se.innerHTML h;
}

function 
clearLog() {
    
document.getElementById('log').innerHTML '';
    
devkit._startTime null;
}

function 
cancelAction() {
    
parent.document.getElementById('devkit').style.display 'none';
}

function 
toggleDebugEvents(s) {
    
devkit._debugEvents(s);
}

function 
storeSelection() {
    
book tinyMCE.selectedInstance.selection.getBookmark();

    return 
false;
}

function 
restoreSelection() {
    
tinyMCE.selectedInstance.selection.moveToBookmark(book);

    return 
false;
}
?>
Онлайн: 1
Реклама