<commit_before>/**
* COMPONENT_IMAGE
*
*
*/
var component_image = new function() {

	"use strict";

	this.url_trigger 	= DEDALO_LIB_BASE_URL + '/component_image/trigger.component_image.php'
	this.related_tipo  	= null
	this.buttonsLoaded 	= false

	var currentPaper

	var cuadrado
	var	circulo
	var	puntero
	var	anadido
	var	vectores
	var	toolZoom
	var	salvar

	var canvas_obj, context, canX, canY, canXold=0, canYold=0, mouseIsDown=0, len=0;
	var segment, path, handle, handle_sync, movePath;
	var node = [];	
	var ar_tag_loaded = []
	var movePath = false;	
	var types = ['point', 'handleIn', 'handleOut'];
	var currentSegment, mode, type;
	var hitOptions = {
		segments: true,
		stroke: true,
		fill: true,
		tolerance: 5
	}



	/**
	* INIT
	* @return 
	*/
	this.init = function(options) {
		
		const self = this	
	
		switch(page_globals.modo) {

			case 'tool_transcription':
				break;
			case 'edit':
				if (options.init_mode==="read") {
					const load_image_read = common.load_script(DEDALO_LIB_BASE_URL + '/component_image/js/component_image_read.js', {"async":true})
					const load_paper 		= common.load_script(PAPER_JS_URL, {"async":true})														
					Promise.all([load_image_read, load_paper]).then(function() {
						setTimeout(function(){
							component_image_read.init(options);
						},150)					  
					});
					
				}
				break;
			case 'list':
				$(function() {
					// Remove background spinner in image container
					$('img.thumb_in_list').on('load', function(){
						$(this).parent('.div_image_image_in_list').css({backgroundImage:'none'});
						//if(SHOW_DEBUG===true) console.log('new image loaded: ' + this.src);
					})
				});
				break;
		}
		

		return true
	};//end init

<commit_msg>Set options.init_mode read mode insensible to global modo<commit_after>/**
* COMPONENT_IMAGE
*
*
*/
var component_image = new function() {

	"use strict";

	this.url_trigger 	= DEDALO_LIB_BASE_URL + '/component_image/trigger.component_image.php'
	this.related_tipo  	= null
	this.buttonsLoaded 	= false

	var currentPaper

	var cuadrado
	var	circulo
	var	puntero
	var	anadido
	var	vectores
	var	toolZoom
	var	salvar

	var canvas_obj, context, canX, canY, canXold=0, canYold=0, mouseIsDown=0, len=0;
	var segment, path, handle, handle_sync, movePath;
	var node = [];	
	var ar_tag_loaded = []
	var movePath = false;	
	var types = ['point', 'handleIn', 'handleOut'];
	var currentSegment, mode, type;
	var hitOptions = {
		segments: true,
		stroke: true,
		fill: true,
		tolerance: 5
	}



	/**
	* INIT
	* @return 
	*/
	this.init = function(options) {
		
		const self = this
	
		switch(page_globals.modo) {

			case 'tool_transcription':
				break;
			case 'tool_image_versions':
			case 'edit':
				break;
			case 'list':
				$(function() {
					// Remove background spinner in image container
					$('img.thumb_in_list').on('load', function(){
						$(this).parent('.div_image_image_in_list').css({backgroundImage:'none'});
						//if(SHOW_DEBUG===true) console.log('new image loaded: ' + this.src);
					})
				});
				break;
		}

		if (options.init_mode==="read") {
			const load_image_read = common.load_script(DEDALO_LIB_BASE_URL + '/component_image/js/component_image_read.js', {"async":true})
			const load_paper 	  = common.load_script(PAPER_JS_URL, {"async":true})
			Promise.all([load_image_read, load_paper]).then(function() {
				setTimeout(function(){
					component_image_read.init(options);
				},150)
			});
		}
		

		return true
	};//end init


{'fraction_non_alphanumeric': 0.13830703012912482, 'fraction_numerical': 0.004591104734576757, 'mean_word_length': 3.4922680412371134, 'pattern_counts': {'":': 4, '<': 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': '1880960', 'n_tokens_mistral': 1480, 'n_tokens_neox': 1247, 'n_words': 257}