<commit_before>/**
 * Copyright 2016, Atlas of Living Australia (ALA)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Version 1.0.0
 * 
 * Created by <NAME> on 10/04/2015.
 *
 * $.fn.keybase([action], options);
 *
 * var options = {
 *   baseUrl: "http://keybase.rbg.vic.gov.au/ws/keyJSON",
 *   ajaxDataType: "json",
 *   key: 2672,
 *   title: true,
 *   titleDiv: ".keybase-key-title",
 *   source: true,
 *   sourceDiv: ".keybase-key-source",
 *   cssClass: {
 *     currentNode: "keybase-player-currentnode",
 *     path: "keybase-player-path",
 *     remainingItems: "keybase-player-remainingitems",
 *     discardedItems: "keybase-player-discardeditems",
 *     stepBack: "keybase-player-stepback",
 *     startOver: "keybase-player-startover"
 *   },
 *   playerDiv: "#keybase-player",
 *   currentNodeDisplay: function(node, currentNodeDiv),
 *   discardedItemsDisplay: function(items, itemsDiv),
 *   pathDisplay: function(path, pathDiv),
 *   playerEvents: function(),
 *   playerWindow: function(),
 *   remainingItemsDisplay: function(items, itemsDiv),
 *   resultDisplay: function(result, resultDiv),
 *   renderItemLink: function(item)
 * };
 *
 * Possible actions are 'player', 'indentedKey' and 'bracketedKey'. Action is optional: if no action is given, 'player'
 * is assumed.
 *
 * There are default values for all options except 'key'. 'key' may also be replaced with a 'data' object, when another
 * web service or file is being used. When a file is used 'data' should be an empty object or not defined at all and
 * 'baseURL' should contain the entire path to the file. 'ajaxDataType' can be either 'json' (default) or 'jsonp'.
 */


;(function( $ ) {
    var json;
    var settings;
    var nested_sets;

    var rootNodeID;
    var next_id;
    //var nested_sets;
    var keyNodes;
    var current_node;

    var currentNodeElem;
    var pathElem;
    var remainingItemsElem;
    var discardedItemsElem;

    var filter_items;
    var filter_leads = [];
    var filter_parents = [];
    var filter_nodes = [];
    var activeFilter;

    var bracketed_key;
    var indented_key;
    var indentedKeyHtml;
    
    $.fn.keybase = function() {
        
        $.fn.keybase.getters = {
            jsonKey: function() { return json; },
            settings: function() { return settings; },
            nestedSets: function() { return nested_sets; },
            currentNode: function() { return current_node; },
            bracketedKey: function() { return bracketed_key; },
            indentedKey: function() { return indented_key; },
            filterItems: function() { return filter_items; },
            filterLeads: function() { return filter_leads; },
            filterParents: function() { return filter_parents; },
            filterNodes: function() { return filter_nodes; },
            keyNodes: function() { return keyNodes; }
        };
        

        var options;
        if (arguments.length === 1) {
            options = arguments[0];
        }

        var action;
        if (arguments.length === 2) {
            action = arguments[0];
            options = arguments[1];<commit_msg>Counter i for nestedSets function was a global variable, so I declared it inside the plug-in.<commit_after>/**
 * Copyright 2016, Atlas of Living Australia (ALA)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Version 1.0.0
 * 
 * Created by <NAME> on 10/04/2015.
 *
 * $.fn.keybase([action], options);
 *
 * var options = {
 *   baseUrl: "http://keybase.rbg.vic.gov.au/ws/keyJSON",
 *   ajaxDataType: "json",
 *   key: 2672,
 *   title: true,
 *   titleDiv: ".keybase-key-title",
 *   source: true,
 *   sourceDiv: ".keybase-key-source",
 *   cssClass: {
 *     currentNode: "keybase-player-currentnode",
 *     path: "keybase-player-path",
 *     remainingItems: "keybase-player-remainingitems",
 *     discardedItems: "keybase-player-discardeditems",
 *     stepBack: "keybase-player-stepback",
 *     startOver: "keybase-player-startover"
 *   },
 *   playerDiv: "#keybase-player",
 *   currentNodeDisplay: function(node, currentNodeDiv),
 *   discardedItemsDisplay: function(items, itemsDiv),
 *   pathDisplay: function(path, pathDiv),
 *   playerEvents: function(),
 *   playerWindow: function(),
 *   remainingItemsDisplay: function(items, itemsDiv),
 *   resultDisplay: function(result, resultDiv),
 *   renderItemLink: function(item)
 * };
 *
 * Possible actions are 'player', 'indentedKey' and 'bracketedKey'. Action is optional: if no action is given, 'player'
 * is assumed.
 *
 * There are default values for all options except 'key'. 'key' may also be replaced with a 'data' object, when another
 * web service or file is being used. When a file is used 'data' should be an empty object or not defined at all and
 * 'baseURL' should contain the entire path to the file. 'ajaxDataType' can be either 'json' (default) or 'jsonp'.
 */


;(function( $ ) {
    var json;
    var settings;
    var nested_sets;

    var rootNodeID;
    var next_id;
    //var nested_sets;
    var keyNodes;
    var current_node;

    var currentNodeElem;
    var pathElem;
    var remainingItemsElem;
    var discardedItemsElem;

    var filter_items;
    var filter_leads = [];
    var filter_parents = [];
    var filter_nodes = [];
    var activeFilter;

    var bracketed_key;
    var indented_key;
    var indentedKeyHtml;
    
    var i;
    
    $.fn.keybase = function() {
        
        $.fn.keybase.getters = {
            jsonKey: function() { return json; },
            settings: function() { return settings; },
            nestedSets: function() { return nested_sets; },
            currentNode: function() { return current_node; },
            bracketedKey: function() { return bracketed_key; },
            indentedKey: function() { return indented_key; },
            filterItems: function() { return filter_items; },
            filterLeads: function() { return filter_leads; },
            filterParents: function() { return filter_parents; },
            filterNodes: function() { return filter_nodes; },
            keyNodes: function() { return keyNodes; }
        };
        

        var options;
        if (arguments.length === 1) {
            options = arguments[0];
        }

        var action;
        if (arguments.length === 2) {
            action = arguments[0];
            options = arguments[1];
{'fraction_non_alphanumeric': 0.1148338286949473, 'fraction_numerical': 0.007565522831667117, 'mean_word_length': 2.8140133951571356, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7426922', 'n_tokens_mistral': 2163, 'n_tokens_neox': 2100, 'n_words': 676}