<commit_before>/**
 * エディタ全体の管理
 */
var EditorList = function () {
	/**
	 * Viewerごとのエディタのインスタンスを保持するリスト
	 * @type {Array}
	 */
	this.editorList = [];
}
EditorList.prototype = {
	/**
	 * 初期化
	 */
	init: function () {
		var changeTargetTab = null;

		// 言語が変更されたら反映＆メンバーに送信
		$(document).on('change', '#changeTabMode', function (e) {
			if (!changeTargetTab) return cancelEvent(e);
			var mode = $(this).val();

			changeTargetTab.applyData({
				mode: mode
			}).send({
				text: changeTargetTab.getText(),
				mode: mode
			}).editor.focus();

		// タブが右クリックされたら言語選択プルダウンを表示
		}).on('contextmenu', '.tab-item', function (e) {
			var viewerId = $(this).parents('.editor-root').attr('id');
			var tabName = $(this).data('tab-name');
			changeTargetTab = editorList.get(viewerId).changeActiveTab(tabName);

			if (changeTargetTab.isSelf) {
				// 初期値代入
				$(document.getElementById('changeTabMode')).val(changeTargetTab.getState().mode);
			} else {
				return cancelEvent(e);
			}
		});

		$.contextMenu({
			selector: '#' + getMyViewerId() + ' .tab-item',
			items: {
				changeTabMode: {
					name: '言語設定<select id="changeTabMode" class="form-control"><option value="abap">ABAP</option><option value="actionscript">ActionScript</option><option value="c_cpp">C++</option><option value="c_cpp">C</option><option value="cobol">COBOL</option><option value="coffee">CoffeeScript</option><option value="csharp">C#</option><option value="css">CSS</option><option value="clojure">Clojure</option><option value="d">D</option><option value="dart">Dart</option><option value="erlang">Erlang</option><option value="forth">Forth</option><option value="golang">Go</option><option value="groovy">Groovy</option><option value="haskell">Haskell</option><option value="haxe">Haxe</option><option value="java">Java</option><option value="javascript">JavaScript</option><option value="jsx">JSX</option><option value="lisp">Lisp</option><option value="lsl">LSL</option><option value="lua">Lua</option><option value="matlab">MATLAB</option><option value="mysql">MySQL</option><option value="objectivec">Objective-C</option><option value="markdown">Markdown</option><option value="ocaml">OCaml</option><option value="pascal">Pascal</option><option value="perl">Perl</option><option value="php">PHP</option><option value="plain_text">Plain Text</option><option value="prolog">Prolog</option><option value="python">Python</option><option value="r">R</option><option value="ruby">Ruby</option><option value="rust">Rust</option><option value="scala">Scala</option><option value="scheme">Scheme</option><option value="sh">ShellScript</option><option value="latex">LaTeX</option><option value="typescript">TypeScript</option><option value="vbscript">VBScript</option><option value="verilog">Verilog</option><option value="assembly_x86">Assembly x86</option><option value="xml">XML</option><option value="xquery">XQuery</option></select>',
					callback: function(e){
						return false;
					}
				}
			}
		});
	},


	/**
	 * Editor追加 (Viewer一人につき一つのエディタ)
	 * @param {String} viewerId
	 */
	add: function (viewerId) {
		this.editorList[viewerId] = new Editor(viewerId, 4).hide();
	},


	/**
	 * Editor削除
	 * @param {String} viewerId
	 */
	remove: function (viewerId) {
		for (var id in this.editorList) {
			if (this.editorList[id] !== viewerId) {
				continue;
			}
			this.editorList[id].remove();
			delete this.editorList[id];
			break;
		}
	},


	/**
	 * 表示エディタを切り替える
	 * @param  {String} viewerId
	 */
	changeViewingEditor: function (viewerId) {
		if (void 0 === this.editorList[viewerId]) {
			console.warn("ユーザー '" + viewerId + "' が存在しません");
			return;
		}
		for (var id in this.editorList) {
			this.editorList[id].hide();
		}
		this.editorList[viewerId].show();
	},


	/**
	 * ViewerのEditorインスタンスを取得。存在しなければ追加する
	 * @param  {String} viewerId 
	 * @return {Editor} 該当ViewerのEditorインスタンス
	 */
	get: function (viewerId) {
		if (void 0 === this.editorList[viewerId]) {<commit_msg>エディタ削除ロジックをシンプルに。<commit_after>/**
 * エディタ全体の管理
 */
var EditorList = function () {
	/**
	 * Viewerごとのエディタのインスタンスを保持するリスト
	 * @type {Array}
	 */
	this.editorList = [];
}
EditorList.prototype = {
	/**
	 * 初期化
	 */
	init: function () {
		var changeTargetTab = null;

		// 言語が変更されたら反映＆メンバーに送信
		$(document).on('change', '#changeTabMode', function (e) {
			if (!changeTargetTab) return cancelEvent(e);
			var mode = $(this).val();

			changeTargetTab.applyData({
				mode: mode
			}).send({
				text: changeTargetTab.getText(),
				mode: mode
			}).editor.focus();

		// タブが右クリックされたら言語選択プルダウンを表示
		}).on('contextmenu', '.tab-item', function (e) {
			var viewerId = $(this).parents('.editor-root').attr('id');
			var tabName = $(this).data('tab-name');
			changeTargetTab = editorList.get(viewerId).changeActiveTab(tabName);

			if (changeTargetTab.isSelf) {
				// 初期値代入
				$(document.getElementById('changeTabMode')).val(changeTargetTab.getState().mode);
			} else {
				return cancelEvent(e);
			}
		});

		$.contextMenu({
			selector: '#' + getMyViewerId() + ' .tab-item',
			items: {
				changeTabMode: {
					name: '言語設定<select id="changeTabMode" class="form-control"><option value="abap">ABAP</option><option value="actionscript">ActionScript</option><option value="c_cpp">C++</option><option value="c_cpp">C</option><option value="cobol">COBOL</option><option value="coffee">CoffeeScript</option><option value="csharp">C#</option><option value="css">CSS</option><option value="clojure">Clojure</option><option value="d">D</option><option value="dart">Dart</option><option value="erlang">Erlang</option><option value="forth">Forth</option><option value="golang">Go</option><option value="groovy">Groovy</option><option value="haskell">Haskell</option><option value="haxe">Haxe</option><option value="java">Java</option><option value="javascript">JavaScript</option><option value="jsx">JSX</option><option value="lisp">Lisp</option><option value="lsl">LSL</option><option value="lua">Lua</option><option value="matlab">MATLAB</option><option value="mysql">MySQL</option><option value="objectivec">Objective-C</option><option value="markdown">Markdown</option><option value="ocaml">OCaml</option><option value="pascal">Pascal</option><option value="perl">Perl</option><option value="php">PHP</option><option value="plain_text">Plain Text</option><option value="prolog">Prolog</option><option value="python">Python</option><option value="r">R</option><option value="ruby">Ruby</option><option value="rust">Rust</option><option value="scala">Scala</option><option value="scheme">Scheme</option><option value="sh">ShellScript</option><option value="latex">LaTeX</option><option value="typescript">TypeScript</option><option value="vbscript">VBScript</option><option value="verilog">Verilog</option><option value="assembly_x86">Assembly x86</option><option value="xml">XML</option><option value="xquery">XQuery</option></select>',
					callback: function(e){
						return false;
					}
				}
			}
		});
	},


	/**
	 * Editor追加 (Viewer一人につき一つのエディタ)
	 * @param {String} viewerId
	 */
	add: function (viewerId) {
		this.editorList[viewerId] = new Editor(viewerId, 4).hide();
	},


	/**
	 * Editor削除
	 * @param {String} viewerId
	 */
	remove: function (viewerId) {
		if (!(viewerId) in this.editorList) return;
		
		this.editorList[viewerId].remove();
		delete this.editorList[viewerId];
	},


	/**
	 * 表示エディタを切り替える
	 * @param  {String} viewerId
	 */
	changeViewingEditor: function (viewerId) {
		if (void 0 === this.editorList[viewerId]) {
			console.warn("ユーザー '" + viewerId + "' が存在しません");
			return;
		}
		for (var id in this.editorList) {
			this.editorList[id].hide();
		}
		this.editorList[viewerId].show();
	},


	/**
	 * ViewerのEditorインスタンスを取得。存在しなければ追加する
	 * @param  {String} viewerId 
	 * @return {Editor} 該当ViewerのEditorインスタンス
	 */
	get: function (viewerId) {
		if (void 0 === this.editorList[viewerId]) {
{'fraction_non_alphanumeric': 0.19486462438032287, 'fraction_numerical': 0.0017795856107792043, 'mean_word_length': 5.545757071547421, 'pattern_counts': {'":': 0, '<': 195, '<?xml version=': 0, '>': 195, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3273229', 'n_tokens_mistral': 3084, 'n_tokens_neox': 2767, 'n_words': 371}