How to show Occurences for Javascript in Aptana? - javascript

I am trying to show occurences when browsing .js files in Eclipse (just simple occurences like it does for C).
For example, if I highlight myVar, then Eclipse should show boxes in a ruler where other occurences of myVar occur in the file.
I've gone into Preferences->General->Editors->Text Editors->Annotations multiple times, de/selected and applied changes to Javascript Occurences, Occurences(com.aptana.ide.annotation.occurences), Occurences(org.eclipse.jdt.ui.occurences) all to no avail(C occurences continue working perfectly on .c files).
I've opened .js files in default Javascript editor and in Aptanas .js editor with no results.
Even really dumb show of occurences which would show any selected text(var, null, etc.) would be great.
Additional information on workspace: Eclipse 3.5(didn't work on 3.4 either), Ubuntu 9.04, CDT, Aptana, Subversive, and some other plugins. .js files are from a large non-web project.

To circumvent your problem, you could use the JSEclipse plug-in (http://www.interaktonline.com/Products/Eclipse/JSEclipse/Installation-Update/). It supports occurrence markers, code completion, etc.

Related

In vscode when working on HTML file, is there a way to color the idents between the opening and closing tags?

I have color bracket and it works great in js files where you can clearly see the nesting of functions etc.
I want that same thing but in the HTML file so the ident would be colored.
So now I'm actively in the ul indent and I want it to be colored:
Is it possible to change in the setting or a special extension? tried Googling but didn't see something like that.
You can use the rainbow tags extension. To install it, just simply do Ctrl+P and paste ext install voldemortensen.rainbow-tags inside the box.

How to display check mark character in jQuery datatables PDF export

I have the following table which uses the datatables plugin for pagination, sorting and exporting.
Everything works great except the check mark in my html is not exported with the pdf, yet it is with excel. I want to get this working because I am going to remove the checkbox element in favour of clicking the table cell and toggling whether the check mark is present. I really want to avoid using 'Y'/'N' as indicators in any part of the table/exports.
Has anyone come across this issue before or can offer any light, my instinct tells me it's something to do with the character encoding in PDF export library, but I don't want to go just go in and start editing library files because this issue (may)will be repeated if I ever need to upgrade the lib. In addition, I'm not totally sure what to look for.
HTML
Excel
PDF
While writing a PDF, use unicode string for check mark exactly as below:
&#10003 followed by ;
like
<table border="2"><tr><td><Check mark: </td><td>✓</td></tr></table>
PROBLEM:
jQuery's Datatables uses pdfmake library for its eporting in PDF.
pdfmake uses only one font 'Roboto' as it's text font and as it so happens its char-set doesn't support the '✓' symbol.
You can have a look at all the characters 'Roboto' , pdfmake and subsequently Datatables supports here: https://www.fontspace.com/font-charmap/21071
This information was found at: https://github.com/bpampuch/pdfmake/issues/1478
SOLUTION:
You can change the font that Datatables uses when exporting to pdf using pdfmake to something that support the character symbol '✓'
create a new vfs_fonts.js file containing your font files
Create the examples/fonts subdirectory in your pdfMake code directory, if it doesn’t already exist.
Copy your fonts (and other files you wish to embed) into the examples/fonts subdirectory.
Run npm install (from the pdfMake directory) to ensure all prerequisites modules are installed.
Run gulp buildFonts to create a new build/vfs_fonts.js (you can update gulpfile.js to change the base directory path or to add an alternative config for the buildFonts task).
Include your new build/vfs_fonts.js file in your code (in the same way you include pdfmake.js or pdfmake.min.js).
The above buildFonts action embeds all files from examples/fonts (into a local key/value variable pdfMake.vfs) - not only fonts. Which means you could put images in there, run gulp buildFonts, and reference them by filename in your doc-definition object.
include this newly created font file in your document
<script type="text/javascript" src="./pdfmake-0.1.37/vfs_fonts.js"></script>
add your fonts to pdfmake
pdfMake.fonts = {
Arial: {
normal: 'arial.ttf',
bold: 'arialbd.ttf',
italics: 'ariali.ttf',
bolditalics: 'arialbi.ttf'
}
};
Add your font to the Datatable
buttons = [
{
customize: function (doc) {
doc.defaultStyle =
{
font: 'Arial'
}
}
}
]
Some helpful links:
DataTables & PDFmake - question on how to set a new font to the datatable
https://datatables.net/forums/discussion/51827/how-i-change-font-family-in-pdf-export - datatable community question on how to change the font family.

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

Eclipse project folder

I have the eclipse setup working pretty well for the java files in my code. But now I want to integrated the JS files also, leaving other XSLs/CSS files. Can I do that?
One is adding all the folders and then manually delete the unwanted ones, but Is there some clean way of doing that?
-Prtcl
You can
reference the JS folder in your workspace (without actually copying it): see linked folder.
then try adding a filter (in the package explorer, in the upper right corner of the view, there is a little down arrow, with a Tool tip saying "view menu": Java Element Filters)
If you do not want to view any xsl/css file, try to hide then to the "Name filter patterns" list

Categories

Resources