YouTube reply button missing in comments

I am rarely seeing a “Reply” option in the comments under YouTube videos. It is there for a few upvoted comments, but for 99% the reply button is missing! For example, see the comment section of this video: https://www.youtube.com/watch?v=raLkw3_IIFc. You can only reply to the two top comments:

enter image description here

Here is a nice report of the problem from the last year https://www.youtube.com/watch?v=-MuofdTPhEA. Has there been any solution/workaround found since?

Making a button with a left and right half

I am trying to make a button in android that does different things depending on whether you click on the left half of the button or on the right half of the button.

Some additional things that the button needs to do are:

  • Have 1-4 of these buttons in an activity all of the same size.
  • Be able to rotate the button (e.g. 90 degrees, 180 degrees so it’s upside-down).

I thought up some different solutions and need to know what would be best practice.

Option 1: Put 2 buttons inside of LinearLayout, remove the spacing in-between them, and then add a text-view on top to make it look like one button.

Pros:

  • Easy to do

Cons:

  • It feels like a hackjob and may come back to bite me if I need to change things later.

Option 2: Build a custom View to do the job.

Pros:

  • I can build it to tailor exactly to my needs.

Cons:

  • I’m not sure how to do this or where to find out how to do this.

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

Redux store seems to still persist some data upon clicking back button [Firefox]

I’m pretty new to Redux and I’m working on a project where there involves some user auth and data associated with that user gets loaded after the user is verified. After the user logs out, I clear the store by doing

const rootReducer = (state, action) => {   if (action.type === USER_LOGOUT) {     state = undefined;     window.location = "somePage.jsp";   }   return appReducer(state, action); }; 

On Chrome, when I click the back button, the store doesn’t have any residual information so this works as expected.

However, on Firefox, when I click on the back button I’ve found that the store still persists some data.

Am I missing something in my steps to clearing out my store or is there a different behavior in Firefox?

Thanks for your help!

Project Online Intercept Ribbon Save Button Action

Need to intercept Project Online Save Button. To perform some action before Project Server update starts. Once my action is successful, I would like original code of Project Server Save to take over.

Below is the Original HTML available

<a class="ms-cui-ctl-large " id="Ribbon.Tabs.PDP.Home.Project.Save-Large" onclick="return false;" href="javascript:;" mscui:controltype="Button" aria-describedby="Ribbon.Tabs.PDP.Home.Project.Save_ToolTip" role="button" unselectable="on"><span class="ms-cui-ctl-largeIconContainer" unselectable="on"><span class=" ms-cui-img-32by32 ms-cui-img-cont-float ms-cui-imageDisabled" unselectable="on"><img class="" style="top: -32px;left: -320px;" unselectable="on" src="/_layouts/15/1033/images/ps32x32.png?rev=45" data-themekey="#"></span></span><span class="ms-cui-ctl-largelabel" unselectable="on">Save</span></a> 

Also, I have tried addEventListener as below

document.body.addEventListener(‘click’, function( event ) { if(event.target.id==”Ribbon.Tabs.PDP.Home.Project.Save-Large”){ console.log(‘mouse button click: ‘, event.target.id); SaveData(_defaultVal,projectName,_curTAB); } }, false);

But unfortunately, I was unable to intercept the save click. However, If i try mouseover it is working fine.

Any idea ?

How to customize the “Add to Cart” button of a product?

I created a custom module with Drupal 8 and Commerce 2.11 to modify the “Add to Cart” button of the product sheets.

The module works, but it is currently applied to all products.

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

How to customize the “Add to Cart” button of a product ?

