<commit_before>XException      = require 'src/Exceptions/XException'

module.exports = class XTechnePanel
    @className = 'XTechnePanel'

    @xdesktop           = null
    @displaySurface     = null

    @container          = null
    @elements           = null

    constructor: (xdesktop, surface, data) ->
        if not xdesktop?
            throw new XException "Could not acquire #{XTechneDesktop.className} instance"
        if not surface?
            throw new XException 'Could not acquire display surface'
        @xdesktop = xdesktop
        @displaySurface = surface
        @container = document.createElement 'nav'
        if not data?
            @container.classList.add 'xtechneDesktopPanel'
        else
            @container.classList.add data.type
        @displaySurface.appendChild @container

    initContent: (contents) ->
        @elements = new Array
        _this = @
        for elData in contents
            if not elData.type?
                console.warn "Missing panelItem type for #{JSON.stringify(elData)}"<commit_msg>Auto push<commit_after>XException      = require 'src/Exceptions/XException'

module.exports = class XTechnePanel
    @className = 'XTechnePanel'

    @xdesktop           = null
    @displaySurface     = null

    @container          = null
    @elements           = null

    constructor: (xdesktop, surface, data) ->
        if not xdesktop?
            throw new XException "Could not acquire #{XTechneDesktop.className} instance"
        if not surface?
            throw new XException 'Could not acquire display surface'
        @xdesktop = xdesktop
        @displaySurface = surface
        @container = document.createElement 'nav'
        if not data?
            @container.classList.add 'xtechneDesktopPanel'
        else
            @container.classList.add data.type
        @displaySurface.appendChild @container

    # TODO: Use array of objects containing properties and HTML element rather
    # than the element only and storing actions in the element (safer that way)
    initContent: (contents) ->
        @elements = new Array
        _this = @
        for elData in contents
            if not elData.type?
                # TODO: Replace with future notification system call
                console.warn "Missing panelItem type for #{JSON.stringify(elData)}"
{'fraction_non_alphanumeric': 0.07228400342172797, 'fraction_numerical': 0.0, 'mean_word_length': 2.135388739946381, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6320912', 'n_tokens_mistral': 598, 'n_tokens_neox': 572, 'n_words': 187}