coffeescript

jQuery plugin authoring in CoffeeScript, with conventionally “private” objects and “prototype” calls

為{幸葍}努か 提交于 2020-01-05 05:40:06
问题 Background So, I came across an article Essential jQuery Plugin Patterns a few months ago. I was trying to write a simple jQuery plugin and I found this article very useful. It contains a lot of information, most of which is beyond my expertise of JavaScript or jQuery. The main thing of interest was the first plugin template, dubbed jQuery Lightweight Plugin Boilerplate , which I referenced in another question a few months ago. Recently, I started using CoffeeScript and looked up for a

CoffeeScript: ImapConnection is not defined in node-imap

青春壹個敷衍的年華 提交于 2020-01-05 04:58:14
问题 I am trying to run example Coffee Scripts from: CoffeScript and node-imap Sending messages works fine, but when I attempt to read a message, I got this kind of error: TypeError: imap.ImapConnection is not a function at Object.<anonymous> (/home/rmatuszak/Dokumenty/NodeJS/mail/coffee2/read.coffee:15:14) at Object.<anonymous> (/home/rmatuszak/Dokumenty/NodeJS/mail/coffee2/read.coffee:7:1) at Module._compile (module.js:409:26) at Object.exports.run (/usr/lib/node_modules/coffee-script/lib/coffee

How do I compile coffeescript before publishing to NPM?

做~自己de王妃 提交于 2020-01-05 04:36:07
问题 I wrote a simple module in CoffeeScript, but I want to publish the compiled JavaScript to NPM. I don't want to manually run the coffee command each time, that's too much typing and I'll probably forget and publish stale js every now and then. I know there's some combination of npm package.json script hooks and CoffeeScript cli arguments that will do the trick, but I forget the particulars. How's it go again? 回答1: A basic package.json setup for the conventional directory structure looks like

Require('jquery-ui') in node-webkit produces navigator not found error

你。 提交于 2020-01-04 14:31:22
问题 I have installed jquery and jquery-ui via npm for my node-webkit project. I also have a index.html which is loaded by node-webkit at startup and which loads a core.js . This core.js requires both jquery and jquery-ui . When I start the app I get a navigator is not defined error. I tried googling it but found no solution. Has anyone an idea what causes this? 回答1: This problem is unrelated to jquery-ui. I can reproduce it with // index.html <script> require('./test.js'); </script> // In test.js

Require('jquery-ui') in node-webkit produces navigator not found error

為{幸葍}努か 提交于 2020-01-04 14:31:11
问题 I have installed jquery and jquery-ui via npm for my node-webkit project. I also have a index.html which is loaded by node-webkit at startup and which loads a core.js . This core.js requires both jquery and jquery-ui . When I start the app I get a navigator is not defined error. I tried googling it but found no solution. Has anyone an idea what causes this? 回答1: This problem is unrelated to jquery-ui. I can reproduce it with // index.html <script> require('./test.js'); </script> // In test.js

ExecJS::RuntimeError in Listings#index error [closed]

孤街浪徒 提交于 2020-01-04 14:15:43
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm receiving this ExecJS error message when I open my localhost , I don't know why, some help would be amazing. I got this on my localhost Showing /.../conektec/app/views/layouts/application.html.erb where line #6 raised: SyntaxError: [stdin]:6:16: unexpected newline (in /.../conektec/app/assets/javascripts

How to stay in the this context during an ajax call (jquery + coffescript)

纵饮孤独 提交于 2020-01-04 03:24:31
问题 I made a class : class @GameMap options : { 'width' : 100, 'height' : 100, 'tileWidth' : 45, 'tileHeight' : 20, 'scale' : 5, 'moveDistance' : 100, #Distance to move with the map controlers 'showErrorMessages' : true, 'zindexDecorElementBase' : 99999, 'zindexGroudElementBase' : 88888 } lang : { 'errContainerMissing' : "L'élement pour créer la carte n'existe pas" } constructor: (@element) -> this.run() run: -> this.loadDatas() loadDatas: (top,left) -> $.ajax( url: "/map/getnewcoord", data: {

How to stay in the this context during an ajax call (jquery + coffescript)

大憨熊 提交于 2020-01-04 03:24:13
问题 I made a class : class @GameMap options : { 'width' : 100, 'height' : 100, 'tileWidth' : 45, 'tileHeight' : 20, 'scale' : 5, 'moveDistance' : 100, #Distance to move with the map controlers 'showErrorMessages' : true, 'zindexDecorElementBase' : 99999, 'zindexGroudElementBase' : 88888 } lang : { 'errContainerMissing' : "L'élement pour créer la carte n'existe pas" } constructor: (@element) -> this.run() run: -> this.loadDatas() loadDatas: (top,left) -> $.ajax( url: "/map/getnewcoord", data: {

ng-grid hiding bootstrap styled dropdowns

可紊 提交于 2020-01-04 02:32:05
问题 I am upgrading a table form. Each row in the table has several elements, including two drop downs in specific columns for each row. I have upgraded the table to ng-grid and upgraded the drop-downs from plain select widgets to styled bootstrap drop-down elements to match the others on the site. The essential problem I am having is that the CSS layout of ng-grid causes the actual drop down menu to be put behind the cell below, and so not visible. Examining the elements shows that they are

Grunt-browserify+mapify+coffeescript = module not found with relative path

隐身守侯 提交于 2020-01-04 01:57:07
问题 I try to get grunt-browserfy working with relative path for coffeescript but I always have an error message when I try to build my sources : >> Error: module "src/app/utils/includeMixin" not found from "/[ABSOLUTE-PATH-TO-MY-PROJECT]/project/src/app/app-audit.coffee" I have my file hierarchy presented like this : project |- build | |- libs.js | |- audit.js |- src |- app |- app-audit.coffee |- utils |- includeMixin.coffee |- vendor |- node_modules |- gruntfile.coffee I use grunt-browserify