intellij function parameters are underlined - javascript

Weird to see and figure out, I am trying to remove these underlines. I guess they are present due to wrong language support or some other issue, but I simply cant remove them. Any guess on why they are and how can i remove them?

That's actually part of the default color scheme for JavaScript. You can change it easily though:
File → Settings → Editor > Colors & Fonts > JavaScript
Then find "Parameter" in the list of styled elements, and on the right side is a checkbox for "Effects", simply disable this and save and you will no longer have underlined parameter names.
Depending on your version of IntelliJ, you may have to save a copy of the default theme first because they didn't always let you overwrite the built in ones.

Related

How to allow double click selection of strings with - in them, within Atom?

Say I have a string like 'cheap-module-inline-source-map' in the following:
In Atom, I want to be able to just double click that string to select the entire string. However it only let's me select the words I click on.
I did find the following in Settings > Editor:
Originally it was /\()"':,.;<>~!##$%^&*|+=[]{}?-…
I removed the - however this did not fix the issue.
You have already looked at the global settings (under "Editor"), but many settings (including this one) appear in the various packages so that you can customize things per syntax.
This setting seems to exist in both language-javascript and language-babel, and perhaps you have other Javascript packages that have it (there are many of them out there...)
If you navigate to...
Settings
Packages
search for "javascript" or "babel"
click "Settings" on the package
Then you will find a "Grammar" settings section in most syntax packages. This is the one from language-javascript.
As you can see it has a copy of the Non-Word Characters setting. You can set this explicitly, though I would have expected it to inherit from the global value.
language-babel has this too, though you need to scroll down a bit further to find it.

How to set JSX files default to Babel text highlighting in sublime

I have a babel text highlighting that i added in my sublime. However every time I open a new react project it defaults to javascript text highlighting then i have to reset each javascript file to get the correct text highlighting. As you can see in the lower right of my screenshot it is by default set to javascript.
The syntax that Sublime selects is based primarily on the extension that the file has.
You can select View > Syntax > Open all with current extension as... from the menu while you have such a file open to tell Sublime what syntax you want it to use for any particular extension.
If you sometimes use regular JavaScript as well, you'll experience your current problem in reverse; you will have to manually swap the syntax back to JavaScript.
Either way, the Project Specific Syntax Settings package may also be useful in this case if you use projects. It will allow you to configure per project what you want the syntax for different files to be.
What I did was to make babel(JavaScript) the default, preventing the default JavaScript by adding it as a value to ignored_packages.
To do this, open your sublime, click on Preferences > settings then paste this in:
"ignored_packages":["JavaScript"]
More details here: https://github.com/babel/babel-sublime

how to create a style selector in google closure editor

I wonder how difficult it is to create a working "style selector" selector in the goog closure editor similar to the one in tinymce.
I mean a selector of text styles such as
heading 1
heading 2
heading 3
paragraph
From the documentation I take that there's none available by default, even though there are slightly related default buttons such as bold etc. The logic for the pre-existing buttons I am aware of are provided in a plugin called basictextformatter.js.
I'm familiar with writing plugins and I would implement this using the .execCommandInternal function, and using the ToolbarFactory to create a selectButton.
But my issue is, do I really have to write all the logic from scratch, such as: how much text to enclose in the style selection if the selection is a caret, and removing previous styles on applying new selections, handling cross-browser tagging insonsistencies, displaying the selected style in the button and all of this?
As it seems to be a standard feature in many other editors, is there a chance I have just missed a pre-existing plugin function or other building blocks?
I'd be grateful for any hints for not re-inventing the wheel.
It sounds like you're referring to "plugins," which are objects you can inject into Google Closure's goog.editor.Field text editor. There are many standard plugins that are included in the Google Closure Library (bold, italicize, underline, make a link, etc), though you can always roll your own. For example, I had to make my own paste plugin that removed HTML formatting from pasted text.
After you pick out the plugins you want, you can then add buttons to the editor's toolbar which fire command events that those injected plugins listen to.
Here's a blog post that gives a much better explanation of how to actually set this up than I ever could here:
http://closuretools.blogspot.com/2010/07/introducing-closure-library-editor.html
Well I think I found the answer.
There's a plugin which is part of the lib called HeaderFormatter. It's unfortunately dependent on BasicFormatter plugin and doesn't seem to come with a default button (you have to create your own) - but looks exactly like it's the answer to this question.

Detecting the IE "Ignore colors specified on webpages" setting state

There is an accessibility option ("Ignore colors specified on webpages") in IE that removes all of the CSS color/background-colors from a webpage in order to make it easier to view for some users.
This can cause issues by removing helpful images that simply cannot be output in the foreground.
Does anyone know if there is a way to detect the state of this setting in an end-users browser?
Ultimately it could be used to display alternative styles depending on the state of this setting, so if it can be detected using JS it would be perfect.
However, I realise that it is a long shot as allowing web pages to detect browser settings could open up security holes! But any thoughts on the subject would be greatly appreciated.
You can test a given element with getComputedStyle; this will not save you with custom css (if the user has an override css defined in accessibility settings), but with stripped colors it does work (though it's still a hack).
A jQuery example follows:
<div id="example" style="background-color:lime;width:40px;height:40px;border:2px solid #000;"></div>
<script>
$(function(){
alert($("#example").css("backgroundColor"));
});
</script>
This will give you white (255,255,255) with accessible colors and the appropriate lime (0,255,0) with stripped colors - this shall get you started with this detection, should you decide to use it.
Yes you can, I can't find the link I was looking for, but the following link will get you started: http://www.w3.org/TR/css3-color/#css-system
Best thing about it is you don't need Javascript.

CKEditor: how to change editor behaviour without changing it's source code?

I mean next thing: I want to add some specific class to table when it's creating in editor area (iframe) for default styling reasons. I now how to do this with changing it's source code of plugin table, but it is bad decision to change that files... And it is impossible to do through configs. Maybe there is some way to redefine table behaviour on the fly...
What will be the best solution in this case?
Thanks in advance!
You can write a plugin to modify the behavior of the table dialog or any other one on the fly. How far you can go with this approach depends on your abilities and which changes do you want. If it becomes too complex to adjust this way then the second approach is to copy the original plugin that you want to modify and create your own version based on that (but outside the CKEditor source folder)
This plugin for example adds a field in the Table and Cell dialogs to pick a background image: http://cksource.com/forums/viewtopic.php?f=18&t=23607
You can learn how to write your plugins by following the CKEditor tutorials.
I think changing the source code for "styling reasons" is a bad idea.
You can easily change the default CSS by changing the default skin (v2 skin I think) or by adding a custom skin to CKEditor.
Documentation
Developers Guide

Categories