<commit_before>/*
 * ext-imagelib.js
 *
 * Licensed under the Apache License, Version 2
 *
 * Copyright(c) 2010 <NAME>
 *
 */

svgEditor.addExtension("imagelib", function() {

	var uiStrings = svgEditor.uiStrings;

	var img_libs = [{
			name: 'Demo library (local)',
			url: 'extensions/imagelib/index.html',
			description: 'Demonstration library for SVG-edit on this server'
		}, 
		{
			name: 'IAN Symbol Libraries',
			url: 'http://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php',
			description: 'Free library of illustrations'
		}
	];
	
	var xlinkns = "http://www.w3.org/1999/xlink";

	function closeBrowser() {
		$('#imgbrowse_holder').hide();
	}
	
	function importImage(url) {
		var newImage = svgCanvas.addSvgElementFromJson({
			"element": "image",
			"attr": {<commit_msg>Fixed image library regression<commit_after>/*
 * ext-imagelib.js
 *
 * Licensed under the Apache License, Version 2
 *
 * Copyright(c) 2010 <NAME>
 *
 */

svgEditor.addExtension("imagelib", function() {

	var uiStrings = svgEditor.uiStrings;
	
	$.extend(uiStrings, {
		imagelib: {
			select_lib: 'Select an image library',
			show_list: 'Show library list',
			import_single: 'Import single',
			import_multi: 'Import multiple',
			open: 'Open as new document'
		}
	});

	var img_libs = [{
			name: 'Demo library (local)',
			url: 'extensions/imagelib/index.html',
			description: 'Demonstration library for SVG-edit on this server'
		}, 
		{
			name: 'IAN Symbol Libraries',
			url: 'http://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php',
			description: 'Free library of illustrations'
		}
	];
	
	var xlinkns = "http://www.w3.org/1999/xlink";

	function closeBrowser() {
		$('#imgbrowse_holder').hide();
	}
	
	function importImage(url) {
		var newImage = svgCanvas.addSvgElementFromJson({
			"element": "image",
			"attr": {
{'fraction_non_alphanumeric': 0.14762165117550574, 'fraction_numerical': 0.010934937124111536, 'mean_word_length': 3.8412698412698414, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '106210', 'n_tokens_mistral': 720, 'n_tokens_neox': 620, 'n_words': 141}