<commit_before>﻿BookShelf.BookAdd = function(params) {

    return $.extend(BookShelf.BookForm(params), {

        resetBook: function() {
            this.book.title("");
            this.book.author("");
        },

        save: function() {
            BookShelf.db.books.add(this.getBook());
            BookShelf.app.back();
        },

        cancel: function() {
            BookShelf.app.back();
        },

        viewShowing: function() {
            this.resetBook();
        }<commit_msg>Views: Reset book status and start/finish dates on add form<commit_after>﻿BookShelf.BookAdd = function(params) {

    return $.extend(BookShelf.BookForm(params), {

        resetBook: function() {
            this.book.title("");
            this.book.author("");
            this.book.status(params.status);
            this.book.startDate(new Date());
            this.book.finishDate(new Date());
        },

        save: function() {
            BookShelf.db.books.add(this.getBook());
            BookShelf.app.back();
        },

        cancel: function() {
            BookShelf.app.back();
        },

        viewShowing: function() {
            this.resetBook();
        }
{'fraction_non_alphanumeric': 0.14814814814814814, 'fraction_numerical': 0.0, 'mean_word_length': 1.7208237986270023, 'pattern_counts': {'":': 0, '<': 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': '3376600', 'n_tokens_mistral': 349, 'n_tokens_neox': 331, 'n_words': 50}