Aptana //novalidate option - javascript

I'm writing Processing.js code using Eclipse (with the Aptana plugin), and I'm a little confused by this option in the Javascript preferences:
Enable error filtering inside //novalidate comments
Using Processing.js allows me (and occasionally forces me - for example, it uses the Java "void" instead of the Javascript "function" for method declarations) to do some funky things to javascript syntax that the validator doesn't like. I've got a bunch of error messages that I'd like to silence, but I'd rather use the Eclipse editor because the rest of my site is there.
I've tried sticking "//novalidate" before, after, after the semicolon on the same line, and even at the beginning of the file, but it has no effect. I've also tried adding exclude rules in Preferences -> Validation, but that doesn't seem to do anything, nor does turning off "Javascript problems" in Problems -> Configure Contents... (which I'd like to avoid, because I'm doing regular javascript elsewhere on my site). I can't find any documentation for "//novalidate" on the Aptana website - does anyone have any idea how to use this properly?
Thanks in advance.

Have you tried Aptana Support methods?

Related

Translating minicart and other javascript related strings in magento 2.1.3

I am learning magento 2, i have started with basics like creating module, then a theme.
Since magento does not come with slovak language i want to do some translation on frontend and later on backend.
I have succeed translating frontend where no javascript / knockout template is used, by placing sk_SK.csv into company/themename/i18n.
I have read about issue on github that in magento 2.0 translation of javascript strings does not work using this method, so i have upgraded to latest version (2.1.3), and its still not working.
I have checked vendor/magento-checkout/i18n/ where the ex. string "Go to Checkout" is defined. So I have tried the override method used also for overriding templates (created company/themename/Magento_Checkout/i18n/sk_SK.csv) and placed the translation here. it does not worked also.
Note: After each change i delete the static folder and run the command to generate static content for sk_SK then i clean the cache and flush the cache, in browser i do hard reload with cleaning cache.
Yes there are lot of topics on github, stackoverflow, docs... but i do not understand them, these answers are written i thing for super professionals.
Note 2: Theoretically i can hard-code slovak language into web/minicart/content.html (not sure if path is right) by overriding this file. But this is not solution for possible multi-language website.
Note 3:
I have did also an export using i18n, but the output is messed up. like "Hello "World"!","something" same quotes in quotes without escape.its pain to open in any excel kind of app (partly succeed with libreoffice calc) because it has long string and too much strings not friendly for developers or people who will do the translation.
What kind of answer i want to receive is like this:
1. Copy this file here, because..[explanation]
2. Edit/Add/Whatever here, because....
3. etc...
Why? I want to learn and not just copy paste.
Thank you

Vim: inline JavaScript syntax highlighting better than on a separate file

When editing JavaScript inside a script tag the syntax highlighting is much better than when editing myFile.js.
Is there a way to have the same syntax highlighting in a separate file as you have inside a script tag?
I already tested both the stock javascript.vim syntax file and this alternative one:
http://www.vim.org/scripts/script.php?script_id=1491!
edit: please check screen shot:
Left side is inside script tags and :setfiletype html.
Right side is plain javascript with :setfiletype javascript
I know it's been a couple of months, but I wonder if you've found a satisfactory answer yet?
I found the following via :help syntax within vim:
JavaScript and Visual Basic embedded inside HTML documents are highlighted as
'Special' with statements, comments, strings and so on colored as in standard
programming languages. Note that only JavaScript and Visual Basic are currently
supported, no other scripting language has been added yet.
This seems to explain why everything that is does not have its own coloring in javascript.vim is colored "Special" when embedded within HTML. This seems to include variable names, function and method names, and so forth. I like it, too, because it separates variables, etc, from punctuation, etc. Much easier to see that your code is correct.
My vim JavaScript highlighting is awesome, this is my setup:
syntax on
filetype plugin on
syntax enable
au BufRead,BufNewFile *.js set filetype=javascript
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
with the following js-related bundles
jslint
and no specific syntax files
My colorscheme (molokai) takes care of the rest
Hope this helps you
Use vim-javascript. It works pretty well.
In my case installing jelera/vim-javascript-syntax did the trick since vim-javascript plugin by itself didn't apply a nice color syntax. If your language of choice is Javascript (as in my case) I recommend you to follow this great guide. Hope this helps!

Aptana and JavaScript/jQuery IDE

I'm using Aptana for JavaScript and jQuery.
My script files are not being outlined, but I understand that this is a known issue.
When editing JavaScript, is there a way to add simple editing short cuts like:
High light a block and comment /or uncomment block.
Getting intellisense to recognize Jquery-UI and other libraries?
And while I’m here and asking what about the outliner and created code?
a. What allows JQuery to be recognized and my scripts to not be recognized?
Answers to 2. and a.
Aptana cheats. It knows jQuery and uses some local heuristics to guess when something is a jQuery collection, but it does not do data-flow analysis on the javascript to determine the type. That's why jQuery shows up, but jQueryUI and your code don't.

VS2008: Is there a way to enable bracket matching for javascript?

The bracket matching in VS2008 is a handy feature, but doesn't seem to work for javascript code.
Is there a way to enable it?
If VS can do this its news to me. It also has other annoyances like not allowing you to go directly to a js function (like you can with C#/VB code/CSS)
I'm currently building a web app (client side code heavy) and given up editing js in VS2008 - it just works against me.
Instead I do it all with notepad++ and the functionlist plugin. Upside is that it provides the bracket matching you're after and also splits all my functions out nicely for easier navigation, highlights the code correctly etc.
I don't see using another app as a problem as its only an alt-tab away
Notepad++
Notepad++ Plugin List
I have looked for similar solutions within VS itself but they either don't work exactly how I'd like or (in one case) crash VS.

Problem porting WordPress Editor to a non-WP application

I like the look and feel of the WordPress editor (version 2.7), and I would like to use it in another web application that is written in ASP.NET. I've used TinyMCE before, and I've even extended it in the past. However, I can't seem to get the Wordpress configuration to work!
I've downloaded the entire WordPress package and taken the TinyMCE code (from the "js" folder) and put it in my web site. It ends up giving me an error on the following line of tiny_mce.js
return f.apply(s||this,Array.prototype.slice.call(arguments,2))
'undefined' is null or not an object.
Now, I've carefully made sure that the steps of execution are identical with the WordPress demonstration site that I've based this from.
I'm not a Javascript newbie (at all), but I can't seem to figure out why this is not working. Has anybody tried to do this before? What am I missing?
A demo of what I am talking about is here (username="admin", password="demo"). View the source, I have the three parts of Javascript that are (seemingly) required to power the editor.
Something of a stab in the dark, but I'm suspecting that there's a dependency on WP's prototype.js and you didn't bring that over with TinyMCE.
If you are able to determine which bit is undefined that might give you a clue. I tried looking at the demo with firebug, but tinymce.js was all one line, so I gave up trying to find that code.
Try putting in either some console.log() if you have firebug, or alert()s before that line, and try to see what f,s,this,arguments etc are when yu get the error, then do the same thing with a vanilla WP install and see the difference?
I suggest including the tiny_mce_src.js istead of the minified version, this way you can use firebug to debug and receive helpfull information.

Categories

Resources