Eclipse: Use Aptana theme for Javascript editor only? - javascript

When I use Aptana in Eclipse, I like the Cobalt theme for my Javascript. However, this theme ends up making my SVN diff-ing nearly impossible for my Java files, because the background is dark blue, and the text is black in the compare editor.
I've look all over the preferences in Eclipse, and can't figure out a way to only use the Aptana Cobalt theme for editing my Javascript files.
Here are the things I've tried:
- I've made the Aptana JavaScript editor the default for ".js" files
- I've made the default for ".txt" and ".java" the normal editors (non-Aptana, whatever they are)
- I've tried setting the theme, and making sure that General > Appearance > Colors and Fonts still has all the defaults
- I've verified that if I changed the theme to something with a white background, my diff-ing editor gets changed and becomes readable
What else can I do?! I just want to use Aptana for Javascript, not my default diff theme.

I had the same problem. No idea wether it has been resolved yet, but I found a temporary solution which might help. I changed the default editor for Javascript in Preferences > General > Editors > File Associations. When you select ".js" from the upper list, you'll see all the possible editors in the bottom list. I made "Javascript Source Editor" my default editor. This editor uses the default theme settings.

There currently isn't a way to achieve this. I would suggest to create a JIRA ticket at http://jira.appcelerator.org/browse/APSTUD.

Related

Can I run javascript in VS Code markdown preview?

Question: Can I get VS Code to execute JS in it's markdown preview.
A little background:
I like to use markdown in VS Code for taking notes, with a nice live preview happening in a pane to the side. I specifically like to make tables in it, but the formatting can get out of hand very quickly if you have even a minor amount of text in a certain column, especially if you use prettier.
I had the brain wave to just make a js variable with the text I'd like to include, and use document.write() to drop the text into the table, but keep the formatting in VScode from sprawling across lines. Lets pretend that I aliased document.write() to dw()
|<script>dw(colHeader1)</script> |<script>dw(colHeader1)</script> |
|------------------------------------|------------------------------------------|
|<script>dw(row1Col1Content)</script>|<script>dw(row1Col2Content)</script> |
(Not the best example, might not be readable on mobile, but hopefully you get it).
Problem is, VScode doesn't run JS in it's preview window. Any way to make it do that?
Open to other suggestions on good ways to put large chunks of text into a table cell in markdown without the text formatting breaking to the point where it's more or less not human readable.
Yes VS Code's built-in markdown preview can run scripts, however scripts are disabled by default for security reasons. You can use the Markdown: Change preview security settings command to allow scripts:
PS: But also note that just because you can, that doesn't mean you should

Change syntax highlighting of individual file in netbeans

I have some javascript files with .php extension. When I open them in Netbeans I'd like it to highlight things as if it were a .js file. In Notepad++ I can just select the language in the menu and I'm good to go. Is there a similar feature for Netbeans?
I don't want to change the highlighting for ALL php files, and I don't mind if I have to reselect the language each time I open the file as it's only one or two files. Thanks.
Yes, It is possible for simple step.
- open NetBeans
- select tools tab
- select tools->options->fonts & colors->syntax->language
- select a language as per need and change the color of it

When working with an already made website, how do you know which file to edit to change something?

Let's say I'm building a website and using an already made Wordpress theme. Say it's a pretty complex theme and there's a lot of folders and files. If I wanted to change something specific, like text, or an image, or something that happens in Javascript/jQuery, and the change that I want is not an option in the themes control panel, what do I do? I know I have to go into the files but how do I know which file to go to? Lately, I've just download the theme to my desktop and use the windows search companion and type in the field that says "a word or phrase in the file." Sometimes it comes up and sometimes it doesn't. For CSS changes I usually use Firebug and click on the element, but many times I want to change the HTML/PHP/Javascript. I feel like I'm doing it the wrong way and there's an easier way that I'm missing.
As you mentioned WordPress theme so I will specifically try to answer this question for editing WordPress theme.
When it comes to WordPress, everything is very structured and well organized. If theme written following standard practices then each component has its specific file. If you are familiar with WordPress theme structure and want to change php code or say a static part then all you need to do is locate the component file say sidebar.php, home.php, single-{type}.php, header.php and many similar files. http://codex.wordpress.org/Template_Hierarchy
Now if you want to edit something that is shown in right/left side of page as sidebar then chances of finding it in sidebar.php are maximum. Similarly to change something on home page try looking for home.php, for posts it could be single-post.php.
Many a times what you are looking to change might need a tweak in widgets. In this case, process remains same as theme you just need to look in different folder.
Javascript: For editing javascript, beautify the code if it came minified. When you have code ready much of js debugging can be done using firebug/Developer Console in chrome. Best way is to put breakpoints at relevant position and then inspect code behavior. You will be able to locate code block that you need to tweak to achieve what you want.
CSS: Create a child theme and then use it override default theme properties.
You can probably use grep in PowerShell, Cygwin, etc.
grep -lir "a word or phrase in the file." *
edit: Emulating Grep in Powershell

