<commit_before>// FIXME. RE-IMPLEMENT FILTERING.
// Removed the old Enyo 2.3.0 implementation of collection filters from this sample that was removed
// before 2.4.0 went final. We'll restore filtering to this sample once we have the new filter
// implementation as part of post-2.4.0 work.
enyo.kind({
	name: "moon.sample.HighlightTextSample",
	classes: "moon enyo-unselectable enyo-fit",
	components: [
		{kind: "moon.Panels", pattern:"activity", classes:"enyo-fit", components: [
			{kind: "moon.Panel", title:"STATIC", titleBelow:"Simple items", subTitleBelow: "Case insensitive", classes:"moon-6h", components: [
				{kind: "moon.Scroller", fit: true, components: [
					{kind: "moon.Divider", content:"Standard highlight"},
					{kind: "moon.Item", components: [
						{kind: "moon.HighlightText", content:"Very long text to see highlight with marquee", highlight:"text", mixins: ["moon.MarqueeItem"]}
					]},
					{kind: "moon.Item", components: [
						{kind: "moon.HighlightText", content:"Text to highlight", highlight:"to"}
					]},
					{kind: "moon.Item", components: [
						{kind: "moon.HighlightText", content:"Text to highlight", highlight:"highlight"}
					]},
					{kind: "moon.Divider", content:"Custom highlight classes"},
					{kind: "moon.Item", components: [
						{kind: "moon.HighlightText", content:"Text to highlight", highlight:"text", highlightClasses:"highlight-text-sample-red"}
					]},
					{kind: "moon.Item", components: [
						{kind: "moon.HighlightText", content:"Text to highlight", highlight:"to", highlightClasses:"highlight-text-sample-blue"}
					]},
					{kind: "moon.Item", components: [
						{kind: "moon.HighlightText", content:"Text to highlight", highlight:"highlight", highlightClasses:"highlight-text-sample-fancy"}
					]},
					{kind: "moon.Divider", content:"Custom control with marquee"},
					{tag:"div", style: "border: 2px dotted grey; margin: 5px 10px;", marqueeOnSpotlight: false, marqueeOnRender: true, mixins: ["moon.MarqueeSupport"], components: [
						{name: "dynamic", kind: "moon.HighlightText", highlight:"text", mixins: ["moon.MarqueeItem"], content:$L("Very long text to see highlight with marquee but not using item")}
					]},
					{kind: "moon.Button", content: "Dynamic Content Change", ontap: "changeContent"}
				]}
			]},
			{name: "inputPanel", kind: "moon.Panel", headerOptions: {kind: "moon.InputHeader"}, classes:"moon-6h", joinToPrev: true, oninput: "search", components: [
				{kind: "moon.DataList", fit: true, name:"list", components: [
					{kind: "moon.Item", bindings: [
						{from: ".model.text", to:".$.text.content"},
						{from: ".controller.text", to: ".$.text.highlight"}
					], components: [
						{kind: "moon.HighlightText", name:"text"}
					]}
				]}
			], title:"SEARCH", titleBelow: "Highlighted text in DataList", subTitleBelow: "Case sensitive"}
		]}
	],
	bindings: [
		{from: ".controller", to: ".$.list.collection"},
		{from: ".$.inputPanel.$.header.value", to: ".controller.text"}
	],
	create: function() {
		this.controller = new enyo.Collection(this.data);
		this.inherited(arguments);
	},
	search: function(inSender, inEvent) {
		inSender.waterfall("onHighlight", {highlight: inEvent.originator.getValue()});
	},
	changeContent: function() {
		this.$.dynamic.setContent("Dynamic content change test, this text should be highlighted.");
	},
	data: [
		{ text: "proident irure nostrud", isFolder: false },
		{ text: "adipisicing veniam officia",isFolder: true },
		{ text: "culpa adipisicing Lorem", isFolder: false },
		{ text: "dolor ut excepteur", isFolder: false },
		{ text: "elit veniam nulla", isFolder: true },
		{ text: "irure laboris irure", isFolder: false },
		{ text: "non do consectetur", isFolder: false },
		{ text: "irure dolor laborum", isFolder: true },
		{ text: "nulla aliqua laborum", isFolder: false },
		{ text: "elit ad sit", isFolder: false },
		{ text: "aliqua voluptate nulla", isFolder: false },
		{ text: "non eiusmod nostrud", isFolder: true },
		{ text: "elit est ullamco", isFolder: true },
		{ text: "magna tempor minim", isFolder: true },
		{ text: "excepteur Lorem id", isFolder: true },
		{ text: "quis eiusmod aute", isFolder: false },
		{ text: "proident cillum elit", isFolder: false },
		{ text: "commodo dolor dolor", isFolder: false },
		{ text: "amet laborum officia", isFolder: false },
		{ text: "aute do enim", isFolder: false },
		{ text: "ut proident elit", isFolder: false },
		{ text: "ea reprehenderit velit", isFolder: false },
		{ text: "ipsum aliqua deserunt", isFolder: true },
		{ text: "ea minim incididunt", isFolder: false },
		{ text: "reprehenderit amet dolore", isFolder: false },<commit_msg>[BHV-10255] added filtering back to highlight sample<commit_after>// FIXME. RE-IMPLEMENT FILTERING.
// Removed the old Enyo 2.3.0 implementation of collection filters from this sample that was removed
// before 2.4.0 went final. We'll restore filtering to this sample once we have the new filter
// implementation as part of post-2.4.0 work.
enyo.kind({
	name: "moon.sample.HighlightTextSample",
	classes: "moon enyo-unselectable enyo-fit",
	components: [
		{kind: "moon.Panels", pattern:"activity", classes:"enyo-fit", components: [
			{kind: "moon.Panel", title:"STATIC", titleBelow:"Simple items", subTitleBelow: "Case insensitive", classes:"moon-6h", components: [
				{kind: "moon.Scroller", fit: true, components: [
					{kind: "moon.Divider", content:"Standard highlight"},
					{kind: "moon.Item", components: [
						{kind: "moon.HighlightText", content:"Very long text to see highlight with marquee", highlight:"text", mixins: ["moon.MarqueeItem"]}
					]},
					{kind: "moon.Item", components: [
						{kind: "moon.HighlightText", content:"Text to highlight", highlight:"to"}
					]},
					{kind: "moon.Item", components: [
						{kind: "moon.HighlightText", content:"Text to highlight", highlight:"highlight"}
					]},
					{kind: "moon.Divider", content:"Custom highlight classes"},
					{kind: "moon.Item", components: [
						{kind: "moon.HighlightText", content:"Text to highlight", highlight:"text", highlightClasses:"highlight-text-sample-red"}
					]},
					{kind: "moon.Item", components: [
						{kind: "moon.HighlightText", content:"Text to highlight", highlight:"to", highlightClasses:"highlight-text-sample-blue"}
					]},
					{kind: "moon.Item", components: [
						{kind: "moon.HighlightText", content:"Text to highlight", highlight:"highlight", highlightClasses:"highlight-text-sample-fancy"}
					]},
					{kind: "moon.Divider", content:"Custom control with marquee"},
					{tag:"div", style: "border: 2px dotted grey; margin: 5px 10px;", marqueeOnSpotlight: false, marqueeOnRender: true, mixins: ["moon.MarqueeSupport"], components: [
						{name: "dynamic", kind: "moon.HighlightText", highlight:"text", mixins: ["moon.MarqueeItem"], content:$L("Very long text to see highlight with marquee but not using item")}
					]},
					{kind: "moon.Button", content: "Dynamic Content Change", ontap: "changeContent"}
				]}
			]},
			{name: "inputPanel", kind: "moon.Panel", headerOptions: {kind: "moon.InputHeader"}, classes:"moon-6h", joinToPrev: true, oninput: "search", components: [
				{kind: "moon.DataList", fit: true, name:"list", components: [
					{kind: "moon.Item", bindings: [
						{from: ".model.text", to:".$.text.content"},
						{from: ".controller.text", to: ".$.text.highlight"}
					], components: [
						{kind: "moon.HighlightText", name:"text"}
					]}
				]}
			], title:"SEARCH", titleBelow: "Highlighted text in DataList", subTitleBelow: "Case sensitive"}
		]}
	],
	bindings: [
		{from: ".filteredController", to: ".$.list.collection"},
		{from: ".$.inputPanel.$.header.value", to: ".controller.text"}
	],
	create: function() {
		this.controller = new enyo.Collection(this.data);
        this.filteredController = new enyo.ProgressiveFilter({
            collection: this.controller,
            method: function (model) {
                return model.get("text").indexOf(this.text) >= 0;
            }
        });
		this.inherited(arguments);
	},
	search: function(inSender, inEvent) {
        this.filteredController.reset();
        this.filteredController.text = inEvent.originator.getValue();
        this.filteredController.filter();

		inSender.waterfall("onHighlight", {highlight: inEvent.originator.getValue()});
	},
	changeContent: function() {
		this.$.dynamic.setContent("Dynamic content change test, this text should be highlighted.");
	},
	data: [
		{ text: "proident irure nostrud", isFolder: false },
		{ text: "adipisicing veniam officia",isFolder: true },
		{ text: "culpa adipisicing Lorem", isFolder: false },
		{ text: "dolor ut excepteur", isFolder: false },
		{ text: "elit veniam nulla", isFolder: true },
		{ text: "irure laboris irure", isFolder: false },
		{ text: "non do consectetur", isFolder: false },
		{ text: "irure dolor laborum", isFolder: true },
		{ text: "nulla aliqua laborum", isFolder: false },
		{ text: "elit ad sit", isFolder: false },
		{ text: "aliqua voluptate nulla", isFolder: false },
		{ text: "non eiusmod nostrud", isFolder: true },
		{ text: "elit est ullamco", isFolder: true },
		{ text: "magna tempor minim", isFolder: true },
		{ text: "excepteur Lorem id", isFolder: true },
		{ text: "quis eiusmod aute", isFolder: false },
		{ text: "proident cillum elit", isFolder: false },
		{ text: "commodo dolor dolor", isFolder: false },
		{ text: "amet laborum officia", isFolder: false },
		{ text: "aute do enim", isFolder: false },
		{ text: "ut proident elit", isFolder: false },
		{ text: "ea reprehenderit velit", isFolder: false },
		{ text: "ipsum aliqua deserunt", isFolder: true },
		{ text: "ea minim incididunt", isFolder: false },
		{ text: "reprehenderit amet dolore", isFolder: false },
{'fraction_non_alphanumeric': 0.16751944330740892, 'fraction_numerical': 0.0036839950880065493, 'mean_word_length': 4.1763771186440675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1857524', 'n_tokens_mistral': 3592, 'n_tokens_neox': 3101, 'n_words': 851}