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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kelp404/angular-form-builder:src/controller.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# fbBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $injector.get '$... | var a, fbBuilderController, fbComponentsController, fbFormController;
a = angular.module('builder.controller', ['builder.provider']);
// ----------------------------------------
// fbBuilderController
// ----------------------------------------
fbBuilderController = function($scope, $injector) {
var $builder;
// ... | CoffeeScript | JavaScript | kelp404/angular-form-builder | src/controller.coffee | MIT | de64f93b3df286595758ec05cb50f1fd543a1ea2 | 600 | https://github.com/kelp404/angular-form-builder/blob/de64f93b3df286595758ec05cb50f1fd543a1ea2/src/controller.coffee | 1 | 45 |
kelp404/angular-form-builder:src/controller.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var a, fbBuilderController, fbComponentsController, fbFormController;
a = angular.module('builder.controller', ['builder.provider']);
// ----------------------------------------
// fbBuilderController
// ----------------------------------------
fbBuilderControlle... | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# fbBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
fbBuilderController.$inject = ['$scope', '$inje... | JavaScript | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | de64f93b3df286595758ec05cb50f1fd543a1ea2 | 600 | https://github.com/kelp404/angular-form-builder/blob/de64f93b3df286595758ec05cb50f1fd543a1ea2/src/controller.coffee | 1 | 45 |
kelp404/angular-form-builder:src/controller.coffee:1:completion | completion | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# fbBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
fbBuilderController.$inject = ['$scope', '$inje... | # status
$scope.status =
activeGroup: $scope.groups[0]
# action
$scope.action =
selectGroup: ($event, group) ->
$event.preventDefault()
$scope.status.activeGroup = group
fbComponentsController.$inject = ['$scope', '$injector']
a.controller 'fbComponentsController', ... | CoffeeScript | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | de64f93b3df286595758ec05cb50f1fd543a1ea2 | 600 | https://github.com/kelp404/angular-form-builder/blob/de64f93b3df286595758ec05cb50f1fd543a1ea2/src/controller.coffee | 1 | 45 |
kelp404/angular-form-builder:src/controller.coffee:1:raw_corpus | raw_corpus | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# fbBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
fbBuilderController.$inject = ['$scope', '$inje... | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 2b56178051d0fbd3d1622ef463c55fbb941504e7 | 600 | https://github.com/kelp404/angular-form-builder/blob/2b56178051d0fbd3d1622ef463c55fbb941504e7/src/controller.coffee | 1 | 45 | ||
kelp404/angular-form-builder:src/controller.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# fbBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $injector.get '$... | var a, fbBuilderController, fbComponentsController, fbFormController;
a = angular.module('builder.controller', ['builder.provider']);
// ----------------------------------------
// fbBuilderController
// ----------------------------------------
fbBuilderController = function($scope, $injector) {
var $builder;
// ... | CoffeeScript | JavaScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 2b56178051d0fbd3d1622ef463c55fbb941504e7 | 600 | https://github.com/kelp404/angular-form-builder/blob/2b56178051d0fbd3d1622ef463c55fbb941504e7/src/controller.coffee | 1 | 45 |
kelp404/angular-form-builder:src/controller.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var a, fbBuilderController, fbComponentsController, fbFormController;
a = angular.module('builder.controller', ['builder.provider']);
// ----------------------------------------
// fbBuilderController
// ----------------------------------------
fbBuilderControlle... | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# fbBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
fbBuilderController.$inject = ['$scope', '$inje... | JavaScript | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 2b56178051d0fbd3d1622ef463c55fbb941504e7 | 600 | https://github.com/kelp404/angular-form-builder/blob/2b56178051d0fbd3d1622ef463c55fbb941504e7/src/controller.coffee | 1 | 45 |
kelp404/angular-form-builder:src/controller.coffee:1:completion | completion | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# fbBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
fbBuilderController.$inject = ['$scope', '$inje... | # status
$scope.status =
activeGroup: $scope.groups[0]
# action
$scope.action =
selectGroup: ($event, group) ->
$event.preventDefault()
$scope.status.activeGroup = group
fbComponentsController.$inject = ['$scope', '$injector']
a.controller 'fbComponentsController', ... | CoffeeScript | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 2b56178051d0fbd3d1622ef463c55fbb941504e7 | 600 | https://github.com/kelp404/angular-form-builder/blob/2b56178051d0fbd3d1622ef463c55fbb941504e7/src/controller.coffee | 1 | 45 |
kelp404/angular-form-builder:src/controller.coffee:1:raw_corpus | raw_corpus | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
fbBuilderController.$inject = ['$scope... | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 3bbc55b495f6cbc265ba43c051c7b2788ca96f5f | 600 | https://github.com/kelp404/angular-form-builder/blob/3bbc55b495f6cbc265ba43c051c7b2788ca96f5f/src/controller.coffee | 1 | 35 | ||
kelp404/angular-form-builder:src/controller.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $inject... | var a, fbBuilderController, fbComponentsController;
a = angular.module('builder.controller', ['builder.provider']);
// ----------------------------------------
// FormBuilderBuilderController
// ----------------------------------------
fbBuilderController = function($scope, $injector) {
var $builder;
// providers... | CoffeeScript | JavaScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 3bbc55b495f6cbc265ba43c051c7b2788ca96f5f | 600 | https://github.com/kelp404/angular-form-builder/blob/3bbc55b495f6cbc265ba43c051c7b2788ca96f5f/src/controller.coffee | 1 | 35 |
kelp404/angular-form-builder:src/controller.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var a, fbBuilderController, fbComponentsController;
a = angular.module('builder.controller', ['builder.provider']);
// ----------------------------------------
// FormBuilderBuilderController
// ----------------------------------------
fbBuilderController = funct... | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
fbBuilderController.$inject = ['$scope... | JavaScript | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 3bbc55b495f6cbc265ba43c051c7b2788ca96f5f | 600 | https://github.com/kelp404/angular-form-builder/blob/3bbc55b495f6cbc265ba43c051c7b2788ca96f5f/src/controller.coffee | 1 | 35 |
kelp404/angular-form-builder:src/controller.coffee:1:completion | completion | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
fbBuilderController.$inject = ['$scope... | $builder = $injector.get '$builder'
# data
$scope.groups = $builder.groups
$scope.components = $builder.componentsArray
# status
$scope.status =
activeGroup: $scope.groups[0]
# action
$scope.action =
selectGroup: ($event, group) ->
$event.preventDefault()
... | CoffeeScript | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 3bbc55b495f6cbc265ba43c051c7b2788ca96f5f | 600 | https://github.com/kelp404/angular-form-builder/blob/3bbc55b495f6cbc265ba43c051c7b2788ca96f5f/src/controller.coffee | 1 | 35 |
kelp404/angular-form-builder:src/controller.coffee:1:raw_corpus | raw_corpus | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
# data
# $scope.formName
fbBu... | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 62a11b845e439aa5a6010d492497b83139c4347a | 600 | https://github.com/kelp404/angular-form-builder/blob/62a11b845e439aa5a6010d492497b83139c4347a/src/controller.coffee | 1 | 38 | ||
kelp404/angular-form-builder:src/controller.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $inject... | var a, fbBuilderController, fbComponentsController;
a = angular.module('builder.controller', ['builder.provider']);
// ----------------------------------------
// FormBuilderBuilderController
// ----------------------------------------
fbBuilderController = function($scope, $injector) {
var $builder;
// providers... | CoffeeScript | JavaScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 62a11b845e439aa5a6010d492497b83139c4347a | 600 | https://github.com/kelp404/angular-form-builder/blob/62a11b845e439aa5a6010d492497b83139c4347a/src/controller.coffee | 1 | 38 |
kelp404/angular-form-builder:src/controller.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var a, fbBuilderController, fbComponentsController;
a = angular.module('builder.controller', ['builder.provider']);
// ----------------------------------------
// FormBuilderBuilderController
// ----------------------------------------
fbBuilderController = funct... | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
# data
# $scope.formName
fbBu... | JavaScript | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 62a11b845e439aa5a6010d492497b83139c4347a | 600 | https://github.com/kelp404/angular-form-builder/blob/62a11b845e439aa5a6010d492497b83139c4347a/src/controller.coffee | 1 | 38 |
kelp404/angular-form-builder:src/controller.coffee:1:completion | completion | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderBuilderController
# ----------------------------------------
fbBuilderController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
# data
# $scope.formName
fbBu... | # providers
$builder = $injector.get '$builder'
# data
$scope.groups = $builder.groups
$scope.components = $builder.componentsArray
# status
$scope.status =
activeGroup: $scope.groups[0]
# action
$scope.action =
selectGroup: ($event, group) ->
$event.preven... | CoffeeScript | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 62a11b845e439aa5a6010d492497b83139c4347a | 600 | https://github.com/kelp404/angular-form-builder/blob/62a11b845e439aa5a6010d492497b83139c4347a/src/controller.coffee | 1 | 38 |
kelp404/angular-form-builder:src/controller.coffee:1:raw_corpus | raw_corpus | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderComponentsController
# ----------------------------------------
fbComponentsController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
# data
$scope.groups = $... | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 3ea57f9aaf487018a395c5963d1a33b3445eca9c | 600 | https://github.com/kelp404/angular-form-builder/blob/3ea57f9aaf487018a395c5963d1a33b3445eca9c/src/controller.coffee | 1 | 25 | ||
kelp404/angular-form-builder:src/controller.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderComponentsController
# ----------------------------------------
fbComponentsController = ($scope, $injector) ->
# providers
$builder = $... | var a, fbComponentsController;
a = angular.module('builder.controller', ['builder.provider']);
// ----------------------------------------
// FormBuilderComponentsController
// ----------------------------------------
fbComponentsController = function($scope, $injector) {
var $builder;
// providers
$builder = $... | CoffeeScript | JavaScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 3ea57f9aaf487018a395c5963d1a33b3445eca9c | 600 | https://github.com/kelp404/angular-form-builder/blob/3ea57f9aaf487018a395c5963d1a33b3445eca9c/src/controller.coffee | 1 | 25 |
kelp404/angular-form-builder:src/controller.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var a, fbComponentsController;
a = angular.module('builder.controller', ['builder.provider']);
// ----------------------------------------
// FormBuilderComponentsController
// ----------------------------------------
fbComponentsController = function($scope, $in... | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderComponentsController
# ----------------------------------------
fbComponentsController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
# data
$scope.groups = $... | JavaScript | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 3ea57f9aaf487018a395c5963d1a33b3445eca9c | 600 | https://github.com/kelp404/angular-form-builder/blob/3ea57f9aaf487018a395c5963d1a33b3445eca9c/src/controller.coffee | 1 | 25 |
kelp404/angular-form-builder:src/controller.coffee:1:completion | completion | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderComponentsController
# ----------------------------------------
fbComponentsController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
# data
$scope.groups = $... | # status
$scope.status =
activeGroup: $scope.groups[0]
# action
$scope.action =
selectGroup: ($event, group) ->
$event.preventDefault()
$scope.status.activeGroup = group
fbComponentsController.$inject = ['$scope', '$injector']
a.controller 'fbComponentsController', ... | CoffeeScript | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 3ea57f9aaf487018a395c5963d1a33b3445eca9c | 600 | https://github.com/kelp404/angular-form-builder/blob/3ea57f9aaf487018a395c5963d1a33b3445eca9c/src/controller.coffee | 1 | 25 |
kelp404/angular-form-builder:src/controller.coffee:1:raw_corpus | raw_corpus | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderComponentsController
# ----------------------------------------
fbComponentsController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
# data
$scope.groups = $... | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 38fb4824fa33c5079f3a3e1623317d9a26c31fef | 600 | https://github.com/kelp404/angular-form-builder/blob/38fb4824fa33c5079f3a3e1623317d9a26c31fef/src/controller.coffee | 1 | 25 | ||
kelp404/angular-form-builder:src/controller.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderComponentsController
# ----------------------------------------
fbComponentsController = ($scope, $injector) ->
# providers
$builder = $... | var a, fbComponentsController;
a = angular.module('builder.controller', ['builder.provider']);
// ----------------------------------------
// FormBuilderComponentsController
// ----------------------------------------
fbComponentsController = function($scope, $injector) {
var $builder, key, value;
// providers
... | CoffeeScript | JavaScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 38fb4824fa33c5079f3a3e1623317d9a26c31fef | 600 | https://github.com/kelp404/angular-form-builder/blob/38fb4824fa33c5079f3a3e1623317d9a26c31fef/src/controller.coffee | 1 | 25 |
kelp404/angular-form-builder:src/controller.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var a, fbComponentsController;
a = angular.module('builder.controller', ['builder.provider']);
// ----------------------------------------
// FormBuilderComponentsController
// ----------------------------------------
fbComponentsController = function($scope, $in... | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderComponentsController
# ----------------------------------------
fbComponentsController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
# data
$scope.groups = $... | JavaScript | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 38fb4824fa33c5079f3a3e1623317d9a26c31fef | 600 | https://github.com/kelp404/angular-form-builder/blob/38fb4824fa33c5079f3a3e1623317d9a26c31fef/src/controller.coffee | 1 | 25 |
kelp404/angular-form-builder:src/controller.coffee:1:completion | completion | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderComponentsController
# ----------------------------------------
fbComponentsController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
# data
$scope.groups = $... | # status
$scope.status =
activeGroup: $scope.groups[0]
# action
$scope.action =
selectGroup: ($event, group) ->
$event.preventDefault()
$scope.status.activeGroup = group
fbComponentsController.$inject = ['$scope', '$injector']
a.controller 'fbComponentsController', ... | CoffeeScript | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 38fb4824fa33c5079f3a3e1623317d9a26c31fef | 600 | https://github.com/kelp404/angular-form-builder/blob/38fb4824fa33c5079f3a3e1623317d9a26c31fef/src/controller.coffee | 1 | 25 |
kelp404/angular-form-builder:src/controller.coffee:1:raw_corpus | raw_corpus | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderComponentsController
# ----------------------------------------
fbComponentsController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
groups = $builder.getCompone... | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 805a5738c1f1eea587e75837bdc935a50517ad25 | 600 | https://github.com/kelp404/angular-form-builder/blob/805a5738c1f1eea587e75837bdc935a50517ad25/src/controller.coffee | 1 | 16 | ||
kelp404/angular-form-builder:src/controller.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderComponentsController
# ----------------------------------------
fbComponentsController = ($scope, $injector) ->
# providers
$builder = $... | var a, fbComponentsController;
a = angular.module('builder.controller', ['builder.provider']);
// ----------------------------------------
// FormBuilderComponentsController
// ----------------------------------------
fbComponentsController = function($scope, $injector) {
var $builder, group, groups, i, len, result... | CoffeeScript | JavaScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 805a5738c1f1eea587e75837bdc935a50517ad25 | 600 | https://github.com/kelp404/angular-form-builder/blob/805a5738c1f1eea587e75837bdc935a50517ad25/src/controller.coffee | 1 | 16 |
kelp404/angular-form-builder:src/controller.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var a, fbComponentsController;
a = angular.module('builder.controller', ['builder.provider']);
// ----------------------------------------
// FormBuilderComponentsController
// ----------------------------------------
fbComponentsController = function($scope, $in... | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderComponentsController
# ----------------------------------------
fbComponentsController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder'
groups = $builder.getCompone... | JavaScript | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 805a5738c1f1eea587e75837bdc935a50517ad25 | 600 | https://github.com/kelp404/angular-form-builder/blob/805a5738c1f1eea587e75837bdc935a50517ad25/src/controller.coffee | 1 | 16 |
kelp404/angular-form-builder:src/controller.coffee:1:completion | completion | a = angular.module 'builder.controller', ['builder.provider']
# ----------------------------------------
# FormBuilderComponentsController
# ----------------------------------------
fbComponentsController = ($scope, $injector) ->
# providers
$builder = $injector.get '$builder' | groups = $builder.getComponentGroups()
$scope.components = {}
for group in groups
$scope.components[group] = $builder.getComponentsByGroup group
fbComponentsController.$inject = ['$scope', '$injector']
a.controller 'fbComponentsController', fbComponentsController | CoffeeScript | CoffeeScript | kelp404/angular-form-builder | src/controller.coffee | MIT | 805a5738c1f1eea587e75837bdc935a50517ad25 | 600 | https://github.com/kelp404/angular-form-builder/blob/805a5738c1f1eea587e75837bdc935a50517ad25/src/controller.coffee | 1 | 16 |
jianliaoim/talk-os:talk-api2x/server/mailers/guest-message.coffee:1:raw_corpus | raw_corpus | moment = require 'moment'
async = require 'async'
limbo = require 'limbo'
Err = require 'err1st'
i18n = require 'i18n'
BaseMailer = require './base'
util = require '../util'
db = limbo.use 'talk'
{
UserModel
MessageModel
MemberModel
} = db
class GuestMessageMailer extends BaseMailer
template: 'guest-message... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/mailers/guest-message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/mailers/guest-message.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-api2x/server/mailers/guest-message.coffee:1:completion | completion | moment = require 'moment'
async = require 'async'
limbo = require 'limbo'
Err = require 'err1st'
i18n = require 'i18n'
BaseMailer = require './base'
util = require '../util'
db = limbo.use 'talk'
{
UserModel
MessageModel
MemberModel
} = db
class GuestMessageMailer extends BaseMailer
template: 'guest-message... | findUser: (callback) ->
UserModel.findOne _id: _userId, (err, user) ->
return callback(new Err("FIELD_MISSING", "email")) unless user?.email
email.user = user
email.to = user.email
callback()
findMember: ['findUser', (callback) ->
MemberModel.findOne
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/mailers/guest-message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/mailers/guest-message.coffee | 1 | 50 |
jianliaoim/talk-os:talk-api2x/server/mailers/guest-message.coffee:2:raw_corpus | raw_corpus | $lt: util.getIdByDate (member.quitAt or member.updatedAt), 'ffffffffffffffff'
isSystem: false
MessageModel.findMessagesFromRoom _roomId, options, (err, messages) ->
email.messages = messages
email.room = messages?[0]?.room
email.clickUrl = util.buildGuestUrl email.room.gu... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/mailers/guest-message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/mailers/guest-message.coffee | 51 | 75 | ||
jianliaoim/talk-os:talk-api2x/server/mailers/guest-message.coffee:2:completion | completion | $lt: util.getIdByDate (member.quitAt or member.updatedAt), 'ffffffffffffffff'
isSystem: false
MessageModel.findMessagesFromRoom _roomId, options, (err, messages) ->
email.messages = messages
email.room = messages?[0]?.room
email.clickUrl = util.buildGuestUrl email.room.gu... | messages = messages.map (message) ->
message.alert = i18n.replace message.getAlert()
message.formatedDate = moment(new Date(message.createdAt)).format('HH:mm')
message
email.messages = messages
email.subject = """[简聊] 话题 “#{room.topic}” 中的聊天记录"""
email.loginUrl = ut... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/mailers/guest-message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/mailers/guest-message.coffee | 51 | 75 |
oozcitak/xmlbuilder-js:test/guards/node.coffee:1:raw_corpus | raw_corpus | suite 'Node Guards:', ->
test 'Invalid operations', ->
testCases = [
() -> xml('test').insertBefore()
() -> xml('test').insertAfter()
() -> xml('test').remove()
() -> xml('test').up()
() -> xml('test').ele('first').prev()
() -> xml('test').ele('first').up().ele('last').next()
... | CoffeeScript | oozcitak/xmlbuilder-js | test/guards/node.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/node.coffee | 1 | 27 | ||
oozcitak/xmlbuilder-js:test/guards/node.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
suite 'Node Guards:', ->
test 'Invalid operations', ->
testCases = [
() -> xml('test').insertBefore()
() -> xml('test').insertAfter()
() -> xml('test').remove()
() -> xml('test').up()
() -> xml('test').ele('first').prev()
... | suite('Node Guards:', function() {
return test('Invalid operations', function() {
var i, j, ref, results, results1, testCases;
testCases = [
function() {
return xml('test').insertBefore();
},
function() {
return xml('test').insertAfter();
},
function() {
r... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/guards/node.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/node.coffee | 1 | 27 |
oozcitak/xmlbuilder-js:test/guards/node.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
suite('Node Guards:', function() {
return test('Invalid operations', function() {
var i, j, ref, results, results1, testCases;
testCases = [
function() {
return xml('test').insertBefore();
},
function() {
return xml('test... | suite 'Node Guards:', ->
test 'Invalid operations', ->
testCases = [
() -> xml('test').insertBefore()
() -> xml('test').insertAfter()
() -> xml('test').remove()
() -> xml('test').up()
() -> xml('test').ele('first').prev()
() -> xml('test').ele('first').up().ele('last').next()
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/guards/node.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/node.coffee | 1 | 27 |
oozcitak/xmlbuilder-js:test/guards/node.coffee:1:completion | completion | suite 'Node Guards:', ->
test 'Invalid operations', ->
testCases = [
() -> xml('test').insertBefore()
() -> xml('test').insertAfter()
() -> xml('test').remove()
() -> xml('test').up()
() -> xml('test').ele('first').prev()
() -> xml('test').ele('first').up().ele('last').next()
... | "Cannot insert elements at root level. parent: <?xml>"
"Cannot insert elements at root level. parent: <?xml>"
"Cannot remove the root element. parent: <?xml>"
"The root node has no parent. Use doc() if you need to get the document object."
"Already at the first node. parent: <?xml>"
"Alrea... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/guards/node.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/guards/node.coffee | 1 | 27 |
octoblu/meshblu:lib/subscribeAndForward.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | f9c1566f1b6f391c456ce7cf8dcfd3773c723783 | 815 | https://github.com/octoblu/meshblu/blob/f9c1566f1b6f391c456ce7cf8dcfd3773c723783/lib/subscribeAndForward.coffee | 1 | 50 | ||
octoblu/meshblu:lib/subscribeAndForward.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')... | var MessageIOClient, Readable, _, authDevice, config, connectMessageIO, debug, getDevice, securityImpl, subscribeAndForward, subscribeAndForwardWithToken;
_ = require('lodash');
authDevice = require('./authDevice');
getDevice = require('./getDevice');
config = require('../config');
MessageIOClient = require('./mes... | CoffeeScript | JavaScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | f9c1566f1b6f391c456ce7cf8dcfd3773c723783 | 815 | https://github.com/octoblu/meshblu/blob/f9c1566f1b6f391c456ce7cf8dcfd3773c723783/lib/subscribeAndForward.coffee | 1 | 50 |
octoblu/meshblu:lib/subscribeAndForward.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MessageIOClient, Readable, _, authDevice, config, connectMessageIO, debug, getDevice, securityImpl, subscribeAndForward, subscribeAndForwardWithToken;
_ = require('lodash');
authDevice = require('./authDevice');
getDevice = require('./getDevice');
config = ... | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | JavaScript | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | f9c1566f1b6f391c456ce7cf8dcfd3773c723783 | 815 | https://github.com/octoblu/meshblu/blob/f9c1566f1b6f391c456ce7cf8dcfd3773c723783/lib/subscribeAndForward.coffee | 1 | 50 |
octoblu/meshblu:lib/subscribeAndForward.coffee:1:completion | completion | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | readStream.push JSON.stringify(message) + '\n'
response.on 'close', ->
messageIOClient.close()
return messageIOClient
subscribeAndForward = (askingDevice, response, uuid, token, requestedSubscriptionTypes, payloadOnly, topics) ->
uuid = uuid || askingDevice.uuid
if token
return subscribeAndForwardWit... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | f9c1566f1b6f391c456ce7cf8dcfd3773c723783 | 815 | https://github.com/octoblu/meshblu/blob/f9c1566f1b6f391c456ce7cf8dcfd3773c723783/lib/subscribeAndForward.coffee | 1 | 50 |
octoblu/meshblu:lib/subscribeAndForward.coffee:2:raw_corpus | raw_corpus | if error
return response.status(401).send(error: 'unauthorized')
if permission
authorizedSubscriptionTypes.push 'broadcast'
authorizedSubscriptionTypes.push 'received'
authorizedSubscriptionTypes.push 'sent'
authorizedSubscriptionTypes.push 'config'
a... | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | f9c1566f1b6f391c456ce7cf8dcfd3773c723783 | 815 | https://github.com/octoblu/meshblu/blob/f9c1566f1b6f391c456ce7cf8dcfd3773c723783/lib/subscribeAndForward.coffee | 51 | 68 | ||
octoblu/meshblu:lib/subscribeAndForward.coffee:2:completion | completion | if error
return response.status(401).send(error: 'unauthorized')
if permission
authorizedSubscriptionTypes.push 'broadcast'
authorizedSubscriptionTypes.push 'received'
authorizedSubscriptionTypes.push 'sent'
authorizedSubscriptionTypes.push 'config'
a... | requestedSubscriptionTypes ?= authorizedSubscriptionTypes
requestedSubscriptionTypes = _.union requestedSubscriptionTypes, ['config', 'data']
subscriptionTypes = _.intersection requestedSubscriptionTypes, authorizedSubscriptionTypes
messageIOClient = connectMessageIO(response, payloadOnly)
... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | f9c1566f1b6f391c456ce7cf8dcfd3773c723783 | 815 | https://github.com/octoblu/meshblu/blob/f9c1566f1b6f391c456ce7cf8dcfd3773c723783/lib/subscribeAndForward.coffee | 51 | 68 |
octoblu/meshblu:lib/subscribeAndForward.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | 522227fcd1396af7d488c8b34d61bd045bd0c85b | 815 | https://github.com/octoblu/meshblu/blob/522227fcd1396af7d488c8b34d61bd045bd0c85b/lib/subscribeAndForward.coffee | 1 | 50 | ||
octoblu/meshblu:lib/subscribeAndForward.coffee:1:completion | completion | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | return messageIOClient
subscribeAndForward = (askingDevice, response, uuid, token, requestedSubscriptionTypes, payloadOnly, topics) ->
uuid = uuid || askingDevice.uuid
if token
return subscribeAndForwardWithToken(response, uuid, token, requestedSubscriptionTypes, payloadOnly, topics)
newSubscriptionTypes = [... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | 522227fcd1396af7d488c8b34d61bd045bd0c85b | 815 | https://github.com/octoblu/meshblu/blob/522227fcd1396af7d488c8b34d61bd045bd0c85b/lib/subscribeAndForward.coffee | 1 | 50 |
octoblu/meshblu:lib/subscribeAndForward.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | 273c802c8cc33498e148abfcaa6d54f4ecc511d2 | 815 | https://github.com/octoblu/meshblu/blob/273c802c8cc33498e148abfcaa6d54f4ecc511d2/lib/subscribeAndForward.coffee | 1 | 50 | ||
octoblu/meshblu:lib/subscribeAndForward.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')... | var MessageIOClient, Readable, _, authDevice, config, connectMessageIO, debug, getDevice, securityImpl, subscribeAndForward, subscribeAndForwardWithToken;
_ = require('lodash');
authDevice = require('./authDevice');
getDevice = require('./getDevice');
config = require('../config');
MessageIOClient = require('./mes... | CoffeeScript | JavaScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | 273c802c8cc33498e148abfcaa6d54f4ecc511d2 | 815 | https://github.com/octoblu/meshblu/blob/273c802c8cc33498e148abfcaa6d54f4ecc511d2/lib/subscribeAndForward.coffee | 1 | 50 |
octoblu/meshblu:lib/subscribeAndForward.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MessageIOClient, Readable, _, authDevice, config, connectMessageIO, debug, getDevice, securityImpl, subscribeAndForward, subscribeAndForwardWithToken;
_ = require('lodash');
authDevice = require('./authDevice');
getDevice = require('./getDevice');
config = ... | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | JavaScript | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | 273c802c8cc33498e148abfcaa6d54f4ecc511d2 | 815 | https://github.com/octoblu/meshblu/blob/273c802c8cc33498e148abfcaa6d54f4ecc511d2/lib/subscribeAndForward.coffee | 1 | 50 |
octoblu/meshblu:lib/subscribeAndForward.coffee:1:completion | completion | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | readStream.push JSON.stringify(message) + '\n'
messageIOClient.start()
return messageIOClient
subscribeAndForward = (askingDevice, response, uuid, token, requestedSubscriptionTypes, payloadOnly, topics) ->
uuid = uuid || askingDevice.uuid
if token
return subscribeAndForwardWithToken(response, uuid, token,... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | 273c802c8cc33498e148abfcaa6d54f4ecc511d2 | 815 | https://github.com/octoblu/meshblu/blob/273c802c8cc33498e148abfcaa6d54f4ecc511d2/lib/subscribeAndForward.coffee | 1 | 50 |
octoblu/meshblu:lib/subscribeAndForward.coffee:2:raw_corpus | raw_corpus | if permission
authorizedSubscriptionTypes.push 'broadcast'
authorizedSubscriptionTypes.push 'received'
authorizedSubscriptionTypes.push 'sent'
requestedSubscriptionTypes ?= authorizedSubscriptionTypes
subscriptionTypes = _.intersection requestedSubscriptionTypes, authorize... | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | 273c802c8cc33498e148abfcaa6d54f4ecc511d2 | 815 | https://github.com/octoblu/meshblu/blob/273c802c8cc33498e148abfcaa6d54f4ecc511d2/lib/subscribeAndForward.coffee | 51 | 62 | ||
octoblu/meshblu:lib/subscribeAndForward.coffee:2:completion | completion | if permission
authorizedSubscriptionTypes.push 'broadcast'
authorizedSubscriptionTypes.push 'received'
authorizedSubscriptionTypes.push 'sent'
requestedSubscriptionTypes ?= authorizedSubscriptionTypes | subscriptionTypes = _.intersection requestedSubscriptionTypes, authorizedSubscriptionTypes
messageIOClient = connectMessageIO(response, payloadOnly)
messageIOClient.subscribe uuid, subscriptionTypes, topics
module.exports = subscribeAndForward | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | 273c802c8cc33498e148abfcaa6d54f4ecc511d2 | 815 | https://github.com/octoblu/meshblu/blob/273c802c8cc33498e148abfcaa6d54f4ecc511d2/lib/subscribeAndForward.coffee | 51 | 62 |
octoblu/meshblu:lib/subscribeAndForward.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | 1991ecf9f04079ca8b9dff0877bc32cf98978e62 | 815 | https://github.com/octoblu/meshblu/blob/1991ecf9f04079ca8b9dff0877bc32cf98978e62/lib/subscribeAndForward.coffee | 1 | 50 | ||
octoblu/meshblu:lib/subscribeAndForward.coffee:1:completion | completion | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | messageIOClient.start()
return messageIOClient
subscribeAndForward = (askingDevice, response, uuid, token, requestedSubscriptionTypes, payloadOnly, topics) ->
uuid = uuid || askingDevice.uuid
if token
return subscribeAndForwardWithToken(response, uuid, token, requestedSubscriptionTypes, payloadOnly, topics)
... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | 1991ecf9f04079ca8b9dff0877bc32cf98978e62 | 815 | https://github.com/octoblu/meshblu/blob/1991ecf9f04079ca8b9dff0877bc32cf98978e62/lib/subscribeAndForward.coffee | 1 | 50 |
octoblu/meshblu:lib/subscribeAndForward.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | d2fe972e793c979918535896e291b39ff8c6099a | 815 | https://github.com/octoblu/meshblu/blob/d2fe972e793c979918535896e291b39ff8c6099a/lib/subscribeAndForward.coffee | 1 | 50 | ||
octoblu/meshblu:lib/subscribeAndForward.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')... | var MessageIOClient, Readable, _, authDevice, config, connectMessageIO, debug, getDevice, securityImpl, subscribeAndForward, subscribeAndForwardWithToken;
_ = require('lodash');
authDevice = require('./authDevice');
getDevice = require('./getDevice');
config = require('../config');
MessageIOClient = require('./mes... | CoffeeScript | JavaScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | d2fe972e793c979918535896e291b39ff8c6099a | 815 | https://github.com/octoblu/meshblu/blob/d2fe972e793c979918535896e291b39ff8c6099a/lib/subscribeAndForward.coffee | 1 | 50 |
octoblu/meshblu:lib/subscribeAndForward.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MessageIOClient, Readable, _, authDevice, config, connectMessageIO, debug, getDevice, securityImpl, subscribeAndForward, subscribeAndForwardWithToken;
_ = require('lodash');
authDevice = require('./authDevice');
getDevice = require('./getDevice');
config = ... | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | JavaScript | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | d2fe972e793c979918535896e291b39ff8c6099a | 815 | https://github.com/octoblu/meshblu/blob/d2fe972e793c979918535896e291b39ff8c6099a/lib/subscribeAndForward.coffee | 1 | 50 |
octoblu/meshblu:lib/subscribeAndForward.coffee:1:completion | completion | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | if payloadOnly
message = message?.payload
readStream.push JSON.stringify(message) + '\n'
messageIOClient.start()
return messageIOClient
subscribeAndForward = (askingDevice, response, uuid, token, subscriptionTypes, payloadOnly, topics) ->
uuid = uuid || askingDevice.uuid
if token
return subscri... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | d2fe972e793c979918535896e291b39ff8c6099a | 815 | https://github.com/octoblu/meshblu/blob/d2fe972e793c979918535896e291b39ff8c6099a/lib/subscribeAndForward.coffee | 1 | 50 |
octoblu/meshblu:lib/subscribeAndForward.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | aba897b57040dc11d944b14529ae645e2f55e642 | 815 | https://github.com/octoblu/meshblu/blob/aba897b57040dc11d944b14529ae645e2f55e642/lib/subscribeAndForward.coffee | 1 | 50 | ||
octoblu/meshblu:lib/subscribeAndForward.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')... | var MessageIOClient, Readable, _, authDevice, config, connectMessageIO, debug, getDevice, securityImpl, subscribeAndForward, subscribeAndForwardWithToken;
_ = require('lodash');
authDevice = require('./authDevice');
getDevice = require('./getDevice');
config = require('../config');
MessageIOClient = require('./mes... | CoffeeScript | JavaScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | aba897b57040dc11d944b14529ae645e2f55e642 | 815 | https://github.com/octoblu/meshblu/blob/aba897b57040dc11d944b14529ae645e2f55e642/lib/subscribeAndForward.coffee | 1 | 50 |
octoblu/meshblu:lib/subscribeAndForward.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MessageIOClient, Readable, _, authDevice, config, connectMessageIO, debug, getDevice, securityImpl, subscribeAndForward, subscribeAndForwardWithToken;
_ = require('lodash');
authDevice = require('./authDevice');
getDevice = require('./getDevice');
config = ... | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | JavaScript | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | aba897b57040dc11d944b14529ae645e2f55e642 | 815 | https://github.com/octoblu/meshblu/blob/aba897b57040dc11d944b14529ae645e2f55e642/lib/subscribeAndForward.coffee | 1 | 50 |
octoblu/meshblu:lib/subscribeAndForward.coffee:1:completion | completion | _ = require 'lodash'
authDevice = require './authDevice'
getDevice = require './getDevice'
config = require '../config'
MessageIOClient = require './messageIOClient'
{Readable} = require 'stream'
securityImpl = require './getSecurityImpl'
debug = require('debug')('meshblu:subscribeAndForward')
subscribeAndForwardWithT... | if payloadOnly
message = message?.payload
readStream.push JSON.stringify(message) + '\n'
messageIOClient.start()
return messageIOClient
subscribeAndForward = (askingDevice, response, uuid, token, subscriptionTypes, payloadOnly) ->
uuid = uuid or askingDevice.uuid
if token
return subscribeAndFor... | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/subscribeAndForward.coffee | MIT | aba897b57040dc11d944b14529ae645e2f55e642 | 815 | https://github.com/octoblu/meshblu/blob/aba897b57040dc11d944b14529ae645e2f55e642/lib/subscribeAndForward.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/test/unit/mixins-executeFunctionByName-spec.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/test/unit/mixins-executeFunctionByName-spec.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/test/unit/mixins-executeFunctionByName-spec.coffee | 1 | 50 | ||
ExpediaGroup/cyclotron:cyclotron-site/test/unit/mixins-executeFunctionByName-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licens... | /*
* Copyright (c) 2013-2018 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/mit-license.php
*
* Unless required by applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/test/unit/mixins-executeFunctionByName-spec.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/test/unit/mixins-executeFunctionByName-spec.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/test/unit/mixins-executeFunctionByName-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2018 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/test/unit/mixins-executeFunctionByName-spec.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/test/unit/mixins-executeFunctionByName-spec.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/test/unit/mixins-executeFunctionByName-spec.coffee:1:completion | completion | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | expect(_.executeFunctionByName('', this)).toBeUndefined()
it 'should return undefined for a null context', ->
expect(_.executeFunctionByName('test', null)).toBeUndefined()
it 'should return the value of a function with no namespace', ->
expect(_.executeFunctionByName('f', { f: -> 10 })).toBe 1... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/test/unit/mixins-executeFunctionByName-spec.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/test/unit/mixins-executeFunctionByName-spec.coffee | 1 | 50 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:raw_corpus | raw_corpus | resolveLink = (content, uri, baseUrl) ->
### Resolve *uri* relative to *content*, resolves using
*baseUrl* if no matching content is found. ###
uriParts = url.parse uri
if uriParts.protocol
# absolute uri
return uri
else if uriParts.hash is uri
# internal anchor
return uri
else
# sea... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/markdown.coffee | 17 | 42 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
resolveLink = (content, uri, baseUrl) ->
### Resolve *uri* relative to *content*, resolves using
*baseUrl* if no matching content is found. ###
uriParts = url.parse uri
if uriParts.protocol
# absolute uri
return uri
else if uriParts.hash is ... | var resolveLink;
resolveLink = function(content, uri, baseUrl) {
/* Resolve *uri* relative to *content*, resolves using
*baseUrl* if no matching content is found. */
var nav, part, path, ref, uriParts;
uriParts = url.parse(uri);
if (uriParts.protocol) {
// absolute uri
return uri;
} else if (... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/markdown.coffee | 17 | 42 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var resolveLink;
resolveLink = function(content, uri, baseUrl) {
/* Resolve *uri* relative to *content*, resolves using
*baseUrl* if no matching content is found. */
var nav, part, path, ref, uriParts;
uriParts = url.parse(uri);
if (uriParts.protoc... | resolveLink = (content, uri, baseUrl) ->
### Resolve *uri* relative to *content*, resolves using
*baseUrl* if no matching content is found. ###
uriParts = url.parse uri
if uriParts.protocol
# absolute uri
return uri
else if uriParts.hash is uri
# internal anchor
return uri
else
# sea... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/markdown.coffee | 17 | 42 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:completion | completion | resolveLink = (content, uri, baseUrl) ->
### Resolve *uri* relative to *content*, resolves using
*baseUrl* if no matching content is found. ###
uriParts = url.parse uri
if uriParts.protocol
# absolute uri
return uri
else if uriParts.hash is uri
# internal anchor
return uri
else
# sea... | path = uriParts.pathname?.split('/') or []
while path.length and nav?
part = path.shift()
if part == ''
# uri begins with / go to contents root
nav = nav.parent while nav.parent
else if part == '..'
nav = nav.parent
else
nav = nav[part]
if nav?.getUrl?
... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/markdown.coffee | 17 | 42 |
jnordberg/wintersmith:src/plugins/markdown.coffee:2:raw_corpus | raw_corpus | parseMarkdownSync = (content, markdown, baseUrl, options) ->
### Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
resolveLink content, uri, baseUrl
... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/markdown.coffee | 44 | 62 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
parseMarkdownSync = (content, markdown, baseUrl, options) ->
### Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. ###
marked.InlineLexer.prototype._reso... | var parseMarkdownSync;
parseMarkdownSync = function(content, markdown, baseUrl, options) {
/* Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/markdown.coffee | 44 | 62 |
jnordberg/wintersmith:src/plugins/markdown.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var parseMarkdownSync;
parseMarkdownSync = function(content, markdown, baseUrl, options) {
/* Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. */
marked... | parseMarkdownSync = (content, markdown, baseUrl, options) ->
### Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
resolveLink content, uri, baseUrl
... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/markdown.coffee | 44 | 62 |
jnordberg/wintersmith:src/plugins/markdown.coffee:2:completion | completion | parseMarkdownSync = (content, markdown, baseUrl, options) ->
### Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
resolveLink content, uri, baseUrl
... | try
if lang is 'auto'
return hljs.highlightAuto(code).value
else if hljs.getLanguage lang
return hljs.highlight(lang, code).value
catch error
return code
marked.setOptions options
return marked markdown | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/markdown.coffee | 44 | 62 |
jnordberg/wintersmith:src/plugins/markdown.coffee:3:raw_corpus | raw_corpus | module.exports = (env, callback) ->
# Highlight.js configuration
hljsConfigDefaults =
classPrefix: ''
hljsConfig = env.config.highlightjs or {}
for key, value of hljsConfigDefaults
hljsConfig[key] ?= hljsConfigDefaults[key]
hljs.configure hljsConfig
class MarkdownPage extends env.plugins.Page
... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/markdown.coffee | 64 | 113 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:3:completion | completion | module.exports = (env, callback) ->
# Highlight.js configuration
hljsConfigDefaults =
classPrefix: ''
hljsConfig = env.config.highlightjs or {}
for key, value of hljsConfigDefaults
hljsConfig[key] ?= hljsConfigDefaults[key]
hljs.configure hljsConfig
class MarkdownPage extends env.plugins.Page
... | MarkdownPage.fromFile = (filepath, callback) ->
async.waterfall [
(callback) ->
fs.readFile filepath.full, callback
(buffer, callback) ->
MarkdownPage.extractMetadata buffer.toString(), callback
(result, callback) =>
{markdown, metadata} = result
page = new this fil... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/markdown.coffee | 64 | 113 |
jnordberg/wintersmith:src/plugins/markdown.coffee:4:raw_corpus | raw_corpus | """
else
error.message = "YAML Parsing error #{ error.message }"
callback error
# split metadata and markdown content
metadata = ''
markdown = content
if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/markdown.coffee | 114 | 162 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:4:completion | completion | """
else
error.message = "YAML Parsing error #{ error.message }"
callback error
# split metadata and markdown content
metadata = ''
markdown = content
if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
... | parseMetadata metadata, callback
markdown: (callback) ->
callback null, markdown
, callback
MarkdownPage.resolveLink = resolveLink
class JsonPage extends MarkdownPage
### Plugin that allows pages to be created with just metadata form a JSON file ###
JsonPage.fromFile = (filepath, callback... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/plugins/markdown.coffee | 114 | 162 |
jnordberg/wintersmith:src/plugins/markdown.coffee:3:raw_corpus | raw_corpus | module.exports = (env, callback) ->
class MarkdownPage extends env.plugins.Page
constructor: (@filepath, @metadata, @markdown) ->
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base=env.config.baseUrl) ->
### parse @markdown and return html. a... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | aaa1d4019e7853c966f30b7bfd2332314432f4c7 | 3,484 | https://github.com/jnordberg/wintersmith/blob/aaa1d4019e7853c966f30b7bfd2332314432f4c7/src/plugins/markdown.coffee | 66 | 115 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:3:completion | completion | module.exports = (env, callback) ->
class MarkdownPage extends env.plugins.Page
constructor: (@filepath, @metadata, @markdown) ->
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base=env.config.baseUrl) ->
### parse @markdown and return html. a... | callback null, page
], callback
MarkdownPage.extractMetadata = (content, callback) ->
parseMetadata = (source, callback) ->
return callback(null, {}) unless source.length > 0
try
callback null, yaml.load(source) or {}
catch error
if error.problem? and error.problemMark?
... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | aaa1d4019e7853c966f30b7bfd2332314432f4c7 | 3,484 | https://github.com/jnordberg/wintersmith/blob/aaa1d4019e7853c966f30b7bfd2332314432f4c7/src/plugins/markdown.coffee | 66 | 115 |
jnordberg/wintersmith:src/plugins/markdown.coffee:4:raw_corpus | raw_corpus | if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
if result?.length is 3
metadata = result[1]
markdown = result[2]
else if content[0...12] is '```metadata\n'
# "Winter Matter"
end = content.indexOf '\n```\n'
... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | aaa1d4019e7853c966f30b7bfd2332314432f4c7 | 3,484 | https://github.com/jnordberg/wintersmith/blob/aaa1d4019e7853c966f30b7bfd2332314432f4c7/src/plugins/markdown.coffee | 116 | 155 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
if result?.length is 3
metadata = result[1]
markdown = result[2]
else if content[0...12] is '```metadata\n'
# ... | var JsonPage, end, markdown, metadata, result;
if (content.slice(0, 3) === '---') {
// "Front Matter"
result = content.match(/^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/);
if ((result != null ? result.length : void 0) === 3) {
metadata = result[1];
markdown = result[2];
}
} else if (content.slice(0, 12) =... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | aaa1d4019e7853c966f30b7bfd2332314432f4c7 | 3,484 | https://github.com/jnordberg/wintersmith/blob/aaa1d4019e7853c966f30b7bfd2332314432f4c7/src/plugins/markdown.coffee | 116 | 155 |
jnordberg/wintersmith:src/plugins/markdown.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var JsonPage, end, markdown, metadata, result;
if (content.slice(0, 3) === '---') {
// "Front Matter"
result = content.match(/^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/);
if ((result != null ? result.length : void 0) === 3) {
metadata = result[1];
mark... | if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
if result?.length is 3
metadata = result[1]
markdown = result[2]
else if content[0...12] is '```metadata\n'
# "Winter Matter"
end = content.indexOf '\n```\n'
... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | aaa1d4019e7853c966f30b7bfd2332314432f4c7 | 3,484 | https://github.com/jnordberg/wintersmith/blob/aaa1d4019e7853c966f30b7bfd2332314432f4c7/src/plugins/markdown.coffee | 116 | 155 |
jnordberg/wintersmith:src/plugins/markdown.coffee:4:completion | completion | if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
if result?.length is 3
metadata = result[1]
markdown = result[2]
else if content[0...12] is '```metadata\n'
# "Winter Matter"
end = content.indexOf '\n```\n'
... | MarkdownPage.resolveLink = resolveLink
class JsonPage extends MarkdownPage
### Plugin that allows pages to be created with just metadata form a JSON file ###
JsonPage.fromFile = (filepath, callback) ->
async.waterfall [
async.apply env.utils.readJSON, filepath.full
(metadata, callback) =>
... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | aaa1d4019e7853c966f30b7bfd2332314432f4c7 | 3,484 | https://github.com/jnordberg/wintersmith/blob/aaa1d4019e7853c966f30b7bfd2332314432f4c7/src/plugins/markdown.coffee | 116 | 155 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:raw_corpus | raw_corpus | resolveLink = (content, uri, baseUrl) ->
### Resolve *uri* relative to *content*, resolves using
*baseUrl* if no matching content is found. ###
uriParts = url.parse uri
if uriParts.protocol
# absolute uri
return uri
else
# search pathname in content tree relative to *content*
nav = content... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 19f88e4742628424010d43371c0b3747c4ab3474 | 3,484 | https://github.com/jnordberg/wintersmith/blob/19f88e4742628424010d43371c0b3747c4ab3474/src/plugins/markdown.coffee | 19 | 41 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
resolveLink = (content, uri, baseUrl) ->
### Resolve *uri* relative to *content*, resolves using
*baseUrl* if no matching content is found. ###
uriParts = url.parse uri
if uriParts.protocol
# absolute uri
return uri
else
# search pathnam... | var resolveLink;
resolveLink = function(content, uri, baseUrl) {
/* Resolve *uri* relative to *content*, resolves using
*baseUrl* if no matching content is found. */
var nav, part, path, ref, uriParts;
uriParts = url.parse(uri);
if (uriParts.protocol) {
// absolute uri
return uri;
} else {
... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 19f88e4742628424010d43371c0b3747c4ab3474 | 3,484 | https://github.com/jnordberg/wintersmith/blob/19f88e4742628424010d43371c0b3747c4ab3474/src/plugins/markdown.coffee | 19 | 41 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var resolveLink;
resolveLink = function(content, uri, baseUrl) {
/* Resolve *uri* relative to *content*, resolves using
*baseUrl* if no matching content is found. */
var nav, part, path, ref, uriParts;
uriParts = url.parse(uri);
if (uriParts.protoc... | resolveLink = (content, uri, baseUrl) ->
### Resolve *uri* relative to *content*, resolves using
*baseUrl* if no matching content is found. ###
uriParts = url.parse uri
if uriParts.protocol
# absolute uri
return uri
else
# search pathname in content tree relative to *content*
nav = content... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 19f88e4742628424010d43371c0b3747c4ab3474 | 3,484 | https://github.com/jnordberg/wintersmith/blob/19f88e4742628424010d43371c0b3747c4ab3474/src/plugins/markdown.coffee | 19 | 41 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:completion | completion | resolveLink = (content, uri, baseUrl) ->
### Resolve *uri* relative to *content*, resolves using
*baseUrl* if no matching content is found. ###
uriParts = url.parse uri
if uriParts.protocol
# absolute uri
return uri
else
# search pathname in content tree relative to *content*
nav = content... | while path.length and nav?
part = path.shift()
if part == ''
# uri begins with / go to contents root
nav = nav.parent while nav.parent
else if part == '..'
nav = nav.parent
else
nav = nav[part]
if nav?.getUrl?
return nav.getUrl() + [uriParts.hash]
re... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 19f88e4742628424010d43371c0b3747c4ab3474 | 3,484 | https://github.com/jnordberg/wintersmith/blob/19f88e4742628424010d43371c0b3747c4ab3474/src/plugins/markdown.coffee | 19 | 41 |
jnordberg/wintersmith:src/plugins/markdown.coffee:2:raw_corpus | raw_corpus | parseMarkdownSync = (content, markdown, baseUrl, options) ->
### Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
resolveLink content, uri, baseUrl
... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | b9d920fcae99b879d3a87a8658fb8477f5a28874 | 3,484 | https://github.com/jnordberg/wintersmith/blob/b9d920fcae99b879d3a87a8658fb8477f5a28874/src/plugins/markdown.coffee | 43 | 59 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
parseMarkdownSync = (content, markdown, baseUrl, options) ->
### Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. ###
marked.InlineLexer.prototype._reso... | var parseMarkdownSync;
parseMarkdownSync = function(content, markdown, baseUrl, options) {
/* Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | b9d920fcae99b879d3a87a8658fb8477f5a28874 | 3,484 | https://github.com/jnordberg/wintersmith/blob/b9d920fcae99b879d3a87a8658fb8477f5a28874/src/plugins/markdown.coffee | 43 | 59 |
jnordberg/wintersmith:src/plugins/markdown.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var parseMarkdownSync;
parseMarkdownSync = function(content, markdown, baseUrl, options) {
/* Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. */
marked... | parseMarkdownSync = (content, markdown, baseUrl, options) ->
### Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
resolveLink content, uri, baseUrl
... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | b9d920fcae99b879d3a87a8658fb8477f5a28874 | 3,484 | https://github.com/jnordberg/wintersmith/blob/b9d920fcae99b879d3a87a8658fb8477f5a28874/src/plugins/markdown.coffee | 43 | 59 |
jnordberg/wintersmith:src/plugins/markdown.coffee:2:completion | completion | parseMarkdownSync = (content, markdown, baseUrl, options) ->
### Parse *markdown* found on *content* node of contents and
resolve links by navigating in the content tree. use *baseUrl* as a last resort
returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
resolveLink content, uri, baseUrl | options.highlight = (code, lang) ->
try
result = if lang and hljs.getLanguage(lang) then hljs.highlight(lang, code) else hljs.highlightAuto(code)
return result.value
catch error
return code
marked.setOptions options
return marked markdown | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | b9d920fcae99b879d3a87a8658fb8477f5a28874 | 3,484 | https://github.com/jnordberg/wintersmith/blob/b9d920fcae99b879d3a87a8658fb8477f5a28874/src/plugins/markdown.coffee | 43 | 59 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:raw_corpus | raw_corpus | parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
options.highlight = (code, lang) ->
try
result = if lang and hljs.getLanguage(lang) the... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | a91007f897d52081141c4dd29c4c74e42ab8ea9d | 3,484 | https://github.com/jnordberg/wintersmith/blob/a91007f897d52081141c4dd29c4c74e42ab8ea9d/src/plugins/markdown.coffee | 19 | 33 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
options.highlight = (code, lang) ->
... | var parseMarkdownSync;
parseMarkdownSync = function(content, baseUrl, options) {
/* Parse markdown *content* and resolve links using *baseUrl*, returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
return url.resolve(baseUrl, uri);
};
options.highlight = function(code, lang) {
va... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | a91007f897d52081141c4dd29c4c74e42ab8ea9d | 3,484 | https://github.com/jnordberg/wintersmith/blob/a91007f897d52081141c4dd29c4c74e42ab8ea9d/src/plugins/markdown.coffee | 19 | 33 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var parseMarkdownSync;
parseMarkdownSync = function(content, baseUrl, options) {
/* Parse markdown *content* and resolve links using *baseUrl*, returns html. */
marked.InlineLexer.prototype._resolveLink = function(uri) {
return url.resolve(baseUrl, uri);
... | parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
options.highlight = (code, lang) ->
try
result = if lang and hljs.getLanguage(lang) the... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | a91007f897d52081141c4dd29c4c74e42ab8ea9d | 3,484 | https://github.com/jnordberg/wintersmith/blob/a91007f897d52081141c4dd29c4c74e42ab8ea9d/src/plugins/markdown.coffee | 19 | 33 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:completion | completion | parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
options.highlight = (code, lang) -> | try
result = if lang and hljs.getLanguage(lang) then hljs.highlight(lang, code) else hljs.highlightAuto(code)
return result.value
catch error
return code
marked.setOptions options
return marked content | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | a91007f897d52081141c4dd29c4c74e42ab8ea9d | 3,484 | https://github.com/jnordberg/wintersmith/blob/a91007f897d52081141c4dd29c4c74e42ab8ea9d/src/plugins/markdown.coffee | 19 | 33 |
jnordberg/wintersmith:src/plugins/markdown.coffee:2:raw_corpus | raw_corpus | module.exports = (env, callback) ->
class MarkdownPage extends env.plugins.Page
constructor: (@filepath, @metadata, @markdown) ->
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base=env.config.baseUrl) ->
### parse @markdown and return html. a... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | a91007f897d52081141c4dd29c4c74e42ab8ea9d | 3,484 | https://github.com/jnordberg/wintersmith/blob/a91007f897d52081141c4dd29c4c74e42ab8ea9d/src/plugins/markdown.coffee | 35 | 84 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:2:completion | completion | module.exports = (env, callback) ->
class MarkdownPage extends env.plugins.Page
constructor: (@filepath, @metadata, @markdown) ->
getLocation: (base) ->
uri = @getUrl base
return uri[0..uri.lastIndexOf('/')]
getHtml: (base=env.config.baseUrl) ->
### parse @markdown and return html. a... | callback null, page
], callback
MarkdownPage.extractMetadata = (content, callback) ->
parseMetadata = (source, callback) ->
return callback(null, {}) unless source.length > 0
try
callback null, yaml.load(source) or {}
catch error
if error.problem? and error.problemMark?
... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | a91007f897d52081141c4dd29c4c74e42ab8ea9d | 3,484 | https://github.com/jnordberg/wintersmith/blob/a91007f897d52081141c4dd29c4c74e42ab8ea9d/src/plugins/markdown.coffee | 35 | 84 |
jnordberg/wintersmith:src/plugins/markdown.coffee:3:raw_corpus | raw_corpus | if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
if result?.length is 3
metadata = result[1]
markdown = result[2]
else if content[0...12] is '```metadata\n'
# "Winter Matter"
end = content.indexOf '\n```\n'
... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | a91007f897d52081141c4dd29c4c74e42ab8ea9d | 3,484 | https://github.com/jnordberg/wintersmith/blob/a91007f897d52081141c4dd29c4c74e42ab8ea9d/src/plugins/markdown.coffee | 85 | 122 | ||
jnordberg/wintersmith:src/plugins/markdown.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
if result?.length is 3
metadata = result[1]
markdown = result[2]
else if content[0...12] is '```metadata\n'
# ... | var JsonPage, end, markdown, metadata, result;
if (content.slice(0, 3) === '---') {
// "Front Matter"
result = content.match(/^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/);
if ((result != null ? result.length : void 0) === 3) {
metadata = result[1];
markdown = result[2];
}
} else if (content.slice(0, 12) =... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | a91007f897d52081141c4dd29c4c74e42ab8ea9d | 3,484 | https://github.com/jnordberg/wintersmith/blob/a91007f897d52081141c4dd29c4c74e42ab8ea9d/src/plugins/markdown.coffee | 85 | 122 |
jnordberg/wintersmith:src/plugins/markdown.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var JsonPage, end, markdown, metadata, result;
if (content.slice(0, 3) === '---') {
// "Front Matter"
result = content.match(/^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/);
if ((result != null ? result.length : void 0) === 3) {
metadata = result[1];
mark... | if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
if result?.length is 3
metadata = result[1]
markdown = result[2]
else if content[0...12] is '```metadata\n'
# "Winter Matter"
end = content.indexOf '\n```\n'
... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | a91007f897d52081141c4dd29c4c74e42ab8ea9d | 3,484 | https://github.com/jnordberg/wintersmith/blob/a91007f897d52081141c4dd29c4c74e42ab8ea9d/src/plugins/markdown.coffee | 85 | 122 |
jnordberg/wintersmith:src/plugins/markdown.coffee:3:completion | completion | if content[0...3] is '---'
# "Front Matter"
result = content.match /^-{3,}\s([\s\S]*?)-{3,}(\s[\s\S]*|\s?)$/
if result?.length is 3
metadata = result[1]
markdown = result[2]
else if content[0...12] is '```metadata\n'
# "Winter Matter"
end = content.indexOf '\n```\n'
... | class JsonPage extends MarkdownPage
### Plugin that allows pages to be created with just metadata form a JSON file ###
JsonPage.fromFile = (filepath, callback) ->
async.waterfall [
async.apply env.utils.readJSON, filepath.full
(metadata, callback) =>
markdown = metadata.content or ''
... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | a91007f897d52081141c4dd29c4c74e42ab8ea9d | 3,484 | https://github.com/jnordberg/wintersmith/blob/a91007f897d52081141c4dd29c4c74e42ab8ea9d/src/plugins/markdown.coffee | 85 | 122 |
jnordberg/wintersmith:src/plugins/markdown.coffee:1:raw_corpus | raw_corpus | parseMarkdownSync = (content, baseUrl, options) ->
### Parse markdown *content* and resolve links using *baseUrl*, returns html. ###
marked.InlineLexer.prototype._resolveLink = (uri) ->
url.resolve baseUrl, uri
options.highlight = (code, lang) ->
try
lang = 'cpp' if lang is 'c'
return hljs.h... | CoffeeScript | jnordberg/wintersmith | src/plugins/markdown.coffee | MIT | 0f7469f5ba91e8da23552515089a90e4337bb6bb | 3,484 | https://github.com/jnordberg/wintersmith/blob/0f7469f5ba91e8da23552515089a90e4337bb6bb/src/plugins/markdown.coffee | 19 | 37 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.