javascript – Como que eu faço um component igual a essa notificação/popup do messenger?

Eu quero reproduzir esse circulo que aparece quando você recebe uma nova menssagem e abre o chat do Messenge, mas eu não sei o nome desse componente e como isso funciona exatamente. Eu procurei por isso na internet mas eu ainda não tenho idéia do que é.

Segue uma imagem do que eu to tentando explicar. Eu quero reproduzir esse comportamento de pop-up em outro app.

inserir a descrição da imagem aqui

Facebook Messenger active status is missing

My active facebook / messenger status is missing even if I have not disabled the active status. Every time I become inactive or disconnected, my status is missing and does not make the xx active. Any solution or explanation for this problem?

Google tag manager: how to set default language for Facebook Messenger chat plugin for users who are not logged in to Facebook?

I've been using this tip to add the Facebook Messenger chat plugin on a website via Google's Tag Manager, and it's working (thanks a lot!)

But when the visitor is not connected to their Facebook account, the welcome phrase is in English. The other translations managed through the Facebook app work correctly when connected to Facebook.

I'm not really in the code, but I changed this:

js.src = "https://connect.facebook.net/en_US/sdk.js";

in that:

 js.src = "https://connect.facebook.net/fr_FR/sdk.js";

without effect

Enable CSF Messenger

CSF (Configserver Security & Firewall) is actually a kind of complete firewall and, of course, it can be said that it is a security complement to cont … | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1806975&goto=newpost

translation – How to translate the Facebook Messenger chat plugin on the site through Google Tag Manager

I've been using this tip to add Facebook Messenger chat plugin on a website via Google Tag Manager, and it's working (thanks a lot!) How to add Facebook Messenger client chat plugin to your site using Google Tag Manager

but: when the visitor is not connected to their FB account, the welcome phrase is in English.
The other translations managed through the FB app work correctly when connected to FB.

I'm not really in the code, but I changed this:
js.src = "https://webmasters.stackexchange.com/https://connect.facebook.net/**en_US/sdk.js";enter the image description here
in that :
js.src = "https://webmasters.stackexchange.com/https://connect.facebook.net/fr_FR/sdk.js";
without effect

Do you have a solution ?

you have a good day,
TO.

How to ask frequently asked questions on the Messenger home page

enter the image description here

I want to have questions like in that image … where should I go to Facebook to configure them for my page?

Can I make privacy on Facebook Messenger?

On Facebook Massager, anyone can see which of my contacts was active before some time like 10 minutes ago, 1 day ago.

Please let me know, can I hide this information?

Regards
TekQ

Choose folders for photos in messenger

So, have an Oppo CPH1701, running Android 6.0.1.

In my photo gallery, I can organize the photos into folders, and by default, my photos and videos I take with my camera are also automatically classified in their own folder. However, when I want to choose a photo or video to send through the Messenger application, they are not organized, just sorted by date.

Is there a way in the app that I can sort these photos?

Facebook / Messenger – Exchange web application stack

Recently, something has happened and I want to communicate with someone who I can see their profile and see their profile photos, and their most recent, but when I try to send them a message, they say that the option could not be done and I do not know why (by the way, this person and I are not friends on Facebook) (This person was also using Messenger recently)

8 – Store custom messages displayed by Drupal :: messenger () -> addMessage () in the database

The suggestions from @Taggart Jensen, @NoSssweat and @Jaypan to use custom entity types are clearly good, given my original question. When I started working on a solution using custom entities, I realized that I could use the t () function and User interface translation (which I already use for string overrides) to do what I want.

My goal:

Make it easier for editors to change the wording of the messages that our custom shows rsc module. Unintentionally stop adding a new entry to the interface translation table every time I change a message in my module code.

My solution:

I created a simple helper function on my rsc module to display messages:

function rsc_message($key, $args=())
{
  Drupal::messenger()->addMessage(t('rsc-' . $key, $args));                    
}

I realize this isn't particularly brilliant, but I wanted a way to constantly add rsc- to each key An example of a call to this function is:

rsc_message('option-expired',
(
  '@option' => $option,
  '@date' => date("F j", $expireTime),
  '@time' => date("g:i a", $expireTime)
));

The corresponding entry in User interface translation (once the key is added to the translation table and once you enter the "translation" shown below) it will be:

rsc-option-expired | The option @option expired on @date at @time.

As you see, I'm having a key to rsc_message instead of a viewable message. This allows me to use User interface translation as my chain manager. It is easy to find my keys using String contains in the manager because they all start with rsc-.

Kindness of using this approach:

  • I don't have much additional code to maintain.
  • Editors change our habit rsc module chains that use the same manager that they use for other chains.
  • All my message chains (25 or so) can be viewed at the same time.
  • Inadvertently, I create a new translation table entry every time I change a string in my rsc module code los key Still the same; We only change the translation through the administrator.
  • I can directly include HTML tags in the translation, so I don't have to worry about the @ var,% var, function! Var t ().
  • I can export the translations for bulk editing or reuse them.

