<commit_before>package uk.co.plogic.gwt.lib.ui.activatedElements;

import java.util.logging.Logger;

import uk.co.plogic.gwt.lib.dom.DomElementByAttributeFinder;
import uk.co.plogic.gwt.lib.dom.DomParser;
import uk.co.plogic.gwt.lib.ui.UrlScraper;

import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;


/**
 * 
 * Take an element like this-
 * <div id="share_map" class="map_canvas_overlay_top" alt="Share map">
 * 		<img src="media/images/share.png" style="width:16px; height:18px;"></img>
 * </div>
 * from the DOM and make it into a share widget.
 * 
 * Assumes bootstrap for the Ok button and uses .share_panel_open and .map_canvas_overlay_top
 * classes.
 * 
 * @author si
 *
 */
public class ShareMap {

	final Logger logger = Logger.getLogger("ShareMap");
	boolean panelOpen = false;
	FlowPanel holdingPanel;
	FlowPanel closedPanel;
	FlowPanel openPanel;
	TextBox urlTextBox;
	UrlScraper urlScraper;

	/**
	 * 
	 * @param className 
	 */
	public ShareMap(DomParser domParser, final UrlScraper urlScraper, final String elementID) {

		this.urlScraper = urlScraper;
	    domParser.addHandler(new DomElementByAttributeFinder("id", elementID) {

	        @Override
	        public void onDomElementFound(Element element, String id) {
	        	setup(element);
	        	hideSharePanel();
	        }
	    });
	}

	private void setup(Element element) {

		RootPanel panel = RootPanel.get(element.getId());
		String originalTagContents = element.getInnerHTML();
		element.setInnerHTML("");

		holdingPanel = new FlowPanel();
		panel.add(holdingPanel);
<commit_msg>refactor: renaming<commit_after>package uk.co.plogic.gwt.lib.ui.activatedElements;

import java.util.logging.Logger;

import uk.co.plogic.gwt.lib.dom.DomElementByAttributeFinder;
import uk.co.plogic.gwt.lib.dom.DomParser;
import uk.co.plogic.gwt.lib.ui.ShareUrl;

import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;


/**
 * 
 * Take an element like this-
 * <div id="share_map" class="map_canvas_overlay_top" alt="Share map">
 * 		<img src="media/images/share.png" style="width:16px; height:18px;"></img>
 * </div>
 * from the DOM and make it into a share widget.
 * 
 * Assumes bootstrap for the Ok button and uses .share_panel_open and .map_canvas_overlay_top
 * classes.
 * 
 * @author si
 *
 */
public class ShareMap {

	final Logger logger = Logger.getLogger("ShareMap");
	boolean panelOpen = false;
	FlowPanel holdingPanel;
	FlowPanel closedPanel;
	FlowPanel openPanel;
	TextBox urlTextBox;
	ShareUrl urlScraper;

	/**
	 * 
	 * @param className 
	 */
	public ShareMap(DomParser domParser, final ShareUrl urlScraper, final String elementID) {

		this.urlScraper = urlScraper;
	    domParser.addHandler(new DomElementByAttributeFinder("id", elementID) {

	        @Override
	        public void onDomElementFound(Element element, String id) {
	        	setup(element);
	        	hideSharePanel();
	        }
	    });
	}

	private void setup(Element element) {

		RootPanel panel = RootPanel.get(element.getId());
		String originalTagContents = element.getInnerHTML();
		element.setInnerHTML("");

		holdingPanel = new FlowPanel();
		panel.add(holdingPanel);

{'fraction_non_alphanumeric': 0.12211920529801325, 'fraction_numerical': 0.002119205298013245, 'mean_word_length': 4.075268817204301, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6958808', 'n_tokens_mistral': 1314, 'n_tokens_neox': 1249, 'n_words': 251}