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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:raw_corpus | raw_corpus | continue if not set
for item in itemSet.items
continue if item.type is "separator"
label = set[item.command]
item.label = label if label?
updateSettings: (onSettingsOpen = false) ->
setTimeout(@delaySettings, 0, onSettingsOpen)
delaySettings: (onSettingsOpen) ->
settings = re... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | c563686aed81e64c7fadc6ba8209889d7ebda000 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/c563686aed81e64c7fadc6ba8209889d7ebda000/lib/main.coffee | 51 | 79 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2107c5e90807ddbcd16834845cca02b402fcd685 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2107c5e90807ddbcd16834845cca02b402fcd685/lib/main.coffee | 1 | 50 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
... | var ChineseSetting;
ChineseSetting = class ChineseSetting {
constructor() {
var CSON;
this.delay = this.delay.bind(this);
CSON = require('cson');
//菜单
this.M = CSON.load(__dirname + '/../def/menu_' + process.platform + '.cson');
//右键菜单
this.C = CSON.load(__dirname + '/../def/context.cson'... | CoffeeScript | JavaScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2107c5e90807ddbcd16834845cca02b402fcd685 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2107c5e90807ddbcd16834845cca02b402fcd685/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ChineseSetting;
ChineseSetting = class ChineseSetting {
constructor() {
var CSON;
this.delay = this.delay.bind(this);
CSON = require('cson');
//菜单
this.M = CSON.load(__dirname + '/../def/menu_' + process.platform + '.cson');
//右键菜单
... | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | JavaScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2107c5e90807ddbcd16834845cca02b402fcd685 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2107c5e90807ddbcd16834845cca02b402fcd685/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | if config.useSetting
# Settings (on init and open)
@updateSettings()
#重载后切换过来时
atom.workspace.onDidChangeActivePaneItem (item) =>
if item isnt undefined
if item.uri isnt undefined
if item.uri.indexOf('atom://config') isnt -1
@updateSettings(true)
up... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2107c5e90807ddbcd16834845cca02b402fcd685 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2107c5e90807ddbcd16834845cca02b402fcd685/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:raw_corpus | raw_corpus | for itemSet in atom.contextMenu.itemSets
set = @C.Context[itemSet.selector]
continue if not set
for item in itemSet.items
continue if item.type is "separator"
label = set[item.command]
item.label = label if label?
updateSettings: (onSettingsOpen = false) ->
setTimeout(@d... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2107c5e90807ddbcd16834845cca02b402fcd685 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2107c5e90807ddbcd16834845cca02b402fcd685/lib/main.coffee | 51 | 81 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
for itemSet in atom.contextMenu.itemSets
set = @C.Context[itemSet.selector]
continue if not set
for item in itemSet.items
continue if item.type is "separator"
label = set[item.command]
item.label = label if label?
upda... | var i, item, itemSet, j, label, len, len1, ref, ref1, set;
ref = atom.contextMenu.itemSets;
for (i = 0, len = ref.length; i < len; i++) {
itemSet = ref[i];
set = this.C.Context[itemSet.selector];
if (!set) {
continue;
}
ref1 = itemSet.items;
for (j = 0, len1 = ref1.length; j < len1; j++) {
item = r... | CoffeeScript | JavaScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2107c5e90807ddbcd16834845cca02b402fcd685 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2107c5e90807ddbcd16834845cca02b402fcd685/lib/main.coffee | 51 | 81 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var i, item, itemSet, j, label, len, len1, ref, ref1, set;
ref = atom.contextMenu.itemSets;
for (i = 0, len = ref.length; i < len; i++) {
itemSet = ref[i];
set = this.C.Context[itemSet.selector];
if (!set) {
continue;
}
ref1 = itemSet.items;
for (j... | for itemSet in atom.contextMenu.itemSets
set = @C.Context[itemSet.selector]
continue if not set
for item in itemSet.items
continue if item.type is "separator"
label = set[item.command]
item.label = label if label?
updateSettings: (onSettingsOpen = false) ->
setTimeout(@d... | JavaScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2107c5e90807ddbcd16834845cca02b402fcd685 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2107c5e90807ddbcd16834845cca02b402fcd685/lib/main.coffee | 51 | 81 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 98f4f307b043c6ebdab6594482a9a2b9741fd46e | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/98f4f307b043c6ebdab6594482a9a2b9741fd46e/lib/main.coffee | 1 | 50 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | if config.useSetting
# Settings (on init and open)
@updateSettings()
#重载后切换过来时
atom.workspace.onDidChangeActivePaneItem (item) =>
if item.uri isnt undefined
if item.uri.indexOf('atom://config') isnt -1
@updateSettings(true)
updateMenu : (menuList, def) ->
ret... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 98f4f307b043c6ebdab6594482a9a2b9741fd46e | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/98f4f307b043c6ebdab6594482a9a2b9741fd46e/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:raw_corpus | raw_corpus | set = @C.Context[itemSet.selector]
continue if not set
for item in itemSet.items
continue if item.type is "separator"
label = set[item.command]
item.label = label if label?
updateSettings: (onSettingsOpen = false) ->
setTimeout(@delaySettings, 0, onSettingsOpen)
delaySettin... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 98f4f307b043c6ebdab6594482a9a2b9741fd46e | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/98f4f307b043c6ebdab6594482a9a2b9741fd46e/lib/main.coffee | 51 | 80 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | ae24365bf073c6531bba4ffe17cded9286be5a70 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/ae24365bf073c6531bba4ffe17cded9286be5a70/lib/main.coffee | 1 | 50 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
... | var ChineseSetting;
ChineseSetting = class ChineseSetting {
constructor() {
var CSON;
this.delay = this.delay.bind(this);
CSON = require('cson');
//菜单
this.M = CSON.load(__dirname + '/../def/menu_' + process.platform + '.cson');
//右键菜单
this.C = CSON.load(__dirname + '/../def/context.cson'... | CoffeeScript | JavaScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | ae24365bf073c6531bba4ffe17cded9286be5a70 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/ae24365bf073c6531bba4ffe17cded9286be5a70/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ChineseSetting;
ChineseSetting = class ChineseSetting {
constructor() {
var CSON;
this.delay = this.delay.bind(this);
CSON = require('cson');
//菜单
this.M = CSON.load(__dirname + '/../def/menu_' + process.platform + '.cson');
//右键菜单
... | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | JavaScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | ae24365bf073c6531bba4ffe17cded9286be5a70 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/ae24365bf073c6531bba4ffe17cded9286be5a70/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | if config.useSetting
# Settings (on init and open)
@updateSettings()
#重载后切换过来时
atom.workspace.onDidChangeActivePaneItem (item) =>
if item isnt undefined and item.uri.indexOf('atom://config') isnt -1
@updateSettings(true)
updateMenu : (menuList, def) ->
return if not def
... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | ae24365bf073c6531bba4ffe17cded9286be5a70 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/ae24365bf073c6531bba4ffe17cded9286be5a70/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 61f692f755b4ffee96b350dc5402f621c086af0c | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/61f692f755b4ffee96b350dc5402f621c086af0c/lib/main.coffee | 1 | 50 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
... | var ChineseSetting;
ChineseSetting = class ChineseSetting {
constructor() {
var CSON;
this.delay = this.delay.bind(this);
CSON = require('cson');
//菜单
this.M = CSON.load(__dirname + '/../def/menu_' + process.platform + '.cson');
//右键菜单
this.C = CSON.load(__dirname + '/../def/context.cson'... | CoffeeScript | JavaScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 61f692f755b4ffee96b350dc5402f621c086af0c | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/61f692f755b4ffee96b350dc5402f621c086af0c/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ChineseSetting;
ChineseSetting = class ChineseSetting {
constructor() {
var CSON;
this.delay = this.delay.bind(this);
CSON = require('cson');
//菜单
this.M = CSON.load(__dirname + '/../def/menu_' + process.platform + '.cson');
//右键菜单
... | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | JavaScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 61f692f755b4ffee96b350dc5402f621c086af0c | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/61f692f755b4ffee96b350dc5402f621c086af0c/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | if config.useSetting
# Settings (on init and open)
@updateSettings()
#重载后切换过来时
atom.workspace.onDidChangeActivePaneItem (item) =>
if item isnt undefined and item.uri.indexOf isnt 'atom://config'
@updateSettings(true)
updateMenu : (menuList, def) ->
return if not def
... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 61f692f755b4ffee96b350dc5402f621c086af0c | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/61f692f755b4ffee96b350dc5402f621c086af0c/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 54e82c2d46b973895ee93bd568c9f5872dc400f1 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/54e82c2d46b973895ee93bd568c9f5872dc400f1/lib/main.coffee | 1 | 50 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
... | var ChineseSetting;
ChineseSetting = class ChineseSetting {
constructor() {
var CSON;
this.delay = this.delay.bind(this);
CSON = require('cson');
//菜单
this.M = CSON.load(__dirname + '/../def/menu_' + process.platform + '.cson');
//右键菜单
this.C = CSON.load(__dirname + '/../def/context.cson'... | CoffeeScript | JavaScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 54e82c2d46b973895ee93bd568c9f5872dc400f1 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/54e82c2d46b973895ee93bd568c9f5872dc400f1/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ChineseSetting;
ChineseSetting = class ChineseSetting {
constructor() {
var CSON;
this.delay = this.delay.bind(this);
CSON = require('cson');
//菜单
this.M = CSON.load(__dirname + '/../def/menu_' + process.platform + '.cson');
//右键菜单
... | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | JavaScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 54e82c2d46b973895ee93bd568c9f5872dc400f1 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/54e82c2d46b973895ee93bd568c9f5872dc400f1/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | if config.useSetting
# Settings (on init and open)
@updateSettings()
#重载后切换过来时
atom.workspace.onDidChangeActivePaneItem (item) =>
if item isnt undefined and item.uri is 'atom://config'
@updateSettings(true)
updateMenu : (menuList, def) ->
return if not def
for menu i... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 54e82c2d46b973895ee93bd568c9f5872dc400f1 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/54e82c2d46b973895ee93bd568c9f5872dc400f1/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 544d0cb13ef52529b86f07b304c337a67f4b4a41 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/544d0cb13ef52529b86f07b304c337a67f4b4a41/lib/main.coffee | 1 | 50 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
config = atom.config.get 'simplified-chi... | if config.useSetting
#console.log @S
# Settings (on init and open)
@updateSettings()
#重载后切换过来时
atom.workspace.onDidChangeActivePaneItem (item) =>
if item isnt undefined and item.uri is 'atom://config'
@updateSettings(true)
updateMenu : (menuList, def) ->
return if ... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 544d0cb13ef52529b86f07b304c337a67f4b4a41 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/544d0cb13ef52529b86f07b304c337a67f4b4a41/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
# Menu
@updateMenu(atom.menu.templat... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 62374735a1a684cf387a6b61b3463a3a914df902 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/62374735a1a684cf387a6b61b3463a3a914df902/lib/main.coffee | 1 | 50 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
... | var ChineseSetting;
ChineseSetting = class ChineseSetting {
constructor() {
var CSON;
this.delay = this.delay.bind(this);
CSON = require('cson');
//菜单
this.M = CSON.load(__dirname + '/../def/menu_' + process.platform + '.cson');
//右键菜单
this.C = CSON.load(__dirname + '/../def/context.cson'... | CoffeeScript | JavaScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 62374735a1a684cf387a6b61b3463a3a914df902 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/62374735a1a684cf387a6b61b3463a3a914df902/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ChineseSetting;
ChineseSetting = class ChineseSetting {
constructor() {
var CSON;
this.delay = this.delay.bind(this);
CSON = require('cson');
//菜单
this.M = CSON.load(__dirname + '/../def/menu_' + process.platform + '.cson');
//右键菜单
... | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
# Menu
@updateMenu(atom.menu.templat... | JavaScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 62374735a1a684cf387a6b61b3463a3a914df902 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/62374735a1a684cf387a6b61b3463a3a914df902/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
# Menu
@updateMenu(atom.menu.templat... | atom.workspace.onDidChangeActivePaneItem (item) =>
if item isnt undefined and item.uri is 'atom://config'
@updateSettings(true)
updateMenu : (menuList, def) ->
return if not def
for menu in menuList
continue if not menu.label
key = menu.label
if key.indexOf '…' isnt -1
... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 62374735a1a684cf387a6b61b3463a3a914df902 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/62374735a1a684cf387a6b61b3463a3a914df902/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:raw_corpus | raw_corpus | item.label = label if label?
updateSettings: (onSettingsOpen = false) ->
setTimeout(@delaySettings, 0, onSettingsOpen)
delaySettings: (onSettingsOpen) ->
settings = require './../tools/settings'
settings.init()
module.exports = new ChineseSetting() | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 62374735a1a684cf387a6b61b3463a3a914df902 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/62374735a1a684cf387a6b61b3463a3a914df902/lib/main.coffee | 51 | 60 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
item.label = label if label?
updateSettings: (onSettingsOpen = false) ->
setTimeout(@delaySettings, 0, onSettingsOpen)
delaySettings: (onSettingsOpen) ->
settings = require './../tools/settings'
settings.init()
module.exports = new ChineseSetti... | item.label = label(typeof label !== "undefined" && label !== null ? {
updateSettings: function(onSettingsOpen = false) {
return setTimeout(this.delaySettings, 0, onSettingsOpen);
},
delaySettings: function(onSettingsOpen) {
var settings;
settings = require('./../tools/settings');
return settings.i... | CoffeeScript | JavaScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 62374735a1a684cf387a6b61b3463a3a914df902 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/62374735a1a684cf387a6b61b3463a3a914df902/lib/main.coffee | 51 | 60 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
item.label = label(typeof label !== "undefined" && label !== null ? {
updateSettings: function(onSettingsOpen = false) {
return setTimeout(this.delaySettings, 0, onSettingsOpen);
},
delaySettings: function(onSettingsOpen) {
var settings;
settings ... | item.label = label if label?
updateSettings: (onSettingsOpen = false) ->
setTimeout(@delaySettings, 0, onSettingsOpen)
delaySettings: (onSettingsOpen) ->
settings = require './../tools/settings'
settings.init()
module.exports = new ChineseSetting() | JavaScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 62374735a1a684cf387a6b61b3463a3a914df902 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/62374735a1a684cf387a6b61b3463a3a914df902/lib/main.coffee | 51 | 60 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:completion | completion | item.label = label if label?
updateSettings: (onSettingsOpen = false) ->
setTimeout(@delaySettings, 0, onSettingsOpen) | delaySettings: (onSettingsOpen) ->
settings = require './../tools/settings'
settings.init()
module.exports = new ChineseSetting() | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 62374735a1a684cf387a6b61b3463a3a914df902 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/62374735a1a684cf387a6b61b3463a3a914df902/lib/main.coffee | 51 | 60 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
# Menu
@updateMenu(atom.menu.templat... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 77aed9512773d6352c67a1ce8c20bbb7cc9f3ba8 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/77aed9512773d6352c67a1ce8c20bbb7cc9f3ba8/lib/main.coffee | 1 | 50 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
... | var ChineseSetting;
ChineseSetting = class ChineseSetting {
constructor() {
var CSON;
this.delay = this.delay.bind(this);
CSON = require('cson');
//菜单
this.M = CSON.load(__dirname + '/../def/menu_' + process.platform + '.cson');
//右键菜单
this.C = CSON.load(__dirname + '/../def/context.cson'... | CoffeeScript | JavaScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 77aed9512773d6352c67a1ce8c20bbb7cc9f3ba8 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/77aed9512773d6352c67a1ce8c20bbb7cc9f3ba8/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ChineseSetting;
ChineseSetting = class ChineseSetting {
constructor() {
var CSON;
this.delay = this.delay.bind(this);
CSON = require('cson');
//菜单
this.M = CSON.load(__dirname + '/../def/menu_' + process.platform + '.cson');
//右键菜单
... | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
# Menu
@updateMenu(atom.menu.templat... | JavaScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 77aed9512773d6352c67a1ce8c20bbb7cc9f3ba8 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/77aed9512773d6352c67a1ce8c20bbb7cc9f3ba8/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
# Menu
@updateMenu(atom.menu.templat... | atom.workspace.onDidChangeActivePaneItem (item) =>
if item.uri is 'atom://config'
@updateSettings(true)
updateMenu : (menuList, def) ->
return if not def
for menu in menuList
continue if not menu.label
key = menu.label
if key.indexOf '…' isnt -1
key = key.replace('…','... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 77aed9512773d6352c67a1ce8c20bbb7cc9f3ba8 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/77aed9512773d6352c67a1ce8c20bbb7cc9f3ba8/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
# Menu
@updateMenu(atom.menu.templat... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 431064ecc79f6bd0b0bcfb4cac3013f3b0fc4f30 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/431064ecc79f6bd0b0bcfb4cac3013f3b0fc4f30/lib/main.coffee | 1 | 50 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | class ChineseSetting
constructor: ->
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
setTimeout(@delay,0)
delay: () =>
# Menu
@updateMenu(atom.menu.templat... | atom.commands.add 'atom-workspace', 'settings-view:open', =>
@updateSettings(true)
atom.workspace.onDidOpen =>
@updateSettings(true)
updateMenu : (menuList, def) ->
return if not def
for menu in menuList
continue if not menu.label
key = menu.label
if key.indexOf '…' isnt -... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 431064ecc79f6bd0b0bcfb4cac3013f3b0fc4f30 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/431064ecc79f6bd0b0bcfb4cac3013f3b0fc4f30/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:raw_corpus | raw_corpus | continue if item.type is "separator"
label = set[item.command]
item.label = label if label?
updateSettings: (onSettingsOpen = false) ->
setTimeout(@delaySettings, 0, onSettingsOpen)
delaySettings: (onSettingsOpen) ->
settings = require './../tools/settings'
settings.init()
module.expo... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 431064ecc79f6bd0b0bcfb4cac3013f3b0fc4f30 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/431064ecc79f6bd0b0bcfb4cac3013f3b0fc4f30/lib/main.coffee | 51 | 62 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:completion | completion | continue if item.type is "separator"
label = set[item.command]
item.label = label if label?
updateSettings: (onSettingsOpen = false) ->
setTimeout(@delaySettings, 0, onSettingsOpen) | delaySettings: (onSettingsOpen) ->
settings = require './../tools/settings'
settings.init()
module.exports = new ChineseSetting() | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 431064ecc79f6bd0b0bcfb4cac3013f3b0fc4f30 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/431064ecc79f6bd0b0bcfb4cac3013f3b0fc4f30/lib/main.coffee | 51 | 62 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | class ChineseSetting
constructor: ->
console.log '执行 constructor'
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
console.log '执行 activate'
setTimeout(@delay,... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2f40468b616ec529efa999e725f8c6f3dc8245f7 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2f40468b616ec529efa999e725f8c6f3dc8245f7/lib/main.coffee | 1 | 50 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class ChineseSetting
constructor: ->
console.log '执行 constructor'
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state... | var ChineseSetting;
ChineseSetting = class ChineseSetting {
constructor() {
var CSON;
this.delay = this.delay.bind(this);
console.log('执行 constructor');
CSON = require('cson');
//菜单
this.M = CSON.load(__dirname + '/../def/menu_' + process.platform + '.cson');
//右键菜单
this.C = CSON.load... | CoffeeScript | JavaScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2f40468b616ec529efa999e725f8c6f3dc8245f7 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2f40468b616ec529efa999e725f8c6f3dc8245f7/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ChineseSetting;
ChineseSetting = class ChineseSetting {
constructor() {
var CSON;
this.delay = this.delay.bind(this);
console.log('执行 constructor');
CSON = require('cson');
//菜单
this.M = CSON.load(__dirname + '/../def/menu_' + process... | class ChineseSetting
constructor: ->
console.log '执行 constructor'
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
console.log '执行 activate'
setTimeout(@delay,... | JavaScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2f40468b616ec529efa999e725f8c6f3dc8245f7 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2f40468b616ec529efa999e725f8c6f3dc8245f7/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | class ChineseSetting
constructor: ->
console.log '执行 constructor'
CSON = require 'cson'
#菜单
@M = CSON.load __dirname + '/../def/menu_'+process.platform+'.cson'
#右键菜单
@C = CSON.load __dirname + '/../def/context.cson'
activate: (state) ->
console.log '执行 activate'
setTimeout(@delay,... | # Settings (on init and open)
@updateSettings()
#快捷键打开 setting 时
atom.commands.add 'atom-workspace', 'settings-view:open', =>
@updateSettings(true)
atom.workspace.onDidOpen =>
@updateSettings(true)
updateMenu : (menuList, def) ->
console.log '执行 updateMenu'
return if not def
... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2f40468b616ec529efa999e725f8c6f3dc8245f7 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2f40468b616ec529efa999e725f8c6f3dc8245f7/lib/main.coffee | 1 | 50 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:raw_corpus | raw_corpus | for itemSet in atom.contextMenu.itemSets
set = @C.Context[itemSet.selector]
continue if not set
for item in itemSet.items
continue if item.type is "separator"
label = set[item.command]
item.label = label if label?
updateSettings: (onSettingsOpen = false) ->
console.log '... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2f40468b616ec529efa999e725f8c6f3dc8245f7 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2f40468b616ec529efa999e725f8c6f3dc8245f7/lib/main.coffee | 51 | 68 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
for itemSet in atom.contextMenu.itemSets
set = @C.Context[itemSet.selector]
continue if not set
for item in itemSet.items
continue if item.type is "separator"
label = set[item.command]
item.label = label if label?
upda... | var i, item, itemSet, j, label, len, len1, ref, ref1, set;
ref = atom.contextMenu.itemSets;
for (i = 0, len = ref.length; i < len; i++) {
itemSet = ref[i];
set = this.C.Context[itemSet.selector];
if (!set) {
continue;
}
ref1 = itemSet.items;
for (j = 0, len1 = ref1.length; j < len1; j++) {
item = r... | CoffeeScript | JavaScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2f40468b616ec529efa999e725f8c6f3dc8245f7 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2f40468b616ec529efa999e725f8c6f3dc8245f7/lib/main.coffee | 51 | 68 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var i, item, itemSet, j, label, len, len1, ref, ref1, set;
ref = atom.contextMenu.itemSets;
for (i = 0, len = ref.length; i < len; i++) {
itemSet = ref[i];
set = this.C.Context[itemSet.selector];
if (!set) {
continue;
}
ref1 = itemSet.items;
for (j... | for itemSet in atom.contextMenu.itemSets
set = @C.Context[itemSet.selector]
continue if not set
for item in itemSet.items
continue if item.type is "separator"
label = set[item.command]
item.label = label if label?
updateSettings: (onSettingsOpen = false) ->
console.log '... | JavaScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2f40468b616ec529efa999e725f8c6f3dc8245f7 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2f40468b616ec529efa999e725f8c6f3dc8245f7/lib/main.coffee | 51 | 68 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:2:completion | completion | for itemSet in atom.contextMenu.itemSets
set = @C.Context[itemSet.selector]
continue if not set
for item in itemSet.items
continue if item.type is "separator"
label = set[item.command]
item.label = label if label?
updateSettings: (onSettingsOpen = false) -> | console.log '执行updateSettings:'+onSettingsOpen
setTimeout(@delaySettings, 0, onSettingsOpen)
delaySettings: (onSettingsOpen) ->
console.log '执行delaySettings'
settings = require './../tools/settings'
settings.init()
module.exports = new ChineseSetting() | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2f40468b616ec529efa999e725f8c6f3dc8245f7 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2f40468b616ec529efa999e725f8c6f3dc8245f7/lib/main.coffee | 51 | 68 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | module.exports =
activate : (state) ->
setTimeout(@delay, 0, this)
delay : (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
that.updateMenu(atom.menu.template, defM.Menu)
ato... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | b277784e6e7c1252466e1b439c752c6b2162be8e | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/b277784e6e7c1252466e1b439c752c6b2162be8e/lib/main.coffee | 1 | 38 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
activate : (state) ->
setTimeout(@delay, 0, this)
delay : (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
... | module.exports = {
activate: function(state) {
return setTimeout(this.delay, 0, this);
},
delay: function(that) {
var CSON, defC, defM;
CSON = require('cson');
defM = CSON.load(__dirname + `/../def/menu_${process.platform}.cson`);
defC = CSON.load(__dirname + "/../def/context.cson");
// Me... | CoffeeScript | JavaScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | b277784e6e7c1252466e1b439c752c6b2162be8e | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/b277784e6e7c1252466e1b439c752c6b2162be8e/lib/main.coffee | 1 | 38 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
activate: function(state) {
return setTimeout(this.delay, 0, this);
},
delay: function(that) {
var CSON, defC, defM;
CSON = require('cson');
defM = CSON.load(__dirname + `/../def/menu_${process.platform}.cson`);
defC = C... | module.exports =
activate : (state) ->
setTimeout(@delay, 0, this)
delay : (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
that.updateMenu(atom.menu.template, defM.Menu)
ato... | JavaScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | b277784e6e7c1252466e1b439c752c6b2162be8e | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/b277784e6e7c1252466e1b439c752c6b2162be8e/lib/main.coffee | 1 | 38 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | module.exports =
activate : (state) ->
setTimeout(@delay, 0, this)
delay : (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
that.updateMenu(atom.menu.template, defM.Menu)
ato... | for menu in menuList
continue if not menu.label
key = menu.label
if key.indexOf '…' isnt -1
key = key.replace('…','...')
set = def[key]
continue if not set
menu.label = set.value if set?
if menu.submenu?
@updateMenu(menu.submenu, set.submenu)
updateContextMen... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | b277784e6e7c1252466e1b439c752c6b2162be8e | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/b277784e6e7c1252466e1b439c752c6b2162be8e/lib/main.coffee | 1 | 38 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | module.exports =
activate : (state) ->
setTimeout(@delay, 0, this)
delay : (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
that.updateMenu(atom.menu.template, defM.Menu)
ato... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 276b51728d671935369e32d2d3acb597fb9d5bec | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/276b51728d671935369e32d2d3acb597fb9d5bec/lib/main.coffee | 1 | 38 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | module.exports =
activate : (state) ->
setTimeout(@delay, 0, this)
delay : (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
that.updateMenu(atom.menu.template, defM.Menu)
ato... | for menu in menuList
continue if not menu.label
key = menu.label
if key.indexOf '…' not -1
key = key.replace('…','...')
set = def[key]
continue if not set
menu.label = set.value if set?
if menu.submenu?
@updateMenu(menu.submenu, set.submenu)
updateContextMenu... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 276b51728d671935369e32d2d3acb597fb9d5bec | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/276b51728d671935369e32d2d3acb597fb9d5bec/lib/main.coffee | 1 | 38 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | module.exports =
activate : (state) ->
setTimeout(@delay, 0, this)
delay : (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
that.updateMenu(atom.menu.template, defM.Menu)
ato... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2d87f42df0d8a0a8d06f93f599db9c0a18b311ad | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2d87f42df0d8a0a8d06f93f599db9c0a18b311ad/lib/main.coffee | 1 | 38 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
activate : (state) ->
setTimeout(@delay, 0, this)
delay : (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
... | module.exports = {
activate: function(state) {
return setTimeout(this.delay, 0, this);
},
delay: function(that) {
var CSON, defC, defM;
CSON = require('cson');
defM = CSON.load(__dirname + `/../def/menu_${process.platform}.cson`);
defC = CSON.load(__dirname + "/../def/context.cson");
// Me... | CoffeeScript | JavaScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2d87f42df0d8a0a8d06f93f599db9c0a18b311ad | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2d87f42df0d8a0a8d06f93f599db9c0a18b311ad/lib/main.coffee | 1 | 38 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
activate: function(state) {
return setTimeout(this.delay, 0, this);
},
delay: function(that) {
var CSON, defC, defM;
CSON = require('cson');
defM = CSON.load(__dirname + `/../def/menu_${process.platform}.cson`);
defC = C... | module.exports =
activate : (state) ->
setTimeout(@delay, 0, this)
delay : (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
that.updateMenu(atom.menu.template, defM.Menu)
ato... | JavaScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2d87f42df0d8a0a8d06f93f599db9c0a18b311ad | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2d87f42df0d8a0a8d06f93f599db9c0a18b311ad/lib/main.coffee | 1 | 38 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | module.exports =
activate : (state) ->
setTimeout(@delay, 0, this)
delay : (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
that.updateMenu(atom.menu.template, defM.Menu)
ato... | for menu in menuList
continue if not menu.label
key = menu.label
if key.indexOf '…' != -1
key = key.replace('…','...')
set = def[key]
continue if not set
menu.label = set.value if set?
if menu.submenu?
@updateMenu(menu.submenu, set.submenu)
updateContextMenu ... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | 2d87f42df0d8a0a8d06f93f599db9c0a18b311ad | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/2d87f42df0d8a0a8d06f93f599db9c0a18b311ad/lib/main.coffee | 1 | 38 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | module.exports =
activate : (state) ->
setTimeout(@delay, 0, this)
delay : (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
that.updateMenu(atom.menu.template, defM.Menu)
ato... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | f63f138f1c69067c221bb9d498828433eabce0e5 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/f63f138f1c69067c221bb9d498828433eabce0e5/lib/main.coffee | 1 | 36 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
activate : (state) ->
setTimeout(@delay, 0, this)
delay : (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
... | module.exports = {
activate: function(state) {
return setTimeout(this.delay, 0, this);
},
delay: function(that) {
var CSON, defC, defM;
CSON = require('cson');
defM = CSON.load(__dirname + `/../def/menu_${process.platform}.cson`);
defC = CSON.load(__dirname + "/../def/context.cson");
// Me... | CoffeeScript | JavaScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | f63f138f1c69067c221bb9d498828433eabce0e5 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/f63f138f1c69067c221bb9d498828433eabce0e5/lib/main.coffee | 1 | 36 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
activate: function(state) {
return setTimeout(this.delay, 0, this);
},
delay: function(that) {
var CSON, defC, defM;
CSON = require('cson');
defM = CSON.load(__dirname + `/../def/menu_${process.platform}.cson`);
defC = C... | module.exports =
activate : (state) ->
setTimeout(@delay, 0, this)
delay : (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
that.updateMenu(atom.menu.template, defM.Menu)
ato... | JavaScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | f63f138f1c69067c221bb9d498828433eabce0e5 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/f63f138f1c69067c221bb9d498828433eabce0e5/lib/main.coffee | 1 | 36 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | module.exports =
activate : (state) ->
setTimeout(@delay, 0, this)
delay : (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
that.updateMenu(atom.menu.template, defM.Menu)
ato... | return if not def
for menu in menuList
continue if not menu.label
key = menu.label
set = def[key]
continue if not set
menu.label = set.value if set?
if menu.submenu?
@updateMenu(menu.submenu, set.submenu)
updateContextMenu : (def) ->
for itemSet in atom.contextMenu... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | f63f138f1c69067c221bb9d498828433eabce0e5 | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/f63f138f1c69067c221bb9d498828433eabce0e5/lib/main.coffee | 1 | 36 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:raw_corpus | raw_corpus | module.exports =
activate: (state) ->
setTimeout(@delay, 0, this)
delay: (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
that.updateMenu(atom.menu.template, defM.Menu)
atom.... | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | fda84be5f230086e8e5b3a75b7328da479db948e | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/fda84be5f230086e8e5b3a75b7328da479db948e/lib/main.coffee | 1 | 36 | ||
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
activate: (state) ->
setTimeout(@delay, 0, this)
delay: (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
... | module.exports = {
activate: function(state) {
return setTimeout(this.delay, 0, this);
},
delay: function(that) {
var CSON, defC, defM;
CSON = require('cson');
defM = CSON.load(__dirname + `/../def/menu_${process.platform}.cson`);
defC = CSON.load(__dirname + "/../def/context.cson");
// Me... | CoffeeScript | JavaScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | fda84be5f230086e8e5b3a75b7328da479db948e | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/fda84be5f230086e8e5b3a75b7328da479db948e/lib/main.coffee | 1 | 36 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
activate: function(state) {
return setTimeout(this.delay, 0, this);
},
delay: function(that) {
var CSON, defC, defM;
CSON = require('cson');
defM = CSON.load(__dirname + `/../def/menu_${process.platform}.cson`);
defC = C... | module.exports =
activate: (state) ->
setTimeout(@delay, 0, this)
delay: (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
that.updateMenu(atom.menu.template, defM.Menu)
atom.... | JavaScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | fda84be5f230086e8e5b3a75b7328da479db948e | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/fda84be5f230086e8e5b3a75b7328da479db948e/lib/main.coffee | 1 | 36 |
chinakids/atom-simplified-chinese-menu:lib/main.coffee:1:completion | completion | module.exports =
activate: (state) ->
setTimeout(@delay, 0, this)
delay: (that) ->
CSON = require 'cson'
defM = CSON.load __dirname + "/../def/menu_#{process.platform}.cson"
defC = CSON.load __dirname + "/../def/context.cson"
# Menu
that.updateMenu(atom.menu.template, defM.Menu)
atom.... | return if not def
for menu in menuList
continue if not menu.label
key = menu.label
set = def[key]
continue if not set
menu.label = set.value if set?
if menu.submenu?
@updateMenu(menu.submenu, set.submenu)
updateContextMenu: (def) ->
for itemSet in atom.contextMenu.... | CoffeeScript | CoffeeScript | chinakids/atom-simplified-chinese-menu | lib/main.coffee | MIT | fda84be5f230086e8e5b3a75b7328da479db948e | 1,335 | https://github.com/chinakids/atom-simplified-chinese-menu/blob/fda84be5f230086e8e5b3a75b7328da479db948e/lib/main.coffee | 1 | 36 |
jianliaoim/talk-os:talk-web/client/app/profile-mobile.coffee:1:raw_corpus | raw_corpus | cx = require 'classnames'
React = require 'react'
recorder = require 'actions-recorder'
query = require '../query'
userActions = require '../actions/user'
lang = require '../locales/lang'
div = React.createFactory 'div'
input = React.createFactory 'input'
T = React.PropTypes
module.exports = React.createClass
di... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/profile-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/profile-mobile.coffee | 1 | 46 | ||
jianliaoim/talk-os:talk-web/client/app/profile-mobile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
cx = require 'classnames'
React = require 'react'
recorder = require 'actions-recorder'
query = require '../query'
userActions = require '../actions/user'
lang = require '../locales/lang'
div = React.createFactory 'div'
input = React.createFactory 'input'
T =... | var React, T, cx, div, input, lang, query, recorder, userActions;
cx = require('classnames');
React = require('react');
recorder = require('actions-recorder');
query = require('../query');
userActions = require('../actions/user');
lang = require('../locales/lang');
div = React.createFactory('div');
input = Reac... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/profile-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/profile-mobile.coffee | 1 | 46 |
jianliaoim/talk-os:talk-web/client/app/profile-mobile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var React, T, cx, div, input, lang, query, recorder, userActions;
cx = require('classnames');
React = require('react');
recorder = require('actions-recorder');
query = require('../query');
userActions = require('../actions/user');
lang = require('../locales/l... | cx = require 'classnames'
React = require 'react'
recorder = require 'actions-recorder'
query = require '../query'
userActions = require '../actions/user'
lang = require '../locales/lang'
div = React.createFactory 'div'
input = React.createFactory 'input'
T = React.PropTypes
module.exports = React.createClass
di... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/profile-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/profile-mobile.coffee | 1 | 46 |
jianliaoim/talk-os:talk-web/client/app/profile-mobile.coffee:1:completion | completion | cx = require 'classnames'
React = require 'react'
recorder = require 'actions-recorder'
query = require '../query'
userActions = require '../actions/user'
lang = require '../locales/lang'
div = React.createFactory 'div'
input = React.createFactory 'input'
T = React.PropTypes
module.exports = React.createClass
di... | onChange: (event) ->
@setState mobile: event.target.value
onComplete: ->
_userId = query.userId(recorder.getState())
if @state.mobile.length isnt 0
userActions.userUpdate _userId, mobile: @state.mobile
@props.onComplete()
render: ->
buttonClassName = cx
'button': true
'is-d... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/profile-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/profile-mobile.coffee | 1 | 46 |
jianliaoim/talk-os:talk-account/client/app/bind-mobile.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'bind-mobile'
propTypes:
store: React.PropTypes.instanceOf(Immutable.Map).isRequired
getInitialState: ->
randomCode: ''
showVerifyMobile: false
bindCode: null
showForceBind: false
error: null
captchaUid: null
getAccount: ->
@prop... | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/bind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/bind-mobile.coffee | 17 | 66 | ||
jianliaoim/talk-os:talk-account/client/app/bind-mobile.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'bind-mobile'
propTypes:
store: React.PropTypes.instanceOf(Immutable.Map).isRequired
getInitialState: ->
randomCode: ''
showVerifyMobile: false
bindCode: null
showForceBind: false
err... | module.exports = React.createClass({
displayName: 'bind-mobile',
propTypes: {
store: React.PropTypes.instanceOf(Immutable.Map).isRequired
},
getInitialState: function() {
return {
randomCode: '',
showVerifyMobile: false,
bindCode: null,
showForceBind: false,
error: null,
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/client/app/bind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/bind-mobile.coffee | 17 | 66 |
jianliaoim/talk-os:talk-account/client/app/bind-mobile.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'bind-mobile',
propTypes: {
store: React.PropTypes.instanceOf(Immutable.Map).isRequired
},
getInitialState: function() {
return {
randomCode: '',
showVerifyMobile: false,
bindCode: ... | module.exports = React.createClass
displayName: 'bind-mobile'
propTypes:
store: React.PropTypes.instanceOf(Immutable.Map).isRequired
getInitialState: ->
randomCode: ''
showVerifyMobile: false
bindCode: null
showForceBind: false
error: null
captchaUid: null
getAccount: ->
@prop... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/bind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/bind-mobile.coffee | 17 | 66 |
jianliaoim/talk-os:talk-account/client/app/bind-mobile.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'bind-mobile'
propTypes:
store: React.PropTypes.instanceOf(Immutable.Map).isRequired
getInitialState: ->
randomCode: ''
showVerifyMobile: false
bindCode: null
showForceBind: false
error: null
captchaUid: null
getAccount: ->
@prop... | @props.store.getIn(['router', 'query', 'action']) is 'change'
onAccountChange: (account) ->
@setState error: null
controllers.updateAccount account
onSendVerifyCode: ->
if detect.isMobile(@getAccount())
if @state.captchaUid?
ajax.mobileSendVerifyCode
data:
phoneNumb... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/bind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/bind-mobile.coffee | 17 | 66 |
jianliaoim/talk-os:talk-account/client/app/bind-mobile.coffee:2:raw_corpus | raw_corpus | if @isChangingBinding()
@onMobileChange verifyCode
else
@onMobileBind verifyCode
onMobileBind: (verifyCode) ->
ajax.mobileBind
data:
randomCode: @state.randomCode
verifyCode: verifyCode
success: (resp) =>
controllers.signInRedirect()
@setState error: nu... | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/bind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/bind-mobile.coffee | 67 | 116 | ||
jianliaoim/talk-os:talk-account/client/app/bind-mobile.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if @isChangingBinding()
@onMobileChange verifyCode
else
@onMobileBind verifyCode
onMobileBind: (verifyCode) ->
ajax.mobileBind
data:
randomCode: @state.randomCode
verifyCode: verifyCode
success: (resp) =>
... | if (this.isChangingBinding()) {
this.onMobileChange(verifyCode);
} else {
this.onMobileBind(verifyCode);
}
({
onMobileBind: function(verifyCode) {
return ajax.mobileBind({
data: {
randomCode: this.state.randomCode,
verifyCode: verifyCode
},
success: (resp) => {
contr... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/client/app/bind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/bind-mobile.coffee | 67 | 116 |
jianliaoim/talk-os:talk-account/client/app/bind-mobile.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (this.isChangingBinding()) {
this.onMobileChange(verifyCode);
} else {
this.onMobileBind(verifyCode);
}
({
onMobileBind: function(verifyCode) {
return ajax.mobileBind({
data: {
randomCode: this.state.randomCode,
verifyCode: verif... | if @isChangingBinding()
@onMobileChange verifyCode
else
@onMobileBind verifyCode
onMobileBind: (verifyCode) ->
ajax.mobileBind
data:
randomCode: @state.randomCode
verifyCode: verifyCode
success: (resp) =>
controllers.signInRedirect()
@setState error: nu... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/bind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/bind-mobile.coffee | 67 | 116 |
jianliaoim/talk-os:talk-account/client/app/bind-mobile.coffee:2:completion | completion | if @isChangingBinding()
@onMobileChange verifyCode
else
@onMobileBind verifyCode
onMobileBind: (verifyCode) ->
ajax.mobileBind
data:
randomCode: @state.randomCode
verifyCode: verifyCode
success: (resp) =>
controllers.signInRedirect()
@setState error: nu... | randomCode: @state.randomCode
verifyCode: verifyCode
success: (resp) =>
controllers.signInRedirect()
@setState error: null
error: (err) =>
error = JSON.parse err.response
if error.code is 230 # number is already bound
@setState
bindCode: error.da... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/bind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/bind-mobile.coffee | 67 | 116 |
jianliaoim/talk-os:talk-account/client/app/bind-mobile.coffee:3:raw_corpus | raw_corpus | VerifyMobile
store: @props.store
onResend: @onSendVerifyCode
onVerify: @onMobileVerify
onBack: @onBack
isLoading: @isLoading()
error: @state.error
renderForceBind: ->
ForceBindMobile
bindCode: @state.bindCode
language: @getLanguage()
render: ->
if @state.sho... | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/bind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/bind-mobile.coffee | 117 | 161 | ||
jianliaoim/talk-os:talk-account/client/app/bind-mobile.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
VerifyMobile
store: @props.store
onResend: @onSendVerifyCode
onVerify: @onMobileVerify
onBack: @onBack
isLoading: @isLoading()
error: @state.error
renderForceBind: ->
ForceBindMobile
bindCode: @state.bindCode
... | VerifyMobile({
store: this.props.store,
onResend: this.onSendVerifyCode,
onVerify: this.onMobileVerify,
onBack: this.onBack,
isLoading: this.isLoading(),
error: this.state.error
});
({
renderForceBind: function() {
return ForceBindMobile({
bindCode: this.state.bindCode,
language: this.get... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/client/app/bind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/bind-mobile.coffee | 117 | 161 |
jianliaoim/talk-os:talk-account/client/app/bind-mobile.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
VerifyMobile({
store: this.props.store,
onResend: this.onSendVerifyCode,
onVerify: this.onMobileVerify,
onBack: this.onBack,
isLoading: this.isLoading(),
error: this.state.error
});
({
renderForceBind: function() {
return ForceBindMobile({
... | VerifyMobile
store: @props.store
onResend: @onSendVerifyCode
onVerify: @onMobileVerify
onBack: @onBack
isLoading: @isLoading()
error: @state.error
renderForceBind: ->
ForceBindMobile
bindCode: @state.bindCode
language: @getLanguage()
render: ->
if @state.sho... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/bind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/bind-mobile.coffee | 117 | 161 |
jianliaoim/talk-os:talk-account/client/app/bind-mobile.coffee:3:completion | completion | VerifyMobile
store: @props.store
onResend: @onSendVerifyCode
onVerify: @onMobileVerify
onBack: @onBack
isLoading: @isLoading()
error: @state.error
renderForceBind: ->
ForceBindMobile
bindCode: @state.bindCode
language: @getLanguage()
render: ->
if @state.sho... | span className: 'hint-title', locales.get('verifyToChangeMobile', @getLanguage())
else
span className: 'hint-title', locales.get('verifyToBindMobile', @getLanguage())
Space height: 15
MobileInput
language: @getLanguage(), account: @getAccount()
onChange: @onAccountChang... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/bind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/bind-mobile.coffee | 117 | 161 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_assignment.coffee:1:raw_corpus | raw_corpus | # Can assign the result of a try/catch block.
result: try
nonexistent * missing
catch error
true
result2: try nonexistent * missing catch error then true
ok result is true and result2 is true
# Can assign a conditional statement.
get_x: -> 10
if x: get_x() then 100
ok x is 10
x: if get_x() then 100
ok x is ... | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_assignment.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_assignment.coffee | 1 | 29 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_assignment.coffee:1:completion | completion | # Can assign the result of a try/catch block.
result: try
nonexistent * missing
catch error
true
result2: try nonexistent * missing catch error then true
ok result is true and result2 is true
# Can assign a conditional statement.
get_x: -> 10 | if x: get_x() then 100
ok x is 10
x: if get_x() then 100
ok x is 100
# This-assignment.
tester: ->
@example: -> 'example function'
this
ok tester().example() is 'example function' | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_assignment.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_assignment.coffee | 1 | 29 |
jianliaoim/talk-os:talk-web/test/spec/util/util.spec.coffee:1:raw_corpus | raw_corpus | Immutable = require 'immutable'
describe 'util: util', ->
beforeEach ->
@util = require 'util/util'
describe 'function: combineMessages', ->
it 'should combine creators when the body is the same and it is a system message', ->
messages = Immutable.fromJS [
{body: '{{_info-join-team}}', isSy... | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/util/util.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/util/util.spec.coffee | 1 | 43 | ||
jianliaoim/talk-os:talk-web/test/spec/util/util.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Immutable = require 'immutable'
describe 'util: util', ->
beforeEach ->
@util = require 'util/util'
describe 'function: combineMessages', ->
it 'should combine creators when the body is the same and it is a system message', ->
messages = Immu... | var Immutable;
Immutable = require('immutable');
describe('util: util', function() {
beforeEach(function() {
return this.util = require('util/util');
});
return describe('function: combineMessages', function() {
it('should combine creators when the body is the same and it is a system message', function(... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/test/spec/util/util.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/util/util.spec.coffee | 1 | 43 |
jianliaoim/talk-os:talk-web/test/spec/util/util.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Immutable;
Immutable = require('immutable');
describe('util: util', function() {
beforeEach(function() {
return this.util = require('util/util');
});
return describe('function: combineMessages', function() {
it('should combine creators when the ... | Immutable = require 'immutable'
describe 'util: util', ->
beforeEach ->
@util = require 'util/util'
describe 'function: combineMessages', ->
it 'should combine creators when the body is the same and it is a system message', ->
messages = Immutable.fromJS [
{body: '{{_info-join-team}}', isSy... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/util/util.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/util/util.spec.coffee | 1 | 43 |
jianliaoim/talk-os:talk-web/test/spec/util/util.spec.coffee:1:completion | completion | Immutable = require 'immutable'
describe 'util: util', ->
beforeEach ->
@util = require 'util/util'
describe 'function: combineMessages', ->
it 'should combine creators when the body is the same and it is a system message', ->
messages = Immutable.fromJS [
{body: '{{_info-join-team}}', isSy... | {_id: 'a', name: 'a'}
{_id: 'b', name: 'b'}
{_id: 'c', name: 'c'}
{_id: 'd', name: 'd'}
]
}
]
expect(@util.combineMessages(messages)).toEqualImmutable combined
it 'should not do anything if there are no messages', ->
messages = Immutable.fromJ... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/util/util.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/util/util.spec.coffee | 1 | 43 |
jianliaoim/talk-os:talk-web/test/spec/util/util.spec.coffee:2:raw_corpus | raw_corpus | it 'should handle mixed messages', ->
messages = Immutable.fromJS [
{body: '{{_info-join-team}}', isSystem: true, creator: {_id: 'a', name: 'a'}}
{body: '{{_info-join-team}}', isSystem: true, creator: {_id: 'b', name: 'b'}}
{body: 'test', isSystem: false, creator: {_id: 'c', name: 'c'}}
... | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/util/util.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/util/util.spec.coffee | 45 | 84 | ||
jianliaoim/talk-os:talk-web/test/spec/util/util.spec.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should handle mixed messages', ->
messages = Immutable.fromJS [
{body: '{{_info-join-team}}', isSystem: true, creator: {_id: 'a', name: 'a'}}
{body: '{{_info-join-team}}', isSystem: true, creator: {_id: 'b', name: 'b'}}
{body: 't... | it('should handle mixed messages', function() {
var combined, messages;
messages = Immutable.fromJS([
{
body: '{{_info-join-team}}',
isSystem: true,
creator: {
_id: 'a',
name: 'a'
}
},
{
body: '{{_info-join-team}}',
isSystem: true,
creator: {
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/test/spec/util/util.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/util/util.spec.coffee | 45 | 84 |
jianliaoim/talk-os:talk-web/test/spec/util/util.spec.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should handle mixed messages', function() {
var combined, messages;
messages = Immutable.fromJS([
{
body: '{{_info-join-team}}',
isSystem: true,
creator: {
_id: 'a',
name: 'a'
}
},
{
body: '{{_info-j... | it 'should handle mixed messages', ->
messages = Immutable.fromJS [
{body: '{{_info-join-team}}', isSystem: true, creator: {_id: 'a', name: 'a'}}
{body: '{{_info-join-team}}', isSystem: true, creator: {_id: 'b', name: 'b'}}
{body: 'test', isSystem: false, creator: {_id: 'c', name: 'c'}}
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/util/util.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/util/util.spec.coffee | 45 | 84 |
jianliaoim/talk-os:talk-web/test/spec/util/util.spec.coffee:2:completion | completion | it 'should handle mixed messages', ->
messages = Immutable.fromJS [
{body: '{{_info-join-team}}', isSystem: true, creator: {_id: 'a', name: 'a'}}
{body: '{{_info-join-team}}', isSystem: true, creator: {_id: 'b', name: 'b'}}
{body: 'test', isSystem: false, creator: {_id: 'c', name: 'c'}}
... | {
body: '{{_info-leave-team}}'
isSystem: true
creators: [
{_id: 'd', name: 'd'}
{_id: 'e', name: 'e'}
]
}
{body: 'test', isSystem: false, creator: {_id: 'f', name: 'f'}}
{body: 'test', isSystem: false, creator: {_id: 'g', name: 'g'}... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/util/util.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/util/util.spec.coffee | 45 | 84 |
jianliaoim/talk-os:talk-web/test/spec/util/util.spec.coffee:3:raw_corpus | raw_corpus | combined = Immutable.fromJS [
{
body: '{{_info-join-team}}'
isSystem: true
creators: [
{_id: 'a', name: 'a'}
{_id: 'b', name: 'b'}
]
}
]
expect(@util.combineMessages(messages)).toEqualImmutable combined
describe 'function: im... | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/util/util.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/util/util.spec.coffee | 86 | 124 | ||
jianliaoim/talk-os:talk-web/test/spec/util/util.spec.coffee:3:completion | completion | combined = Immutable.fromJS [
{
body: '{{_info-join-team}}'
isSystem: true
creators: [
{_id: 'a', name: 'a'}
{_id: 'b', name: 'b'}
]
}
]
expect(@util.combineMessages(messages)).toEqualImmutable combined
describe 'function: im... | scale = @util.imageRotateScale(iWidth, iHeight, cWidth, cHeight)
expect(scale).toBe 1
[iWidth, iHeight, cWidth, cHeight] = [200, 200, 300, 200]
scale = @util.imageRotateScale(iWidth, iHeight, cWidth, cHeight)
expect(scale).toBe 1
[iWidth, iHeight, cWidth, cHeight] = [100, 100, 300, 200]
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/util/util.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/util/util.spec.coffee | 86 | 124 |
jianliaoim/talk-os:talk-web/test/spec/util/util.spec.coffee:4:raw_corpus | raw_corpus | it 'iHeight > iWidth (3)', ->
[iWidth, iHeight, cWidth, cHeight] = [3260, 2450, 1100, 660]
scale = @util.imageRotateScale(iWidth, iHeight, cWidth, cHeight)
expect(scale).toBe (iHeight / iWidth)
it 'iHeight > iWidth (4)', ->
[iWidth, iHeight, cWidth, cHeight] = [3260, 2450, 230, 375]
s... | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/util/util.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/util/util.spec.coffee | 126 | 154 | ||
jianliaoim/talk-os:talk-web/test/spec/util/util.spec.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'iHeight > iWidth (3)', ->
[iWidth, iHeight, cWidth, cHeight] = [3260, 2450, 1100, 660]
scale = @util.imageRotateScale(iWidth, iHeight, cWidth, cHeight)
expect(scale).toBe (iHeight / iWidth)
it 'iHeight > iWidth (4)', ->
[iWidth, i... | it('iHeight > iWidth (3)', function() {
var cHeight, cWidth, iHeight, iWidth, scale;
[iWidth, iHeight, cWidth, cHeight] = [3260, 2450, 1100, 660];
scale = this.util.imageRotateScale(iWidth, iHeight, cWidth, cHeight);
return expect(scale).toBe(iHeight / iWidth);
});
it('iHeight > iWidth (4)', function() {
var... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/test/spec/util/util.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/util/util.spec.coffee | 126 | 154 |
jianliaoim/talk-os:talk-web/test/spec/util/util.spec.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('iHeight > iWidth (3)', function() {
var cHeight, cWidth, iHeight, iWidth, scale;
[iWidth, iHeight, cWidth, cHeight] = [3260, 2450, 1100, 660];
scale = this.util.imageRotateScale(iWidth, iHeight, cWidth, cHeight);
return expect(scale).toBe(iHeight / iWid... | it 'iHeight > iWidth (3)', ->
[iWidth, iHeight, cWidth, cHeight] = [3260, 2450, 1100, 660]
scale = @util.imageRotateScale(iWidth, iHeight, cWidth, cHeight)
expect(scale).toBe (iHeight / iWidth)
it 'iHeight > iWidth (4)', ->
[iWidth, iHeight, cWidth, cHeight] = [3260, 2450, 230, 375]
s... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/util/util.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/util/util.spec.coffee | 126 | 154 |
jianliaoim/talk-os:talk-web/test/spec/util/util.spec.coffee:4:completion | completion | it 'iHeight > iWidth (3)', ->
[iWidth, iHeight, cWidth, cHeight] = [3260, 2450, 1100, 660]
scale = @util.imageRotateScale(iWidth, iHeight, cWidth, cHeight)
expect(scale).toBe (iHeight / iWidth)
it 'iHeight > iWidth (4)', ->
[iWidth, iHeight, cWidth, cHeight] = [3260, 2450, 230, 375]
s... | it 'iHeight <= iWidth (2)', ->
[iWidth, iHeight, cWidth, cHeight] = [730, 8, 700, 1100]
scale = @util.imageRotateScale(iWidth, iHeight, cWidth, cHeight)
expect(scale).toBe (iWidth / cWidth)
it 'iHeight <= iWidth (3)', ->
[iWidth, iHeight, cWidth, cHeight] = [3260, 2450, 660, 1100]
sca... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/util/util.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/util/util.spec.coffee | 126 | 154 |
buttercoin/buttercoin:lib/amount.coffee:1:raw_corpus | raw_corpus | BigDecimal = require('bigdecimal').BigDecimal
module.exports = class Amount
constructor: (string_value) ->
if typeof string_value == 'undefined'
string_value = '0'
if typeof string_value == 'string'
try
@value = new BigDecimal(string_value)
catch e
throw new Error('String i... | CoffeeScript | buttercoin/buttercoin | lib/amount.coffee | MIT | 1ec26da453ab2accbc8ba8e4948f3f8a549ad979 | 663 | https://github.com/buttercoin/buttercoin/blob/1ec26da453ab2accbc8ba8e4948f3f8a549ad979/lib/amount.coffee | 1 | 39 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.