android – Create a button with a left and right half

I'm trying to create a button in Android that performs various actions, depending on whether you click on the left half of the button or on the right half of the button.

Some additional things, the button need to do:

  • Have 1-4 of these buttons in one activity, all of the same size.
  • You can turn the knob (eg 90 degrees, 180 degrees so that it is upside down).

I came up with different solutions and I need to know what works best.

Option 1: Add two buttons to LinearLayout, remove the space between them, and add a text view to make it look like a button.

Pros:

Disadvantage:

  • It feels like a hack job and can bite me back if I have to change something later.

Option 2: Create a custom view to run the job.

Pros:

  • I can build it to fit my needs.

Disadvantage:

  • I'm not sure how to do that or where to figure out how to do that.

Should I choose one of these options, or is there another, better solution that I can not think of?

jquery – Action button "Project Online Intercept Ribbon Save"

You need to catch the Project Online Save button. Perform an action before starting the Project Server update. If my action succeeds, I want the original code to be inherited from Project Server Save.

Below is the original HTML code available

save up

I have also tried addEventListener as below

document.body.addEventListener (& # 39; click & # 39 ;, function (event) {
if (event.target.id == "Ribbon.Tabs.PDP.Home.Project.Save-Large") {
console.log (& # 39; mouse click: & # 39 ;, event.target.id);
SaveData (_defaultVal, projectname, _curTAB); }}, not correct);

Unfortunately, I could not catch the backup click. However, when I try to mouseover, it works fine.

Any idea ?

8 – How do you customize the "Add to Cart" button of a product?

I've created a custom module using Drupal 8 and Commerce 2.11 to change the "Add to Cart" button on the product sheets.

The module works, but is currently used for all products.

I only want to apply it to the product with ID 50

How do you customize the "Add to Cart" button on a product?

