id stringlengths 34 124 | type stringclasses 4
values | prompt stringlengths 0 4.95k | response stringlengths 21 4.89k | source_lang stringclasses 3
values | target_lang stringclasses 2
values | repo stringclasses 75
values | path stringlengths 10 88 | license stringclasses 1
value | commit stringlengths 40 40 | stars int64 431 18.7k | source_url stringlengths 86 176 | line_start int64 1 214 | line_end int64 3 253 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
elving/swag:test/math_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Handlebars, Swag, context;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
context = {
value: 5
};
Swag.registerHelpers(Handlebars);
describe('add', function() {
return describe('{{add value 5}}', function() {
... | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
context =
value: 5
Swag.registerHelpers Handlebars
describe 'add', ->
describe '{{add value 5}}', ->
it 'should return the sum of two numbers.', ->
source = '{{add value 5}}'
template = Handleba... | JavaScript | CoffeeScript | elving/swag | test/math_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/math_test.coffee | 1 | 50 |
elving/swag:test/math_test.coffee:1:completion | completion | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
context =
value: 5
Swag.registerHelpers Handlebars
describe 'add', ->
describe '{{add value 5}}', ->
it 'should return the sum of two numbers.', ->
source = '{{add value 5}}'
template = Handleba... | template(context).should.equal '0'
describe 'divide', ->
describe '{{divide value 5}}', ->
it 'should return the division of two numbers.', ->
source = '{{divide value 5}}'
template = Handlebars.compile(source)
template(context).should.equal '1'
describe 'multiply', ... | CoffeeScript | CoffeeScript | elving/swag | test/math_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/math_test.coffee | 1 | 50 |
elving/swag:test/math_test.coffee:2:raw_corpus | raw_corpus | describe 'ceil', ->
describe '{{ceil 5}}', ->
it 'should return the value rounded up to the nearest integer.', ->
source = '{{ceil value}}'
template = Handlebars.compile(source)
template(context = value: 5.6).should.equal '6'
describe 'round', ->
describe '{{round... | CoffeeScript | elving/swag | test/math_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/math_test.coffee | 51 | 65 | ||
elving/swag:test/math_test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'ceil', ->
describe '{{ceil 5}}', ->
it 'should return the value rounded up to the nearest integer.', ->
source = '{{ceil value}}'
template = Handlebars.compile(source)
template(context = value: 5.6).sho... | describe('ceil', function() {
return describe('{{ceil 5}}', function() {
return it('should return the value rounded up to the nearest integer.', function() {
var context, source, template;
source = '{{ceil value}}';
template = Handlebars.compile(source);
return template(context = {
... | CoffeeScript | JavaScript | elving/swag | test/math_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/math_test.coffee | 51 | 65 |
elving/swag:test/math_test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('ceil', function() {
return describe('{{ceil 5}}', function() {
return it('should return the value rounded up to the nearest integer.', function() {
var context, source, template;
source = '{{ceil value}}';
template = Handlebars.com... | describe 'ceil', ->
describe '{{ceil 5}}', ->
it 'should return the value rounded up to the nearest integer.', ->
source = '{{ceil value}}'
template = Handlebars.compile(source)
template(context = value: 5.6).should.equal '6'
describe 'round', ->
describe '{{round... | JavaScript | CoffeeScript | elving/swag | test/math_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/math_test.coffee | 51 | 65 |
elving/swag:test/math_test.coffee:2:completion | completion | describe 'ceil', ->
describe '{{ceil 5}}', ->
it 'should return the value rounded up to the nearest integer.', ->
source = '{{ceil value}}'
template = Handlebars.compile(source)
template(context = value: 5.6).should.equal '6' | describe 'round', ->
describe '{{round 5}}', ->
it 'should return the value rounded to the nearest integer.', ->
source = '{{round value}}'
template = Handlebars.compile(source)
template(context = value: 5.69).should.equal '6' | CoffeeScript | CoffeeScript | elving/swag | test/math_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/math_test.coffee | 51 | 65 |
elving/swag:test/math_test.coffee:1:raw_corpus | raw_corpus | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
context =
value: 5
describe 'add', ->
describe '{{add value 5}}', ->
it 'should return the sum of two numbers.', ->
source = '{{add value 5}}'
template = Handlebars.compile(source)
t... | CoffeeScript | elving/swag | test/math_test.coffee | MIT | ceecfbab2987ad991113cb7ce1daaec9811408ae | 675 | https://github.com/elving/swag/blob/ceecfbab2987ad991113cb7ce1daaec9811408ae/test/math_test.coffee | 1 | 50 | ||
elving/swag:test/math_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
context =
value: 5
describe 'add', ->
describe '{{add value 5}}', ->
it 'should return the sum of two numbers.', ->
source = '{{add value 5}}'
... | var Handlebars, Swag, context;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
context = {
value: 5
};
describe('add', function() {
return describe('{{add value 5}}', function() {
return it('should return the sum of two numbers.', function() {
var source, templat... | CoffeeScript | JavaScript | elving/swag | test/math_test.coffee | MIT | ceecfbab2987ad991113cb7ce1daaec9811408ae | 675 | https://github.com/elving/swag/blob/ceecfbab2987ad991113cb7ce1daaec9811408ae/test/math_test.coffee | 1 | 50 |
elving/swag:test/math_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Handlebars, Swag, context;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
context = {
value: 5
};
describe('add', function() {
return describe('{{add value 5}}', function() {
return it('should return the sum o... | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
context =
value: 5
describe 'add', ->
describe '{{add value 5}}', ->
it 'should return the sum of two numbers.', ->
source = '{{add value 5}}'
template = Handlebars.compile(source)
t... | JavaScript | CoffeeScript | elving/swag | test/math_test.coffee | MIT | ceecfbab2987ad991113cb7ce1daaec9811408ae | 675 | https://github.com/elving/swag/blob/ceecfbab2987ad991113cb7ce1daaec9811408ae/test/math_test.coffee | 1 | 50 |
elving/swag:test/math_test.coffee:1:completion | completion | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
context =
value: 5
describe 'add', ->
describe '{{add value 5}}', ->
it 'should return the sum of two numbers.', ->
source = '{{add value 5}}'
template = Handlebars.compile(source)
t... | describe '{{divide value 5}}', ->
it 'should return the division of two numbers.', ->
source = '{{divide value 5}}'
template = Handlebars.compile(source)
template(context).should.equal '1'
describe 'multiply', ->
describe '{{multiply value 5}}', ->
it 'should ... | CoffeeScript | CoffeeScript | elving/swag | test/math_test.coffee | MIT | ceecfbab2987ad991113cb7ce1daaec9811408ae | 675 | https://github.com/elving/swag/blob/ceecfbab2987ad991113cb7ce1daaec9811408ae/test/math_test.coffee | 1 | 50 |
elving/swag:test/math_test.coffee:2:raw_corpus | raw_corpus | it 'should return the value rounded up to the nearest integer.', ->
source = '{{ceil value}}'
template = Handlebars.compile(source)
template(context = value: 5.6).should.equal '6'
describe 'round', ->
describe '{{round 5}}', ->
it 'should return the value rounded to t... | CoffeeScript | elving/swag | test/math_test.coffee | MIT | ceecfbab2987ad991113cb7ce1daaec9811408ae | 675 | https://github.com/elving/swag/blob/ceecfbab2987ad991113cb7ce1daaec9811408ae/test/math_test.coffee | 51 | 63 | ||
elving/swag:test/math_test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should return the value rounded up to the nearest integer.', ->
source = '{{ceil value}}'
template = Handlebars.compile(source)
template(context = value: 5.6).should.equal '6'
describe 'round', ->
describe '{{round ... | it('should return the value rounded up to the nearest integer.', function() {
var context, source, template;
source = '{{ceil value}}';
template = Handlebars.compile(source);
return template(context = {
value: 5.6
}).should.equal('6');
});
describe('round', function() {
return describe('{{round 5}}', f... | CoffeeScript | JavaScript | elving/swag | test/math_test.coffee | MIT | ceecfbab2987ad991113cb7ce1daaec9811408ae | 675 | https://github.com/elving/swag/blob/ceecfbab2987ad991113cb7ce1daaec9811408ae/test/math_test.coffee | 51 | 63 |
elving/swag:test/math_test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should return the value rounded up to the nearest integer.', function() {
var context, source, template;
source = '{{ceil value}}';
template = Handlebars.compile(source);
return template(context = {
value: 5.6
}).should.equal('6');
});
describe('... | it 'should return the value rounded up to the nearest integer.', ->
source = '{{ceil value}}'
template = Handlebars.compile(source)
template(context = value: 5.6).should.equal '6'
describe 'round', ->
describe '{{round 5}}', ->
it 'should return the value rounded to t... | JavaScript | CoffeeScript | elving/swag | test/math_test.coffee | MIT | ceecfbab2987ad991113cb7ce1daaec9811408ae | 675 | https://github.com/elving/swag/blob/ceecfbab2987ad991113cb7ce1daaec9811408ae/test/math_test.coffee | 51 | 63 |
elving/swag:test/math_test.coffee:2:completion | completion | it 'should return the value rounded up to the nearest integer.', ->
source = '{{ceil value}}'
template = Handlebars.compile(source)
template(context = value: 5.6).should.equal '6' | describe 'round', ->
describe '{{round 5}}', ->
it 'should return the value rounded to the nearest integer.', ->
source = '{{round value}}'
template = Handlebars.compile(source)
template(context = value: 5.69).should.equal '6' | CoffeeScript | CoffeeScript | elving/swag | test/math_test.coffee | MIT | ceecfbab2987ad991113cb7ce1daaec9811408ae | 675 | https://github.com/elving/swag/blob/ceecfbab2987ad991113cb7ce1daaec9811408ae/test/math_test.coffee | 51 | 63 |
elving/swag:test/math_test.coffee:1:raw_corpus | raw_corpus | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
context =
value: 5
describe 'add', ->
describe '{{add value 5}}', ->
it 'should return the sum of two numbers.', ->
source = '{{add value 5}}'
template = Handlebars.compile(source)
t... | CoffeeScript | elving/swag | test/math_test.coffee | MIT | 5e45f8e30f1605c8b521997024c9a49806571fc8 | 675 | https://github.com/elving/swag/blob/5e45f8e30f1605c8b521997024c9a49806571fc8/test/math_test.coffee | 1 | 50 | ||
elving/swag:test/math_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
context =
value: 5
describe 'add', ->
describe '{{add value 5}}', ->
it 'should return the sum of two numbers.', ->
source = '{{add value 5}}'
... | var Handlebars, Swag, context;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
context = {
value: 5
};
describe('add', function() {
return describe('{{add value 5}}', function() {
return it('should return the sum of two numbers.', function() {
var source, templat... | CoffeeScript | JavaScript | elving/swag | test/math_test.coffee | MIT | 5e45f8e30f1605c8b521997024c9a49806571fc8 | 675 | https://github.com/elving/swag/blob/5e45f8e30f1605c8b521997024c9a49806571fc8/test/math_test.coffee | 1 | 50 |
elving/swag:test/math_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Handlebars, Swag, context;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
context = {
value: 5
};
describe('add', function() {
return describe('{{add value 5}}', function() {
return it('should return the sum o... | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
context =
value: 5
describe 'add', ->
describe '{{add value 5}}', ->
it 'should return the sum of two numbers.', ->
source = '{{add value 5}}'
template = Handlebars.compile(source)
t... | JavaScript | CoffeeScript | elving/swag | test/math_test.coffee | MIT | 5e45f8e30f1605c8b521997024c9a49806571fc8 | 675 | https://github.com/elving/swag/blob/5e45f8e30f1605c8b521997024c9a49806571fc8/test/math_test.coffee | 1 | 50 |
elving/swag:test/math_test.coffee:1:completion | completion | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
context =
value: 5
describe 'add', ->
describe '{{add value 5}}', ->
it 'should return the sum of two numbers.', ->
source = '{{add value 5}}'
template = Handlebars.compile(source)
t... | describe '{{divide value 5}}', ->
it 'should return the division of two numbers.', ->
source = '{{divide value 5}}'
template = Handlebars.compile(source)
template(context).should.equal 1
describe 'multiply', ->
describe '{{multiply value 5}}', ->
it 'should re... | CoffeeScript | CoffeeScript | elving/swag | test/math_test.coffee | MIT | 5e45f8e30f1605c8b521997024c9a49806571fc8 | 675 | https://github.com/elving/swag/blob/5e45f8e30f1605c8b521997024c9a49806571fc8/test/math_test.coffee | 1 | 50 |
elving/swag:test/math_test.coffee:2:raw_corpus | raw_corpus | it 'should return the value rounded up to the nearest integer.', ->
source = '{{ceil value}}'
template = Handlebars.compile(source)
template(context = value: 5.6).should.equal 6
describe 'round', ->
describe '{{round 5}}', ->
it 'should return the value rounded to the... | CoffeeScript | elving/swag | test/math_test.coffee | MIT | 5e45f8e30f1605c8b521997024c9a49806571fc8 | 675 | https://github.com/elving/swag/blob/5e45f8e30f1605c8b521997024c9a49806571fc8/test/math_test.coffee | 51 | 63 | ||
elving/swag:test/math_test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should return the value rounded up to the nearest integer.', ->
source = '{{ceil value}}'
template = Handlebars.compile(source)
template(context = value: 5.6).should.equal 6
describe 'round', ->
describe '{{round 5}... | it('should return the value rounded up to the nearest integer.', function() {
var context, source, template;
source = '{{ceil value}}';
template = Handlebars.compile(source);
return template(context = {
value: 5.6
}).should.equal(6);
});
describe('round', function() {
return describe('{{round 5}}', fun... | CoffeeScript | JavaScript | elving/swag | test/math_test.coffee | MIT | 5e45f8e30f1605c8b521997024c9a49806571fc8 | 675 | https://github.com/elving/swag/blob/5e45f8e30f1605c8b521997024c9a49806571fc8/test/math_test.coffee | 51 | 63 |
elving/swag:test/math_test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should return the value rounded up to the nearest integer.', function() {
var context, source, template;
source = '{{ceil value}}';
template = Handlebars.compile(source);
return template(context = {
value: 5.6
}).should.equal(6);
});
describe('ro... | it 'should return the value rounded up to the nearest integer.', ->
source = '{{ceil value}}'
template = Handlebars.compile(source)
template(context = value: 5.6).should.equal 6
describe 'round', ->
describe '{{round 5}}', ->
it 'should return the value rounded to the... | JavaScript | CoffeeScript | elving/swag | test/math_test.coffee | MIT | 5e45f8e30f1605c8b521997024c9a49806571fc8 | 675 | https://github.com/elving/swag/blob/5e45f8e30f1605c8b521997024c9a49806571fc8/test/math_test.coffee | 51 | 63 |
elving/swag:test/math_test.coffee:2:completion | completion | it 'should return the value rounded up to the nearest integer.', ->
source = '{{ceil value}}'
template = Handlebars.compile(source)
template(context = value: 5.6).should.equal 6 | describe 'round', ->
describe '{{round 5}}', ->
it 'should return the value rounded to the nearest integer.', ->
source = '{{round value}}'
template = Handlebars.compile(source)
template(context = value: 5.69).should.equal 6 | CoffeeScript | CoffeeScript | elving/swag | test/math_test.coffee | MIT | 5e45f8e30f1605c8b521997024c9a49806571fc8 | 675 | https://github.com/elving/swag/blob/5e45f8e30f1605c8b521997024c9a49806571fc8/test/math_test.coffee | 51 | 63 |
JoelBesada/activate-power-mode:spec/activate-power-mode-spec.coffee:1:raw_corpus | raw_corpus | ActivatePowerMode = require '../lib/activate-power-mode'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "ActivatePowerMode", ->
[workspaceE... | CoffeeScript | JoelBesada/activate-power-mode | spec/activate-power-mode-spec.coffee | MIT | e359c61fed43a7f31576d0f426fa2738c823abff | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/e359c61fed43a7f31576d0f426fa2738c823abff/spec/activate-power-mode-spec.coffee | 1 | 50 | ||
JoelBesada/activate-power-mode:spec/activate-power-mode-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
ActivatePowerMode = require '../lib/activate-power-mode'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus t... | var ActivatePowerMode;
ActivatePowerMode = require('../lib/activate-power-mode');
// Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
// To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
// or `fdescribe`). Remove the `f` to unfocus the block.
describe("ActivateP... | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | spec/activate-power-mode-spec.coffee | MIT | e359c61fed43a7f31576d0f426fa2738c823abff | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/e359c61fed43a7f31576d0f426fa2738c823abff/spec/activate-power-mode-spec.coffee | 1 | 50 |
JoelBesada/activate-power-mode:spec/activate-power-mode-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ActivatePowerMode;
ActivatePowerMode = require('../lib/activate-power-mode');
// Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
// To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
// or `fdescribe`). R... | ActivatePowerMode = require '../lib/activate-power-mode'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "ActivatePowerMode", ->
[workspaceE... | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | spec/activate-power-mode-spec.coffee | MIT | e359c61fed43a7f31576d0f426fa2738c823abff | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/e359c61fed43a7f31576d0f426fa2738c823abff/spec/activate-power-mode-spec.coffee | 1 | 50 |
JoelBesada/activate-power-mode:spec/activate-power-mode-spec.coffee:1:completion | completion | ActivatePowerMode = require '../lib/activate-power-mode'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "ActivatePowerMode", ->
[workspaceE... | activationPromise
runs ->
expect(workspaceElement.querySelector('.activate-power-mode')).toExist()
activatePowerModeElement = workspaceElement.querySelector('.activate-power-mode')
expect(activatePowerModeElement).toExist()
activatePowerModePanel = atom.workspace.panelForItem(ac... | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | spec/activate-power-mode-spec.coffee | MIT | e359c61fed43a7f31576d0f426fa2738c823abff | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/e359c61fed43a7f31576d0f426fa2738c823abff/spec/activate-power-mode-spec.coffee | 1 | 50 |
JoelBesada/activate-power-mode:spec/activate-power-mode-spec.coffee:2:raw_corpus | raw_corpus | # activated.
atom.commands.dispatch workspaceElement, 'activate-power-mode:toggle'
waitsForPromise ->
activationPromise
runs ->
# Now we can test for view visibility
activatePowerModeElement = workspaceElement.querySelector('.activate-power-mode')
expect(activatePower... | CoffeeScript | JoelBesada/activate-power-mode | spec/activate-power-mode-spec.coffee | MIT | e359c61fed43a7f31576d0f426fa2738c823abff | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/e359c61fed43a7f31576d0f426fa2738c823abff/spec/activate-power-mode-spec.coffee | 51 | 62 | ||
JoelBesada/activate-power-mode:spec/activate-power-mode-spec.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# activated.
atom.commands.dispatch workspaceElement, 'activate-power-mode:toggle'
waitsForPromise ->
activationPromise
runs ->
# Now we can test for view visibility
activatePowerModeElement = workspaceElement.querySele... | // activated.
atom.commands.dispatch(workspaceElement, 'activate-power-mode:toggle');
waitsForPromise(function() {
return activationPromise;
});
runs(function() {
var activatePowerModeElement;
// Now we can test for view visibility
activatePowerModeElement = workspaceElement.querySelector('.activate-power-mod... | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | spec/activate-power-mode-spec.coffee | MIT | e359c61fed43a7f31576d0f426fa2738c823abff | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/e359c61fed43a7f31576d0f426fa2738c823abff/spec/activate-power-mode-spec.coffee | 51 | 62 |
JoelBesada/activate-power-mode:spec/activate-power-mode-spec.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// activated.
atom.commands.dispatch(workspaceElement, 'activate-power-mode:toggle');
waitsForPromise(function() {
return activationPromise;
});
runs(function() {
var activatePowerModeElement;
// Now we can test for view visibility
activatePowerModeElemen... | # activated.
atom.commands.dispatch workspaceElement, 'activate-power-mode:toggle'
waitsForPromise ->
activationPromise
runs ->
# Now we can test for view visibility
activatePowerModeElement = workspaceElement.querySelector('.activate-power-mode')
expect(activatePower... | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | spec/activate-power-mode-spec.coffee | MIT | e359c61fed43a7f31576d0f426fa2738c823abff | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/e359c61fed43a7f31576d0f426fa2738c823abff/spec/activate-power-mode-spec.coffee | 51 | 62 |
JoelBesada/activate-power-mode:spec/activate-power-mode-spec.coffee:2:completion | completion | # activated.
atom.commands.dispatch workspaceElement, 'activate-power-mode:toggle'
waitsForPromise ->
activationPromise | runs ->
# Now we can test for view visibility
activatePowerModeElement = workspaceElement.querySelector('.activate-power-mode')
expect(activatePowerModeElement).toBeVisible()
atom.commands.dispatch workspaceElement, 'activate-power-mode:toggle'
expect(activatePowerModeElement).no... | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | spec/activate-power-mode-spec.coffee | MIT | e359c61fed43a7f31576d0f426fa2738c823abff | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/e359c61fed43a7f31576d0f426fa2738c823abff/spec/activate-power-mode-spec.coffee | 51 | 62 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:raw_corpus | raw_corpus | templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disabled as there
# are exceptions being thrown from the electron-dl module
#
canShowSaveImg = params.mediaType == 'image' && false
canShowCopyImgLink = params.mediaType == 'image' && params.srcU... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/contextmenu.coffee | 13 | 62 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:completion | completion | templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disabled as there
# are exceptions being thrown from the electron-dl module
#
canShowSaveImg = params.mediaType == 'image' && false
canShowCopyImgLink = params.mediaType == 'image' && params.srcU... | label: el,
action: {name: 'replacemisspelling', params: [el]}
}
{
type: 'separator'
visible: params?.dictionarySuggestions?.length > 0
}
{
label: i18n.__('menu.edit.spell_check.title:Spellcheck')
submenu: [
{
label: spellC... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/contextmenu.coffee | 13 | 62 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:raw_corpus | raw_corpus | submenu: langMenu
}
]
}
{ type: 'separator' }
{
label: i18n.__('menu.edit.save_image:Save Image')
visible: canShowSaveImg
action: {name: 'saveimage', params: [params.srcURL]}
}
{ type: 'separator' } if canShowSaveImg
{
label: i18n.__('menu.edit... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/contextmenu.coffee | 63 | 112 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:completion | completion | submenu: langMenu
}
]
}
{ type: 'separator' }
{
label: i18n.__('menu.edit.save_image:Save Image')
visible: canShowSaveImg
action: {name: 'saveimage', params: [params.srcURL]}
}
{ type: 'separator' } if canShowSaveImg
{
label: i18n.__('menu.edit... | label: i18n.__('menu.edit.cut:Cut')
role: 'cut'
enabled: params.editFlags.canCut
visible: true
}
{
label: i18n.__('menu.edit.copy:Copy')
role: 'copy'
enabled: params.editFlags.canCopy
visible: true
}
{
label: i18n.__('menu.edit.copy_link:Co... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/contextmenu.coffee | 63 | 112 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:4:raw_corpus | raw_corpus | templateAboutContext = (params, viewstate) ->
[{
label: i18n.__('menu.edit.copy')
role: 'copy'
enabled: params.editFlags.canCopy
}
{
label: i18n.__('menu.edit.copy_link:Copy Link')
visible: params.linkURL != '' and params.mediaType == 'none'
action: {name: 'co... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/contextmenu.coffee | 116 | 126 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
templateAboutContext = (params, viewstate) ->
[{
label: i18n.__('menu.edit.copy')
role: 'copy'
enabled: params.editFlags.canCopy
}
{
label: i18n.__('menu.edit.copy_link:Copy Link')
visible: params.linkURL != '' ... | var templateAboutContext;
templateAboutContext = function(params, viewstate) {
return [
{
label: i18n.__('menu.edit.copy'),
role: 'copy',
enabled: params.editFlags.canCopy
},
{
label: i18n.__('menu.edit.copy_link:Copy Link'),
visible: params.linkURL !== '' && params.mediaTyp... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/contextmenu.coffee | 116 | 126 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var templateAboutContext;
templateAboutContext = function(params, viewstate) {
return [
{
label: i18n.__('menu.edit.copy'),
role: 'copy',
enabled: params.editFlags.canCopy
},
{
label: i18n.__('menu.edit.copy_link:Copy Link'),
... | templateAboutContext = (params, viewstate) ->
[{
label: i18n.__('menu.edit.copy')
role: 'copy'
enabled: params.editFlags.canCopy
}
{
label: i18n.__('menu.edit.copy_link:Copy Link')
visible: params.linkURL != '' and params.mediaType == 'none'
action: {name: 'co... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/contextmenu.coffee | 116 | 126 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:4:completion | completion | templateAboutContext = (params, viewstate) ->
[{
label: i18n.__('menu.edit.copy')
role: 'copy'
enabled: params.editFlags.canCopy | }
{
label: i18n.__('menu.edit.copy_link:Copy Link')
visible: params.linkURL != '' and params.mediaType == 'none'
action: {name: 'copytext', params: [params.linkText]}
}] | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/contextmenu.coffee | 116 | 126 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:5:raw_corpus | raw_corpus | module.exports = (params, viewstate) ->
if viewstate.state == viewstate.STATE_ABOUT
templateAboutContext(params, viewstate)
else
templateContext(params, viewstate) | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/contextmenu.coffee | 127 | 131 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (params, viewstate) ->
if viewstate.state == viewstate.STATE_ABOUT
templateAboutContext(params, viewstate)
else
templateContext(params, viewstate)
``` | module.exports = function(params, viewstate) {
if (viewstate.state === viewstate.STATE_ABOUT) {
return templateAboutContext(params, viewstate);
} else {
return templateContext(params, viewstate);
}
}; | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/contextmenu.coffee | 127 | 131 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(params, viewstate) {
if (viewstate.state === viewstate.STATE_ABOUT) {
return templateAboutContext(params, viewstate);
} else {
return templateContext(params, viewstate);
}
};
``` | module.exports = (params, viewstate) ->
if viewstate.state == viewstate.STATE_ABOUT
templateAboutContext(params, viewstate)
else
templateContext(params, viewstate) | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/views/contextmenu.coffee | 127 | 131 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:raw_corpus | raw_corpus | templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disabled as there
# are exceptions being thrown from the electron-dl module
#
canShowSaveImg = params.mediaType == 'image' && false
canShowCopyImgLink = params.mediaType == 'image' && params.srcU... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 81e73a140d93cc6ea8986e416731cc727752d066 | 3,762 | https://github.com/yakyak/yakyak/blob/81e73a140d93cc6ea8986e416731cc727752d066/src/ui/views/contextmenu.coffee | 9 | 58 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:completion | completion | templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disabled as there
# are exceptions being thrown from the electron-dl module
#
canShowSaveImg = params.mediaType == 'image' && false
canShowCopyImgLink = params.mediaType == 'image' && params.srcU... | label: el,
action: {name: 'replacemisspelling', params: [el]}
}
{
type: 'separator'
visible: params?.dictionarySuggestions?.length > 0
}
{
label: i18n.__('menu.edit.spell_check.title:Spellcheck')
submenu: [
{
label: spellC... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 81e73a140d93cc6ea8986e416731cc727752d066 | 3,762 | https://github.com/yakyak/yakyak/blob/81e73a140d93cc6ea8986e416731cc727752d066/src/ui/views/contextmenu.coffee | 9 | 58 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:raw_corpus | raw_corpus | templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disabled as there
# are exceptions being thrown from the electron-dl module
#
canShowSaveImg = params.mediaType == 'image' && false
canShowCopyImgLink = params.mediaType == 'image' && params.srcU... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 637de30240821cbf6ed71c5069d95350706f8876 | 3,762 | https://github.com/yakyak/yakyak/blob/637de30240821cbf6ed71c5069d95350706f8876/src/ui/views/contextmenu.coffee | 13 | 62 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:completion | completion | templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disabled as there
# are exceptions being thrown from the electron-dl module
#
canShowSaveImg = params.mediaType == 'image' && false
canShowCopyImgLink = params.mediaType == 'image' && params.srcU... | }
{
label: i18n.__('menu.edit.spell_check.title:Spellcheck')
submenu: [
{
label: spellCheck
enabled: false
checked: spellcheckLanguage != 'none'
click: -> action 'setspellchecklanguage', 'none'
}
{... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 637de30240821cbf6ed71c5069d95350706f8876 | 3,762 | https://github.com/yakyak/yakyak/blob/637de30240821cbf6ed71c5069d95350706f8876/src/ui/views/contextmenu.coffee | 13 | 62 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:raw_corpus | raw_corpus | label: i18n.__('menu.edit.save_image:Save Image')
visible: canShowSaveImg
click: (item, win) ->
try
download win, params.srcURL
catch
console.log 'Possible problem with saving image. ', err
}
{ type: 'separator' } if canShowSaveImg
{
... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 637de30240821cbf6ed71c5069d95350706f8876 | 3,762 | https://github.com/yakyak/yakyak/blob/637de30240821cbf6ed71c5069d95350706f8876/src/ui/views/contextmenu.coffee | 63 | 112 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:completion | completion | label: i18n.__('menu.edit.save_image:Save Image')
visible: canShowSaveImg
click: (item, win) ->
try
download win, params.srcURL
catch
console.log 'Possible problem with saving image. ', err
}
{ type: 'separator' } if canShowSaveImg
{
... | enabled: params.editFlags.canCut
visible: true
}
{
label: i18n.__('menu.edit.copy:Copy')
role: 'copy'
enabled: params.editFlags.canCopy
visible: true
}
{
label: i18n.__('menu.edit.copy_link:Copy Link')
visible: canShowCopyLink
click: () ->
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 637de30240821cbf6ed71c5069d95350706f8876 | 3,762 | https://github.com/yakyak/yakyak/blob/637de30240821cbf6ed71c5069d95350706f8876/src/ui/views/contextmenu.coffee | 63 | 112 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:3:raw_corpus | raw_corpus | clipboard.writeText params.srcURL
}
{
label: i18n.__('menu.edit.paste:Paste')
role: 'paste'
visible: (isContentPasteable() &&
viewstate.state == viewstate.STATE_NORMAL) || params.isEditable
}].filter (n) -> n != undefined | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 637de30240821cbf6ed71c5069d95350706f8876 | 3,762 | https://github.com/yakyak/yakyak/blob/637de30240821cbf6ed71c5069d95350706f8876/src/ui/views/contextmenu.coffee | 113 | 120 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:3:completion | completion | clipboard.writeText params.srcURL
}
{
label: i18n.__('menu.edit.paste:Paste') | role: 'paste'
visible: (isContentPasteable() &&
viewstate.state == viewstate.STATE_NORMAL) || params.isEditable
}].filter (n) -> n != undefined | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 637de30240821cbf6ed71c5069d95350706f8876 | 3,762 | https://github.com/yakyak/yakyak/blob/637de30240821cbf6ed71c5069d95350706f8876/src/ui/views/contextmenu.coffee | 113 | 120 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:4:raw_corpus | raw_corpus | templateAboutContext = (params, viewstate) ->
[{
label: i18n.__('menu.edit.copy')
role: 'copy'
enabled: params.editFlags.canCopy
}
{
label: i18n.__('menu.edit.copy_link')
visible: params.linkURL != '' and params.mediaType == 'none'
click: () ->
if ... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 637de30240821cbf6ed71c5069d95350706f8876 | 3,762 | https://github.com/yakyak/yakyak/blob/637de30240821cbf6ed71c5069d95350706f8876/src/ui/views/contextmenu.coffee | 122 | 137 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
templateAboutContext = (params, viewstate) ->
[{
label: i18n.__('menu.edit.copy')
role: 'copy'
enabled: params.editFlags.canCopy
}
{
label: i18n.__('menu.edit.copy_link')
visible: params.linkURL != '' and params... | var templateAboutContext;
templateAboutContext = function(params, viewstate) {
return [
{
label: i18n.__('menu.edit.copy'),
role: 'copy',
enabled: params.editFlags.canCopy
},
{
label: i18n.__('menu.edit.copy_link'),
visible: params.linkURL !== '' && params.mediaType === 'non... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 637de30240821cbf6ed71c5069d95350706f8876 | 3,762 | https://github.com/yakyak/yakyak/blob/637de30240821cbf6ed71c5069d95350706f8876/src/ui/views/contextmenu.coffee | 122 | 137 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var templateAboutContext;
templateAboutContext = function(params, viewstate) {
return [
{
label: i18n.__('menu.edit.copy'),
role: 'copy',
enabled: params.editFlags.canCopy
},
{
label: i18n.__('menu.edit.copy_link'),
visi... | templateAboutContext = (params, viewstate) ->
[{
label: i18n.__('menu.edit.copy')
role: 'copy'
enabled: params.editFlags.canCopy
}
{
label: i18n.__('menu.edit.copy_link')
visible: params.linkURL != '' and params.mediaType == 'none'
click: () ->
if ... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 637de30240821cbf6ed71c5069d95350706f8876 | 3,762 | https://github.com/yakyak/yakyak/blob/637de30240821cbf6ed71c5069d95350706f8876/src/ui/views/contextmenu.coffee | 122 | 137 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:4:completion | completion | templateAboutContext = (params, viewstate) ->
[{
label: i18n.__('menu.edit.copy')
role: 'copy'
enabled: params.editFlags.canCopy
}
{
label: i18n.__('menu.edit.copy_link') | visible: params.linkURL != '' and params.mediaType == 'none'
click: () ->
if process.platform == 'darwin'
clipboard
.writeBookmark params.linkText, params.linkText
else
clipboard.writeText params.linkText
}] | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 637de30240821cbf6ed71c5069d95350706f8876 | 3,762 | https://github.com/yakyak/yakyak/blob/637de30240821cbf6ed71c5069d95350706f8876/src/ui/views/contextmenu.coffee | 122 | 137 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:5:raw_corpus | raw_corpus | module.exports = (params, viewstate) ->
if viewstate.state == viewstate.STATE_ABOUT
ContextMenu.buildFromTemplate templateAboutContext(params, viewstate)
else
ContextMenu.buildFromTemplate templateContext(params, viewstate) | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 637de30240821cbf6ed71c5069d95350706f8876 | 3,762 | https://github.com/yakyak/yakyak/blob/637de30240821cbf6ed71c5069d95350706f8876/src/ui/views/contextmenu.coffee | 138 | 142 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (params, viewstate) ->
if viewstate.state == viewstate.STATE_ABOUT
ContextMenu.buildFromTemplate templateAboutContext(params, viewstate)
else
ContextMenu.buildFromTemplate templateContext(params, viewstate)
``` | module.exports = function(params, viewstate) {
if (viewstate.state === viewstate.STATE_ABOUT) {
return ContextMenu.buildFromTemplate(templateAboutContext(params, viewstate));
} else {
return ContextMenu.buildFromTemplate(templateContext(params, viewstate));
}
}; | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 637de30240821cbf6ed71c5069d95350706f8876 | 3,762 | https://github.com/yakyak/yakyak/blob/637de30240821cbf6ed71c5069d95350706f8876/src/ui/views/contextmenu.coffee | 138 | 142 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(params, viewstate) {
if (viewstate.state === viewstate.STATE_ABOUT) {
return ContextMenu.buildFromTemplate(templateAboutContext(params, viewstate));
} else {
return ContextMenu.buildFromTemplate(templateContext(params, viewstat... | module.exports = (params, viewstate) ->
if viewstate.state == viewstate.STATE_ABOUT
ContextMenu.buildFromTemplate templateAboutContext(params, viewstate)
else
ContextMenu.buildFromTemplate templateContext(params, viewstate) | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 637de30240821cbf6ed71c5069d95350706f8876 | 3,762 | https://github.com/yakyak/yakyak/blob/637de30240821cbf6ed71c5069d95350706f8876/src/ui/views/contextmenu.coffee | 138 | 142 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:5:completion | completion | module.exports = (params, viewstate) ->
if viewstate.state == viewstate.STATE_ABOUT | ContextMenu.buildFromTemplate templateAboutContext(params, viewstate)
else
ContextMenu.buildFromTemplate templateContext(params, viewstate) | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 637de30240821cbf6ed71c5069d95350706f8876 | 3,762 | https://github.com/yakyak/yakyak/blob/637de30240821cbf6ed71c5069d95350706f8876/src/ui/views/contextmenu.coffee | 138 | 142 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:raw_corpus | raw_corpus | templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disabled as there
# are exceptions being thrown from the electron-dl module
#
canShowSaveImg = params.mediaType == 'image' && false
canShowCopyImgLink = params.mediaType == 'image' && params.srcU... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | f365fd17d79d229de05df31d3f796ba3c118d5c7 | 3,762 | https://github.com/yakyak/yakyak/blob/f365fd17d79d229de05df31d3f796ba3c118d5c7/src/ui/views/contextmenu.coffee | 12 | 61 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:completion | completion | templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disabled as there
# are exceptions being thrown from the electron-dl module
#
canShowSaveImg = params.mediaType == 'image' && false
canShowCopyImgLink = params.mediaType == 'image' && params.srcU... | }
{
label: i18n.__('menu.edit.spell_check.title:Spellcheck')
submenu: [
{
label: spellCheck
enabled: false
checked: spellcheckLanguage != 'none'
click: -> action 'setspellchecklanguage', 'none'
}
{... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | f365fd17d79d229de05df31d3f796ba3c118d5c7 | 3,762 | https://github.com/yakyak/yakyak/blob/f365fd17d79d229de05df31d3f796ba3c118d5c7/src/ui/views/contextmenu.coffee | 12 | 61 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:raw_corpus | raw_corpus | templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disabled as there
# are exceptions being thrown from the electron-dl module
#
canShowSaveImg = params.mediaType == 'image' && false
canShowCopyImgLink = params.mediaType == 'image' && params.srcU... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 91ded9aafa9158dd0244b2b5a4e8ea4a8299acf6 | 3,762 | https://github.com/yakyak/yakyak/blob/91ded9aafa9158dd0244b2b5a4e8ea4a8299acf6/src/ui/views/contextmenu.coffee | 12 | 61 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:completion | completion | templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disabled as there
# are exceptions being thrown from the electron-dl module
#
canShowSaveImg = params.mediaType == 'image' && false
canShowCopyImgLink = params.mediaType == 'image' && params.srcU... | submenu: [
{
label: spellCheck
enabled: false
checked: spellcheckLanguage != 'none'
click: -> action 'setspellchecklanguage', 'none'
}
{
label: i18n.__('menu.edit.spell_check.turn_off:Turn spellcheck off')... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 91ded9aafa9158dd0244b2b5a4e8ea4a8299acf6 | 3,762 | https://github.com/yakyak/yakyak/blob/91ded9aafa9158dd0244b2b5a4e8ea4a8299acf6/src/ui/views/contextmenu.coffee | 12 | 61 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:raw_corpus | raw_corpus | {
label: i18n.__('menu.edit.save_image:Save Image')
visible: canShowSaveImg
click: (item, win) ->
try
download win, params.srcURL
catch
console.log 'Possible problem with saving image. ', err
}
{ type: 'separator' } if canShowSaveIm... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 91ded9aafa9158dd0244b2b5a4e8ea4a8299acf6 | 3,762 | https://github.com/yakyak/yakyak/blob/91ded9aafa9158dd0244b2b5a4e8ea4a8299acf6/src/ui/views/contextmenu.coffee | 62 | 111 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:completion | completion | {
label: i18n.__('menu.edit.save_image:Save Image')
visible: canShowSaveImg
click: (item, win) ->
try
download win, params.srcURL
catch
console.log 'Possible problem with saving image. ', err
}
{ type: 'separator' } if canShowSaveIm... | role: 'cut'
enabled: params.editFlags.canCut
visible: true
}
{
label: i18n.__('menu.edit.copy:Copy')
role: 'copy'
enabled: params.editFlags.canCopy
visible: true
}
{
label: i18n.__('menu.edit.copy_link:Copy Link')
visible: canShowCopyLink
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 91ded9aafa9158dd0244b2b5a4e8ea4a8299acf6 | 3,762 | https://github.com/yakyak/yakyak/blob/91ded9aafa9158dd0244b2b5a4e8ea4a8299acf6/src/ui/views/contextmenu.coffee | 62 | 111 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:3:raw_corpus | raw_corpus | else
clipboard.writeText params.srcURL
}
{
label: i18n.__('menu.edit.paste:Paste')
role: 'paste'
visible: (isContentPasteable() &&
viewstate.state == viewstate.STATE_NORMAL) || params.isEditable
}].filter (n) -> n != undefined | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 91ded9aafa9158dd0244b2b5a4e8ea4a8299acf6 | 3,762 | https://github.com/yakyak/yakyak/blob/91ded9aafa9158dd0244b2b5a4e8ea4a8299acf6/src/ui/views/contextmenu.coffee | 112 | 120 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:3:completion | completion | else
clipboard.writeText params.srcURL
}
{ | label: i18n.__('menu.edit.paste:Paste')
role: 'paste'
visible: (isContentPasteable() &&
viewstate.state == viewstate.STATE_NORMAL) || params.isEditable
}].filter (n) -> n != undefined | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 91ded9aafa9158dd0244b2b5a4e8ea4a8299acf6 | 3,762 | https://github.com/yakyak/yakyak/blob/91ded9aafa9158dd0244b2b5a4e8ea4a8299acf6/src/ui/views/contextmenu.coffee | 112 | 120 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:raw_corpus | raw_corpus | remote = require('electron').remote
clipboard = require('electron').clipboard
# {download} = require('electron-dl') # See IMPORTANT below
ContextMenu = remote.Menu
{isContentPasteable} = require '../util'
templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disable... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 39e8c438d6f6401e39be9bb77e20643e0401c3e7 | 3,762 | https://github.com/yakyak/yakyak/blob/39e8c438d6f6401e39be9bb77e20643e0401c3e7/src/ui/views/contextmenu.coffee | 1 | 50 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:completion | completion | remote = require('electron').remote
clipboard = require('electron').clipboard
# {download} = require('electron-dl') # See IMPORTANT below
ContextMenu = remote.Menu
{isContentPasteable} = require '../util'
templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disable... | { type: 'separator' } if canShowSaveImg
{
label: i18n.__('menu.edit.undo:Undo')
role: 'undo'
enabled: params.editFlags.canUndo
visible: true
}
{
label: i18n.__('menu.edit.redo:Redo')
role: 'redo'
enabled: params.editFlags.canRedo
visible: true
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 39e8c438d6f6401e39be9bb77e20643e0401c3e7 | 3,762 | https://github.com/yakyak/yakyak/blob/39e8c438d6f6401e39be9bb77e20643e0401c3e7/src/ui/views/contextmenu.coffee | 1 | 50 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:raw_corpus | raw_corpus | }
{
label: i18n.__('menu.edit.copy_link:Copy Link')
visible: canShowCopyLink
click: () ->
if process.platform == 'darwin'
clipboard.writeBookmark params.linkText, params.linkText
else
clipboard.writeText params.linkText
}
{
... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 39e8c438d6f6401e39be9bb77e20643e0401c3e7 | 3,762 | https://github.com/yakyak/yakyak/blob/39e8c438d6f6401e39be9bb77e20643e0401c3e7/src/ui/views/contextmenu.coffee | 51 | 78 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:completion | completion | }
{
label: i18n.__('menu.edit.copy_link:Copy Link')
visible: canShowCopyLink
click: () ->
if process.platform == 'darwin'
clipboard.writeBookmark params.linkText, params.linkText
else
clipboard.writeText params.linkText
}
{
... | if process.platform == 'darwin'
clipboard.writeBookmark params.srcURL, params.srcURL
else
clipboard.writeText params.srcURL
}
{
label: i18n.__('menu.edit.paste:Paste')
role: 'paste'
visible: (isContentPasteable() &&
viewstate.state ... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 39e8c438d6f6401e39be9bb77e20643e0401c3e7 | 3,762 | https://github.com/yakyak/yakyak/blob/39e8c438d6f6401e39be9bb77e20643e0401c3e7/src/ui/views/contextmenu.coffee | 51 | 78 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:raw_corpus | raw_corpus | remote = require('electron').remote
clipboard = require('electron').clipboard
# {download} = require('electron-dl') # See IMPORTANT below
ContextMenu = remote.Menu
{isContentPasteable} = require '../util'
templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disable... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 7800c1ff30d3e9eb1ab618a4bd8799810d94aeb9 | 3,762 | https://github.com/yakyak/yakyak/blob/7800c1ff30d3e9eb1ab618a4bd8799810d94aeb9/src/ui/views/contextmenu.coffee | 1 | 50 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:completion | completion | remote = require('electron').remote
clipboard = require('electron').clipboard
# {download} = require('electron-dl') # See IMPORTANT below
ContextMenu = remote.Menu
{isContentPasteable} = require '../util'
templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disable... | { type: 'separator' } if canShowSaveImg
{
label: i18n.__('menu.edit.undo')
role: 'undo'
enabled: params.editFlags.canUndo
visible: true
}
{
label: i18n.__('menu.edit.redo')
role: 'redo'
enabled: params.editFlags.canRedo
visible: true
}
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 7800c1ff30d3e9eb1ab618a4bd8799810d94aeb9 | 3,762 | https://github.com/yakyak/yakyak/blob/7800c1ff30d3e9eb1ab618a4bd8799810d94aeb9/src/ui/views/contextmenu.coffee | 1 | 50 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:raw_corpus | raw_corpus | }
{
label: i18n.__('menu.edit.copy_link')
visible: canShowCopyLink
click: () ->
if process.platform == 'darwin'
clipboard.writeBookmark params.linkText, params.linkText
else
clipboard.writeText params.linkText
}
{
label:... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 7800c1ff30d3e9eb1ab618a4bd8799810d94aeb9 | 3,762 | https://github.com/yakyak/yakyak/blob/7800c1ff30d3e9eb1ab618a4bd8799810d94aeb9/src/ui/views/contextmenu.coffee | 51 | 78 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:completion | completion | }
{
label: i18n.__('menu.edit.copy_link')
visible: canShowCopyLink
click: () ->
if process.platform == 'darwin'
clipboard.writeBookmark params.linkText, params.linkText
else
clipboard.writeText params.linkText
}
{
label:... | if process.platform == 'darwin'
clipboard.writeBookmark params.srcURL, params.srcURL
else
clipboard.writeText params.srcURL
}
{
label: i18n.__('menu.edit.paste')
role: 'paste'
visible: (isContentPasteable() &&
viewstate.state == vie... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 7800c1ff30d3e9eb1ab618a4bd8799810d94aeb9 | 3,762 | https://github.com/yakyak/yakyak/blob/7800c1ff30d3e9eb1ab618a4bd8799810d94aeb9/src/ui/views/contextmenu.coffee | 51 | 78 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:raw_corpus | raw_corpus | remote = require('electron').remote
clipboard = require('electron').clipboard
# {download} = require('electron-dl') # See IMPORTANT below
ContextMenu = remote.Menu
{isContentPasteable} = require '../util'
templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disabl... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | a939e0e86bd8af04e2de99852c98e9682162b2a5 | 3,762 | https://github.com/yakyak/yakyak/blob/a939e0e86bd8af04e2de99852c98e9682162b2a5/src/ui/views/contextmenu.coffee | 1 | 50 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:completion | completion | remote = require('electron').remote
clipboard = require('electron').clipboard
# {download} = require('electron-dl') # See IMPORTANT below
ContextMenu = remote.Menu
{isContentPasteable} = require '../util'
templateContext = (params, viewstate) ->
#
# IMPORTANT: currently save images is disabl... | }
{ type: 'separator' } if canShowSaveImg
{
label: 'Undo'
role: 'undo'
enabled: params.editFlags.canUndo
visible: true
}
{
label: 'Redo'
role: 'redo'
enabled: params.editFlags.canRedo
visible: true
}
{ type: 'separator' }
{
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | a939e0e86bd8af04e2de99852c98e9682162b2a5 | 3,762 | https://github.com/yakyak/yakyak/blob/a939e0e86bd8af04e2de99852c98e9682162b2a5/src/ui/views/contextmenu.coffee | 1 | 50 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:raw_corpus | raw_corpus | visible: true
}
{
label: "Copy Link"
visible: canShowCopyLink
click: () ->
if process.platform == 'darwin'
clipboard.writeBookmark params.linkText, params.linkText
else
clipboard.writeText params.linkText
}
{
label: ... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | a939e0e86bd8af04e2de99852c98e9682162b2a5 | 3,762 | https://github.com/yakyak/yakyak/blob/a939e0e86bd8af04e2de99852c98e9682162b2a5/src/ui/views/contextmenu.coffee | 51 | 79 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:completion | completion | visible: true
}
{
label: "Copy Link"
visible: canShowCopyLink
click: () ->
if process.platform == 'darwin'
clipboard.writeBookmark params.linkText, params.linkText
else
clipboard.writeText params.linkText
}
{
label: ... | click: (item, win) ->
if process.platform == 'darwin'
clipboard.writeBookmark params.srcURL, params.srcURL
else
clipboard.writeText params.srcURL
}
{
label: 'Paste'
role: 'paste'
visible: (isContentPasteable() &&
viewsta... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | a939e0e86bd8af04e2de99852c98e9682162b2a5 | 3,762 | https://github.com/yakyak/yakyak/blob/a939e0e86bd8af04e2de99852c98e9682162b2a5/src/ui/views/contextmenu.coffee | 51 | 79 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:raw_corpus | raw_corpus | templateContext = (params, viewstate) ->
formats = clipboard.availableFormats()
pasteableContent = ['text/plain', 'image/png']
hasPasteableContent = 0
for content in formats
hasPasteableContent += pasteableContent.includes(content)
hasPasteableContent = hasPasteableContent > 0
#
# ... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 1028a3a655a522ef5b9edbb27ab6959a3df788f6 | 3,762 | https://github.com/yakyak/yakyak/blob/1028a3a655a522ef5b9edbb27ab6959a3df788f6/src/ui/views/contextmenu.coffee | 6 | 55 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:completion | completion | templateContext = (params, viewstate) ->
formats = clipboard.availableFormats()
pasteableContent = ['text/plain', 'image/png']
hasPasteableContent = 0
for content in formats
hasPasteableContent += pasteableContent.includes(content)
hasPasteableContent = hasPasteableContent > 0
#
# ... | {
label: 'Undo'
role: 'undo'
enabled: params.editFlags.canUndo
visible: true
}
{
label: 'Redo'
role: 'redo'
enabled: params.editFlags.canRedo
visible: true
}
{ type: 'separator' }
{
label: 'Cut'
role: 'cut'
enabl... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 1028a3a655a522ef5b9edbb27ab6959a3df788f6 | 3,762 | https://github.com/yakyak/yakyak/blob/1028a3a655a522ef5b9edbb27ab6959a3df788f6/src/ui/views/contextmenu.coffee | 6 | 55 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:raw_corpus | raw_corpus | {
label: "Copy Link"
visible: canShowCopyLink
click: () ->
if process.platform == 'darwin'
clipboard.writeBookmark params.linkText, params.linkText
else
clipboard.writeText params.linkText
}
{
label: 'Copy Image Link'
... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 1028a3a655a522ef5b9edbb27ab6959a3df788f6 | 3,762 | https://github.com/yakyak/yakyak/blob/1028a3a655a522ef5b9edbb27ab6959a3df788f6/src/ui/views/contextmenu.coffee | 56 | 87 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:completion | completion | {
label: "Copy Link"
visible: canShowCopyLink
click: () ->
if process.platform == 'darwin'
clipboard.writeBookmark params.linkText, params.linkText
else
clipboard.writeText params.linkText
}
{
label: 'Copy Image Link'
... | clipboard.writeText params.srcURL
}
{
label: 'Paste'
role: 'paste' if params.isEditable
visible: (hasPasteableContent || params.isEditable)
enabled: hasPasteableContent
# if there is a role, then click is ignored
click: () ->
if viewstate.state == view... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 1028a3a655a522ef5b9edbb27ab6959a3df788f6 | 3,762 | https://github.com/yakyak/yakyak/blob/1028a3a655a522ef5b9edbb27ab6959a3df788f6/src/ui/views/contextmenu.coffee | 56 | 87 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:raw_corpus | raw_corpus | templateContext = (params, viewstate) ->
formats = clipboard.availableFormats()
pasteableContent = ['text/plain', 'image/png']
hasPasteableContent = 0
for content in formats
hasPasteableContent += pasteableContent.includes(content)
hasPasteableContent = hasPasteableContent > 0
#
canS... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 6db1ff789fcd552eae5ae54038ed13419efc926b | 3,762 | https://github.com/yakyak/yakyak/blob/6db1ff789fcd552eae5ae54038ed13419efc926b/src/ui/views/contextmenu.coffee | 6 | 55 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:completion | completion | templateContext = (params, viewstate) ->
formats = clipboard.availableFormats()
pasteableContent = ['text/plain', 'image/png']
hasPasteableContent = 0
for content in formats
hasPasteableContent += pasteableContent.includes(content)
hasPasteableContent = hasPasteableContent > 0
#
canS... | enabled: params.editFlags.canUndo
visible: true
}
{
label: 'Redo'
role: 'redo'
enabled: params.editFlags.canRedo
visible: true
}
{ type: 'separator' }
{
label: 'Cut'
role: 'cut'
enabled: params.editFlags.canCut
visible: true
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 6db1ff789fcd552eae5ae54038ed13419efc926b | 3,762 | https://github.com/yakyak/yakyak/blob/6db1ff789fcd552eae5ae54038ed13419efc926b/src/ui/views/contextmenu.coffee | 6 | 55 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:raw_corpus | raw_corpus | click: () ->
if process.platform == 'darwin'
clipboard.writeBookmark params.linkText, params.linkText
else
clipboard.writeText params.linkText
}
{
label: 'Copy Image Link'
visible: canShowCopyImgLink
click: (item, win) ->
... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 6db1ff789fcd552eae5ae54038ed13419efc926b | 3,762 | https://github.com/yakyak/yakyak/blob/6db1ff789fcd552eae5ae54038ed13419efc926b/src/ui/views/contextmenu.coffee | 56 | 84 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:completion | completion | click: () ->
if process.platform == 'darwin'
clipboard.writeBookmark params.linkText, params.linkText
else
clipboard.writeText params.linkText
}
{
label: 'Copy Image Link'
visible: canShowCopyImgLink
click: (item, win) ->
... | }
{
label: 'Paste'
role: 'paste' if params.isEditable
visible: (hasPasteableContent || params.isEditable)
enabled: hasPasteableContent
# if there is a role, then click is ignored
click: () ->
if viewstate.state == viewstate.STATE_NORMAL
for... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 6db1ff789fcd552eae5ae54038ed13419efc926b | 3,762 | https://github.com/yakyak/yakyak/blob/6db1ff789fcd552eae5ae54038ed13419efc926b/src/ui/views/contextmenu.coffee | 56 | 84 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:raw_corpus | raw_corpus | templateContext = (params, viewstate) ->
formats = clipboard.availableFormats()
pasteableContent = ['text/plain', 'image/png']
hasPasteableContent = 0
for content in formats
hasPasteableContent += pasteableContent.includes(content)
hasPasteableContent = hasPasteableContent > 0
#
canS... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | d712a14b7955b7827ecd8eeca8619b629e941da8 | 3,762 | https://github.com/yakyak/yakyak/blob/d712a14b7955b7827ecd8eeca8619b629e941da8/src/ui/views/contextmenu.coffee | 7 | 56 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:completion | completion | templateContext = (params, viewstate) ->
formats = clipboard.availableFormats()
pasteableContent = ['text/plain', 'image/png']
hasPasteableContent = 0
for content in formats
hasPasteableContent += pasteableContent.includes(content)
hasPasteableContent = hasPasteableContent > 0
#
canS... | visible: true
}
{
label: 'Redo'
role: 'redo'
enabled: params.editFlags.canRedo
visible: true
}
{ type: 'separator' }
{
label: 'Cut'
role: 'cut'
enabled: params.editFlags.canCut
visible: true
}
{
label: 'Copy'
rol... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | d712a14b7955b7827ecd8eeca8619b629e941da8 | 3,762 | https://github.com/yakyak/yakyak/blob/d712a14b7955b7827ecd8eeca8619b629e941da8/src/ui/views/contextmenu.coffee | 7 | 56 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:raw_corpus | raw_corpus | if process.platform == 'darwin'
clipboard.writeBookmark params.linkText, params.linkText
else
clipboard.writeText params.linkText
}
{
label: 'Copy Image Link'
visible: canShowCopyImgLink
click: (item, win) ->
if process.platform == ... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | d712a14b7955b7827ecd8eeca8619b629e941da8 | 3,762 | https://github.com/yakyak/yakyak/blob/d712a14b7955b7827ecd8eeca8619b629e941da8/src/ui/views/contextmenu.coffee | 57 | 84 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:completion | completion | if process.platform == 'darwin'
clipboard.writeBookmark params.linkText, params.linkText
else
clipboard.writeText params.linkText
}
{
label: 'Copy Image Link'
visible: canShowCopyImgLink
click: (item, win) ->
if process.platform == ... | {
label: 'Paste'
role: 'paste' if params.isEditable
visible: (hasPasteableContent || params.isEditable)
enabled: hasPasteableContent
# if there is a role, then click is ignored
click: () ->
if viewstate.state == viewstate.STATE_NORMAL
formats =... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | d712a14b7955b7827ecd8eeca8619b629e941da8 | 3,762 | https://github.com/yakyak/yakyak/blob/d712a14b7955b7827ecd8eeca8619b629e941da8/src/ui/views/contextmenu.coffee | 57 | 84 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:raw_corpus | raw_corpus | templateContext = (params, viewstate) ->
formats = clipboard.availableFormats()
pasteableContent = ['text/plain', 'image/png']
hasPasteableContent = 0
for content in formats
hasPasteableContent += pasteableContent.includes(content)
hasPasteableContent = hasPasteableContent > 0
#
canS... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/views/contextmenu.coffee | 7 | 56 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:completion | completion | templateContext = (params, viewstate) ->
formats = clipboard.availableFormats()
pasteableContent = ['text/plain', 'image/png']
hasPasteableContent = 0
for content in formats
hasPasteableContent += pasteableContent.includes(content)
hasPasteableContent = hasPasteableContent > 0
#
canS... | clipboard.writeText params.srcURL
}
{
label: "Copy Link"
visible: canShowCopyLink
click: () ->
if process.platform == 'darwin'
clipboard.writeBookmark params.linkText, params.linkText
else
clipboard.writeText params.linkText
}
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/views/contextmenu.coffee | 7 | 56 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:raw_corpus | raw_corpus | }
{ type: 'separator' }
{
label: 'Cut'
role: 'cut'
enabled: params.editFlags.canCut
visible: true
}
{
label: 'Copy'
role: 'copy'
enabled: params.editFlags.canCopy
visible: true
}
{
label: 'Paste'
role: 'paste' if par... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/views/contextmenu.coffee | 57 | 84 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:completion | completion | }
{ type: 'separator' }
{
label: 'Cut'
role: 'cut'
enabled: params.editFlags.canCut
visible: true
}
{
label: 'Copy'
role: 'copy'
enabled: params.editFlags.canCopy
visible: true
} | {
label: 'Paste'
role: 'paste' if params.isEditable
visible: (hasPasteableContent || params.isEditable)
enabled: hasPasteableContent
# if there is a role, then click is ignored
click: () ->
if viewstate.state == viewstate.STATE_NORMAL
formats =... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 67394aea6082574e1e63328982dc60f77af94841 | 3,762 | https://github.com/yakyak/yakyak/blob/67394aea6082574e1e63328982dc60f77af94841/src/ui/views/contextmenu.coffee | 57 | 84 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:raw_corpus | raw_corpus | remote = require('electron').remote
contextMenu = require('electron-context-menu')
clipboard = require('electron').clipboard
trifl = require 'trifl'
trifl.expose window
module.exports = (viewstate) ->
contextMenu {
window: remote.getCurrentWindow()
showInspectElement: false
pr... | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/views/contextmenu.coffee | 1 | 50 | ||
yakyak/yakyak:src/ui/views/contextmenu.coffee:1:completion | completion | remote = require('electron').remote
contextMenu = require('electron-context-menu')
clipboard = require('electron').clipboard
trifl = require 'trifl'
trifl.expose window
module.exports = (viewstate) ->
contextMenu {
window: remote.getCurrentWindow()
showInspectElement: false
pr... | visible: showNonEnabled
}
{
label: 'Copy'
enabled: false
# only show it when right-clicking images
visible: showNonEnabled
}
]
append: (params, browserWindow) ->
formats = clipboard.availa... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/views/contextmenu.coffee | 1 | 50 |
yakyak/yakyak:src/ui/views/contextmenu.coffee:2:raw_corpus | raw_corpus | else if formats.includes 'image/png'
action 'onpasteimage'
}]
} | CoffeeScript | yakyak/yakyak | src/ui/views/contextmenu.coffee | MIT | 48f8e595deb5416d1eeb3f664fea31ee293d4998 | 3,762 | https://github.com/yakyak/yakyak/blob/48f8e595deb5416d1eeb3f664fea31ee293d4998/src/ui/views/contextmenu.coffee | 51 | 54 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee | 1 | 50 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee:1:completion | completion | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | $scope.$watch 'model', (model) ->
$scope.hashItems = [] unless model?
$scope.addHashValue = ->
$scope.model = {} unless $scope.model?
$scope.hashItems.push { key: '', value: '', _key: ''}
$scope.updateHashKey = (hashItem) ->
# Set... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee:2:raw_corpus | raw_corpus | # Initialize
if $scope.model?
$scope.hashItems = _.map $scope.model, (value, key) ->
{ key: key, value: value, _key: key}
$scope.hashItems = _.filter $scope.hashItems, (hashItem) ->
hashItem._key != '$$hashKey'
else
... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee | 51 | 65 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee:2:completion | completion | # Initialize
if $scope.model?
$scope.hashItems = _.map $scope.model, (value, key) ->
{ key: key, value: value, _key: key}
$scope.hashItems = _.filter $scope.hashItems, (hashItem) ->
hashItem._key != '$$hashKey'
else | $scope.hashItems = []
link: (scope, element, attrs) ->
scope.label ?= 'Item'
return
} | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.hash.coffee | 51 | 65 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.