<?php  use Drupal\commerce_store\Entity\StoreType; use Drupal\commerce_product\Entity\ProductType; use Drupal\commerce_product\Entity\ProductVariationType; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Url;  function mymodule_form_commerce_order_item_add_to_cart_form_alter(&$  form, \Drupal\Core\Form\FormStateInterface $  form_state, $  form_id) {   $  current_store = \Drupal::service('commerce_store.current_store');   $  owner = $  current_store->getStore()->getOwner();   foreach ($  form_state->getFormObject()->getEntity()->getPurchasedEntity()->getProduct()->getStores() as $  store) {     $  bundle = $  store->bundle();     // Product type abonnement.     if ($  bundle == 'online') {       if (isset($  form["#attributes"]["class"]) && in_array("commerce-order-item-add-to-cart-form", $  form["#attributes"]["class"])) {         $  selectedVariationId = $  form_state->get('selected_variation');         $  selectedVariation = \Drupal\commerce_product\Entity\ProductVariation::load($  selectedVariationId);         $  form['actions']['submit']['#value'] = t('Subscribe');         if (!$  owner->hasRole('marchand')) {           $  form['actions']['submit']['#attributes']['class'] = array('button--add-to-cart', 'button button--primary', 'js-form-submit', 'form-submit', 'is-disabled', 'btn-warning', 'btn');           $  form['actions']['submit']['#disabled'] = TRUE;         }       }     }   } } 

I added commerce-order-item-add-to-cart-form-commerce-product-50 to my code but it does not work :

<?php  use Drupal\commerce_store\Entity\StoreType; use Drupal\commerce_product\Entity\ProductType; use Drupal\commerce_product\Entity\ProductVariationType; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Url;  function mymodule_form_commerce_order_item_add_to_cart_form_alter(&$  form, \Drupal\Core\Form\FormStateInterface $  form_state, $  form_id) {   $  current_store = \Drupal::service('commerce_store.current_store');   $  owner = $  current_store->getStore()->getOwner();   foreach ($  form_state->getFormObject()->getEntity()->getPurchasedEntity()->getProduct()->getStores() as $  store) {     $  bundle = $  store->bundle();     // Product type abonnement.     if ($  bundle == 'online') {       if (isset($  form["#attributes"]["class"]) && in_array("commerce-order-item-add-to-cart-form-commerce-product-50", $  form["#attributes"]["class"])) {         $  selectedVariationId = $  form_state->get('selected_variation');         $  selectedVariation = \Drupal\commerce_product\Entity\ProductVariation::load($  selectedVariationId);         $  form['actions']['submit']['#value'] = t('Subscribe');         if (!$  owner->hasRole('marchand')) {           $  form['actions']['submit']['#attributes']['class'] = array('button--add-to-cart', 'button button--primary', 'js-form-submit', 'form-submit', 'is-disabled', 'btn-warning', 'btn');           $  form['actions']['submit']['#disabled'] = TRUE;         }       }     }   } } 

enter image description here

Magento 2 controller redirect on button click in phtml file

I want to redirect customer using controller when button is clicked in one of my phtml files.

So far I got, controller:

public function execute(){     return $  this->addToCart(); }  public function addToCart(){     // some logic     $  this->_redirect('checkout/cart/index'); } 

The above is working fine (redirecting) when you access the controller via URL (www.mydomain.com/batchorder/index/addtocart).

And here is my .phtml file:

$  ("#addToCart").click(function(){ let controllerUrl = "<?php echo $  block-getUrl('batchorder/index/addtocart'); ?>" $  .post(controllerUrl, { "products": JSON.stringify(sideCart.SideCartProducts) }) 

The post request returns my logic as it should, however, it is not redirecting. Anyone can help?

Libreoffice has no menubar in Kubuntu 18.04 if Application button (for global menus) is added on window titlebar

It looks like a bug but I am not sure which program is to blame..

In Plasma 5.12 the option to add global menus in window titlebar has been removed. There is a panel widget that adds global menus to the panel, but also global menus are still available in the window titlebar as a button. I have added that button with global menus as indicated here. That’s under System Settings > Application Style > Windows Decorations > (tab) Buttons:

enter image description here

The idea is to get the global menus into a left-side button on the window upper margin; like for example in Chrome:

enter image description here

When this is done, Libreoffice has no menubar anymore. Adding the Menubar button and using it has no effect.

enter image description here

But once the “Application” button is dragged away from the titlebar at System Settings > Application Style > Windows Decorations > (tab) Buttons, the menubar in Libreoffice comes back.

enter image description here

When the motion button is pressed, the shape of the character changes and always goes to the left direction

good day. When the motion button is pressed, the shape of the character changes and always goes to the left direction.

Why is this happening and what is the solution?

enter image description here

enter image description here

Pressing two buttons moves to the left and the shape changes.

using System.Collections; using System.Collections.Generic; using UnityEngine;

public class PlayerKontrol : MonoBehaviour {

public float karakterHizi = 8f, maxSurat = 4f; private Rigidbody2D myRigidbody; private Animator myAnimator;   private bool solaGit, sagaGit;  void Awake () {     myRigidbody = GetComponent<Rigidbody2D> ();     myAnimator = GetComponent<Animator> ();  }  void FixedUpdate () {     if (solaGit) {          SolaGit ();     }      if (sagaGit) {          SagaGit ();     } }  public void AyarlaSolaGit (bool solaGit) {     this.solaGit = solaGit;     this.sagaGit = !solaGit; }  public void HareketiDurdur () {     solaGit = sagaGit = false;     myAnimator.SetBool ("run", false); }  void SolaGit (){      float Xdurdur = 0f;     float surat = Mathf.Abs (myRigidbody.velocity.x);      if (surat < maxSurat)         Xdurdur = -karakterHizi;      Vector3 yon = transform.localScale;     yon.x = -0.3f;     transform.localScale = yon;      myAnimator.SetBool ("run", true);      myRigidbody.AddForce (new Vector2 (Xdurdur, 0));  }  void SagaGit () {      float Xdurdur = 0f;     float surat = Mathf.Abs (myRigidbody.velocity.x);      if (surat < maxSurat)         Xdurdur = -karakterHizi;      Vector3 yon = transform.localScale;     yon.x = 0.3f;     transform.localScale = yon;      myAnimator.SetBool ("run", true);      myRigidbody.AddForce (new Vector2 (Xdurdur, 0));  } 

}

When the motion button is pressed, the shape of the character changes and always goes to the left direction

good day. When the motion button is pressed, the shape of the character changes and always goes to the left direction.

Why is this happening and what is the solution?

enter image description here

enter image description here

Pressing two buttons moves to the left and the shape changes.

using System.Collections; using System.Collections.Generic; using UnityEngine;

public class PlayerKontrol : MonoBehaviour {

public float karakterHizi = 8f, maxSurat = 4f; private Rigidbody2D myRigidbody; private Animator myAnimator;   private bool solaGit, sagaGit;  void Awake () {     myRigidbody = GetComponent<Rigidbody2D> ();     myAnimator = GetComponent<Animator> ();  }  void FixedUpdate () {     if (solaGit) {          SolaGit ();     }      if (sagaGit) {          SagaGit ();     } }  public void AyarlaSolaGit (bool solaGit) {     this.solaGit = solaGit;     this.sagaGit = !solaGit; }  public void HareketiDurdur () {     solaGit = sagaGit = false;     myAnimator.SetBool ("run", false); }  void SolaGit (){      float Xdurdur = 0f;     float surat = Mathf.Abs (myRigidbody.velocity.x);      if (surat < maxSurat)         Xdurdur = -karakterHizi;      Vector3 yon = transform.localScale;     yon.x = -0.3f;     transform.localScale = yon;      myAnimator.SetBool ("run", true);      myRigidbody.AddForce (new Vector2 (Xdurdur, 0));  }  void SagaGit () {      float Xdurdur = 0f;     float surat = Mathf.Abs (myRigidbody.velocity.x);      if (surat < maxSurat)         Xdurdur = -karakterHizi;      Vector3 yon = transform.localScale;     yon.x = 0.3f;     transform.localScale = yon;      myAnimator.SetBool ("run", true);      myRigidbody.AddForce (new Vector2 (Xdurdur, 0));  } 

}

When the motion button is pressed, the shape of the character changes and always goes to the left direction

good day. When the motion button is pressed, the shape of the character changes and always goes to the left direction.

Why is this happening and what is the solution?

enter image description here

enter image description here

Pressing two buttons moves to the left and the shape changes.

using System.Collections; using System.Collections.Generic; using UnityEngine;

public class PlayerKontrol : MonoBehaviour {

public float karakterHizi = 8f, maxSurat = 4f; private Rigidbody2D myRigidbody; private Animator myAnimator;   private bool solaGit, sagaGit;  void Awake () {     myRigidbody = GetComponent<Rigidbody2D> ();     myAnimator = GetComponent<Animator> ();  }  void FixedUpdate () {     if (solaGit) {          SolaGit ();     }      if (sagaGit) {          SagaGit ();     } }  public void AyarlaSolaGit (bool solaGit) {     this.solaGit = solaGit;     this.sagaGit = !solaGit; }  public void HareketiDurdur () {     solaGit = sagaGit = false;     myAnimator.SetBool ("run", false); }  void SolaGit (){      float Xdurdur = 0f;     float surat = Mathf.Abs (myRigidbody.velocity.x);      if (surat < maxSurat)         Xdurdur = -karakterHizi;      Vector3 yon = transform.localScale;     yon.x = -0.3f;     transform.localScale = yon;      myAnimator.SetBool ("run", true);      myRigidbody.AddForce (new Vector2 (Xdurdur, 0));  }  void SagaGit () {      float Xdurdur = 0f;     float surat = Mathf.Abs (myRigidbody.velocity.x);      if (surat < maxSurat)         Xdurdur = -karakterHizi;      Vector3 yon = transform.localScale;     yon.x = 0.3f;     transform.localScale = yon;      myAnimator.SetBool ("run", true);      myRigidbody.AddForce (new Vector2 (Xdurdur, 0));  } 

}