How do I add a custom action to the WooCommerce admin JS interface order cards next to the ‘Begin Fulfillment’ button?

The new WooCommerce admin functionality is great, but the only reference to ‘Begin Fulfillment’ are in the language .pot file and it appears compiled js file 7.2eb145fe8d6d73093386.js and its minified equivalent making it hard to work out what is going on.

The default action just goes to the order detail page, and I would like to add a new one next to it to trigger some custom JS for a modal where you can enter the shipping tracking number, marking the order complete and hiding the card in the process.

A suitable compromise would be to take over the behaviour of the existing button to trigger the modal, this a compromise because I was going to filter the i18n string to change the button label to ‘View Order’, as really that is what it does. Be great if this triggered the preview modal like the orders list.

The alternative option would be to hide the default one completely and add a custom button, list of cards and actions but I can’t find any suitable filters for this option either.

javascript – simple calculator with button not working

I was trying to make a simple calculator using buttons but when submitting the form, the result element seems to be out of range since my button click event stores the calculation result, Thus, makes it impossible to call it from from another function. I also tried using ‘var’ but it did not help. I am relatively new to the programming world ,so please explain thoroughly if possible. here is the code:-


//HTML

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Calculator</title>
</head>
<body>
    <form>
        <input type="number" name="num1" id="num1">
        <button name="calc" id="add" value="add">+</button>
        <button name="calc" id="sub" value="sub">-</button>
        <button name="calc" id="mul" value="mul">*</button>
        <button name="calc" id="divi" value="divi">/</button>
        <input type="number" name="num2" id="num2">
        <button type="submit" value="result" id="res">=</button>
        <input type="number" name="result" id="num3">
    </form>
</body>
</html>


//JAVASCRIPT

    <script>
        const form = document.querySelector('form');
        const btn = document.querySelector('button');

        btn.addEventListener('click', e =>{
            const num1 = parseFloat(document.querySelector('#num1').value);
            const num2 = parseFloat(document.querySelector('#num2').value);

            if(btn.value === 'add'){
                var num3 = num1 + num2;
            }
            else if(btn.value === 'sub'){
                var num3 =  num1 - num2;
            }
            else if(btn.value === 'mul'){
                var num3 =  num1 * num2;
            }
            else if(btn.value === 'divi'){
                var num3 =  num1 / num2;
            }
            else{
                console.log('that is not a number!');
            }
        });

        form.addEventListener('submit', e =>{
            e.preventDefault();
            form.result.value = num3;
        });
    </script>

Should submit button colors match color scheme or be consistent across products?

The consistency of the design is not done by the choice of colors or its quantity, but by the design itself. The color is just one more component within the design guidelines.

If you define color variability in the design guidelines as a design component, the color change in the buttons can be an element of manifestation of this variable, provided that the shape of the buttons is sufficiently personal and recognizable.

A clear and extreme example of the use of different colors in design is the Carrefour supermarket logo. Although one of the basic canons in corporate image is the consistency of unique and representative colors, when Carrefour presented its new design in 2009, it did so with a considerable number of gradients to be used in its differents communication needs.

enter image description here

Page from the Carrefour Brand Book

Add a Flow button in a SharePoint library

I have recently added a Flow button in a SharePoint Library. I found the code on internet (I have no experience in JSON).

I would like the button to be visible if:

  1. Document status (choice column) is different than Approved
  2. Approvers (person column) is not empty
  3. Ready for Approval (boolean column) is True

I could implement only one condition: Document status (choice column) is different than Approved

But I wonder how can I add the other 2 conditions?

Any help would more than appreciated.

The code looks like this:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "span",
  "style": {
    "color": "#001f00"
  },
  "children": (
    {
      "elmType": "button",
      "style": {
        "border": "light",
        "background-color": "Orange",
        "color": "#001f00",
        "cursor": "pointer",
        "visibility": {
          "operator": "?",
          "operands": (
            {
              "operator": "!=",
              "operands": (
                "($Document_x0020_status)",
                "Approved",
              )
            },
            "visible",
            "hidden"
          )
        }
      },
      "txtContent": "Send to Approval",
      "customRowAction": {
        "action": "executeFlow",
        "actionParams": "{"id": "53c665d0-ce12-4148-aa5a-c7202557ea78"}"
      }
    }
  )
}

unity – Some UI button script not working in apk build!

There are a lot of posts regarding this problem in various website and even in this one but no one has given a feasible solution to this problem. I have a button that has a custom sprite. I also have a custom script attached to that button which when pressed down (IPOINTER DOWN) changes the color of particular sprite renderer. All this works in pc but not on apk build. Why?
I have two canvas, so I thought there might be raycasting issues, so I disabled one but still no luck.
The buttons are in world space in canvas. So, I thought I might not use a canvas but IPointer only works on clickable UI elements.

swift – Add button to uitableview cell programmatically

I just want my code to produce a button in every table view cell that has text. When the button is press just have it say hi. Each cell should have a button in it. I want this to be done all and code and do not use the storyboard at all. The class should remain a uiview controller and not be changed.

import UIKit

class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {

    private let myArray: NSArray = ("First","Second","Third")
     var myTableView =  UITableView()

    override func viewDidLoad() {
        super.viewDidLoad()

        myTableView.register(UITableViewCell.self, forCellReuseIdentifier: "MyCell")
        myTableView.dataSource = self
        myTableView.delegate = self
        
        
        
        self.view.addSubview(myTableView)
        myTableView.translatesAutoresizingMaskIntoConstraints = false
        
        
        
        NSLayoutConstraint.activate((

            myTableView.heightAnchor.constraint(equalTo: view.heightAnchor, multiplier: 0.90),
            myTableView.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 1),
            myTableView.topAnchor.constraint(equalTo: view.topAnchor),
            myTableView.leadingAnchor.constraint(equalTo: view.leadingAnchor),



        ))
    }

    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        print("Num: (indexPath.row)")
        print("Value: (myArray(indexPath.row))")
    }

    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return myArray.count
    }

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "MyCell", for: indexPath as IndexPath)
        cell.textLabel!.text = "(myArray(indexPath.row))"
        return cell
    }
}

image – How to make a button look disabled

Hopefully this isn’t too specific for here. I have the following button image that I use on my site

enter image description here

Here’s an example with text:

enter image description here

This is rendered using the following CSS:

input.borderlessButton {
    background: url("../Images/button.png") no-repeat scroll 0 0
}

In the HTML it’s getting disabled

<input type="submit" disabled/>

This, obviously doesn’t change the look as the image doesn’t change. I can add a CSS :disabled pseudo class.

But how’s the best way to make the button above look disabled?

All suggestions welcome.