<commit_before>/* @flow */
"use strict";

import scrollContainer from "$WIDGETS/scrollContainer";
import textContainer from "$WIDGETS/textContainer";
import View from "$LIB/View";
import glyph from "$WIDGETS/glyph";
import list from "$WIDGETS/list";
import listItem from "$WIDGETS/listItem";
import listItemContents from "$WIDGETS/listItemContents";
import listItemActions from "$WIDGETS/listItemActions";
import listItemSpacer from "$WIDGETS/listItemSpacer";
import listHeading from "$WIDGETS/listHeading";
import listIndicator from "$WIDGETS/listIndicator";

import h from "yasmf-h";
import L from "$APP/localization/localization";
import GCS from "$LIB/grandCentralStation";

import licenses from "$MODELS/licenses.json";

const kp = require("keypather")();


export default class AboutView extends View {
    get TARGET_SELECTORS() {
        return [
            {selector: "tap:a", emit: "linkTapped"},
            {selector: "tap:ul li > button", emit: "licenseTapped"}
        ];
    }

    onLinkTapped(sender, notice, linkElement) {
        GCS.emit("APP:DO:URL", linkElement.getAttribute("link"));
    }

    onLicenseTapped(sender, notice, license) {
        GCS.emit("APP:DO:URL", license.value);
    }

    template() {
        let model = kp.get(this, "controller.model");
        //if (!model) {model = {dictionaries: []}};
        return scrollContainer({contents: [
            textContainer({contents: [
                h.p(`Logology is an app about the love of words.
                    Combinations of words are our thoughts, crystalized,
                    ready to put into action. Without definitions, our
                    thoughts would be immaterial`),
                h.p([h.span("Logology was created as a demonstration app for the book, "),
                    h.a("Mastering PhoneGap Mobile Application Development", {
                        attrs: {
                            href: "javascript: return false;",
                            link: "https://www.packtpub.com/application-development/mastering-phonegap-mobile-application-development"
                        }
                    }),
                    h.span(`, and was built to illustrate how to create mobile hybrid
                            apps using Cordova and PhoneGap.`)]),
                h.p(`This app relies upon the following technologies. Tap each one
                    for additional information, including licensing information.`)
            ]}),
            list({
                contents: ["plugin", "package", "dev-package"].map ( t=> {
                    return [listHeading({contents:L.T(`about:${t}`)})].concat(
                        licenses.map( license => {
                            return license.type === t ? listItem({
                                contents: listItemContents({
                                    props: {
                                        value: license.link
                                    },
                                    contents: ["name", "comment", "licenseType"].map( field => {
                                        return h.el(`div.y-flex ${field}`, license[field]);
                                    })
                                })
                            }) : undefined;
                        })
                    );
                })
            })
        ]});
    }

}

export function createAboutView(options = {}) {
    return new AboutView(options);
}
<commit_msg>Add book cover; word net license<commit_after>/* @flow */
"use strict";

import scrollContainer from "$WIDGETS/scrollContainer";
import textContainer from "$WIDGETS/textContainer";
import View from "$LIB/View";
import glyph from "$WIDGETS/glyph";
import list from "$WIDGETS/list";
import listItem from "$WIDGETS/listItem";
import listItemContents from "$WIDGETS/listItemContents";
import listItemActions from "$WIDGETS/listItemActions";
import listItemSpacer from "$WIDGETS/listItemSpacer";
import listHeading from "$WIDGETS/listHeading";
import listIndicator from "$WIDGETS/listIndicator";

import h from "yasmf-h";
import L from "$APP/localization/localization";
import GCS from "$LIB/grandCentralStation";

import licenses from "$MODELS/licenses.json";

const kp = require("keypather")();


export default class AboutView extends View {
    get TARGET_SELECTORS() {
        return [
            {selector: "tap:a", emit: "linkTapped"},
            {selector: "tap:ul li > button", emit: "licenseTapped"}
        ];
    }

    onLinkTapped(sender, notice, linkElement) {
        GCS.emit("APP:DO:URL", linkElement.getAttribute("link"));
    }

    onLicenseTapped(sender, notice, license) {
        GCS.emit("APP:DO:URL", license.value);
    }

    template() {
        let model = kp.get(this, "controller.model");
        return scrollContainer({contents: [
            textContainer({contents: [
                h.img({
                    attrs:{
                        srcset: "img/book-cover-xhidpi.jpg 2500w, img/book-cover-hidpi.jpg 1250w, img/book-cover-lodpi.jpg 625w",
                        src:"img/book-cover-lodpi.jpg"
                    },
                    styles: {
                        width: "100%"
                    }
                }),
                h.p(L.T("about:p:1")),
                h.p(h.a(L.T("about:book-title"), {
                        attrs: {
                            href: "javascript: return false;",
                            link: "https://www.packtpub.com/application-development/mastering-phonegap-mobile-application-development"
                        }
                    })),
                h.p(L.T("about:p:2")),
                h.p(L.T("about:p:3"))
            ]}),
            list({
                contents: ["plugin", "package", "dev-package"].map ( t=> {
                    return [listHeading({contents:L.T(`about:${t}`)})].concat(
                        licenses.map( license => {
                            return license.type === t ? listItem({
                                contents: listItemContents({
                                    props: {
                                        value: license.link
                                    },
                                    contents: ["name", "comment", "licenseType"].map( field => {
                                        return h.el(`div.y-flex ${field}`, license[field]);
                                    })
                                })
                            }) : undefined;
                        })
                    );
                })
            }),
            textContainer({
                contents: [
                    h.h1(L.T("about:wordnet")),
                    h.p(L.T("about:wordnet:use")),
                    h.p(L.T("about:wordnet:license:1")),
                    h.p(L.T("about:wordnet:license:2")),
                    h.p(L.T("about:wordnet:license:3")),
                    h.p(L.T("about:wordnet:license:4")),
                ]
            })
        ]});
    }

}

export function createAboutView(options = {}) {
    return new AboutView(options);
}

{'fraction_non_alphanumeric': 0.12477192982456141, 'fraction_numerical': 0.003087719298245614, 'mean_word_length': 1.5413694721825963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3392356', 'n_tokens_mistral': 1890, 'n_tokens_neox': 1817, 'n_words': 401}