<commit_before><?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>

<div class="container clearfix">

    <div class="page-header">

        <h3>

            Found <?php echo $searchResults[0]; ?> Books
            For: <span><?php echo htmlspecialchars($searchTerm); ?></span>

        </h3>

    </div>

    <!-- Portfolio Filter
    ============================================= -->
    <ul id="portfolio-filter" class="clearfix">

        <!--        <li class="activeFilter"><a href="#" data-filter="*">Show All</a></li>-->
        <!--        <li><a href="#" data-filter=".pf-icons">Books My Friends Own</a></li>-->
        <!--        <li><a href="#" data-filter=".pf-illustrations">Books I Can Borrow Now</a></li>-->
        <!--        <li><a href="#" data-filter=".pf-uielements">Books Friends Borrowed In The Past</a></li>-->
    </ul><!-- #portfolio-filter end -->

    <div id="portfolio-shuffle">
        <i class="icon-random"></i>
    </div>

    <div class="clear"></div>

    <!-- Portfolio Items
    ============================================= -->
    <div id="portfolio" class="portfolio-6 portfolio-masonry clearfix">
        <?php for ($i = 1;

                   $i < count($searchResults) - 1; // Last item is the meta data

                   $i++):
            $isbn = $searchResults[$i]['isbn'];
            $googleLink = 'https://books.google.com/books?vid=' . $isbn; ?>
            <article class="portfolio-item pf-media pf-icons">
                <div class="portfolio-image" style="box-shadow: 3px 1px 10px #888888;">
                    <a href="<?php echo $googleLink; ?>">
                        <img
                            src="https://books.google.com/books?id=<?php echo $searchResults[$i]['google_id']; ?>&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api"
                            alt="Open Imagination">
                    </a>
                    <div class="portfolio-overlay">
                        <a href="AjaxBookAdd" id="AddBookLink<?php echo $searchResults[$i]['google_id']; ?>"
                           class="left-icon" title="Add Book To My Bookshelf"><i
                                class="icon-line-plus"></i></a>
                        <?php if (isset($searchResults[$i]['isbn'])): ?>
                            <a href="<?php echo $googleLink; ?>"
                               title="Book Information" class="right-icon"><i
                                    class="icon-line-ellipsis"></i></a>
                        <?php endif ?>
                    </div>
                </div>

                <!-- Notifications-->
                <div id="custom-notification-message-success-<?php echo $searchResults[$i]['google_id']; ?>"
                     data-notify-position="bottom-right" data-notify-type="success"
                     data-notify-msg="<i class='icon-line-circle-check'></i> <strong><?php echo htmlspecialchars($searchResults[$i]['name']); ?></strong> Has Been Added To Your Bookshelf."></div>

                <div id="custom-notification-message-error-<?php echo $searchResults[$i]['google_id']; ?>"
                     data-notify-position="bottom-right" data-notify-type="error"
                     data-notify-msg="<i class='icon-line-circle-cross'></i>Unable To Add <strong><?php echo htmlspecialchars($searchResults[$i]['name']); ?></strong> To Your Bookshelf."></div>

                <script type="text/javascript">

                    //Get a reference to the link on the page
                    // with an id of "mylink"
                    var lnkObj = document.getElementById("AddBookLink<?php echo $searchResults[$i]['google_id']; ?>");
                    //Set code to run when the link is clicked
                    // by assigning a function to "onclick"
                    lnkObj.onclick = function () {

                        var google_id = '<?php echo $searchResults[$i]['google_id']; ?>';
                        jQuery.ajax({
                            type: "POST",
                            url: "<?php echo base_url(); ?>" + "ajax/addBook",
                            dataType: 'json',
                            data: {google_id: google_id}, // google_id is now referred to by id. Remap of value names.
                            success: function (res) {
                                if (res.success == "true") {
                                    SEMICOLON.widget.notifications(jQuery('#custom-notification-message-success-<?php echo $searchResults[$i]['google_id']; ?>'));
                                }
                                else {
                                    SEMICOLON.widget.notifications(jQuery('#custom-notification-message-error-<?php echo $searchResults[$i]['google_id']; ?>'));
                                }
                            },
                            error: function () {
                                SEMICOLON.widget.notifications(jQuery('#custom-notification-message-error-<?php echo $searchResults[$i]['google_id']; ?>'));
                            }
                        });

                        return false;
                    }
                </script>
                <div class="portfolio-desc center">
                    <h3>
                        <a href="<?php echo $googleLink; ?>"><?php echo htmlspecialchars($searchResults[$i]['name']); ?></a>
                    </h3>
                    <span><a
                            href="<?php echo $googleLink; ?>"><?php echo htmlspecialchars($searchResults[$i]['author']); ?><commit_msg>Fixing link's target in book search results.<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>

