Questions tagged [coffeescript]
CoffeeScript is a language that compiles into JavaScript. Underneath all of those embarrassing braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.
9,760
questions
2
votes
0
answers
11
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
5
views
officeaddin-How to import excel and read it with excel
How to import excel and read it with excel
enter image description here
0
votes
0
answers
21
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 ...
3
votes
2
answers
110
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 ...
0
votes
0
answers
11
views
How to rewrite fields from coffe.script to type.script
I want to rewrite this msg = '' msg += if error?.message then ' :: ' + $i18n.t(error.message) else '' if error?.data?.errors error.data.errors = ($i18n.t(item) for item in error.data.errors) msg += ...
0
votes
0
answers
19
views
H2O Flow Content Security Policy
I am implementing a feature using H2O Flow open source code. I am running into errors when calling an internal API
Refused to connect to "https://...." because it violates the following ...
3
votes
0
answers
37
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
0
answers
18
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
56
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
25
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
47
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
35
views
Need to RUN SQL Stored Procedure from JavaScript
I'm testing the API from the Cypress tool. For my requirement I have connected to my SQL Server DB using coffeescript and tedious npm packages with the required settings. With that I'm also able to ...
0
votes
0
answers
20
views
Expected values not returned in coffee script [duplicate]
In:
jenkinsGetCSRFCrumb = (msg) ->
url = process.env.HUBOT_JENKINS_URL
path = "#{url}/crumbIssuer/api/json"
req = msg.http(path)
if process.env.HUBOT_JENKINS_AUTH
auth = new ...
0
votes
0
answers
29
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
15
views
cofeescript showing entire url line instead of executing function
I am very new to coding and I decided to try my hand at altering an Übersicht weather widget on my Mac. I have managed to figure out everything besides how to show the icons I want based off of the &...
0
votes
0
answers
25
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
23
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
381
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
0
answers
13
views
How to match bold inputs in hubot coffeescript
I am working to develop a hubot slack application where we can give commands from the slack chatbot and give the response back using coffeescript.
now, I am able to use the slack bot with this.In ...
0
votes
1
answer
54
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?
0
votes
1
answer
44
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
28
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
0
answers
17
views
Finding Angular variable content integrated in RoR app's haml file
Working on the Rails v6 app with Angular.js and haml, I can't find in which file variant variable is defined.
Angular is integrated with coffee-script inside RoR app.
This is my price_breakdown.html....
0
votes
3
answers
141
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&...
0
votes
0
answers
12
views
How to use CoffeeScript.compile in GraalJS (non-NodeJS environment)
I'm trying to use the CoffeeScript module in a project that implements a JavaScript interpreter via GraalJS, but I'm unable to use CoffeeScript, I assume it's because it's not running in a NodeJS ...
-1
votes
3
answers
349
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
0
answers
21
views
How to use one atom snippet inside another without breaking the first one
Since I learned about custom snippets, I've been using atom to write documents in latex. The thing is that I have a problem when using one snippet inside another and I cannot find any documentation ...
0
votes
1
answer
155
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
37
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
41
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
70
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
0
answers
19
views
How to make, use and manage coffeescript in rails 6, (I am following an old guide which is using rails5)?
I want to use coffeescript in Rails6 like Rails5. I am following an old guide which uses Rails5.
In the guide, He(Lecturer) uses the automatically generated coffeescript file from the controller ...
0
votes
0
answers
29
views
How to setup Physicsjs with CoffeeScript using a Cakefile?
Firstly,I'm disappointed that physicsjs is no longer maintained. As I am new to coffeescipt.I would like to setup coffeescipt with physicsjs.
I have never written a cakefile:
I have written some code ...
0
votes
0
answers
30
views
Is it possible to convert this JS to CoffeeScript?
Is it possible to convert the following code to CoffeeScript?
async function print(readable) {
readable.setEncoding('utf8');
let data = '';
for await (const chunk of readable) {
data += ...
0
votes
1
answer
27
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
323
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 &...
1
vote
2
answers
187
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 ...
0
votes
0
answers
49
views
Loop back error next is not a function, unhandled rejection
module.exports = (tableName, params, option, next) ->
log.debug "#{tableName}/insertOrUpdate", params
data = params
Table = Promise.promisifyAll loopback.getModel tableName
...
0
votes
1
answer
64
views
coffeescript promise recursion chain issue
My Initial data is like
[{"id":1,"type":"value","pid":"123"},
{"id":2,"type":"value1","pid":"451"},
...
1
vote
1
answer
197
views
Node.JS Video Upload
Can anyone help me with video upload in Node.JS?
Currently, I am using the express-fileupload module for uploading a video it works fine till 70MB but when the size increases it's not able to parse ...
2
votes
2
answers
61
views
Coffeescript wait until flag is set from a callback and then move on to the next part of the code
I have here a simple program using coffeescript which creates a server on a Raspberry pi, and this receives data from a python script running on a Windows machine on the same network, does some ...
0
votes
0
answers
24
views
Placeholder in initial snippet is removed after a second snippet is used
I have the following two snippets
'.text.tex.latex':
'pmatrix 2x2':
'prefix': 'twopmatrix'
'body': '\\\\begin{pmatrix} \n
$1 & $2 \\\\\\\\ \n
$3 & $4 \n
...
0
votes
1
answer
28
views
Atom Snippets for tex files
I have a .tex file to which I want to add snippets. I have tried the following
'.source.tex':
'console.log':
'prefix': 'Hello'
'body': 'Hello World!'
but it doesn't seem to work. (I have ...
0
votes
1
answer
35
views
Add parameters while submitting a form in rails6
Can I add additional parameters to the below submit function without adding hidden_fields in the form and ajax in rails6
$("#product_form").submit()
Please help. Thanks
0
votes
0
answers
48
views
React Event Listener not working properly Reflux store
I have a component with the form:
class RandomComponent extends React.Component
constructor: (props) ->
super(props)
@store = ReactElements.RandomThing.store
actions.loadDocuments()
...
0
votes
0
answers
63
views
Not able to get URL parameters after Ajax request using Rails
I'm using Rails5 (without turbolinks).
I'm trying to highlight a row of the table.
This event is triggerd by a click action.
One record per row and each row has a delete button.
When the delete button ...
0
votes
0
answers
36
views
Variable visibility issue is CoffeeScript when writing Hubot scripts
I am having a problem that's eating me alive and I can not seem to figure it out.
I have been writing a bunch of scripts for Hubot and stumbled upon a weird variable visibility issue that I can not ...
1
vote
0
answers
146
views
How to make a doubleClick() on some coordinates (Webdriver io)?
I am writing tests in CoffeeScript using Webdriver.io and mocha. The code is processed using the CoffeeScript compiler.
I want to move the mouse cursor to some place on the canvas and make a ...
0
votes
1
answer
94
views
How to check syntax error in coffeescript
I am not familiar with coffee script, I try to move jquery from view to put in asset but not able to make it work.
Here the working from view:
- jquery_ready do
$('label[for=voucher_name], input#...
1
vote
1
answer
90
views
frontend: using data from table related to a different table based on id
Update: solution added. Simpler than what I let my head get around to.
I have a table that I am creating dynamically using an API endpoint (/listpotato).
this table has the id: #potato_list
and ...