...for the given label, then checks if that field is hidden via CSS (or Javascript). It is not currently tested if the label is visible or hidden. For this see...

You can include files from app/assets or from the public folder with javascript_include_tag. The subtle difference that tells rails how to build the path correctly is a single...

...slash at the beginning of the path: <%= javascript_include_tag('ckeditor/config') %> # for assets/ckeditor/config.js <%= javascript_include_tag('/ckeditor/ckeditor') %> # for public/ckeditor/ckeditor.js This also applies to stylesheet_link_tag. Note that when you...

...order to navigate through the browser history. you can manipulate the window.history object via javascript like follows: When /^I go back in the browser history$/ do page.evaluate_script('window.history.back()')

stackoverflow.com

...menu for copying and pasting will appear. This can confuse unexperienced users. Use the Javascript hack below to disable text selection on mobile devices: // Deactivating distracting Text Selection:

makandracards.com

...t reliably work in Selenium features. I overhauled the entire step so it uses Javascript to detect visibility in Selenium. The step has support for jQuery and Prototype projects, so...

...this, test for the right environment and place the JS-code afterwards: - if Rails.env.production? :javascript var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXXXXX-X']); _gaq.push(['_trackPageview...

code-experience.com

React.js is a relatively new Javascript templating engine that has two-way-bindings like AngularJS or Batman. The interesting idea here is that React keeps a virtual copy of the...

makandra dev
github.com

...you can only truncate single lines with CSS by using text-overflow, this small JavaScript library also allows truncating text after multiple lines. Please note: For Internet Explorer, the element...

docs.angularjs.org

...the value of the last expression, it may return DOM nodes: # coffeescript scope.focus = -> element.focus() # javascript scope.focus = function() { return element.focus(); // wheee } If you e.g. use this function like this, the error...

...Put the attached file into features/support/ to make Capybara more patient in scenarios tagged @javascript...

makandra dev
mailru.github.io

A set of javascript tools for working with files. It offers different kinds of things: A cross-browser JS API to work with File objects. Image helper methods, like rotating...

...it's unavailable, a timeout error is thrown. Now, consider a scenario like this: @javascript Scenario: Receive an e-mail after clicking the fancy link When I follow "fancy link...

...will be running. How is that last item the worst? Consider these steps: Before('@javascript') do # Disable code snippets that embed code to third party services, like Google Analytics, when...

makandra dev

...replace the tracking code with a debug version that prints debugging info to the JavaScript console...

If you want to do JavaScript-style camelization, ActiveSupport's String#camelize method can actually help you out. Simply pass a :lower argument to it. >> 'foo_bar_baz'.camelize

github.com

...acts like Stripe’s and also serves a fake version of Stripe.js, Stripe’s JavaScript library that allows you to collect your customers’ payment information without ever having it touch...

When you include a non-existing Javascript file, you probably won't notice it during development. But with caching active (on production or staging) Rails will write an empty all.js...

matthewphillips.info

A while ago I tweeted a thread about how a small JavaScript snippet, one that can fit in a single tweet in fact, can be used to allow defining custom...

makandra dev
thecssninja.com

The attached article explains how to preload images with only CSS. No Javascript required. The gist is: .element:after { content: url(img01.jpg) url(img02.jpg) url(img03.jpg); display: none...

makandra dev
bootswatch.com

...that you can easily use or replace the theme. Does not come with extra JavaScript; some effects like button click ripples are implemented via CSS. Also check out their other...

makandra dev
nexts.github.io

Small (1.5 KB) Javascript library that lets you render tables, lists, etc. with hundreds of thousands of items. How it works is that you move your data set from the...

developer.mozilla.org

dragging the finger after touchstart touching the element for a long time an JavaScript event handler calling event.preventDefault() on the touchstart event an JavaScript event handler calling event.preventDefault() on...

...will never fire. Only these events will fire: touchstart touchend Caveats when canceling with JavaScript When you call event.preventDefault() on the touchstart or touchend event, you can prevent the subsequent...

requiremind.com

Batman is an alternative Javascript MVC with a similar flavor as AngularJS, but a lot less features and geared towards Ruby on Rails. The attached link leads to a tutorial...

css3pie.com

...and time-consuming to implement, involving complex sprite images, extra non-semantic markup, large JavaScript libraries, and other lovely hacks...

blog.salsify.com

...able to work around this issue in most projects by doing this instead: After '@javascript' do step 'I wait for the page to load'