configure right click mouse for code comments in phpstorm? - phpstorm

Is it possible to configure comments code directly when right click mouse? For example, I select some code, then right click, then I can choose html comment, php comment, multiline comment.

No, it's not possible. But you can add your feature request on JetBrains tracker: http://youtrack.jetbrains.com/issues/WI#newissue=yes

Yes, all menus in PhpStorm are fully customisable.
Open Settings|Menus and Toolbars, then expand Editor popup menu, select any suitable existing element and use Add After to add one of Main Menu|Code|Comment ... actions.
This will make them appear in "right click menu" within editors. Action may be disabled depending on whether it is defined for the language at caret position.
Note, that built-in actions will automatically choose comment style depending on context.
If your intent is to specifically surround the selection with i.e. html comment you'll need to take additional steps - create a custom template for Surround with action, recording a Macro that invokes it on selection and adding that macro to the menu as described above.

Related

How to disable dialog that shows on pasting code in NetBeans?

When I paste a piece of code in the current HTML file NetBeans (12.5) always shows me the following dialog:
So, I need to press Esc every time. How to disable this dialog not to show it?
Displaying the Completion Window for HTML files is enabled by default, but it is easy to disable it:
Select Tools > Options > Editor
Select HTML from the Language droplist
Uncheck the Auto Popup Completion Window checkbox
Click Apply
Notes:
The change is immediately effective.
There are several other checkboxes in that same Options dialog (as shown above) which allow the Completion Window to still popup in specific situations.
Similar functionality for the Completion Window is also provided for some other languages, such as Java, JavaScript and PHP. Just select other languages from the Language drop list to see what functionality is available.

GTM Setup for tracking "click to display" text on wordpress

Code and GTM Setup Example
I have tried a few variations in how I set my triggers, but none of the ways I have tried have actually started to track test clicks. The client has click to display text to show their phone numbers, ideally so that we can track how many visitors are coming to the site to get the phone contact details. I will include some code below. I am not sure if it is my syntax or if I am forgetting something outside of this setup. GTM is installed correctly and tracking standard google analytic information. Thanks in advance.
Previously I have tried to limit the trigger based on the class, but I have instead added and moved to ID.
This is tricky part of GTM because when you have nested elements like this:
<div>
<span>
<h2>
It is sometimes difficult to say what exact element is clicked.
Your triggers are set for <div> (based on ID you have in your screenshot) but I suspect when you click the actual element that is picked up is one of the <span> ones. To fix it, firstly in GTM go to variables tab -> Configure Built-in variables and make sure "Click Classes" is enabled.
Then setup a trigger like this:
This one will listen to one of those spans you have there.
Usually my approach to click events is: before I setup the trigger I enable the preview mode with GTM so that I see GTM's debugger console. Then click on an element - this action will generate click event on left hand event log. Select it and you will be able to see exact element that is being clicked with it's IDs and classes. Then it's easy to setup the trigger.
Hope this helps.

Is there any shortcut to select entire code block in Atom similar to Option + Up Arrow in PhpStorm

Is there any shortcut to select entire code block in Atom similar to Option + Up Arrow in PhpStorm?
It helps you select the code block and if you press Option + Up Arrow again, it expands the selection to its parent block.
Is there any shortcut or plugin to have that feature? It makes it faster to work with heavy code.
Yes! You want the expand-region plugin, it's great! Add these to your keymap.cson to expand the region with option-up (alt-up on windows) :
'atom-text-editor':
'alt-up': 'expand-region:expand'
'alt-down': 'expand-region:shrink'
Ctrl+Alt+M (Cmd+Ctrl+M on Mac) selects entire code inside the current brackets. It doesn't expand to the parent block though.
If you need that feature, you might want to look for some package. There is select-scope package that claims to add that functionality. I haven't tested if it works. It also doesn't seem to show up on the package list in every atom version.
If you decide to try that package out, you may need to override it's key-binding as it uses Ctrl+S.
This is now built into Atom.
https://blog.atom.io/2018/10/23/atom-1-32.html
Select Larger/Smaller Syntax Node

