Canvas snippets for sublime or atom text editor - javascript

How can i convert those textmate snippets for sublime or atom..
https://github.com/johnhunter/JavaScriptCanvas.tmbundle
And please What is the best text editor for developing canvas application that support autocomplete and live preview.

I got it :)
I tried to make this package for Atom and it works fine.
Also think the orginal snippets i've shared above works fine in sublime, i've just tried it.
https://atom.io/packages/canvas-snippets
if someone found more packages can help within developing canvas apps please post it here :)
here.
thanks

Here's Something I made for SublimeText.
Canvas Snippets
Features
Has every methods and Property of the Canvas' Context
And more snippets to initialize and get started setting up canvas
Also has some commonly used code
Has some Math objects property too
A CheatSheet to look up tab triggers

Related

The best extension to enable autocomplete feature when writing JavaScript in Atom

I'm learning Javascript and up until now when I wanted to change anything in the DOM, I was using Google Chrome devtools to do that. Now I'm moving to write my code inside the JavaScript file, that accompanies the webpage, in Atom but the problem is the extremely useful autocomplete features of Chrome devtools is not available in Atom. For example when I type this code:
document.addEventListener('click', function(){
const mainHeading = document.querySelector('h1');
mainHeading.style.backgroundColor = 'red';
})
Chrome devtools is intelligent enough to suggest backgroundColor with a capital C to prevent any typing errors but the same thing doesn't happen in Atom. In fact Atom does not have any suggestions at all. I have tried installing different JavaScript plugins such as atom-ternjs or autocomplete-javascript, to name a few but none is working when you want to write the code to manipulate the DOM. Any suggestions to solve this is greatly appreciated.
Here's a quick solution using Atom Ternjs.
Navigate to the menu bar and click Packages-> Atom Ternjs -> Configure Project.
Here, select the browser option under libs
Then, just scroll down and click on Save and Restart Server.
I hope this helps.
I'm using TabNine extension now and I'm satisfied with the performance. It uses deep learning to learn and predict the variables and lines of code you might want to write based on those variables and the more lines you write in a particular project the better it gets at giving the suggestions.

How to take a screenshot of a web page by using Javascript

I need to capture the currently active web page as a screenshot. I've already tried html2canvas & GrabzIt but the problem is that I need a precise screenshot of the page I am on currently. The reason why I don't want to use html2canvas is because it does not always return a good version of a screenshot (not rendering properly) and I don't want to use GrabzIt because it's not free.
Do any of you have an idea how to accomplish this either by using javascript/java/flash?
Any option will do as long as it works...
P.S. I'm currently capturing screenshots with my addon for Firefox by using the function that firefox offers : context.drawWindow and now i want to make it available online.
Thanks a lot!
Currently possible alternatives:
rasterizeHTML.js:
this tool looks to be capable to capture a while page containing sophisticated html-structure and an image as well in this demo:
http://cburgmer.github.io/rasterizeHTML.js/
Lively 3D:
On the tool's website you can find a demo as well and it is still supported and developed.
http://livelygoes3d.blogspot.co.at/2011/11/rendering-html-on-canvas.html
HTML2Canvas:
Or after all HTML2Canvas because it does not look like that it is put on hold, quite the opposite there is a new release-version of it. And since I used it it might be handle rendering images onto a canvas better.
https://html2canvas.hertzen.com
Old-Answer:
I used this package in one of my projects and it worked pretty well. The only complain I have to make on this package is that images are not rendered that well in the final screenshot. But may be it's improved since then.
In the end, I ended up using server side generation of screenshots with phantomjs. Found it the most reliable in my scenario and it takes pretty decent screenshots.

How to highlight (un)used JavaScript live in Dreamweaver

I am working in Dreamweaver CS4 and implemented JQuery code that I found online for a gallery function.
I am only using a very small part of the gallery functions available, and would like to delete the unused script in order to get more clarity and a cleaner script. But as a JavaScript beginner I can't identify what is important and what is not.
My question: Is there a way in Dreamweaver to view/highlight the JS code that the site is using? I am imagining a tool that you could turn on when running the live view that would visualize the portions of code that is being used.
Or, the other way round, is there a way to highlight the unused code.
The live code button doesn't seem to do this.
Thanks for your help!
My question: Is there a way in Dreamweaver to view/highlight the JS code that the site is using?
No. You would need to use Firebug or a similar javascript tracker/debugger to see how the code is used. The most DW will tell you is which external files are linked to a page.

Which Javascript code editor supports plain text line numbering?

I need to add a text area that also has line numbering capabilities. I tried EditArea, but I couldn't make it work with text files. It would be ideal if it could highlight syntax for existing programming languages, but that would only be a side bonus.
The main thing I'm after is line numbering for whatever I paste in it. Please only list open source ones.
Try Etherpad, we can configure it to show line numbers.
Etherpad is a highly customizable Open Source online editor providing
collaborative editing in really real-time
Other opensource alternatives CodeMirror and Firepad
Firepad is feature rich, built on Google's Firebase, so no need to setup a server

A sample for jQuery based WYSIWYG Editor demonstrate OOP javascript

Want a WYSIWYG jQuery Editor as an example to illustrate how to use jQuery to built OOP javascript component.
P.S.
It is so good stackoverflow can use markdown... Would be a heaven if users would love such thing too
jHtmlArea - WYSIWYG HTML Editor for jQuery
A simple, light weight, extensible WYSIWYG HTML Editor built on top of jQuery. This component allows you to easily display a WYSIWYG HTML Editor in place of any TextArea DOM Elements on the page. The minified script alone is 7kb, and with css and image files it's a total of 15kb.
This project also include Visual Studio JavaScript Intellisense support.
(source: codeplex.com)
http://projects.bundleweb.com.ar/jWYSIWYG/ looks outdated, better try this link to jwysiwyg
jwysiwyg looks good but there's no useful documentation at all!
Check CleEditor http://premiumsoftware.net/cleditor/
CLEditor supports the following browsers on both the mac and pc: IE 6.0+, FF 1.5+, Safari 4+, Chrome 5+ and Opera 10+. All testing is done using jQuery 1.4.2.
CLEditor provides a rich plugin development environment, allowing you to customize its user interface and functionality to fit your needs.
http://wmd-editor.com/features#compatibility
or maybe if you just have time to write/modify for your own parse (as i will do)
use this:
http://markitup.jaysalvat.com
The WYSIWYG which can accept formatted text copied from Microsoft Word, are...
CLEditor
jHTML Area
NicEdit
Xinha
jWYSIWYG
I chose CLEdit, because the code is clean, and it allows me to decide how I want images to be aligned, and it doesn't have bugs like NicEdit. On NicEdit, it produces DOUBLE line breaks when HTML code is copied from other sites into the editor.

Categories