getStore () -> getOwner ();
foreach ($ form_state-> getFormObject () -> getEntity () -> getPurchasedEntity () -> getProduct () -> getStores () as $ store) {
$ bundle = $ store-> bundle ();
// Product type subscription.
if ($ bundle == & # 39; online & # 39;) {
if (isset ($ form["#attributes"]["class"]) && in_array ("commerce-order-item-add-to-cart-form"), $ form["#attributes"]["class"])) {
$ selectedVariationId = $ form_state-> get (& # 39; selected_variation & # 39;);
$ selectedVariation =  Drupal  commerce_product  Entity  ProductVariation :: load ($ selectedVariationId);
$ form['actions']['submit']['#value']    = t (& # 39; subscribe & # 39;);
if (! $ owner-> hasRole (& # 39; marchand & # 39;)) {
$ form['actions']['submit']['#attributes']['class']    = array ("button - add-to-cart"), "button button - primary", "js-form-submit", "shape" submit & # 39 ;, & # 39; is-disabled & 39 ;, btn-warning & 39 ;, btn & # 39;
$ form['actions']['submit']['#disabled']    = TRUE;
}
}
}
}
}

I added Commerce Ordered on Add-to-Cart Form-commerce product 50 to my code but it does not work:

getStore () -> getOwner ();
foreach ($ form_state-> getFormObject () -> getEntity () -> getPurchasedEntity () -> getProduct () -> getStores () as $ store) {
$ bundle = $ store-> bundle ();
// Product type subscription.
if ($ bundle == & # 39; online & # 39;) {
if (isset ($ form["#attributes"]["class"]) && in_array ("Commerce Order Item Add-to-Cart Form Commerce Product-50", $ Form)["#attributes"]["class"])) {
$ selectedVariationId = $ form_state-> get (& # 39; selected_variation & # 39;);
$ selectedVariation =  Drupal  commerce_product  Entity  ProductVariation :: load ($ selectedVariationId);
$ form['actions']['submit']['#value']    = t (& # 39; subscribe & # 39;);
if (! $ owner-> hasRole (& # 39; marchand & # 39;)) {
$ form['actions']['submit']['#attributes']['class']    = array ("button - add-to-cart"), "button button - primary", "js-form-submit", "shape" submit & # 39 ;, & # 39; is-disabled & 39 ;, btn-warning & 39 ;, btn & # 39;
$ form['actions']['submit']['#disabled']    = TRUE;
}
}
}
}
}

Enter the image description here

magento2 – Redirect the Magento 2 controller by clicking the button in the HTML file

I'd like to redirect the customer using the controller when the button is clicked in one of my PHP files.

So far I have controllers:

execute public function () {
return $ this-> addToCart ();
}

public function addToCart () {
// a logic
$ this -> _ redirect (& # 39; checkout / shopping cart / index & # 39;);
}

The above works fine (redirect) when you access the controller through a URL (www.mydomain.com/batchorder/index/addtocart).

And here is mine .phtml File:

$ ("# addToCart"). click (function () {
let controllerUrl = ""
$ .post (controllerUrl,
{
"Products": JSON.stringify (sideCart.SideCartProducts)
})

The post request returns my logic as it should, but no redirection is performed. Can anyone help?

php – Woocommerce: Custom pop-up dialog after adding to the shopping cart button

Some products have 2 custom SKU fields (SKU1, SKU2). I would like the user to see a pop-up window with a mandatory selection field after clicks in the shopping cart: "With barcode", "Without barcode". If the user selects "with barcode", the product is added to the shopping cart with SKU1. If you select "without barcode", the product will be added to the shopping cart with SKU2. If the product has only SKU1 or SKU2, the popup should not be displayed.

Can you achieve something like this? Preferably without the use of a plugin

javascript – problem displaying div when clicking on the radio button and another div

I have a problem and would like the help of friends:

On an article selection page, I want to display a div, that is hidden if I choose the radio button.

It works fine if you click directly on the radio button. However, the radio button is also selected by clicking on the name of the option in the DIV (example: Boleto Bancaria). And when I click on the option name, the hidden DIV is not displayed.

I want to display the hidden DIV by clicking on the name Boleto bancário (in this case throughout the DIV) as well as on the radio button.

HTML is something like this:

$ ("Enter[name=op]") change (function (data) {
var selection = $ ("Input[name=op]: marked ") val ();
console.log (selection);
if (selection! = "op3")
$ ("# fields"). hide ();
otherwise
$ ("# fields"). show (& # 39; almost & # 39;);
});

$ ("# fields"). hide ();
$ ("Div.table-selection") .click (function () {$ (# div) removeClass ("success") find (& # 39; div & # 39; input & # 39;) .addClass (& # 39; success & # 39;). find (& # 39; input & prop;) prop (& # 39; checked & # 39 ;, true);});

Option 1
Option 2
Option 3
Displays the instruction

Thank you for your personal attention.

angular – How do I handle a custom button click event for PrimeNG p-fullCalendar?

I use the p-full calendar Control for displaying appointments.

I would like to add a custom button in the header to add a new appointment.

I did that by specifying it in the options according to the full calendar documents:

Export class AppointmentsComponent implements OnInit {

Events: arbitrary[];
Options: arbitrary;
displayAddAppointment: boolean;

Constructor() { }

ngOnInit () {

this.options = {
Header: {
left: "prev, next today",
Middle: "Title",
right: & # 39; addAppointmentButton, Month, AgendaWoche, AgendaDay & # 39;
},
customButtons: {
addAppointmentButton: {
Text: "New Appointment",
click: r => {
// this works, but displayAddAppointment inside the component is inaccessible.
// I want to display a modal dialog to add a new appointment.
}
}
}
};

The HTML is:

The button will be displayed well and the click event will also be triggered.

But how do I handle the click event of this button so I can see the modal dialog box?

magento2 – Do not change the color of the Magento 2 email template email button

I tried to change the email template verification button in my custom theme as follows:

app / design / frontend / test / my / web / css / source / _email-extend.less

.Button{
on{
Background color: # 00A73F;
Limit: 1px fixed # 00A73F! important;
Boundary radius: 10px! important;
-webkit-border-radius: 10px! important;
-moz-border-radius: 10px! important;
-ms-border-radius: 10px! important;
&: active {
Text decoration: none;
Limit: 1px fixed # 00A73F! important;
Boundary radius: 10px! important;
-webkit-border-radius: 10px! important;
-moz-border-radius: 10px! important;
-ms-border-radius: 10px! important;
}
&: Focus {
Text decoration: none;
Limit: 1px fixed # 00A73F! important;
Boundary radius: 10px! important;
-webkit-border-radius: 10px! important;
-moz-border-radius: 10px! important;
-ms-border-radius: 10px! important;
}
&:Visited {
Text decoration: none;
Limit: 1px fixed # 00A73F! important;
Boundary radius: 10px! important;
-webkit-border-radius: 10px! important;
-moz-border-radius: 10px! important;
-ms-border-radius: 10px! important;
}
&:hover {
Text decoration: none;
Limit: 1px fixed # 00A73F! important;
Boundary radius: 10px! important;
-webkit-border-radius: 10px! important;
-moz-border-radius: 10px! important;
-ms-border-radius: 10px! important;
}
}
}

The background color of the button was changed successfully, but when I hover the button with the mouse, the color is set back to the old color