<commit_before>'use strict';

var exampleDoc = require('../simple/exampleDoc');
var MessageQueue = require('substance/util/MessageQueue');
var CollabSession = require('substance/model/CollabSession');
var StubHub = require('substance/util/StubHub');
var Component = require('substance/ui/Component');
var SplitPane = require('substance/ui/SplitPane');
var Editor = require('../simple/Editor');
var $$ = Component.$$;

function TwoEditors() {
  TwoEditors.super.apply(this, arguments);
}

TwoEditors.Prototype = function() {

  this.render = function() {
    var el = $$('div').addClass('sc-two-editors');
    el.append(
      $$(SplitPane, {
          splitType: 'vertical',
          sizeA: '50%'
        }).append(
        $$(Editor, {documentSession: this.props.session1}).ref('left').addClass('left-editor'),
        $$(Editor, {documentSession: this.props.session2}).ref('right')
      )
    );
    return el;
  };
};

Component.extend(TwoEditors);

window.onload = function() {
  var messageQueue = new MessageQueue();

  // Two edited docs, one doc instance on the hub all with the same contents,
  // now we start synchronizing them.

  var doc1 = exampleDoc();
  var doc2 = exampleDoc();
  var hubDoc = exampleDoc();
  
  var hub = new StubHub(hubDoc, messageQueue);

  // Create two CollabSessions for the same doc
  var session1 = new CollabSession(doc1, {messageQueue: messageQueue});
  // var session2 = new CollabSession(doc2, {messageQueue: messageQueue});
  // TwoEditors.static.mount({
  //   session1: session1,
  //   session2: session2
  // }, 'body');
};<commit_msg>Reactivate UI for Collabwriter example.<commit_after>'use strict';

var exampleDoc = require('../simple/exampleDoc');
var MessageQueue = require('substance/util/MessageQueue');
var CollabSession = require('substance/model/CollabSession');
var StubHub = require('substance/util/StubHub');
var Component = require('substance/ui/Component');
var SplitPane = require('substance/ui/SplitPane');
var Editor = require('../simple/Editor');
var $$ = Component.$$;

function TwoEditors() {
  TwoEditors.super.apply(this, arguments);
}

TwoEditors.Prototype = function() {

  this.render = function() {
    var el = $$('div').addClass('sc-two-editors');
    el.append(
      $$(SplitPane, {
          splitType: 'vertical',
          sizeA: '50%'
        }).append(
        $$(Editor, {documentSession: this.props.session1}).ref('left').addClass('left-editor'),
        $$(Editor, {documentSession: this.props.session2}).ref('right')
      )
    );
    return el;
  };
};

Component.extend(TwoEditors);

window.onload = function() {
  var messageQueue = new MessageQueue();

  // Two edited docs, one doc instance on the hub all with the same contents,
  // now we start synchronizing them.

  var doc1 = exampleDoc();
  var doc2 = exampleDoc();
  var hubDoc = exampleDoc();
  
  var hub = new StubHub(hubDoc, messageQueue);

  // Create two CollabSessions for the same doc
  var session1 = new CollabSession(doc1, {messageQueue: messageQueue});
  var session2 = new CollabSession(doc2, {messageQueue: messageQueue});
  
  TwoEditors.static.mount({
    session1: session1,
    session2: session2
  }, 'body');
};
{'fraction_non_alphanumeric': 0.15526976160602257, 'fraction_numerical': 0.00878293601003764, 'mean_word_length': 3.8172205438066467, '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': '4849901', 'n_tokens_mistral': 977, 'n_tokens_neox': 966, 'n_words': 236}