Wickedness of this approach:

  • A key it is not added to the translation table until the message for that key is displayed. Sometimes getting a particular error message to display can be challenging.
  • I can't enter a translation in the table for a key until the key is there.

To overcome evil, I created a quick and dirty chain manager feature in my habit rsc module as page string-manager. It allows me to add strings to the table, remove strings from the table, and test strings on the table to make sure they work correctly. Here is the code.

In / custom / rsc / rsc.routing.yml modules

rsc.stringManager:

  path: '/string-manager/{key}/{p1}/{p2}/{p3}/{p4}/{p5}'
  defaults:
    _controller: 'DrupalrscControllerrscController::stringManager'
    _title: 'String Manager'
    p1: ''
    p2: ''
    p3: ''
    p4: ''
    p5: ''
  requirements:
    _role: 'administrator'

In / custom / rsc / src / Controller / rscController.php modules

namespace DrupalrscController;

use DrupalCoreControllerControllerBase;

class rscController extends ControllerBase
{
  public function stringManager($key, $p1, $p2, $p3, $p4, $p5)
  {
    require_once DRUPAL_ROOT . '/modules/custom/rsc/rsc_string_manager.php';

    return
    (
      '#markup' => rsc_string_manager($key, $p1, $p2, $p3, $p4, $p5)
    );
  }
}

In modules / custom / rsc / rsc_string_manager.php

function rsc_string_manager($key, $p1, $p2, $p3, $p4, $p5)
{
  // Avoid accidental add or delete of non-rsc strings.
  // Prepend ! to a key to override this safety measure.

  if (strpos($key, '!') === 0) {
    $key = substr($key, 1);
  }
  else if (strpos($key, 'rsc-') !== 0) {
    return "Prefix $key with rsc- or use ! to override";
  }

  // Note: '++' in the query string gets converted to '  '

  if (strpos($key, '  ') == strlen($key)-2) {
    $key = rtrim($key, ' ');
    $action = 'add';
  }
  else if (strpos($key, '--') == strlen($key)-2) {
    $key = rtrim($key, '-');
    $action = 'delete';
  }
  else {
    $action = 'check';
  }

  $storage = Drupal::service('locale.storage');
  $string = $storage->findString(('source' => $key));

  if ($action == 'add') {
    if (!is_null($string)) {
      return "$key -- ALREADY EXISTS";
    }
    $string = new DrupallocaleSourceString();
    $string->setString($key);
    $string->setStorage($storage);
    $string->save();
    return "$key -- ADDED";
  }
  else {
    if (is_null($string)) {
      return "$key -- NOT FOUND";
    }  
    if ($action == 'delete') {
      $string->delete();
      return "$key -- DELETED"; 
    }
    else { // ($action == 'check')
      $mask = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_';
      $args = ($p1, $p2, $p3, $p4, $p5);
      $trans = t($key);
      $params = ();

       // Find placeholders in the "translated" string and match arguments
       // to them in their order in the url. We use only @ placeholders
       // because we can use bold, italics, etc. in the translated string.

      $i = 0;
      $p = 0;
      while ($i < count($args) && $args($i) && ($p = strpos($trans, '@', $p)) !== false) {
        $q = strspn($trans, $mask, $p+1);
        $params(substr($trans, $p, $q+1)) = $args($i);
        $p += $q;
        $i++;
      }
      return t($key, $params);
    }
  }
}

Use:

  • key ++ (add a key)
  • key-- (delete a key)
  • key / p1 / p2 / ... (check a translation)

Example:

  • mysite.com/string-manager/rsc-option-expired++ (add)
  • mysite.com/string-manager/rsc-option-expired (consult)
  • mysite.com/string-manager/rsc-option-expired/retry/April 1/2:30 pm (check with parameters)
  • mysite.com/string-manager/rsc-option-expired-- (delete)

Add the key (line 1 above). The text displayed is:

rsc-option-expired -- ADDED

To go User interface translationsearch for strings containing "rsc-" and find the newly added string. The string table contains:

rsc-option-expired | 

In the Translation to English column, paste in:

The option @option expired on @date at @time.

Now the string table contains:

rsc-option-expired | The option @option expired on @date at @time.

Check the translation without parameters (line 2 above). The text displayed is:

The option @option expired on @date at @time.

Verify the translation with the parameters (line 3 above). The text displayed is:

The option retry expired on April 1 at 2:30 pm.

Delete the key (line 4 above). The text displayed is:

rsc-option-expired -- DELETED

Now the rope is gone from the table.

This utility has been quite useful to me since I have added messages to my rsc module. When I add a new message key, I use the utility to immediately add it to the translation table. Then I immediately add the translation (which publishers will no doubt change later, who likes the way developers say things?)

Perhaps this utility is not useful to anyone but me; However, it took me a long time to figure out how to manipulate the translation string table correctly, so maybe the bits of the code will help someone.

PS By using! before a key or removing the rsc- requirement in the code, you can use this utility to manipulate any string in the translation table (as long as it does not contain bars).