<commit_before>﻿function TourStep(controlToHighlight, imageHolder, arrowDirection, arrowPointCoordinates) {
    this.controlToHighlight = controlToHighlight;
    this.imageHolder = imageHolder;
    this.arrowDirection = arrowDirection;
    this.arrowPointCoordinates = arrowPointCoordinates;
}

function ImageHolder(imagePath, width, height) {
    this.imagePath = imagePath;
    this.height = height;
    this.width = width;
}

function Coordinate(x, y) {
    this.x = x;
    this.y = y;
}

function TourSequence() {
    this.tourSteps = [];
}

TourSequence.prototype.addStep = function(step) {
    this.tourSteps.push(step);
};

TourSequence.prototype.nextStep = function() {
    return this.tourSteps.shift();
};

TourSequence.prototype.hasNextStep = function() {
    return this.tourSteps.length > 0;
};

TourSequence.prototype.startTour = function() {

    var self = this;
    
    if (self.hasNextStep()) {
        var tourOverlay = $('<div id="tourOverlay"></div>').appendTo('body');
        var img = $('<img class="tourImage"> </img>').appendTo(tourOverlay);

        // keep people from dragging the image around
        $(img).on('dragstart', function (event) { event.preventDefault(); });

        tourOverlay.height($(document).height() + 100);
        // IE8 fix for fadeIn
        tourOverlay.css('filter', 'alpha(opacity=80)');
<commit_msg>Added the ability to specify an exit message.<commit_after>﻿function TourStep(controlToHighlight, imageHolder, arrowDirection, arrowPointCoordinates) {
    this.controlToHighlight = controlToHighlight;
    this.imageHolder = imageHolder;
    this.arrowDirection = arrowDirection;
    this.arrowPointCoordinates = arrowPointCoordinates;
}

function ImageHolder(imagePath, width, height) {
    this.imagePath = imagePath;
    this.height = height;
    this.width = width;
}

function ExitTourImage(imageHolder, offsetCoordinates) {
    this.imageHolder = imageHolder;
    if (typeof offsetCoordinates !== 'undefined' && offsetCoordinates !== null) {
        this.exitTourOffsetCoordinates = offsetCoordinates;
    } else {
        this.exitTourOffsetCoordinates = new Coordinate(0, 0);
    }
}

function Coordinate(x, y) {
    this.x = x;
    this.y = y;
}

function TourSequence(exitTourImage) {
    this.tourSteps = [];
    this.exitTourImage = exitTourImage;
}

TourSequence.prototype.addStep = function(step) {
    this.tourSteps.push(step);
};

TourSequence.prototype.nextStep = function() {
    return this.tourSteps.shift();
};

TourSequence.prototype.hasNextStep = function() {
    return this.tourSteps.length > 0;
};

TourSequence.prototype.startTour = function() {

    var self = this;
    
    if (self.hasNextStep()) {
        var tourOverlay = $('<div id="tourOverlay"></div>').appendTo('body');
        var img = $('<img class="tourImage"> </img>').appendTo(tourOverlay);
        
        // if the called defined an exit image, place it on the screen and bind a click event to cancel the tour
        if (typeof self.exitTourImage !== 'undefined' && self.exitTourImage !== null) {
            var closeImg = $('<img id="napkinTourClose"> </img>').appendTo(tourOverlay);
            closeImg.attr('src', self.exitTourImage.imageHolder.imagePath);
            closeImg.css('top', self.exitTourImage.exitTourOffsetCoordinates.y);
            closeImg.css('left', self.exitTourImage.exitTourOffsetCoordinates.x);

            closeImg.click(function() {
                tourOverlay.fadeOut(800);
            });
        }

        // keep people from dragging the image around
        $(img).on('dragstart', function (event) { event.preventDefault(); });

        tourOverlay.height($(document).height() + 100);
        // IE8 fix for fadeIn
        tourOverlay.css('filter', 'alpha(opacity=80)');

{'fraction_non_alphanumeric': 0.1332979288369623, 'fraction_numerical': 0.005045140732873075, 'mean_word_length': 3.421361502347418, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, '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': '2170902', 'n_tokens_mistral': 1152, 'n_tokens_neox': 1094, 'n_words': 227}