<commit_before><link rel="import" href="../polymer/polymer.html">

<!--

Small behaviour for Polymer elements that will ensure that they are registered for


-->

<script>

if( typeof Hotplate == 'undefined' ) Hotplate = {};

Hotplate.HotWsBehavior = {

  properties: {

    wsData: {
      type: Object,
      value: Hotplate.cometClient.data,
      readOnly: true,
    },

    wsMethods: {
      type: Object,
      value: Hotplate.cometClient,
      readOnly: true,
    },

    ajaxElementId: {
      type: String
    },

  },

  wsReset: function(){
    if( ! this.ajaxElementId ) return;
    var aj = this.$[ this.ajaxElementId ];
    if( aj ){
      aj.generateRequest();
    }
  },

  wsOpen: function(){
    Hotplate.cometClient.open();
  },

  wsClose: function(){
    Hotplate.cometClient.close();
  },

  // Function to be overridden by element to receive messages
  wsMessage: function( message ){
  },

  /* Methods wrapping */

  wsSendLocal: function( message ){
    if( this.wsMethods ) this.wsMethods.sendLocal( message );
  },

  wsSendWs: function( message ){
    if( this.wsMethods ) this.wsMethods.sendWs( message );
  },


  attached: function() {
    this.wsMethods.addSubscriber( this );<commit_msg>Using element's 'refresh' call to refresh now<commit_after><link rel="import" href="../polymer/polymer.html">

<!--

Small behaviour for Polymer elements that will ensure that they are registered for


-->

<script>

if( typeof Hotplate == 'undefined' ) Hotplate = {};

Hotplate.HotWsBehavior = {

  properties: {

    wsData: {
      type: Object,
      value: Hotplate.cometClient.data,
      readOnly: true,
    },

    wsMethods: {
      type: Object,
      value: Hotplate.cometClient,
      readOnly: true,
    },

/*
    ajaxElementId: {
      type: String
    },
*/

  },

  // A 'reset' will trigger 'refresh' in live elements
  wsReset: function(){
    if( this.refresh) this.refresh();

    /*
    if( ! this.ajaxElementId ) return;
    var aj = this.$[ this.ajaxElementId ];
    if( aj ){
      aj.generateRequest();
    }
    */
  },

  wsOpen: function(){
    Hotplate.cometClient.open();
  },

  wsClose: function(){
    Hotplate.cometClient.close();
  },

  // Function to be overridden by element to receive messages
  wsMessage: function( message ){
  },

  /* Methods wrapping */

  wsSendLocal: function( message ){
    if( this.wsMethods ) this.wsMethods.sendLocal( message );
  },

  wsSendWs: function( message ){
    if( this.wsMethods ) this.wsMethods.sendWs( message );
  },


  attached: function() {
    this.wsMethods.addSubscriber( this );
{'fraction_non_alphanumeric': 0.1381172839506173, 'fraction_numerical': 0.0, 'mean_word_length': 2.7148997134670485, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1161685', 'n_tokens_mistral': 877, 'n_tokens_neox': 797, 'n_words': 199}