<commit_before><script type="text/javascript">

    var funcNames = {
        'parse-str': 'parseStr',
        'parse-float': 'parseFloat',
        'parse-int': 'parseInt',
        'is-nan': 'isNaN',
        'is-finite': 'isFinite'
    };

    RED.nodes.registerType('simplejs', {
        category: 'function',
        color: '#fdd0a2',
        defaults: {
            func: {value: '', required: true},
            property: {value: 'payload', required: true},
            name: {value: ''}
        },
        inputs: 1,
        outputs: 1,
        icon: 'function.png',
        label: function () {
            return this.name || funcNames[this.func] + '(msg.' + this.property + ')' || 'simplejs';
        }
    });
</script>

<script type="text/x-red" data-template-name="simplejs">

    <div class="form-row">
        <label for="node-input-property"><i class="fa fa-bookmark"></i> Property</label>
        <div style="width: 252px; margin-right: 0px; margin-left: 0px;" class="red-ui-typedInput-container">
            <button><span>msg.</span></button>
            <div class="red-ui-typedInput-input" style="left: 45px; right: 0px;">
                <input type="text" id="node-input-property" class="red-ui-typedInput" style="margin-right: 0px; margin-left: 0px;">
            </div>
        </div>

    </div>

    <div class="form-row">
        <label for="node-input-func"><i class="fa fa-archive"></i> Function</label>
        <select id="node-input-func">
            <option value=""></option>
            <option value="parse-str">String()</option>
            <option value="parse-float">parseFloat()</option>
            <option value="parse-int">parseInt()</option>
            <option value="is-nan">isNaN()</option>
            <option value="is-finite">isFinite()</option>
        </select>
    </div>

    <div class="form-row">
        <label for="node-input-name"><i class="icon-tag"></i> Name</label>
        <input type="text" id="node-input-name" placeholder="Name">
    </div>

    <div class="form-tips">
        <b>Tip:</b> If you are using isNaN() or isFinite() the node
        won't return anything if the given <code>msg.payload</code> won't
        satisfy the function.
        <br>
        The node won't also return anything if the chosen function did not
        return anything.
    </div>

</script>

<script type="text/x-red" data-help-name="simplejs">
    <p>
        A simple node which gives you access to some global JavaScript functions.
        <br>
        Implemented are <i>String()</i>, <i>parseFloat()</i>, <i>parseInt()</i>, <i>isNaN()</i> and <i>isFinite()</i>.
        <br>
        The node can only be used for the <code>msg</code>-object

        <br>
        <br>
        More information on these functions can be obtained here:
        <a href="http://www.w3schools.com/jsref/jsref_obj_global.asp" target="_blank">
            http://www.w3schools.com/jsref/jsref_obj_global.asp
        </a>
        <br>
        <br>
        by <NAME>, 2017<br><commit_msg>better help text<commit_after><script type="text/javascript">

    var funcNames = {
        'parse-str': 'parseStr',
        'parse-float': 'parseFloat',
        'parse-int': 'parseInt',
        'is-nan': 'isNaN',
        'is-finite': 'isFinite'
    };

    RED.nodes.registerType('simplejs', {
        category: 'function',
        color: '#fdd0a2',
        defaults: {
            func: {value: '', required: true},
            property: {value: 'payload', required: true},
            name: {value: ''}
        },
        inputs: 1,
        outputs: 1,
        icon: 'function.png',
        label: function () {
            return this.name || funcNames[this.func] + '(msg.' + this.property + ')' || 'simplejs';
        }
    });
</script>

<script type="text/x-red" data-template-name="simplejs">

    <div class="form-row">
        <label for="node-input-property"><i class="fa fa-bookmark"></i> Property</label>
        <div style="width: 252px; margin-right: 0px; margin-left: 0px;" class="red-ui-typedInput-container">
            <button><span>msg.</span></button>
            <div class="red-ui-typedInput-input" style="left: 45px; right: 0px;">
                <input type="text" id="node-input-property" class="red-ui-typedInput" style="margin-right: 0px; margin-left: 0px;">
            </div>
        </div>

    </div>

    <div class="form-row">
        <label for="node-input-func"><i class="fa fa-archive"></i> Function</label>
        <select id="node-input-func">
            <option value=""></option>
            <option value="parse-str">String()</option>
            <option value="parse-float">parseFloat()</option>
            <option value="parse-int">parseInt()</option>
            <option value="is-nan">isNaN()</option>
            <option value="is-finite">isFinite()</option>
        </select>
    </div>

    <div class="form-row">
        <label for="node-input-name"><i class="icon-tag"></i> Name</label>
        <input type="text" id="node-input-name" placeholder="Name">
    </div>

    <div class="form-tips">
        <b>Tip:</b> If you are using isNaN() or isFinite() the node
        won't return anything if the given <code>msg.&lt;property&gt;</code> won't
        satisfy the function.
        <br>
        The node won't also return anything if the chosen function did not
        return anything.
    </div>

</script>

<script type="text/x-red" data-help-name="simplejs">
    <p>
        A simple node which gives you access to some global JavaScript functions.
        <br>
        Implemented are <i>String()</i>, <i>parseFloat()</i>, <i>parseInt()</i>, <i>isNaN()</i> and <i>isFinite()</i>.
        <br>
        The node can only be used for the <code>msg</code>-object

        <br>
        <br>
        More information on these functions can be obtained here:
        <a href="http://www.w3schools.com/jsref/jsref_obj_global.asp" target="_blank">
            http://www.w3schools.com/jsref/jsref_obj_global.asp
        </a>
        <br>
        <br>
        by <NAME>, 2017<br>
{'fraction_non_alphanumeric': 0.17586776859504133, 'fraction_numerical': 0.006611570247933884, 'mean_word_length': 2.304751501911524, 'pattern_counts': {'":': 0, '<': 157, '<?xml version=': 0, '>': 157, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '3705848', 'n_tokens_mistral': 1952, 'n_tokens_neox': 1875, 'n_words': 425}