Open ajax dialog with JavaScript

By adding use-ajax to a link we can open a modal using the Drupal ajax library as per the docs.

E.g.

<a class="use-ajax" 
    data-dialog-options="{&quot;width&quot;:400}" 
    data-dialog-type="modal" 
    href="/node/1">
    First article displayed in modal dialog.
</a>

This will use the ajax library to fetch node/1 and then display it in a modal.

There is also a Dialog API for JavaScript which allows opening modals using JavaScript.

E.g.

var myDialog  = Drupal.dialog(ADOMElement, settings);
myDialog.show();

The problem with this API is you need to pass in a existing DOM element.

My question is can I trigger opening a modal with JavaScript and utalise the internal Drupal ajax library to actually fetch the content?

E.g Can I do something like this?

var myDialog  = Drupal.dialog('/node/1', {useAjax: true});
myDialog.show();

I could just create an html link as per my first code block, hide it with css, and then trigger a click on it with JS but this seems a hit hacky – there must be a way to trigger this action using pure JS.

linux – Open clicked links in forwarded X11 email in a local browser instance

I forward Claws mail from my laptop to my desktop over ssh. When I click on links in messages Claws will try to open a browser process on the laptop. I use Brave and it uses hardware acceleration which doesn’t tunnel well, so I can’t forward it from the laptop to the desktop. Instead, I’d like to open the links on my desktop where I already have a browser open.

There’s another question on StackExchange where someone asked this, but there aren’t any answers, just comments.

How can I accomplish this? I currently copy and paste the links into my browser but that’s a pain and I don’t want to keep doing that.

sharepoint online – How to open files in search result in client app

Sharepoint Online – Modern Search

When searching for a file, clicking on it doesn’t open it in the client app.
It also creates some kind of ‘unique sharinglink’ (ex: tenant.sharepoint.com/:x:/r/sites/…)

When browsing to the site and library, the file will open in the client app.

When browsing to the old searchpages, I can set the setting to open in client and it works.

When using the new searchbar, on top of every site… it doesn’t

Any ideas?

uploads – A method to force open the Media Manager UI when directly uploading in the editor

I am trying to find a way to force open the Media Manager UI after uploading an image (or simply use the Media Manager rather than the Upload button, if easier).

The reason for this approach is that I have added some custom validation code in the default wp.media.frame to validate some image metadata (credits) and allowing an upload/insert only if this field contains data. This works as long as the editor uses the Media Manager’s upload tab is used to upload an image (since it auto-opens the library tab with the uploaded image preselected). But if the editor simply uploads the image using the Uploader button, then the media manager never opens and the validation never occurs, leading to potential images without credit metadata.

I understand that the wp.Uploader object handles the upload. I have tried to link to various events (success, reset, complete ) but none fire when used in the js. eg.

    wp.Uploader.queue.on('init', function() {
        console.log('Upload init!');
    });
    wp.Uploader.queue.on('progress', function() {
        console.log('Upload progress!');
    });
    wp.Uploader.queue.on('success', function() {
        console.log('Upload success!');
    });
    wp.Uploader.queue.on('complete', function() {
        console.log('Upload complete!');
    });
    wp.Uploader.queue.on('FileUploaded', function() {
        console.log('Upload FileUploaded!');
    });
    wp.Uploader.queue.on('reset', function() {
        console.log('Upload reset!');
    });

Is the above possible? It can be the default behaviour for all upload events. A last resort could be to hack the css and hide the upload button fully but that seems clunky at he least.

enter image description here

Thanks!

apache 2.4 – PHP Warning: failed to open stream: HTTP request failed

I have two web servers:

www.example.com.ar and eventos.example.com.ar

I get the errors such as:

(Wed Sep 16 12:11:30.872792 2020) (php7:warn) (pid 17125) (client xx.yy.226.234:48896) PHP Warning: file_get_contents(https://eventos.example.com.ar/eventos/api/events?month=9&year=1999): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Requestrn in /var/www/www_example_com_ar/wp-content/plugins/example-plugin/mlc-plugin.php on line 340

The line 340th has:

$rest = file_get_contents('https://eventos.example.com.ar/eventos/api/events?month='.$month.'&year='.$year, true);

I’ve tested with curl on the same host that runs www.example.com.ar and I don’t get such an error:

curl -I "https://eventos.example.com.ar/eventos/api/events?month=9&amp;year=1999"
HTTP/1.1 200 OK
Date: Wed, 16 Sep 2020 19:26:05 GMT
Server: Apache/2.4.39 () OpenSSL/1.0.2k-fips
X-DNS-Prefetch-Control: off
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=15552000; includeSubDomains
X-Download-Options: noopen
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Content-Length: 37027
ETag: W/"90a3-gzipB01lW17JrEb0GD0k0g2zFow"

I have installed:

  • Apache: httpd-2.4.6-90.el7.centos.x86_64
  • PHP: php73-php-7.3.15-1.el7.remi.x86_64

By the way, I have:

php73 -i | grep allow_url_fopen
allow_url_fopen => On => On

On CentOS 7.7

So, the question is: what does it cause that error?

dual boot – Cannot open ubuntu 20.06 which is in downloads on my hp pavilion with xp. dualboot

Step 1- Get a pen drive / HDD with enough space (above 5–6gb is more than enough).

Step 2- Format it by right clicking on the drive and clicking format.

Step 3- Download UNetbootin. This software allows you to create a bootable HDD/pendrive. Do not forget to download the Ubuntu ISO file.

Step 4- if you want to keep Windows XP and Ubuntu, partition your drive. Refer to YouTube tutorials for this because I’m not experienced enough to share this. If you want to kill Windows XP forever, ignore this.

Step 5- Shut down your PC, connect your pen drive and select boot from USB. To do this step successfully, you need to know your motherboard model and company as it varies from company to company. Once again, refer to YouTube for this step.

Step 6- Follow the steps and install just like any other windows program.

Step 7- Post installation, enjoy Linux life.

Can not CheckOut ,edit and open master pages,Page Layouts in share point 2013 designer

using share point designer 2013 i can not open master page and edit master page all the settings for share point designer allowed for web application level.

SharePoint Farm has 2 WFE Servers Web Application created on Port 81 Web Application URL: First WFE Server name & Port: http://spTestWfe1:81 Port 81 is allowed from my PCto WFE

when i try to edit master pages or page layouts below is the message from SPD
enter image description here

could not find a webserver at ” on port 81. please check to make sure that the web server name is valid and your proxy settings are set correctly sharepoint designer

create a terminal command to open another user profile in chrome

How can i create a terminal command to open another user profile in chrome ?
It took me a long time to switch between them,because i a lot of user in chrome?
“ code “`
bold
italic

quote

No option to click on list items to open form

Stack Exchange Network


Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

How to remove the open to work frame on linkedin without changing other things

I am actively looking for a job and used open to work feature on LinkedIn (all LinkedIn members can see that I am open to work). Recently Linkedin comes out with a new feature”open to work frame”, which means if I allow all the LinkedIn members to see that I am open to work, the ‘open to work frame’ will automatically be added on my profile photo. I really do not like the photo frame and want to remove it without change my ‘open to work’ status, however, it seems that Linkedin does not give me this option. I wonder, is anybody in the same situation as me? I really want to convince LinkedIn to give me an option that ‘open to work without open to work frame’.And anybody knows how to do it? Thank you very much.