Is it more accessible to use a <button> or <a> to open/close a modal? [duplicate]

This question already has an answer here:
Why are buttons discouraged from navigation?
(1 answer)
Closed last year.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
From my understanding, buttons are used to carry out functions and links are used to navigate the user to a different page. But what is best practice in terms of opening and closing a modal?
<a id="testModal" href="#">Open Modal</a>
or
<button id="testModal">Open Modal</button>
<button>
Change the <a href="#"> to a <button> and put your event handler on it.
Some more context on which elements belongs where....
Does the Control Take Me to Another Page? Use an Anchor
If, when clicked, tapped, or activated by keyboard or voice (or insert novel interaction method here), the user is whisked to another URL (including an anchor on the same page), then use <a href="[URL]">. Make sure you use the href attribute and that it has a real URL, not a “#” (otherwise you’re probably relying on JavaScript, which is not at all necessary for a hyperlink). If an href points to just a “#”, then you’re probably doing it wrong. If it points to a named anchor as part of your progressive enhancement efforts, then that’s totally valid.
Does the Control Change Something on the Current Page? Use a Button
If, when activated, the user is not moved from the page (or to an anchor within the page), but instead is presented with a new view (message boxes, changes in layout, etc.), then use a <button>. While you could use an<input type="button">, it’s more likely you’ll get into conflicts with pre-existing styles and subsequent developers (like me).
Does the Control Submit Form Fields? Use a Submit
If, when activated, information the user has entered (either by manually typing or by choosing items on the screen) is being sent back to the server, then use an <input type="submit">. This has better live within a <form>. If you need more styling control or have to embed more than just a simple text string, use a <button type="submit"> instead.
Keyboard Considerations
Think of keyboard users for a moment. A hyperlink can be fired by pressing the enter key. But a true button can be fired by pressing the enter key or the space bar. When a hyperlink has focus and the user presses the space bar, the page will scroll one screenful. If there isn’t more to scroll then the user just experiences nothing. Given a set of interface elements that look the same, if some work with a space bar and some don’t, you can’t expect users to have much confidence in how the page behaves.
I think it’s also worth mentioning that events triggered by a space bar only fire when the key is released, whereas using the Enter key will fire the event as soon as you press the key down (prior to releasing it).
I think there are two possible cases.
Your content is only visually hidden in page or visible in page (can be read by screen readers) and can be hash linked, then an anchor tag might be appropriate (this case is not so common, eg: use case is if you are highlighting a paragraph or image on the page as a modal).
In almost all other cases, your modal is loaded on the same page and is in no way navigated using a url link (except through ajax for accessing data possibly, which doesn't count). Hence it is a custom functionality and a button is the appropriate choice.
Sort of by definition, a dialog is something that will pop up over the current window. You're not really leaving the window, it's just temporarily unavailable. Once you're done with the dialog, you typically go back to the window. So in that respect, you don't want to use a link because you're not going to another page. You're doing some action on the current page. Use a button.
When using a screen reader, I will often bring up the list of links (Ins+F7 in JAWS) to see what pages I can link to. I'll also bring up a list of buttons (Ctrl+Ins+B) to see what actions are available on the page. I would expect the action to bring up a modal dialog to be in my button list.

Adding GUI controls to external program

is it possible to add buttons or menu items to external programs? For instance, adding an menu item into notepad itself which will show a messagebox (after clicking on it) with the current text within notepad. if yes, is there a url which gives some more details about it?
looking forward to your answers.
It's possible by creating the control (via the Windows API or whatever) and then assigning your target window's HWND as the new control's parent. For reference, check the SetParent Win32 API function on MSDN.
Not sure how well this will work with a menu, but that's the normal way to add a control to a window. Be careful, though. There are lots of gotchas (commands taken by the target application, memory considerations, etc).