<commit_before>﻿import button = require("ui/button");
import dialogs = require("ui/dialogs");
import frame = require("ui/frame");
import gridModule = require("ui/layouts/grid-layout");
import pages = require("ui/page");
import text = require("ui/text-view");
import fs = require("file-system");
import trace = require("trace");

trace.enable();
trace.setCategories(trace.categories.Test);

var list: string[] = ["pages", "layouts", "modal-view", "bindings", "custom-components"];

// basePath is auto-changed when building multiple apps
var basePath = "";
export function createPage() {
    var txtInput = new text.TextView();
    var btn = new button.Button();
    btn.text = "Run";
    btn.on(button.Button.tapEvent, function () {
        var filePath, fileName, i = 0;
        while (i < list.length) {
            filePath = fs.path.join(__dirname, list[i], txtInput.text);
            if ((fs.File.exists(filePath + ".xml") || (fs.File.exists(filePath + ".js")))) {
                fileName = basePath + list[i] + "/" + txtInput.text;
                break;
            }
            i++;
        }
        if (i < list.length) {
            frame.topmost().navigate(fileName);
        } else {
            dialogs.alert("Cannot find page: " + txtInput.text);
        }
    });

    var grid = new gridModule.GridLayout();
    grid.addRow(new gridModule.ItemSpec(1, gridModule.GridUnitType.auto));<commit_msg>list with pages fixed<commit_after>﻿import button = require("ui/button");
import dialogs = require("ui/dialogs");
import frame = require("ui/frame");
import gridModule = require("ui/layouts/grid-layout");
import pages = require("ui/page");
import text = require("ui/text-view");
import fs = require("file-system");
import trace = require("trace");

trace.enable();
trace.setCategories(trace.categories.Test);

var list: string[] = ["pages", "layouts", "modal-view", "bindings"];

// basePath is auto-changed when building multiple apps
var basePath = "";
export function createPage() {
    var txtInput = new text.TextView();
    var btn = new button.Button();
    btn.text = "Run";
    btn.on(button.Button.tapEvent, function () {
        var filePath, fileName, i = 0;
        while (i < list.length) {
            filePath = fs.path.join(__dirname, list[i], txtInput.text);
            if ((fs.File.exists(filePath + ".xml") || (fs.File.exists(filePath + ".js")))) {
                fileName = basePath + list[i] + "/" + txtInput.text;
                break;
            }
            i++;
        }
        if (i < list.length) {
            frame.topmost().navigate(fileName);
        } else {
            dialogs.alert("Cannot find page: " + txtInput.text);
        }
    });

    var grid = new gridModule.GridLayout();
    grid.addRow(new gridModule.ItemSpec(1, gridModule.GridUnitType.auto));
{'fraction_non_alphanumeric': 0.16341030195381884, 'fraction_numerical': 0.0014209591474245115, 'mean_word_length': 2.8054054054054056, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3802980', 'n_tokens_mistral': 841, 'n_tokens_neox': 834, 'n_words': 195}