<div class="container clearfix">

    <div class="page-header">

        <h3>

            Found <?php echo $searchResults[0]; ?> Books
            For: <span><?php echo htmlspecialchars($searchTerm); ?></span>

        </h3>

    </div>

    <!-- Portfolio Filter
    ============================================= -->
    <ul id="portfolio-filter" class="clearfix">

        <!--        <li class="activeFilter"><a href="#" data-filter="*">Show All</a></li>-->
        <!--        <li><a href="#" data-filter=".pf-icons">Books My Friends Own</a></li>-->
        <!--        <li><a href="#" data-filter=".pf-illustrations">Books I Can Borrow Now</a></li>-->
        <!--        <li><a href="#" data-filter=".pf-uielements">Books Friends Borrowed In The Past</a></li>-->
    </ul><!-- #portfolio-filter end -->

    <div id="portfolio-shuffle">
        <i class="icon-random"></i>
    </div>

    <div class="clear"></div>

    <!-- Portfolio Items
    ============================================= -->
    <div id="portfolio" class="portfolio-6 portfolio-masonry clearfix">
        <?php for ($i = 1;

                   $i < count($searchResults) - 1; // Last item is the meta data

                   $i++):
            $isbn = $searchResults[$i]['isbn'];
            $googleLink = 'https://books.google.com/books?vid=' . $isbn; ?>
            <article class="portfolio-item pf-media pf-icons">
                <div class="portfolio-image" style="box-shadow: 3px 1px 10px #888888;">
                    <a target="bookinfoframe" href="<?php echo $googleLink; ?>">
                        <img
                            src="https://books.google.com/books?id=<?php echo $searchResults[$i]['google_id']; ?>&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api"
                            alt="Open Imagination">
                    </a>
                    <div class="portfolio-overlay">
                        <a href="AjaxBookAdd" id="AddBookLink<?php echo $searchResults[$i]['google_id']; ?>"
                           class="left-icon" title="Add Book To My Bookshelf"><i
                                class="icon-line-plus"></i></a>
                        <?php if (isset($searchResults[$i]['isbn'])): ?>
                            <a target="bookinfoframe" href="<?php echo $googleLink; ?>"
                               title="Book Information" class="right-icon"><i
                                    class="icon-line-ellipsis"></i></a>
                        <?php endif ?>
                    </div>
                </div>

                <!-- Notifications-->
                <div id="custom-notification-message-success-<?php echo $searchResults[$i]['google_id']; ?>"
                     data-notify-position="bottom-right" data-notify-type="success"
                     data-notify-msg="<i class='icon-line-circle-check'></i> <strong><?php echo htmlspecialchars($searchResults[$i]['name']); ?></strong> Has Been Added To Your Bookshelf."></div>

                <div id="custom-notification-message-error-<?php echo $searchResults[$i]['google_id']; ?>"
                     data-notify-position="bottom-right" data-notify-type="error"
                     data-notify-msg="<i class='icon-line-circle-cross'></i>Unable To Add <strong><?php echo htmlspecialchars($searchResults[$i]['name']); ?></strong> To Your Bookshelf."></div>

                <script type="text/javascript">

                    //Get a reference to the link on the page
                    // with an id of "mylink"
                    var lnkObj = document.getElementById("AddBookLink<?php echo $searchResults[$i]['google_id']; ?>");
                    //Set code to run when the link is clicked
                    // by assigning a function to "onclick"
                    lnkObj.onclick = function () {

                        var google_id = '<?php echo $searchResults[$i]['google_id']; ?>';
                        jQuery.ajax({
                            type: "POST",
                            url: "<?php echo base_url(); ?>" + "ajax/addBook",
                            dataType: 'json',
                            data: {google_id: google_id}, // google_id is now referred to by id. Remap of value names.
                            success: function (res) {
                                if (res.success == "true") {
                                    SEMICOLON.widget.notifications(jQuery('#custom-notification-message-success-<?php echo $searchResults[$i]['google_id']; ?>'));
                                }
                                else {
                                    SEMICOLON.widget.notifications(jQuery('#custom-notification-message-error-<?php echo $searchResults[$i]['google_id']; ?>'));
                                }
                            },
                            error: function () {
                                SEMICOLON.widget.notifications(jQuery('#custom-notification-message-error-<?php echo $searchResults[$i]['google_id']; ?>'));
                            }
                        });

                        return false;
                    }
                </script>
                <div class="portfolio-desc center">
                    <h3>
                        <a target="bookinfoframe"
                           href="<?php echo $googleLink; ?>"><?php echo htmlspecialchars($searchResults[$i]['name']); ?></a>
                    </h3>
                    <span><a target="bookinfoframe"
                             href="<?php echo $googleLink; ?>"><?php echo htmlspecialchars($searchResults[$i]['author']); ?>
{'fraction_non_alphanumeric': 0.1745037494486105, 'fraction_numerical': 0.0035288928098809, 'mean_word_length': 1.5798816568047338, 'pattern_counts': {'":': 0, '<': 207, '<?xml version=': 0, '>': 205, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3857430', 'n_tokens_mistral': 2997, 'n_tokens_neox': 2829, 'n_words': 588}