I know how to define static, standard code templates in NetBeans and I am wondering whether it's possible to define more customized and dynamic templates.
For example, when i type div.className to generate me a HTML <div> element with the class I specify.
Start netbeans and go-to: Tools->Plugins menu,Available Plugins tab, then search for Zen Coding hit install.
type: div.className and hit: ctrl+alt+n to get: <div class="className">
You will notice the new Edit->Zen Coding menu.
Installation & usage: https://github.com/lorenzos/ZenCodingNetBeansPlugin#readme
Read more about Zen Coding at: http://code.google.com/p/zen-coding/
Related
I've paid attention that some implementations of the UI5-based apps prevent of loading XML-views (templates) and I can't get an XML-view via the DevTools' Network tab, e.g.:
https://discovery-center.cloud.sap
https://openui5nightly.hana.ondemand.com
While other implementations load the XML-view and only after that parses it in a browser:
https://openui5nightly.hana.ondemand.com/test-resources/sap/m/demokit/tutorial/walkthrough/37/webapp/test/mockServer.html
How to protect my UI5-app source code and to prevent from the UI5 app loading the XML-view as it appears in IDE?
Is it a matter of the UI5 Tooling configuration?
I know, there is a dedicated step in UI5 Tooling Builder:
(7/8) Running task uglify...
But it looks like, it doesn't prevent from loading XML-views «as is».
Thanks to #Marc for sharing this knowledge! I arrange his info as the proper answer.
The UI5 Tooling proposes an option to minify a codebase of an UI5 app. However, it's still possible to reverse engineer the minified version and to download the original XML-templates with the help of UI5 Diagnostic Tools:
Press Ctrl + Shift + Alt + S, a UI5 Diagnostic Tools pop up should rise up
Go to Control Tree section
Choose the desired view, on the right side of the popup, click on the Export tab
Choose the desired format for exporting: Export to XML or Export to HTML.
P.S. Perhaps worth pointing out that it's possible to prevent activating UI5 Tooling by setting in the HTML bootstrap script the productive-flag to true:
<script type = "text/javascript">
window["sap-ui-config"] = {
"productive" : true
};
</script>
It might complicate a little reverse engineering of an UI5 application.
We have one Plone site (4.3.x) using TinyMCE version 1.4.3, but we found that we should have the version 1.3.18 instead for this Plone version.
So I:
Uninstalled the TinyMCE package ( manage / portal_setup / import / Remove TinyMCE profile ).
Pin buildout version to 1.3.18 and run buildout.
Reinstalled TinyMCE package ( same procediment, but select TinyMCE install profile).
After that I notice that:
For default Plone content types it worked fine.
For the new dexterity content types defined in this Plone Site it didn't work. It load just a textarea with html into it instead of load TinyMCE.
I did many tests on this, and what I can see is that my content type should use wysiwygEditorBox macro from this template Products/TinyMCE/skins/tinymce/tinymce_wysiwyg_support.pt but instead it is using this template Products/CMFPlone/skins/plone_wysiwyg/wysiwyg_support.pt.
I tried to change order of portal_skins but it just affect Archetypes types, not Dexterity types.
What step should I do next? is there any better way to debug it instead of adding <span> tags with debug messages?
Looking in the parts/omelette directory shows the following in plone/app/form/widgets/wysiwygwidget.pt (line 21)
support_path string:nocall:here/${editor}_wysiwyg_support|here/${editor}/wysiwyg_support|here/po
My guess is that ${editor} isn't set right (ie to tinymce) so the above line is falling back to search for the wysiwyg_support.pt template.
I have 2 question about the edit visual studio code.
1. when I include a js file in my html as <script src="hey.js"></script> and use it in my js code after like hey.speak() the editor says 'cannot find name 'hey'.
when I create new function and calling this function afterward when it shows me the function's argument why it says "any" on every argument it takes ? when In real the current function expects to get a function (in a callback case)
I'm trying to arrange my project code, and I'm trying to follow the wornings. thanks (:
VSCode doesn't load <script> tags referenced in HTML automatically. If you open the referenced file by yourself (e.g. in an editor to the side), global symbols should get picked up.
This is definitely a nice feature request, you can ask for it at the VSCode User Voice Website.
In the meantime, you can configure the linting settings of JavaScript, to ignore undeclaredVariables, for example.
You should be able to include
/* global hey */
to the top of your script, then VS Code (and other linters) will know that you have an undeclared global the you will be importing.
I'm using eclipse JSDT and I have a javascript object declaration that looks like this:
var rs1 = {};
rs1.person1 = {};
rs1.person1.phone = "hg";
rs1.person1.name = "lk";
Content assist will pull up rs1 properties (rs1.person1.name) in the editor if I add it to a file in the project javascript include path user library, but the following notation
var rs1 = {person1:{ phone:"hg", name:"lk"}};
then content assist will only go as far as rs1.person and stop. If I use this same JSON notation directly in my javascript, then content assist works as expected. It just doesn't work when I add it the project include path.
I've been struggling with this for a few days but I can't find a way to make it work.
Any ideas?
It seems that this may be a problem with eclipse on linux (I'm running ubuntu). I downloaded a fresh copy of indigo to ensure that it wasn't some third party plugin that was causing the problem, but the content assist was still not working.
Just tried it on a windows box this morning and content assist works as expected.
When I dynamically load a snippet of html containing javascript via AJAX, I cannot see that content in the source tab in the developer tools window in Chrome 22.0.1229.94. Tellingly, I went here
https://developers.google.com/chrome-developer-tools/docs/scripts-breakpoints#js_dynamic
This page shows an example developer tools window which is out of date. There is a button on the page to load a dynamic script and it does not show up in the source tab when you do.
As a work-around, I have found that adding
debugger;
to the script and reloading it will cause it to pause in the dynamically loaded code, but unfortunately, all the line numbers are greyed out and you can't set any breakpoints within the debugger.
Am I missing something here or what?
Thanks,
Rob
When you use a library or javascript code that you have loaded it dynamically, you can use the phrase
//# sourceURL=foo.js
at the beginning of your javascript code that foo.js is the name that will be assigned it. debugger will show it with that name.
This is true in chrome, and I think in firebug too.
In this case you can place a breakpoint in the dynamically loaded javascript code.
Possible duplicate of:
Is possible to debug dynamic loading JavaScript by some debugger like WebKit, FireBug or IE8 Developer Tool?
Don't know if this works or not in chrome (This definitely doesn't work for me now, may be in the past).
//# sourceURL=foo.js
Working Solution
For your dynamically loaded script via ajax to appear in your chrome source tool, you need to add the following line at the start or end (I prefer) location of your script file:
//# sourceURL=foo.js
And your script with name foo.js will appear at the left pane of source tab under (no domain) dropdown
->localhost
-- source/src
->(no domain)
-- foo.js
Alternatively you can add the below line in your script anywhere between the scripts.
debugger;
In chrome, you can use " debugger; " statement to break at a statement when debugger panel is open. Chrome will simply ignore this if the debugger panel is closed.
This will help stop your script in debugging mode and you will see your script in source (debugging) panel with name like VM****.
Hope this helps.
You can use //# sourceURL. Chrome doesn't seem to be supporting //# sourceURL for inline scripts. However, it does work on eval expressions. This article gives more details about naming eval blocks and naming of any anonymous functions in your code.
Instead of using eval, you can try embedding a script tag or JSONP may be.
Varunkumar Nagarajan
for me it happened on nodejs project.
i restarted server and open in new tab my app and tada!..
Alternatively, to fix this problem you can open developer tool in a seprate window by clicking the icon. Now reload your script, and it will shown in script tab as expected. I know this is not a solution but a work arround.