Questions tagged [coffeescript]
A language that transpiles to JavaScript. Use this tag for questions about programming with the CoffeeScript language.
9,750
questions
0
votes
0
answers
7
views
Übersicht (macOS) question: prevent image caching in widget
I am maintaining an old CoffeeScript in Übersicht that spits out a random image from Photos. The widget refreshes every 30 minutes.
What happens is that an AppleScript executes and overwrites an image ...
0
votes
0
answers
30
views
Troubleshooting Issues with PDF Conversion in Updated Docker-Wkhtmltopdf-aas Package
I've taken on the task of updating an old package available on GitHub => https://github.com/leknoppix/docker-wkhtmltopdf-aas (master branch). This package allows for the quick setup of an API to ...
0
votes
0
answers
25
views
Cannot import coffee-script file into application.js
I am facing a problem that is too hard to fix. I am building a Rails application, I created a coffee-script file named mypage.coffee. Then, I embedded this file into application.js file. The error ...
0
votes
0
answers
11
views
export, import, use class with coffeescript in rails5 app
I am trying to fix pusher process in rails 5 app.
However, coffeescript is not working what I expected with export, import error on browser like:
SyntaxError: [stdin]:1:1: reserved word 'export'
or
...
1
vote
0
answers
10
views
Why does installing grunt(npm install grunt --save-dev) into my project stops in between and doesn't make any chnages to package.json?
Installing grunt stops in between and does not move forward, please see image attached
Reasons why this is happening and solution to it?
Uglified js files via brunch before but it is no more ...
0
votes
1
answer
32
views
how put an id unique in a button in a rails loop?
I have a grid where the receipts are listed with their information and the display button. The idea is that pressing the button that appears in the actions column (button_tag) sends the information of ...
0
votes
1
answer
44
views
Prioritize Gmail filter using Gmail API
I am creating a filter in Gmail using Gmail API but the problem is that any filter created via API is moved to the top of the existing filters. I need it to be put at the bottom. There does not seem ...
0
votes
0
answers
27
views
Passing json from rails to coffeescript
I'm trying to untangle some code I wrote a few years ago. I thought it was all working, but then I upgraded to Rails 7 and started getting some stranger errors on one page.
Working code:
...
2
votes
0
answers
269
views
custom script languages (such as coffeescript) no longer supported in vue 3.3?
UPDATE 2: This seems to be like an undocumented change to how the compiler works with the code in the tags (most likely unintentional, so probably a regression)
Here's how the compiler handles ...
0
votes
0
answers
14
views
Display Selected Apps sticky top in MultipleSelection dropdown AngularJS
Hi ~ I have a Apps Dropdown in which user is allowed to select upto 2 Apps, I want the selected Apps to be stayed at top always whenever it is scrolled for that I need to assign top & bottom ...
0
votes
0
answers
21
views
TypeError: Class constructor UserHandler cannot be invoked without 'new'
My Express.js project I am working on stopped working after installed Xcode on my Macbook Pro with Apple Silicon. It is working for my co-worker, who is also using a mac, but with Intel. When it ...
0
votes
0
answers
26
views
How to make "wait for input" skippable?
I'm using a block coding program (visual novel maker) and I don't personally know much about coding but I was told to ask about this here. I really hope I'm using the right tags, since I read that ...
0
votes
1
answer
35
views
CoffeeScript and Service Workers
When trying to register a service worker in CoffeeScript, it looks like the latest Chrome browser doesn't support service workers, which I know is not true. Here is my app.coffee, which is converted ...
0
votes
0
answers
44
views
In rails how to require a coffeescript file
In a rails application. I want to create a coffeescript function that can be shared by multiple coffeescripts.
for example
app/assets/javascripts/util.js.coffee
sample_function = (word) -> ...
0
votes
1
answer
33
views
CoffeeScript function syntax with nesting
I've come across a use of functions in JavaScript that I can't seem to convert, correctly, to CoffeeScript syntax. I'd appreciate it if someone could let me know how to do this:
JavaScript version:
...
0
votes
0
answers
301
views
webpack-electron, [11440:0125/075150.232:ERROR:CONSOLE(1)] "Request Network.loadNetworkResource failed
I try to run electron using webpack, when I run electron with the watcher running then elecrone spits out the following in the console
"[11440:0125/075150.232:ERROR:CONSOLE(1)]
"Request ...
0
votes
0
answers
52
views
Where to check if window.opener is null at regular intervals in coffeeScript
I'd like to close the child window when parent window is closed after showing browser's default dialog(Are you sure you want to leave?), but I couldn't find any solution to do it from parent window
...
0
votes
0
answers
116
views
How to add a loader in a Vue/Webpack app to support non JS files used in a dependency of a node module
I have a Vue 2 app that uses Webpack, and I am trying to use in it the node module PSD.js, which in itself utilizes CoffeeScript as part of it's dependencies. When I try to compile i get the error:
...
0
votes
0
answers
37
views
Porting: how can i convert those coffeescript into lua?
((contextObject) ->
return (contextObject.isInherent or contextObject.isAdditionalInherent) and !contextObject.isHiddenToUI and !@getGameSession().getModifierClassForType(contextObject....
1
vote
0
answers
17
views
import packages in CoffeeScript [duplicate]
I'm trying to import a package inside an old coffe script file:
import Quill from 'quill/core'
But keep getting the error:
Uncaught SyntaxError: Cannot use import statement outside a module
I set type:...
2
votes
0
answers
52
views
Facing issue after converting code from JavaScript to CoffeeScript, Code is not working nor displaying any Error?
counters = document.querySelectorAll('.counter')
counters.forEach (counter) ->
incrementButton = counter.querySelector('.plus')
decrementButton = counter.querySelector('.minus')
...
0
votes
0
answers
18
views
RequireJS - config a module with the same name in both paths and slim, which one will be finally imported?
There is a code snippet of build.js that defines the config for RequireJS:
{
appDir: "public",
baseUrl: "javascripts",
fileExclusionRegExp: /(^coffee)|(^components)|(^less)|(^...
0
votes
1
answer
131
views
Adding and using current geolocation for weather application (widget) using OpenWeatherAPI
I am trying to add/use current geolocation on the weather widget that I am trying to make.
Currently, I am able to display information of cities based on an external file. I have very little knowledge ...
1
vote
1
answer
88
views
Calling AJAX in Coffeescript
I have an ajax call that works well in a view, but I would like to make it in a coffee script, right inside a datatable call. The code looks like:
$(document).ready(function () {
$.ajax({
...
1
vote
1
answer
140
views
how can put ruby tag with javascript (coffescript)?
I am working with ruby on rails (rails 4.2). Given a validation done in javascript I need to run a ruby tag or not. I found something similar here but it didn't work for me.
html:
<div id="...
0
votes
0
answers
114
views
How do I make VSCODE understand source maps for concatenated coffeescript files?
Trying to use the VSCODE debugger on some coffeescript but part of the build process has grunt-contrib-coffee concatenate a bunch of the sources then compile it and create source maps.
ie Gruntfile:
&...
0
votes
1
answer
77
views
Dropzone Rails Gem How to Send with 0 Files
I want to know the right way on how I handle still sending even when I have 0 files uploaded. I have a form that has a lot of data to input and the images are optional.
I could probably send this with ...
0
votes
0
answers
30
views
Trouble with toggling visibility of a link_to in a tag
It's been a very long time since I've touched anything to do with Javascript or Coffeescript, still pretty new to RoR and I'm having some trouble getting an eventlistener to work.
Currently tags on my ...
4
votes
3
answers
637
views
how add coffeescript in svelte on Rails 7?
I have a Rails 7 app with esbuild :
esbuild.config.js :
#!/usr/bin/env node
const watch = process.argv.includes("--watch");
const esbuild = require('esbuild')
const ...
3
votes
1
answer
352
views
nodejs debugging with non-javascript
In my case, I want to debug CoffeeScript, but this question is NOT CoffeeScript specific. It relates to debugging ANY non-JavaScript language that compiles to JavaScript. To do that, you need to ...
0
votes
1
answer
48
views
Coffeescript if condition for date
This is my 1st mini project using coffeescript dcaf.
Im currently doing some function in coffeescript, my roadblock is i cant compare 2 dates on if statement. Any thoughts?
0
votes
1
answer
378
views
Ruby/Rails button and search filtering
I've added the Active and Archived buttons to this page for extra filtering.
The existing search box functionality uses the following js.coffee which calls the controller index to pull the data from ...
-1
votes
1
answer
39
views
i am using node cron for running jobs , i will this run every day including saturday and sunday '00 00 22 * * *'
i am using node cron for running jobs , i am confused will this
pattern run every day including Saturday and Sunday as well
'00 00 22 * * *'
0
votes
1
answer
502
views
CoffeeScript can't use spread operator with class fields
I can't understand why this syntax of spread method is wrong for CoffeeScript in WebStorm
class Test
fruit: {apple: "apple"}
init: ->
console.log 1, @fruit
spread: ->
...
0
votes
0
answers
168
views
How do I resolve this javascript 404 error?
Im running into what seems like an odd issue. We made a slight change to our coffee javascript and then ran the clobber and precompile. Now for some reason the script works for about 30 seconds then ...
0
votes
0
answers
186
views
DB connectivity failure in Cypress while running from console
I was trying to connect MSSQL from Cypress and finally got a solution by following the steps provided in this link:
https://github.com/cypress-io/cypress/issues/6621
The solution worked perfectly fine ...
0
votes
1
answer
106
views
Get unique values from an array of objects using Cofeescript
I have an array that looks like this:
[
{
"id": 1,
"name": "Paul",
"parent": "Jane"
},
{
"id": 2,
"name"...
0
votes
2
answers
3k
views
MongoDB aggregate function with find function
I am using coffeescript with nodejs to query monogodb data but for some custom data i need to perform aggregate function on my collection but using Session.aggregate(query) in the code is giving me ...
0
votes
1
answer
314
views
Set Atom config.cson location
Is it possible to set Atom config.cson location, instead of using the default ~/.atom/config.cson?
Or at least to be able to use project-relative paths in the config.cson?
1
vote
1
answer
164
views
How to execute a python code from coffee script and get the output
i am developing a coffeescript which needs to execute a python program and get the responses from the python code.
my coffee script is
module.exports = (robot) ->
robot.respond /greetme/i, (msg)...
0
votes
1
answer
66
views
Create a coffeescript to access config.ini file
i am trying to use config.ini in an existing coffeescript.
this is my config.ini
[env]
RUNNING_ENV = 'dev'
[dev]
security="no"
priority="P2"
[prod]
security="yes"
...
0
votes
3
answers
2k
views
Get checked value from radio button group
I am populating radio buttons dynamically, and on submit button click I need to get value of the checked radio button from the group.
<ul data-bind="foreach: Numbers">
<li&...
-1
votes
3
answers
3k
views
Show/Hide Html sections on button click
I have 3 sections of code in the same page, in those 3 sections I have submit buttons.
Initially 1st section should be visible, 2nd and 3rd sections are hidden. On button click from 1st section, 2nd ...
0
votes
1
answer
523
views
show/hide on radio button checked/unchecked- knockout js
I have 2 radio buttons, When I click on the option A, a particular div has to be shown, and when click on the option B, 1st div should be hidden and 2nd div should be shown. Below is the code.
<div ...
0
votes
1
answer
45
views
Array element presence check quirks in CoffeeScript
When checking element presence in inline arrays via the in keyword, CoffeeScript ignores indexOf and rather does that many equality checks.
However, when referring to an array via a variable, it calls ...
-2
votes
1
answer
64
views
SetTimeOut inside a Javascript Promise [duplicate]
I have this code snippet , basically I want to add some interval in between calling myfunc for each element in myCol .
Promise.all(
_.map(myCol, (o) ->
...
1
vote
1
answer
111
views
Get string from html to coffeescript
I cannot seem to be able to pass a string from html
<div class="download-by-date" data-hello="dd/mm/yy">
to coffeescript:
$('.datepicker').datepicker({ dateFormat: $(this)....
0
votes
1
answer
29
views
How to get those tr of a table containing a text_field with a certain value?
I have a table with several rows in which each td has a field, but I need to search for those tr containing the value "Egress" in a text_field. The value "Egress" is entered by the ...
0
votes
1
answer
477
views
SOLVED: Rails 6, Webpacker, Bootstrap 5, Coffee on Heroku is not working
Problem with coffee script on heroku.
At local machine (Ubuntu Linux) all working perfectly, but after deploying changes to Heroku, coffee script stop working, and I can't understand why.
Tried to &...
2
votes
2
answers
780
views
How add the sizes of the slices in the pie chart (at the top) in Chart.js?
I am starting to learn the chart.js library.
I drew a pie chart (like "pie"). When you hover over the slices of the diagram, a number appears in the pop-up window that sets the size of the ...