<commit_before>/*global ares, enyo, $L */

// Action popup now accept call back that will be run when user click
// on ok or cancel. Note that events are not fired when callback are
// defined

enyo.kind({
	name: "Ares.ActionPopup",
	kind: "onyx.Popup",
	modal: true,
	centered: true,
	floating: true,
	autoDismiss: false,
	classes:"ares-classic-popup",
	published: {
		title: "",
		actionButton: "",
		cancelButton: "",
		actionCallback: null,
		cancelCallback: null,
		message: ""
	},
	events: {
		onConfirmActionPopup: "",
		onCancelActionPopup: ""
	},
	components: [
		{tag: "div", name: "title", classes:"title", content: ""},
		{kind: "enyo.Scroller",  classes:"ares-small-popup", fit: true, components: [
			{classes:"ares-small-popup-details", name:"popupContent", components:[
				{name:"message"}
			]}
		]},
		{kind: "onyx.Toolbar", classes:"bottom-toolbar", name: "buttons", components: [
			{name:"cancelButton", kind: "onyx.Button", content: $L("Cancel"), ontap: "actionCancel"},
			{name:"actionButton", classes:"right", kind: "onyx.Button", content: $L("Delete"), ontap: "actionConfirm"}
		]}
	],
	/** @private */
	create: function() {
		ares.setupTraceLogger(this);
		this.inherited(arguments);

		this.titleChanged();
		this.messageChanged();
		this.actionButtonChanged();
		this.cancelButtonChanged();
	},
	/** @private */
	titleChanged: function(oldVal) {
		this.$.title.setContent(this.title);
	},
	/** @private */
	messageChanged:function(oldVal) {
		this.$.message.setContent(this.message);
	},
	/** @private */
	actionButtonChanged: function(oldVal) {
		if (this.actionButton !== "") {
			this.$.actionButton.setContent(this.actionButton);
		}
	},
	/** @private */
	cancelButtonChanged: function(oldVal) {
		if (this.cancelButton !== "") {
			this.$.cancelButton.setContent(this.cancelButton);
		}
	},
	/** @private */
	actionConfirm: function(inSender, inEvent) {
		this.hide();
		if (this.actionCallback) {
			this.actionCallback();
		}
		else {
			this.doConfirmActionPopup();
		}
		this.clearCallbacks();
		return true;
	},
	/** @private */
	actionCancel: function(inSender, inEvent) {
		this.hide();
		if (this.cancelCallback) {
			this.cancelCallback();
		}
		else {
			this.doCancelActionPopup();
		}
		this.clearCallbacks();
		return true;
	},
	/** @private */
	clearCallbacks: function() {
		this.actionCallback = null;
		this.cancelCallback = null;
	}
});<commit_msg>ENYO-3082: Merge commit '<PASSWORD>' into ENYO-3082<commit_after>/*global ares, enyo, $L */

// Action popup now accept call back that will be run when user click
// on ok or cancel. Note that events are not fired when callback are
// defined

enyo.kind({
	name: "Ares.ActionPopup",
	kind: "onyx.Popup",
	modal: true,
	centered: true,
	floating: true,
	autoDismiss: false,
	classes:"ares-classic-popup",
	published: {
		title: "",
		actionButton: "",
        action1Button: "",
		cancelButton: "",
		actionCallback: null,
		cancelCallback: null,
		message: ""
	},
	events: {
		onConfirmActionPopup: "",
        onConfirmAction1Popup: "",
		onCancelActionPopup: ""
	},
	components: [
		{tag: "div", name: "title", classes:"title", content: ""},
		{kind: "enyo.Scroller",  classes:"ares-small-popup", fit: true, components: [
			{classes:"ares-small-popup-details", name:"popupContent", components:[
				{name:"message"}
			]}
		]},
		{kind: "onyx.Toolbar", classes:"bottom-toolbar", name: "buttons", components: [
            {name:"actionButton", kind: "onyx.Button", content: "Action", ontap: "actionConfirm"},
            {name:"action1Button", kind: "onyx.Button", content: "Action1", ontap: "action1Confirm", showing: false},
            {name:"cancelButton", classes:"right", kind: "onyx.Button", content: $L("Cancel"), ontap: "actionCancel"}
		]}
	],
	/** @private */
	create: function() {
		ares.setupTraceLogger(this);
		this.inherited(arguments);

		this.titleChanged();
		this.messageChanged();
		this.actionButtonChanged();
	this.action1ButtonChanged();
		this.cancelButtonChanged();
	},
	/** @private */
	titleChanged: function(oldVal) {
		this.$.title.setContent(this.title);
	},
	/** @private */
	messageChanged:function(oldVal) {
		this.$.message.setContent(this.message);
	},
	/** @private */
	actionButtonChanged: function(oldVal) {
		if (this.actionButton !== "") {
			this.$.actionButton.setContent(this.actionButton);
		}
	},
	/** @private */
    action1ButtonChanged: function(oldVal) {
	    if (this.action1Button !== "") {
		    this.$.action1Button.setContent(this.action1Button);
		    this.$.action1Button.show();
	    } else {
		    this.$.action1Button.hide();
	    }
    },
    /** @private */
	cancelButtonChanged: function(oldVal) {
		if (this.cancelButton !== "") {
			this.$.cancelButton.setContent(this.cancelButton);
		}
	},
	/** @private */
	actionConfirm: function(inSender, inEvent) {
		this.hide();
		if (this.actionCallback) {
			this.actionCallback();
		}
		else {
			this.doConfirmActionPopup();
		}
		this.clearCallbacks();
	},
    /** @private */
    action1Confirm: function(inSender, inEvent) {
        this.hide();
        this.doConfirmAction1Popup();
		return true;
	},
	/** @private */
	actionCancel: function(inSender, inEvent) {
		this.hide();
		if (this.cancelCallback) {
			this.cancelCallback();
		}
		else {
			this.doCancelActionPopup();
		}
		this.clearCallbacks();
		return true;
	},
	/** @private */
	clearCallbacks: function() {
		this.actionCallback = null;
		this.cancelCallback = null;
	}
});
{'fraction_non_alphanumeric': 0.17885284955103536, 'fraction_numerical': 0.004031519149715961, 'mean_word_length': 3.921550946798918, 'pattern_counts': {'":': 0, '<': 4, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3287736', 'n_tokens_mistral': 1948, 'n_tokens_neox': 1816, 'n_words': 344}