To test that an object was constructed by a given constructor function, use jasmine.any(Klass): describe('plus()', function() { it ('returns...

openjs.com

Despite the many JavaScript libraries that are available today, I cannot find one that makes it easy to add keyboard shortcuts(or accelerators) to your javascript app. This is because...

...keyboard shortcuts where only used in JavaScript games - no serious web application used keyboard shortcuts to navigate around its interface. But Google apps like Google Reader and Gmail changed that...

...to use for Selenium+Chrome). Similar sounding but completely different card: Detect if a Javascript is running under Selenium WebDriver (with Rails...

So you want to find out how many horizontal pixels you have available on a mobile device. This is super...

...triggers events that were registered through jQuery. Events registered through CSS or the native Javascript registry will not trigger...

The basic idea is pretty simple: an element's height is accessible via the offsetHeight property, its drawn height via...

harvesthq.github.com

Chosen is a JavaScript plugin that makes long, unwieldy select boxes much more user-friendly. It is currently available in both jQuery and Prototype flavors...

makandra dev
code.google.com

Javascript that implements client-side hyphenation of HTML-Documents...

github.com

jQuery plugin to register callback functions to keyboard shortkuts. Keyboard events in vanilla Javascripts are super-painful to work with, so hopefully this library can help...

github.com

Added utility methods for the Prototype Javascript framework...

nickstakenburg.com

Prototip allows you to easily create both simple and complex tooltips using the Prototype javascript framework. Please note: "Permission to use Prototip on your domain is required and can be...

bitbucket.org

String manipulation extensions for the Underscore.js javascript library...

code.google.com

Flot is a pure Javascript plotting library for jQuery. It produces graphical plots of arbitrary datasets on-the-fly client-side...

github.com

Javascript sprite library for Canvas

github.com

The Holy Grail of testing for front-end development; execute browser-less, console-based, javascript + DOM code right from within your Rails test suite...

You can use this code: function scrollToLine($textarea, lineNumber) { var lineHeight = parseInt($textarea.css('line-height')); $textarea.scrollTop(lineNumber * lineHeight); }

If you want a class-like construct in JavaScript, you can use the module pattern below. The module pattern gives you basic class concepts like a constructor, private state, public...

Since the module pattern only uses basic JavaScript, your code will run in any browser. You don't need CoffeeScript or an ES6 transpiler like Babel. A cosmetic benefit...

When I enter "text" into the browser dialog Also see Accept or deny JavaScript confirmation dialogs in Capybara/Selenium...

github.com

Using the JS fullscreen API is painful because all browers use different methods and events and you need to use...

This is non-trivial because you need to fake event objects and require different code for different browsers. Luckily, there...

phantomjs.org

...DOM handling, CSS selector, JSON, Canvas, and SVG. PhantomJS can be fully scripted using JavaScript. It is an optimal solution for headless testing of web-based applications, site scraping, pages...

blog.bitcrowd.net

When cucumber encounters a failing step in a @javascript feature, the selenium browser window instantly closes. Sometimes you do not want that, because you need to see what is going...

medium.com

...parse, interpret & run them. In this post, we’ll dive into this phase for JavaScript, why it might be slowing down your app’s start-up & how you can fix...

TL;DR Debugging problems with javascript errors in cucumber tests is sometimes easier in the browser. Run the test, stop at the problematic point (with Then pause from Spreewald...

...which looks like this (many of the steps are part of the spreewald gem): @javascript Scenario: Autocomplete city for station Given there is a city with the name "Munich"