<commit_before>// VVVV.js -- Visual Webclient Programming
// (c) 2011 <NAME>
// VVVV.js is freely distributable under the MIT license.
// Additional authors of sub components are mentioned at the specific code locations.


// some prerequisites ...
$.ajaxPrefilter(function( options, originalOptions, jqXHR ) {
  if ( options.dataType == 'script' || originalOptions.dataType == 'script' ) {
      options.cache = true;
  }
});

if(!window.console) {
  window.console = {
    log : function(str) {
    }
  };
}

// actual VVVV.js initialization code
VVVV = {};

VVVV.onNotImplemented = function(nodename) {
  console.log("Warning: "+nodename+" is not implemented.");
};

/**
 * Adds the neccessary JavaScripts to the head, calls the callback once everything is in place.
 * @param {String} path_to_vvvv points to the folder of your vvvv.js. This is relative to your html-file
 * @param {String} mode. Can be either "full", "vvvviewer" or "run". Depends on what you want to do 
 * @param {Function} callback will be called once all the scripts and initialisations have been finished.
 */
VVVV.init = function (path_to_vvvv, mode, callback) {
  VVVV.Root = path_to_vvvv || './';
  VVVV.Nodes = {};
  VVVV.NodeLibrary = {};

  console.log('loading vvvv.js ...');

  var head = document.getElementsByTagName('head')[0];
  var loadCounter = 0;

  function loadMonitor(event) {
    event.target.removeEventListener('load', loadMonitor);
    if (--loadCounter <= 0) {
      initialisationComplete();
    };
  }

  function insertJS(url) {
    var script = document.createElement('script');
    script.async = false;
    script.src = VVVV.Root + url;
    script.addEventListener('load', loadMonitor);
    loadCounter++;
    head.appendChild(script);
  }

  if ($('script[src*=underscore]').length==0)
    insertJS('lib/underscore/underscore-min.js');
  if ($('script[src*="d3.js"]').length==0 && (mode=='full' || mode=='vvvviewer'))
    insertJS('lib/d3-v1.14/d3.min.js');
  if ($('script[src*=glMatrix]').length==0 && (mode=='full' || mode=='run'))
    insertJS('lib/glMatrix-0.9.5.min.js');

  if ($('script[src*="vvvv.core.js"]').length==0) {
    insertJS('core/vvvv.core.js');
    insertJS('core/vvvv.core.vvvvconnector.js');
    if (mode=='run' || mode=='full') {
      insertJS('mainloop/vvvv.mainloop.js');
      insertJS('mainloop/vvvv.dominterface.js');

      insertJS('nodes/vvvv.nodes.value.js');
      insertJS('nodes/vvvv.nodes.string.js');
      insertJS('nodes/vvvv.nodes.boolean.js');
      insertJS('nodes/vvvv.nodes.color.js');
      insertJS('nodes/vvvv.nodes.spreads.js');
      insertJS('nodes/vvvv.nodes.animation.js');<commit_msg>adds / to script URL in insertJS, just to be safe<commit_after>// VVVV.js -- Visual Webclient Programming
// (c) 2011 <NAME>
// VVVV.js is freely distributable under the MIT license.
// Additional authors of sub components are mentioned at the specific code locations.


// some prerequisites ...
$.ajaxPrefilter(function( options, originalOptions, jqXHR ) {
  if ( options.dataType == 'script' || originalOptions.dataType == 'script' ) {
      options.cache = true;
  }
});

if(!window.console) {
  window.console = {
    log : function(str) {
    }
  };
}

// actual VVVV.js initialization code
VVVV = {};

VVVV.onNotImplemented = function(nodename) {
  console.log("Warning: "+nodename+" is not implemented.");
};

/**
 * Adds the neccessary JavaScripts to the head, calls the callback once everything is in place.
 * @param {String} path_to_vvvv points to the folder of your vvvv.js. This is relative to your html-file
 * @param {String} mode. Can be either "full", "vvvviewer" or "run". Depends on what you want to do 
 * @param {Function} callback will be called once all the scripts and initialisations have been finished.
 */
VVVV.init = function (path_to_vvvv, mode, callback) {
  VVVV.Root = path_to_vvvv || './';
  VVVV.Nodes = {};
  VVVV.NodeLibrary = {};

  console.log('loading vvvv.js ...');

  var head = document.getElementsByTagName('head')[0];
  var loadCounter = 0;

  function loadMonitor(event) {
    event.target.removeEventListener('load', loadMonitor);
    if (--loadCounter <= 0) {
      initialisationComplete();
    };
  }

  function insertJS(url) {
    var script = document.createElement('script');
    script.async = false;
    script.src = VVVV.Root + '/' +url;
    script.addEventListener('load', loadMonitor);
    loadCounter++;
    head.appendChild(script);
  }

  if ($('script[src*=underscore]').length==0)
    insertJS('lib/underscore/underscore-min.js');
  if ($('script[src*="d3.js"]').length==0 && (mode=='full' || mode=='vvvviewer'))
    insertJS('lib/d3-v1.14/d3.min.js');
  if ($('script[src*=glMatrix]').length==0 && (mode=='full' || mode=='run'))
    insertJS('lib/glMatrix-0.9.5.min.js');

  if ($('script[src*="vvvv.core.js"]').length==0) {
    insertJS('core/vvvv.core.js');
    insertJS('core/vvvv.core.vvvvconnector.js');
    if (mode=='run' || mode=='full') {
      insertJS('mainloop/vvvv.mainloop.js');
      insertJS('mainloop/vvvv.dominterface.js');

      insertJS('nodes/vvvv.nodes.value.js');
      insertJS('nodes/vvvv.nodes.string.js');
      insertJS('nodes/vvvv.nodes.boolean.js');
      insertJS('nodes/vvvv.nodes.color.js');
      insertJS('nodes/vvvv.nodes.spreads.js');
      insertJS('nodes/vvvv.nodes.animation.js');
{'fraction_non_alphanumeric': 0.1729506659163384, 'fraction_numerical': 0.007503282686175202, 'mean_word_length': 3.7019400352733687, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '3411015', 'n_tokens_mistral': 1841, 'n_tokens_neox': 1744, 'n_words': 382}