<commit_before>/** @jsx React.DOM */

var MindEditor = React.createClass( {
	dragBlobId: null,
	getInitialState: function() {
		window.editor = this;
		if ( typeof( Storage ) == "undefined" ) {
			console.log( "Browser does not support localstorage." );
		}
		if ( typeof( Storage ) !== "undefined" && localStorage.getItem( "mindEditor.blobs" ) ) {
			return { 
				blobs: JSON.parse( localStorage.getItem( "mindEditor.blobs" ) ), 
				nextBlobId: JSON.parse( localStorage.getItem( "mindEditor.nextBlobId" ) ) 
			};
		}
		else {
			var intro = "Welcome to MindEdit! Click anywhere to start writing.\n\n";
			if ( typeof( Storage ) !== "undefined" ) {
				intro += "Your browser supports localStorage. Great!\nYour text will be automatically saved on your browser.\n";
			}
			else {
				intro += "Your browser does not support localStorage.\nYour text will be lost after you reload or leave this page.\n";
			}
			return { 
				blobs: {
					0: {
						x: 100,
						y: 100,
						text: intro
					}
				},
				nextBlobId: 1
			}
		}
	},
	componentWillUpdate: function() {
		if ( typeof( Storage ) !== "undefined" ) {
			localStorage.setItem( "mindEditor.blobs", JSON.stringify( this.state.blobs ) );
			localStorage.setItem( "mindEditor.nextBlobId", JSON.stringify( this.state.nextBlobId ) );
		}
	},<commit_msg>fix: make intro blob movable<commit_after>/** @jsx React.DOM */

var MindEditor = React.createClass( {
	dragBlobId: null,
	getInitialState: function() {
		window.editor = this;
		if ( typeof( Storage ) == "undefined" ) {
			console.log( "Browser does not support localstorage." );
		}
		if ( typeof( Storage ) !== "undefined" && localStorage.getItem( "mindEditor.blobs" ) ) {
			return { 
				blobs: JSON.parse( localStorage.getItem( "mindEditor.blobs" ) ), 
				nextBlobId: JSON.parse( localStorage.getItem( "mindEditor.nextBlobId" ) ) 
			};
		}
		else {
			var intro = "Welcome to MindEdit! Click anywhere to start writing.\n\n";
			if ( typeof( Storage ) !== "undefined" ) {
				intro += "Your browser supports localStorage. Great!\nYour text will be automatically saved on your browser.\n";
			}
			else {
				intro += "Your browser does not support localStorage.\nYour text will be lost after you reload or leave this page.\n";
			}
			return { 
				blobs: {
					0: {
						id: 0,
						x: 100,
						y: 100,
						text: intro
					}
				},
				nextBlobId: 1
			}
		}
	},
	componentWillUpdate: function() {
		if ( typeof( Storage ) !== "undefined" ) {
			localStorage.setItem( "mindEditor.blobs", JSON.stringify( this.state.blobs ) );
			localStorage.setItem( "mindEditor.nextBlobId", JSON.stringify( this.state.nextBlobId ) );
		}
	},
{'fraction_non_alphanumeric': 0.1404367469879518, 'fraction_numerical': 0.006400602409638554, 'mean_word_length': 3.031866464339909, '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': '7441292', 'n_tokens_mistral': 1031, 'n_tokens_neox': 853, 'n_words': 226}