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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
octoblu/meshblu:lib/MessageWebhook.coffee:2:raw_corpus | raw_corpus | removeToken: (token) =>
@device.removeTokenFromCache token, (error) =>
module.exports = MessageWebhook | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 0b4a5f0233ed1ad2bd0447db99ef92ca89866069 | 815 | https://github.com/octoblu/meshblu/blob/0b4a5f0233ed1ad2bd0447db99ef92ca89866069/lib/MessageWebhook.coffee | 51 | 55 | ||
octoblu/meshblu:lib/MessageWebhook.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
removeToken: (token) =>
@device.removeTokenFromCache token, (error) =>
module.exports = MessageWebhook
``` | ({
removeToken: (token) => {
return this.device.removeTokenFromCache(token, (error) => {});
}
});
module.exports = MessageWebhook; | CoffeeScript | JavaScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 0b4a5f0233ed1ad2bd0447db99ef92ca89866069 | 815 | https://github.com/octoblu/meshblu/blob/0b4a5f0233ed1ad2bd0447db99ef92ca89866069/lib/MessageWebhook.coffee | 51 | 55 |
octoblu/meshblu:lib/MessageWebhook.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
removeToken: (token) => {
return this.device.removeTokenFromCache(token, (error) => {});
}
});
module.exports = MessageWebhook;
``` | removeToken: (token) =>
@device.removeTokenFromCache token, (error) =>
module.exports = MessageWebhook | JavaScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 0b4a5f0233ed1ad2bd0447db99ef92ca89866069 | 815 | https://github.com/octoblu/meshblu/blob/0b4a5f0233ed1ad2bd0447db99ef92ca89866069/lib/MessageWebhook.coffee | 51 | 55 |
octoblu/meshblu:lib/MessageWebhook.coffee:2:completion | completion | removeToken: (token) =>
@device.removeTokenFromCache token, (error) => | module.exports = MessageWebhook | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 0b4a5f0233ed1ad2bd0447db99ef92ca89866069 | 815 | https://github.com/octoblu/meshblu/blob/0b4a5f0233ed1ad2bd0447db99ef92ca89866069/lib/MessageWebhook.coffee | 51 | 55 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
config = require '../config'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID' ]
constructor: (options, dependencies={}) ->
{@uuid, @options, @type} = options
{@request, @device} = dependen... | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 51ebbd8763a3a475d787d0f50bda1deb9069a7da | 815 | https://github.com/octoblu/meshblu/blob/51ebbd8763a3a475d787d0f50bda1deb9069a7da/lib/MessageWebhook.coffee | 1 | 50 | ||
octoblu/meshblu:lib/MessageWebhook.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
config = require '../config'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID' ]
constructor: (options, dependencies={}) ->
{@uuid, @opt... | var MessageWebhook, _, config;
_ = require('lodash');
config = require('../config');
MessageWebhook = (function() {
class MessageWebhook {
constructor(options, dependencies = {}) {
var Device;
this.generateAndForwardMeshbluCredentials = this.generateAndForwardMeshbluCredentials.bind(this);
th... | CoffeeScript | JavaScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 51ebbd8763a3a475d787d0f50bda1deb9069a7da | 815 | https://github.com/octoblu/meshblu/blob/51ebbd8763a3a475d787d0f50bda1deb9069a7da/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MessageWebhook, _, config;
_ = require('lodash');
config = require('../config');
MessageWebhook = (function() {
class MessageWebhook {
constructor(options, dependencies = {}) {
var Device;
this.generateAndForwardMeshbluCredentials = this.ge... | _ = require 'lodash'
config = require '../config'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID' ]
constructor: (options, dependencies={}) ->
{@uuid, @options, @type} = options
{@request, @device} = dependen... | JavaScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 51ebbd8763a3a475d787d0f50bda1deb9069a7da | 815 | https://github.com/octoblu/meshblu/blob/51ebbd8763a3a475d787d0f50bda1deb9069a7da/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:completion | completion | _ = require 'lodash'
config = require '../config'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID' ]
constructor: (options, dependencies={}) ->
{@uuid, @options, @type} = options
{@request, @device} = dependen... | httpSignature: MessageWebhook.HTTP_SIGNATURE_OPTIONS
@doRequest options, message, callback
return
if @options.generateAndForwardMeshbluCredentials
@generateAndForwardMeshbluCredentials (error, token) =>
bearer = new Buffer("#{@uuid}:#{token}").toString('base64')
@doRequest auth: b... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 51ebbd8763a3a475d787d0f50bda1deb9069a7da | 815 | https://github.com/octoblu/meshblu/blob/51ebbd8763a3a475d787d0f50bda1deb9069a7da/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:2:raw_corpus | raw_corpus | callback()
removeToken: (token) =>
@device.removeTokenFromCache token, (error) =>
module.exports = MessageWebhook | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 51ebbd8763a3a475d787d0f50bda1deb9069a7da | 815 | https://github.com/octoblu/meshblu/blob/51ebbd8763a3a475d787d0f50bda1deb9069a7da/lib/MessageWebhook.coffee | 51 | 56 | ||
octoblu/meshblu:lib/MessageWebhook.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
callback()
removeToken: (token) =>
@device.removeTokenFromCache token, (error) =>
module.exports = MessageWebhook
``` | callback()({
removeToken: (token) => {
return this.device.removeTokenFromCache(token, (error) => {});
}
});
module.exports = MessageWebhook; | CoffeeScript | JavaScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 51ebbd8763a3a475d787d0f50bda1deb9069a7da | 815 | https://github.com/octoblu/meshblu/blob/51ebbd8763a3a475d787d0f50bda1deb9069a7da/lib/MessageWebhook.coffee | 51 | 56 |
octoblu/meshblu:lib/MessageWebhook.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
callback()({
removeToken: (token) => {
return this.device.removeTokenFromCache(token, (error) => {});
}
});
module.exports = MessageWebhook;
``` | callback()
removeToken: (token) =>
@device.removeTokenFromCache token, (error) =>
module.exports = MessageWebhook | JavaScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 51ebbd8763a3a475d787d0f50bda1deb9069a7da | 815 | https://github.com/octoblu/meshblu/blob/51ebbd8763a3a475d787d0f50bda1deb9069a7da/lib/MessageWebhook.coffee | 51 | 56 |
octoblu/meshblu:lib/MessageWebhook.coffee:2:completion | completion | callback()
removeToken: (token) => | @device.removeTokenFromCache token, (error) =>
module.exports = MessageWebhook | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 51ebbd8763a3a475d787d0f50bda1deb9069a7da | 815 | https://github.com/octoblu/meshblu/blob/51ebbd8763a3a475d787d0f50bda1deb9069a7da/lib/MessageWebhook.coffee | 51 | 56 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
config = require '../config'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID' ]
constructor: (options, dependencies={}) ->
{@uuid, @options, @type} = options
{@request, @device} = dependen... | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | f2978caad8b4af5d4c8e4ecc758a79226dc30026 | 815 | https://github.com/octoblu/meshblu/blob/f2978caad8b4af5d4c8e4ecc758a79226dc30026/lib/MessageWebhook.coffee | 1 | 50 | ||
octoblu/meshblu:lib/MessageWebhook.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
config = require '../config'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID' ]
constructor: (options, dependencies={}) ->
{@uuid, @opt... | var MessageWebhook, _, config;
_ = require('lodash');
config = require('../config');
MessageWebhook = (function() {
class MessageWebhook {
constructor(options, dependencies = {}) {
var Device;
this.generateAndForwardMeshbluCredentials = this.generateAndForwardMeshbluCredentials.bind(this);
th... | CoffeeScript | JavaScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | f2978caad8b4af5d4c8e4ecc758a79226dc30026 | 815 | https://github.com/octoblu/meshblu/blob/f2978caad8b4af5d4c8e4ecc758a79226dc30026/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MessageWebhook, _, config;
_ = require('lodash');
config = require('../config');
MessageWebhook = (function() {
class MessageWebhook {
constructor(options, dependencies = {}) {
var Device;
this.generateAndForwardMeshbluCredentials = this.ge... | _ = require 'lodash'
config = require '../config'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID' ]
constructor: (options, dependencies={}) ->
{@uuid, @options, @type} = options
{@request, @device} = dependen... | JavaScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | f2978caad8b4af5d4c8e4ecc758a79226dc30026 | 815 | https://github.com/octoblu/meshblu/blob/f2978caad8b4af5d4c8e4ecc758a79226dc30026/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:completion | completion | _ = require 'lodash'
config = require '../config'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID' ]
constructor: (options, dependencies={}) ->
{@uuid, @options, @type} = options
{@request, @device} = dependen... | @doRequest options, message, callback
return
if @options.generateAndForwardMeshbluCredentials
@generateAndForwardMeshbluCredentials (error, token) =>
bearer = new Buffer("#{@uuid}:#{token}").toString('base64')
@doRequest auth: bearer: bearer, message, (error) =>
@removeToken(t... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | f2978caad8b4af5d4c8e4ecc758a79226dc30026 | 815 | https://github.com/octoblu/meshblu/blob/f2978caad8b4af5d4c8e4ecc758a79226dc30026/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID' ]
constructor: (options, dependencies={}) ->
{@uuid, @options, @type} = options... | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | e0d09aec3b5469aed05390c9cbe8aa4aad521a86 | 815 | https://github.com/octoblu/meshblu/blob/e0d09aec3b5469aed05390c9cbe8aa4aad521a86/lib/MessageWebhook.coffee | 1 | 50 | ||
octoblu/meshblu:lib/MessageWebhook.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID' ]
constructor: (options, d... | var Device, MessageWebhook, _, config;
_ = require('lodash');
config = require('../config');
Device = require('./models/device');
MessageWebhook = (function() {
class MessageWebhook {
constructor(options, dependencies = {}) {
this.generateAndForwardMeshbluCredentials = this.generateAndForwardMeshbluCred... | CoffeeScript | JavaScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | e0d09aec3b5469aed05390c9cbe8aa4aad521a86 | 815 | https://github.com/octoblu/meshblu/blob/e0d09aec3b5469aed05390c9cbe8aa4aad521a86/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Device, MessageWebhook, _, config;
_ = require('lodash');
config = require('../config');
Device = require('./models/device');
MessageWebhook = (function() {
class MessageWebhook {
constructor(options, dependencies = {}) {
this.generateAndForward... | _ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID' ]
constructor: (options, dependencies={}) ->
{@uuid, @options, @type} = options... | JavaScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | e0d09aec3b5469aed05390c9cbe8aa4aad521a86 | 815 | https://github.com/octoblu/meshblu/blob/e0d09aec3b5469aed05390c9cbe8aa4aad521a86/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:completion | completion | _ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID' ]
constructor: (options, dependencies={}) ->
{@uuid, @options, @type} = options... | @doRequest options, message, callback
return
if @options.generateAndForwardMeshbluCredentials
@generateAndForwardMeshbluCredentials (error, token) =>
bearer = new Buffer("#{@uuid}:#{token}").toString('base64')
@doRequest auth: bearer: bearer, message, (error) =>
@removeToken(t... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | e0d09aec3b5469aed05390c9cbe8aa4aad521a86 | 815 | https://github.com/octoblu/meshblu/blob/e0d09aec3b5469aed05390c9cbe8aa4aad521a86/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID']
constructor: (options, dependencies={}) ->
{@uuid, @options, @type} = options
... | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/lib/MessageWebhook.coffee | 1 | 50 | ||
octoblu/meshblu:lib/MessageWebhook.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID']
constructor: (options, de... | var Device, MessageWebhook, _, config;
_ = require('lodash');
config = require('../config');
Device = require('./models/device');
MessageWebhook = (function() {
class MessageWebhook {
constructor(options, dependencies = {}) {
this.generateAndForwardMeshbluCredentials = this.generateAndForwardMeshbluCred... | CoffeeScript | JavaScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Device, MessageWebhook, _, config;
_ = require('lodash');
config = require('../config');
Device = require('./models/device');
MessageWebhook = (function() {
class MessageWebhook {
constructor(options, dependencies = {}) {
this.generateAndForward... | _ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID']
constructor: (options, dependencies={}) ->
{@uuid, @options, @type} = options
... | JavaScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:completion | completion | _ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID']
constructor: (options, dependencies={}) ->
{@uuid, @options, @type} = options
... | httpSignature: MessageWebhook.HTTP_SIGNATURE_OPTIONS
@doRequest options, message, callback
return
if @options.generateAndForwardMeshbluCredentials
@generateAndForwardMeshbluCredentials (error, token) =>
bearer = new Buffer("#{@uuid}:#{token}").toString('base64')
@doRequest auth: b... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID']
constructor: (@uuid, @options, dependencies={}) ->
@request = dependencies.req... | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | e83560036af63314369407de9d2774465f8a4367 | 815 | https://github.com/octoblu/meshblu/blob/e83560036af63314369407de9d2774465f8a4367/lib/MessageWebhook.coffee | 1 | 50 | ||
octoblu/meshblu:lib/MessageWebhook.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID']
constructor: (@uuid, @opt... | var Device, MessageWebhook, _, config;
_ = require('lodash');
config = require('../config');
Device = require('./models/device');
MessageWebhook = (function() {
class MessageWebhook {
constructor(uuid, options1, dependencies = {}) {
var ref;
this.generateAndForwardMeshbluCredentials = this.generat... | CoffeeScript | JavaScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | e83560036af63314369407de9d2774465f8a4367 | 815 | https://github.com/octoblu/meshblu/blob/e83560036af63314369407de9d2774465f8a4367/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Device, MessageWebhook, _, config;
_ = require('lodash');
config = require('../config');
Device = require('./models/device');
MessageWebhook = (function() {
class MessageWebhook {
constructor(uuid, options1, dependencies = {}) {
var ref;
t... | _ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID']
constructor: (@uuid, @options, dependencies={}) ->
@request = dependencies.req... | JavaScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | e83560036af63314369407de9d2774465f8a4367 | 815 | https://github.com/octoblu/meshblu/blob/e83560036af63314369407de9d2774465f8a4367/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:completion | completion | _ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID']
constructor: (@uuid, @options, dependencies={}) ->
@request = dependencies.req... | return
if @options.generateAndForwardMeshbluCredentials
@generateAndForwardMeshbluCredentials (error, token) =>
bearer = new Buffer("#{@uuid}:#{token}").toString('base64')
@doRequest auth: bearer: bearer, message, (error) =>
@removeToken(token)
callback error
return... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | e83560036af63314369407de9d2774465f8a4367 | 815 | https://github.com/octoblu/meshblu/blob/e83560036af63314369407de9d2774465f8a4367/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID']
constructor: (@uuid, @options, dependencies={}) ->
@request = dependencies.req... | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 02786e82b71afed2b777b8370f86f90b4dbf7575 | 815 | https://github.com/octoblu/meshblu/blob/02786e82b71afed2b777b8370f86f90b4dbf7575/lib/MessageWebhook.coffee | 1 | 50 | ||
octoblu/meshblu:lib/MessageWebhook.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID']
constructor: (@uuid, @opt... | var Device, MessageWebhook, _, config;
_ = require('lodash');
config = require('../config');
Device = require('./models/device');
MessageWebhook = (function() {
class MessageWebhook {
constructor(uuid, options1, dependencies = {}) {
var ref;
this.generateAndForwardMeshbluCredentials = this.generat... | CoffeeScript | JavaScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 02786e82b71afed2b777b8370f86f90b4dbf7575 | 815 | https://github.com/octoblu/meshblu/blob/02786e82b71afed2b777b8370f86f90b4dbf7575/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Device, MessageWebhook, _, config;
_ = require('lodash');
config = require('../config');
Device = require('./models/device');
MessageWebhook = (function() {
class MessageWebhook {
constructor(uuid, options1, dependencies = {}) {
var ref;
t... | _ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID']
constructor: (@uuid, @options, dependencies={}) ->
@request = dependencies.req... | JavaScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 02786e82b71afed2b777b8370f86f90b4dbf7575 | 815 | https://github.com/octoblu/meshblu/blob/02786e82b71afed2b777b8370f86f90b4dbf7575/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:completion | completion | _ = require 'lodash'
config = require '../config'
Device = require './models/device'
class MessageWebhook
@HTTP_SIGNATURE_OPTIONS:
keyId: 'meshblu-webhook-key'
key: config.privateKey
headers: [ 'date', 'X-MESHBLU-UUID']
constructor: (@uuid, @options, dependencies={}) ->
@request = dependencies.req... | return
if @options.generateAndForwardMeshbluCredentials
@generateAndForwardMeshbluCredentials (error, token) =>
bearer = new Buffer("#{@uuid}:#{token}").toString('base64')
@doRequest auth: bearer: bearer, message, (error) =>
@removeToken(token)
callback error
return... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 02786e82b71afed2b777b8370f86f90b4dbf7575 | 815 | https://github.com/octoblu/meshblu/blob/02786e82b71afed2b777b8370f86f90b4dbf7575/lib/MessageWebhook.coffee | 1 | 50 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
Device = require './models/device'
class MessageWebhook
constructor: (@uuid, @options, dependencies={}) ->
@request = dependencies.request ? require 'request'
@device = dependencies.device
@device ?= new Device uuid: @uuid
generateAndForwardMeshbluCredentials: (callback=->) =>
... | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 40eb9c175750f451cab2abad242c9b786aa81002 | 815 | https://github.com/octoblu/meshblu/blob/40eb9c175750f451cab2abad242c9b786aa81002/lib/MessageWebhook.coffee | 1 | 29 | ||
octoblu/meshblu:lib/MessageWebhook.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
Device = require './models/device'
class MessageWebhook
constructor: (@uuid, @options, dependencies={}) ->
@request = dependencies.request ? require 'request'
@device = dependencies.device
@device ?= new Device uuid: @uuid
g... | var Device, MessageWebhook, _;
_ = require('lodash');
Device = require('./models/device');
MessageWebhook = class MessageWebhook {
constructor(uuid, options1, dependencies = {}) {
var ref;
this.generateAndForwardMeshbluCredentials = this.generateAndForwardMeshbluCredentials.bind(this);
this.send = this... | CoffeeScript | JavaScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 40eb9c175750f451cab2abad242c9b786aa81002 | 815 | https://github.com/octoblu/meshblu/blob/40eb9c175750f451cab2abad242c9b786aa81002/lib/MessageWebhook.coffee | 1 | 29 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Device, MessageWebhook, _;
_ = require('lodash');
Device = require('./models/device');
MessageWebhook = class MessageWebhook {
constructor(uuid, options1, dependencies = {}) {
var ref;
this.generateAndForwardMeshbluCredentials = this.generateAndFor... | _ = require 'lodash'
Device = require './models/device'
class MessageWebhook
constructor: (@uuid, @options, dependencies={}) ->
@request = dependencies.request ? require 'request'
@device = dependencies.device
@device ?= new Device uuid: @uuid
generateAndForwardMeshbluCredentials: (callback=->) =>
... | JavaScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 40eb9c175750f451cab2abad242c9b786aa81002 | 815 | https://github.com/octoblu/meshblu/blob/40eb9c175750f451cab2abad242c9b786aa81002/lib/MessageWebhook.coffee | 1 | 29 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:completion | completion | _ = require 'lodash'
Device = require './models/device'
class MessageWebhook
constructor: (@uuid, @options, dependencies={}) ->
@request = dependencies.request ? require 'request'
@device = dependencies.device
@device ?= new Device uuid: @uuid
generateAndForwardMeshbluCredentials: (callback=->) =>
... | send: (message, callback=->) =>
@generateAndForwardMeshbluCredentials (error, token) =>
options = _.extend {}, _.omit(@options, 'generateAndForwardMeshbluCredentials'), json: message
options.auth ?= bearer: new Buffer("#{@uuid}:#{token}").toString('base64') if token
@request options, (error, respo... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 40eb9c175750f451cab2abad242c9b786aa81002 | 815 | https://github.com/octoblu/meshblu/blob/40eb9c175750f451cab2abad242c9b786aa81002/lib/MessageWebhook.coffee | 1 | 29 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
Device = require './models/device'
class MessageWebhook
constructor: (@uuid, @options, dependencies={}) ->
@request = dependencies.request ? require 'request'
@device = dependencies.device
@device ?= new Device uuid: @uuid
generateAndForwardMeshbluCredentials: (callback=->) =>
... | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 91a7e4ed0094294d168de96de0a3f76ed5f21e9b | 815 | https://github.com/octoblu/meshblu/blob/91a7e4ed0094294d168de96de0a3f76ed5f21e9b/lib/MessageWebhook.coffee | 1 | 30 | ||
octoblu/meshblu:lib/MessageWebhook.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
Device = require './models/device'
class MessageWebhook
constructor: (@uuid, @options, dependencies={}) ->
@request = dependencies.request ? require 'request'
@device = dependencies.device
@device ?= new Device uuid: @uuid
g... | var Device, MessageWebhook, _;
_ = require('lodash');
Device = require('./models/device');
MessageWebhook = class MessageWebhook {
constructor(uuid, options1, dependencies = {}) {
var ref;
this.generateAndForwardMeshbluCredentials = this.generateAndForwardMeshbluCredentials.bind(this);
this.send = this... | CoffeeScript | JavaScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 91a7e4ed0094294d168de96de0a3f76ed5f21e9b | 815 | https://github.com/octoblu/meshblu/blob/91a7e4ed0094294d168de96de0a3f76ed5f21e9b/lib/MessageWebhook.coffee | 1 | 30 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Device, MessageWebhook, _;
_ = require('lodash');
Device = require('./models/device');
MessageWebhook = class MessageWebhook {
constructor(uuid, options1, dependencies = {}) {
var ref;
this.generateAndForwardMeshbluCredentials = this.generateAndFor... | _ = require 'lodash'
Device = require './models/device'
class MessageWebhook
constructor: (@uuid, @options, dependencies={}) ->
@request = dependencies.request ? require 'request'
@device = dependencies.device
@device ?= new Device uuid: @uuid
generateAndForwardMeshbluCredentials: (callback=->) =>
... | JavaScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 91a7e4ed0094294d168de96de0a3f76ed5f21e9b | 815 | https://github.com/octoblu/meshblu/blob/91a7e4ed0094294d168de96de0a3f76ed5f21e9b/lib/MessageWebhook.coffee | 1 | 30 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:completion | completion | _ = require 'lodash'
Device = require './models/device'
class MessageWebhook
constructor: (@uuid, @options, dependencies={}) ->
@request = dependencies.request ? require 'request'
@device = dependencies.device
@device ?= new Device uuid: @uuid
generateAndForwardMeshbluCredentials: (callback=->) =>
... | send: (message, callback=->) =>
@generateAndForwardMeshbluCredentials (error, token) =>
options = _.extend {}, _.omit(@options, 'generateAndForwardMeshbluCredentials'), json: message
options.auth ?= bearer: new Buffer("#{@uuid}:#{token}").toString('base64') if token
@request options, (error, respo... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 91a7e4ed0094294d168de96de0a3f76ed5f21e9b | 815 | https://github.com/octoblu/meshblu/blob/91a7e4ed0094294d168de96de0a3f76ed5f21e9b/lib/MessageWebhook.coffee | 1 | 30 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
class MessageWebhook
constructor: (@device, @options, dependencies={}) ->
@request = dependencies.request ? require 'request'
@generateAndStoreToken = dependencies.generateAndStoreToken ? require './generateAndStoreToken'
@revokeToken = dependencies.revokeToken ? require './revokeTok... | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/lib/MessageWebhook.coffee | 1 | 28 | ||
octoblu/meshblu:lib/MessageWebhook.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
class MessageWebhook
constructor: (@device, @options, dependencies={}) ->
@request = dependencies.request ? require 'request'
@generateAndStoreToken = dependencies.generateAndStoreToken ? require './generateAndStoreToken'
@revo... | var MessageWebhook, _;
_ = require('lodash');
MessageWebhook = class MessageWebhook {
constructor(device, options1, dependencies = {}) {
var ref, ref1, ref2;
this.generateAndForwardMeshbluCredentials = this.generateAndForwardMeshbluCredentials.bind(this);
this.send = this.send.bind(this);
this.remov... | CoffeeScript | JavaScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/lib/MessageWebhook.coffee | 1 | 28 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MessageWebhook, _;
_ = require('lodash');
MessageWebhook = class MessageWebhook {
constructor(device, options1, dependencies = {}) {
var ref, ref1, ref2;
this.generateAndForwardMeshbluCredentials = this.generateAndForwardMeshbluCredentials.bind(this... | _ = require 'lodash'
class MessageWebhook
constructor: (@device, @options, dependencies={}) ->
@request = dependencies.request ? require 'request'
@generateAndStoreToken = dependencies.generateAndStoreToken ? require './generateAndStoreToken'
@revokeToken = dependencies.revokeToken ? require './revokeTok... | JavaScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/lib/MessageWebhook.coffee | 1 | 28 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:completion | completion | _ = require 'lodash'
class MessageWebhook
constructor: (@device, @options, dependencies={}) ->
@request = dependencies.request ? require 'request'
@generateAndStoreToken = dependencies.generateAndStoreToken ? require './generateAndStoreToken'
@revokeToken = dependencies.revokeToken ? require './revokeTok... | send: (message, callback=->) =>
@generateAndForwardMeshbluCredentials (error, token) =>
options = _.extend {}, _.omit(@options, 'generateAndForwardMeshbluCredentials'), json: message
options.auth ?= bearer: new Buffer("#{@device.uuid}:#{token}").toString('base64') if token
@request options, (error... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | 8ac5cdc79fe7d300cab1f100b895a31462332bda | 815 | https://github.com/octoblu/meshblu/blob/8ac5cdc79fe7d300cab1f100b895a31462332bda/lib/MessageWebhook.coffee | 1 | 28 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
class MessageWebhook
constructor: (@options, dependencies={}) ->
@request = dependencies.request ? require 'request'
send: (message, callback=->) =>
options = _.extend {}, @options, json: message
@request options, (error, response) =>
return callback error if error?
re... | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | c5c362d82ec94ad008db45c35f10e3f02ad222e2 | 815 | https://github.com/octoblu/meshblu/blob/c5c362d82ec94ad008db45c35f10e3f02ad222e2/lib/MessageWebhook.coffee | 1 | 14 | ||
octoblu/meshblu:lib/MessageWebhook.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
class MessageWebhook
constructor: (@options, dependencies={}) ->
@request = dependencies.request ? require 'request'
send: (message, callback=->) =>
options = _.extend {}, @options, json: message
@request options, (error, re... | var MessageWebhook, _;
_ = require('lodash');
MessageWebhook = class MessageWebhook {
constructor(options1, dependencies = {}) {
var ref;
this.send = this.send.bind(this);
this.options = options1;
this.request = (ref = dependencies.request) != null ? ref : require('request');
}
send(message, ca... | CoffeeScript | JavaScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | c5c362d82ec94ad008db45c35f10e3f02ad222e2 | 815 | https://github.com/octoblu/meshblu/blob/c5c362d82ec94ad008db45c35f10e3f02ad222e2/lib/MessageWebhook.coffee | 1 | 14 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MessageWebhook, _;
_ = require('lodash');
MessageWebhook = class MessageWebhook {
constructor(options1, dependencies = {}) {
var ref;
this.send = this.send.bind(this);
this.options = options1;
this.request = (ref = dependencies.request) != n... | _ = require 'lodash'
class MessageWebhook
constructor: (@options, dependencies={}) ->
@request = dependencies.request ? require 'request'
send: (message, callback=->) =>
options = _.extend {}, @options, json: message
@request options, (error, response) =>
return callback error if error?
re... | JavaScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | c5c362d82ec94ad008db45c35f10e3f02ad222e2 | 815 | https://github.com/octoblu/meshblu/blob/c5c362d82ec94ad008db45c35f10e3f02ad222e2/lib/MessageWebhook.coffee | 1 | 14 |
octoblu/meshblu:lib/MessageWebhook.coffee:1:completion | completion | _ = require 'lodash'
class MessageWebhook
constructor: (@options, dependencies={}) ->
@request = dependencies.request ? require 'request'
send: (message, callback=->) => | options = _.extend {}, @options, json: message
@request options, (error, response) =>
return callback error if error?
return callback new Error "HTTP Status: #{response.statusCode}" unless _.inRange response.statusCode, 200, 300
callback()
module.exports = MessageWebhook | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/MessageWebhook.coffee | MIT | c5c362d82ec94ad008db45c35f10e3f02ad222e2 | 815 | https://github.com/octoblu/meshblu/blob/c5c362d82ec94ad008db45c35f10e3f02ad222e2/lib/MessageWebhook.coffee | 1 | 14 |
jianliaoim/talk-os:talk-web/client/module/no-favorite.coffee:1:raw_corpus | raw_corpus | React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
span = React.createFactory 'span'
lang = require '../locales/lang'
module.exports = React.createClass
displayName: 'no-favorite'
mixins: [PureRenderMixin]
render: ->
div className: 'no-favori... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/no-favorite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/no-favorite.coffee | 1 | 16 | ||
jianliaoim/talk-os:talk-web/client/module/no-favorite.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
span = React.createFactory 'span'
lang = require '../locales/lang'
module.exports = React.createClass
displayName: 'no-favorite'
mixins: [Pur... | var PureRenderMixin, React, div, lang, span;
React = require('react');
PureRenderMixin = require('react-addons-pure-render-mixin');
div = React.createFactory('div');
span = React.createFactory('span');
lang = require('../locales/lang');
module.exports = React.createClass({
displayName: 'no-favorite',
mixins: ... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/no-favorite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/no-favorite.coffee | 1 | 16 |
jianliaoim/talk-os:talk-web/client/module/no-favorite.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PureRenderMixin, React, div, lang, span;
React = require('react');
PureRenderMixin = require('react-addons-pure-render-mixin');
div = React.createFactory('div');
span = React.createFactory('span');
lang = require('../locales/lang');
module.exports = React... | React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
span = React.createFactory 'span'
lang = require '../locales/lang'
module.exports = React.createClass
displayName: 'no-favorite'
mixins: [PureRenderMixin]
render: ->
div className: 'no-favori... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/no-favorite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/no-favorite.coffee | 1 | 16 |
jianliaoim/talk-os:talk-web/client/module/no-favorite.coffee:1:completion | completion | React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
span = React.createFactory 'span'
lang = require '../locales/lang'
module.exports = React.createClass | displayName: 'no-favorite'
mixins: [PureRenderMixin]
render: ->
div className: 'no-favorite',
span className: "ti ti-star-solid"
div className: "message", lang.getText('no-favorite')
div className: 'tip', lang.getText('no-favorite-tip') | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/no-favorite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/no-favorite.coffee | 1 | 16 |
oozcitak/xmlbuilder-js:test/basic/prevnextroot.coffee:1:raw_corpus | raw_corpus | suite 'Navigation:', ->
test 'Prev/next/root', ->
eq(
xml('test5', { headless: true })
.e('node','1')
.up()
.e('node','element')
.up()
.e('node','2')
.prev()
.prev()
.att('prev','yes')
.next()
.next()
.att('next','yes')
... | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/prevnextroot.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/prevnextroot.coffee | 1 | 39 | ||
oozcitak/xmlbuilder-js:test/basic/prevnextroot.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
suite 'Navigation:', ->
test 'Prev/next/root', ->
eq(
xml('test5', { headless: true })
.e('node','1')
.up()
.e('node','element')
.up()
.e('node','2')
.prev()
.prev()
.att('prev','yes')
... | suite('Navigation:', function() {
test('Prev/next/root', function() {
return eq(xml('test5', {
headless: true
}).e('node', '1').up().e('node', 'element').up().e('node', '2').prev().prev().att('prev', 'yes').next().next().att('next', 'yes').root().att('root', 'yes').end(), '<test5 root="yes"><node prev="... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/basic/prevnextroot.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/prevnextroot.coffee | 1 | 39 |
oozcitak/xmlbuilder-js:test/basic/prevnextroot.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
suite('Navigation:', function() {
test('Prev/next/root', function() {
return eq(xml('test5', {
headless: true
}).e('node', '1').up().e('node', 'element').up().e('node', '2').prev().prev().att('prev', 'yes').next().next().att('next', 'yes').root().at... | suite 'Navigation:', ->
test 'Prev/next/root', ->
eq(
xml('test5', { headless: true })
.e('node','1')
.up()
.e('node','element')
.up()
.e('node','2')
.prev()
.prev()
.att('prev','yes')
.next()
.next()
.att('next','yes')
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/prevnextroot.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/prevnextroot.coffee | 1 | 39 |
oozcitak/xmlbuilder-js:test/basic/prevnextroot.coffee:1:completion | completion | suite 'Navigation:', ->
test 'Prev/next/root', ->
eq(
xml('test5', { headless: true })
.e('node','1')
.up()
.e('node','element')
.up()
.e('node','2')
.prev()
.prev()
.att('prev','yes')
.next()
.next()
.att('next','yes')
... | )
test 'up() in dtd', ->
eq(
xml('test', { headless: true }).dtd().com('internal subset').up().ele('node').end()
'<!DOCTYPE test [<!-- internal subset -->]>' +
'<test><node/></test>'
)
test 'doc() in element', ->
isan(
xml('test').ele('node').doc()
'XMLDocument'
)
... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/basic/prevnextroot.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/prevnextroot.coffee | 1 | 39 |
jianliaoim/talk-os:talk-api2x/server/middlewares/auth-guest.coffee:1:raw_corpus | raw_corpus | Err = require 'err1st'
jwt = require 'jsonwebtoken'
config = require 'config'
authGuest = (options = {}) ->
_authGuest = (req, res, callback = ->) ->
try
user = jwt.verify req.cookies[config.guestSessionKey], config.guestSessionSecret
catch err
return callback(new Err('NOT_LOGIN')) unless user?._... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/middlewares/auth-guest.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/middlewares/auth-guest.coffee | 1 | 16 | ||
jianliaoim/talk-os:talk-api2x/server/middlewares/auth-guest.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Err = require 'err1st'
jwt = require 'jsonwebtoken'
config = require 'config'
authGuest = (options = {}) ->
_authGuest = (req, res, callback = ->) ->
try
user = jwt.verify req.cookies[config.guestSessionKey], config.guestSessionSecret
catch err
... | var Err, authGuest, config, jwt;
Err = require('err1st');
jwt = require('jsonwebtoken');
config = require('config');
authGuest = function(options = {}) {
var _authGuest;
return _authGuest = function(req, res, callback = function() {}) {
var err, user;
try {
user = jwt.verify(req.cookies[config.gue... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/middlewares/auth-guest.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/middlewares/auth-guest.coffee | 1 | 16 |
jianliaoim/talk-os:talk-api2x/server/middlewares/auth-guest.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Err, authGuest, config, jwt;
Err = require('err1st');
jwt = require('jsonwebtoken');
config = require('config');
authGuest = function(options = {}) {
var _authGuest;
return _authGuest = function(req, res, callback = function() {}) {
var err, user;
... | Err = require 'err1st'
jwt = require 'jsonwebtoken'
config = require 'config'
authGuest = (options = {}) ->
_authGuest = (req, res, callback = ->) ->
try
user = jwt.verify req.cookies[config.guestSessionKey], config.guestSessionSecret
catch err
return callback(new Err('NOT_LOGIN')) unless user?._... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/middlewares/auth-guest.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/middlewares/auth-guest.coffee | 1 | 16 |
jianliaoim/talk-os:talk-api2x/server/middlewares/auth-guest.coffee:1:completion | completion | Err = require 'err1st'
jwt = require 'jsonwebtoken'
config = require 'config'
authGuest = (options = {}) ->
_authGuest = (req, res, callback = ->) ->
try | user = jwt.verify req.cookies[config.guestSessionKey], config.guestSessionSecret
catch err
return callback(new Err('NOT_LOGIN')) unless user?._id
req.set '_sessionUserId', user._id
callback()
module.exports = authGuest | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/middlewares/auth-guest.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/middlewares/auth-guest.coffee | 1 | 16 |
mojotech/pioneer:src/widgets/Widget.Fields.coffee:1:raw_corpus | raw_corpus | _ = require("lodash")
class @Widget.Fields extends @Widget
fillAll: (values) ->
@_map Object.keys(values), (f) => @fill({
selector: @_name(f)
value: values[f]
})
readAll: ->
_readAll = (f) =>
@read(@_name(f)).then (v) -> [f, v]
@_map(@fields, _readAll).then (read) ->
_.obj... | CoffeeScript | mojotech/pioneer | src/widgets/Widget.Fields.coffee | MIT | d13defb203540b07f186afb1ca31b5a4ed954b6e | 523 | https://github.com/mojotech/pioneer/blob/d13defb203540b07f186afb1ca31b5a4ed954b6e/src/widgets/Widget.Fields.coffee | 1 | 29 | ||
mojotech/pioneer:src/widgets/Widget.Fields.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require("lodash")
class @Widget.Fields extends @Widget
fillAll: (values) ->
@_map Object.keys(values), (f) => @fill({
selector: @_name(f)
value: values[f]
})
readAll: ->
_readAll = (f) =>
@read(@_name(f)).then (v) -> [f, v]... | var _;
_ = require("lodash");
this.Widget.Fields = class Fields extends this.Widget {
fillAll(values) {
return this._map(Object.keys(values), (f) => {
return this.fill({
selector: this._name(f),
value: values[f]
});
});
}
readAll() {
var _readAll;
_readAll = (f) => {... | CoffeeScript | JavaScript | mojotech/pioneer | src/widgets/Widget.Fields.coffee | MIT | d13defb203540b07f186afb1ca31b5a4ed954b6e | 523 | https://github.com/mojotech/pioneer/blob/d13defb203540b07f186afb1ca31b5a4ed954b6e/src/widgets/Widget.Fields.coffee | 1 | 29 |
mojotech/pioneer:src/widgets/Widget.Fields.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _;
_ = require("lodash");
this.Widget.Fields = class Fields extends this.Widget {
fillAll(values) {
return this._map(Object.keys(values), (f) => {
return this.fill({
selector: this._name(f),
value: values[f]
});
});
}
... | _ = require("lodash")
class @Widget.Fields extends @Widget
fillAll: (values) ->
@_map Object.keys(values), (f) => @fill({
selector: @_name(f)
value: values[f]
})
readAll: ->
_readAll = (f) =>
@read(@_name(f)).then (v) -> [f, v]
@_map(@fields, _readAll).then (read) ->
_.obj... | JavaScript | CoffeeScript | mojotech/pioneer | src/widgets/Widget.Fields.coffee | MIT | d13defb203540b07f186afb1ca31b5a4ed954b6e | 523 | https://github.com/mojotech/pioneer/blob/d13defb203540b07f186afb1ca31b5a4ed954b6e/src/widgets/Widget.Fields.coffee | 1 | 29 |
mojotech/pioneer:src/widgets/Widget.Fields.coffee:1:completion | completion | _ = require("lodash")
class @Widget.Fields extends @Widget
fillAll: (values) ->
@_map Object.keys(values), (f) => @fill({
selector: @_name(f)
value: values[f]
})
readAll: ->
_readAll = (f) =>
@read(@_name(f)).then (v) -> [f, v]
@_map(@fields, _readAll).then (read) -> | _.object(read)
_name: (name) ->
"[name='#{name}']"
_type: (type) ->
"[type='#{type}']"
_map: (collection, callback) ->
results = []
_reduce = (p, f, i) ->
p.then ->
callback(f, i).then (v) -> results.push(v)
_.reduce(collection, _reduce, Driver.promise.fulfilled())
.then... | CoffeeScript | CoffeeScript | mojotech/pioneer | src/widgets/Widget.Fields.coffee | MIT | d13defb203540b07f186afb1ca31b5a4ed954b6e | 523 | https://github.com/mojotech/pioneer/blob/d13defb203540b07f186afb1ca31b5a4ed954b6e/src/widgets/Widget.Fields.coffee | 1 | 29 |
mojotech/pioneer:src/widgets/Widget.Fields.coffee:1:raw_corpus | raw_corpus | class @Widget.Fields extends @Widget
fillAll: (values) ->
@_map Object.keys(values), (f) => @fill(@_name(f), values[f])
readAll: ->
_readAll = (f) =>
@read(@_name(f)).then (v) -> [f, v]
@_map(@fields, _readAll).then (read) ->
_.object(read)
_name: (name) ->
"[name='#{name}']"
_ty... | CoffeeScript | mojotech/pioneer | src/widgets/Widget.Fields.coffee | MIT | 013c1209adc4a8e8642ea1dd0bde34af4d7b468b | 523 | https://github.com/mojotech/pioneer/blob/013c1209adc4a8e8642ea1dd0bde34af4d7b468b/src/widgets/Widget.Fields.coffee | 1 | 16 | ||
mojotech/pioneer:src/widgets/Widget.Fields.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class @Widget.Fields extends @Widget
fillAll: (values) ->
@_map Object.keys(values), (f) => @fill(@_name(f), values[f])
readAll: ->
_readAll = (f) =>
@read(@_name(f)).then (v) -> [f, v]
@_map(@fields, _readAll).then (read) ->
_.objec... | this.Widget.Fields = class Fields extends this.Widget {
fillAll(values) {
return this._map(Object.keys(values), (f) => {
return this.fill(this._name(f), values[f]);
});
}
readAll() {
var _readAll;
_readAll = (f) => {
return this.read(this._name(f)).then(function(v) {
return [f... | CoffeeScript | JavaScript | mojotech/pioneer | src/widgets/Widget.Fields.coffee | MIT | 013c1209adc4a8e8642ea1dd0bde34af4d7b468b | 523 | https://github.com/mojotech/pioneer/blob/013c1209adc4a8e8642ea1dd0bde34af4d7b468b/src/widgets/Widget.Fields.coffee | 1 | 16 |
mojotech/pioneer:src/widgets/Widget.Fields.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.Widget.Fields = class Fields extends this.Widget {
fillAll(values) {
return this._map(Object.keys(values), (f) => {
return this.fill(this._name(f), values[f]);
});
}
readAll() {
var _readAll;
_readAll = (f) => {
return this.r... | class @Widget.Fields extends @Widget
fillAll: (values) ->
@_map Object.keys(values), (f) => @fill(@_name(f), values[f])
readAll: ->
_readAll = (f) =>
@read(@_name(f)).then (v) -> [f, v]
@_map(@fields, _readAll).then (read) ->
_.object(read)
_name: (name) ->
"[name='#{name}']"
_ty... | JavaScript | CoffeeScript | mojotech/pioneer | src/widgets/Widget.Fields.coffee | MIT | 013c1209adc4a8e8642ea1dd0bde34af4d7b468b | 523 | https://github.com/mojotech/pioneer/blob/013c1209adc4a8e8642ea1dd0bde34af4d7b468b/src/widgets/Widget.Fields.coffee | 1 | 16 |
mojotech/pioneer:src/widgets/Widget.Fields.coffee:1:completion | completion | class @Widget.Fields extends @Widget
fillAll: (values) ->
@_map Object.keys(values), (f) => @fill(@_name(f), values[f])
readAll: ->
_readAll = (f) =>
@read(@_name(f)).then (v) -> [f, v] | @_map(@fields, _readAll).then (read) ->
_.object(read)
_name: (name) ->
"[name='#{name}']"
_type: (type) ->
"[type='#{type}']" | CoffeeScript | CoffeeScript | mojotech/pioneer | src/widgets/Widget.Fields.coffee | MIT | 013c1209adc4a8e8642ea1dd0bde34af4d7b468b | 523 | https://github.com/mojotech/pioneer/blob/013c1209adc4a8e8642ea1dd0bde34af4d7b468b/src/widgets/Widget.Fields.coffee | 1 | 16 |
mojotech/pioneer:src/widgets/Widget.Fields.coffee:1:raw_corpus | raw_corpus | class @Widget.Fields extends @Widget
fillAll: (values) ->
@_map @fields, (f) => @fill(@_name(f), values[f])
readAll: ->
_readAll = (f) =>
@read(@_name(f)).then (v) -> [f, v]
@_map(@fields, _readAll).then (read) ->
_.object(read)
_name: (name) ->
"[name='#{name}']"
_type: (type) -... | CoffeeScript | mojotech/pioneer | src/widgets/Widget.Fields.coffee | MIT | 8893d83821a43a751c37e44c703da32e4fd16fc6 | 523 | https://github.com/mojotech/pioneer/blob/8893d83821a43a751c37e44c703da32e4fd16fc6/src/widgets/Widget.Fields.coffee | 1 | 16 | ||
mojotech/pioneer:src/widgets/Widget.Fields.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class @Widget.Fields extends @Widget
fillAll: (values) ->
@_map @fields, (f) => @fill(@_name(f), values[f])
readAll: ->
_readAll = (f) =>
@read(@_name(f)).then (v) -> [f, v]
@_map(@fields, _readAll).then (read) ->
_.object(read)
_... | this.Widget.Fields = class Fields extends this.Widget {
fillAll(values) {
return this._map(this.fields, (f) => {
return this.fill(this._name(f), values[f]);
});
}
readAll() {
var _readAll;
_readAll = (f) => {
return this.read(this._name(f)).then(function(v) {
return [f, v];
... | CoffeeScript | JavaScript | mojotech/pioneer | src/widgets/Widget.Fields.coffee | MIT | 8893d83821a43a751c37e44c703da32e4fd16fc6 | 523 | https://github.com/mojotech/pioneer/blob/8893d83821a43a751c37e44c703da32e4fd16fc6/src/widgets/Widget.Fields.coffee | 1 | 16 |
mojotech/pioneer:src/widgets/Widget.Fields.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.Widget.Fields = class Fields extends this.Widget {
fillAll(values) {
return this._map(this.fields, (f) => {
return this.fill(this._name(f), values[f]);
});
}
readAll() {
var _readAll;
_readAll = (f) => {
return this.read(this... | class @Widget.Fields extends @Widget
fillAll: (values) ->
@_map @fields, (f) => @fill(@_name(f), values[f])
readAll: ->
_readAll = (f) =>
@read(@_name(f)).then (v) -> [f, v]
@_map(@fields, _readAll).then (read) ->
_.object(read)
_name: (name) ->
"[name='#{name}']"
_type: (type) -... | JavaScript | CoffeeScript | mojotech/pioneer | src/widgets/Widget.Fields.coffee | MIT | 8893d83821a43a751c37e44c703da32e4fd16fc6 | 523 | https://github.com/mojotech/pioneer/blob/8893d83821a43a751c37e44c703da32e4fd16fc6/src/widgets/Widget.Fields.coffee | 1 | 16 |
mojotech/pioneer:src/widgets/Widget.Fields.coffee:1:completion | completion | class @Widget.Fields extends @Widget
fillAll: (values) ->
@_map @fields, (f) => @fill(@_name(f), values[f])
readAll: ->
_readAll = (f) =>
@read(@_name(f)).then (v) -> [f, v] | @_map(@fields, _readAll).then (read) ->
_.object(read)
_name: (name) ->
"[name='#{name}']"
_type: (type) ->
"[type='#{type}']" | CoffeeScript | CoffeeScript | mojotech/pioneer | src/widgets/Widget.Fields.coffee | MIT | 8893d83821a43a751c37e44c703da32e4fd16fc6 | 523 | https://github.com/mojotech/pioneer/blob/8893d83821a43a751c37e44c703da32e4fd16fc6/src/widgets/Widget.Fields.coffee | 1 | 16 |
ichord/At.js:src/editableController.coffee:1:raw_corpus | raw_corpus | class EditableController extends Controller
_getRange: ->
sel = @app.window.getSelection()
sel.getRangeAt(0) if sel.rangeCount > 0
_setRange: (position, node, range=@_getRange()) ->
return unless range and node
node = $(node)[0]
if position == 'after'
range.setEndAfter node
range.s... | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/editableController.coffee | 1 | 50 | ||
ichord/At.js:src/editableController.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class EditableController extends Controller
_getRange: ->
sel = @app.window.getSelection()
sel.getRangeAt(0) if sel.rangeCount > 0
_setRange: (position, node, range=@_getRange()) ->
return unless range and node
node = $(node)[0]
if posit... | var EditableController;
EditableController = class EditableController extends Controller {
_getRange() {
var sel;
sel = this.app.window.getSelection();
if (sel.rangeCount > 0) {
return sel.getRangeAt(0);
}
}
_setRange(position, node, range = this._getRange()) {
if (!(range && node)) {
... | CoffeeScript | JavaScript | ichord/At.js | src/editableController.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/editableController.coffee | 1 | 50 |
ichord/At.js:src/editableController.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var EditableController;
EditableController = class EditableController extends Controller {
_getRange() {
var sel;
sel = this.app.window.getSelection();
if (sel.rangeCount > 0) {
return sel.getRangeAt(0);
}
}
_setRange(position, node, r... | class EditableController extends Controller
_getRange: ->
sel = @app.window.getSelection()
sel.getRangeAt(0) if sel.rangeCount > 0
_setRange: (position, node, range=@_getRange()) ->
return unless range and node
node = $(node)[0]
if position == 'after'
range.setEndAfter node
range.s... | JavaScript | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/editableController.coffee | 1 | 50 |
ichord/At.js:src/editableController.coffee:1:completion | completion | class EditableController extends Controller
_getRange: ->
sel = @app.window.getSelection()
sel.getRangeAt(0) if sel.rangeCount > 0
_setRange: (position, node, range=@_getRange()) ->
return unless range and node
node = $(node)[0]
if position == 'after'
range.setEndAfter node
range.s... | _movingEvent: (e) ->
e.type == 'click' or e.which in [KEY_CODE.RIGHT, KEY_CODE.LEFT, KEY_CODE.UP, KEY_CODE.DOWN]
_unwrap: (node) ->
node = $(node).unwrap().get 0
if (next = node.nextSibling) and next.nodeValue
node.nodeValue += next.nodeValue
$(next).remove()
node
catchQuery: (e) ->
... | CoffeeScript | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/editableController.coffee | 1 | 50 |
ichord/At.js:src/editableController.coffee:2:raw_corpus | raw_corpus | # The range at the end of an element is not inside in firefox but not others browsers including IE.
# To normolize them, we have to move the range inside the element while deleting content or moving caret right after .atwho-inserted
if /firefox/i.test(navigator.userAgent)
if $(range.startContainer).is @$i... | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/editableController.coffee | 51 | 100 | ||
ichord/At.js:src/editableController.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# The range at the end of an element is not inside in firefox but not others browsers including IE.
# To normolize them, we have to move the range inside the element while deleting content or moving caret right after .atwho-inserted
if /firefox/i.test(nav... | // The range at the end of an element is not inside in firefox but not others browsers including IE.
// To normolize them, we have to move the range inside the element while deleting content or moving caret right after .atwho-inserted
var $inserted, $query, _range, inserted, isString, matched, offset, query_content;
i... | CoffeeScript | JavaScript | ichord/At.js | src/editableController.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/editableController.coffee | 51 | 100 |
ichord/At.js:src/editableController.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// The range at the end of an element is not inside in firefox but not others browsers including IE.
// To normolize them, we have to move the range inside the element while deleting content or moving caret right after .atwho-inserted
var $inserted, $query, _range,... | # The range at the end of an element is not inside in firefox but not others browsers including IE.
# To normolize them, we have to move the range inside the element while deleting content or moving caret right after .atwho-inserted
if /firefox/i.test(navigator.userAgent)
if $(range.startContainer).is @$i... | JavaScript | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/editableController.coffee | 51 | 100 |
ichord/At.js:src/editableController.coffee:2:completion | completion | # The range at the end of an element is not inside in firefox but not others browsers including IE.
# To normolize them, we have to move the range inside the element while deleting content or moving caret right after .atwho-inserted
if /firefox/i.test(navigator.userAgent)
if $(range.startContainer).is @$i... | and $query.is(':empty') and $query.text().length == 0
$query.remove()
if not @_movingEvent e
$query.removeClass 'atwho-inserted'
if $query.length > 0
switch e.which
when KEY_CODE.LEFT
@_setRange 'before', $query.get(0), range
$query.removeClass 'atwho-query'
... | CoffeeScript | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/editableController.coffee | 51 | 100 |
ichord/At.js:src/editableController.coffee:3:raw_corpus | raw_corpus | # wrapping query with .atwho-query
if $query.length == 0 and isString \
and (index = range.startOffset - @at.length - matched.length) >= 0
range.setStart range.startContainer, index
$query = $ '<span/>', @app.document
.attr @getOpt "editableAtwhoQueryAttrs"
.addClass 'atwho-query... | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/editableController.coffee | 101 | 150 | ||
ichord/At.js:src/editableController.coffee:3:completion | completion | # wrapping query with .atwho-query
if $query.length == 0 and isString \
and (index = range.startOffset - @at.length - matched.length) >= 0
range.setStart range.startContainer, index
$query = $ '<span/>', @app.document
.attr @getOpt "editableAtwhoQueryAttrs"
.addClass 'atwho-query... | else
@view.hide()
@query = el: $query
if $query.text().indexOf(this.at) >= 0
if @_movingEvent(e) and $query.hasClass 'atwho-inserted'
$query.removeClass('atwho-query')
else if false != @callbacks('afterMatchFailed').call this, @at, $query
@_setRange "after", @_unwra... | CoffeeScript | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/editableController.coffee | 101 | 150 |
ichord/At.js:src/editableController.coffee:4:raw_corpus | raw_corpus | # Insert value of `data-value` attribute of chosen item into inputor
#
# @param content [String] string to insert
insert: (content, $li) ->
@$inputor.focus() unless @$inputor.is ':focus'
overrides = @getOpt 'functionOverrides'
if overrides.insert
return overrides.insert.call this, content, $li
... | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/editableController.coffee | 151 | 174 | ||
ichord/At.js:src/editableController.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Insert value of `data-value` attribute of chosen item into inputor
#
# @param content [String] string to insert
insert: (content, $li) ->
@$inputor.focus() unless @$inputor.is ':focus'
overrides = @getOpt 'functionOverrides'
if overrides.inser... | // Insert value of `data-value` attribute of chosen item into inputor
// @param content [String] string to insert
({
insert: function(content, $li) {
var data, overrides, range, suffix, suffixNode;
if (!this.$inputor.is(':focus')) {
this.$inputor.focus();
}
overrides = this.getOpt('functionOver... | CoffeeScript | JavaScript | ichord/At.js | src/editableController.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/editableController.coffee | 151 | 174 |
ichord/At.js:src/editableController.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Insert value of `data-value` attribute of chosen item into inputor
// @param content [String] string to insert
({
insert: function(content, $li) {
var data, overrides, range, suffix, suffixNode;
if (!this.$inputor.is(':focus')) {
this.$inputor.f... | # Insert value of `data-value` attribute of chosen item into inputor
#
# @param content [String] string to insert
insert: (content, $li) ->
@$inputor.focus() unless @$inputor.is ':focus'
overrides = @getOpt 'functionOverrides'
if overrides.insert
return overrides.insert.call this, content, $li
... | JavaScript | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/editableController.coffee | 151 | 174 |
ichord/At.js:src/editableController.coffee:4:completion | completion | # Insert value of `data-value` attribute of chosen item into inputor
#
# @param content [String] string to insert
insert: (content, $li) ->
@$inputor.focus() unless @$inputor.is ':focus'
overrides = @getOpt 'functionOverrides'
if overrides.insert
return overrides.insert.call this, content, $li
... | .addClass 'atwho-inserted'
.html content
.attr 'data-atwho-at-query', "" + data['atwho-at'] + @query.text
.attr 'contenteditable', "false"
if range = @_getRange()
if @query.el.length
range.setEndAfter @query.el[0]
range.collapse false
range.insertNode suffixNode = @app.do... | CoffeeScript | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | a627b5fcac22c35d52b7fb6d8a93181d2546f3c0 | 5,250 | https://github.com/ichord/At.js/blob/a627b5fcac22c35d52b7fb6d8a93181d2546f3c0/src/editableController.coffee | 151 | 174 |
ichord/At.js:src/editableController.coffee:3:raw_corpus | raw_corpus | # wrapping query with .atwho-query
if $query.length == 0 and isString \
and (index = range.startOffset - @at.length - matched.length) >= 0
range.setStart range.startContainer, index
$query = $ '<span/>', @app.document
.attr @getOpt "editableAtwhoQueryAttrs"
.addClass 'atwho-query... | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | 045fa58788ad71bc74a28640f63436eea1595095 | 5,250 | https://github.com/ichord/At.js/blob/045fa58788ad71bc74a28640f63436eea1595095/src/editableController.coffee | 101 | 150 | ||
ichord/At.js:src/editableController.coffee:3:completion | completion | # wrapping query with .atwho-query
if $query.length == 0 and isString \
and (index = range.startOffset - @at.length - matched.length) >= 0
range.setStart range.startContainer, index
$query = $ '<span/>', @app.document
.attr @getOpt "editableAtwhoQueryAttrs"
.addClass 'atwho-query... | else
@view.hide()
@query = el: $query
if $query.text().indexOf(this.at) >= 0
if @_movingEvent(e) and $query.hasClass 'atwho-inserted'
$query.removeClass('atwho-query')
else if false != @callbacks('afterMatchFailed').call this, @at, $query
@_setRange "after", @_unwra... | CoffeeScript | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | 045fa58788ad71bc74a28640f63436eea1595095 | 5,250 | https://github.com/ichord/At.js/blob/045fa58788ad71bc74a28640f63436eea1595095/src/editableController.coffee | 101 | 150 |
ichord/At.js:src/editableController.coffee:4:raw_corpus | raw_corpus | # @param content [String] string to insert
insert: (content, $li) ->
@$inputor.focus() unless @$inputor.is ':focus'
overrides = @getOpt 'functionOverrides'
if overrides.insert
return overrides.insert.call this, content, $li
suffix = if (suffix = @getOpt 'suffix') == "" then suffix else suffix or... | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | 045fa58788ad71bc74a28640f63436eea1595095 | 5,250 | https://github.com/ichord/At.js/blob/045fa58788ad71bc74a28640f63436eea1595095/src/editableController.coffee | 151 | 172 | ||
ichord/At.js:src/editableController.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# @param content [String] string to insert
insert: (content, $li) ->
@$inputor.focus() unless @$inputor.is ':focus'
overrides = @getOpt 'functionOverrides'
if overrides.insert
return overrides.insert.call this, content, $li
suffix = if (su... | // @param content [String] string to insert
({
insert: function(content, $li) {
var data, overrides, range, suffix, suffixNode;
if (!this.$inputor.is(':focus')) {
this.$inputor.focus();
}
overrides = this.getOpt('functionOverrides');
if (overrides.insert) {
return overrides.insert.call... | CoffeeScript | JavaScript | ichord/At.js | src/editableController.coffee | MIT | 045fa58788ad71bc74a28640f63436eea1595095 | 5,250 | https://github.com/ichord/At.js/blob/045fa58788ad71bc74a28640f63436eea1595095/src/editableController.coffee | 151 | 172 |
ichord/At.js:src/editableController.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// @param content [String] string to insert
({
insert: function(content, $li) {
var data, overrides, range, suffix, suffixNode;
if (!this.$inputor.is(':focus')) {
this.$inputor.focus();
}
overrides = this.getOpt('functionOverrides');
if ... | # @param content [String] string to insert
insert: (content, $li) ->
@$inputor.focus() unless @$inputor.is ':focus'
overrides = @getOpt 'functionOverrides'
if overrides.insert
return overrides.insert.call this, content, $li
suffix = if (suffix = @getOpt 'suffix') == "" then suffix else suffix or... | JavaScript | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | 045fa58788ad71bc74a28640f63436eea1595095 | 5,250 | https://github.com/ichord/At.js/blob/045fa58788ad71bc74a28640f63436eea1595095/src/editableController.coffee | 151 | 172 |
ichord/At.js:src/editableController.coffee:4:completion | completion | # @param content [String] string to insert
insert: (content, $li) ->
@$inputor.focus() unless @$inputor.is ':focus'
overrides = @getOpt 'functionOverrides'
if overrides.insert
return overrides.insert.call this, content, $li
suffix = if (suffix = @getOpt 'suffix') == "" then suffix else suffix or... | .html content
.attr 'data-atwho-at-query', "" + data['atwho-at'] + @query.text
.attr 'contenteditable', "false"
if range = @_getRange()
if @query.el.length
range.setEndAfter @query.el[0]
range.collapse false
range.insertNode suffixNode = @app.document.createTextNode "" + suffix... | CoffeeScript | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | 045fa58788ad71bc74a28640f63436eea1595095 | 5,250 | https://github.com/ichord/At.js/blob/045fa58788ad71bc74a28640f63436eea1595095/src/editableController.coffee | 151 | 172 |
ichord/At.js:src/editableController.coffee:4:raw_corpus | raw_corpus | # @param content [String] string to insert
insert: (content, $li) ->
@$inputor.focus() unless @$inputor.is ':focus'
suffix = if (suffix = @getOpt 'suffix') == "" then suffix else suffix or "\u00A0"
data = $li.data('item-data')
@query.el
.removeClass 'atwho-query'
.addClass 'atwho-inserted'... | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | d6dba688e8279904351bc1cc30bbe99f6536e4e9 | 5,250 | https://github.com/ichord/At.js/blob/d6dba688e8279904351bc1cc30bbe99f6536e4e9/src/editableController.coffee | 151 | 168 | ||
ichord/At.js:src/editableController.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# @param content [String] string to insert
insert: (content, $li) ->
@$inputor.focus() unless @$inputor.is ':focus'
suffix = if (suffix = @getOpt 'suffix') == "" then suffix else suffix or "\u00A0"
data = $li.data('item-data')
@query.el
.r... | // @param content [String] string to insert
({
insert: function(content, $li) {
var data, range, suffix, suffixNode;
if (!this.$inputor.is(':focus')) {
this.$inputor.focus();
}
suffix = (suffix = this.getOpt('suffix')) === "" ? suffix : suffix || "\u00A0";
data = $li.data('item-data');
t... | CoffeeScript | JavaScript | ichord/At.js | src/editableController.coffee | MIT | d6dba688e8279904351bc1cc30bbe99f6536e4e9 | 5,250 | https://github.com/ichord/At.js/blob/d6dba688e8279904351bc1cc30bbe99f6536e4e9/src/editableController.coffee | 151 | 168 |
ichord/At.js:src/editableController.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// @param content [String] string to insert
({
insert: function(content, $li) {
var data, range, suffix, suffixNode;
if (!this.$inputor.is(':focus')) {
this.$inputor.focus();
}
suffix = (suffix = this.getOpt('suffix')) === "" ? suffix : suff... | # @param content [String] string to insert
insert: (content, $li) ->
@$inputor.focus() unless @$inputor.is ':focus'
suffix = if (suffix = @getOpt 'suffix') == "" then suffix else suffix or "\u00A0"
data = $li.data('item-data')
@query.el
.removeClass 'atwho-query'
.addClass 'atwho-inserted'... | JavaScript | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | d6dba688e8279904351bc1cc30bbe99f6536e4e9 | 5,250 | https://github.com/ichord/At.js/blob/d6dba688e8279904351bc1cc30bbe99f6536e4e9/src/editableController.coffee | 151 | 168 |
ichord/At.js:src/editableController.coffee:4:completion | completion | # @param content [String] string to insert
insert: (content, $li) ->
@$inputor.focus() unless @$inputor.is ':focus'
suffix = if (suffix = @getOpt 'suffix') == "" then suffix else suffix or "\u00A0"
data = $li.data('item-data')
@query.el
.removeClass 'atwho-query'
.addClass 'atwho-inserted'... | .attr 'data-atwho-at-query', "" + data['atwho-at'] + @query.text
if range = @_getRange()
if @query.el.length
range.setEndAfter @query.el[0]
range.collapse false
range.insertNode suffixNode = @app.document.createTextNode "\u200D" + suffix
@_setRange 'after', suffixNode, range
@$in... | CoffeeScript | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | d6dba688e8279904351bc1cc30bbe99f6536e4e9 | 5,250 | https://github.com/ichord/At.js/blob/d6dba688e8279904351bc1cc30bbe99f6536e4e9/src/editableController.coffee | 151 | 168 |
ichord/At.js:src/editableController.coffee:1:raw_corpus | raw_corpus | class EditableController extends Controller
_getRange: ->
sel = @app.window.getSelection()
sel.getRangeAt(0) if sel.rangeCount > 0
_setRange: (position, node, range=@_getRange()) ->
return unless range
node = $(node)[0]
if position == 'after'
range.setEndAfter node
range.setStartAf... | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | 5374211c21e7080d8bb8c5fffaf9e5e33384f944 | 5,250 | https://github.com/ichord/At.js/blob/5374211c21e7080d8bb8c5fffaf9e5e33384f944/src/editableController.coffee | 1 | 50 | ||
ichord/At.js:src/editableController.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class EditableController extends Controller
_getRange: ->
sel = @app.window.getSelection()
sel.getRangeAt(0) if sel.rangeCount > 0
_setRange: (position, node, range=@_getRange()) ->
return unless range
node = $(node)[0]
if position == 'a... | var EditableController;
EditableController = class EditableController extends Controller {
_getRange() {
var sel;
sel = this.app.window.getSelection();
if (sel.rangeCount > 0) {
return sel.getRangeAt(0);
}
}
_setRange(position, node, range = this._getRange()) {
if (!range) {
retu... | CoffeeScript | JavaScript | ichord/At.js | src/editableController.coffee | MIT | 5374211c21e7080d8bb8c5fffaf9e5e33384f944 | 5,250 | https://github.com/ichord/At.js/blob/5374211c21e7080d8bb8c5fffaf9e5e33384f944/src/editableController.coffee | 1 | 50 |
ichord/At.js:src/editableController.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var EditableController;
EditableController = class EditableController extends Controller {
_getRange() {
var sel;
sel = this.app.window.getSelection();
if (sel.rangeCount > 0) {
return sel.getRangeAt(0);
}
}
_setRange(position, node, r... | class EditableController extends Controller
_getRange: ->
sel = @app.window.getSelection()
sel.getRangeAt(0) if sel.rangeCount > 0
_setRange: (position, node, range=@_getRange()) ->
return unless range
node = $(node)[0]
if position == 'after'
range.setEndAfter node
range.setStartAf... | JavaScript | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | 5374211c21e7080d8bb8c5fffaf9e5e33384f944 | 5,250 | https://github.com/ichord/At.js/blob/5374211c21e7080d8bb8c5fffaf9e5e33384f944/src/editableController.coffee | 1 | 50 |
ichord/At.js:src/editableController.coffee:1:completion | completion | class EditableController extends Controller
_getRange: ->
sel = @app.window.getSelection()
sel.getRangeAt(0) if sel.rangeCount > 0
_setRange: (position, node, range=@_getRange()) ->
return unless range
node = $(node)[0]
if position == 'after'
range.setEndAfter node
range.setStartAf... | _movingEvent: (e) ->
e.type == 'click' or e.which in [KEY_CODE.RIGHT, KEY_CODE.LEFT, KEY_CODE.UP, KEY_CODE.DOWN]
_unwrap: (node) ->
node = $(node).unwrap().get 0
if (next = node.nextSibling) and next.nodeValue
node.nodeValue += next.nodeValue
$(next).remove()
node
catchQuery: (e) ->
... | CoffeeScript | CoffeeScript | ichord/At.js | src/editableController.coffee | MIT | 5374211c21e7080d8bb8c5fffaf9e5e33384f944 | 5,250 | https://github.com/ichord/At.js/blob/5374211c21e7080d8bb8c5fffaf9e5e33384f944/src/editableController.coffee | 1 | 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.