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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sorich87/bootstrap-tour:tests/tests.coffee:3:raw_corpus | raw_corpus | strictEqual(tour.getState("end"), "yes", "tour sets end state")
clearTour(tour)
test "Tour.ended should return true is tour ended and false if not", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
strictEqual(tour.ended(), false, "tour returns false if n... | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 3b2c244bcf4355cf0f2ff44370b9a8cf78707b22 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/3b2c244bcf4355cf0f2ff44370b9a8cf78707b22/tests/tests.coffee | 101 | 150 | ||
sorich87/bootstrap-tour:tests/tests.coffee:3:completion | completion | strictEqual(tour.getState("end"), "yes", "tour sets end state")
clearTour(tour)
test "Tour.ended should return true is tour ended and false if not", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
strictEqual(tour.ended(), false, "tour returns false if n... | test "Tour.hideStep should hide a step", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
tour.hideStep(0)
strictEqual(tour.getStep(0).element.data("popover").tip().filter(":visible").length, 0, "tour hides step")
clearTour(tour)
test "Tour.showStep sho... | CoffeeScript | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 3b2c244bcf4355cf0f2ff44370b9a8cf78707b22 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/3b2c244bcf4355cf0f2ff44370b9a8cf78707b22/tests/tests.coffee | 101 | 150 |
sorich87/bootstrap-tour:tests/tests.coffee:4:raw_corpus | raw_corpus | test "Tour.showNextStep should show the next step", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
tour.showNextStep()
strictEqual(tour.getStep(1).element.data("popover").tip().filter... | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 3b2c244bcf4355cf0f2ff44370b9a8cf78707b22 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/3b2c244bcf4355cf0f2ff44370b9a8cf78707b22/tests/tests.coffee | 151 | 168 | ||
sorich87/bootstrap-tour:tests/tests.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test "Tour.showNextStep should show the next step", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
tour.showNextStep()
strictE... | test("Tour.showNextStep should show the next step", function() {
var tour;
tour = new Tour();
tour.addStep({
element: $("<div></div>").appendTo("#qunit-fixture")
});
tour.addStep({
element: $("<div></div>").appendTo("#qunit-fixture")
});
tour.start();
tour.showNextStep();
strictEqual(tour.getS... | CoffeeScript | JavaScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 3b2c244bcf4355cf0f2ff44370b9a8cf78707b22 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/3b2c244bcf4355cf0f2ff44370b9a8cf78707b22/tests/tests.coffee | 151 | 168 |
sorich87/bootstrap-tour:tests/tests.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
test("Tour.showNextStep should show the next step", function() {
var tour;
tour = new Tour();
tour.addStep({
element: $("<div></div>").appendTo("#qunit-fixture")
});
tour.addStep({
element: $("<div></div>").appendTo("#qunit-fixture")
});
tour.... | test "Tour.showNextStep should show the next step", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
tour.showNextStep()
strictEqual(tour.getStep(1).element.data("popover").tip().filter... | JavaScript | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 3b2c244bcf4355cf0f2ff44370b9a8cf78707b22 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/3b2c244bcf4355cf0f2ff44370b9a8cf78707b22/tests/tests.coffee | 151 | 168 |
sorich87/bootstrap-tour:tests/tests.coffee:4:completion | completion | test "Tour.showNextStep should show the next step", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
tour.showNextStep()
strictEqual(tour.getStep(1).element.data("popover").tip().filter... | test "Tour.showPrevStep should show the previous step", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.showStep(1)
tour.showPrevStep()
strictEqual(tour.getStep(0).element.data("popover").tip(... | CoffeeScript | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 3b2c244bcf4355cf0f2ff44370b9a8cf78707b22 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/3b2c244bcf4355cf0f2ff44370b9a8cf78707b22/tests/tests.coffee | 151 | 168 |
sorich87/bootstrap-tour:tests/tests.coffee:1:raw_corpus | raw_corpus | clearTour = (tour) ->
tour.setState("current_step", null)
tour.setState("end", null)
$.each(tour._steps, (i, s) ->
s.element.popover("hide").removeData("popover")
)
test "Tour should set the tour options", ->
tour = new Tour({
afterSetState: ->
true
afterGetState: ->
true
})
ok(to... | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 378e3add8b69692c27182e83672670963088605e | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/378e3add8b69692c27182e83672670963088605e/tests/tests.coffee | 1 | 50 | ||
sorich87/bootstrap-tour:tests/tests.coffee:1:completion | completion | clearTour = (tour) ->
tour.setState("current_step", null)
tour.setState("end", null)
$.each(tour._steps, (i, s) ->
s.element.popover("hide").removeData("popover")
)
test "Tour should set the tour options", ->
tour = new Tour({
afterSetState: ->
true
afterGetState: ->
true
})
ok(to... | tour = new Tour()
tour.setState("test", "yes")
strictEqual($.cookie("tour_test"), "yes", "tour saves state")
clearTour(tour)
test "Tour.getState should get state cookie", ->
tour = new Tour()
tour.setState("test", "yes")
strictEqual(tour.getState("test"), "yes", "tour gets state")
$.cookie("tour_test", n... | CoffeeScript | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 378e3add8b69692c27182e83672670963088605e | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/378e3add8b69692c27182e83672670963088605e/tests/tests.coffee | 1 | 50 |
sorich87/bootstrap-tour:tests/tests.coffee:2:raw_corpus | raw_corpus | title: "Test"
content: "Just a test"
next: 2
end: false
animation: false
}
tour.addStep(step)
deepEqual(tour.getStep(0), step, "tour gets a step")
clearTour(tour)
test "Tour.start should start a tour", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})... | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 24b2aa9ed3ba89084044de815fd83f94757f9010 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/24b2aa9ed3ba89084044de815fd83f94757f9010/tests/tests.coffee | 51 | 100 | ||
sorich87/bootstrap-tour:tests/tests.coffee:2:completion | completion | title: "Test"
content: "Just a test"
next: 2
end: false
animation: false
}
tour.addStep(step)
deepEqual(tour.getStep(0), step, "tour gets a step")
clearTour(tour)
test "Tour.start should start a tour", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})... | test "Tour.start(true) should force starting a tour that ended", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.setState("end", "yes")
tour.start(true)
strictEqual($(".popover").length, 1, "previously ended tour starts again if forced to")
clearTour(tour)
tes... | CoffeeScript | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 24b2aa9ed3ba89084044de815fd83f94757f9010 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/24b2aa9ed3ba89084044de815fd83f94757f9010/tests/tests.coffee | 51 | 100 |
sorich87/bootstrap-tour:tests/tests.coffee:3:raw_corpus | raw_corpus | clearTour(tour)
test "Tour.ended should return true is tour ended and false if not", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
strictEqual(tour.ended(), false, "tour returns false if not ended")
tour.end()
strictEqual(tour.ended(), true, "tour re... | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 24b2aa9ed3ba89084044de815fd83f94757f9010 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/24b2aa9ed3ba89084044de815fd83f94757f9010/tests/tests.coffee | 101 | 150 | ||
sorich87/bootstrap-tour:tests/tests.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
clearTour(tour)
test "Tour.ended should return true is tour ended and false if not", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
strictEqual(tour.ended(), false, "tour returns false if not ended"... | clearTour(tour);
test("Tour.ended should return true is tour ended and false if not", function() {
var tour;
tour = new Tour();
tour.addStep({
element: $("<div></div>").appendTo("#qunit-fixture")
});
tour.start();
strictEqual(tour.ended(), false, "tour returns false if not ended");
tour.end();
stri... | CoffeeScript | JavaScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 24b2aa9ed3ba89084044de815fd83f94757f9010 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/24b2aa9ed3ba89084044de815fd83f94757f9010/tests/tests.coffee | 101 | 150 |
sorich87/bootstrap-tour:tests/tests.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
clearTour(tour);
test("Tour.ended should return true is tour ended and false if not", function() {
var tour;
tour = new Tour();
tour.addStep({
element: $("<div></div>").appendTo("#qunit-fixture")
});
tour.start();
strictEqual(tour.ended(), false, "... | clearTour(tour)
test "Tour.ended should return true is tour ended and false if not", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
strictEqual(tour.ended(), false, "tour returns false if not ended")
tour.end()
strictEqual(tour.ended(), true, "tour re... | JavaScript | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 24b2aa9ed3ba89084044de815fd83f94757f9010 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/24b2aa9ed3ba89084044de815fd83f94757f9010/tests/tests.coffee | 101 | 150 |
sorich87/bootstrap-tour:tests/tests.coffee:3:completion | completion | clearTour(tour)
test "Tour.ended should return true is tour ended and false if not", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
strictEqual(tour.ended(), false, "tour returns false if not ended")
tour.end()
strictEqual(tour.ended(), true, "tour re... | test "Tour.hideStep should hide a step", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
tour.hideStep(0)
strictEqual(tour.getStep(0).element.data("popover").tip().filter(":visible").length, 0, "tour hides step")
clearTour(tour)
test "Tour.showStep sho... | CoffeeScript | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 24b2aa9ed3ba89084044de815fd83f94757f9010 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/24b2aa9ed3ba89084044de815fd83f94757f9010/tests/tests.coffee | 101 | 150 |
sorich87/bootstrap-tour:tests/tests.coffee:4:raw_corpus | raw_corpus | test "Tour.showNextStep should show the next step", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
tour.showNextStep()
strictEqual(tour.getStep(1).element.data("popover").tip().filter... | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 24b2aa9ed3ba89084044de815fd83f94757f9010 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/24b2aa9ed3ba89084044de815fd83f94757f9010/tests/tests.coffee | 151 | 158 | ||
sorich87/bootstrap-tour:tests/tests.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test "Tour.showNextStep should show the next step", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
tour.showNextStep()
strictE... | test("Tour.showNextStep should show the next step", function() {
var tour;
tour = new Tour();
tour.addStep({
element: $("<div></div>").appendTo("#qunit-fixture")
});
tour.addStep({
element: $("<div></div>").appendTo("#qunit-fixture")
});
tour.start();
tour.showNextStep();
strictEqual(tour.getS... | CoffeeScript | JavaScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 24b2aa9ed3ba89084044de815fd83f94757f9010 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/24b2aa9ed3ba89084044de815fd83f94757f9010/tests/tests.coffee | 151 | 158 |
sorich87/bootstrap-tour:tests/tests.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
test("Tour.showNextStep should show the next step", function() {
var tour;
tour = new Tour();
tour.addStep({
element: $("<div></div>").appendTo("#qunit-fixture")
});
tour.addStep({
element: $("<div></div>").appendTo("#qunit-fixture")
});
tour.... | test "Tour.showNextStep should show the next step", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.start()
tour.showNextStep()
strictEqual(tour.getStep(1).element.data("popover").tip().filter... | JavaScript | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 24b2aa9ed3ba89084044de815fd83f94757f9010 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/24b2aa9ed3ba89084044de815fd83f94757f9010/tests/tests.coffee | 151 | 158 |
sorich87/bootstrap-tour:tests/tests.coffee:4:completion | completion | test "Tour.showNextStep should show the next step", ->
tour = new Tour()
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")})
tour.addStep({element: $("<div></div>").appendTo("#qunit-fixture")}) | tour.start()
tour.showNextStep()
strictEqual(tour.getStep(1).element.data("popover").tip().filter(":visible").length, 1, "tour shows next step")
clearTour(tour) | CoffeeScript | CoffeeScript | sorich87/bootstrap-tour | tests/tests.coffee | MIT | 24b2aa9ed3ba89084044de815fd83f94757f9010 | 4,416 | https://github.com/sorich87/bootstrap-tour/blob/24b2aa9ed3ba89084044de815fd83f94757f9010/tests/tests.coffee | 151 | 158 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 39 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.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/app/widgets/stoplight/stoplightWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 39 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.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/app/widgets/stoplight/stoplightWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 39 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.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 ... | cyclotronApp.controller 'StoplightWidget', ($scope, dashboardService, dataService) ->
$scope.activeColor = null
$scope.evalColors = (row) ->
rules = $scope.widget.rules
return unless rules?
$scope.tooltip = _.compile($scope.widget.tooltip, row)
if rules.red?
red =... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 39 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:2:raw_corpus | raw_corpus | $scope.activeColor = null
$scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initialize
if $scope.dataSource?
$scope.dataVersion ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 41 | 82 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:2:completion | completion | $scope.activeColor = null
$scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initialize
if $scope.dataSource?
$scope.dataVersion ... | data = eventData.data[dsDefinition.resultSet].data
data = $scope.filterAndSortWidgetData(data)
# Check for no data
if data?
# Load the data
$scope.evalColors(_.first(data))
$scope.widgetContext.loading = false
# Data Source error... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 41 | 82 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | b56e43a76db5194d1381575b1f85b8905693799e | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/b56e43a76db5194d1381575b1f85b8905693799e/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 39 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 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-2015 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/app/widgets/stoplight/stoplightWidget.coffee | MIT | b56e43a76db5194d1381575b1f85b8905693799e | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/b56e43a76db5194d1381575b1f85b8905693799e/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 39 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2015 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-2015 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/app/widgets/stoplight/stoplightWidget.coffee | MIT | b56e43a76db5194d1381575b1f85b8905693799e | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/b56e43a76db5194d1381575b1f85b8905693799e/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 39 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 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 ... | cyclotronApp.controller 'StoplightWidget', ($scope, dashboardService, dataService) ->
$scope.activeColor = null
$scope.evalColors = (row) ->
rules = $scope.widget.rules
return unless rules?
$scope.tooltip = _.compile($scope.widget.tooltip, row)
if rules.red?
red =... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | b56e43a76db5194d1381575b1f85b8905693799e | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/b56e43a76db5194d1381575b1f85b8905693799e/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 39 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 39 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 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-2015 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/app/widgets/stoplight/stoplightWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 39 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2015 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-2015 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/app/widgets/stoplight/stoplightWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 39 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 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 ... | cyclotronApp.controller 'StoplightWidget', ($scope, dashboardService, dataService) ->
$scope.activeColor = null
$scope.evalColors = (row) ->
rules = $scope.widget.rules
return unless rules?
if rules.red?
red = _.compile(rules.red, row)
if red == true then retur... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 39 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:2:raw_corpus | raw_corpus | $scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initialize
if $scope.dataSource?
$scope.dataVersion = 0
$scope.widgetContex... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 41 | 80 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
$scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initialize
if $scope.dataSource?
... | var dsDefinition;
$scope.reload = function() {
return $scope.dataSource.execute(true);
};
// Load Data Source
dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget);
$scope.dataSource = dataService.get(dsDefinition);
// Initialize
if ($scope.dataSource != null) {
$scope.dataVersion = 0;
... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 41 | 80 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var dsDefinition;
$scope.reload = function() {
return $scope.dataSource.execute(true);
};
// Load Data Source
dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget);
$scope.dataSource = dataService.get(dsDefinition);
// Initialize
if (... | $scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initialize
if $scope.dataSource?
$scope.dataVersion = 0
$scope.widgetContex... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 41 | 80 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:2:completion | completion | $scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initialize
if $scope.dataSource?
$scope.dataVersion = 0
$scope.widgetContex... | data = eventData.data[dsDefinition.resultSet].data
data = $scope.filterAndSortWidgetData(data)
# Check for no data
if data?
# Load the data
$scope.evalColors(_.first(data))
$scope.widgetContext.loading = false
# Data Source error... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | d9f6710d26e1473dc1dab805685dd5b572fead4a | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/d9f6710d26e1473dc1dab805685dd5b572fead4a/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 41 | 80 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 41 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 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-2015 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/app/widgets/stoplight/stoplightWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 41 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2015 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-2015 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/app/widgets/stoplight/stoplightWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 41 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | $scope.loading = false
$scope.dataSourceError = false
$scope.dataSourceErrorMessage = null
$scope.activeColor = null
$scope.evalColors = (row) ->
rules = $scope.widget.rules
return unless rules?
if rules.red?
red = _.compile(rules.red, row)
if red == tr... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 41 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:2:raw_corpus | raw_corpus | $scope.activeColor = null
$scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initialize
if $scope.dataSource?
$scope.dataVersion ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 43 | 82 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:2:completion | completion | $scope.activeColor = null
$scope.reload = ->
$scope.dataSource.execute(true)
# Load Data Source
dsDefinition = dashboardService.getDataSource $scope.dashboard, $scope.widget
$scope.dataSource = dataService.get dsDefinition
# Initialize
if $scope.dataSource?
$scope.dataVersion ... | $scope.dataSourceErrorMessage = null
data = eventData.data[dsDefinition.resultSet].data
# Filter the data if the widget has "filters"
if $scope.widget.filters?
data = dataService.filter(data, $scope.widget.filters)
# Sort the data if the widget has "sor... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 43 | 82 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:3:raw_corpus | raw_corpus | $scope.loading = false
# Data Source error
$scope.$on 'dataSource:' + dsDefinition.name + ':error', (event, data) ->
$scope.dataSourceError = true
$scope.dataSourceErrorMessage = data.error
$scope.nodata = null
$scope.loading = false
# Data Sourc... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 84 | 101 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:3:completion | completion | $scope.loading = false
# Data Source error
$scope.$on 'dataSource:' + dsDefinition.name + ':error', (event, data) ->
$scope.dataSourceError = true
$scope.dataSourceErrorMessage = data.error
$scope.nodata = null
$scope.loading = false | # Data Source loading
$scope.$on 'dataSource:' + dsDefinition.name + ':loading', ->
$scope.loading = true
# Initialize the Data Source
$scope.dataSource.init dsDefinition
else
$scope.evalColors({}) | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | aa249eacd2cdb7409ce6c4581e1cedf99c9471b7 | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/aa249eacd2cdb7409ce6c4581e1cedf99c9471b7/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 84 | 101 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | 425ed381cbae1e6fb7fd34c1d1427426d69292df | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/425ed381cbae1e6fb7fd34c1d1427426d69292df/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 43 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 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-2015 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/app/widgets/stoplight/stoplightWidget.coffee | MIT | 425ed381cbae1e6fb7fd34c1d1427426d69292df | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/425ed381cbae1e6fb7fd34c1d1427426d69292df/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2015 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-2015 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/app/widgets/stoplight/stoplightWidget.coffee | MIT | 425ed381cbae1e6fb7fd34c1d1427426d69292df | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/425ed381cbae1e6fb7fd34c1d1427426d69292df/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | $scope.loading = false
$scope.dataSourceError = false
$scope.dataSourceErrorMessage = null
$scope.activeColor = null
$scope.widgetTitle = -> _.jsExec($scope.widget.title)
$scope.evalColors = (row) ->
rules = $scope.widget.rules
return unless rules?
if rules.red?
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | 425ed381cbae1e6fb7fd34c1d1427426d69292df | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/425ed381cbae1e6fb7fd34c1d1427426d69292df/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 43 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 40 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 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-2015 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/app/widgets/stoplight/stoplightWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 40 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2015 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-2015 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/app/widgets/stoplight/stoplightWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 40 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | $scope.loading = false
$scope.widgetTitle = -> _.jsExec($scope.widget.title)
$scope.activeColor = null
$scope.evalColors = (row) ->
rules = $scope.widget.rules
return unless rules?
if rules.red?
red = _.compile(rules.red, row)
if red == true then return $s... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 1 | 40 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:2:raw_corpus | raw_corpus | $scope.activeColor = null
$scope.loadData = ->
$scope.loading = true
$scope.dataSourceError = false
$scope.dataSourceErrorMessage = null
# Load data source
dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget)
$scope.dataSource = dataService... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 42 | 87 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:2:completion | completion | $scope.activeColor = null
$scope.loadData = ->
$scope.loading = true
$scope.dataSourceError = false
$scope.dataSourceErrorMessage = null
# Load data source
dsDefinition = dashboardService.getDataSource($scope.dashboard, $scope.widget)
$scope.dataSource = dataService... | if $scope.widget.sortBy?
data = dataService.sort(data, $scope.widget.sortBy)
# Check for no Data
if _.isEmpty(data) && $scope.widget.noData?
$scope.nodata = _.jsExec($scope.widget.noData)
else
$scope.nodata = null
# Lo... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 42 | 87 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:3:raw_corpus | raw_corpus | $scope.reload = ->
$scope.dataSource.execute(true)
# Data Source
if $scope.widget.dataSource?
$scope.loadData()
else
$scope.evalColors({}) | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 89 | 96 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
$scope.reload = ->
$scope.dataSource.execute(true)
# Data Source
if $scope.widget.dataSource?
$scope.loadData()
else
$scope.evalColors({})
``` | $scope.reload = function() {
return $scope.dataSource.execute(true);
};
// Data Source
if ($scope.widget.dataSource != null) {
$scope.loadData();
} else {
$scope.evalColors({});
} | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 89 | 96 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
$scope.reload = function() {
return $scope.dataSource.execute(true);
};
// Data Source
if ($scope.widget.dataSource != null) {
$scope.loadData();
} else {
$scope.evalColors({});
}
``` | $scope.reload = ->
$scope.dataSource.execute(true)
# Data Source
if $scope.widget.dataSource?
$scope.loadData()
else
$scope.evalColors({}) | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 89 | 96 |
ExpediaGroup/cyclotron:cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee:3:completion | completion | $scope.reload = ->
$scope.dataSource.execute(true)
# Data Source | if $scope.widget.dataSource?
$scope.loadData()
else
$scope.evalColors({}) | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/widgets/stoplight/stoplightWidget.coffee | 89 | 96 |
CaryLandholt/AngularFun:scripts/controllers/controllers.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['libs/angular'], (angular) ->
'use strict'
angular.module 'controllers', [] | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/controllers.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/controllers/controllers.coffee | 1 | 6 | ||
CaryLandholt/AngularFun:scripts/controllers/controllers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['libs/angular'], (angular) ->
'use strict'
angular.module 'controllers', []
``` | /*global define*/
define(['libs/angular'], function(angular) {
'use strict';
return angular.module('controllers', []);
}); | CoffeeScript | JavaScript | CaryLandholt/AngularFun | scripts/controllers/controllers.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/controllers/controllers.coffee | 1 | 6 |
CaryLandholt/AngularFun:scripts/controllers/controllers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['libs/angular'], function(angular) {
'use strict';
return angular.module('controllers', []);
});
``` | ###global define###
define ['libs/angular'], (angular) ->
'use strict'
angular.module 'controllers', [] | JavaScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/controllers.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/controllers/controllers.coffee | 1 | 6 |
CaryLandholt/AngularFun:scripts/controllers/controllers.coffee:1:completion | completion | ###global define###
define ['libs/angular'], (angular) -> | 'use strict'
angular.module 'controllers', [] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/controllers.coffee | MIT | 0ae299ec8a05ddbfb2e26f04898245b95f7ab37c | 672 | https://github.com/CaryLandholt/AngularFun/blob/0ae299ec8a05ddbfb2e26f04898245b95f7ab37c/scripts/controllers/controllers.coffee | 1 | 6 |
CaryLandholt/AngularFun:scripts/controllers/controllers.coffee:1:raw_corpus | raw_corpus | ###global define###
define ['angular'], (angular) ->
'use strict'
angular.module 'controllers', [] | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/controllers.coffee | MIT | d1cdd10b75a390445a1180aeef6460f89f7bfedb | 672 | https://github.com/CaryLandholt/AngularFun/blob/d1cdd10b75a390445a1180aeef6460f89f7bfedb/scripts/controllers/controllers.coffee | 1 | 6 | ||
CaryLandholt/AngularFun:scripts/controllers/controllers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global define###
define ['angular'], (angular) ->
'use strict'
angular.module 'controllers', []
``` | /*global define*/
define(['angular'], function(angular) {
'use strict';
return angular.module('controllers', []);
}); | CoffeeScript | JavaScript | CaryLandholt/AngularFun | scripts/controllers/controllers.coffee | MIT | d1cdd10b75a390445a1180aeef6460f89f7bfedb | 672 | https://github.com/CaryLandholt/AngularFun/blob/d1cdd10b75a390445a1180aeef6460f89f7bfedb/scripts/controllers/controllers.coffee | 1 | 6 |
CaryLandholt/AngularFun:scripts/controllers/controllers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global define*/
define(['angular'], function(angular) {
'use strict';
return angular.module('controllers', []);
});
``` | ###global define###
define ['angular'], (angular) ->
'use strict'
angular.module 'controllers', [] | JavaScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/controllers.coffee | MIT | d1cdd10b75a390445a1180aeef6460f89f7bfedb | 672 | https://github.com/CaryLandholt/AngularFun/blob/d1cdd10b75a390445a1180aeef6460f89f7bfedb/scripts/controllers/controllers.coffee | 1 | 6 |
CaryLandholt/AngularFun:scripts/controllers/controllers.coffee:1:completion | completion | ###global define###
define ['angular'], (angular) -> | 'use strict'
angular.module 'controllers', [] | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | scripts/controllers/controllers.coffee | MIT | d1cdd10b75a390445a1180aeef6460f89f7bfedb | 672 | https://github.com/CaryLandholt/AngularFun/blob/d1cdd10b75a390445a1180aeef6460f89f7bfedb/scripts/controllers/controllers.coffee | 1 | 6 |
cdglabs/apparatus:test/Serializer.test.coffee:1:raw_corpus | raw_corpus | roundTrip = (value) ->
serializer = new Serializer([])
serializedObject = serializer.jsonify(value)
serializedString = JSON.stringify(serializedObject)
deserializer = new Serializer([])
deserializedString = JSON.parse(serializedString)
deserializedObject = deserializer.dejsonify(deserializedString)
retu... | CoffeeScript | cdglabs/apparatus | test/Serializer.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Serializer.test.coffee | 10 | 19 | ||
cdglabs/apparatus:test/Serializer.test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
roundTrip = (value) ->
serializer = new Serializer([])
serializedObject = serializer.jsonify(value)
serializedString = JSON.stringify(serializedObject)
deserializer = new Serializer([])
deserializedString = JSON.parse(serializedString)
deserializedOb... | var roundTrip;
roundTrip = function(value) {
var deserializedObject, deserializedString, deserializer, serializedObject, serializedString, serializer;
serializer = new Serializer([]);
serializedObject = serializer.jsonify(value);
serializedString = JSON.stringify(serializedObject);
deserializer = new Seriali... | CoffeeScript | JavaScript | cdglabs/apparatus | test/Serializer.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Serializer.test.coffee | 10 | 19 |
cdglabs/apparatus:test/Serializer.test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var roundTrip;
roundTrip = function(value) {
var deserializedObject, deserializedString, deserializer, serializedObject, serializedString, serializer;
serializer = new Serializer([]);
serializedObject = serializer.jsonify(value);
serializedString = JSON.st... | roundTrip = (value) ->
serializer = new Serializer([])
serializedObject = serializer.jsonify(value)
serializedString = JSON.stringify(serializedObject)
deserializer = new Serializer([])
deserializedString = JSON.parse(serializedString)
deserializedObject = deserializer.dejsonify(deserializedString)
retu... | JavaScript | CoffeeScript | cdglabs/apparatus | test/Serializer.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Serializer.test.coffee | 10 | 19 |
cdglabs/apparatus:test/Serializer.test.coffee:1:completion | completion | roundTrip = (value) ->
serializer = new Serializer([])
serializedObject = serializer.jsonify(value)
serializedString = JSON.stringify(serializedObject) | deserializer = new Serializer([])
deserializedString = JSON.parse(serializedString)
deserializedObject = deserializer.dejsonify(deserializedString)
return deserializedObject | CoffeeScript | CoffeeScript | cdglabs/apparatus | test/Serializer.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Serializer.test.coffee | 10 | 19 |
cdglabs/apparatus:test/Serializer.test.coffee:2:raw_corpus | raw_corpus | testRoundTrip = (t, value) ->
# Note: Since serializing actually mutates the original object by adding IDs,
# we don't have to strip IDs from the output.
# TODO: We should be skeptical of the fact that serializing mutates the
# original object.
roundTripValue = roundTrip(value)
t.ok(
cyclicDeepEqual(v... | CoffeeScript | cdglabs/apparatus | test/Serializer.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Serializer.test.coffee | 21 | 31 | ||
cdglabs/apparatus:test/Serializer.test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
testRoundTrip = (t, value) ->
# Note: Since serializing actually mutates the original object by adding IDs,
# we don't have to strip IDs from the output.
# TODO: We should be skeptical of the fact that serializing mutates the
# original object.
roundT... | var testRoundTrip;
testRoundTrip = function(t, value) {
var roundTripValue;
// Note: Since serializing actually mutates the original object by adding IDs,
// we don't have to strip IDs from the output.
// TODO: We should be skeptical of the fact that serializing mutates the
// original object.
roundTripVa... | CoffeeScript | JavaScript | cdglabs/apparatus | test/Serializer.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Serializer.test.coffee | 21 | 31 |
cdglabs/apparatus:test/Serializer.test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var testRoundTrip;
testRoundTrip = function(t, value) {
var roundTripValue;
// Note: Since serializing actually mutates the original object by adding IDs,
// we don't have to strip IDs from the output.
// TODO: We should be skeptical of the fact that seri... | testRoundTrip = (t, value) ->
# Note: Since serializing actually mutates the original object by adding IDs,
# we don't have to strip IDs from the output.
# TODO: We should be skeptical of the fact that serializing mutates the
# original object.
roundTripValue = roundTrip(value)
t.ok(
cyclicDeepEqual(v... | JavaScript | CoffeeScript | cdglabs/apparatus | test/Serializer.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Serializer.test.coffee | 21 | 31 |
cdglabs/apparatus:test/Serializer.test.coffee:2:completion | completion | testRoundTrip = (t, value) ->
# Note: Since serializing actually mutates the original object by adding IDs,
# we don't have to strip IDs from the output.
# TODO: We should be skeptical of the fact that serializing mutates the | # original object.
roundTripValue = roundTrip(value)
t.ok(
cyclicDeepEqual(value, roundTripValue),
"round trip value should equal original value") | CoffeeScript | CoffeeScript | cdglabs/apparatus | test/Serializer.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Serializer.test.coffee | 21 | 31 |
cdglabs/apparatus:test/Serializer.test.coffee:3:raw_corpus | raw_corpus | stripIds = (value) ->
if _.isArray(value)
return (stripIds(subValue) for subValue in value)
else if _.isObject(value)
return _.mapObject(_.omit(value, 'id'), stripIds)
else
return value
test "Primitive values work", (t) ->
testRoundTrip(t, 23)
testRoundTrip(t, "primitive string")
testRoundTrip(... | CoffeeScript | cdglabs/apparatus | test/Serializer.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Serializer.test.coffee | 33 | 82 | ||
cdglabs/apparatus:test/Serializer.test.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
stripIds = (value) ->
if _.isArray(value)
return (stripIds(subValue) for subValue in value)
else if _.isObject(value)
return _.mapObject(_.omit(value, 'id'), stripIds)
else
return value
test "Primitive values work", (t) ->
testRoundTrip(t, 23... | var stripIds;
stripIds = function(value) {
var subValue;
if (_.isArray(value)) {
return (function() {
var i, len, results;
results = [];
for (i = 0, len = value.length; i < len; i++) {
subValue = value[i];
results.push(stripIds(subValue));
}
return results;
})(... | CoffeeScript | JavaScript | cdglabs/apparatus | test/Serializer.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Serializer.test.coffee | 33 | 82 |
cdglabs/apparatus:test/Serializer.test.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var stripIds;
stripIds = function(value) {
var subValue;
if (_.isArray(value)) {
return (function() {
var i, len, results;
results = [];
for (i = 0, len = value.length; i < len; i++) {
subValue = value[i];
results.push(str... | stripIds = (value) ->
if _.isArray(value)
return (stripIds(subValue) for subValue in value)
else if _.isObject(value)
return _.mapObject(_.omit(value, 'id'), stripIds)
else
return value
test "Primitive values work", (t) ->
testRoundTrip(t, 23)
testRoundTrip(t, "primitive string")
testRoundTrip(... | JavaScript | CoffeeScript | cdglabs/apparatus | test/Serializer.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Serializer.test.coffee | 33 | 82 |
cdglabs/apparatus:test/Serializer.test.coffee:3:completion | completion | stripIds = (value) ->
if _.isArray(value)
return (stripIds(subValue) for subValue in value)
else if _.isObject(value)
return _.mapObject(_.omit(value, 'id'), stripIds)
else
return value
test "Primitive values work", (t) ->
testRoundTrip(t, 23)
testRoundTrip(t, "primitive string")
testRoundTrip(... | a = {}
b = {}
a.x = b
a.y = b
testRoundTrip(t, a)
t.end()
test "Self-referential objects work", (t) ->
a = {}
a.x = a
testRoundTrip(t, a)
t.end()
test "Mutually-referential objects work", (t) ->
a = {}
b = {}
a.x = b
b.x = a
testRoundTrip(t, a)
t.end()
test "Prototypes are serialized", ... | CoffeeScript | CoffeeScript | cdglabs/apparatus | test/Serializer.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Serializer.test.coffee | 33 | 82 |
cdglabs/apparatus:test/Serializer.test.coffee:4:raw_corpus | raw_corpus | testRoundTrip(t, a)
t.end()
test "Double-underscored properties are not serialized", (t) ->
a = {x: 10, __secret: "my secret"}
aActual = stripIds(roundTrip(a))
aExpected = {x: 10}
t.ok(cyclicDeepEqual(aActual, aExpected))
t.end()
test "Functions are not serialized", (t) ->
a = {x: 10, y: (a) -> a * a}
... | CoffeeScript | cdglabs/apparatus | test/Serializer.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Serializer.test.coffee | 83 | 122 | ||
cdglabs/apparatus:test/Serializer.test.coffee:4:completion | completion | testRoundTrip(t, a)
t.end()
test "Double-underscored properties are not serialized", (t) ->
a = {x: 10, __secret: "my secret"}
aActual = stripIds(roundTrip(a))
aExpected = {x: 10}
t.ok(cyclicDeepEqual(aActual, aExpected))
t.end()
test "Functions are not serialized", (t) ->
a = {x: 10, y: (a) -> a * a}
... | builtin = {secretCode: secretCode}
a = {x: builtin}
serializer = new Serializer([builtin])
serializedObject = serializer.jsonify(a)
serializedString = JSON.stringify(serializedObject)
t.equal(
serializedString.indexOf("ABRACADABRA"), -1,
"serialized object does not contain secret word")
deseriali... | CoffeeScript | CoffeeScript | cdglabs/apparatus | test/Serializer.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Serializer.test.coffee | 83 | 122 |
Atraci/Atraci:coffee/_user.coffee:1:raw_corpus | raw_corpus | class User
@_cachedUserInfo: null
@getInfo: (success) ->
if @_cachedUserInfo isnt null
success? @_cachedUserInfo
else
# we will use user's ip to know where (s)he is
$.getJSON('http://ip-api.com/json').done((data) ->
@_cachedUserInfo = {}
@_cachedUserInfo.country = data.cou... | CoffeeScript | Atraci/Atraci | coffee/_user.coffee | MIT | d3fd00622f5f2e6c5d402c7a1ef2cd693f35e9ca | 800 | https://github.com/Atraci/Atraci/blob/d3fd00622f5f2e6c5d402c7a1ef2cd693f35e9ca/coffee/_user.coffee | 1 | 21 | ||
Atraci/Atraci:coffee/_user.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class User
@_cachedUserInfo: null
@getInfo: (success) ->
if @_cachedUserInfo isnt null
success? @_cachedUserInfo
else
# we will use user's ip to know where (s)he is
$.getJSON('http://ip-api.com/json').done((data) ->
@_cached... | var User;
User = (function() {
class User {
static getInfo(success) {
if (this._cachedUserInfo !== null) {
return typeof success === "function" ? success(this._cachedUserInfo) : void 0;
} else {
// we will use user's ip to know where (s)he is
return $.getJSON('http://ip-api.co... | CoffeeScript | JavaScript | Atraci/Atraci | coffee/_user.coffee | MIT | d3fd00622f5f2e6c5d402c7a1ef2cd693f35e9ca | 800 | https://github.com/Atraci/Atraci/blob/d3fd00622f5f2e6c5d402c7a1ef2cd693f35e9ca/coffee/_user.coffee | 1 | 21 |
Atraci/Atraci:coffee/_user.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var User;
User = (function() {
class User {
static getInfo(success) {
if (this._cachedUserInfo !== null) {
return typeof success === "function" ? success(this._cachedUserInfo) : void 0;
} else {
// we will use user's ip to know wh... | class User
@_cachedUserInfo: null
@getInfo: (success) ->
if @_cachedUserInfo isnt null
success? @_cachedUserInfo
else
# we will use user's ip to know where (s)he is
$.getJSON('http://ip-api.com/json').done((data) ->
@_cachedUserInfo = {}
@_cachedUserInfo.country = data.cou... | JavaScript | CoffeeScript | Atraci/Atraci | coffee/_user.coffee | MIT | d3fd00622f5f2e6c5d402c7a1ef2cd693f35e9ca | 800 | https://github.com/Atraci/Atraci/blob/d3fd00622f5f2e6c5d402c7a1ef2cd693f35e9ca/coffee/_user.coffee | 1 | 21 |
Atraci/Atraci:coffee/_user.coffee:1:completion | completion | class User
@_cachedUserInfo: null
@getInfo: (success) ->
if @_cachedUserInfo isnt null
success? @_cachedUserInfo
else
# we will use user's ip to know where (s)he is
$.getJSON('http://ip-api.com/json').done((data) ->
@_cachedUserInfo = {} | @_cachedUserInfo.country = data.country?.toLowerCase()
@_cachedUserInfo.countryCode = data.countryCode
@_cachedUserInfo.timezone = data.timezone
@_cachedUserInfo.lat = data.lat
@_cachedUserInfo.lon = data.lon
@_cachedUserInfo.ip = data.query
success? @_cachedUserInfo
... | CoffeeScript | CoffeeScript | Atraci/Atraci | coffee/_user.coffee | MIT | d3fd00622f5f2e6c5d402c7a1ef2cd693f35e9ca | 800 | https://github.com/Atraci/Atraci/blob/d3fd00622f5f2e6c5d402c7a1ef2cd693f35e9ca/coffee/_user.coffee | 1 | 21 |
Atraci/Atraci:coffee/_user.coffee:1:raw_corpus | raw_corpus | request = require('request')
class User
@_cachedUserInfo: null
@getRightCountyCode: (countryCode) ->
switch countryCode
when 'TW' then return 'zh-TW'
else return 'unknown'
@getInfo: (success) ->
if @_cachedUserInfo isnt null
success? @_cachedUserInfo
else
# we will use user'... | CoffeeScript | Atraci/Atraci | coffee/_user.coffee | MIT | 711494b66ceb9d2a3ede3d50a538c46c1d8d9db3 | 800 | https://github.com/Atraci/Atraci/blob/711494b66ceb9d2a3ede3d50a538c46c1d8d9db3/coffee/_user.coffee | 1 | 29 | ||
Atraci/Atraci:coffee/_user.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
request = require('request')
class User
@_cachedUserInfo: null
@getRightCountyCode: (countryCode) ->
switch countryCode
when 'TW' then return 'zh-TW'
else return 'unknown'
@getInfo: (success) ->
if @_cachedUserInfo isnt null
suc... | var User, request;
request = require('request');
User = (function() {
class User {
static getRightCountyCode(countryCode) {
switch (countryCode) {
case 'TW':
return 'zh-TW';
default:
return 'unknown';
}
}
static getInfo(success) {
if (this._cachedUs... | CoffeeScript | JavaScript | Atraci/Atraci | coffee/_user.coffee | MIT | 711494b66ceb9d2a3ede3d50a538c46c1d8d9db3 | 800 | https://github.com/Atraci/Atraci/blob/711494b66ceb9d2a3ede3d50a538c46c1d8d9db3/coffee/_user.coffee | 1 | 29 |
Atraci/Atraci:coffee/_user.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var User, request;
request = require('request');
User = (function() {
class User {
static getRightCountyCode(countryCode) {
switch (countryCode) {
case 'TW':
return 'zh-TW';
default:
return 'unknown';
}
}
... | request = require('request')
class User
@_cachedUserInfo: null
@getRightCountyCode: (countryCode) ->
switch countryCode
when 'TW' then return 'zh-TW'
else return 'unknown'
@getInfo: (success) ->
if @_cachedUserInfo isnt null
success? @_cachedUserInfo
else
# we will use user'... | JavaScript | CoffeeScript | Atraci/Atraci | coffee/_user.coffee | MIT | 711494b66ceb9d2a3ede3d50a538c46c1d8d9db3 | 800 | https://github.com/Atraci/Atraci/blob/711494b66ceb9d2a3ede3d50a538c46c1d8d9db3/coffee/_user.coffee | 1 | 29 |
Atraci/Atraci:coffee/_user.coffee:1:completion | completion | request = require('request')
class User
@_cachedUserInfo: null
@getRightCountyCode: (countryCode) ->
switch countryCode
when 'TW' then return 'zh-TW'
else return 'unknown'
@getInfo: (success) ->
if @_cachedUserInfo isnt null
success? @_cachedUserInfo
else | # we will use user's ip to know where (s)he is
request
url: 'http://ip-api.com/json',
json: true
, (error, response, data) =>
if not error and response.statusCode is 200
@_cachedUserInfo = {}
@_cachedUserInfo.country = data.country
@_cachedUserInfo.count... | CoffeeScript | CoffeeScript | Atraci/Atraci | coffee/_user.coffee | MIT | 711494b66ceb9d2a3ede3d50a538c46c1d8d9db3 | 800 | https://github.com/Atraci/Atraci/blob/711494b66ceb9d2a3ede3d50a538c46c1d8d9db3/coffee/_user.coffee | 1 | 29 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_compilation.coffee:1:raw_corpus | raw_corpus | # Ensure that carriage returns don't break compilation on Windows.
CoffeeScript: require('./../lib/coffee-script')
Lexer: require('./../lib/lexer')
js: CoffeeScript.compile("one\r\ntwo", {no_wrap: on})
ok js is "one;\ntwo;"
# Try out language extensions to CoffeeScript.
# Create the Node were going to add -- a lit... | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_compilation.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_compilation.coffee | 1 | 50 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_compilation.coffee:1:completion | completion | # Ensure that carriage returns don't break compilation on Windows.
CoffeeScript: require('./../lib/coffee-script')
Lexer: require('./../lib/lexer')
js: CoffeeScript.compile("one\r\ntwo", {no_wrap: on})
ok js is "one;\ntwo;"
# Try out language extensions to CoffeeScript.
# Create the Node were going to add -- a lit... | return false unless variable: @match(/^--(\w+)--/, 1)
@i: + variable.length + 4
@token 'EXTENSION', new SplitNode(variable)
true
# Compile with the extension.
js: CoffeeScript.compile 'return --tobesplit--', {no_wrap: on}
ok js is "return 'tobesplit'.split('');"
# Let's try a different extension, for Ruby-sty... | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_compilation.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_compilation.coffee | 1 | 50 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_compilation.coffee:2:raw_corpus | raw_corpus | @i: + words[0].length
@token 'EXTENSION', new WordArrayNode(words[1].split(/\s+/))
true
js: CoffeeScript.compile 'puts %w{one two three}', {no_wrap: on}
ok js is 'puts(["one", "two", "three"]);'
# Finally, let's try an extension that converts `a << b` into `a.push(b)`.
CoffeeScript.extend ->
return false unl... | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_compilation.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_compilation.coffee | 51 | 72 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_compilation.coffee:2:completion | completion | @i: + words[0].length
@token 'EXTENSION', new WordArrayNode(words[1].split(/\s+/))
true
js: CoffeeScript.compile 'puts %w{one two three}', {no_wrap: on}
ok js is 'puts(["one", "two", "three"]);'
# Finally, let's try an extension that converts `a << b` into `a.push(b)`. | CoffeeScript.extend ->
return false unless @chunk.match(/^<</)
@i: + 2
@token 'PROPERTY_ACCESS', '.'
@token 'IDENTIFIER', 'push'
js: CoffeeScript.compile 'a << b', {no_wrap: on}
ok js is 'a.push(b);'
Lexer.extensions: [] | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_compilation.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_compilation.coffee | 51 | 72 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | 1 | 50 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee:1:completion | completion | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | scope.sidebarContent[0].isOpen = true
else
scope.isShowHideWidgetsOpen = true
$element = $(element)
$parent = $element.parent()
$header = $element.find '.sidebar-header'
$accordion = $element.find '.sidebar-accordion'
$footer = $el... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee:3:raw_corpus | raw_corpus | $hitbox.on 'click', (event) ->
event.preventDefault()
isSidebarExpanded = !isSidebarExpanded
updateExpandedState()
$clickCover.on 'click', (event) ->
event.preventDefault()
isSidebarExpanded = false
updateExpand... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | 54 | 96 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
$hitbox.on 'click', (event) ->
event.preventDefault()
isSidebarExpanded = !isSidebarExpanded
updateExpandedState()
$clickCover.on 'click', (event) ->
event.preventDefault()
... | var sizer, timer;
$hitbox.on('click', function(event) {
var isSidebarExpanded;
event.preventDefault();
isSidebarExpanded = !isSidebarExpanded;
return updateExpandedState();
});
$clickCover.on('click', function(event) {
var isSidebarExpanded;
event.preventDefault();
isSidebarExpanded = false;
return up... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | 54 | 96 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var sizer, timer;
$hitbox.on('click', function(event) {
var isSidebarExpanded;
event.preventDefault();
isSidebarExpanded = !isSidebarExpanded;
return updateExpandedState();
});
$clickCover.on('click', function(event) {
var isSidebarExpanded;
event.pre... | $hitbox.on 'click', (event) ->
event.preventDefault()
isSidebarExpanded = !isSidebarExpanded
updateExpandedState()
$clickCover.on 'click', (event) ->
event.preventDefault()
isSidebarExpanded = false
updateExpand... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | 54 | 96 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee:3:completion | completion | $hitbox.on 'click', (event) ->
event.preventDefault()
isSidebarExpanded = !isSidebarExpanded
updateExpandedState()
$clickCover.on 'click', (event) ->
event.preventDefault()
isSidebarExpanded = false
updateExpand... | $element.off 'resize'
return
controller: ($scope, $window, configService, dashboardOverridesService, dashboardService) ->
$scope.footerLogos = configService.dashboardSidebar?.footer?.logos || []
$scope.calculatedWidgets = []
$scope.widgetOverrides = []
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | 54 | 96 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee:4:raw_corpus | raw_corpus | if $scope.widgetOverrides?[index].indexOverride?
indexOverride = $scope.widgetOverrides?[index].indexOverride
else
indexOverride = index
return {
label: dashboardService.getWidgetName(widget, index)
... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | 98 | 137 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee:4:completion | completion | if $scope.widgetOverrides?[index].indexOverride?
indexOverride = $scope.widgetOverrides?[index].indexOverride
else
indexOverride = index
return {
label: dashboardService.getWidgetName(widget, index)
... | $scope.calculatedWidgets.splice(index, 1)
# Save all widget positions
_.each $scope.calculatedWidgets, (widgetOverride, index) ->
widgetOverride.indexOverride = index
$scope.widgetOverrides[widgetOverride.index].indexOverride = index
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/directives/directives.dashboardSidebar.coffee | 98 | 137 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.