<commit_before>﻿window.cls || (window.cls = {});
cls.debug || (cls.debug = {});

cls.debug.wrap_transmit = function()
{
  opera._debug_wrap_scopeTransmit = opera.scopeTransmit;
  opera.scopeTransmit = function(service, message, command, tag)
  {
    window.debug.log_transmit(service, message, command, tag);
    opera._debug_wrap_scopeTransmit(service, message, command, tag);
  };
  cls.debug.wrap_transmit = function(){};
}

cls.debug.create_debug_environment = function(params)
{
  window.ini.debug = true;
  window.cls.TestFramework.prototype = ViewBase;
  cls.debug.Debug.prototype =
  window.cls.debug.TestScopeMessages.prototype =
  new window.cls.TestFramework();
  window.debug = new cls.debug.Debug('debug', 'Debug', 'scroll debug-container');
  new cls.debug.ConfigureMessageFilters(
    'configure-message-filters', 'Message Filters', 'scroll filter-container');
  var test_messages = new cls.debug.TestScopeMessages(
    'test-messages', 'Test Messages', 'scroll test-messages');
  eventHandlers.click['test-messages'] = test_messages.get_bound_click_handler();
  eventHandlers.change['test-messages'] = test_messages.get_bound_change_handler();
  new CompositeView('debug_new', 'Debug', {
      dir: 'v', width: 700, height: 700,
      children:
      [
        { height: 200, tabs: ['debug', 'test-messages'] }
      ]
    });

  new Settings
  (
    // id
    'debug',
    // kel-value map
    {
      'show-as-tab': true,
      'pretty-print-messages': true
    },
    // key-label map
    {
      'show-as-tab': 'Show view in a tab',
      'pretty-print-messages': "Pretty print the scope messages",
    },
    // settings map
    {
      checkboxes:
      [

      ]
    }
  );
  new ToolbarConfig
  (
    'debug',
    [
      {
        handler: 'debug-clear-log',
        title: 'Clear debug log'
      },
      {
        handler: 'configure-message-filters',
        title: 'Configure Message Filters'
      },
      {
        handler: 'reload-dragonfly',
        title: 'Reload Dragonfly'
      }
    ]
  )
  new Switches
  (
    'debug',
    [
      'pretty-print-messages',
    ]
  );

  eventHandlers.click['reload-dragonfly'] = function(event, target)
  {
    window.location.reload();
  }

  eventHandlers.click['debug-clear-log'] = function(event, target)
  {
    window.debug.clear_log();
  }<commit_msg>Added button to debug view that replaces all ui strings with the ui string label, to make it easier to find non-translated stuff<commit_after>﻿window.cls || (window.cls = {});
cls.debug || (cls.debug = {});

cls.debug.wrap_transmit = function()
{
  opera._debug_wrap_scopeTransmit = opera.scopeTransmit;
  opera.scopeTransmit = function(service, message, command, tag)
  {
    window.debug.log_transmit(service, message, command, tag);
    opera._debug_wrap_scopeTransmit(service, message, command, tag);
  };
  cls.debug.wrap_transmit = function(){};
}

cls.debug.create_debug_environment = function(params)
{
  window.ini.debug = true;
  window.cls.TestFramework.prototype = ViewBase;
  cls.debug.Debug.prototype =
  window.cls.debug.TestScopeMessages.prototype =
  new window.cls.TestFramework();
  window.debug = new cls.debug.Debug('debug', 'Debug', 'scroll debug-container');
  new cls.debug.ConfigureMessageFilters(
    'configure-message-filters', 'Message Filters', 'scroll filter-container');
  var test_messages = new cls.debug.TestScopeMessages(
    'test-messages', 'Test Messages', 'scroll test-messages');
  eventHandlers.click['test-messages'] = test_messages.get_bound_click_handler();
  eventHandlers.change['test-messages'] = test_messages.get_bound_change_handler();
  new CompositeView('debug_new', 'Debug', {
      dir: 'v', width: 700, height: 700,
      children:
      [
        { height: 200, tabs: ['debug', 'test-messages'] }
      ]
    });

  new Settings
  (
    // id
    'debug',
    // kel-value map
    {
      'show-as-tab': true,
      'pretty-print-messages': true
    },
    // key-label map
    {
      'show-as-tab': 'Show view in a tab',
      'pretty-print-messages': "Pretty print the scope messages",
    },
    // settings map
    {
      checkboxes:
      [

      ]
    }
  );
  new ToolbarConfig
  (
    'debug',
    [
      {
        handler: 'debug-clear-log',
        title: 'Clear debug log'
      },
      {
        handler: 'configure-message-filters',
        title: 'Configure Message Filters'
      },
      {
        handler: 'reload-dragonfly',
        title: 'Reload Dragonfly'
      },
      {
        handler: 'find-strings',
        title: 'Find untranslated strings'
      }
    ]
  )
  new Switches
  (
    'debug',
    [
      'pretty-print-messages',
    ]
  );

  eventHandlers.click['find-strings'] = function(event, target)
  {
    for (key in window.ui_strings) {
      window.ui_strings[key] = "# " + key + " #";
    }
    client.setup();
  }

  eventHandlers.click['reload-dragonfly'] = function(event, target)
  {
    window.location.reload();
  }

  eventHandlers.click['debug-clear-log'] = function(event, target)
  {
    window.debug.clear_log();
  }
{'fraction_non_alphanumeric': 0.14559462662979059, 'fraction_numerical': 0.0035559067562228367, 'mean_word_length': 2.8096313017306245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1326312', 'n_tokens_mistral': 1655, 'n_tokens_neox': 1633, 'n_words': 304}