Add a code editor to a textarea via console/bookmarklet

I've run into an issue where I'm developing pages on a CMS which is out of my control, and I'm editing increasingly complex pages with nothing more than a textarea.
Initially I'm creating the pages in my code editor, then copying the HTML into the textarea. Keeping the local and CMS code in sync by hand.
This workflow sucks.
I'd like to have code highlighting, etc while I work within the CMS. Is there any way I can add a code editor like Ace or CodeMirror to the textarea via bookmarklet or console command? I've tried using the Ace Bookmarket Builder but I don't know if it's been designed to work on any page, or just github.
Edit:
I don't think I was clear enough above. I'm just an end user on this CMS, I have no ability to change how it functions on the backend. I literally just need a bookmarklet that finds the textarea and applies a code editor to it.
both tinymce and syntaxhighlighter are packages that are not tied to a CMS, so if yours is custom then you will want to try to use these together, I have heard of some success in this adventure in the Drupal (there is actually a project for it currently) arena but you may be looking at a bit of work to do so custom. there is chatter about this http://www.tinymce.com/forum/viewtopic.php?id=22901 <-here with even a plugin to tinymce :) hope this gets the ideas going!

Which wysiwyg editor in Drupal will give me most control over markup?

At the moment I'm using the wysiwyg module for Drupal with tiny_mce. However, it keeps inserting all kinds of superfluous spans and other trash elements in my markup. I want to use wysiwyg mostly for semantic markup with css classes, any inline styles are a problem, because I have to clean up my html by hand - sort of defies the purpose of having a wysiwyg editor altogether. What other wysiwyg editor should I try, which will behave more sensibly?
WYMeditor, available via the WYSIWYG API, is not the fanciest editor, but it does produce XHTML markup.
BUEditor integrated via the BUEditor module, is an easily extensible system that allows you to easily define buttons and associated markup. It is a favorite of a markup-obsessed colleague of mine, so I imagine it does a good job.
In my experience ck editor is a very good solution.
The only problem i have seen it have is drop a instead of leaving a box blank
It has paste plain text and paste from word features that prevent extra markup from being dropped in
When working with a cms i think what is important usually is not how well you can enter markup, as a developer you can usually just use a text area and drop html, but how the editors will enter content.
Ck editor usually produces very clean results, as long as direct pasting from Word does not take place
As people have helped me out in the comments, there are two ways to integrate it with Drupal
WYSIWYG API module, and standalone module cKEditor
I really wanted to go with CKEditor myself but after trying to get rid of that adding breaks and spaces everywhere stuff I had to revert to plain text input.
I am currently considering markitup!, which you may want to investigate as well.
I am hopeful as I have good experiences with it on WP but I didn't get to try it on Drupal just yet.
I would suggest BUEditor, you can configure all buttons and thus control the output
Unfortunately I have yet to find an editor that doesn't try to mess with your code in one way or another. In Drupal, I've tried TinyMCE, FCKEditor, and CKEditor. In non-Drupal projects I've used Ephox EditLive and the YUI 2 Rich Text Editor. All of them try to "fix" or autoformat your code in one way or another, and to that end they are all frustrating. Of that group, Ephox EditLive is the worst offender, and ironically it's the only one that isn't free.
I've resigned myself to plain text editing in Drupal whenever there's a slight chance I may need to control the underlying HTML. My WYSIWYG editor is off by default; I whitelist pages in as needed. It's tedious, but for me it's better than playing tug-of-war with the WYSIWYG for control.

Categories

Resources