...use Semantic Versioning's naming convention. If your library has both a Ruby and JavaScript component and you want to use the same version constant for both, you can use...
= form.file_field :add_images, class: 'hidden', multiple: true Add Images = gallery_form.submit Javascript Now to the dynamic part. I built it with an Unpoly compiler, but the code...
...so you can both use up the entire quota. Note that the Google Maps Javascript API (the one that draws maps on the screen) has a different quota policy. Here...
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...
...or close the dialog. The easiest way to interact with the editor is via javascript postMessages. To abort the dialog a post message on click with an event listener like...
...any CSS that contains directives like background-image: url(/internal-path/wallpaper.png) will be break Referenced javascripts or stylesheets will probably attempt to load from the wrong URL The solution to this...
...below are from Holly. This is the feature that tests Holly's print stylesheet: @javascript Scenario: When printing a tree, the page appears black on white with all controls hidden...
...jQuery cache even exists. After all jQuery could simply attach event handlers to the Javascript object that represents the DOM element. The reason for the existence of the jQuery cache...
...is that old versions of Internet Explorer could not garbage-collect Javascript objects with circular references. For instance, the following object graph could not be reclaimed by old IE's...
...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...
...probably don't want to. [2] If you don't speak CoffeeScript, take this JavaScript: this.app.decorator('$httpBackend', ['$delegate', function($delegate) { return function() { var headers = arguments[4]; var contentType = (headers != null...
...not it is hidden via CSS. In a Selenium scenario, visibility is detected via Javascript. This detection is very precise and should correctly determine visibility for the most fucked up...
...will find that this is hard to test with Cucumber and Capybara: A non-Javascript Rack::Test scenario will just ignore the host and try to open /some/path in your...
Here is a Javascript function reloadUsers() that fetches a HTML snippet from the server using AJAX and replaces the current .users container in the DOM: window.reloadUsers = -> $.get('/users').then (html...
...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...
...browsers that support a given declaration. There is CSS.supports() to do the equivalent in Javascript. backdrop-filter (Edge 17+, but not FF): Applying filters to what is visible through an...
...real ones. An attacker with control over a victim's browser can simply use JavaScript or web developer tools to retrieve values from those inputs...
position: fixed; top: 0; width: auto; display: none; border: none; margin: 0; } Javascript ;(function($) { $.fn.fixHeader = function() { return this.each(function() { var $table = $(this), $t_fixed; function init() { $t_fixed...
...you can switch between drivers using tags: Feature: The app works with low resolutions @javascript @chrome320x480 Scenario: Visit my profile in low res Given "bart" is a user with the...
In JavaScript we often use Immediately Invoked Function Expessions (or IIFEs) to prevent local variables from bleeding into an outside scope: (function() { var foo = "value"; // foo is scoped to this...
...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...
Capybara has a variety of finder methods like find_button to help you look up DOM elements. There are also...
Service just like Factory, but: instead of a funciton, it receives a Javascript class / a constructor function as argument simplest service type, but also least flexible Value
...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...
...in your PT profile or in ~/.config/geordi/global.yml if you have ever used geordi commit javascript: (function() { var pt_project_id = 'XXX'; var pt_token='XXX'; var url = `https://www.pivotaltracker.com/services/v5/projects/$...