commit stringlengths 40 40 | old_file stringlengths 9 134 | new_file stringlengths 9 134 | old_contents stringlengths 0 2.21k | new_contents stringlengths 34 3.19k | subject stringlengths 14 340 | message stringlengths 15 1.43k | lang stringclasses 1
value | license stringclasses 13
values | repos stringlengths 9 29k |
|---|---|---|---|---|---|---|---|---|---|
becb2e7a0659dcb120c25adf09fb627c1bd3803e | client/app/lib/commonviews/buttonviewwithprogressbar.coffee | client/app/lib/commonviews/buttonviewwithprogressbar.coffee | kd = require 'kd'
KDButtonView = kd.ButtonView
KDProgressBarView = kd.ProgressBarView
KDCustomHTMLView = kd.CustomHTMLView
module.exports = class ButtonViewWithProgressBar extends KDCustomHTMLView
constructor: (options = {}, data) ->
super options, data
o = @getOptions() or {}
buttonOptions = o.buttonOptions or {}
progressOptions = o.progressOptions or {}
loaderOptions = o.loaderOptions or {}
buttonOptions.cb = buttonOptions.callback
buttonOptions.callback = @bound 'handleCallback'
progressOptions.cssClass = kd.utils.curry 'hidden', progressOptions.cssClass
@addSubView @button = new KDButtonView buttonOptions
@addSubView @progressBar = new KDProgressBarView progressOptions
handleCallback: ->
buttonOptions = @getOption 'buttonOptions' or {}
buttonOptions.cb?.call()
@startProgress()
startProgress: ->
@button.disable()
@progressBar.show()
resetProgress: ->
@show()
@progressBar.hide()
@updateProgress 0
@button.enable()
updateProgress: (value, unit, label) ->
@progressBar.updateBar value, unit, label
| kd = require 'kd'
KDButtonView = kd.ButtonView
KDProgressBarView = kd.ProgressBarView
KDCustomHTMLView = kd.CustomHTMLView
module.exports = class ButtonViewWithProgressBar extends KDCustomHTMLView
constructor: (options = {}, data) ->
super options, data
o = @getOptions() or {}
o.startProgress ?= yes
buttonOptions = o.buttonOptions or {}
progressOptions = o.progressOptions or {}
loaderOptions = o.loaderOptions or {}
buttonOptions.cb = buttonOptions.callback
buttonOptions.callback = @bound 'handleCallback'
progressOptions.cssClass = kd.utils.curry 'hidden', progressOptions.cssClass
@addSubView @button = new KDButtonView buttonOptions
@addSubView @progressBar = new KDProgressBarView progressOptions
handleCallback: ->
buttonOptions = @getOption 'buttonOptions' or {}
buttonOptions.cb?.call()
@startProgress() if @getOption 'startProgress'
startProgress: ->
@button.disable()
@progressBar.show()
resetProgress: ->
@show()
@progressBar.hide()
@updateProgress 0
@button.enable()
updateProgress: (value, unit, label) ->
@progressBar.updateBar value, unit, label
| Add "startProgress" parameter to start to show progress bar. | ButtonViewWithProgressBar: Add "startProgress" parameter to start to show progress bar.
| CoffeeScript | agpl-3.0 | drewsetski/koding,sinan/koding,sinan/koding,kwagdy/koding-1,koding/koding,szkl/koding,alex-ionochkin/koding,andrewjcasal/koding,andrewjcasal/koding,gokmen/koding,usirin/koding,cihangir/koding,alex-ionochkin/koding,andrewjcasal/koding,drewsetski/koding,koding/koding,gokmen/koding,cihangir/koding,jack89129/koding,szkl/koding,szkl/koding,acbodine/koding,szkl/koding,kwagdy/koding-1,rjeczalik/koding,koding/koding,rjeczalik/koding,koding/koding,sinan/koding,usirin/koding,usirin/koding,gokmen/koding,usirin/koding,andrewjcasal/koding,drewsetski/koding,koding/koding,mertaytore/koding,sinan/koding,acbodine/koding,mertaytore/koding,rjeczalik/koding,usirin/koding,jack89129/koding,alex-ionochkin/koding,mertaytore/koding,jack89129/koding,mertaytore/koding,rjeczalik/koding,alex-ionochkin/koding,gokmen/koding,alex-ionochkin/koding,mertaytore/koding,acbodine/koding,sinan/koding,szkl/koding,kwagdy/koding-1,acbodine/koding,sinan/koding,andrewjcasal/koding,jack89129/koding,koding/koding,jack89129/koding,andrewjcasal/koding,rjeczalik/koding,gokmen/koding,acbodine/koding,andrewjcasal/koding,sinan/koding,usirin/koding,szkl/koding,szkl/koding,cihangir/koding,usirin/koding,cihangir/koding,mertaytore/koding,sinan/koding,kwagdy/koding-1,jack89129/koding,mertaytore/koding,alex-ionochkin/koding,cihangir/koding,rjeczalik/koding,drewsetski/koding,mertaytore/koding,drewsetski/koding,jack89129/koding,andrewjcasal/koding,cihangir/koding,koding/koding,gokmen/koding,acbodine/koding,rjeczalik/koding,szkl/koding,alex-ionochkin/koding,drewsetski/koding,drewsetski/koding,kwagdy/koding-1,jack89129/koding,kwagdy/koding-1,rjeczalik/koding,gokmen/koding,alex-ionochkin/koding,acbodine/koding,cihangir/koding,kwagdy/koding-1,cihangir/koding,koding/koding,drewsetski/koding,acbodine/koding,kwagdy/koding-1,usirin/koding,gokmen/koding |
0344c541208e76c0d06f699ee025d226fccc8eb0 | src/atom-fsharp/keymaps/core.cson | src/atom-fsharp/keymaps/core.cson | # Keybindings require three things to be fully defined: A selector that is
# matched against the focused element, the keystroke and the command to
# execute.
#
# Below is a basic keybinding which registers on all platforms by applying to
# the root workspace element.
# For more detailed documentation see
# https://atom.io/docs/latest/advanced/keymaps
'atom-text-editor[data-grammar~=fsharp]':
'alt-enter': 'FSI:Send-Selection'
'alt-/':'FSI:Send-Line'
'ctrl-space': 'fsharp:autocomplete'
'cmd-space': 'fsharp:autocomplete'
| # Keybindings require three things to be fully defined: A selector that is
# matched against the focused element, the keystroke and the command to
# execute.
#
# Below is a basic keybinding which registers on all platforms by applying to
# the root workspace element.
# For more detailed documentation see
# https://atom.io/docs/latest/advanced/keymaps
'atom-workspace atom-text-editor:not([mini])[data-grammar~=fsharp]':
'alt-enter': 'FSI:Send-Selection'
'alt-/':'FSI:Send-Line'
'ctrl-space': 'fsharp:autocomplete'
'cmd-space': 'fsharp:autocomplete'
| Change keymap selector (fixes alt-enter override in OSX) | Change keymap selector (fixes alt-enter override in OSX)
| CoffeeScript | mit | ionide/ionide-atom-fsharp,dangets/ionide-atom-fsharp,ionide/ionide-fsharp |
1745208f1728f5d3289736abc011675fbaeafcc8 | app/assets/javascripts/views/overlays/figure_overlay_view.js.coffee | app/assets/javascripts/views/overlays/figure_overlay_view.js.coffee | ETahi.FigureOverlayView = ETahi.OverlayView.extend
templateName: 'overlays/figure_overlay'
layoutName: 'layouts/no_assignee_overlay_layout' #TODO: include assignee here?
uploads: Ember.ArrayController.create content: []
figures: null
didInsertElement: ->
@set 'figures', @get('controller.paper.figures')
uploader = $('.js-jquery-fileupload')
uploader.fileupload
url: "/papers/#{@controller.get('paper.id')}/figures"
dataType: 'json'
method: 'POST'
uploader.on 'fileuploadprocessalways', (e, data) =>
file = data.files[0]
@uploads.pushObject
filename: file.name
preview: file.preview?.toDataURL()
progress: 0
progressBarStyle: "width: 0%;"
uploader.on 'fileuploadprogress', (e, data) =>
currentUpload = @uploads.findBy('filename', data.files[0].name)
progress = parseInt(data.loaded / data.total * 100.0, 10) #rounds the number
Ember.setProperties currentUpload,
progress: progress
progressBarStyle: "width: #{progress}%;"
uploader.on 'fileuploaddone', (e, data) =>
newUpload = @uploads.findBy 'filename', data.files[0].name
@uploads.removeObject newUpload
store = @get('controller.store')
updatedFigures = _.map data.result.figures, (figure) ->
store.createRecord 'figure', figure
@figures.pushObjects updatedFigures
| ETahi.FigureOverlayView = ETahi.OverlayView.extend
templateName: 'overlays/figure_overlay'
layoutName: 'layouts/no_assignee_overlay_layout' #TODO: include assignee here?
uploads: []
figures: Em.computed.alias('controller.paper.figures')
setupUpload: (->
uploader = $('.js-jquery-fileupload')
uploader.fileupload
url: "/papers/#{@controller.get('paper.id')}/figures"
dataType: 'json'
method: 'POST'
uploader.on 'fileuploadprocessalways', (e, data) =>
file = data.files[0]
@uploads.pushObject
filename: file.name
preview: file.preview?.toDataURL()
progress: 0
progressBarStyle: "width: 0%;"
uploader.on 'fileuploadprogress', (e, data) =>
currentUpload = @uploads.findBy('filename', data.files[0].name)
progress = parseInt(data.loaded / data.total * 100.0, 10) #rounds the number
Ember.setProperties currentUpload,
progress: progress
progressBarStyle: "width: #{progress}%;"
uploader.on 'fileuploaddone', (e, data) =>
newUpload = @uploads.findBy 'filename', data.files[0].name
@uploads.removeObject newUpload
store = @get('controller.store')
updatedFigures = _.map data.result.figures, (figure) ->
store.push 'figure', figure
@get('figures').pushObjects updatedFigures
).on('didInsertElement')
| Fix deleting of newly uploaded figures | Fix deleting of newly uploaded figures
| CoffeeScript | mit | johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi |
bec2ac4eb5482644dd6ee574421583687451c049 | lib/language-idris.coffee | lib/language-idris.coffee | IdrisController = require './idris-controller'
{CompositeDisposable} = require 'atom'
module.exports =
active: false
statusbar: null
config:
pathToIdris:
type: 'string'
default: 'idris'
description: 'Path to the idris executable'
activate: ->
@disposables = new CompositeDisposable
@active = @initIdris()
if not @isActive()
@disposables.add myself=atom.workspace.onDidOpen (event) =>
item = event.item
@active = @initIdris()
if @isActive()
myself.dispose()
initIdris: () ->
if @isActive()
true
else
idrisFileOpened = atom.workspace.getTextEditors().some @isIdrisFile
if idrisFileOpened
@controller = new IdrisController
if @statusbar
@controller.attachStatusIndicator @statusbar
subscription = atom.commands.add 'atom-text-editor[data-grammar~="idris"]', @controller.getCommands()
@subscriptions = new CompositeDisposable
@subscriptions.add subscription
true
else
false
isActive: ->
@active
isIdrisFile: (editor) ->
editor.getGrammar?()?.scopeName == 'source.idris'
deactivate: ->
@subscriptions.dispose()
this.controller.destroy()
consumeStatusBar: (statusbar) ->
@statusbar = statusbar
@controller?.attachStatusIndicator statusbar
| IdrisController = require './idris-controller'
{CompositeDisposable} = require 'atom'
module.exports =
config:
pathToIdris:
type: 'string'
default: 'idris'
description: 'Path to the idris executable'
activate: ->
@controller = new IdrisController
subscription = atom.commands.add 'atom-text-editor[data-grammar~="idris"]', @controller.getCommands()
@subscriptions = new CompositeDisposable
@subscriptions.add subscription
deactivate: ->
@subscriptions.dispose()
this.controller.destroy()
consumeStatusBar: (statusBar) ->
@controller.attachStatusIndicator statusBar
| Revert "only start the idris compiler when there is an idris file opened" | Revert "only start the idris compiler when there is an idris file opened"
This reverts commit 89c0032aca1593cc851a65e7836ea8f539258a11.
Conflicts:
lib/language-idris.coffee
| CoffeeScript | mit | idris-hackers/atom-language-idris |
122204a9f132359a6552b9bfe8a3c8f8c7236eef | atom/config.cson | atom/config.cson | "*":
editor:
fontFamily: "input"
fontSize: 13
showInvisibles: true
showIndentGuide: true
invisibles: {}
core:
themes: [
"one-dark-ui"
"facebook-syntax"
]
welcome:
showOnStartup: false
whitespace:
removeTrailingWhitespace: true
ignoreWhitespaceOnCurrentLine: false
ensureSingleTrailingNewline: true
"exception-reporting":
userId: "b6917109-8650-33d4-94c7-9edad015d73f"
linter: {}
"highlight-column": {}
"block-cursor":
primaryColor:
red: 195
green: 59
blue: 50
alpha: 1
"highlight-line":
hideHighlightOnSelect: true
| "*":
editor:
fontFamily: "input"
fontSize: 12
showInvisibles: true
showIndentGuide: true
invisibles: {}
core:
themes: [
"atom-material-ui"
"gotham-syntax"
]
welcome:
showOnStartup: false
whitespace:
removeTrailingWhitespace: true
ignoreWhitespaceOnCurrentLine: false
ensureSingleTrailingNewline: true
"exception-reporting":
userId: "b6917109-8650-33d4-94c7-9edad015d73f"
linter: {}
"highlight-column": {}
"block-cursor":
primaryColor:
red: 195
green: 59
blue: 50
alpha: 1
"highlight-line":
hideHighlightOnSelect: true
| Update atom theme and change font-size | Update atom theme and change font-size
| CoffeeScript | mit | therealechan/dotfiles,chankaward/dotfiles,chankaward/dotfiles,therealechan/dotfiles,therealechan/dotfiles,chankaward/dotfiles |
cec08d708f40d35ca8896990fb316d3f5d57ee96 | src/filings-cli.coffee | src/filings-cli.coffee | fs = require 'fs'
optimist = require 'optimist'
parseOptions = (args=[]) ->
options = optimist(args)
options.usage('Usage: filings <command>')
options.alias('h', 'help').describe('h', 'Print this usage message')
options.alias('v', 'version').describe('v', 'Print the filings version')
options
module.exports =
run: (args=process.argv[2..]) ->
options = parseOptions(args)
if options.argv.v
console.log JSON.parse(fs.readFileSync('package.json')).version
else if options.argv.h
options.showHelp()
else if command = options.argv._.shift()
console.error "Unrecognized command: #{command}"
else
options.showHelp()
| fs = require 'fs'
path = require 'path'
optimist = require 'optimist'
{FormFour} = require './filings'
parseOptions = (args=[]) ->
options = optimist(args)
options.usage('Usage: filings <command>')
options.alias('h', 'help').describe('h', 'Print this usage message')
options.alias('v', 'version').describe('v', 'Print the filings version')
options
module.exports =
run: (args=process.argv[2..]) ->
options = parseOptions(args)
[command, commandArgs...] = options.argv._
if options.argv.v
console.log JSON.parse(fs.readFileSync('package.json')).version
else if options.argv.h
options.showHelp()
else if command = options.argv._.shift()
switch command
when 'profit'
reportPath = path.resolve(process.cwd(), commandArgs.shift())
FormFour.open reportPath, (error, formFour) ->
if error?
console.error(error)
else
console.log(formFour.getProfit())
else
console.error "Unrecognized command: #{command}"
else
options.showHelp()
| Add form 4 profit command | Add form 4 profit command
| CoffeeScript | mit | parrondo/filings,kevinsawicki/filings,krisalexander/filings |
6c90cf0d19fb0ceb1a8200b90bd9819f59b7de25 | src/client/docs.coffee | src/client/docs.coffee | # Helper function needed to deal with array-like stylesheet objects.
toArray = (obj) -> Array::slice.call obj
# Scans your stylesheet for pseudo classes and adds a class with the same name.
# Thanks to Knyle Style Sheets for the idea.
processStyles = ->
# Compile regular expression.
pseudos = [ 'link', 'visited', 'hover', 'active', 'focus', 'target',
'enabled', 'disabled', 'checked' ]
pseudoRe = new RegExp(":((" + pseudos.join(")|(") + "))", "gi")
# Only get inline style elements, and only the first one
styleSheet = toArray(document.styleSheets).filter((ss) -> not ss.href?)[0]
if styleSheet?
processedStyles = toArray(styleSheet.cssRules).filter((rule) ->
# Keep only rules with pseudo classes.
rule.selectorText and rule.selectorText.match pseudoRe
).map((rule) ->
# Replace : with . and encoded :
rule.cssText.replace pseudoRe, ".\\3A $1"
).reduce((prev, cur) ->
prev + cur
)
# Add the styles to the document
styleEl = document.createElement "style"
styleEl.appendChild document.createTextNode processedStyles
document.getElementsByTagName("head")[0].appendChild styleEl
| # Scans your stylesheet for pseudo classes and adds a class with the same name.
# Thanks to Knyle Style Sheets for the idea.
$ ->
addPseudoClasses()
add = (a, b) -> a + b
addPseudoClasses = ->
# Compile regular expression.
pseudos = [ 'link', 'visited', 'hover', 'active', 'focus', 'target',
'enabled', 'disabled', 'checked' ]
pseudoRe = new RegExp(":((" + pseudos.join(")|(") + "))", "gi")
processedPseudoClasses = _.toArray(document.styleSheets)
# Filter out `link` elements.
.filter(
(ss) ->
not ss.href?
).map((ss) ->
_.toArray(ss.cssRules)
.filter((rule) ->
# Keep only rules with pseudo classes.
rule.selectorText and rule.selectorText.match pseudoRe
).map((rule) ->
# Replace : with . and encoded :
rule.cssText.replace pseudoRe, ".\\3A $1"
).reduce(add)
).reduce(add, '')
if processedPseudoClasses.length
# Add a new style element with the processed pseudo class styles.
$('head').append $('<style />').text(processedPseudoClasses)
| Refactor pseudo class selector script a bit | Refactor pseudo class selector script a bit
| CoffeeScript | mit | paulwellnerbou/styledocco,ooooooo-q/styledocco,ooooooo-q/styledocco,paulwellnerbou/styledocco,trungnghia112/styledocco,trungnghia112/styledocco,jacobrask/styledocco |
3735b4c7f839615af9af94d7aef461be9b020577 | app/js/jail_iframe/initializers/scrollbarSuppressor.coffee | app/js/jail_iframe/initializers/scrollbarSuppressor.coffee | scrollbarWidth = 0
FactlinkJailRoot.loaded_promise.then ->
# Create the measurement nod; see http://davidwalsh.name/detect-scrollbar-width
scrollDiv = document.createElement("div");
$(scrollDiv).css(
width: "100px"
height: "100px"
overflow: "scroll"
position: "absolute"
top: "-9999px"
)
document.body.appendChild(scrollDiv)
scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
document.body.removeChild(scrollDiv)
console.log 'scrollbar width: ', scrollbarWidth
# To check for scrollbars on the window, use the slightly unusual window.innerHeight
# rather than document.documentElement.clientHeight so it works in css compat mode.
window_has_scrollbar = -> window.innerHeight < document.documentElement.scrollHeight
FactlinkJailRoot.on 'modalOpened', ->
if scrollbarWidth > 0 && window_has_scrollbar()
console.log 'has scrollbar!'
document.documentElement.setAttribute('data-factlink-suppress-scrolling', '')
FactlinkJailRoot.on 'modalClosed', -> document.documentElement.removeAttribute('data-factlink-suppress-scrolling')
| scrollbarWidth = 0
FactlinkJailRoot.loaded_promise.then ->
# Create the measurement nod; see http://davidwalsh.name/detect-scrollbar-width
scrollDiv = document.createElement("div");
$(scrollDiv).css(
width: "100px"
height: "100px"
overflow: "scroll"
position: "absolute"
top: "-9999px"
)
document.body.appendChild(scrollDiv)
scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
document.body.removeChild(scrollDiv)
console.log 'scrollbar width: ', scrollbarWidth
# To check for scrollbars on the window, use the slightly unusual window.innerHeight
# rather than document.documentElement.clientHeight so it works in css compat mode.
window_has_scrollbar = -> window.innerHeight < document.documentElement.scrollHeight
saved_marginRight = null
FactlinkJailRoot.on 'modalOpened', ->
if scrollbarWidth > 0 && window_has_scrollbar()
console.log 'has scrollbar!'
saved_marginRight = document.documentElement.style.marginRight
document.documentElement.style.marginRight = scrollbarWidth + 'px'
document.documentElement.setAttribute('data-factlink-suppress-scrolling', '')
FactlinkJailRoot.on 'modalClosed', ->
if saved_marginRight != null
document.documentElement.style.marginRight = saved_marginRight
document.documentElement.removeAttribute('data-factlink-suppress-scrolling')
| Change html margin when the sidebar opens to compensate for change in | Change html margin when the sidebar opens to compensate for change in
| CoffeeScript | mit | Factlink/js-library,Factlink/js-library,Factlink/js-library |
0db7df6c144d4061059a35d68d428e14c07d7ac4 | app/assets/javascripts/admin/order_cycles/order_cycles.js.erb.coffee | app/assets/javascripts/admin/order_cycles/order_cycles.js.erb.coffee | angular.module('admin.orderCycles', ['ngTagsInput', 'admin.indexUtils', 'admin.enterprises'])
.directive 'datetimepicker', ($timeout, $parse) ->
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
$timeout ->
flatpickr(element, Object.assign({},
window.FLATPICKR_DATETIME_DEFAULT, {
onOpen: (selectedDates, dateStr, instance) ->
instance.setDate(ngModel.$modelValue)
instance.input.dispatchEvent(new Event('focus', { bubbles: true }));
}));
.directive 'ofnOnChange', ->
(scope, element, attrs) ->
element.bind 'change', ->
scope.$apply(attrs.ofnOnChange)
.directive 'ofnSyncDistributions', ->
(scope, element, attrs) ->
element.bind 'change', ->
if !$(this).is(':checked')
scope.$apply ->
scope.removeDistributionOfVariant(attrs.ofnSyncDistributions)
| angular.module('admin.orderCycles', ['ngTagsInput', 'admin.indexUtils', 'admin.enterprises'])
.directive 'datetimepicker', ($timeout, $parse) ->
require: "ngModel"
link: (scope, element, attrs, ngModel) ->
$timeout ->
fp = flatpickr(element, Object.assign({},
window.FLATPICKR_DATETIME_DEFAULT, {
onOpen: (selectedDates, dateStr, instance) ->
instance.setDate(ngModel.$modelValue)
instance.input.dispatchEvent(new Event('focus', { bubbles: true }));
}));
fp.minuteElement.addEventListener "keyup", (e) ->
if !isNaN(event.target.value)
fp.setDate(fp.selectedDates[0].setMinutes(e.target.value), true)
fp.hourElement.addEventListener "keyup", (e) ->
if !isNaN(event.target.value)
fp.setDate(fp.selectedDates[0].setHours(e.target.value), true)
.directive 'ofnOnChange', ->
(scope, element, attrs) ->
element.bind 'change', ->
scope.$apply(attrs.ofnOnChange)
.directive 'ofnSyncDistributions', ->
(scope, element, attrs) ->
element.bind 'change', ->
if !$(this).is(':checked')
scope.$apply ->
scope.removeDistributionOfVariant(attrs.ofnSyncDistributions)
| Add keyup event listener on hour/minute inputs | Add keyup event listener on hour/minute inputs
- To set the date (and trigger the onChange event) when the user is typing through its keyboard
| CoffeeScript | agpl-3.0 | lin-d-hop/openfoodnetwork,openfoodfoundation/openfoodnetwork,mkllnk/openfoodnetwork,Matt-Yorkley/openfoodnetwork,openfoodfoundation/openfoodnetwork,mkllnk/openfoodnetwork,Matt-Yorkley/openfoodnetwork,Matt-Yorkley/openfoodnetwork,lin-d-hop/openfoodnetwork,mkllnk/openfoodnetwork,mkllnk/openfoodnetwork,lin-d-hop/openfoodnetwork,lin-d-hop/openfoodnetwork,openfoodfoundation/openfoodnetwork,Matt-Yorkley/openfoodnetwork,openfoodfoundation/openfoodnetwork |
895d2d3334bb1ba6909df726e560ccc19ff18928 | lib/dev-live-reload.coffee | lib/dev-live-reload.coffee | UIWatcher = require './ui-watcher'
module.exports =
activate: (state) ->
uiWatcher = new UIWatcher
themeManager: atom.themes
rootView.command 'dev-live-reload:reload-all', ->
uiWatcher.reloadAll()
| $ = require 'jquery'
UIWatcher = require './ui-watcher'
module.exports =
activate: (state) ->
# HACK: I need an actvation event when the ui or packages are all loaded.
# It cant watch all the packages until they are all loaded.
createUIWatcher = ->
uiWatcher = new UIWatcher
themeManager: atom.themes
$(window).off 'focus', createUIWatcher
$(window).on 'focus', createUIWatcher
rootView.command 'dev-live-reload:reload-all', ->
uiWatcher.reloadAll()
| Create the UIWatcher after everything has been loaded | Create the UIWatcher after everything has been loaded | CoffeeScript | mit | atom/dev-live-reload |
69846018df072a8180a67d785b7990523b832bb4 | src/trix/controllers/level_2_input_controller.coffee | src/trix/controllers/level_2_input_controller.coffee | #= require trix/controllers/abstract_input_controller
class Trix.Level2InputController extends Trix.AbstractInputController
events:
beforeinput: (event) ->
log(event)
input: (event) ->
log(event)
log = (event) ->
console.log("[#{event.type}] #{event.inputType}: #{JSON.stringify(event.data)}")
| #= require trix/controllers/abstract_input_controller
{objectsAreEqual} = Trix
class Trix.Level2InputController extends Trix.AbstractInputController
mutationIsExpected: (mutationSummary) ->
result = objectsAreEqual(mutationSummary, @inputSummary)
console.log("[mutation] [#{if result then "expected" else "unexpected"}] #{JSON.stringify({mutationSummary})}")
delete @inputSummary
result
events:
beforeinput: (event) ->
@inputSummary = @[event.inputType]?(event)
console.group(event.inputType)
console.log("[#{event.type}] #{JSON.stringify(event.data)} #{JSON.stringify({@inputSummary})}")
input: (event) ->
console.log("[#{event.type}] #{JSON.stringify(event.data)}")
Promise.resolve().then(console.groupEnd)
insertText: (event) ->
textAdded = event.data
@delegate?.inputControllerWillPerformTyping()
@responder?.insertString(textAdded)
{textAdded}
deleteContentBackward: (event) ->
textDeleted = [event.getTargetRanges()...].map(staticRangeToRange).join("")
@delegate?.inputControllerWillPerformTyping()
@responder?.deleteInDirection("backward")
{textDeleted}
staticRangeToRange = (staticRange) ->
range = document.createRange()
range.setStart(staticRange.startContainer, staticRange.startOffset)
range.setEnd(staticRange.endContainer, staticRange.endOffset)
range
| Add "insertText" and "deleteContentBackward" inputType handlers | Add "insertText" and "deleteContentBackward" inputType handlers
| CoffeeScript | mit | basecamp/trix,basecamp/trix,basecamp/trix,basecamp/trix |
2a3b6e46d1a123c581825f50e2689c3eb2c97361 | core/app/backbone/views/react_install_extension_button.coffee | core/app/backbone/views/react_install_extension_button.coffee | determineBrowser = ->
[ 'chrome', 'firefox', 'safari', 'phantom_js', 'unsupported-browser' ]
.filter( (browser) -> $('html.'+browser).length
)[0]
extension_link_by_browser =
firefox: 'https://static.factlink.com/extension/firefox/factlink-latest.xpi'
safari: 'https://static.factlink.com/extension/firefox/factlink.safariextz'
chrome: 'javascript:chrome.webstore.install()'
icon_class_by_browser =
firefox: 'install-firefox'
safari: 'install-safari'
chrome: 'install-chrome'
window.ReactInstallExtensionButton = React.createClass
displayName: 'ReactInstallExtensionButton'
render: ->
browserName = determineBrowser()
extension_link = extension_link_by_browser[browserName]
icon_class = icon_class_by_browser[browserName]
extra_class = if @props.huge_button then 'button-huge' else null
if document.documentElement.getAttribute('data-factlink-extension-loaded') != undefined
_button ['button', extra_class,
disabled: true],
'Factlink already installed.'
else
_div [],
_div ['visible-when-chrome'],
_a ['button-success', extra_class, href: extension_link],
_span [icon_class]
'Install Factlink for ' + browserName.capitalize()
_div ['visible-when-firefox'],
_a ['button-success', extra_class, href: extension_link],
_span [icon_class]
'Install Factlink for ' + browserName.capitalize()
_div ['visible-when-safari'],
_a ['button-success', extra_class, href: extension_link],
_span [icon_class]
'Install Factlink for ' + browserName.capitalize()
| determineBrowser = ->
[ 'chrome', 'firefox', 'safari', 'phantom_js', 'unsupported-browser' ]
.filter( (browser) -> $('html.'+browser).length
)[0]
extension_link_by_browser =
firefox: 'https://static.factlink.com/extension/firefox/factlink-latest.xpi'
safari: 'https://static.factlink.com/extension/firefox/factlink.safariextz'
chrome: 'javascript:chrome.webstore.install()'
icon_class_by_browser =
firefox: 'install-firefox'
safari: 'install-safari'
chrome: 'install-chrome'
window.ReactInstallExtensionButton = React.createClass
displayName: 'ReactInstallExtensionButton'
render: ->
browserName = determineBrowser()
extension_link = extension_link_by_browser[browserName]
icon_class = icon_class_by_browser[browserName]
extra_class = if @props.huge_button then 'button-huge' else null
if document.documentElement.getAttribute('data-factlink-extension-loaded') != undefined
_button ['button', extra_class,
disabled: true],
'Factlink already installed.'
else
_a ['button-success', extra_class, href: extension_link],
_span [icon_class]
'Install Factlink for ' + browserName.capitalize()
| Simplify browser-specific extension install logic | Simplify browser-specific extension install logic
| CoffeeScript | mit | Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core,daukantas/factlink-core |
5e174189c268c1540eb3a90ea2e431d6f3d0ce2f | coffee/node_readline.coffee | coffee/node_readline.coffee | # IMPORTANT: choose one
RL_LIB = "libreadline" # NOTE: libreadline is GPL
#RL_LIB = "libedit"
HISTORY_FILE = require('path').join(process.env.HOME, '.mal-history')
rlwrap = {} # namespace for this module in web context
ffi = require('ffi')
fs = require('fs')
rllib = ffi.Library(RL_LIB, {
'readline': ['string', ['string']],
'add_history': ['int', ['string']]})
rl_history_loaded = false
exports.readline = rlwrap.readline = (prompt = 'user> ') ->
if !rl_history_loaded
rl_history_loaded = true
lines = []
if fs.existsSync(HISTORY_FILE)
lines = fs.readFileSync(HISTORY_FILE).toString().split("\n");
# Max of 2000 lines
lines = lines[Math.max(lines.length - 2000, 0)..]
rllib.add_history(line) for line in lines when line != ""
line = rllib.readline prompt
if line
rllib.add_history line
try
fs.appendFileSync HISTORY_FILE, line + "\n"
catch exc
true
line
# vim: ts=2:sw=2
| readlineSync = require('readline-sync');
exports.readline = (prompt = 'user> ') ->
readlineSync.question(prompt)
| Fix CoffeeScript example. Use readline-sync. Old ffi thing does not work. | Fix CoffeeScript example. Use readline-sync. Old ffi thing does not work.
| CoffeeScript | mpl-2.0 | treeform/mal,treeform/mal,treeform/mal,treeform/mal,treeform/mal,treeform/mal,treeform/mal,treeform/mal,treeform/mal,treeform/mal,treeform/mal,treeform/mal,treeform/mal,treeform/mal,treeform/mal,treeform/mal |
1644dc12c6519545843ae53841cee6262b29ddbe | src/index.cjsx | src/index.cjsx | React = require 'react'
deep = require 'deep-get-set'
module.exports = React.createClass
displayName: "SimpleTable"
propTypes:
columns: React.PropTypes.array
data: React.PropTypes.array
render: ->
columns = @props.columns.map (column) ->
if typeof column is "string"
<th key={column}>{column}</th>
else
<th key={column.displayName}>{column.displayName}</th>
body = @props.data.map (rowData, i) =>
row = []
for column in @props.columns
# Columns can either be a simple string or be an object that defines
# both a displayName and path for accessing the data.
if typeof column is "string"
datum = deep(rowData, column.toLowerCase())
key = i + "-" + column
else if column.path?
datum = deep(rowData, column.path)
key = i + "-" + column.path
else if column.function?
datum = column.function(rowData)
key = i + "-" + column.displayName
row.push <td key={key}>{datum}</td>
return <tr key={i}>{row}</tr>
return (
<table>
<thead>
<tr>{columns}</tr>
</thead>
<tbody>{body}</tbody>
</table>
)
| React = require 'react'
deep = require 'deep-get-set'
module.exports = React.createClass
displayName: "SimpleTable"
propTypes:
columns: React.PropTypes.array
data: React.PropTypes.array
render: ->
columns = @props.columns.map (column) ->
if typeof column is "string"
<th key={column}>{column}</th>
else
<th key={column.displayName}>{column.displayName}</th>
body = @props.data.map (rowData, i) =>
row = []
for column in @props.columns
# Columns can either be a simple string or be an object that defines
# both a displayName and path for accessing the data.
if typeof column is "string"
datum = deep(rowData, column.toLowerCase())
key = i + "-" + column
else if column.path?
datum = deep(rowData, column.path)
key = i + "-" + column.path
else if column.function?
datum = column.function(rowData)
key = i + "-" + column.displayName
row.push <td key={key}>{datum}</td>
return <tr key={i}>{row}</tr>
return (
<table>
<thead key="thead">
<tr>{columns}</tr>
</thead>
<tbody key="tbody">{body}</tbody>
</table>
)
| Make react happy with keys | Make react happy with keys
| CoffeeScript | mit | KyleAMathews/react-simple-table |
b04a70ddffd89c13b0a3b6f2ea048ff440a4a69b | js-library/app/js/jail_iframe/classes/control_iframe.coffee | js-library/app/js/jail_iframe/classes/control_iframe.coffee | class FactlinkJailRoot.ControlIframe
constructor: ->
@el = document.createElement('iframe')
@el.className = 'factlink-control-frame'
#need to append to outer document before we can access frame document.
FactlinkJailRoot.$factlinkCoreContainer.append(@el)
@$el = $(@el)
@doc = @el.contentWindow.document;
@doc.open()
#need doctype to avoid quirks mode
@doc.write('<!DOCTYPE html><title></title>')
@doc.close()
style = @doc.createElement('style')
style.appendChild(@doc.createTextNode(FrameCss))
@doc.head.appendChild(style)
setContent: (contentNode) ->
bodyEl = @doc.body
while bodyEl.firstChild
bodyEl.removeChild(bodyEl.firstChild)
bodyEl.appendChild(contentNode)
@resizeFrame()
resizeFrame: ->
@el.style.width = @doc.body.clientWidth + 'px'
@el.style.height = @doc.body.clientHeight + 'px'
destroy: ->
return unless @el
@doc = null
@el.parentElement?.removeChild(@el)
@$el = @el = null
| control_visibility_transition_time = 300+1000/60 #keep in sync with scss
class FactlinkJailRoot.ControlIframe
constructor: ->
@el = document.createElement('iframe')
@el.className = 'factlink-control-frame'
#need to append to outer document before we can access frame document.
FactlinkJailRoot.$factlinkCoreContainer.append(@el)
@$el = $(@el)
@doc = @el.contentWindow.document;
@doc.open()
#need doctype to avoid quirks mode
@doc.write('<!DOCTYPE html><title></title>')
@doc.close()
style = @doc.createElement('style')
style.appendChild(@doc.createTextNode(FrameCss))
@doc.head.appendChild(style)
setContent: (contentNode) ->
bodyEl = @doc.body
while bodyEl.firstChild
bodyEl.removeChild(bodyEl.firstChild)
bodyEl.appendChild(contentNode)
@resizeFrame()
resizeFrame: ->
@el.style.width = @doc.body.clientWidth + 'px'
@el.style.height = @doc.body.clientHeight + 'px'
fadeIn: ->
@$el.addClass 'factlink-control-visible'
FactlinkJailRoot.Timer control_visibility_transition_time
fadeOut: ->
@$el.removeClass 'factlink-control-visible'
FactlinkJailRoot.Timer control_visibility_transition_time
#feature:should we communicate visibility to the control contents?
destroy: ->
return unless @el
@doc = null
@el.parentElement?.removeChild(@el)
@$el = @el = null
| Implement fadeout/in in control iframe; return deferred for completion handlers | Implement fadeout/in in control iframe; return deferred for completion handlers
| CoffeeScript | mit | daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core |
2219dc0168c1d484c050f4dbd83816b726d48930 | src/deployment-monitor.coffee | src/deployment-monitor.coffee | _ = require('underscore')
class DeploymentMonitor
timeout = 10000
constructor: ()->
@_deployment = null
@_chat = null
@_currentTimeout = 0
@_eventListeners = {
'change': ()=>
@_resetTimeout()
@_monitorTimeout()
'close': ()=>
@.removeDeployment()
'error': ()=>
@.removeDeployment()
}
setDeployment: (deployment, chat)->
@removeDeployment() if @hasDeployment()
@_deployment = deployment
@_chat = chat
_.each(@_eventListeners, (listener, event)=>
@_deployment.on(event, listener)
)
hasDeployment: ()->
return null != @_deployment
getDeployment: ()->
return @_deployment
removeDeployment: ()->
_.each(@_eventListeners, (listener, event)=>
@_deployment.removeListener(event, listener)
)
@_deployment = null
@_chat = null
_monitorTimeout: _.debounce(()->
if !@.hasDeployment()
return
@_currentTimeout += timeout
@_chat.send "Running #{@_currentTimeout}ms: #{getLastText(@_deployment.data.output)}"
@_monitorTimeout()
, timeout)
_resetTimeout: ()->
if @_currentTimeout > 0
@_chat.send "Continuing..."
@_currentTimeout = 0
getLastText = (text)->
textLines = text.split(/\r?\n/)
n = textLines.length - 1
while(!textLines[n].trim() && n > 0)
n--
return textLines[n]
module.exports = DeploymentMonitor
| _ = require('underscore')
class DeploymentMonitor
timeout = 10000
constructor: ()->
@_deployment = null
@_chat = null
@_currentTimeout = 0
@_eventListeners = {
change: ()=>
@_resetTimeout()
@_monitorTimeout()
close: ()=>
@.removeDeployment()
error: ()=>
@.removeDeployment()
}
setDeployment: (deployment, chat)->
@removeDeployment() if @hasDeployment()
@_deployment = deployment
@_chat = chat
_.each(@_eventListeners, (listener, event)=>
@_deployment.on(event, listener)
)
hasDeployment: ()->
return null != @_deployment
getDeployment: ()->
return @_deployment
removeDeployment: ()->
_.each(@_eventListeners, (listener, event)=>
@_deployment.removeListener(event, listener)
)
@_deployment = null
@_chat = null
_monitorTimeout: _.debounce(()->
if !@.hasDeployment()
return
@_currentTimeout += timeout
@_chat.send "Running #{@_currentTimeout}ms: #{getLastText(@_deployment.data.output)}"
@_monitorTimeout()
, timeout)
_resetTimeout: ()->
if @_currentTimeout > 0
@_chat.send "Continuing..."
@_currentTimeout = 0
getLastText = (text)->
textLines = text.split(/\r?\n/)
n = textLines.length - 1
while(!textLines[n].trim() && n > 0)
n--
return textLines[n]
module.exports = DeploymentMonitor
| Remove unnecessary quotes of eventListeners. | Remove unnecessary quotes of eventListeners.
| CoffeeScript | mit | cargomedia/hubot-pulsar,vogdb/hubot-pulsar,vogdb/hubot-pulsar,cargomedia/hubot-pulsar |
40d03604d8145ec0d06b0d5bf00e08fd025a3815 | app/assets/javascripts/rglossa/views/cwb/result/table_view.coffee | app/assets/javascripts/rglossa/views/cwb/result/table_view.coffee | App.CwbResultTableView = Em.View.extend
didInsertElement: ->
@$('[data-ot]').each (index, token) ->
new Opentip token, $(token).data('ot'),
style: 'dark'
fixed: true
| App.CwbResultTableView = Em.View.extend
contentBinding: 'controller.arrangedContent'
# We need to create tooltips with grammatical info for tokens after both of these have happened:
# - the controller's content property has been filled with a page of search results
# - the view has been rendered
contentDidChange: (->
return unless @get('content.length')
# Use the afterRender queue since the table rows may not be rendered yet even though the
# content property has been filled.
Ember.run.scheduleOnce 'afterRender', @, ->
@$('[data-ot]').each (index, token) ->
new Opentip token, $(token).data('ot'),
style: 'dark'
fixed: true
).observes('content.length')
| Fix creation of tooltips with grammatical token info | Fix creation of tooltips with grammatical token info
| CoffeeScript | mit | textlab/rglossa,textlab/glossa,textlab/glossa,textlab/rglossa,textlab/glossa,textlab/rglossa,textlab/glossa,textlab/rglossa,textlab/glossa,textlab/rglossa |
29603bf5accf6f0a7772fb0b0226858c02cac6a4 | app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee | app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee | # Monkey patch Turbolinks to render 401
# See https://github.com/turbolinks/turbolinks/issues/179
# https://github.com/projecthydra-labs/hyrax/issues/617
Turbolinks.HttpRequest.prototype.requestLoaded = ->
@endRequest =>
if 200 <= @xhr.status < 300 or @xhr.status == 401
@delegate.requestCompletedWithResponse(@xhr.responseText, @xhr.getResponseHeader("Turbolinks-Location"))
else
@failed = true
@delegate.requestFailedWithStatusCode(@xhr.status, @xhr.responseText)
| # Monkey patch Turbolinks to render 401
# See https://github.com/turbolinks/turbolinks/issues/179
# https://github.com/projecthydra-labs/hyrax/issues/617
if Turbolinks?
Turbolinks.HttpRequest.prototype.requestLoaded = ->
@endRequest =>
if 200 <= @xhr.status < 300 or @xhr.status == 401
@delegate.requestCompletedWithResponse(@xhr.responseText, @xhr.getResponseHeader("Turbolinks-Location"))
else
@failed = true
@delegate.requestFailedWithStatusCode(@xhr.status, @xhr.responseText)
| Make sure Turbolinks is defined before patching. | Make sure Turbolinks is defined before patching.
| CoffeeScript | apache-2.0 | samvera/hyrax,samvera/hyrax,samvera/hyrax,samvera/hyrax |
11d6a819422a9cdaf9a50cba7670b4f24f9b40e1 | javascripts/lib.coffee | javascripts/lib.coffee | #= require almond
window.ttm ||= {}
ttm.ClassMixer = (klass)->
klass.build = ->
it = new klass
it.initialize && it.initialize.apply(it, arguments)
it
klass.prototype.klass = klass
klass
define "lib/class_mixer", ->
return ttm.ClassMixer
| #= require almond
window.ttm ||= {}
window.decorators ||= {}
ttm.ClassMixer = (klass)->
klass.build = ->
it = new klass
it.initialize && it.initialize.apply(it, arguments)
it
klass.prototype.klass = klass
klass
define "lib/class_mixer", ->
return ttm.ClassMixer
| Implement decorator pattern for student dashboard. | WIP: Implement decorator pattern for student dashboard.
| CoffeeScript | mit | thinkthroughmath/ttm-coffeescript-utilities |
e055f9c2ba84c196c26365cdb6635b61d4fca14d | app/assets/javascripts/components/add_author_form_component.js.coffee | app/assets/javascripts/components/add_author_form_component.js.coffee | ETahi.AddAuthorFormComponent = Ember.Component.extend
tagName: 'div'
setNewAuthor: ( ->
unless @get('newAuthor')
@set('newAuthor', {})
).on('init')
actions:
toggleAuthorForm: ->
@sendAction('hideAuthorForm')
saveNewAuthor: ->
@sendAction('saveAuthor', @get('newAuthor'))
| ETahi.AddAuthorFormComponent = Ember.Component.extend
tagName: 'div'
setNewAuthor: ( ->
unless @get('newAuthor')
@set('newAuthor', {})
).on('init')
actions:
toggleAuthorForm: ->
@sendAction('hideAuthorForm')
saveNewAuthor: ->
author = @get('newAuthor')
@sendAction('saveAuthor', author)
if Ember.typeOf(author) == 'object'
@set('newAuthor', {})
| Fix new author form holding on to new author. | Fix new author form holding on to new author.
| CoffeeScript | mit | johan--/tahi,johan--/tahi,johan--/tahi,johan--/tahi |
21485bba3aa5a56db7e7122e12d4e056f61aba18 | client/lanes/react/mixins/Screen.coffee | client/lanes/react/mixins/Screen.coffee | Lanes.React.Mixins.Screen = {
childContextTypes:
screen: React.PropTypes.object
listenNetworkEvents: true
loadOrCreateModel: (options) ->
if options.prop and @props[options.prop]
@props[options.prop]
else
model = new options.klass
if options.attribute and @props.args?.length
model.fetch(_.extend( {}, options.syncOptions, {
query: {"#{options.attribute}": @props.args[0]}
}))
model
}
| Lanes.React.Mixins.Screen = {
childContextTypes:
screen: React.PropTypes.object
listenNetworkEvents: true
loadOrCreateModel: (options) ->
if options.prop and @props[options.prop]
@props[options.prop]
else
model = new options.klass
if options.attribute and @props.args?.length
model.fetch(_.extend( {}, options.syncOptions, {
query: {"#{options.attribute}": @props.args[0]}
})).then => @state?.commands?.setModel(model)
model
}
| Call setModel after fetching model | Call setModel after fetching model
Needed so the commands can notify observers
| CoffeeScript | mit | argosity/lanes,argosity/hippo,argosity/hippo,argosity/lanes,argosity/lanes,argosity/hippo |
86b2a7773ef78a48ff523da4d4d0481f62f1fddc | lib/init.coffee | lib/init.coffee | module.exports =
configDefaults:
clangCommand: 'clang'
clangPlusPlusCommand: 'clang++'
clangExecutablePath: null
clangIncludePaths: '.'
clangSuppressWarnings: false
clangDefaultCFlags: '-Wall'
clangDefaultCppFlags: '-Wall'
activate: ->
console.log 'activate linter-clang'
| module.exports =
configDefaults:
clangCommand: 'clang'
clangExecutablePath: null
clangIncludePaths: '.'
clangSuppressWarnings: false
clangDefaultCFlags: '-Wall'
clangDefaultCppFlags: '-Wall'
activate: ->
console.log 'activate linter-clang'
| Remove Clang Plus Plus Command Variable. | Remove Clang Plus Plus Command Variable.
| CoffeeScript | mit | k2b6s9j/linter-emscripten,k2b6s9j/linter-emscripten,k2b6s9j/linter-emscripten |
ab0f9e88a776f0a5daa334b2f6e802865ac9598d | src/browser/atom-protocol-handler.coffee | src/browser/atom-protocol-handler.coffee | app = require 'app'
fs = require 'fs'
path = require 'path'
protocol = require 'protocol'
# Handles requests with 'atom' protocol.
#
# It's created by {AtomApplication} upon instantiation and is used to create a
# custom resource loader for 'atom://' URLs.
#
# The following directories are searched in order:
# * ~/.atom/assets
# * ~/.atom/dev/packages (unless in safe mode)
# * ~/.atom/packages
# * RESOURCE_PATH/node_modules
#
module.exports =
class AtomProtocolHandler
constructor: (@resourcePath, safeMode) ->
@loadPaths = []
unless safeMode
@loadPaths.push(path.join(app.getHomeDir(), '.atom', 'dev', 'packages'))
@loadPaths.push(path.join(app.getHomeDir(), '.atom', 'packages'))
@loadPaths.push(path.join(@resourcePath, 'node_modules'))
@registerAtomProtocol()
# Creates the 'atom' custom protocol handler.
registerAtomProtocol: ->
protocol.registerProtocol 'atom', (request) =>
relativePath = path.normalize(request.url.substr(7))
if relativePath.indexOf('assets/') is 0
assetsPath = path.join(app.getHomeDir(), '.atom', relativePath)
filePath = assetsPath if fs.statSyncNoException(assetsPath).isFile?()
unless filePath
for loadPath in @loadPaths
filePath = path.join(loadPath, relativePath)
break if fs.statSyncNoException(filePath).isFile?()
new protocol.RequestFileJob(filePath)
| app = require 'app'
fs = require 'fs'
path = require 'path'
protocol = require 'protocol'
# Handles requests with 'atom' protocol.
#
# It's created by {AtomApplication} upon instantiation and is used to create a
# custom resource loader for 'atom://' URLs.
#
# The following directories are searched in order:
# * ~/.atom/assets
# * ~/.atom/dev/packages (unless in safe mode)
# * ~/.atom/packages
# * RESOURCE_PATH/node_modules
#
module.exports =
class AtomProtocolHandler
constructor: (@resourcePath, safeMode) ->
@loadPaths = []
@dotAtomDirectory = path.join(app.getHomeDir(), '.atom')
unless safeMode
@loadPaths.push(path.join(@dotAtomDirectory, 'dev', 'packages'))
@loadPaths.push(path.join(@dotAtomDirectory, 'packages'))
@loadPaths.push(path.join(@resourcePath, 'node_modules'))
@registerAtomProtocol()
# Creates the 'atom' custom protocol handler.
registerAtomProtocol: ->
protocol.registerProtocol 'atom', (request) =>
relativePath = path.normalize(request.url.substr(7))
if relativePath.indexOf('assets/') is 0
assetsPath = path.join(@dotAtomDirectory, relativePath)
filePath = assetsPath if fs.statSyncNoException(assetsPath).isFile?()
unless filePath
for loadPath in @loadPaths
filePath = path.join(loadPath, relativePath)
break if fs.statSyncNoException(filePath).isFile?()
new protocol.RequestFileJob(filePath)
| Add dot atom directory ivar | Add dot atom directory ivar
| CoffeeScript | mit | t9md/atom,acontreras89/atom,fredericksilva/atom,abcP9110/atom,BogusCurry/atom,dijs/atom,constanzaurzua/atom,qskycolor/atom,kaicataldo/atom,bj7/atom,hellendag/atom,chengky/atom,lisonma/atom,harshdattani/atom,rlugojr/atom,sebmck/atom,YunchengLiao/atom,Galactix/atom,tmunro/atom,ashneo76/atom,lpommers/atom,rxkit/atom,qskycolor/atom,CraZySacX/atom,pombredanne/atom,ralphtheninja/atom,RobinTec/atom,einarmagnus/atom,me6iaton/atom,stinsonga/atom,Locke23rus/atom,bolinfest/atom,alfredxing/atom,hellendag/atom,palita01/atom,devmario/atom,jacekkopecky/atom,woss/atom,Rodjana/atom,MjAbuz/atom,ilovezy/atom,mrodalgaard/atom,acontreras89/atom,liuderchi/atom,RobinTec/atom,nvoron23/atom,burodepeper/atom,Jandersoft/atom,mdumrauf/atom,Hasimir/atom,sekcheong/atom,Austen-G/BlockBuilder,jlord/atom,CraZySacX/atom,Huaraz2/atom,kevinrenaers/atom,Abdillah/atom,brumm/atom,liuxiong332/atom,Jonekee/atom,jtrose2/atom,constanzaurzua/atom,seedtigo/atom,jacekkopecky/atom,codex8/atom,stuartquin/atom,tisu2tisu/atom,mertkahyaoglu/atom,n-riesco/atom,dsandstrom/atom,PKRoma/atom,decaffeinate-examples/atom,Shekharrajak/atom,yalexx/atom,gzzhanghao/atom,kaicataldo/atom,kevinrenaers/atom,Hasimir/atom,dannyflax/atom,sebmck/atom,FoldingText/atom,devmario/atom,RobinTec/atom,yangchenghu/atom,originye/atom,ObviouslyGreen/atom,targeter21/atom,ReddTea/atom,YunchengLiao/atom,Jonekee/atom,kdheepak89/atom,sotayamashita/atom,jjz/atom,FoldingText/atom,rjattrill/atom,me-benni/atom,fedorov/atom,folpindo/atom,vjeux/atom,johnhaley81/atom,fscherwi/atom,Ingramz/atom,rmartin/atom,AdrianVovk/substance-ide,lovesnow/atom,basarat/atom,matthewclendening/atom,Jdesk/atom,ykeisuke/atom,mdumrauf/atom,rookie125/atom,beni55/atom,Neron-X5/atom,Locke23rus/atom,matthewclendening/atom,yangchenghu/atom,ykeisuke/atom,ppamorim/atom,fedorov/atom,elkingtonmcb/atom,Sangaroonaom/atom,stinsonga/atom,transcranial/atom,sxgao3001/atom,davideg/atom,NunoEdgarGub1/atom,Ingramz/atom,basarat/atom,darwin/atom,kaicataldo/atom,kjav/atom,vcarrera/atom,DiogoXRP/atom,h0dgep0dge/atom,t9md/atom,pkdevbox/atom,vinodpanicker/atom,MjAbuz/atom,lpommers/atom,crazyquark/atom,mostafaeweda/atom,bj7/atom,vcarrera/atom,phord/atom,FoldingText/atom,kjav/atom,ezeoleaf/atom,toqz/atom,charleswhchan/atom,tjkr/atom,bcoe/atom,svanharmelen/atom,Shekharrajak/atom,jeremyramin/atom,woss/atom,githubteacher/atom,Andrey-Pavlov/atom,kittens/atom,bencolon/atom,sebmck/atom,qiujuer/atom,ReddTea/atom,FoldingText/atom,ezeoleaf/atom,bj7/atom,tisu2tisu/atom,ashneo76/atom,bcoe/atom,synaptek/atom,tmunro/atom,dsandstrom/atom,hharchani/atom,ashneo76/atom,sillvan/atom,wiggzz/atom,toqz/atom,jjz/atom,qiujuer/atom,DiogoXRP/atom,bcoe/atom,vjeux/atom,paulcbetts/atom,amine7536/atom,rsvip/aTom,sillvan/atom,mnquintana/atom,devoncarew/atom,prembasumatary/atom,basarat/atom,jordanbtucker/atom,davideg/atom,hellendag/atom,hakatashi/atom,phord/atom,Jandersolutions/atom,brettle/atom,AlisaKiatkongkumthon/atom,ardeshirj/atom,folpindo/atom,john-kelly/atom,omarhuanca/atom,fang-yufeng/atom,BogusCurry/atom,Austen-G/BlockBuilder,gontadu/atom,pombredanne/atom,abcP9110/atom,hharchani/atom,fscherwi/atom,bsmr-x-script/atom,anuwat121/atom,nucked/atom,ReddTea/atom,atom/atom,scv119/atom,sxgao3001/atom,gontadu/atom,n-riesco/atom,jacekkopecky/atom,yalexx/atom,bryonwinger/atom,ivoadf/atom,Neron-X5/atom,jeremyramin/atom,jlord/atom,qskycolor/atom,omarhuanca/atom,stuartquin/atom,wiggzz/atom,Rodjana/atom,Jandersolutions/atom,jordanbtucker/atom,RuiDGoncalves/atom,G-Baby/atom,G-Baby/atom,Andrey-Pavlov/atom,batjko/atom,GHackAnonymous/atom,daxlab/atom,transcranial/atom,FIT-CSE2410-A-Bombs/atom,deepfox/atom,AlexxNica/atom,DiogoXRP/atom,johnhaley81/atom,devmario/atom,abcP9110/atom,johnrizzo1/atom,paulcbetts/atom,mertkahyaoglu/atom,AlbertoBarrago/atom,ObviouslyGreen/atom,Jdesk/atom,Jandersolutions/atom,sotayamashita/atom,0x73/atom,efatsi/atom,MjAbuz/atom,pombredanne/atom,isghe/atom,FoldingText/atom,kc8wxm/atom,hagb4rd/atom,Shekharrajak/atom,phord/atom,lisonma/atom,rsvip/aTom,sekcheong/atom,toqz/atom,Ju2ender/atom,Andrey-Pavlov/atom,yangchenghu/atom,tony612/atom,ralphtheninja/atom,darwin/atom,Dennis1978/atom,splodingsocks/atom,Austen-G/BlockBuilder,sillvan/atom,0x73/atom,SlimeQ/atom,mdumrauf/atom,medovob/atom,yomybaby/atom,beni55/atom,dsandstrom/atom,johnhaley81/atom,anuwat121/atom,dkfiresky/atom,hpham04/atom,Jdesk/atom,matthewclendening/atom,beni55/atom,AlexxNica/atom,tisu2tisu/atom,yalexx/atom,tony612/atom,hpham04/atom,rookie125/atom,KENJU/atom,Huaraz2/atom,rjattrill/atom,ironbox360/atom,NunoEdgarGub1/atom,rsvip/aTom,russlescai/atom,AlbertoBarrago/atom,mostafaeweda/atom,fredericksilva/atom,dkfiresky/atom,liuxiong332/atom,wiggzz/atom,mertkahyaoglu/atom,john-kelly/atom,devoncarew/atom,nrodriguez13/atom,mnquintana/atom,splodingsocks/atom,ObviouslyGreen/atom,crazyquark/atom,omarhuanca/atom,crazyquark/atom,gzzhanghao/atom,me-benni/atom,rxkit/atom,avdg/atom,prembasumatary/atom,Mokolea/atom,mnquintana/atom,acontreras89/atom,tmunro/atom,yomybaby/atom,rsvip/aTom,abcP9110/atom,vhutheesing/atom,Neron-X5/atom,AlbertoBarrago/atom,bcoe/atom,bsmr-x-script/atom,sotayamashita/atom,Klozz/atom,rjattrill/atom,jtrose2/atom,dannyflax/atom,woss/atom,Hasimir/atom,bencolon/atom,dkfiresky/atom,nvoron23/atom,niklabh/atom,constanzaurzua/atom,Huaraz2/atom,amine7536/atom,Abdillah/atom,rmartin/atom,Klozz/atom,Ju2ender/atom,yomybaby/atom,AlisaKiatkongkumthon/atom,YunchengLiao/atom,lisonma/atom,john-kelly/atom,paulcbetts/atom,me6iaton/atom,sillvan/atom,nrodriguez13/atom,medovob/atom,amine7536/atom,rxkit/atom,jjz/atom,PKRoma/atom,chengky/atom,yomybaby/atom,champagnez/atom,deepfox/atom,GHackAnonymous/atom,rlugojr/atom,synaptek/atom,vjeux/atom,Sangaroonaom/atom,einarmagnus/atom,florianb/atom,jlord/atom,crazyquark/atom,nrodriguez13/atom,sekcheong/atom,batjko/atom,kandros/atom,pengshp/atom,yamhon/atom,gisenberg/atom,brumm/atom,fredericksilva/atom,johnrizzo1/atom,nucked/atom,Arcanemagus/atom,atom/atom,matthewclendening/atom,ezeoleaf/atom,panuchart/atom,gisenberg/atom,daxlab/atom,atom/atom,mnquintana/atom,GHackAnonymous/atom,kdheepak89/atom,Andrey-Pavlov/atom,devoncarew/atom,yalexx/atom,KENJU/atom,abcP9110/atom,bencolon/atom,florianb/atom,qiujuer/atom,ardeshirj/atom,kc8wxm/atom,vinodpanicker/atom,john-kelly/atom,g2p/atom,NunoEdgarGub1/atom,nvoron23/atom,cyzn/atom,kdheepak89/atom,chengky/atom,Jandersoft/atom,qiujuer/atom,ralphtheninja/atom,chengky/atom,ardeshirj/atom,rlugojr/atom,scippio/atom,nucked/atom,basarat/atom,ppamorim/atom,tony612/atom,fang-yufeng/atom,boomwaiza/atom,svanharmelen/atom,kittens/atom,tony612/atom,helber/atom,Jandersolutions/atom,RuiDGoncalves/atom,RobinTec/atom,mostafaeweda/atom,seedtigo/atom,oggy/atom,medovob/atom,vinodpanicker/atom,lisonma/atom,Rychard/atom,chfritz/atom,gzzhanghao/atom,charleswhchan/atom,ppamorim/atom,decaffeinate-examples/atom,lovesnow/atom,jjz/atom,russlescai/atom,Galactix/atom,Austen-G/BlockBuilder,deepfox/atom,001szymon/atom,ezeoleaf/atom,avdg/atom,AdrianVovk/substance-ide,brettle/atom,ivoadf/atom,jacekkopecky/atom,jjz/atom,scv119/atom,svanharmelen/atom,batjko/atom,kandros/atom,SlimeQ/atom,liuxiong332/atom,stinsonga/atom,hpham04/atom,hharchani/atom,Rychard/atom,kittens/atom,yomybaby/atom,russlescai/atom,fedorov/atom,ilovezy/atom,Hasimir/atom,rookie125/atom,sebmck/atom,ppamorim/atom,me6iaton/atom,Shekharrajak/atom,SlimeQ/atom,kdheepak89/atom,tjkr/atom,liuderchi/atom,Galactix/atom,omarhuanca/atom,mertkahyaoglu/atom,0x73/atom,lisonma/atom,mnquintana/atom,isghe/atom,ilovezy/atom,crazyquark/atom,KENJU/atom,0x73/atom,fedorov/atom,Ju2ender/atom,dsandstrom/atom,MjAbuz/atom,me-benni/atom,kc8wxm/atom,KENJU/atom,Dennis1978/atom,liuderchi/atom,jeremyramin/atom,tony612/atom,Abdillah/atom,ivoadf/atom,jlord/atom,PKRoma/atom,ali/atom,G-Baby/atom,andrewleverette/atom,synaptek/atom,jordanbtucker/atom,oggy/atom,Jonekee/atom,pkdevbox/atom,elkingtonmcb/atom,vinodpanicker/atom,darwin/atom,FoldingText/atom,oggy/atom,kandros/atom,elkingtonmcb/atom,h0dgep0dge/atom,KENJU/atom,hagb4rd/atom,gisenberg/atom,bryonwinger/atom,scippio/atom,hpham04/atom,Hasimir/atom,bcoe/atom,acontreras89/atom,isghe/atom,batjko/atom,Abdillah/atom,001szymon/atom,dannyflax/atom,originye/atom,sxgao3001/atom,xream/atom,dannyflax/atom,tjkr/atom,devoncarew/atom,hakatashi/atom,chfritz/atom,dijs/atom,mrodalgaard/atom,jacekkopecky/atom,xream/atom,sillvan/atom,SlimeQ/atom,florianb/atom,champagnez/atom,me6iaton/atom,russlescai/atom,NunoEdgarGub1/atom,n-riesco/atom,acontreras89/atom,prembasumatary/atom,jacekkopecky/atom,kevinrenaers/atom,qiujuer/atom,ali/atom,ReddTea/atom,efatsi/atom,mostafaeweda/atom,MjAbuz/atom,pombredanne/atom,kc8wxm/atom,deoxilix/atom,Jandersolutions/atom,amine7536/atom,hagb4rd/atom,ali/atom,basarat/atom,sekcheong/atom,scv119/atom,stuartquin/atom,gontadu/atom,ppamorim/atom,isghe/atom,deoxilix/atom,me6iaton/atom,Jdesk/atom,gisenberg/atom,gabrielPeart/atom,davideg/atom,fang-yufeng/atom,ilovezy/atom,scv119/atom,h0dgep0dge/atom,constanzaurzua/atom,brumm/atom,GHackAnonymous/atom,oggy/atom,AdrianVovk/substance-ide,chengky/atom,vcarrera/atom,Jandersoft/atom,hpham04/atom,AlisaKiatkongkumthon/atom,burodepeper/atom,niklabh/atom,tanin47/atom,panuchart/atom,n-riesco/atom,palita01/atom,chfritz/atom,qskycolor/atom,liuderchi/atom,targeter21/atom,Ju2ender/atom,einarmagnus/atom,gabrielPeart/atom,targeter21/atom,dkfiresky/atom,rsvip/aTom,florianb/atom,brettle/atom,codex8/atom,fang-yufeng/atom,decaffeinate-examples/atom,jtrose2/atom,lpommers/atom,Locke23rus/atom,codex8/atom,niklabh/atom,ironbox360/atom,FIT-CSE2410-A-Bombs/atom,deepfox/atom,Jdesk/atom,transcranial/atom,kjav/atom,john-kelly/atom,kjav/atom,rmartin/atom,omarhuanca/atom,Neron-X5/atom,lovesnow/atom,panuchart/atom,YunchengLiao/atom,boomwaiza/atom,nvoron23/atom,hharchani/atom,codex8/atom,kittens/atom,Andrey-Pavlov/atom,fang-yufeng/atom,rmartin/atom,decaffeinate-examples/atom,prembasumatary/atom,folpindo/atom,vjeux/atom,pengshp/atom,davideg/atom,xream/atom,RobinTec/atom,kittens/atom,githubteacher/atom,rmartin/atom,Dennis1978/atom,pombredanne/atom,Mokolea/atom,Rychard/atom,isghe/atom,RuiDGoncalves/atom,mertkahyaoglu/atom,ilovezy/atom,stinsonga/atom,woss/atom,alexandergmann/atom,synaptek/atom,johnrizzo1/atom,rjattrill/atom,vjeux/atom,paulcbetts/atom,h0dgep0dge/atom,Shekharrajak/atom,harshdattani/atom,tanin47/atom,devmario/atom,charleswhchan/atom,russlescai/atom,cyzn/atom,boomwaiza/atom,florianb/atom,bsmr-x-script/atom,amine7536/atom,deoxilix/atom,mrodalgaard/atom,gisenberg/atom,daxlab/atom,devoncarew/atom,splodingsocks/atom,helber/atom,gabrielPeart/atom,sxgao3001/atom,seedtigo/atom,synaptek/atom,ali/atom,vhutheesing/atom,toqz/atom,andrewleverette/atom,Klozz/atom,fedorov/atom,ironbox360/atom,fredericksilva/atom,Mokolea/atom,YunchengLiao/atom,anuwat121/atom,dannyflax/atom,palita01/atom,tanin47/atom,dijs/atom,codex8/atom,toqz/atom,liuxiong332/atom,n-riesco/atom,FIT-CSE2410-A-Bombs/atom,pengshp/atom,scippio/atom,nvoron23/atom,yamhon/atom,batjko/atom,yalexx/atom,helber/atom,pkdevbox/atom,BogusCurry/atom,liuxiong332/atom,kjav/atom,GHackAnonymous/atom,NunoEdgarGub1/atom,AlexxNica/atom,SlimeQ/atom,fredericksilva/atom,matthewclendening/atom,lovesnow/atom,originye/atom,jtrose2/atom,targeter21/atom,vinodpanicker/atom,davideg/atom,hakatashi/atom,constanzaurzua/atom,ReddTea/atom,alfredxing/atom,einarmagnus/atom,hharchani/atom,harshdattani/atom,bolinfest/atom,dsandstrom/atom,bolinfest/atom,alfredxing/atom,Abdillah/atom,champagnez/atom,jtrose2/atom,targeter21/atom,fscherwi/atom,jlord/atom,t9md/atom,woss/atom,001szymon/atom,hagb4rd/atom,CraZySacX/atom,Galactix/atom,yamhon/atom,bryonwinger/atom,sebmck/atom,splodingsocks/atom,avdg/atom,vcarrera/atom,cyzn/atom,devmario/atom,sekcheong/atom,dannyflax/atom,Jandersoft/atom,githubteacher/atom,bryonwinger/atom,sxgao3001/atom,alexandergmann/atom,kc8wxm/atom,vhutheesing/atom,ykeisuke/atom,efatsi/atom,Galactix/atom,Austen-G/BlockBuilder,Jandersoft/atom,g2p/atom,lovesnow/atom,Arcanemagus/atom,Ju2ender/atom,einarmagnus/atom,Arcanemagus/atom,alexandergmann/atom,vcarrera/atom,hagb4rd/atom,Neron-X5/atom,dkfiresky/atom,qskycolor/atom,Rodjana/atom,basarat/atom,oggy/atom,hakatashi/atom,andrewleverette/atom,kdheepak89/atom,charleswhchan/atom,Sangaroonaom/atom,Ingramz/atom,burodepeper/atom,g2p/atom,deepfox/atom,prembasumatary/atom,Austen-G/BlockBuilder,charleswhchan/atom,ali/atom,mostafaeweda/atom |
811012897857b1fbf69f1b011efb6921f950b1c0 | app/assets/javascripts/backbone/views/work/job_form_view.coffee | app/assets/javascripts/backbone/views/work/job_form_view.coffee | Gather.Views.Work.JobFormView = Backbone.View.extend
initialize: (options) ->
events:
'cocoon:after-insert': 'shiftInserted'
shiftInserted: (event, inserted) ->
@initDatePickers(inserted)
initDatePickers: (inserted) ->
$(inserted).find(".datetimepicker").datetimepicker()
| Gather.Views.Work.JobFormView = Backbone.View.extend
initialize: (options) ->
@formatFields()
events:
'cocoon:after-insert': 'shiftInserted'
'change #work_job_times': 'formatFields'
formatFields: ->
dateFormat = I18n.t('datepicker.pformat')
timeFormat = I18n.t('timepicker.pformat')
times = @$('#work_job_times').val()
switch times
when 'date_time' then @setPickerFormat("#{dateFormat} #{timeFormat}")
when 'date_only', 'full_period' then @setPickerFormat(dateFormat)
shiftInserted: (event, inserted) ->
@initDatePickers(inserted)
initDatePickers: (inserted) ->
@$(inserted).find('.datetimepicker').datetimepicker()
setPickerFormat: (format) ->
@shiftDatePickers().map (picker) ->
$(this).data('DateTimePicker').format(format)
shiftDatePickers: ->
@$('#shift-table .datetimepicker')
| Set picker format based on times | 7836: Set picker format based on times
| CoffeeScript | mit | touchstone-cohousing/mess,touchstone-cohousing/mess,touchstone-cohousing/mess |
b8b89b82d25cd3feed67f422a032f3064c4c27d0 | core/app/backbone/views/channels/favourite_topic_button_view.coffee | core/app/backbone/views/channels/favourite_topic_button_view.coffee | class window.FavouriteTopicButtonView extends ActionButtonView
mini: true
onRender: -> @updateButton()
initialize: ->
@user = currentUser
@bindTo @user.favourite_topics, 'add remove change reset', @updateButton, @
templateHelpers: =>
disabled_label: Factlink.Global.t.follow_topic.capitalize()
disable_label: Factlink.Global.t.unfavourite.capitalize()
enabled_label: Factlink.Global.t.favourited.capitalize()
buttonEnabled: ->
@model.get('slug_title') in @user.favourite_topics.pluck('slug_title')
primaryAction: (e) ->
@model.favourite()
secondaryAction: (e) ->
@model.unfavourite()
| class window.FavouriteTopicButtonView extends ActionButtonView
mini: true
onRender: -> @updateButton()
initialize: ->
@user = currentUser
@bindTo @user.favourite_topics, 'add remove change reset', @updateButton, @
templateHelpers: =>
disabled_label: Factlink.Global.t.follow_topic.capitalize()
disable_label: Factlink.Global.t.unfollow.capitalize()
enabled_label: Factlink.Global.t.followed.capitalize()
buttonEnabled: ->
@model.get('slug_title') in @user.favourite_topics.pluck('slug_title')
primaryAction: (e) ->
@model.favourite()
secondaryAction: (e) ->
@model.unfavourite()
| Use unfollow labels for 'Follow topic' button | Use unfollow labels for 'Follow topic' button
| CoffeeScript | mit | daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core |
765e71afe2dccc06644129baa28c14a2b53623ce | bin/tourney-time.coffee | bin/tourney-time.coffee | #!/usr/bin/env coffee
argv = require('yargs')
.usage('Usage: $0 --teams [num] --time [num] --rest [num] --areas [num]')
.demand(['teams'])
.default('time', 33)
.default('rest', 7)
.default('areas', 1)
.argv
{teams, time, rest, areas} = argv
{timeNeededMinutes, tourneySchedule, playoffGames} = require('../lib/tourney-time')(argv)
hours = Math.floor(timeNeededMinutes / 60)
minutes = timeNeededMinutes % 60
time = ""
time += "#{hours} hours" if hours
time += ', ' if hours and minutes
time += "#{minutes} minutes" if minutes
console.log """For #{teams} teams
Playing #{time} minute games
with #{rest} minute breaks in between games
on #{areas} playing area(s)
you'll play a #{tourneySchedule.type} tournament with #{tourneySchedule.games + playoffGames} total games
#{tourneySchedule.games} tourney games and #{playoffGames} playoff games
which will take #{time} """
console.log tourneySchedule
| #!/usr/bin/env coffee
argv = require('yargs')
.usage('Usage: $0 --teams [num] --time [num] --rest [num] --areas [num]')
.demand(['teams'])
.default('time', 33)
.default('rest', 7)
.default('areas', 1)
.argv
{teams, time, rest, areas} = argv
{timeNeededMinutes, tourneySchedule, playoffGames, schedule} = require('../lib/tourney-time')(argv)
hours = Math.floor(timeNeededMinutes / 60)
minutes = timeNeededMinutes % 60
totalTime = ""
totalTime += "#{hours} hours" if hours
totalTime += ', ' if hours and minutes
totalTime += "#{minutes} minutes" if minutes
console.log """For #{teams} teams
Playing #{time} minute games
with #{rest} minute breaks in between games
on #{areas} playing area(s)
you'll play a #{tourneySchedule.type} tournament with #{tourneySchedule.games + playoffGames} total games
#{tourneySchedule.games} tourney games and #{playoffGames} playoff games
which will take #{totalTime} """
console.log schedule
| Fix for bad game time output | bug: Fix for bad game time output
| CoffeeScript | mit | duereg/tourney-time |
faf60739b936cda5479d4549d3872578faa881e9 | client/DevTools/AppController.coffee | client/DevTools/AppController.coffee | class DevToolsController extends AppController
name = "DevTools"
version = "0.1"
route = "/:name?/#{name}"
KD.registerAppClass this, {
name, version, behavior: "application", route,
menu : [
{ title : "Create a new App", eventName : "create" }
{ type : "separator" }
{ title : "Save", eventName : "save" }
{ title : "Save All", eventName : "saveAll" }
{ type : "separator" }
{ title : "Publish to AppStore", eventName : "publish" }
{ title : "customViewToggleLiveReload" }
{ type : "separator" }
{ title : "customViewToggleFullscreen" }
{ type : "separator" }
{ title : "Exit", eventName : "exit" }
]
}
constructor:(options = {}, data)->
options.view = new DevToolsMainView
options.appInfo =
name : "DevTools"
type : "application"
super options, data
# FIXME facet, to make it work I had to call notifyWindowResizeListeners here
handleQuery:->
{workspace} = @getView()
workspace.ready ->
KD.getSingleton("windowController").notifyWindowResizeListeners() | class DevToolsController extends AppController
name = "DevTools"
version = "0.1"
route = "/:name?/#{name}"
KD.registerAppClass this, {
name, version, behavior: "application", route,
menu : [
{ title : "Create a new App", eventName : "create" }
{ type : "separator" }
{ title : "Save", eventName : "save" }
{ title : "Save All", eventName : "saveAll" }
{ type : "separator" }
{ title : "Publish to AppStore", eventName : "publish" }
{ title : "customViewToggleLiveReload" }
{ type : "separator" }
{ title : "customViewToggleFullscreen" }
{ type : "separator" }
{ title : "Exit", eventName : "exit" }
]
}
constructor:(options = {}, data)->
options.view = new DevToolsMainView
options.appInfo =
name : "DevTools"
type : "application"
super options, data
# FIXME facet, to make it work I had to call notifyWindowResizeListeners here
handleQuery:->
{workspace} = @getView()
workspace.ready ->
wc = KD.getSingleton("windowController")
wc.notifyWindowResizeListeners()
wc.notifyWindowResizeListeners() | Fix the resizeHandler, dunno why it needs to be called two times ~ FIXME later | DevTools: Fix the resizeHandler, dunno why it needs to be called two times ~ FIXME later
| CoffeeScript | agpl-3.0 | szkl/koding,drewsetski/koding,drewsetski/koding,mertaytore/koding,alex-ionochkin/koding,gokmen/koding,usirin/koding,jack89129/koding,drewsetski/koding,alex-ionochkin/koding,drewsetski/koding,kwagdy/koding-1,rjeczalik/koding,rjeczalik/koding,gokmen/koding,alex-ionochkin/koding,mertaytore/koding,kwagdy/koding-1,gokmen/koding,sinan/koding,sinan/koding,acbodine/koding,sinan/koding,usirin/koding,koding/koding,usirin/koding,gokmen/koding,kwagdy/koding-1,acbodine/koding,cihangir/koding,acbodine/koding,mertaytore/koding,gokmen/koding,andrewjcasal/koding,mertaytore/koding,gokmen/koding,kwagdy/koding-1,szkl/koding,sinan/koding,gokmen/koding,usirin/koding,sinan/koding,acbodine/koding,szkl/koding,rjeczalik/koding,koding/koding,acbodine/koding,alex-ionochkin/koding,cihangir/koding,koding/koding,rjeczalik/koding,drewsetski/koding,sinan/koding,kwagdy/koding-1,mertaytore/koding,szkl/koding,rjeczalik/koding,szkl/koding,usirin/koding,alex-ionochkin/koding,cihangir/koding,jack89129/koding,mertaytore/koding,koding/koding,drewsetski/koding,koding/koding,sinan/koding,mertaytore/koding,kwagdy/koding-1,cihangir/koding,jack89129/koding,szkl/koding,cihangir/koding,drewsetski/koding,andrewjcasal/koding,alex-ionochkin/koding,mertaytore/koding,usirin/koding,rjeczalik/koding,koding/koding,jack89129/koding,rjeczalik/koding,andrewjcasal/koding,andrewjcasal/koding,alex-ionochkin/koding,acbodine/koding,usirin/koding,cihangir/koding,kwagdy/koding-1,alex-ionochkin/koding,andrewjcasal/koding,rjeczalik/koding,cihangir/koding,kwagdy/koding-1,andrewjcasal/koding,usirin/koding,andrewjcasal/koding,szkl/koding,szkl/koding,sinan/koding,jack89129/koding,drewsetski/koding,jack89129/koding,jack89129/koding,koding/koding,acbodine/koding,gokmen/koding,andrewjcasal/koding,koding/koding,cihangir/koding,jack89129/koding,acbodine/koding |
5b33812749d1d662e3570236f6e6e286cd1b36b5 | coffee/simulate.coffee | coffee/simulate.coffee | unless Offline
throw new Error("Offline simulate brought in without offline.js")
for state in ['up', 'down']
if document.querySelector("script[data-simulate='#{ state }']") or localStorage.OFFLINE_SIMULATE is state
Offline.options ?= {}
Offline.options.checks ?= {}
Offline.options.checks.active = state
| unless Offline
throw new Error("Offline simulate brought in without offline.js")
for state in ['up', 'down']
if document.querySelector("script[data-simulate='#{ state }']") or localStorage?.OFFLINE_SIMULATE is state
Offline.options ?= {}
Offline.options.checks ?= {}
Offline.options.checks.active = state
| Fix missing availability check for window.localStorage (e.g. it is disabled by default in android webviews) | Fix missing availability check for window.localStorage (e.g. it is disabled by default in android webviews)
| CoffeeScript | mit | micha/offline,micha/offline,matghaleb/offline,HubSpot/offline,sanbiv/offline,Thunderforge/offline,MartinReidy/offline,sanbiv/offline,dieface/offline,saada/offline,sombr/offline,marcomatteocci/offline,mcanthony/offline,HubSpot/offline,hadifarnoud/offline,hadifarnoud/offline,sojimaxi/offline,saada/offline,Thunderforge/offline,Climax777/offline,marcomatteocci/offline,sombr/offline,viljami/offline,dieface/offline,viljami/offline,Climax777/offline,matghaleb/offline,MartinReidy/offline,sojimaxi/offline,mcanthony/offline |
c2f5fe346c069a80f85d38c6bf24d76daccf2666 | src/reactGUI/ReactDOM-shim.coffee | src/reactGUI/ReactDOM-shim.coffee | try
ReactDOM = require 'react-dom'
catch
ReactDOM = window.ReactDOM
unless ReactDOM?
throw "Can't find ReactDOM"
module.exports = ReactDOM | try
ReactDOM = require 'react-dom'
catch
ReactDOM = window.ReactDOM
# can fall back to normal React until 0.15
unless ReactDOM?
try
ReactDOM = require 'react'
catch
ReactDOM = window.React
unless ReactDOM?
throw "Can't find ReactDOM"
module.exports = ReactDOM
| Allow ReactDOM -> React fallback | Allow ReactDOM -> React fallback
| CoffeeScript | bsd-2-clause | literallycanvas/literallycanvas,irskep/literallycanvas |
05ce975ab4e0ea6ba4b62afd5430703868ad9945 | benchmark/benchmark-bootstrap.coffee | benchmark/benchmark-bootstrap.coffee | require 'atom'
{runSpecSuite} = require '../spec/jasmine-helper'
atom.openDevTools()
document.title = "Benchmark Suite"
benchmarkSuite = require.resolve('./benchmark-suite')
runSpecSuite(benchmarkSuite, true)
| require '../src/atom'
{runSpecSuite} = require '../spec/jasmine-helper'
atom.openDevTools()
document.title = "Benchmark Suite"
benchmarkSuite = require.resolve('./benchmark-suite')
runSpecSuite(benchmarkSuite, true)
| Use relative path to atom require | Use relative path to atom require
| CoffeeScript | mit | scippio/atom,vjeux/atom,stinsonga/atom,0x73/atom,DiogoXRP/atom,bolinfest/atom,AdrianVovk/substance-ide,boomwaiza/atom,Jandersolutions/atom,targeter21/atom,oggy/atom,t9md/atom,dkfiresky/atom,anuwat121/atom,CraZySacX/atom,davideg/atom,rmartin/atom,panuchart/atom,Austen-G/BlockBuilder,yalexx/atom,liuxiong332/atom,KENJU/atom,ykeisuke/atom,alexandergmann/atom,PKRoma/atom,anuwat121/atom,CraZySacX/atom,johnrizzo1/atom,isghe/atom,jjz/atom,YunchengLiao/atom,kjav/atom,florianb/atom,palita01/atom,russlescai/atom,florianb/atom,woss/atom,fedorov/atom,ezeoleaf/atom,seedtigo/atom,sillvan/atom,ali/atom,mertkahyaoglu/atom,sxgao3001/atom,FIT-CSE2410-A-Bombs/atom,jtrose2/atom,fedorov/atom,dsandstrom/atom,nrodriguez13/atom,elkingtonmcb/atom,constanzaurzua/atom,basarat/atom,Austen-G/BlockBuilder,devmario/atom,scv119/atom,Ju2ender/atom,0x73/atom,florianb/atom,Austen-G/BlockBuilder,john-kelly/atom,Huaraz2/atom,tanin47/atom,elkingtonmcb/atom,oggy/atom,abcP9110/atom,crazyquark/atom,hagb4rd/atom,ppamorim/atom,kaicataldo/atom,yangchenghu/atom,vinodpanicker/atom,Dennis1978/atom,john-kelly/atom,lpommers/atom,dkfiresky/atom,tanin47/atom,scv119/atom,vjeux/atom,yalexx/atom,deepfox/atom,bryonwinger/atom,FoldingText/atom,Ju2ender/atom,constanzaurzua/atom,rlugojr/atom,rxkit/atom,jlord/atom,paulcbetts/atom,johnrizzo1/atom,NunoEdgarGub1/atom,0x73/atom,tjkr/atom,codex8/atom,me6iaton/atom,qiujuer/atom,pengshp/atom,ReddTea/atom,yomybaby/atom,Rychard/atom,G-Baby/atom,batjko/atom,crazyquark/atom,gabrielPeart/atom,nucked/atom,RobinTec/atom,liuderchi/atom,bradgearon/atom,GHackAnonymous/atom,Ingramz/atom,helber/atom,bryonwinger/atom,fang-yufeng/atom,deepfox/atom,DiogoXRP/atom,Jdesk/atom,gontadu/atom,yomybaby/atom,einarmagnus/atom,svanharmelen/atom,mostafaeweda/atom,charleswhchan/atom,KENJU/atom,toqz/atom,NunoEdgarGub1/atom,Sangaroonaom/atom,tony612/atom,ivoadf/atom,john-kelly/atom,originye/atom,qskycolor/atom,targeter21/atom,targeter21/atom,hakatashi/atom,sillvan/atom,scv119/atom,abcP9110/atom,sillvan/atom,kevinrenaers/atom,originye/atom,palita01/atom,stuartquin/atom,mertkahyaoglu/atom,nrodriguez13/atom,gzzhanghao/atom,boomwaiza/atom,basarat/atom,abcP9110/atom,sxgao3001/atom,erikhakansson/atom,bcoe/atom,vjeux/atom,AlexxNica/atom,decaffeinate-examples/atom,nucked/atom,acontreras89/atom,vcarrera/atom,devoncarew/atom,transcranial/atom,FoldingText/atom,brumm/atom,Hasimir/atom,decaffeinate-examples/atom,batjko/atom,qiujuer/atom,johnhaley81/atom,kandros/atom,bolinfest/atom,nvoron23/atom,Austen-G/BlockBuilder,scippio/atom,githubteacher/atom,jeremyramin/atom,ralphtheninja/atom,Jandersolutions/atom,fedorov/atom,daxlab/atom,yalexx/atom,vinodpanicker/atom,hpham04/atom,mnquintana/atom,Neron-X5/atom,BogusCurry/atom,me6iaton/atom,dkfiresky/atom,n-riesco/atom,basarat/atom,ObviouslyGreen/atom,jlord/atom,Jandersoft/atom,rjattrill/atom,gabrielPeart/atom,tmunro/atom,mrodalgaard/atom,kjav/atom,mertkahyaoglu/atom,Neron-X5/atom,matthewclendening/atom,stuartquin/atom,constanzaurzua/atom,mostafaeweda/atom,einarmagnus/atom,Jandersolutions/atom,hharchani/atom,githubteacher/atom,Jandersolutions/atom,brumm/atom,rookie125/atom,cyzn/atom,charleswhchan/atom,brumm/atom,matthewclendening/atom,paulcbetts/atom,john-kelly/atom,isghe/atom,Huaraz2/atom,abe33/atom,yamhon/atom,andrewleverette/atom,rsvip/aTom,ali/atom,n-riesco/atom,liuderchi/atom,hagb4rd/atom,RuiDGoncalves/atom,russlescai/atom,bsmr-x-script/atom,FoldingText/atom,toqz/atom,batjko/atom,kdheepak89/atom,hellendag/atom,execjosh/atom,devoncarew/atom,hagb4rd/atom,Shekharrajak/atom,MjAbuz/atom,MjAbuz/atom,gisenberg/atom,chfritz/atom,gzzhanghao/atom,pengshp/atom,t9md/atom,CraZySacX/atom,deoxilix/atom,Ju2ender/atom,bj7/atom,tanin47/atom,codex8/atom,kittens/atom,gisenberg/atom,qskycolor/atom,vinodpanicker/atom,SlimeQ/atom,toqz/atom,Austen-G/BlockBuilder,ilovezy/atom,phord/atom,sotayamashita/atom,synaptek/atom,splodingsocks/atom,champagnez/atom,omarhuanca/atom,alfredxing/atom,jeremyramin/atom,kandros/atom,dannyflax/atom,yamhon/atom,AlbertoBarrago/atom,ali/atom,kittens/atom,basarat/atom,mdumrauf/atom,gontadu/atom,nvoron23/atom,paulcbetts/atom,mostafaeweda/atom,ezeoleaf/atom,Galactix/atom,synaptek/atom,amine7536/atom,omarhuanca/atom,stinsonga/atom,rjattrill/atom,scippio/atom,Neron-X5/atom,yangchenghu/atom,sebmck/atom,seedtigo/atom,jtrose2/atom,efatsi/atom,jordanbtucker/atom,dsandstrom/atom,sekcheong/atom,fscherwi/atom,Jdesk/atom,scv119/atom,amine7536/atom,Rychard/atom,amine7536/atom,folpindo/atom,Shekharrajak/atom,targeter21/atom,nvoron23/atom,bcoe/atom,hellendag/atom,harshdattani/atom,bencolon/atom,harshdattani/atom,ironbox360/atom,devoncarew/atom,Shekharrajak/atom,basarat/atom,dijs/atom,atom/atom,bcoe/atom,atom/atom,einarmagnus/atom,stinsonga/atom,ironbox360/atom,omarhuanca/atom,folpindo/atom,g2p/atom,jordanbtucker/atom,dannyflax/atom,lpommers/atom,Ju2ender/atom,isghe/atom,Neron-X5/atom,Neron-X5/atom,lpommers/atom,jlord/atom,decaffeinate-examples/atom,Ju2ender/atom,toqz/atom,kandros/atom,AlbertoBarrago/atom,kaicataldo/atom,jtrose2/atom,deepfox/atom,sekcheong/atom,yalexx/atom,kc8wxm/atom,bencolon/atom,tjkr/atom,pengshp/atom,rookie125/atom,alfredxing/atom,AlexxNica/atom,Jandersoft/atom,ReddTea/atom,deoxilix/atom,Klozz/atom,lovesnow/atom,kittens/atom,gisenberg/atom,tisu2tisu/atom,me6iaton/atom,mdumrauf/atom,ilovezy/atom,vcarrera/atom,mrodalgaard/atom,RobinTec/atom,bryonwinger/atom,nucked/atom,codex8/atom,ykeisuke/atom,qskycolor/atom,gabrielPeart/atom,splodingsocks/atom,pombredanne/atom,amine7536/atom,wiggzz/atom,Ingramz/atom,kc8wxm/atom,prembasumatary/atom,Abdillah/atom,crazyquark/atom,sekcheong/atom,RobinTec/atom,dkfiresky/atom,AlbertoBarrago/atom,erikhakansson/atom,tmunro/atom,fang-yufeng/atom,DiogoXRP/atom,fredericksilva/atom,rookie125/atom,devoncarew/atom,ezeoleaf/atom,kc8wxm/atom,Jandersolutions/atom,constanzaurzua/atom,prembasumatary/atom,jjz/atom,davideg/atom,lovesnow/atom,seedtigo/atom,brettle/atom,ilovezy/atom,lisonma/atom,sxgao3001/atom,pkdevbox/atom,BogusCurry/atom,jordanbtucker/atom,YunchengLiao/atom,kc8wxm/atom,gisenberg/atom,pombredanne/atom,qiujuer/atom,Rychard/atom,hagb4rd/atom,mnquintana/atom,ali/atom,hpham04/atom,me-benni/atom,sebmck/atom,tjkr/atom,fedorov/atom,acontreras89/atom,dsandstrom/atom,hakatashi/atom,folpindo/atom,SlimeQ/atom,splodingsocks/atom,YunchengLiao/atom,daxlab/atom,vinodpanicker/atom,rmartin/atom,alexandergmann/atom,BogusCurry/atom,panuchart/atom,hellendag/atom,palita01/atom,qskycolor/atom,jjz/atom,hharchani/atom,nvoron23/atom,svanharmelen/atom,deepfox/atom,Galactix/atom,kevinrenaers/atom,devmario/atom,GHackAnonymous/atom,ashneo76/atom,n-riesco/atom,h0dgep0dge/atom,chengky/atom,amine7536/atom,gzzhanghao/atom,mostafaeweda/atom,oggy/atom,phord/atom,Rodjana/atom,bsmr-x-script/atom,AlexxNica/atom,batjko/atom,hagb4rd/atom,medovob/atom,t9md/atom,ashneo76/atom,Andrey-Pavlov/atom,ppamorim/atom,ObviouslyGreen/atom,charleswhchan/atom,rjattrill/atom,chfritz/atom,rsvip/aTom,ardeshirj/atom,jjz/atom,SlimeQ/atom,paulcbetts/atom,AlisaKiatkongkumthon/atom,xream/atom,pombredanne/atom,kdheepak89/atom,bolinfest/atom,h0dgep0dge/atom,devmario/atom,FoldingText/atom,synaptek/atom,russlescai/atom,bradgearon/atom,vjeux/atom,Austen-G/BlockBuilder,acontreras89/atom,Arcanemagus/atom,ardeshirj/atom,nrodriguez13/atom,ivoadf/atom,kjav/atom,cyzn/atom,charleswhchan/atom,0x73/atom,Dennis1978/atom,sillvan/atom,andrewleverette/atom,kdheepak89/atom,GHackAnonymous/atom,bryonwinger/atom,fang-yufeng/atom,woss/atom,liuxiong332/atom,hharchani/atom,beni55/atom,oggy/atom,YunchengLiao/atom,hpham04/atom,prembasumatary/atom,kevinrenaers/atom,sekcheong/atom,execjosh/atom,erikhakansson/atom,liuxiong332/atom,fredericksilva/atom,davideg/atom,Jdesk/atom,constanzaurzua/atom,kittens/atom,RuiDGoncalves/atom,ezeoleaf/atom,panuchart/atom,mnquintana/atom,stuartquin/atom,mrodalgaard/atom,Jandersoft/atom,lisonma/atom,russlescai/atom,boomwaiza/atom,FIT-CSE2410-A-Bombs/atom,GHackAnonymous/atom,mertkahyaoglu/atom,G-Baby/atom,rsvip/aTom,001szymon/atom,Andrey-Pavlov/atom,bcoe/atom,sekcheong/atom,jjz/atom,champagnez/atom,yamhon/atom,dannyflax/atom,lisonma/atom,AdrianVovk/substance-ide,abcP9110/atom,YunchengLiao/atom,devoncarew/atom,tisu2tisu/atom,transcranial/atom,beni55/atom,andrewleverette/atom,niklabh/atom,davideg/atom,matthewclendening/atom,bj7/atom,efatsi/atom,acontreras89/atom,vcarrera/atom,tony612/atom,dsandstrom/atom,johnhaley81/atom,lisonma/atom,g2p/atom,jacekkopecky/atom,jlord/atom,toqz/atom,cyzn/atom,fredericksilva/atom,PKRoma/atom,harshdattani/atom,Hasimir/atom,alexandergmann/atom,gontadu/atom,mnquintana/atom,PKRoma/atom,Galactix/atom,anuwat121/atom,rlugojr/atom,dannyflax/atom,avdg/atom,efatsi/atom,beni55/atom,isghe/atom,fredericksilva/atom,Huaraz2/atom,ReddTea/atom,ivoadf/atom,Hasimir/atom,brettle/atom,jacekkopecky/atom,chengky/atom,kjav/atom,burodepeper/atom,lovesnow/atom,niklabh/atom,einarmagnus/atom,AdrianVovk/substance-ide,matthewclendening/atom,Jonekee/atom,synaptek/atom,Ingramz/atom,elkingtonmcb/atom,bencolon/atom,NunoEdgarGub1/atom,johnhaley81/atom,rmartin/atom,chengky/atom,kaicataldo/atom,GHackAnonymous/atom,xream/atom,NunoEdgarGub1/atom,KENJU/atom,mostafaeweda/atom,vcarrera/atom,g2p/atom,rxkit/atom,vhutheesing/atom,mnquintana/atom,liuxiong332/atom,SlimeQ/atom,MjAbuz/atom,synaptek/atom,fredericksilva/atom,001szymon/atom,KENJU/atom,FoldingText/atom,n-riesco/atom,pombredanne/atom,Locke23rus/atom,vinodpanicker/atom,ykeisuke/atom,abe33/atom,lovesnow/atom,Galactix/atom,deoxilix/atom,sotayamashita/atom,pkdevbox/atom,RobinTec/atom,chfritz/atom,yangchenghu/atom,Rodjana/atom,FoldingText/atom,jlord/atom,Jandersoft/atom,atom/atom,ReddTea/atom,john-kelly/atom,Jandersoft/atom,helber/atom,avdg/atom,AlisaKiatkongkumthon/atom,G-Baby/atom,AlisaKiatkongkumthon/atom,dannyflax/atom,prembasumatary/atom,florianb/atom,rxkit/atom,hakatashi/atom,russlescai/atom,transcranial/atom,ralphtheninja/atom,ilovezy/atom,Mokolea/atom,Hasimir/atom,hpham04/atom,burodepeper/atom,phord/atom,lovesnow/atom,ardeshirj/atom,Andrey-Pavlov/atom,rmartin/atom,Shekharrajak/atom,gisenberg/atom,nvoron23/atom,woss/atom,qskycolor/atom,Jonekee/atom,darwin/atom,stinsonga/atom,jacekkopecky/atom,devmario/atom,MjAbuz/atom,ppamorim/atom,jtrose2/atom,brettle/atom,pombredanne/atom,Sangaroonaom/atom,jeremyramin/atom,pkdevbox/atom,ObviouslyGreen/atom,mdumrauf/atom,tony612/atom,me-benni/atom,tony612/atom,targeter21/atom,Jdesk/atom,Sangaroonaom/atom,oggy/atom,Jonekee/atom,FIT-CSE2410-A-Bombs/atom,devmario/atom,lisonma/atom,Mokolea/atom,einarmagnus/atom,yomybaby/atom,dannyflax/atom,Mokolea/atom,bj7/atom,Abdillah/atom,hharchani/atom,Andrey-Pavlov/atom,champagnez/atom,abe33/atom,kjav/atom,burodepeper/atom,sebmck/atom,fang-yufeng/atom,darwin/atom,Abdillah/atom,batjko/atom,crazyquark/atom,hpham04/atom,fscherwi/atom,codex8/atom,ppamorim/atom,ashneo76/atom,wiggzz/atom,ralphtheninja/atom,acontreras89/atom,omarhuanca/atom,dkfiresky/atom,deepfox/atom,rsvip/aTom,Locke23rus/atom,hharchani/atom,rmartin/atom,jtrose2/atom,fedorov/atom,Shekharrajak/atom,dijs/atom,sotayamashita/atom,Jdesk/atom,alfredxing/atom,kc8wxm/atom,ilovezy/atom,liuxiong332/atom,ReddTea/atom,fscherwi/atom,h0dgep0dge/atom,yomybaby/atom,n-riesco/atom,sebmck/atom,charleswhchan/atom,wiggzz/atom,sxgao3001/atom,Klozz/atom,darwin/atom,niklabh/atom,001szymon/atom,helber/atom,bradgearon/atom,hakatashi/atom,me6iaton/atom,h0dgep0dge/atom,execjosh/atom,basarat/atom,originye/atom,medovob/atom,dijs/atom,Abdillah/atom,svanharmelen/atom,liuderchi/atom,kdheepak89/atom,medovob/atom,me6iaton/atom,abcP9110/atom,codex8/atom,davideg/atom,Abdillah/atom,RobinTec/atom,kdheepak89/atom,tony612/atom,liuderchi/atom,Klozz/atom,rlugojr/atom,fang-yufeng/atom,rjattrill/atom,Rodjana/atom,tmunro/atom,yalexx/atom,vjeux/atom,chengky/atom,Galactix/atom,sillvan/atom,chengky/atom,avdg/atom,kittens/atom,omarhuanca/atom,prembasumatary/atom,johnrizzo1/atom,vcarrera/atom,bsmr-x-script/atom,sxgao3001/atom,MjAbuz/atom,Locke23rus/atom,florianb/atom,jacekkopecky/atom,tisu2tisu/atom,decaffeinate-examples/atom,ironbox360/atom,matthewclendening/atom,qiujuer/atom,bcoe/atom,isghe/atom,qiujuer/atom,jacekkopecky/atom,Arcanemagus/atom,me-benni/atom,githubteacher/atom,dsandstrom/atom,woss/atom,mertkahyaoglu/atom,vhutheesing/atom,xream/atom,vhutheesing/atom,ppamorim/atom,woss/atom,KENJU/atom,crazyquark/atom,NunoEdgarGub1/atom,RuiDGoncalves/atom,splodingsocks/atom,daxlab/atom,yomybaby/atom,Andrey-Pavlov/atom,ali/atom,SlimeQ/atom,jacekkopecky/atom,Arcanemagus/atom,Hasimir/atom,Dennis1978/atom,rsvip/aTom,sebmck/atom |
6ec1f195b3c42954d0a551ea06af665291dad28f | client/views/tasks/add_task.coffee | client/views/tasks/add_task.coffee | Template.newTaskForm.events
'submit #new-task, click #addTaskButton': (e) ->
e.preventDefault()
body = $('#new-task-text').val()
$('#new-task-text').val("")
now = new Date()
priority = 'low'
list = 'Adel'
Tasks.insert
body: body
dateDue: moment(now).add('w', 1).toDate()
dateCreated: now
dateCompleted: false
modified: now
list: list
priority: priority
completed: false
repeating: false
list = Lists.findOne
name: list
Lists.update list._id,
$inc:
numTodos: 1
| Template.newTaskForm.events
'submit #new-task, click #addTaskButton': (e) ->
e.preventDefault()
body = $('#new-task-text').val()
$('#new-task-text').val("")
now = new Date()
priority = 'low'
list = 'Home'
Tasks.insert
body: body
dateDue: moment(now).add('w', 1).toDate()
dateCreated: now
dateCompleted: false
modified: now
list: list
priority: priority
completed: false
repeating: false
list = Lists.findOne
name: list
Lists.update list._id,
$inc:
numTodos: 1
| Add tasks to 'Home' list by default | Add tasks to 'Home' list by default
| CoffeeScript | agpl-3.0 | adelq/astroid-web |
73d154f6df2c1bcc4a99b2220c25cf74a41ac587 | src/tab.coffee | src/tab.coffee | {View} = require 'space-pen'
module.exports =
class Tab extends View
@content: (editSession) ->
@div class: 'tab', =>
@span class: 'file-name', outlet: 'fileName'
@span class: 'close-icon'
initialize: (@editSession) ->
@buffer = @editSession.buffer
@subscribe @buffer, 'path-change', => @updateFileName()
@subscribe @buffer, 'contents-modified', => @updateModifiedStatus()
@subscribe @buffer, 'after-save', => @updateModifiedStatus()
@subscribe @buffer, 'git-status-change', => @updateModifiedStatus()
@updateFileName()
@updateModifiedStatus()
updateModifiedStatus: ->
if @buffer.isModified()
@toggleClass('file-modified') unless @isModified
@isModified = true
else
@removeClass('file-modified') if @isModified
@isModified = false
updateFileName: ->
@fileName.text(@editSession.buffer.getBaseName() ? 'untitled')
| {View} = require 'space-pen'
module.exports =
class Tab extends View
@content: (editSession) ->
@div class: 'tab', =>
@span class: 'file-name', outlet: 'fileName'
@span class: 'close-icon'
initialize: (@editSession) ->
@buffer = @editSession.buffer
@subscribe @buffer, 'path-changed', => @updateFileName()
@subscribe @buffer, 'contents-modified', => @updateModifiedStatus()
@subscribe @buffer, 'saved', => @updateModifiedStatus()
@subscribe @buffer, 'git-status-changed', => @updateModifiedStatus()
@updateFileName()
@updateModifiedStatus()
updateModifiedStatus: ->
if @buffer.isModified()
@toggleClass('file-modified') unless @isModified
@isModified = true
else
@removeClass('file-modified') if @isModified
@isModified = false
updateFileName: ->
@fileName.text(@editSession.buffer.getBaseName() ? 'untitled')
| Rename `Anchor` and `Buffer` events to passive-voice scheme | Rename `Anchor` and `Buffer` events to passive-voice scheme
| CoffeeScript | mit | pombredanne/tabs,harai/tabs,acontreras89/tabs,atom/tabs |
5e1d1e9ad6359fd3f0b5c7a88492ab599b925e23 | core/app/backbone/views/opinionators/opinionators_avatars_view.coffee | core/app/backbone/views/opinionators/opinionators_avatars_view.coffee | class OpinionatorsAvatarView extends Backbone.Marionette.Layout
tagName: 'span'
className: 'opinionators-avatar'
template: 'opinionators/avatar'
onRender: ->
UserPopoverContentView.makeTooltip @, @model
class window.OpinionatorsAvatarsView extends Backbone.Marionette.CompositeView
tagName: 'span'
className: 'opinionators-avatars'
template: "opinionators/avatars"
itemView: OpinionatorsAvatarView
itemViewContainer: ".js-opinionators-avatars-collection"
events:
'click .js-show-all' : 'show_all'
number_of_items: 7
initialize: (options) ->
@listenTo @collection, 'add remove reset sync', @render
_initialEvents: -> # don't use default bindings to collection
appendHtml: (collectionView, itemView, index) ->
super if index < @truncatedListSizes().numberToShow
templateHelpers: =>
numberOfOthers: @truncatedListSizes().numberOfOthers
truncatedListSizes: ->
truncatedListSizes @collection.totalRecords, @number_of_items
show_all: (e) ->
e.stopPropagation()
e.preventDefault()
@number_of_items = Infinity
@render()
| class OpinionatorsAvatarView extends Backbone.Marionette.Layout
tagName: 'span'
className: 'opinionators-avatar'
template: 'opinionators/avatar'
onRender: ->
UserPopoverContentView.makeTooltip @, @model
class window.OpinionatorsAvatarsView extends Backbone.Marionette.CompositeView
tagName: 'span'
className: 'opinionators-avatars'
template: "opinionators/avatars"
itemView: OpinionatorsAvatarView
itemViewContainer: ".js-opinionators-avatars-collection"
events:
'click .js-show-all' : 'show_all'
number_of_items: 4
initialize: (options) ->
@listenTo @collection, 'add remove reset sync', @render
_initialEvents: -> # don't use default bindings to collection
appendHtml: (collectionView, itemView, index) ->
super if index < @truncatedListSizes().numberToShow
templateHelpers: =>
numberOfOthers: @truncatedListSizes().numberOfOthers
truncatedListSizes: ->
truncatedListSizes @collection.totalRecords, @number_of_items
show_all: (e) ->
e.stopPropagation()
e.preventDefault()
@number_of_items = Infinity
@render()
| Truncate to 4 images by default | Truncate to 4 images by default
| CoffeeScript | mit | Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core |
f9774141b14f0ecf46a49b5475d9cf576cfdee8b | services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee | services/web/app/coffee/Features/Analytics/AnalyticsManager.coffee | settings = require "settings-sharelatex"
logger = require "logger-sharelatex"
_ = require "underscore"
request = require "request"
makeRequest: (opts, callback)->
if settings.apis?.analytics?.url?
request opts, callback
else
callback()
module.exports =
recordEvent: (user_id, event, segmentation = {}, callback = (error) ->) ->
if user_id == settings.smokeTest?.userId
return callback()
opts =
body:
event:event
segmentation:segmentation
json:true
method:"POST"
timeout:1000
url: "#{settings.apis.analytics.url}/user/#{user_id}/event"
makeRequest opts, callback
getLastOccurance: (user_id, event, callback = (error) ->) ->
opts =
body:
event:event
json:true
method:"POST"
timeout:1000
url: "#{settings.apis.analytics.url}/user/#{user_id}/event/last_occurnace"
makeRequest opts, (err, response, body)->
if err?
console.log response, opts
logger.err {user_id, err}, "error getting last occurance of event"
return callback err
else
return callback null, body | settings = require "settings-sharelatex"
logger = require "logger-sharelatex"
_ = require "underscore"
request = require "request"
makeRequest = (opts, callback)->
if settings.apis?.analytics?.url?
urlPath = opts.url
opts.url = "#{settings.apis.analytics.url}#{urlPath}"
request opts, callback
else
callback()
module.exports =
recordEvent: (user_id, event, segmentation = {}, callback = (error) ->) ->
if user_id == settings.smokeTest?.userId
return callback()
opts =
body:
event:event
segmentation:segmentation
json:true
method:"POST"
timeout:1000
url: "/user/#{user_id}/event"
makeRequest opts, callback
getLastOccurance: (user_id, event, callback = (error) ->) ->
opts =
body:
event:event
json:true
method:"POST"
timeout:1000
url: "/user/#{user_id}/event/last_occurnace"
makeRequest opts, (err, response, body)->
if err?
console.log response, opts
logger.err {user_id, err}, "error getting last occurance of event"
return callback err
else
return callback null, body
| Fix up makeRequest, so it copes with `analytics.url` being un-configured. | Fix up makeRequest, so it copes with `analytics.url` being un-configured.
| CoffeeScript | agpl-3.0 | sharelatex/sharelatex |
24197ffa4b20fe65fc018919191b79d6d671ce0c | js/outer/error.coffee | js/outer/error.coffee | CI.outer.Error = class Error extends CI.outer.Page
constructor: ->
@name = "error"
@status = renderContext.status or 404
@url = renderContext.githubPrivateAuthURL
title: =>
titles =
401: "Login required"
404: "Page not found"
500: "Internal server error"
titles[@status] or "Something unexpected happened"
message: =>
messages =
401: "<a href=\"#{@url}\"><b>Login here</b> to view this page</a>"
404: "We're sorry, but that page doesn't exist"
500: "We're sorry, but something broke"
messages[@status] or "Something completely unexpected happened"
viewContext: =>
title: @title()
error: @status
message: @message()
| CI.outer.Error = class Error extends CI.outer.Page
constructor: ->
super
@name = "error"
@status = renderContext.status or 404
@url = renderContext.githubPrivateAuthURL
title: =>
titles =
401: "Login required"
404: "Page not found"
500: "Internal server error"
titles[@status] or "Something unexpected happened"
message: =>
messages =
401: "<a href=\"#{@url}\"><b>Login here</b> to view this page</a>"
404: "We're sorry, but that page doesn't exist"
500: "We're sorry, but something broke"
messages[@status] or "Something completely unexpected happened"
viewContext: =>
title: @title()
error: @status
message: @message()
| Fix the 401 page looking incorrect. | Fix the 401 page looking incorrect.
CI.outer.Error inherited from outer.Page, but wasn't calling super, so variables that Page expected, @opts, wasn't created
Fixes #1740
| CoffeeScript | epl-1.0 | RayRutjes/frontend,circleci/frontend,circleci/frontend,prathamesh-sonpatki/frontend,RayRutjes/frontend,prathamesh-sonpatki/frontend,circleci/frontend |
817b5274d8fe447e02ec4ed163ccf67f034b42c6 | spec/header-cells/string-cell-spec.coffee | spec/header-cells/string-cell-spec.coffee | describe 'HeaderCells StringCell', ->
HeaderCell = require '../../lib/header-cells/string-cell'
initView = ({ model } = {}) ->
model ?= new Backbone.Model label: 'header cell label'
new HeaderCell { model }
showView = ->
initView(arguments...).render()
it 'renders the label', ->
expect(showView().$el).toHaveText 'header cell label'
| describe 'HeaderCells StringCell', ->
HeaderCell = require '../../lib/header-cells/string-cell'
initView = ({ model } = {}) ->
model ?= new Backbone.Model label: 'header cell label'
new HeaderCell { model }
showView = ->
initView(arguments...).render()
it 'renders the label', ->
expect(showView().$el).toHaveText 'header cell label'
it 'has a className', ->
expect(showView().$el).toHaveClass 'string-cell'
| Improve string cell spec coverage | Improve string cell spec coverage
| CoffeeScript | mit | juanca/marionette-tree,juanca/marionette-tree |
34341250628506337a9f220706c93261f770752c | Gruntfile.coffee | Gruntfile.coffee | module.exports = (grunt) ->
documentation = 'doc'
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
clean: [
'bin'
'.grunt'
documentation
]
jsdoc:
dist:
src: ['topicmap.js', 'README.md']
options:
destination: documentation
template: 'node_modules/ink-docstrap/template'
configure: 'jsdoc.conf.json'
'gh-pages':
'default':
src: '**/*'
options:
base: 'doc'
message: 'Update documentation'
travis:
src: '**/*'
options:
base: 'doc'
message: 'Update documentation'
repo: 'https://' + process.env.GH_TOKEN + '@github.com/' + process.env.TRAVIS_REPO_SLUG
user:
name: 'Travis CI Server'
email: 'will.byrne@hpe.com'
watch:
doc:
files: [
'src/**/*.js'
'README.md'
]
tasks: ['doc']
grunt.loadNpmTasks 'grunt-gh-pages'
grunt.loadNpmTasks 'grunt-jsdoc'
grunt.registerTask 'doc', ['jsdoc']
grunt.registerTask 'push-doc', ['doc', 'gh-pages:default']
grunt.registerTask 'push-doc-travis', ['doc', 'gh-pages:travis']
grunt.registerTask 'watch-doc', ['watch:doc'] | module.exports = (grunt) ->
documentation = 'doc'
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
clean: [
'bin'
'.grunt'
documentation
]
jsdoc:
dist:
src: ['topicmap.js', 'README.md']
options:
destination: documentation
template: 'node_modules/ink-docstrap/template'
configure: 'jsdoc.conf.json'
'gh-pages':
'default':
src: '**/*'
options:
base: 'doc'
message: 'Update documentation'
travis:
src: '**/*'
options:
base: 'doc'
message: 'Update documentation'
repo: 'https://' + process.env.GH_TOKEN + '@github.com/' + process.env.TRAVIS_REPO_SLUG
user:
name: 'Travis CI Server'
email: 'will.byrne@hpe.com'
watch:
doc:
files: [
'src/**/*.js'
'README.md'
]
tasks: ['doc']
grunt.loadNpmTasks 'grunt-gh-pages'
grunt.loadNpmTasks 'grunt-jsdoc'
grunt.registerTask 'doc', ['jsdoc']
grunt.registerTask 'push-doc', ['doc', 'gh-pages:default']
grunt.registerTask 'push-doc-travis', ['doc', 'gh-pages:travis']
grunt.registerTask 'watch-doc', ['watch:doc'] | Set up travis for Topic Map [rev: Alex Scown] | [BIFHI-38] Set up travis for Topic Map [rev: Alex Scown]
| CoffeeScript | mit | hpe-idol/topic-map,hpautonomy/topic-map,hpe-idol/topic-map,hpautonomy/topic-map |
6a5208348117e6b3dcc5fdfe9bb9b3df89bfb5d0 | src/app/common/user-icon/user-icon.coffee | src/app/common/user-icon/user-icon.coffee | #
# User icon via gravatar email address or user initials
#
angular.module('doubtfire.common.user-icon', [])
.directive('userIcon', ->
restrict: 'E'
replace: true
scope:
user: '=?'
size: '=?'
email: '=?'
templateUrl: 'common/user-icon/user-icon.tpl.html'
controller: ($scope, $http, currentUser, md5) ->
$scope.user ?= currentUser.profile
$scope.size ?= 100
$scope.email ?= $scope.user.email
$scope.userBackgroundStyle = (email) ->
# Gravatar hash
hash = if (email) then md5.createHash(email.trim().toLowerCase()) else md5.createHash('')
backgroundUrl = "https://www.gravatar.com/avatar/#{hash}.png?default=blank&size=#{$scope.size}"
"background-image: url('#{backgroundUrl}')"
$scope.initials = (->
initials = if ($scope.user && $scope.user.name) then $scope.user.name.split(" ") else " "
("#{initials[0][0]}#{initials[1][0]}").toUpperCase()
)()
)
| #
# User icon via gravatar email address or user initials
#
angular.module('doubtfire.common.user-icon', [])
.directive('userIcon', ->
restrict: 'E'
replace: true
scope:
user: '=?'
size: '=?'
email: '=?'
templateUrl: 'common/user-icon/user-icon.tpl.html'
controller: ($scope, $http, currentUser, md5) ->
$scope.user ?= currentUser.profile
$scope.size ?= 100
$scope.email ?= $scope.user.email
$scope.userBackgroundStyle = (email) ->
# Gravatar hash
hash = if (email) then md5.createHash(email.trim().toLowerCase()) else md5.createHash('')
backgroundUrl = "https://www.gravatar.com/avatar/#{hash}.png?default=blank&size=#{$scope.size}"
"background-image: url('#{backgroundUrl}')"
$scope.initials = (->
initials = if ($scope.user && $scope.user.name) then $scope.user.name.split(" ") else " "
if initials.length > 1 then ("#{initials[0][0]}#{initials[1][0]}").toUpperCase() else " "
)()
)
| Test length of name array in initials | FIX: Test length of name array in initials
| CoffeeScript | agpl-3.0 | doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web |
d0ac5e17bbd5b81cc092de461bb170af25e82b8b | app/assets/javascripts/projects.coffee | app/assets/javascripts/projects.coffee |
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
ready = ->
engine = new Bloodhound(
datumTokenizer: (d) ->
console.log d
Bloodhound.tokenizers.whitespace d.title
queryTokenizer: Bloodhound.tokenizers.whitespace
remote: url: '../projects/typeahead/%QUERY')
promise = engine.initialize()
$('.typeahead').typeahead null,
name: 'engine'
displayKey: 'email'
source: engine.ttAdapter()
return
$(document).ready ready
$(document).on 'page:load', ready
ready = ->
$('#SignOutMyself').click ->
if !@checked
url = document.URL
alert 'You won\'t be able to perform any more actions on the project after you\'re unenrolled!'
return
return
$(document).ready ready
$(document).on 'page:load', ready
ready = ->
$('#setInactiveButton').click ->
alert 'You\'re going to set the project status to inactive'
return
$(document).ready ready
$(document).on 'page:load', ready
|
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
ready = ->
engine = new Bloodhound(
datumTokenizer: (d) ->
console.log d
Bloodhound.tokenizers.whitespace d.title
queryTokenizer: Bloodhound.tokenizers.whitespace
remote: url: '../projects/typeahead/%QUERY')
promise = engine.initialize()
$('.typeahead').typeahead null,
name: 'engine'
displayKey: 'email'
source: engine.ttAdapter()
return
$(document).ready ready
$(document).on 'page:load', ready
ready = ->
$('#SignOutMyself').click ->
if !@checked
url = document.URL
locale = url.split('?')[1].split('=')[1]
if locale == 'de'
alert 'Sie sind nicht mehr befugt, weitere Maßnahmen für das Projekt durchzuführen, nachdem Sie sich aus dem Projekt ausgetragen haben!'
else
alert 'You won\'t be able to perform any more actions on the project after you\'re unenrolled!'
return
return
return
$(document).ready ready
$(document).on 'page:load', ready
ready = ->
$('#setInactiveButton').click ->
url = document.URL
locale = url.split('?')[1].split('=')[1]
if locale == 'de'
alert 'Das Projekt wird nun inaktiv geschalten!'
else
alert 'You\'re going to set the project status to inactive'
return
return
$(document).ready ready
$(document).on 'page:load', ready
| Add translation for pop up messages | Add translation for pop up messages
| CoffeeScript | mit | hpi-swt2/wimi-portal,hpi-swt2/wimi-portal,hpi-swt2/wimi-portal |
d270ea812a5cab3704a673f311050cf84b1a7dd2 | lib/init.coffee | lib/init.coffee | {BufferedProcess, CompositeDisposable} = require 'atom'
lsc = require 'atom-livescript'
module.exports =
provideLinter: ->
grammarScopes: ['source.livescript']
scope: 'file'
lintOnFly: true
lint: (textEditor)=>
new Promise (resolve, reject)=>
filePath = textEditor.getPath()
fileText = textEditor.getText()
try
lsc.compile fileText
resolve []
catch err
result = /Parse error on line (\d+): (.*)/.exec err.message
messages = [
type: 'Error'
text: result[2]
filePath: filePath
range: [
[parseInt(result[1])-1, 0]
[parseInt(result[1]), 0]
]
]
resolve messages
process.onWillThrowError ({error, handle})=>
atom.notifications.addError "Failed to run lsc",
detail: error.message
dismissable: true
handle()
resolve []
| {BufferedProcess, CompositeDisposable} = require 'atom'
lsc = require 'atom-livescript'
module.exports =
provideLinter: ->
grammarScopes: ['source.livescript']
scope: 'file'
lintOnFly: true
lint: (textEditor)=>
new Promise (resolve, reject)=>
filePath = textEditor.getPath()
fileText = textEditor.getText()
try
lsc.compile fileText
resolve []
catch err
result = switch
when err instanceof SyntaxError
r = /(.*) on line (\d+)$/.exec err.message
line: r[2]
text: r[1]
else
r = /Parse error on line (\d+): (.*)/.exec err.message
line: r[1]
text: r[2]
messages = [
type: 'Error'
text: result.text
filePath: filePath
range: [
[parseInt(result.line)-1, 0]
[parseInt(result.line), 0]
]
]
resolve messages
process.onWillThrowError ({error, handle})=>
atom.notifications.addError "Failed to run lsc",
detail: error.message
dismissable: true
handle()
resolve []
| Fix for another parse error | Fix for another parse error
| CoffeeScript | mit | AtomLinter/linter-lsc |
9843004373d3f0f29a9fc98276ca6bf71b452e8b | lib/main.coffee | lib/main.coffee | grammarListView = null
grammarStatusView = null
module.exports =
config:
showOnRightSideOfStatusBar:
type: 'boolean'
default: true
activate: ->
@commandDisposable = atom.commands.add('atom-text-editor', 'grammar-selector:show', createGrammarListView)
atom.packages.onDidActivateAll(createGrammarStatusView)
deactivate: ->
@commandDisposable.dispose()
grammarStatusView?.destroy()
grammarStatusView = null
grammarListView?.destroy()
grammarListView = null
createGrammarListView = ->
editor = atom.workspace.getActiveTextEditor()
if editor?
GrammarListView = require './grammar-list-view'
grammarListView ?= new GrammarListView(editor)
grammarListView.attach()
createGrammarStatusView = ->
statusBar = atom.views.getView(atom.workspace).querySelector("status-bar")
if statusBar?
GrammarStatusView = require './grammar-status-view'
grammarStatusView = new GrammarStatusView().initialize(statusBar)
grammarStatusView.attach()
| commandDisposable = null
grammarListView = null
grammarStatusView = null
module.exports =
config:
showOnRightSideOfStatusBar:
type: 'boolean'
default: true
activate: ->
commandDisposable = atom.commands.add('atom-text-editor', 'grammar-selector:show', createGrammarListView)
atom.packages.onDidActivateAll(createGrammarStatusView)
deactivate: ->
commandDisposable?.dispose()
commandDisposable = null
grammarStatusView?.destroy()
grammarStatusView = null
grammarListView?.destroy()
grammarListView = null
createGrammarListView = ->
editor = atom.workspace.getActiveTextEditor()
if editor?
GrammarListView = require './grammar-list-view'
grammarListView ?= new GrammarListView(editor)
grammarListView.toggle()
createGrammarStatusView = ->
statusBar = atom.views.getView(atom.workspace).querySelector("status-bar")
if statusBar?
GrammarStatusView = require './grammar-status-view'
grammarStatusView = new GrammarStatusView().initialize(statusBar)
grammarStatusView.attach()
| Call toggle each time command is dispatched | Call toggle each time command is dispatched
| CoffeeScript | mit | atom/grammar-selector |
83ea606278994d54be2f120f8544c689642a65ab | src/filters/moment-date.filter.coffee | src/filters/moment-date.filter.coffee | angular.module('impac.filters.moment-date', []).filter('momentDate', ($translate, ImpacTheming) ->
(date, component) ->
moment.locale($translate.use().toLowerCase())
validPeriods = ['daily', 'weekly', 'monthly', 'quarterly', 'yearly', 'default']
if !_.isEmpty(component) && validPeriods.includes(component.toLowerCase())
component = 'period-' + component.toLowerCase()
settings = ImpacTheming.get()
format = settings.dateFormatterSettings.default
if settings.dateFormatterSettings.formats && settings.dateFormatterSettings.formats[component]
format = settings.dateFormatterSettings.formats[component]
return moment(date).format(format)
)
| angular.module('impac.filters.moment-date', []).filter('momentDate', ($translate, ImpacTheming) ->
(date, component) ->
moment.locale($translate.use().toLowerCase())
validPeriods = ['daily', 'weekly', 'monthly', 'quarterly', 'yearly', 'default']
if !_.isEmpty(component) && _.includes(validPeriods, component.toLowerCase())
component = 'period-' + component.toLowerCase()
settings = ImpacTheming.get()
format = settings.dateFormatterSettings.default
if settings.dateFormatterSettings.formats && settings.dateFormatterSettings.formats[component]
format = settings.dateFormatterSettings.formats[component]
return moment(date).format(format)
)
| Refactor using lodash for ie11 | Refactor using lodash for ie11
| CoffeeScript | apache-2.0 | xaun/impac-angular,maestrano/impac-angular,xaun/impac-angular,maestrano/impac-angular |
ae3d11bcd9d954a30c10de23d4d5a5d301c23ebd | app/assets/javascripts/sprangular/directives/addressSelection.coffee | app/assets/javascripts/sprangular/directives/addressSelection.coffee | Sprangular.directive 'addressSelection', ->
restrict: 'E'
templateUrl: 'addresses/selection.html'
scope:
address: '='
addresses: '='
countries: '='
disabled: '=disabledFields'
submitted: '='
existingAddress: '='
controller: ($scope) ->
$scope.$watch 'addresses', (addresses) ->
return unless addresses && addresses.length > 0
found = _.find addresses, (existing) ->
existing.same($scope.address)
$scope.toggleExistingAddress() if found
$scope.toggleExistingAddress = ->
$scope.existingAddress = !$scope.existingAddress
if $scope.existingAddress
$scope.address = $scope.addresses[0]
else
$scope.address = new Sprangular.Address()
link: (element, attrs) ->
attrs.disabled = false unless attrs.disabled?
attrs.existingAddress = false unless attrs.existingAddress?
| Sprangular.directive 'addressSelection', ->
restrict: 'E'
templateUrl: 'addresses/selection.html'
scope:
address: '='
addresses: '='
countries: '='
disabled: '=disabledFields'
submitted: '='
existingAddress: '='
controller: ($scope) ->
$scope.$watch 'addresses', (addresses) ->
return unless addresses && addresses.length > 0
found = _.find addresses, (existing) ->
existing.same($scope.address)
$scope.toggleExistingAddress() if found
$scope.toggleExistingAddress = ->
$scope.existingAddress = !$scope.existingAddress
if $scope.existingAddress
$scope.address = $scope.addresses[0]
else
$scope.address = new Sprangular.Address()
compile: (element, attrs) ->
attrs.existingAddress = 'false' if !attrs.exisitingAddress?
link: (scope, element, attrs) ->
attrs.disabled = false unless attrs.disabled?
| Add default value for existingAddress attribute in compile stage | Add default value for existingAddress attribute in compile stage
| CoffeeScript | mit | sprangular/sprangular,sprangular/sprangular,sprangular/sprangular |
8e10a31bd3a07c52211f09816c491cea466e0cbd | lib/rails/beforesend.coffee | lib/rails/beforesend.coffee | # Implements global `ajaxBeforeSend` event.
#
# jQuery already provides a handful of global AJAX events. However,
# there is no global version of `beforeSend`, so `ajaxBeforeSend` is
# added to complement it.
#
# Reference: http://docs.jquery.com/Ajax_Events
# Skip for Zepto which doesn't have ajaxSetup but does already support
# `ajaxBeforeSend`. It'd be better to feature test for the event and
# see if we need to install it.
return unless $.ajaxSetup
# One caveat about using `$.ajaxSetup` is that its easily clobbered.
# If anything else tries to register another global `beforeSend`
# handler, ours will be overriden.
#
# To work around this, register your global `beforeSend` handler with:
#
# $(document).bind('ajaxBeforeSend', function() {})
#
$.ajaxSetup
beforeSend: (xhr, settings) ->
# Skip if global events are disabled
return unless settings.global
# Default to document if context isn't set
element = settings.context || document
# Provide a global version of the `beforeSend` callback
event = $.Event 'ajaxBeforeSend'
$(element).trigger event, [xhr, settings]
event.result
| # Implements global `ajaxBeforeSend` event.
#
# jQuery already provides a handful of global AJAX events. However,
# there is no global version of `beforeSend`, so `ajaxBeforeSend` is
# added to complement it.
#
# Reference: http://docs.jquery.com/Ajax_Events
# Skip for Zepto which doesn't have ajaxSetup but does already support
# `ajaxBeforeSend`. It'd be better to feature test for the event and
# see if we need to install it.
if $.ajaxSetup
# One caveat about using `$.ajaxSetup` is that its easily clobbered.
# If anything else tries to register another global `beforeSend`
# handler, ours will be overriden.
#
# To work around this, register your global `beforeSend` handler with:
#
# $(document).bind('ajaxBeforeSend', function() {})
#
$.ajaxSetup
beforeSend: (xhr, settings) ->
# Skip if global events are disabled
return unless settings.global
# Default to document if context isn't set
element = settings.context || document
# Provide a global version of the `beforeSend` callback
event = $.Event 'ajaxBeforeSend'
$(element).trigger event, [xhr, settings]
event.result
| Make compatible with coffee 1.1.3 bug | Make compatible with coffee 1.1.3 bug
| CoffeeScript | mit | josh/rails-behaviors,josh/rails-behaviors,josh/rails-behaviors,josh/rails-behaviors |
8b92755236d28e5da19a309f4868d045c4a84747 | menus/find-and-replace.cson | menus/find-and-replace.cson | 'menu': [
'label': 'Find'
'submenu': [
{ 'label': 'Find in Buffer', 'command': 'find-and-replace:show'}
{ 'label': 'Replace in Buffer', 'command': 'find-and-replace:show-replace'}
{ 'label': 'Select Next', 'command': 'find-and-replace:select-next'}
{ 'label': 'Select All', 'command': 'find-and-replace:select-all'}
{ 'type': 'separator' }
{ 'label': 'Find in Project', 'command': 'project-find:show'}
{ 'type': 'separator' }
{ 'label': 'Find Next', 'command': 'find-and-replace:find-next'}
{ 'label': 'Find Previous', 'command': 'find-and-replace:find-previous'}
{ 'label': 'Replace Next', 'command': 'find-and-replace:replace-next'}
{ 'label': 'Replace All', 'command': 'find-and-replace:replace-all'}
{ 'type': 'separator' }
]
]
'context-menu':
'.tree-view > li.directory':
'Search in this directory': 'project-find:show-in-current-directory'
| 'menu': [
'label': 'Find'
'submenu': [
{ 'label': 'Find in Buffer', 'command': 'find-and-replace:show'}
{ 'label': 'Replace in Buffer', 'command': 'find-and-replace:show-replace'}
{ 'label': 'Select Next', 'command': 'find-and-replace:select-next'}
{ 'label': 'Select All', 'command': 'find-and-replace:select-all'}
{ 'label': 'Toggle Find in Buffer', 'command': 'find-and-replace:toggle'}
{ 'type': 'separator' }
{ 'label': 'Find in Project', 'command': 'project-find:show'}
{ 'label': 'Toggle Find in Project', 'command': 'project-find:toggle'}
{ 'type': 'separator' }
{ 'label': 'Find Next', 'command': 'find-and-replace:find-next'}
{ 'label': 'Find Previous', 'command': 'find-and-replace:find-previous'}
{ 'label': 'Replace Next', 'command': 'find-and-replace:replace-next'}
{ 'label': 'Replace All', 'command': 'find-and-replace:replace-all'}
{ 'type': 'separator' }
]
]
'context-menu':
'.tree-view > li.directory':
'Search in this directory': 'project-find:show-in-current-directory'
| Add toggle menu item for panels | Add toggle menu item for panels
Refs #164
| CoffeeScript | mit | harai/find-and-replace,bmperrea/find-and-replace,trevdor/find-and-replace,atom/find-and-replace |
e6c7444c4528982f86a46e2f9eccedc57f0725f7 | src/scripts/sheits.coffee | src/scripts/sheits.coffee | # Description:
# When you get some bad news sometimes you got to let it out.
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# sheeeit - Display an image or animated gif
#
# Author:
# danishkhan
sheits = [
"http://www.circlenoir.com/forums/attachment.php?attachmentid=478&stc=1#.jpg",
"http://media.skateboard.com.au/forum/images/davis_sheeeit.jpg",
"http://www.gifsoup.com/webroot/animatedgifs1/2019075_o.gif",
"http://i417.photobucket.com/albums/pp258/reddreadrevolver/sheeeit.gif",
"http://behance.vo.llnwd.net/profiles3/111050/projects/252777/1110501249152745.jpg"
]
module.exports = (robot) ->
robot.hear /sh(e+)(i+)(t+)/, (msg) ->
msg.send msg.random sheits
| # Description:
# When you get some bad news sometimes you got to let it out.
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# sheeeit - Display an image or animated gif
#
# Author:
# danishkhan
sheits = [
"http://www.circlenoir.com/forums/attachment.php?attachmentid=478&stc=1#.jpg",
"http://media.skateboard.com.au/forum/images/davis_sheeeit.jpg",
"http://www.gifsoup.com/webroot/animatedgifs1/2019075_o.gif",
"http://i417.photobucket.com/albums/pp258/reddreadrevolver/sheeeit.gif",
"http://behance.vo.llnwd.net/profiles3/111050/projects/252777/1110501249152745.jpg"
]
module.exports = (robot) ->
robot.hear /sh(e+)(i+)(t+)/, (msg) ->
msg.send msg.random sheits
| Indent msg.send so that we all can Clay. Sheeeeeeeeeit. | Indent msg.send so that we all can Clay. Sheeeeeeeeeit.
| CoffeeScript | mit | justinwoo/hubot-scripts,davidsulpy/hubot-scripts,zecahnin/hubot-scripts,1stdibs/hubot-scripts,contolini/hubot-scripts,jan0sch/hubot-scripts,chauffer/hubot-scripts,ericjsilva/hubot-scripts,1000hz/hubot-scripts,MaxMEllon/hubot-scripts,jhubert/hubot-scripts,Tyriont/hubot-scripts,DataDog/hubot-scripts,opentable/hubot-scripts,flores/hubot-scripts,terryjbates/hubot-scripts,alexhouse/hubot-scripts,ambikads/hubot-scripts,jankowiakmaria/hubot-scripts,wsoula/hubot-scripts,flores/hubot-scripts,ryantomlinson/hubot-scripts,dbkaplun/hubot-scripts,iilab/hubot-scripts,dhfromkorea/hubot-scripts,cycomachead/hubot-scripts,DataDog/hubot-scripts,gregburek/emojibot,jacobtomlinson/hubot-scripts,n0mer/hubot-scripts,arcaartem/hubot-scripts,yigitbey/hubot-scripts,phillipalexander/hubot-scripts,josephcarmello/hubot-scripts,sklise/hubot-scripts,dyg2104/hubot-scripts,Ev1l/hubot-scripts,markstory/hubot-scripts,GrimDerp/hubot-scripts,azimman/hubot-scripts,fromonesrc/hubot-scripts,modulexcite/hubot-scripts,amhorton/hubot-scripts,github/hubot-scripts,marksie531/hubot-scripts,magicstone1412/hubot-scripts |
b0314408590b53f93734d66b5f7ce96dd265bfc3 | lib/minimap-pigments-binding.coffee | lib/minimap-pigments-binding.coffee | {CompositeDisposable} = require 'atom'
module.exports =
class MinimapPigmentsBinding
constructor: ({@editor, @minimap, @colorBuffer}) ->
@displayedMarkers = []
@subscriptions = new CompositeDisposable
@colorBuffer.initialize().then => @updateMarkers()
@subscriptions.add @colorBuffer.onDidUpdateColorMarkers => @updateMarkers()
updateMarkers: ->
markers = @colorBuffer.findValidColorMarkers()
for m in @displayedMarkers when m not in markers
@minimap.removeAllDecorationsForMarker(m.marker)
for m in markers when m.color?.isValid() and m not in @displayedMarkers
@minimap.decorateMarker(m.marker, type: 'highlight', color: m.color.toCSS())
@displayedMarkers = markers
destroy: ->
@subscriptions.dispose()
| {CompositeDisposable} = require 'atom'
module.exports =
class MinimapPigmentsBinding
constructor: ({@editor, @minimap, @colorBuffer}) ->
@displayedMarkers = []
@subscriptions = new CompositeDisposable
@colorBuffer.initialize().then => @updateMarkers()
@subscriptions.add @colorBuffer.editor.displayBuffer.onDidTokenize =>
@updateMarkers()
@subscriptions.add @colorBuffer.onDidUpdateColorMarkers =>
@updateMarkers()
updateMarkers: ->
markers = @colorBuffer.findValidColorMarkers()
for m in @displayedMarkers when m not in markers
@minimap.removeAllDecorationsForMarker(m.marker)
for m in markers when m.color?.isValid() and m not in @displayedMarkers
@minimap.decorateMarker(m.marker, type: 'highlight', color: m.color.toCSS())
@displayedMarkers = markers
destroy: ->
@subscriptions.dispose()
| Fix markers persisting after tokenisation when they should have been hidden | :bug: Fix markers persisting after tokenisation when they should have been hidden
| CoffeeScript | mit | abe33/minimap-pigments |
4baa4f05012480454a79100937589accac4ccc6b | karma.conf.coffee | karma.conf.coffee | webpackConfig = require('./webpack.config.coffee')
webpackConfig.entry = {}
module.exports = (config) ->
config.set
frameworks: ['jasmine']
browsers: ['Chrome']
files: [
'./spec/**/*.coffee'
]
preprocessors:
'./spec/**/*spec.coffee': ['webpack']
webpack: webpackConfig
webpackMiddleware:
noInfo: true
| webpackConfig = require('./webpack.config.coffee')
webpackConfig.entry = {}
module.exports = (config) ->
config.set
frameworks: ['jasmine']
browsers: ['Chrome']
files: [
'./spec/**/*.coffee'
]
preprocessors:
'./spec/**/*': ['webpack']
webpack: webpackConfig
webpackMiddleware:
noInfo: true
| Simplify spec files regex since webpack should be doing all the heavy lifting | Simplify spec files regex since webpack should be doing all the heavy lifting
| CoffeeScript | mit | juanca/marionette-tree,juanca/marionette-tree |
247cf9d2436a3168addc1ef112c45b48a208d70c | lib/router.coffee | lib/router.coffee | Router.configure
layoutTemplate: 'Layout'
Router.route '/', ->
return @redirect '/course/si'
Router.route '/si', ->
return @redirect '/course/si'
Router.route '/tsi', ->
return @redirect '/course/tsi'
Router.route '/course/:course',
name: 'course'
waitOn: ->
return [
Meteor.subscribe 'Grade'
Meteor.subscribe 'userGradeInfo'
]
action: ->
course = @params.course.toLowerCase()
if course not in ['si', 'tsi']
return @redirect '/course/si'
Session.set 'grade', course
Session.set 'grade-filter-status', @params.query.status
@render 'Grade'
fastRender: true
Router.route '/my/:course/:email',
name: 'my'
waitOn: ->
return [
Meteor.subscribe 'Grade'
Meteor.subscribe 'userGradeInfo'
]
action: ->
course = @params.course.toLowerCase()
if course not in ['si', 'tsi']
return @redirect "/course/si/#{params.email}"
Session.set 'grade', course
Session.set 'grade-filter-status', @params.query.status
@render 'Grade',
data:
email: @params.email
fastRender: true
| Router.configure
layoutTemplate: 'Layout'
Router.route '/', ->
return @redirect '/course/si'
Router.route '/si', ->
return @redirect '/course/si'
Router.route '/tsi', ->
return @redirect '/course/tsi'
Router.route '/course/:course',
name: 'course'
waitOn: ->
return [
Meteor.subscribe 'Grade'
Meteor.subscribe 'userGradeInfo'
]
action: ->
course = @params.course.toLowerCase()
if course not in ['si', 'tsi']
return @redirect '/course/si'
Session.set 'grade', course
Session.set 'grade-filter-status', @params.query.status
@render 'Grade'
fastRender: true
Router.route '/my/:course/:email',
name: 'my'
waitOn: ->
return [
Meteor.subscribe 'Grade'
Meteor.subscribe 'userGradeInfo', @params.email
]
action: ->
course = @params.course.toLowerCase()
if course not in ['si', 'tsi']
return @redirect "/course/si/#{@params.email}"
Session.set 'grade', course
Session.set 'grade-filter-status', @params.query.status
@render 'Grade',
data:
email: @params.email
fastRender: true
| Fix bugs with shared url | Fix bugs with shared url
| CoffeeScript | mit | rodrigok/GradeFaccat,rodrigok/GradeFaccat |
ce1fe207bc3602a80d7eba9787af25b4eaaebeca | test/specs/Piece.spec.coffee | test/specs/Piece.spec.coffee | define (require) ->
Piece = require 'Piece'
ranks = require 'ranks'
describe 'Piece', ->
for rank of ranks
do (rank) ->
it "should not throw if rank #{rank}", ->
expect(->
new Piece
rank: rank
side: 0
).to.not.throw()
it 'should throw if rank is not valid', ->
expect(->
new Piece
rank: 'abc'
side: 0
).to.throw()
it 'should not throw if side 0 or 1', ->
expect(->
new Piece
rank: '1'
side: 0
).to.not.throw()
expect(->
new Piece
rank: '1'
side: 1
).to.not.throw()
it 'should throw if side not valid', ->
expect(->
new Piece
rank: '1'
side: 2
).to.throw()
expect(->
new Piece
rank: '1'
side: -1
).to.throw()
| define (require) ->
Piece = require 'Piece'
ranks = require 'ranks'
describe 'Piece', ->
it 'should not throw if rank is valid', ->
for rank of ranks
expect(->
new Piece
rank: rank
side: 0
).to.not.throw()
it 'should throw if rank is not valid', ->
expect(->
new Piece
rank: 'abc'
side: 0
).to.throw()
it 'should not throw if side 0 or 1', ->
expect(->
new Piece
rank: '1'
side: 0
).to.not.throw()
expect(->
new Piece
rank: '1'
side: 1
).to.not.throw()
it 'should throw if side not valid', ->
expect(->
new Piece
rank: '1'
side: 2
).to.throw()
expect(->
new Piece
rank: '1'
side: -1
).to.throw()
| Break tests down into one | [master] Break tests down into one
| CoffeeScript | mit | benletchford/stratego.io,benletchford/stratego.io,benletchford/stratego.io |
5235114eed2f53d0aa58e23e616b3f76f58899d4 | spec/spec-suite.coffee | spec/spec-suite.coffee | require 'window'
measure 'spec suite require time', ->
fsUtils = require 'fs-utils'
path = require 'path'
require 'spec-helper'
requireSpecs = (directoryPath, specType) ->
for specPath in fsUtils.listTreeSync(path.join(directoryPath, 'spec')) when /-spec\.coffee$/.test specPath
require specPath
setSpecType = (specType) ->
for spec in jasmine.getEnv().currentRunner().specs() when not spec.specType?
spec.specType = specType
# Run core specs
requireSpecs(window.resourcePath)
setSpecType('core')
# Run bundled package specs
for packagePath in fsUtils.listTreeSync(config.nodeModulesDirPath) when atom.isInternalPackage(packagePath)
requireSpecs(packagePath, 'bundled')
setSpecType('bundled')
# Run user package specs
for packagePath in fsUtils.listTreeSync(config.userPackagesDirPath)
requireSpecs(packagePath, 'user')
setSpecType('user')
| fs = require 'fs'
require 'window'
measure 'spec suite require time', ->
fsUtils = require 'fs-utils'
path = require 'path'
require 'spec-helper'
requireSpecs = (directoryPath, specType) ->
for specPath in fsUtils.listTreeSync(path.join(directoryPath, 'spec')) when /-spec\.coffee$/.test specPath
require specPath
setSpecType = (specType) ->
for spec in jasmine.getEnv().currentRunner().specs() when not spec.specType?
spec.specType = specType
# Run core specs
requireSpecs(window.resourcePath)
setSpecType('core')
# Run bundled package specs
if fsUtils.isDirectorySync(config.nodeModulesDirPath)
for packageName in fs.readdirSync(config.nodeModulesDirPath)
packagePath = path.join(config.nodeModulesDirPath, packageName)
requireSpecs(packagePath, 'bundled') if atom.isInternalPackage(packagePath)
setSpecType('bundled')
# Run user package specs
if fsUtils.isDirectorySync(config.userPackagesDirPath)
for packageName in fs.readdirSync(config.userPackagesDirPath)
requireSpecs(path.join(config.userPackagesDirPath, packageName))
setSpecType('user')
| Use fs.readdirSync() for listing package directories | Use fs.readdirSync() for listing package directories
Previously fsUtils.listTreeSync() was used which returns every path
in the tree, not just paths directly underneath the root path.
This speeds up the spec suite require time by not stat'ing the entire
node_modules directory.
| CoffeeScript | mit | helber/atom,john-kelly/atom,GHackAnonymous/atom,codex8/atom,mnquintana/atom,tanin47/atom,alfredxing/atom,daxlab/atom,mdumrauf/atom,Hasimir/atom,Mokolea/atom,jordanbtucker/atom,CraZySacX/atom,mostafaeweda/atom,crazyquark/atom,Dennis1978/atom,sekcheong/atom,transcranial/atom,davideg/atom,deepfox/atom,abcP9110/atom,0x73/atom,hellendag/atom,lisonma/atom,FoldingText/atom,yamhon/atom,kjav/atom,fredericksilva/atom,bolinfest/atom,NunoEdgarGub1/atom,NunoEdgarGub1/atom,daxlab/atom,florianb/atom,oggy/atom,niklabh/atom,toqz/atom,paulcbetts/atom,tony612/atom,johnhaley81/atom,Jonekee/atom,kevinrenaers/atom,GHackAnonymous/atom,mertkahyaoglu/atom,amine7536/atom,YunchengLiao/atom,MjAbuz/atom,gontadu/atom,lpommers/atom,omarhuanca/atom,originye/atom,dannyflax/atom,gisenberg/atom,targeter21/atom,ykeisuke/atom,nvoron23/atom,jlord/atom,NunoEdgarGub1/atom,xream/atom,lisonma/atom,batjko/atom,splodingsocks/atom,lpommers/atom,qskycolor/atom,Andrey-Pavlov/atom,basarat/atom,fredericksilva/atom,hagb4rd/atom,ykeisuke/atom,panuchart/atom,CraZySacX/atom,panuchart/atom,scv119/atom,h0dgep0dge/atom,devoncarew/atom,Rychard/atom,jeremyramin/atom,kc8wxm/atom,ilovezy/atom,davideg/atom,rjattrill/atom,bj7/atom,qskycolor/atom,dijs/atom,dsandstrom/atom,devmario/atom,helber/atom,Shekharrajak/atom,ardeshirj/atom,darwin/atom,kaicataldo/atom,liuderchi/atom,me6iaton/atom,bencolon/atom,vcarrera/atom,xream/atom,deepfox/atom,tjkr/atom,tony612/atom,DiogoXRP/atom,kc8wxm/atom,andrewleverette/atom,niklabh/atom,n-riesco/atom,Jandersolutions/atom,ezeoleaf/atom,brettle/atom,devmario/atom,Ju2ender/atom,Arcanemagus/atom,phord/atom,githubteacher/atom,nvoron23/atom,hagb4rd/atom,Jandersolutions/atom,champagnez/atom,Arcanemagus/atom,pombredanne/atom,ashneo76/atom,deepfox/atom,decaffeinate-examples/atom,einarmagnus/atom,anuwat121/atom,YunchengLiao/atom,Ju2ender/atom,scippio/atom,yamhon/atom,kjav/atom,gisenberg/atom,Ju2ender/atom,tony612/atom,Sangaroonaom/atom,bsmr-x-script/atom,scippio/atom,johnrizzo1/atom,constanzaurzua/atom,jtrose2/atom,Rodjana/atom,RuiDGoncalves/atom,fscherwi/atom,ezeoleaf/atom,yomybaby/atom,omarhuanca/atom,atom/atom,FoldingText/atom,matthewclendening/atom,mostafaeweda/atom,oggy/atom,SlimeQ/atom,bcoe/atom,t9md/atom,AlbertoBarrago/atom,devmario/atom,chfritz/atom,fedorov/atom,Galactix/atom,brettle/atom,palita01/atom,russlescai/atom,davideg/atom,amine7536/atom,rjattrill/atom,mertkahyaoglu/atom,gontadu/atom,jtrose2/atom,kandros/atom,omarhuanca/atom,yomybaby/atom,medovob/atom,andrewleverette/atom,batjko/atom,codex8/atom,johnhaley81/atom,stinsonga/atom,NunoEdgarGub1/atom,abcP9110/atom,rsvip/aTom,nvoron23/atom,ali/atom,darwin/atom,ReddTea/atom,sekcheong/atom,jjz/atom,AlexxNica/atom,rjattrill/atom,sotayamashita/atom,yalexx/atom,KENJU/atom,hpham04/atom,woss/atom,Jonekee/atom,jlord/atom,abcP9110/atom,florianb/atom,Jdesk/atom,vhutheesing/atom,dkfiresky/atom,daxlab/atom,fscherwi/atom,vhutheesing/atom,avdg/atom,decaffeinate-examples/atom,scv119/atom,ObviouslyGreen/atom,paulcbetts/atom,0x73/atom,sillvan/atom,me-benni/atom,KENJU/atom,omarhuanca/atom,ppamorim/atom,woss/atom,githubteacher/atom,decaffeinate-examples/atom,me6iaton/atom,bj7/atom,sebmck/atom,elkingtonmcb/atom,gzzhanghao/atom,brumm/atom,rxkit/atom,amine7536/atom,hharchani/atom,boomwaiza/atom,chengky/atom,folpindo/atom,Hasimir/atom,fedorov/atom,MjAbuz/atom,einarmagnus/atom,FoldingText/atom,ilovezy/atom,nucked/atom,lovesnow/atom,palita01/atom,CraZySacX/atom,acontreras89/atom,ReddTea/atom,rsvip/aTom,liuxiong332/atom,bcoe/atom,fang-yufeng/atom,andrewleverette/atom,fedorov/atom,me6iaton/atom,Galactix/atom,sotayamashita/atom,florianb/atom,yomybaby/atom,sillvan/atom,stinsonga/atom,h0dgep0dge/atom,sebmck/atom,rjattrill/atom,Austen-G/BlockBuilder,vinodpanicker/atom,AlexxNica/atom,GHackAnonymous/atom,g2p/atom,AdrianVovk/substance-ide,abe33/atom,Ju2ender/atom,basarat/atom,Shekharrajak/atom,DiogoXRP/atom,ironbox360/atom,Rodjana/atom,toqz/atom,sekcheong/atom,ppamorim/atom,amine7536/atom,bryonwinger/atom,palita01/atom,Mokolea/atom,devoncarew/atom,vjeux/atom,hagb4rd/atom,mrodalgaard/atom,stuartquin/atom,hakatashi/atom,nvoron23/atom,folpindo/atom,ali/atom,russlescai/atom,bradgearon/atom,erikhakansson/atom,kittens/atom,Jandersoft/atom,lisonma/atom,codex8/atom,sebmck/atom,isghe/atom,ashneo76/atom,rmartin/atom,ashneo76/atom,kc8wxm/atom,basarat/atom,n-riesco/atom,vcarrera/atom,bsmr-x-script/atom,AlbertoBarrago/atom,rmartin/atom,brettle/atom,kjav/atom,dannyflax/atom,jjz/atom,Ju2ender/atom,lisonma/atom,phord/atom,Abdillah/atom,harshdattani/atom,bencolon/atom,rookie125/atom,john-kelly/atom,prembasumatary/atom,RobinTec/atom,isghe/atom,rlugojr/atom,rxkit/atom,deoxilix/atom,Huaraz2/atom,deepfox/atom,jacekkopecky/atom,t9md/atom,hharchani/atom,sxgao3001/atom,mnquintana/atom,jlord/atom,fredericksilva/atom,ppamorim/atom,liuxiong332/atom,davideg/atom,svanharmelen/atom,ardeshirj/atom,GHackAnonymous/atom,FIT-CSE2410-A-Bombs/atom,qskycolor/atom,qiujuer/atom,ironbox360/atom,Ingramz/atom,avdg/atom,woss/atom,ironbox360/atom,Neron-X5/atom,tanin47/atom,woss/atom,Galactix/atom,Andrey-Pavlov/atom,Ingramz/atom,crazyquark/atom,hpham04/atom,PKRoma/atom,ReddTea/atom,gisenberg/atom,crazyquark/atom,ilovezy/atom,qskycolor/atom,ppamorim/atom,Rychard/atom,stuartquin/atom,john-kelly/atom,pombredanne/atom,scv119/atom,efatsi/atom,nvoron23/atom,burodepeper/atom,abe33/atom,Rodjana/atom,fang-yufeng/atom,Ingramz/atom,mnquintana/atom,DiogoXRP/atom,fang-yufeng/atom,johnrizzo1/atom,pombredanne/atom,synaptek/atom,Abdillah/atom,Klozz/atom,dijs/atom,G-Baby/atom,matthewclendening/atom,wiggzz/atom,kc8wxm/atom,Sangaroonaom/atom,crazyquark/atom,panuchart/atom,tjkr/atom,Jdesk/atom,lpommers/atom,liuxiong332/atom,batjko/atom,bcoe/atom,prembasumatary/atom,kittens/atom,jlord/atom,pkdevbox/atom,jordanbtucker/atom,basarat/atom,hagb4rd/atom,burodepeper/atom,chfritz/atom,champagnez/atom,hellendag/atom,yomybaby/atom,rxkit/atom,russlescai/atom,RobinTec/atom,ardeshirj/atom,ralphtheninja/atom,AlexxNica/atom,oggy/atom,beni55/atom,gisenberg/atom,Sangaroonaom/atom,kittens/atom,vcarrera/atom,gabrielPeart/atom,NunoEdgarGub1/atom,kevinrenaers/atom,SlimeQ/atom,ali/atom,constanzaurzua/atom,florianb/atom,pengshp/atom,dannyflax/atom,chengky/atom,sekcheong/atom,ObviouslyGreen/atom,targeter21/atom,Locke23rus/atom,ezeoleaf/atom,Jdesk/atom,rmartin/atom,Andrey-Pavlov/atom,gzzhanghao/atom,yomybaby/atom,yalexx/atom,liuxiong332/atom,gabrielPeart/atom,dkfiresky/atom,alexandergmann/atom,yangchenghu/atom,bj7/atom,brumm/atom,nucked/atom,woss/atom,fang-yufeng/atom,Austen-G/BlockBuilder,gisenberg/atom,fedorov/atom,tisu2tisu/atom,cyzn/atom,toqz/atom,lovesnow/atom,svanharmelen/atom,KENJU/atom,mostafaeweda/atom,crazyquark/atom,acontreras89/atom,Klozz/atom,charleswhchan/atom,vcarrera/atom,isghe/atom,deepfox/atom,tony612/atom,me6iaton/atom,sillvan/atom,MjAbuz/atom,execjosh/atom,Dennis1978/atom,lisonma/atom,originye/atom,t9md/atom,boomwaiza/atom,PKRoma/atom,fang-yufeng/atom,qiujuer/atom,devoncarew/atom,scippio/atom,tmunro/atom,bolinfest/atom,yangchenghu/atom,synaptek/atom,rlugojr/atom,targeter21/atom,kc8wxm/atom,qiujuer/atom,tisu2tisu/atom,lovesnow/atom,kaicataldo/atom,synaptek/atom,hakatashi/atom,ivoadf/atom,hakatashi/atom,me-benni/atom,fredericksilva/atom,john-kelly/atom,n-riesco/atom,rlugojr/atom,alfredxing/atom,Jandersolutions/atom,sillvan/atom,hharchani/atom,anuwat121/atom,codex8/atom,darwin/atom,fredericksilva/atom,harshdattani/atom,dkfiresky/atom,GHackAnonymous/atom,constanzaurzua/atom,Abdillah/atom,jacekkopecky/atom,mrodalgaard/atom,champagnez/atom,synaptek/atom,omarhuanca/atom,Abdillah/atom,KENJU/atom,johnhaley81/atom,YunchengLiao/atom,splodingsocks/atom,lovesnow/atom,harshdattani/atom,kandros/atom,0x73/atom,BogusCurry/atom,Jandersoft/atom,sebmck/atom,chengky/atom,codex8/atom,0x73/atom,gontadu/atom,me-benni/atom,Jandersoft/atom,kdheepak89/atom,G-Baby/atom,splodingsocks/atom,AlisaKiatkongkumthon/atom,h0dgep0dge/atom,BogusCurry/atom,ralphtheninja/atom,Jdesk/atom,mertkahyaoglu/atom,devmario/atom,isghe/atom,SlimeQ/atom,bryonwinger/atom,g2p/atom,acontreras89/atom,jeremyramin/atom,acontreras89/atom,h0dgep0dge/atom,Jdesk/atom,transcranial/atom,tmunro/atom,seedtigo/atom,Mokolea/atom,qiujuer/atom,isghe/atom,dkfiresky/atom,alexandergmann/atom,gzzhanghao/atom,Huaraz2/atom,vinodpanicker/atom,vjeux/atom,nrodriguez13/atom,ali/atom,prembasumatary/atom,sxgao3001/atom,hakatashi/atom,jtrose2/atom,mdumrauf/atom,beni55/atom,mnquintana/atom,xream/atom,gabrielPeart/atom,constanzaurzua/atom,Galactix/atom,g2p/atom,Jandersoft/atom,bradgearon/atom,scv119/atom,ppamorim/atom,cyzn/atom,atom/atom,ivoadf/atom,charleswhchan/atom,alexandergmann/atom,yalexx/atom,Hasimir/atom,Hasimir/atom,Klozz/atom,ReddTea/atom,pkdevbox/atom,kittens/atom,efatsi/atom,nrodriguez13/atom,bencolon/atom,russlescai/atom,dsandstrom/atom,dsandstrom/atom,liuderchi/atom,G-Baby/atom,jacekkopecky/atom,Neron-X5/atom,lovesnow/atom,kdheepak89/atom,dannyflax/atom,001szymon/atom,sillvan/atom,BogusCurry/atom,dannyflax/atom,devmario/atom,Galactix/atom,ivoadf/atom,KENJU/atom,Abdillah/atom,abcP9110/atom,russlescai/atom,mostafaeweda/atom,jeremyramin/atom,bcoe/atom,einarmagnus/atom,erikhakansson/atom,amine7536/atom,matthewclendening/atom,stuartquin/atom,Shekharrajak/atom,RobinTec/atom,cyzn/atom,liuderchi/atom,SlimeQ/atom,matthewclendening/atom,abe33/atom,stinsonga/atom,medovob/atom,deoxilix/atom,charleswhchan/atom,yamhon/atom,mertkahyaoglu/atom,kdheepak89/atom,deoxilix/atom,Dennis1978/atom,anuwat121/atom,chengky/atom,FIT-CSE2410-A-Bombs/atom,jjz/atom,oggy/atom,hpham04/atom,einarmagnus/atom,sotayamashita/atom,jtrose2/atom,pkdevbox/atom,wiggzz/atom,mostafaeweda/atom,Shekharrajak/atom,001szymon/atom,boomwaiza/atom,Hasimir/atom,bryonwinger/atom,vjeux/atom,jordanbtucker/atom,vinodpanicker/atom,synaptek/atom,sxgao3001/atom,yalexx/atom,FoldingText/atom,transcranial/atom,Neron-X5/atom,tjkr/atom,Locke23rus/atom,alfredxing/atom,sxgao3001/atom,RuiDGoncalves/atom,mrodalgaard/atom,charleswhchan/atom,kdheepak89/atom,john-kelly/atom,YunchengLiao/atom,oggy/atom,bcoe/atom,originye/atom,githubteacher/atom,florianb/atom,paulcbetts/atom,Arcanemagus/atom,ilovezy/atom,targeter21/atom,beni55/atom,n-riesco/atom,devoncarew/atom,AdrianVovk/substance-ide,execjosh/atom,rsvip/aTom,erikhakansson/atom,charleswhchan/atom,Neron-X5/atom,phord/atom,Austen-G/BlockBuilder,medovob/atom,MjAbuz/atom,rookie125/atom,pombredanne/atom,liuxiong332/atom,vjeux/atom,kaicataldo/atom,matthewclendening/atom,kdheepak89/atom,decaffeinate-examples/atom,liuderchi/atom,qskycolor/atom,atom/atom,devoncarew/atom,niklabh/atom,AlisaKiatkongkumthon/atom,Austen-G/BlockBuilder,ezeoleaf/atom,einarmagnus/atom,SlimeQ/atom,folpindo/atom,qiujuer/atom,AdrianVovk/substance-ide,Jonekee/atom,dsandstrom/atom,rmartin/atom,rmartin/atom,jlord/atom,pombredanne/atom,bolinfest/atom,ObviouslyGreen/atom,hharchani/atom,johnrizzo1/atom,Jandersolutions/atom,avdg/atom,basarat/atom,paulcbetts/atom,Rychard/atom,batjko/atom,kandros/atom,yalexx/atom,sebmck/atom,vjeux/atom,kjav/atom,hpham04/atom,Austen-G/BlockBuilder,pengshp/atom,ali/atom,elkingtonmcb/atom,tmunro/atom,Jandersolutions/atom,bryonwinger/atom,vinodpanicker/atom,fscherwi/atom,ykeisuke/atom,jtrose2/atom,rookie125/atom,RuiDGoncalves/atom,PKRoma/atom,kevinrenaers/atom,me6iaton/atom,splodingsocks/atom,n-riesco/atom,fedorov/atom,Andrey-Pavlov/atom,MjAbuz/atom,dijs/atom,jjz/atom,jacekkopecky/atom,sekcheong/atom,jacekkopecky/atom,kjav/atom,wiggzz/atom,Locke23rus/atom,RobinTec/atom,sxgao3001/atom,acontreras89/atom,jacekkopecky/atom,targeter21/atom,toqz/atom,Huaraz2/atom,hharchani/atom,abcP9110/atom,burodepeper/atom,Jandersoft/atom,hagb4rd/atom,jjz/atom,elkingtonmcb/atom,ReddTea/atom,AlisaKiatkongkumthon/atom,basarat/atom,FoldingText/atom,dkfiresky/atom,kittens/atom,ilovezy/atom,mertkahyaoglu/atom,rsvip/aTom,batjko/atom,tony612/atom,tisu2tisu/atom,toqz/atom,efatsi/atom,mdumrauf/atom,Austen-G/BlockBuilder,prembasumatary/atom,RobinTec/atom,prembasumatary/atom,execjosh/atom,yangchenghu/atom,rsvip/aTom,seedtigo/atom,constanzaurzua/atom,dannyflax/atom,chfritz/atom,vhutheesing/atom,svanharmelen/atom,dsandstrom/atom,FIT-CSE2410-A-Bombs/atom,brumm/atom,davideg/atom,bradgearon/atom,hpham04/atom,bsmr-x-script/atom,Andrey-Pavlov/atom,001szymon/atom,nucked/atom,ralphtheninja/atom,YunchengLiao/atom,mnquintana/atom,vinodpanicker/atom,helber/atom,Shekharrajak/atom,pengshp/atom,vcarrera/atom,chengky/atom,seedtigo/atom,AlbertoBarrago/atom,tanin47/atom,hellendag/atom,nrodriguez13/atom,Neron-X5/atom,stinsonga/atom,FoldingText/atom |
6ab6145ab8ae052ee4942d524b39c662d0762b89 | server/methods/setAvatarFromService.coffee | server/methods/setAvatarFromService.coffee | Meteor.methods
setAvatarFromService: (image, service) ->
if not Meteor.userId()
throw new Meteor.Error 203, '[methods] typingStatus -> Usuário não logado'
user = Meteor.user()
file = new FS.File image
file.attachData image, ->
file.name user.username
Avatars.insert file, (err, fileObj) ->
Meteor.users.update {_id: user._id}, {$set: {avatarOrigin: service}}
| Meteor.methods
setAvatarFromService: (image, service) ->
if not Meteor.userId()
throw new Meteor.Error 203, '[methods] typingStatus -> Usuário não logado'
user = Meteor.user()
file = new FS.File image
file.attachData image, ->
file.name user.username
Avatars.insert file, (err, fileObj) ->
Meteor.users.update {_id: user._id}, {$set: {avatarOrigin: service}}
resetAvatar: (image, service) ->
if not Meteor.userId()
throw new Meteor.Error 203, '[methods] typingStatus -> Usuário não logado'
user = Meteor.user()
Avatars.remove {'copies.avatars.name': user.username}
Meteor.users.update user._id, {$unset: {avatarOrigin: 1}}
| Add method to reset avatar | Add method to reset avatar
| CoffeeScript | mit | erikmaarten/Rocket.Chat,haosdent/Rocket.Chat,abduljanjua/TheHub,subesokun/Rocket.Chat,acidicX/Rocket.Chat,hazio/Rocket.Chat,Deepakkothandan/Rocket.Chat,acidsound/Rocket.Chat,matthewshirley/Rocket.Chat,alexbrazier/Rocket.Chat,Gyubin/Rocket.Chat,PavelVanecek/Rocket.Chat,yuyixg/Rocket.Chat,lukaroski/traden,ludiculous/Rocket.Chat,mrsimpson/Rocket.Chat,mhurwi/Rocket.Chat,psadaic/Rocket.Chat,KyawNaingTun/Rocket.Chat,jbsavoy18/rocketchat-1,ggazzo/Rocket.Chat,ealbers/Rocket.Chat,nishimaki10/Rocket.Chat,lihuanghai/Rocket.Chat,Deepakkothandan/Rocket.Chat,LeonardOliveros/Rocket.Chat,tlongren/Rocket.Chat,jbsavoy18/rocketchat-1,tlongren/Rocket.Chat,linnovate/hi,mrinaldhar/Rocket.Chat,ut7/Rocket.Chat,jonathanhartman/Rocket.Chat,apnero/tactixteam,AlecTroemel/Rocket.Chat,AimenJoe/Rocket.Chat,PavelVanecek/Rocket.Chat,Maysora/Rocket.Chat,nishimaki10/Rocket.Chat,tntobias/Rocket.Chat,ggazzo/Rocket.Chat,celloudiallo/Rocket.Chat,mrsimpson/Rocket.Chat,galrotem1993/Rocket.Chat,linnovate/hi,qnib/Rocket.Chat,4thParty/Rocket.Chat,TribeMedia/Rocket.Chat,adamteece/Rocket.Chat,nrhubbar/Rocket.Chat,Ninotna/Rocket.Chat,lihuanghai/Rocket.Chat,lucasgolino/Rocket.Chat,TribeMedia/Rocket.Chat,MiHuevos/Rocket.Chat,flaviogrossi/Rocket.Chat,OtkurBiz/Rocket.Chat,leohmoraes/Rocket.Chat,mccambridge/Rocket.Chat,jessedhillon/Rocket.Chat,ZBoxApp/Rocket.Chat,Flitterkill/Rocket.Chat,abhishekshukla0302/trico,nathantreid/Rocket.Chat,JamesHGreen/Rocket_API,JamesHGreen/Rocket.Chat,4thParty/Rocket.Chat,Sing-Li/Rocket.Chat,marzieh312/Rocket.Chat,abduljanjua/TheHub,ahmadassaf/Rocket.Chat,ziedmahdi/Rocket.Chat,k0nsl/Rocket.Chat,rasata/Rocket.Chat,4thParty/Rocket.Chat,abhishekshukla0302/trico,org100h1/Rocket.Panda,jessedhillon/Rocket.Chat,acidicX/Rocket.Chat,madmanteam/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,yuyixg/Rocket.Chat,berndsi/Rocket.Chat,sscpac/chat-locker,mitar/Rocket.Chat,karlprieb/Rocket.Chat,LearnersGuild/Rocket.Chat,ealbers/Rocket.Chat,mitar/Rocket.Chat,capensisma/Rocket.Chat,thunderrabbit/Rocket.Chat,tradetiger/Rocket.Chat,4thParty/Rocket.Chat,fatihwk/Rocket.Chat,williamfortunademoraes/Rocket.Chat,I-am-Gabi/Rocket.Chat,litewhatever/Rocket.Chat,andela-cnnadi/Rocket.Chat,steedos/chat,tradetiger/Rocket.Chat,TribeMedia/Rocket.Chat,williamfortunademoraes/Rocket.Chat,icaromh/Rocket.Chat,thunderrabbit/Rocket.Chat,LearnersGuild/echo-chat,wicked539/Rocket.Chat,xasx/Rocket.Chat,acaronmd/Rocket.Chat,nrhubbar/Rocket.Chat,lukaroski/traden,ederribeiro/Rocket.Chat,wtsarchive/Rocket.Chat,sikofitt/Rocket.Chat,Codebrahma/Rocket.Chat,jonathanhartman/Rocket.Chat,matthewshirley/Rocket.Chat,andela-cnnadi/Rocket.Chat,umeshrs/rocket-chat,qnib/Rocket.Chat,mrsimpson/Rocket.Chat,AlecTroemel/Rocket.Chat,warcode/Rocket.Chat,xboston/Rocket.Chat,VoiSmart/Rocket.Chat,slava-sh/Rocket.Chat,marzieh312/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,Gudii/Rocket.Chat,JamesHGreen/Rocket.Chat,galrotem1993/Rocket.Chat,callblueday/Rocket.Chat,jessedhillon/Rocket.Chat,BorntraegerMarc/Rocket.Chat,inoxth/Rocket.Chat,fonsich/Rocket.Chat,Jandersoft/Rocket.Chat,umeshrs/rocket-chat-integration,janmaghuyop/Rocket.Chat,ludiculous/Rocket.Chat,inoxth/Rocket.Chat,jhou2/Rocket.Chat,org100h1/Rocket.Panda,ImpressiveSetOfIntelligentStudents/chat,hazio/Rocket.Chat,pitamar/Rocket.Chat,HeapCity/Heap.City,pitamar/Rocket.Chat,atyenoria/Rocket.Chat,timkinnane/Rocket.Chat,himeshp/Rocket.Chat,erikmaarten/Rocket.Chat,LearnersGuild/echo-chat,dmitrijs-balcers/Rocket.Chat,katopz/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,wtsarchive/Rocket.Chat,mhurwi/Rocket.Chat,umeshrs/rocket-chat,ggazzo/Rocket.Chat,k0nsl/Rocket.Chat,flaviogrossi/Rocket.Chat,umeshrs/rocket-chat,osxi/Rocket.Chat,Kiran-Rao/Rocket.Chat,ZBoxApp/Rocket.Chat,Movile/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,cnash/Rocket.Chat,k0nsl/Rocket.Chat,liemqv/Rocket.Chat,Dianoga/Rocket.Chat,ndarilek/Rocket.Chat,KyawNaingTun/Rocket.Chat,xasx/Rocket.Chat,himeshp/Rocket.Chat,madmanteam/Rocket.Chat,nishimaki10/Rocket.Chat,BorntraegerMarc/Rocket.Chat,acidsound/Rocket.Chat,uniteddiversity/Rocket.Chat,subesokun/Rocket.Chat,danielbressan/Rocket.Chat,liemqv/Rocket.Chat,callblueday/Rocket.Chat,wicked539/Rocket.Chat,cdwv/Rocket.Chat,Deepakkothandan/Rocket.Chat,timkinnane/Rocket.Chat,callmekatootie/Rocket.Chat,nrhubbar/Rocket.Chat,Abdelhamidhenni/Rocket.Chat,Gyubin/Rocket.Chat,parkmap/Rocket.Chat,wtsarchive/Rocket.Chat,amaapp/ama,BHWD/noouchat,callmekatootie/Rocket.Chat,alexbrazier/Rocket.Chat,cnash/Rocket.Chat,rasata/Rocket.Chat,Codebrahma/Rocket.Chat,karlprieb/Rocket.Chat,HeapCity/Heap.City,AlecTroemel/Rocket.Chat,jonathanhartman/Rocket.Chat,wangleihd/Rocket.Chat,haosdent/Rocket.Chat,mitar/Rocket.Chat,lukaroski/traden,osxi/Rocket.Chat,mccambridge/Rocket.Chat,revspringjake/Rocket.Chat,celloudiallo/Rocket.Chat,berndsi/Rocket.Chat,yuyixg/Rocket.Chat,subesokun/Rocket.Chat,Maysora/Rocket.Chat,thswave/Rocket.Chat,jeanmatheussouto/Rocket.Chat,xboston/Rocket.Chat,jyx140521/Rocket.Chat,sargentsurg/Rocket.Chat,VoiSmart/Rocket.Chat,jadeqwang/Rocket.Chat,psadaic/Rocket.Chat,ahmadassaf/Rocket.Chat,tzellman/Rocket.Chat,Jandersolutions/Rocket.Chat,snaiperskaya96/Rocket.Chat,thebakeryio/Rocket.Chat,pitamar/Rocket.Chat,mohamedhagag/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,tzellman/Rocket.Chat,soonahn/Rocket.Chat,Ninotna/Rocket.Chat,danielbressan/Rocket.Chat,glnarayanan/Rocket.Chat,JamesHGreen/Rocket.Chat,JamesHGreen/Rocket_API,himeshp/Rocket.Chat,intelradoux/Rocket.Chat,coreyaus/Rocket.Chat,jhou2/Rocket.Chat,AimenJoe/Rocket.Chat,princesust/Rocket.Chat,ut7/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,mhurwi/Rocket.Chat,soonahn/Rocket.Chat,intelradoux/Rocket.Chat,snaiperskaya96/Rocket.Chat,LearnersGuild/Rocket.Chat,intelradoux/Rocket.Chat,acaronmd/Rocket.Chat,mohamedhagag/Rocket.Chat,inoxth/Rocket.Chat,LeonardOliveros/Rocket.Chat,snaiperskaya96/Rocket.Chat,Flitterkill/Rocket.Chat,freakynit/Rocket.Chat,klatys/Rocket.Chat,williamfortunademoraes/Rocket.Chat,hazio/Rocket.Chat,greatdinosaur/Rocket.Chat,ImpressiveSetOfIntelligentStudents/chat,sscpac/chat-locker,mitar/Rocket.Chat,fduraibi/Rocket.Chat,katopz/Rocket.Chat,xboston/Rocket.Chat,jeanmatheussouto/Rocket.Chat,NMandapaty/Rocket.Chat,bopjesvla/chatmafia,slava-sh/Rocket.Chat,parkmap/Rocket.Chat,fduraibi/Rocket.Chat,nabiltntn/Rocket.Chat,ealbers/Rocket.Chat,wangleihd/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,anhld/Rocket.Chat,Kiran-Rao/Rocket.Chat,Kiran-Rao/Rocket.Chat,mrinaldhar/Rocket.Chat,xboston/Rocket.Chat,bt/Rocket.Chat,glnarayanan/Rocket.Chat,ziedmahdi/Rocket.Chat,ndarilek/Rocket.Chat,j-ew-s/Rocket.Chat,litewhatever/Rocket.Chat,revspringjake/Rocket.Chat,jyx140521/Rocket.Chat,webcoding/Rocket.Chat,Maysora/Rocket.Chat,kkochubey1/Rocket.Chat,k0nsl/Rocket.Chat,LearnersGuild/echo-chat,biomassives/Rocket.Chat,nabiltntn/Rocket.Chat,ziedmahdi/Rocket.Chat,lonbaker/Rocket.Chat,coreyaus/Rocket.Chat,Dianoga/Rocket.Chat,tlongren/Rocket.Chat,apnero/tactixteam,liemqv/Rocket.Chat,anhld/Rocket.Chat,sikofitt/Rocket.Chat,org100h1/Rocket.Panda,ludiculous/Rocket.Chat,timkinnane/Rocket.Chat,liuliming2008/Rocket.Chat,ut7/Rocket.Chat,sunhaolin/Rocket.Chat,Movile/Rocket.Chat,phlkchan/Rocket.Chat,JisuPark/Rocket.Chat,mwharrison/Rocket.Chat,icaromh/Rocket.Chat,fatihwk/Rocket.Chat,phlkchan/Rocket.Chat,greatdinosaur/Rocket.Chat,nathantreid/Rocket.Chat,HeapCity/Heap.City,MiHuevos/Rocket.Chat,Gudii/Rocket.Chat,LearnersGuild/echo-chat,JamesHGreen/Rocket_API,Dianoga/Rocket.Chat,qnib/Rocket.Chat,AimenJoe/Rocket.Chat,galrotem1993/Rocket.Chat,sunhaolin/Rocket.Chat,osxi/Rocket.Chat,warcode/Rocket.Chat,thebakeryio/Rocket.Chat,jonathanhartman/Rocket.Chat,Codebrahma/Rocket.Chat,steedos/chat,princesust/Rocket.Chat,fonsich/Rocket.Chat,inoxth/Rocket.Chat,cdwv/Rocket.Chat,qnib/Rocket.Chat,alexbrazier/Rocket.Chat,org100h1/Rocket.Panda,sunhaolin/Rocket.Chat,Abdelhamidhenni/Rocket.Chat,mccambridge/Rocket.Chat,LeonardOliveros/Rocket.Chat,callblueday/Rocket.Chat,soonahn/Rocket.Chat,slava-sh/Rocket.Chat,pkgodara/Rocket.Chat,uniteddiversity/Rocket.Chat,ggazzo/Rocket.Chat,I-am-Gabi/Rocket.Chat,karlprieb/Rocket.Chat,j-ew-s/Rocket.Chat,haoyixin/Rocket.Chat,xasx/Rocket.Chat,bopjesvla/chatmafia,pachox/Rocket.Chat,webcoding/Rocket.Chat,sargentsurg/Rocket.Chat,xasx/Rocket.Chat,KyawNaingTun/Rocket.Chat,lonbaker/Rocket.Chat,ziedmahdi/Rocket.Chat,tradetiger/Rocket.Chat,mrinaldhar/Rocket.Chat,liuliming2008/Rocket.Chat,Sing-Li/Rocket.Chat,pkgodara/Rocket.Chat,cdwv/Rocket.Chat,igorstajic/Rocket.Chat,Sing-Li/Rocket.Chat,ndarilek/Rocket.Chat,icaromh/Rocket.Chat,sscpac/chat-locker,Jandersoft/Rocket.Chat,bopjesvla/chatmafia,Gudii/Rocket.Chat,Gyubin/Rocket.Chat,jadeqwang/Rocket.Chat,madmanteam/Rocket.Chat,ederribeiro/Rocket.Chat,liuliming2008/Rocket.Chat,arvi/Rocket.Chat,acidsound/Rocket.Chat,PavelVanecek/Rocket.Chat,greatdinosaur/Rocket.Chat,klatys/Rocket.Chat,umeshrs/rocket-chat-integration,bt/Rocket.Chat,warcode/Rocket.Chat,jhou2/Rocket.Chat,gitaboard/Rocket.Chat,jeanmatheussouto/Rocket.Chat,callmekatootie/Rocket.Chat,thebakeryio/Rocket.Chat,jyx140521/Rocket.Chat,anhld/Rocket.Chat,BHWD/noouchat,marzieh312/Rocket.Chat,mwharrison/Rocket.Chat,ut7/Rocket.Chat,Deepakkothandan/Rocket.Chat,Ninotna/Rocket.Chat,uniteddiversity/Rocket.Chat,mccambridge/Rocket.Chat,igorstajic/Rocket.Chat,atyenoria/Rocket.Chat,revspringjake/Rocket.Chat,ederribeiro/Rocket.Chat,psadaic/Rocket.Chat,Jandersolutions/Rocket.Chat,Gyubin/Rocket.Chat,timkinnane/Rocket.Chat,jeann2013/Rocket.Chat,biomassives/Rocket.Chat,apnero/tactixteam,danielbressan/Rocket.Chat,bt/Rocket.Chat,wangleihd/Rocket.Chat,ahmadassaf/Rocket.Chat,cnash/Rocket.Chat,BHWD/noouchat,christmo/Rocket.Chat,Achaikos/Rocket.Chat,mohamedhagag/Rocket.Chat,katopz/Rocket.Chat,PavelVanecek/Rocket.Chat,pachox/Rocket.Chat,fonsich/Rocket.Chat,VoiSmart/Rocket.Chat,Achaikos/Rocket.Chat,Movile/Rocket.Chat,Jandersolutions/Rocket.Chat,wicked539/Rocket.Chat,leohmoraes/Rocket.Chat,fatihwk/Rocket.Chat,tntobias/Rocket.Chat,haoyixin/Rocket.Chat,Gudii/Rocket.Chat,capensisma/Rocket.Chat,gitaboard/Rocket.Chat,ealbers/Rocket.Chat,leohmoraes/Rocket.Chat,coreyaus/Rocket.Chat,jbsavoy18/rocketchat-1,jadeqwang/Rocket.Chat,subesokun/Rocket.Chat,Movile/Rocket.Chat,amaapp/ama,Flitterkill/Rocket.Chat,liuliming2008/Rocket.Chat,arvi/Rocket.Chat,andela-cnnadi/Rocket.Chat,marzieh312/Rocket.Chat,ahmadassaf/Rocket.Chat,flaviogrossi/Rocket.Chat,wicked539/Rocket.Chat,rasata/Rocket.Chat,tzellman/Rocket.Chat,jeann2013/Rocket.Chat,LearnersGuild/Rocket.Chat,Gromby/Rocket.Chat,acidicX/Rocket.Chat,pachox/Rocket.Chat,fatihwk/Rocket.Chat,pitamar/Rocket.Chat,janmaghuyop/Rocket.Chat,mwharrison/Rocket.Chat,tntobias/Rocket.Chat,thswave/Rocket.Chat,alenodari/Rocket.Chat,steedos/chat,haoyixin/Rocket.Chat,glnarayanan/Rocket.Chat,Kiran-Rao/Rocket.Chat,celloudiallo/Rocket.Chat,tlongren/Rocket.Chat,webcoding/Rocket.Chat,abhishekshukla0302/trico,florinnichifiriuc/Rocket.Chat,OtkurBiz/Rocket.Chat,ZBoxApp/Rocket.Chat,JisuPark/Rocket.Chat,bt/Rocket.Chat,OtkurBiz/Rocket.Chat,lonbaker/Rocket.Chat,abhishekshukla0302/trico,NMandapaty/Rocket.Chat,abduljanjua/TheHub,BorntraegerMarc/Rocket.Chat,mhurwi/Rocket.Chat,kkochubey1/Rocket.Chat,biomassives/Rocket.Chat,alexbrazier/Rocket.Chat,thswave/Rocket.Chat,philosowaffle/rpi-Rocket.Chat,danielbressan/Rocket.Chat,Sing-Li/Rocket.Chat,nathantreid/Rocket.Chat,florinnichifiriuc/Rocket.Chat,alenodari/Rocket.Chat,igorstajic/Rocket.Chat,steedos/chat,christmo/Rocket.Chat,wtsarchive/Rocket.Chat,amaapp/ama,litewhatever/Rocket.Chat,klatys/Rocket.Chat,AimenJoe/Rocket.Chat,Achaikos/Rocket.Chat,haosdent/Rocket.Chat,wolfika/Rocket.Chat,alenodari/Rocket.Chat,parkmap/Rocket.Chat,litewhatever/Rocket.Chat,sikofitt/Rocket.Chat,acaronmd/Rocket.Chat,I-am-Gabi/Rocket.Chat,jeann2013/Rocket.Chat,matthewshirley/Rocket.Chat,mwharrison/Rocket.Chat,JamesHGreen/Rocket.Chat,inoio/Rocket.Chat,pachox/Rocket.Chat,adamteece/Rocket.Chat,JisuPark/Rocket.Chat,TribeMedia/Rocket.Chat,mrsimpson/Rocket.Chat,inoio/Rocket.Chat,cnash/Rocket.Chat,matthewshirley/Rocket.Chat,acaronmd/Rocket.Chat,haoyixin/Rocket.Chat,igorstajic/Rocket.Chat,intelradoux/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,adamteece/Rocket.Chat,pkgodara/Rocket.Chat,klatys/Rocket.Chat,Flitterkill/Rocket.Chat,AlecTroemel/Rocket.Chat,yuyixg/Rocket.Chat,arvi/Rocket.Chat,gitaboard/Rocket.Chat,princesust/Rocket.Chat,cdwv/Rocket.Chat,LearnersGuild/Rocket.Chat,atyenoria/Rocket.Chat,wolfika/Rocket.Chat,dmitrijs-balcers/Rocket.Chat,BorntraegerMarc/Rocket.Chat,freakynit/Rocket.Chat,NMandapaty/Rocket.Chat,kkochubey1/Rocket.Chat,lucasgolino/Rocket.Chat,janmaghuyop/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,florinnichifiriuc/Rocket.Chat,thunderrabbit/Rocket.Chat,Jandersoft/Rocket.Chat,christmo/Rocket.Chat,berndsi/Rocket.Chat,karlprieb/Rocket.Chat,fduraibi/Rocket.Chat,abduljanjua/TheHub,amaapp/ama,snaiperskaya96/Rocket.Chat,inoio/Rocket.Chat,fduraibi/Rocket.Chat,erikmaarten/Rocket.Chat,phlkchan/Rocket.Chat,nishimaki10/Rocket.Chat,umeshrs/rocket-chat-integration,Dianoga/Rocket.Chat,JamesHGreen/Rocket_API,Abdelhamidhenni/Rocket.Chat,flaviogrossi/Rocket.Chat,capensisma/Rocket.Chat,Gromby/Rocket.Chat,soonahn/Rocket.Chat,lukaroski/traden,MiHuevos/Rocket.Chat,sargentsurg/Rocket.Chat,wolfika/Rocket.Chat,OtkurBiz/Rocket.Chat,Gromby/Rocket.Chat,nabiltntn/Rocket.Chat,tntobias/Rocket.Chat,LeonardOliveros/Rocket.Chat,jbsavoy18/rocketchat-1,mrinaldhar/Rocket.Chat,lihuanghai/Rocket.Chat,galrotem1993/Rocket.Chat,pkgodara/Rocket.Chat,freakynit/Rocket.Chat,Achaikos/Rocket.Chat,ndarilek/Rocket.Chat,NMandapaty/Rocket.Chat,lucasgolino/Rocket.Chat,j-ew-s/Rocket.Chat |
bed87da341c3df5f6b8fb08f10f602001a838711 | app/assets/javascripts/hyper_admin/angularjs/controllers/form_ctrl.js.coffee | app/assets/javascripts/hyper_admin/angularjs/controllers/form_ctrl.js.coffee | angular.module("hyperadmin")
.controller "FormCtrl", ($scope, Restangular) ->
@submit = =>
target = @meta.target
method = @meta.method
onError = (response) =>
errors = response.data
onSuccess = (resource) =>
# Do nothing yet
if method == "post"
Restangular.all(target).post(@resource).then onSuccess, onError
else if method == "patch"
Restangular.one(target).patch(@resource).then onSuccess, onError
this
| angular.module("hyperadmin")
.controller "FormCtrl", ($scope, Restangular) ->
@submit = =>
target = @meta.target
method = @meta.method
onError = (response) =>
@errors = response.data
onSuccess = (resource) =>
# Do nothing yet
if method == "post"
Restangular.all(target).post(@resource).then onSuccess, onError
else if method == "patch"
Restangular.one(target).patch(@resource).then onSuccess, onError
this
| Fix displaying error messages from forms | Fix displaying error messages from forms
| CoffeeScript | mit | hyperoslo/hyper_admin,hyperoslo/hyper_admin,hyperoslo/hyper_admin |
2687bc6b635b00dc1607c2e0ccee08d958692883 | components/form/utilities.coffee | components/form/utilities.coffee | _ = require 'underscore'
{ isTouchDevice } = require '../util/device.coffee'
module.exports =
firstVisibleInput: ($el) ->
$el.find('input:visible, textarea:visible').first()
moveCursorToEnd: ($input) ->
val = $input.val()
$input.val('').val val
autofocus: ($input, defer = false) ->
return if isTouchDevice()
focus = =>
$input.focus()
@moveCursorToEnd $input
if defer then _.defer(focus) else focus()
| _ = require 'underscore'
{ isTouchDevice } = require '../util/device.coffee'
module.exports =
firstVisibleInput: ($el) ->
$el.find('input:visible, textarea:visible').first()
moveCursorToEnd: ($input) ->
val = $input.val()
$input.val('').val val
isFocusable: ($el) ->
$el.is('input') or $el.is('textarea')
autofocus: ($el, defer = false) ->
return if isTouchDevice()
focus = =>
if not @isFocusable $el
$el = @firstVisibleInput $el
$el.focus()
@moveCursorToEnd $el
if defer then _.defer(focus) else focus()
| Allow autofocus to accept a container element | Allow autofocus to accept a container element
| CoffeeScript | mit | xtina-starr/force,anandaroop/force,oxaudo/force,yuki24/force,joeyAghion/force,anandaroop/force,joeyAghion/force,joeyAghion/force,erikdstock/force,joeyAghion/force,oxaudo/force,cavvia/force-1,yuki24/force,cavvia/force-1,mzikherman/force,izakp/force,kanaabe/force,eessex/force,anandaroop/force,eessex/force,cavvia/force-1,artsy/force,izakp/force,erikdstock/force,kanaabe/force,mzikherman/force,yuki24/force,artsy/force,artsy/force,dblock/force,eessex/force,damassi/force,oxaudo/force,anandaroop/force,dblock/force,xtina-starr/force,erikdstock/force,damassi/force,cavvia/force-1,erikdstock/force,eessex/force,artsy/force-public,izakp/force,mzikherman/force,izakp/force,kanaabe/force,damassi/force,artsy/force-public,kanaabe/force,xtina-starr/force,mzikherman/force,artsy/force,dblock/force,oxaudo/force,yuki24/force,kanaabe/force,damassi/force,xtina-starr/force |
c809c7dd87b39a4b74d2a848194813ae838e522d | components/RandomUuid.coffee | components/RandomUuid.coffee | noflo = require("noflo")
uuid = require("node-uuid")
class RandomUuid extends noflo.Component
description: "Generate a random UUID token"
constructor: ->
@inPorts =
in: new noflo.Port
@outPorts =
out: new noflo.Port
@inPorts.in.on "disconnect", =>
token = uuid.v4()
@outPorts.out.send(token)
@outPorts.out.disconnect()
exports.getComponent = -> new RandomUuid
| noflo = require('noflo')
uuid = require('node-uuid')
class RandomUuid extends noflo.Component
description: 'Generate a random UUID token'
constructor: ->
@inPorts =
in: new noflo.Port
@outPorts =
out: new noflo.Port
@inPorts.in.on 'begingroup', (group) =>
@outPorts.out.beginGroup group
@inPorts.in.on 'endgroup', =>
@outPorts.out.endGroup()
@inPorts.in.on 'disconnect', =>
@outPorts.out.disconnect()
@inPorts.in.on 'data', =>
@outPorts.out.send uuid.v4()
exports.getComponent = -> new RandomUuid
| Send UUID on 'data' rather than 'disconnect' | Send UUID on 'data' rather than 'disconnect'
| CoffeeScript | mit | kenhkan/noflo-swiss,meticulo3366/noflo-swiss |
6220f78ade4e5b050fe43d007dde14c971b47c98 | server.coffee | server.coffee | require 'js-yaml'
socket = require 'socket.io'
solid = require 'solid'
{Engine} = require './engine'
engine = new Engine
moves: require './data/bw/moves.yml'
io = socket.listen solid (app) ->
app.get '/', @render ->
@doctype 5
@html ->
@head ->
@js '/socket.io/socket.io.js'
@script @html_safe '''
var socket = io.connect('http://localhost');
socket.on('newuser', function (data) {
console.log(data);
document.write(data);
});
'''
io.sockets.on 'connection', (socket) ->
socket.emit 'newuser', 'you joined!'
| require 'js-yaml'
socket = require 'socket.io'
solid = require 'solid'
{Engine} = require './engine'
engine = new Engine
moves: require './data/bw/moves.yml'
io = socket.listen solid (app) ->
app.get '/jquery.js', @jquery
app.get '/', @render ->
@doctype 5
@html ->
@head ->
@js '/jquery.js'
@js '/socket.io/socket.io.js'
@script @html_safe '''
var socket = io.connect('http://localhost');
socket.on('newuser', function (data) {
console.log(data);
$("#messages").append(data);
});
'''
@body ->
@p JSON.stringify(engine.moves)
@p '#messages'
io.sockets.on 'connection', (socket) ->
socket.emit 'newuser', 'you joined!'
| Add jQuery and show move data. | Add jQuery and show move data.
| CoffeeScript | mit | 6/battletower,pepijndevos/battletower,sarenji/pokebattle-sim,sarenji/pokebattle-sim,askii93/battletower,sarenji/pokebattle-sim |
eb144a76a04fa4765c26bb1595a173fac11e1aef | grammars/generic-config.cson | grammars/generic-config.cson | 'fileTypes': [
'gitattributes'
'gitignore'
'conf'
'ctags'
'hgignore'
'mailmap'
'stylelintignore'
'cfg'
]
'name': 'Generic Configuration'
'patterns': [
{
'include': '#comment'
}
]
'repository':
'comment':
'captures':
'1':
'name': 'comment.line.number-sign.generic-config'
'2':
'name': 'punctuation.definition.comment.generic-config'
'3':
'name': 'comment.line.semi-colon.generic-config'
'4':
'name': 'punctuation.definition.comment.generic-config'
'match': '((#).*$\\n?)|((;).*$\\n?)'
'scopeName': 'text.generic-config'
| 'fileTypes': [
'gitattributes'
'.config/git/ignore'
'.git/info/exclude'
'gitignore'
'conf'
'ctags'
'hgignore'
'mailmap'
'stylelintignore'
'cfg'
]
'name': 'Generic Configuration'
'patterns': [
{
'include': '#comment'
}
]
'repository':
'comment':
'captures':
'1':
'name': 'comment.line.number-sign.generic-config'
'2':
'name': 'punctuation.definition.comment.generic-config'
'3':
'name': 'comment.line.semi-colon.generic-config'
'4':
'name': 'punctuation.definition.comment.generic-config'
'match': '((#).*$\\n?)|((;).*$\\n?)'
'scopeName': 'text.generic-config'
| Add support for gitignores other than .gitignore | Add support for gitignores other than .gitignore
| CoffeeScript | mit | lee-dohm/language-generic-config |
bf91d3fcc50bc181909794cabfdc01b61f70d102 | test/test_client.coffee | test/test_client.coffee | client = require 'nack/client'
process = require 'nack/process'
config = __dirname + "/fixtures/echo.ru"
exports.testClientRequest = (test) ->
test.expect 8
p = process.createProcess config
p.on 'ready', () ->
c = client.createConnection p.sockPath
test.ok c
request = c.request 'GET', '/foo', {}
test.ok request
test.same "GET", request.method
test.same "/foo", request.path
test.same "/foo", request.headers['PATH_INFO']
request.end()
request.on "response", (response) ->
test.ok response
test.same 200, response.statusCode
p.quit()
p.on 'exit', () ->
test.ok true
test.done()
| client = require 'nack/client'
process = require 'nack/process'
config = __dirname + "/fixtures/echo.ru"
exports.testClientRequest = (test) ->
test.expect 10
p = process.createProcess config
p.on 'ready', () ->
c = client.createConnection p.sockPath
test.ok c
request = c.request 'GET', '/foo', {}
test.ok request
test.same "GET", request.method
test.same "/foo", request.path
test.same "/foo", request.headers['PATH_INFO']
test.ok request.writeable
request.end()
request.on 'close', () ->
test.ok true
request.on 'response', (response) ->
test.ok response
test.same 200, response.statusCode
p.quit()
p.on 'exit', () ->
test.ok true
test.done()
| Test client request is a writable stream | Test client request is a writable stream
| CoffeeScript | mit | josh/nack,josh/nack |
80cb00b8ad5f0da94eb359625b15ad56f28b91b0 | spec/file-icons-spec.coffee | spec/file-icons-spec.coffee | DefaultFileIcons = require '../lib/default-file-icons'
FileIcons = require '../lib/file-icons'
describe 'FileIcons', ->
afterEach ->
FileIcons.setService(new DefaultFileIcons)
it 'provides a default', ->
expect(FileIcons.getService()).toBeDefined()
expect(FileIcons.getService()).not.toBeNull()
it 'allows the default to be overridden', ->
service = new Object
FileIcons.setService(service)
expect(FileIcons.getService()).toBe(service)
it 'allows the service to be reset to the default easily', ->
service = new Object
FileIcons.setService(service)
FileIcons.resetService()
expect(FileIcons.getService()).not.toBe(service)
| DefaultFileIcons = require '../lib/default-file-icons'
FileIcons = require '../lib/file-icons'
describe 'FileIcons', ->
afterEach ->
FileIcons.setService(new DefaultFileIcons)
it 'provides a default', ->
expect(FileIcons.getService()).toBeDefined()
expect(FileIcons.getService()).not.toBeNull()
it 'allows the default to be overridden', ->
service = new Object
FileIcons.setService(service)
expect(FileIcons.getService()).toBe(service)
it 'allows the service to be reset to the default easily', ->
service = new Object
FileIcons.setService(service)
FileIcons.resetService()
expect(FileIcons.getService()).not.toBe(service)
describe 'Class handling', ->
workspaceElement = null
beforeEach ->
workspaceElement = atom.views.getView(atom.workspace)
waitsForPromise ->
atom.workspace.open('sample.js')
waitsForPromise ->
atom.packages.activatePackage('tabs')
it 'allows multiple classes to be passed', ->
service =
iconClassForPath: (path) -> 'first second'
FileIcons.setService(service)
tab = workspaceElement.querySelector('.tab')
tab.updateIcon()
expect(tab.itemTitle.className).toBe('title icon first second')
it 'allows an array of classes to be passed', ->
service =
iconClassForPath: (path) -> ['first', 'second']
FileIcons.setService(service)
tab = workspaceElement.querySelector('.tab')
tab.updateIcon()
expect(tab.itemTitle.className).toBe('title icon first second')
| Add a spec for class-list enhancements | Add a spec for class-list enhancements
| CoffeeScript | mit | atom/tabs |
67eccb640b03fff0755d4be6417f0959dfd049a2 | app/assets/javascripts/todo_lists.js.coffee | app/assets/javascripts/todo_lists.js.coffee | # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
OUT.registerCreatedHandler "todo_list", (selector) ->
$(selector).find("a.new").click()
$ ->
# Remove links to todo-list from todo-lists in content area
$('.content h2 a[rel="todo-list"]').each ->
$(this).parent().html $(this).html()
# TODO: doesnot work with live added data
OUT.contentItems.highlightQueryIn ".content-items .content-item-todo-list h2, .content-items .todo-title", (chain) ->
matched_lists = $(".content-items .content-item-todo-list h2 span.highlight").parents('.content-item-todo-list')
matched_lists.find('.content-item').show()
$(window).load ->
$('.content-todo-list.sortable').sortable
connectWith: ".content-todo-list.sortable"
| # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
OUT.registerCreatedHandler "todo_list", (selector) ->
$(selector).find("a.new").click()
$ ->
# Remove links to todo-list from todo-lists in content area
$('.content h2 a[rel="todo-list"]').each ->
$(this).replaceWith $(this).html()
# TODO: doesnot work with live added data
OUT.contentItems.highlightQueryIn ".content-items .content-item-todo-list h2, .content-items .todo-title", (chain) ->
matched_lists = $(".content-items .content-item-todo-list h2 span.highlight").parents('.content-item-todo-list')
matched_lists.find('.content-item').show()
$(window).load ->
$('.content-todo-list.sortable').sortable
connectWith: ".content-todo-list.sortable"
| Fix bug in transforming linked todo_list titles into plain text | Fix bug in transforming linked todo_list titles into plain text
| CoffeeScript | mit | rrrene/outline,rrrene/outline |
d8f703e552da06666a0448e2261cd4a143076069 | angular/core/models/stance_model.coffee | angular/core/models/stance_model.coffee | angular.module('loomioApp').factory 'StanceModel', (DraftableModel, AppConfig, MentionLinkService) ->
class StanceModel extends DraftableModel
@singular: 'stance'
@plural: 'stances'
@indices: ['pollId', 'authorId']
@serializableAttributes: AppConfig.permittedParams.stance
@draftParent: 'poll'
defaultValues: ->
reason: ''
stanceChoicesAttributes: []
visitorAttributes: {}
relationships: ->
@belongsTo 'poll'
@hasMany 'stanceChoices'
participant: ->
@recordStore.users.find(@userId) or @recordStore.visitors.find(@visitorId)
stanceChoice: ->
_.first @stanceChoices()
pollOption: ->
@stanceChoice().pollOption() if @stanceChoice()
pollOptionId: ->
(@pollOption() or {}).id
pollOptions: ->
@recordStore.pollOptions.find(@pollOptionIds())
stanceChoiceNames: ->
_.pluck(@pollOptions(), 'name')
pollOptionIds: ->
_.pluck @stanceChoices(), 'pollOptionId'
choose: (optionIds) ->
_.each @recordStore.stanceChoices.find(stanceId: @id), (stanceChoice) ->
stanceChoice.remove()
_.each _.flatten([optionIds]), (optionId) =>
@recordStore.stanceChoices.create(pollOptionId: parseInt(optionId), stanceId: @id)
@
# prepareForForm: ->
# @stanceChoicesAttributes = _.map(@pollOptionIds(), (id) -> { pollOptionId: id })
| angular.module('loomioApp').factory 'StanceModel', (DraftableModel, AppConfig, MentionLinkService) ->
class StanceModel extends DraftableModel
@singular: 'stance'
@plural: 'stances'
@indices: ['pollId', 'authorId']
@serializableAttributes: AppConfig.permittedParams.stance
@draftParent: 'poll'
afterConstruction: ->
@visitorAttributes =
name: @participant().name
email: @participant().email
defaultValues: ->
reason: ''
stanceChoicesAttributes: []
visitorAttributes: {}
relationships: ->
@belongsTo 'poll'
@hasMany 'stanceChoices'
participant: ->
@recordStore.users.find(@userId) or @recordStore.visitors.find(@visitorId)
stanceChoice: ->
_.first @stanceChoices()
pollOption: ->
@stanceChoice().pollOption() if @stanceChoice()
pollOptionId: ->
(@pollOption() or {}).id
pollOptions: ->
@recordStore.pollOptions.find(@pollOptionIds())
stanceChoiceNames: ->
_.pluck(@pollOptions(), 'name')
pollOptionIds: ->
_.pluck @stanceChoices(), 'pollOptionId'
choose: (optionIds) ->
_.each @recordStore.stanceChoices.find(stanceId: @id), (stanceChoice) ->
stanceChoice.remove()
_.each _.flatten([optionIds]), (optionId) =>
@recordStore.stanceChoices.create(pollOptionId: parseInt(optionId), stanceId: @id)
@
# prepareForForm: ->
# @stanceChoicesAttributes = _.map(@pollOptionIds(), (id) -> { pollOptionId: id })
| Set visitor attributes on stance construction | Set visitor attributes on stance construction
| CoffeeScript | agpl-3.0 | piratas-ar/loomio,piratas-ar/loomio,piratas-ar/loomio,loomio/loomio,loomio/loomio,piratas-ar/loomio,loomio/loomio,loomio/loomio |
12e4e82b915e009103c34d655a0ffaadc180dbae | src/core/types/utils.coffee | src/core/types/utils.coffee | # This file contains utilities to deal with prototype extensions.
#### def
# Defines a non-enumerable property on the specified constructor's `prototype`.
#
# def Object, merge: (o) ->
# # merge implementation
#
# {foo: 10}.merge bar: 20 # {foo: 10, bar: 20}
def = (ctor, o) ->
for name, value of o
unless ctor.prototype[name]?
Object.defineProperty? ctor.prototype,
name,
enumerable: false, value: value
module.exports = {def}
| # This file contains utilities to deal with prototype extensions.
#### def
# Defines a non-enumerable property on the specified constructor's `prototype`.
#
# def Object, merge: (o) ->
# # merge implementation
#
# {foo: 10}.merge bar: 20 # {foo: 10, bar: 20}
def = (ctor, o) ->
for name, value of o
Object.defineProperty? ctor.prototype,
name,
enumerable: false, value: value, writable: true
module.exports = {def}
| Remove existence check in def and set defined properties as writable. | Remove existence check in def and set defined properties as writable.
| CoffeeScript | mit | abe33/neat,abe33/neat,abe33/neat,abe33/neat |
4505664671ba51e058a602e39223d7ae6b7b3cde | scripts/views/layouts/workspace/menu.coffee | scripts/views/layouts/workspace/menu.coffee | define [
'jquery'
'underscore'
'backbone'
'marionette'
'cs!collections/media-types'
'cs!views/workspace/menu/auth'
'cs!views/workspace/menu/add'
'cs!views/workspace/menu/toolbar-search'
'hbs!templates/layouts/workspace/menu'
], ($, _, Backbone, Marionette, mediaTypes, AuthView, AddView, toolbarView, menuTemplate) ->
_toolbar = null
return new class MenuLayout extends Marionette.Layout
template: menuTemplate
regions:
add: '#workspace-menu-add'
auth: '#workspace-menu-auth'
toolbar: '#workspace-menu-toolbar'
onRender: () ->
@showView(_toolbar)
showView: (view) ->
_toolbar = view or toolbarView
@add.show(new AddView {collection:mediaTypes})
@auth.show(new AuthView())
@toolbar.show(_toolbar)
showToolbar: (view) ->
@showView(view or toolbarView)
| define [
'jquery'
'underscore'
'backbone'
'marionette'
'cs!collections/media-types'
'cs!session'
'cs!views/workspace/menu/auth'
'cs!views/workspace/menu/add'
'cs!views/workspace/menu/toolbar-search'
'hbs!templates/layouts/workspace/menu'
], ($, _, Backbone, Marionette, mediaTypes, session, AuthView, AddView, toolbarView, menuTemplate) ->
_toolbar = null
return new class MenuLayout extends Marionette.Layout
template: menuTemplate
regions:
add: '#workspace-menu-add'
auth: '#workspace-menu-auth'
toolbar: '#workspace-menu-toolbar'
onRender: () ->
@showView(_toolbar)
showView: (view) ->
_toolbar = view or toolbarView
@add.show(new AddView {collection:mediaTypes})
@auth.show(new AuthView {model: session})
@toolbar.show(_toolbar)
showToolbar: (view) ->
@showView(view or toolbarView)
| Include session in AuthView constructor | Include session in AuthView constructor
| CoffeeScript | agpl-3.0 | oerpub/github-bookeditor,oerpub/github-bookeditor,oerpub/bookish,oerpub/github-bookeditor,oerpub/bookish |
135e453299767efa733e02434f2e7a8a09eb74d6 | server/methods/updateRoom.coffee | server/methods/updateRoom.coffee | Meteor.methods
updateRoom: (rid, name, users, accessPermissions) ->
if not Meteor.userId()
throw new Meteor.Error('invalid-user', "[methods] updateRoom -> Invalid user")
room = ChatRoom.findOne rid
if room.t not in ['d'] and name? and name isnt room.name
Meteor.call 'saveRoomName', rid, name
Meteor.call 'relabelRoom', rid, accessPermissions
if users?
# remove the current users
users = _.without.apply _,room.usernames.concat users
for user in users
Meteor.call 'addUserToRoom', rid, user
return true
| Meteor.methods
updateRoom: (rid, name, usernames, accessPermissions) ->
console.log '[method] updateRoom -> arguments', arguments
if not Meteor.userId()
throw new Meteor.Error('invalid-user', "[methods] updateRoom -> Requires authenticated user")
# validate params exist
unless rid and name and usernames and accessPermissions
throw new Meteor.Error 'invalid-argument', 'Missing required values'
room = ChatRoom.findOne rid
# don't allow the room creator to be removed
unless room.u.username in usernames
throw new Meteor.Error 'invalid-argument', 'You cannot remove the room creator'
if room.t not in ['d'] and name? and name isnt room.name
Meteor.call 'saveRoomName', rid, name
# relabel room if permissions changed
if _.difference( room.accessPermissions, accessPermissions ).length > 0
Meteor.call 'relabelRoom', rid, accessPermissions
# add users to the room that weren't previously in the room
usersToAdd = _.difference( usernames, room.usernames)
for username in usersToAdd
Meteor.call 'addUserToRoom', {rid: rid, username: username}
# remove users from the room that were previously in the room
usersToRemove = _.difference( room.usernames, usernames)
for username in usersToRemove
Meteor.call 'removeUserFromRoom', {rid: rid, username: username}
return {rid:rid}
| Validate parameters, and: 1. check that room creator is not removed 2. relabel room if access permissions changed 3. add new members that we're previously in the room 4. remove existing members that should no longer be in the room | Validate parameters, and:
1. check that room creator is not removed
2. relabel room if access permissions changed
3. add new members that we're previously in the room
4. remove existing members that should no longer be in the room
| CoffeeScript | mit | sscpac/chat-locker,sscpac/chat-locker,sscpac/chat-locker |
0ce8f6bf811901d8e4156429b559e8be5c1bc38c | src/trix/views/image_attachment_view.coffee | src/trix/views/image_attachment_view.coffee | class Trix.ImageAttachmentView
constructor: (@attachment) ->
@attachment.delegate = this
@image = document.createElement("img")
render: ->
@loadPreview() if @attachment.isPending()
@updateImageAttributes()
@image
loadPreview: ->
reader = new FileReader
reader.onload = (event) =>
@image.setAttribute("src", event.target.result)
reader.readAsDataURL(@attachment.file)
attributeNames = "src width height class".split(" ")
updateImageAttributes: ->
attributes = {}
attributes[key] = value for key, value of @attachment.attributes
attributes.src = attributes.url
attributes.class = "pending-attachment" if @attachment.isPending()
for key in attributeNames
if value = attributes[key]
@image.setAttribute(key, value)
else
@image.removeAttribute(key)
# Attachment delegate
attachmentDidUpdate: (@attachment) ->
@updateImageAttributes()
| class Trix.ImageAttachmentView
constructor: (@attachment) ->
@attachment.delegate = this
@image = document.createElement("img")
render: ->
@loadFile() if @attachment.isPending()
@updateImageAttributes()
@image
loadFile: ->
reader = new FileReader
reader.onload = (event) =>
if @attachment.isPending()
@image.setAttribute("src", event.target.result)
@attachment.update(width: @image.offsetWidth, height: @image.offsetHeight)
reader.readAsDataURL(@attachment.file)
attributeNames = "url width height class".split(" ")
updateImageAttributes: ->
attributes = {}
for key in attributeNames
attributes[key] = @attachment.attributes[key]
if attributes.url
attributes.src = attributes.url
delete attributes.url
if @attachment.isPending()
attributes.class = "pending-attachment"
for key, value of attributes
if value?
@image.setAttribute(key, value)
else
@image.removeAttribute(key)
# Attachment delegate
attachmentDidUpdate: ->
@updateImageAttributes()
| Set image dimensions after loading the File | Set image dimensions after loading the File
| CoffeeScript | mit | GabiGrin/trix,basecamp/trix,basecamp/trix,ChenMichael/trix,GabiGrin/trix,urossmolnik/trix,GabiGrin/trix,ChenMichael/trix,basecamp/trix,urossmolnik/trix,urossmolnik/trix,basecamp/trix,ChenMichael/trix |
b36206ca3bc19b06fc460204601eba254ab395b1 | menus/bracket-matcher.cson | menus/bracket-matcher.cson | 'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'Bracket Matcher'
'submenu': [
{ 'label': 'Go To Matching Bracket', 'command': 'bracket-matcher:go-to-matching-bracket' }
{ 'label': 'Select Inside Brackets', 'command': 'bracket-matcher:select-inside-brackets' }
{ 'label': 'Remove Brackets From Selection', 'command': 'bracket-matcher:remove-brackets-from-selection' }
{ 'label': 'Close Current Tag', 'command': 'bracket-matcher:close-tag'}
{ 'label': 'Remove Matching Brackets', 'command': 'bracket-matcher:remove-matching-brackets'}
]
]
}
]
| 'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'Bracket Matcher'
'submenu': [
{ 'label': 'Go To Matching Bracket', 'command': 'bracket-matcher:go-to-matching-bracket' }
{ 'label': 'Select Inside Brackets', 'command': 'bracket-matcher:select-inside-brackets' }
{ 'label': 'Remove Brackets From Selection', 'command': 'bracket-matcher:remove-brackets-from-selection' }
{ 'label': 'Close Current Tag', 'command': 'bracket-matcher:close-tag' }
{ 'label': 'Remove Matching Brackets', 'command': 'bracket-matcher:remove-matching-brackets' }
]
]
},
{
'label': 'Selection'
'submenu': [
{ 'label': 'Select Inside Brackets', 'command': 'bracket-matcher:select-inside-brackets' }
]
}
]
| Add Select Inside Brackets to Selection menu | Add Select Inside Brackets to Selection menu
| CoffeeScript | mit | adamCoGithub/Bracket-Matcher-no-smart-quotes,adamCoGithub/Bracket-Matcher-no-autoclose,adamCoGithub/Bracket-Matcher-no-smart-quotes,lpommers/bracket-matcher,lpommers/bracket-matcher,jacekkopecky/bracket-matcher,jacekkopecky/bracket-matcher,atom/bracket-matcher,bwinton/bracket-matcher,adamCoGithub/Bracket-Matcher-no-autoclose,bwinton/bracket-matcher |
0aee6d89bfbb6b376d918e0028b5a84770eb6b25 | src/the-more-you-know.coffee | src/the-more-you-know.coffee | module.exports = (robot) ->
robot.hear /the more you know/, (msg) ->
msg.reply "http://www.youtube.com/watch?v=v3rhQc666Sg"
| module.exports = (robot) ->
robot.hear /the more you know/, (msg) ->
msg.send "http://www.youtube.com/watch?v=v3rhQc666Sg"
| Change to post in channel not reply. | Change to post in channel not reply.
| CoffeeScript | mit | lightcap/hubot-the-more-you-know |
9130af5295cbebaf143bae7e87c906f294d745fb | community/server/src/main/coffeescript/test/neo4j/webadmin/modules/databrowser/views/TestPropertyContainerView.coffee | community/server/src/main/coffeescript/test/neo4j/webadmin/modules/databrowser/views/TestPropertyContainerView.coffee |
define ['lib/amd/Backbone','neo4j/webadmin/modules/databrowser/views/PropertyContainerView'], (Backbone, PropertyContainerView) ->
# TODO: Refactor out the "shouldBeConvertedToString" into it's own class
describe "PropertyContainerView", ->
pcv = new PropertyContainerView(template:null)
it "recognizes ascii characters as strings", ->
expect(pcv.shouldBeConvertedToString "a").toBe(true)
expect(pcv.shouldBeConvertedToString "abcd123 ").toBe(true)
it "recognizes swedish characters as strings", ->
expect(pcv.shouldBeConvertedToString "åäö").toBe(true)
expect(pcv.shouldBeConvertedToString "åäö #$ asd ").toBe(true)
it "recognizes strings containing odd characters as strings", ->
expect(pcv.shouldBeConvertedToString ";åäö #$ asd ").toBe(true)
it "recognizes valid JSON values as not being strings", ->
expect(pcv.shouldBeConvertedToString "1").toBe(false)
expect(pcv.shouldBeConvertedToString "12").toBe(false)
expect(pcv.shouldBeConvertedToString "12.523").toBe(false)
expect(pcv.shouldBeConvertedToString "['1','2','3']").toBe(false)
expect(pcv.shouldBeConvertedToString "[1,2,3]").toBe(false)
expect(pcv.shouldBeConvertedToString '"a quoted string"').toBe(false)
|
define ['lib/amd/Backbone','neo4j/webadmin/modules/databrowser/views/PropertyContainerView'], (Backbone, PropertyContainerView) ->
# TODO: Refactor out the "shouldBeConvertedToString" into it's own class
describe "PropertyContainerView", ->
pcv = new PropertyContainerView(template:null)
it "recognizes ascii characters as strings", ->
expect(pcv.shouldBeConvertedToString "a").toBe(true)
expect(pcv.shouldBeConvertedToString "abcd123 ").toBe(true)
it "recognizes strings containing odd characters as strings", ->
expect(pcv.shouldBeConvertedToString ";åäö #$ asd ").toBe(true)
it "recognizes valid JSON values as not being strings", ->
expect(pcv.shouldBeConvertedToString "1").toBe(false)
expect(pcv.shouldBeConvertedToString "12").toBe(false)
expect(pcv.shouldBeConvertedToString "12.523").toBe(false)
expect(pcv.shouldBeConvertedToString "['1','2','3']").toBe(false)
expect(pcv.shouldBeConvertedToString "[1,2,3]").toBe(false)
expect(pcv.shouldBeConvertedToString '"a quoted string"').toBe(false)
| Remove a test that fails in TeamCity. | Remove a test that fails in TeamCity.
There is no obvious reason why this test should fail, but since
Webadmin has been replaced by the Browser, there doesn't seem to be any
point trying to work out what is going on.
| CoffeeScript | apache-2.0 | HuangLS/neo4j,HuangLS/neo4j,HuangLS/neo4j,HuangLS/neo4j,HuangLS/neo4j |
cbd9622719e477ac693abf58fd3e20b1398e4d6a | src/PaginationStream.coffee | src/PaginationStream.coffee | reqr = if global.GENTLY then GENTLY.hijack(require) else require
stream = reqr "stream"
class PaginationStream extends stream.Readable
constructor: (fetchPage) ->
super objectMode: true
@_fetchPage = fetchPage
@_pageno = 0
@_items = []
@_itemsRead = 0
_read: ->
if @_items.length > 0
@_itemsRead++
return process.nextTick => @push @_items.pop()
if @_nitems? && @_itemsRead >= @_nitems
return process.nextTick => @push null
@_fetchPage ++@_pageno, (err, result) =>
if err?
return @emit "error", err
@_nitems = result.count
@_items = (result.items[i] for i in [result.items.length-1 .. 0])
return @_read()
module.exports = PaginationStream
| reqr = if global.GENTLY then GENTLY.hijack(require) else require
TransloaditClient = reqr "./TransloaditClient"
stream = reqr "stream"
class PaginationStream extends stream.Readable
constructor: (@_fetchPage) ->
super objectMode: true
@_pageno = 0
@_items = []
@_itemsRead = 0
_read: ->
if @_items.length > 0
@_itemsRead++
return process.nextTick => @push @_items.pop()
if @_nitems? && @_itemsRead >= @_nitems
return process.nextTick => @push null
@_fetchPage ++@_pageno, (err, result) =>
if err?
return @emit "error", err
@_nitems = result.count
@_items = (result.items[i] for i in [result.items.length-1 .. 0])
return @_read()
module.exports = PaginationStream
| Revert "Some nice warnings away" | Revert "Some nice warnings away"
This reverts commit 1e04dc556af840e0e4571e287135e510245524d7.
| CoffeeScript | mit | transloadit/node-sdk,adrusi/node-sdk,transloadit/node-sdk |
4d2d1f46760181a403e2e5392848a8faabe71a02 | concerns/observes-viewport.coffee | concerns/observes-viewport.coffee | ###
Use intersection observer to lazy load. Not using vue-in-viewport-mixin since
needs are simpler and I want more control.
###
export default
props:
intersectionOptions:
type: Object
default: -> {}
data: -> inViewport: false
mounted: ->
return unless @shouldObserve and IntersectionObserver?
@observer = new IntersectionObserver @onInViewport,
@makeIntersectionOptions()
@observer.observe @$el
computed:
# Conditions where the viewport is watched
shouldObserve: -> @lazyload or @autopause
# Conditions where we observe only once
shouldObserveOnce: -> not @autopause
watch:
# Trigger load when in viewport
inViewport: (visible) -> @load() if visible
methods:
# Parse interesection options
makeIntersectionOptions: ->
options = @intersectionOptions
if options.root and typeof options.root == 'string'
options.root = document.querySelector options.root
return options
# Store when in viewport
onInViewport: (entries) ->
@inViewport = entries[0].isIntersecting
@observer?.disconnect() if @inViewport and @shouldObserveOnce
| ###
Use intersection observer to lazy load. Not using vue-in-viewport-mixin since
needs are simpler and I want more control.
###
export default
props:
intersectionOptions:
type: Object
default: -> {}
data: -> inViewport: false
# Start observing on init
mounted: -> @startObserving()
computed:
# Conditions where the viewport is watched
shouldObserve: -> @lazyload or @autopause
# Conditions where we observe only once
shouldObserveOnce: -> not @autopause
watch:
# Trigger load when in viewport
inViewport: (visible) -> @load() if visible
methods:
# Start observing if appropriate
startObserving: ->
return unless @shouldObserve and IntersectionObserver?
return if @observer # Don't make multiple observers
@observer = new IntersectionObserver @onInViewport,
@makeIntersectionOptions()
@observer.observe @$el
# Parse interesection options
makeIntersectionOptions: ->
options = @intersectionOptions
if options.root and typeof options.root == 'string'
options.root = document.querySelector options.root
return options
# Store when in viewport
onInViewport: (entries) ->
@inViewport = entries[0].isIntersecting
if @inViewport and @shouldObserveOnce
@observer?.disconnect()
delete @observer
| Move initializing of observing into a method | Move initializing of observing into a method
| CoffeeScript | mit | BKWLD/vue-visual |
959e98543eda4266de4c83d2edece5b110514e12 | test/user/model.spec.coffee | test/user/model.spec.coffee | {Testing, expect, sinon, _} = require 'openstax-react-components/test/helpers'
User = require 'user/model'
describe 'User', ->
it 'defaults to not logged in', ->
expect(User.isLoggedIn()).to.be.false
| {Testing, expect, sinon, _} = require 'openstax-react-components/test/helpers'
User = require 'user/model'
describe 'User', ->
it 'defaults to not logged in', ->
expect(User.isLoggedIn()).to.be.false
it 'resets courses when destroy is called, but still emits signals', ->
fakeCourse =
destroy: -> true
sinon.stub(fakeCourse, 'destroy')
User.courses = [fakeCourse]
logoutSpy = sinon.spy()
User.channel.on 'logout.received', logoutSpy
User.destroy()
expect(User.courses).to.be.empty
expect(fakeCourse.destroy).to.have.been.called
expect(logoutSpy).not.to.have.been.called
User._signalLogoutCompleted()
expect(logoutSpy).to.have.been.called
| Test logout signal is emitted after destroy | Test logout signal is emitted after destroy
| CoffeeScript | agpl-3.0 | openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js |
f42bd3f34bdc899e2528aad0a40dc426a147df99 | src/config-observer.coffee | src/config-observer.coffee | module.exports =
observeConfig: (keyPath, args...) ->
@configSubscriptions ?= {}
@configSubscriptions[keyPath] = config.observe(keyPath, args...)
unobserveConfig: ->
for keyPath, subscription of @configSubscriptions ? {}
subscription.cancel()
| module.exports =
observeConfig: (keyPath, args...) ->
@configSubscriptions ?= {}
@configSubscriptions[keyPath] = config.observe(keyPath, args...)
unobserveConfig: ->
if @configSubscriptions?
subscription.cancel() for keyPath, subscription of @configSubscriptions
@configSubscriptions = null
| Clear config subscriptions when unobserving | :non-potable_water: Clear config subscriptions when unobserving
| CoffeeScript | mit | originye/atom,SlimeQ/atom,acontreras89/atom,rmartin/atom,crazyquark/atom,acontreras89/atom,rsvip/aTom,dsandstrom/atom,githubteacher/atom,alfredxing/atom,erikhakansson/atom,NunoEdgarGub1/atom,n-riesco/atom,harshdattani/atom,Jonekee/atom,RobinTec/atom,florianb/atom,qskycolor/atom,DiogoXRP/atom,KENJU/atom,ilovezy/atom,kittens/atom,isghe/atom,me6iaton/atom,matthewclendening/atom,chengky/atom,nvoron23/atom,tony612/atom,niklabh/atom,YunchengLiao/atom,mertkahyaoglu/atom,h0dgep0dge/atom,dannyflax/atom,qskycolor/atom,Ingramz/atom,originye/atom,champagnez/atom,sillvan/atom,stuartquin/atom,g2p/atom,Klozz/atom,dannyflax/atom,svanharmelen/atom,kevinrenaers/atom,liuxiong332/atom,hagb4rd/atom,rmartin/atom,yomybaby/atom,hagb4rd/atom,synaptek/atom,vcarrera/atom,bryonwinger/atom,YunchengLiao/atom,GHackAnonymous/atom,toqz/atom,niklabh/atom,helber/atom,deoxilix/atom,kc8wxm/atom,gzzhanghao/atom,champagnez/atom,constanzaurzua/atom,ezeoleaf/atom,h0dgep0dge/atom,davideg/atom,john-kelly/atom,deoxilix/atom,liuderchi/atom,dsandstrom/atom,toqz/atom,mertkahyaoglu/atom,seedtigo/atom,Neron-X5/atom,SlimeQ/atom,mrodalgaard/atom,gzzhanghao/atom,G-Baby/atom,splodingsocks/atom,mdumrauf/atom,RobinTec/atom,pkdevbox/atom,ralphtheninja/atom,kandros/atom,kittens/atom,jacekkopecky/atom,lovesnow/atom,kdheepak89/atom,vcarrera/atom,johnrizzo1/atom,tony612/atom,deepfox/atom,qiujuer/atom,hpham04/atom,Hasimir/atom,sillvan/atom,crazyquark/atom,Shekharrajak/atom,ppamorim/atom,prembasumatary/atom,anuwat121/atom,mostafaeweda/atom,woss/atom,johnhaley81/atom,davideg/atom,johnhaley81/atom,Rodjana/atom,woss/atom,jjz/atom,Sangaroonaom/atom,FoldingText/atom,mrodalgaard/atom,me6iaton/atom,andrewleverette/atom,ppamorim/atom,florianb/atom,FIT-CSE2410-A-Bombs/atom,isghe/atom,ali/atom,qskycolor/atom,MjAbuz/atom,Austen-G/BlockBuilder,hpham04/atom,oggy/atom,jlord/atom,matthewclendening/atom,FoldingText/atom,devoncarew/atom,githubteacher/atom,me-benni/atom,hharchani/atom,yomybaby/atom,devoncarew/atom,devoncarew/atom,nrodriguez13/atom,pombredanne/atom,Jandersolutions/atom,ardeshirj/atom,bj7/atom,basarat/atom,ReddTea/atom,AlbertoBarrago/atom,matthewclendening/atom,vinodpanicker/atom,kdheepak89/atom,PKRoma/atom,Galactix/atom,pengshp/atom,nrodriguez13/atom,Jdesk/atom,liuxiong332/atom,decaffeinate-examples/atom,bryonwinger/atom,sillvan/atom,wiggzz/atom,tisu2tisu/atom,Neron-X5/atom,nvoron23/atom,daxlab/atom,sekcheong/atom,basarat/atom,svanharmelen/atom,john-kelly/atom,Dennis1978/atom,anuwat121/atom,stinsonga/atom,omarhuanca/atom,lpommers/atom,russlescai/atom,kjav/atom,Shekharrajak/atom,Jdesk/atom,tisu2tisu/atom,n-riesco/atom,Sangaroonaom/atom,vjeux/atom,Galactix/atom,tanin47/atom,hagb4rd/atom,oggy/atom,yalexx/atom,Mokolea/atom,ReddTea/atom,codex8/atom,kdheepak89/atom,abcP9110/atom,atom/atom,omarhuanca/atom,Arcanemagus/atom,hellendag/atom,alfredxing/atom,kaicataldo/atom,rxkit/atom,bradgearon/atom,darwin/atom,bcoe/atom,avdg/atom,brettle/atom,kjav/atom,synaptek/atom,ardeshirj/atom,rookie125/atom,RobinTec/atom,alexandergmann/atom,dkfiresky/atom,medovob/atom,kc8wxm/atom,hpham04/atom,seedtigo/atom,deepfox/atom,NunoEdgarGub1/atom,hharchani/atom,fedorov/atom,Locke23rus/atom,cyzn/atom,deoxilix/atom,vjeux/atom,woss/atom,mostafaeweda/atom,yomybaby/atom,Jandersolutions/atom,rjattrill/atom,Mokolea/atom,hharchani/atom,mostafaeweda/atom,chengky/atom,bcoe/atom,kandros/atom,darwin/atom,scippio/atom,ObviouslyGreen/atom,Ingramz/atom,woss/atom,gisenberg/atom,elkingtonmcb/atom,fscherwi/atom,ironbox360/atom,beni55/atom,isghe/atom,liuderchi/atom,BogusCurry/atom,abe33/atom,liuxiong332/atom,Shekharrajak/atom,avdg/atom,Abdillah/atom,russlescai/atom,CraZySacX/atom,qiujuer/atom,RuiDGoncalves/atom,burodepeper/atom,KENJU/atom,qskycolor/atom,ralphtheninja/atom,stinsonga/atom,liuxiong332/atom,boomwaiza/atom,Jdesk/atom,sekcheong/atom,devmario/atom,qiujuer/atom,jtrose2/atom,matthewclendening/atom,mertkahyaoglu/atom,FIT-CSE2410-A-Bombs/atom,vinodpanicker/atom,decaffeinate-examples/atom,folpindo/atom,kjav/atom,fang-yufeng/atom,bryonwinger/atom,me6iaton/atom,Abdillah/atom,h0dgep0dge/atom,kdheepak89/atom,constanzaurzua/atom,kaicataldo/atom,0x73/atom,ObviouslyGreen/atom,deepfox/atom,acontreras89/atom,BogusCurry/atom,rmartin/atom,lovesnow/atom,yangchenghu/atom,sxgao3001/atom,constanzaurzua/atom,vjeux/atom,scv119/atom,vjeux/atom,DiogoXRP/atom,KENJU/atom,targeter21/atom,rxkit/atom,kittens/atom,charleswhchan/atom,johnhaley81/atom,MjAbuz/atom,dsandstrom/atom,Andrey-Pavlov/atom,originye/atom,jlord/atom,burodepeper/atom,targeter21/atom,jjz/atom,Jandersoft/atom,sxgao3001/atom,RobinTec/atom,xream/atom,fedorov/atom,vinodpanicker/atom,Neron-X5/atom,g2p/atom,CraZySacX/atom,champagnez/atom,Rodjana/atom,001szymon/atom,acontreras89/atom,liuderchi/atom,niklabh/atom,medovob/atom,russlescai/atom,n-riesco/atom,phord/atom,BogusCurry/atom,beni55/atom,Jdesk/atom,Galactix/atom,ykeisuke/atom,Hasimir/atom,andrewleverette/atom,vjeux/atom,fredericksilva/atom,oggy/atom,einarmagnus/atom,toqz/atom,hellendag/atom,mnquintana/atom,rlugojr/atom,basarat/atom,mnquintana/atom,dkfiresky/atom,burodepeper/atom,fang-yufeng/atom,ironbox360/atom,ivoadf/atom,palita01/atom,nrodriguez13/atom,gzzhanghao/atom,FIT-CSE2410-A-Bombs/atom,davideg/atom,florianb/atom,kdheepak89/atom,jordanbtucker/atom,CraZySacX/atom,omarhuanca/atom,isghe/atom,mdumrauf/atom,bolinfest/atom,stinsonga/atom,folpindo/atom,jtrose2/atom,vcarrera/atom,bsmr-x-script/atom,acontreras89/atom,lpommers/atom,targeter21/atom,ReddTea/atom,jjz/atom,qskycolor/atom,gontadu/atom,liuxiong332/atom,harshdattani/atom,decaffeinate-examples/atom,jlord/atom,ali/atom,nucked/atom,transcranial/atom,h0dgep0dge/atom,Neron-X5/atom,NunoEdgarGub1/atom,rjattrill/atom,bencolon/atom,Ju2ender/atom,ezeoleaf/atom,KENJU/atom,brumm/atom,bsmr-x-script/atom,brettle/atom,abe33/atom,panuchart/atom,Ju2ender/atom,sotayamashita/atom,Locke23rus/atom,G-Baby/atom,woss/atom,davideg/atom,mostafaeweda/atom,vinodpanicker/atom,brumm/atom,g2p/atom,decaffeinate-examples/atom,helber/atom,rlugojr/atom,tjkr/atom,beni55/atom,fscherwi/atom,gabrielPeart/atom,alfredxing/atom,rsvip/aTom,scv119/atom,001szymon/atom,vhutheesing/atom,codex8/atom,Galactix/atom,GHackAnonymous/atom,bencolon/atom,jtrose2/atom,mostafaeweda/atom,yomybaby/atom,splodingsocks/atom,hpham04/atom,wiggzz/atom,lovesnow/atom,PKRoma/atom,charleswhchan/atom,toqz/atom,pombredanne/atom,Huaraz2/atom,rsvip/aTom,ralphtheninja/atom,dkfiresky/atom,kaicataldo/atom,scv119/atom,cyzn/atom,gisenberg/atom,dannyflax/atom,kc8wxm/atom,sebmck/atom,bryonwinger/atom,me6iaton/atom,tony612/atom,G-Baby/atom,kjav/atom,gisenberg/atom,boomwaiza/atom,FoldingText/atom,omarhuanca/atom,Jandersolutions/atom,abe33/atom,chfritz/atom,hagb4rd/atom,ashneo76/atom,chengky/atom,lpommers/atom,oggy/atom,dijs/atom,bencolon/atom,AdrianVovk/substance-ide,gisenberg/atom,john-kelly/atom,me-benni/atom,sotayamashita/atom,yamhon/atom,anuwat121/atom,kittens/atom,lisonma/atom,jlord/atom,Hasimir/atom,scippio/atom,codex8/atom,amine7536/atom,jtrose2/atom,batjko/atom,transcranial/atom,hpham04/atom,amine7536/atom,Jdesk/atom,0x73/atom,isghe/atom,Austen-G/BlockBuilder,YunchengLiao/atom,fredericksilva/atom,ppamorim/atom,Hasimir/atom,t9md/atom,Jonekee/atom,charleswhchan/atom,Jandersoft/atom,vinodpanicker/atom,yangchenghu/atom,ardeshirj/atom,jordanbtucker/atom,davideg/atom,xream/atom,einarmagnus/atom,einarmagnus/atom,abcP9110/atom,ReddTea/atom,NunoEdgarGub1/atom,abcP9110/atom,amine7536/atom,batjko/atom,sillvan/atom,devmario/atom,ironbox360/atom,devmario/atom,dkfiresky/atom,Austen-G/BlockBuilder,paulcbetts/atom,crazyquark/atom,pengshp/atom,xream/atom,execjosh/atom,Shekharrajak/atom,qiujuer/atom,cyzn/atom,john-kelly/atom,Andrey-Pavlov/atom,mrodalgaard/atom,hakatashi/atom,palita01/atom,ashneo76/atom,panuchart/atom,0x73/atom,sebmck/atom,brettle/atom,Klozz/atom,panuchart/atom,Mokolea/atom,svanharmelen/atom,Shekharrajak/atom,yangchenghu/atom,prembasumatary/atom,charleswhchan/atom,charleswhchan/atom,dsandstrom/atom,abcP9110/atom,mnquintana/atom,jeremyramin/atom,lisonma/atom,jeremyramin/atom,Abdillah/atom,atom/atom,stuartquin/atom,qiujuer/atom,seedtigo/atom,vcarrera/atom,bradgearon/atom,Neron-X5/atom,RuiDGoncalves/atom,NunoEdgarGub1/atom,gisenberg/atom,SlimeQ/atom,nucked/atom,Jandersolutions/atom,ivoadf/atom,Jandersoft/atom,avdg/atom,splodingsocks/atom,ilovezy/atom,vcarrera/atom,AlisaKiatkongkumthon/atom,alexandergmann/atom,Huaraz2/atom,MjAbuz/atom,Dennis1978/atom,efatsi/atom,mertkahyaoglu/atom,t9md/atom,elkingtonmcb/atom,Abdillah/atom,fedorov/atom,ykeisuke/atom,synaptek/atom,elkingtonmcb/atom,sekcheong/atom,chengky/atom,pkdevbox/atom,bolinfest/atom,rxkit/atom,tony612/atom,stuartquin/atom,AlexxNica/atom,johnrizzo1/atom,jacekkopecky/atom,batjko/atom,rlugojr/atom,n-riesco/atom,atom/atom,jjz/atom,einarmagnus/atom,Rychard/atom,MjAbuz/atom,Abdillah/atom,medovob/atom,alexandergmann/atom,splodingsocks/atom,john-kelly/atom,russlescai/atom,abcP9110/atom,Andrey-Pavlov/atom,ashneo76/atom,ali/atom,0x73/atom,dkfiresky/atom,tmunro/atom,wiggzz/atom,tjkr/atom,rmartin/atom,daxlab/atom,rookie125/atom,efatsi/atom,bolinfest/atom,daxlab/atom,Huaraz2/atom,Austen-G/BlockBuilder,execjosh/atom,lovesnow/atom,GHackAnonymous/atom,fredericksilva/atom,hakatashi/atom,deepfox/atom,basarat/atom,gontadu/atom,DiogoXRP/atom,fang-yufeng/atom,ali/atom,devmario/atom,gontadu/atom,rmartin/atom,bsmr-x-script/atom,tisu2tisu/atom,bcoe/atom,vhutheesing/atom,fredericksilva/atom,Ingramz/atom,crazyquark/atom,me-benni/atom,lisonma/atom,gabrielPeart/atom,pombredanne/atom,me6iaton/atom,devoncarew/atom,dannyflax/atom,githubteacher/atom,vhutheesing/atom,Rodjana/atom,crazyquark/atom,paulcbetts/atom,constanzaurzua/atom,mnquintana/atom,bcoe/atom,AdrianVovk/substance-ide,deepfox/atom,Locke23rus/atom,sxgao3001/atom,Arcanemagus/atom,transcranial/atom,synaptek/atom,bj7/atom,bradgearon/atom,Jandersoft/atom,boomwaiza/atom,sxgao3001/atom,dannyflax/atom,einarmagnus/atom,chengky/atom,kevinrenaers/atom,bj7/atom,devmario/atom,jeremyramin/atom,rookie125/atom,nvoron23/atom,hharchani/atom,YunchengLiao/atom,ReddTea/atom,kevinrenaers/atom,KENJU/atom,Arcanemagus/atom,AlbertoBarrago/atom,Ju2ender/atom,jtrose2/atom,Austen-G/BlockBuilder,t9md/atom,AlbertoBarrago/atom,lisonma/atom,lovesnow/atom,SlimeQ/atom,yalexx/atom,harshdattani/atom,sebmck/atom,Austen-G/BlockBuilder,hakatashi/atom,tmunro/atom,fang-yufeng/atom,toqz/atom,florianb/atom,ivoadf/atom,constanzaurzua/atom,ObviouslyGreen/atom,prembasumatary/atom,stinsonga/atom,GHackAnonymous/atom,batjko/atom,n-riesco/atom,helber/atom,codex8/atom,ali/atom,jlord/atom,darwin/atom,FoldingText/atom,brumm/atom,yamhon/atom,pengshp/atom,AdrianVovk/substance-ide,Rychard/atom,yalexx/atom,amine7536/atom,ilovezy/atom,omarhuanca/atom,yamhon/atom,folpindo/atom,gabrielPeart/atom,amine7536/atom,tony612/atom,MjAbuz/atom,prembasumatary/atom,hharchani/atom,florianb/atom,GHackAnonymous/atom,dannyflax/atom,jacekkopecky/atom,ezeoleaf/atom,phord/atom,chfritz/atom,dijs/atom,YunchengLiao/atom,tjkr/atom,tanin47/atom,rsvip/aTom,jjz/atom,rjattrill/atom,Ju2ender/atom,ezeoleaf/atom,sekcheong/atom,yomybaby/atom,dsandstrom/atom,paulcbetts/atom,scv119/atom,Galactix/atom,pombredanne/atom,nvoron23/atom,execjosh/atom,hagb4rd/atom,codex8/atom,Sangaroonaom/atom,sillvan/atom,paulcbetts/atom,fang-yufeng/atom,kc8wxm/atom,chfritz/atom,Andrey-Pavlov/atom,prembasumatary/atom,Andrey-Pavlov/atom,andrewleverette/atom,liuderchi/atom,FoldingText/atom,nvoron23/atom,yalexx/atom,sotayamashita/atom,Klozz/atom,erikhakansson/atom,jordanbtucker/atom,Ju2ender/atom,rsvip/aTom,sebmck/atom,phord/atom,oggy/atom,jacekkopecky/atom,johnrizzo1/atom,PKRoma/atom,scippio/atom,RuiDGoncalves/atom,sekcheong/atom,basarat/atom,rjattrill/atom,lisonma/atom,erikhakansson/atom,pombredanne/atom,jacekkopecky/atom,Jonekee/atom,Hasimir/atom,Rychard/atom,AlisaKiatkongkumthon/atom,hellendag/atom,kc8wxm/atom,yalexx/atom,SlimeQ/atom,palita01/atom,efatsi/atom,Dennis1978/atom,nucked/atom,bcoe/atom,russlescai/atom,hakatashi/atom,devoncarew/atom,ykeisuke/atom,001szymon/atom,targeter21/atom,ilovezy/atom,AlexxNica/atom,ppamorim/atom,basarat/atom,fscherwi/atom,targeter21/atom,ppamorim/atom,kittens/atom,mnquintana/atom,AlexxNica/atom,FoldingText/atom,ilovezy/atom,sebmck/atom,RobinTec/atom,AlisaKiatkongkumthon/atom,pkdevbox/atom,mdumrauf/atom,tanin47/atom,dijs/atom,batjko/atom,jacekkopecky/atom,fedorov/atom,kjav/atom,tmunro/atom,sxgao3001/atom,kandros/atom,fedorov/atom,matthewclendening/atom,synaptek/atom,Jandersolutions/atom,fredericksilva/atom,Jandersoft/atom,mertkahyaoglu/atom |
2561cef3cd63de769d6e2897dd1e4f97fef3aade | public/coffee/views/databaseItemView.coffee | public/coffee/views/databaseItemView.coffee | class window.DatabaseItemView extends Backbone.View
tagName: 'li'
className: 'databaseItem'
events:
'click .databaseItem span': 'gotoDatabase',
'click .databaseItem a': 'toggleCollections'
initialize: ->
@template = _.template $('#databaseItemTemplate').html()
render: ->
id = @model.get '_id'
$(@el).html @template({ id: id, name: @model.get('name'), url: "databases/#{id}" })
this
toggleCollections: (event) =>
console.log 'toggleCollections'
@collectionsView = new CollectionsView(this, @model) unless @collectionsView
icon = $('a.treeIcon', @el)
if @collectionsView.isVisible
icon.removeClass 'expanded'
@collectionsView.hide()
else
icon.addClass 'expanded'
@collectionsView.show()
gotoDatabase: (event) =>
console.log 'gotoDatabase'
| class window.DatabaseItemView extends Backbone.View
tagName: 'li'
className: 'databaseItem'
events:
'click .databaseItem span': 'gotoDatabase',
'click .databaseItem a': 'toggleCollections'
initialize: ->
@template = _.template $('#databaseItemTemplate').html()
render: ->
id = @model.get '_id'
$(@el).html @template({ id: id, name: @model.get('name'), url: "databases/#{id}" })
this
toggleCollections: (event) =>
console.log 'toggleCollections'
@collectionsView = new CollectionsView(this, @model) unless @collectionsView
icon = $('a.treeIcon', @el)
if @collectionsView.isVisible
icon.removeClass 'expanded'
@collectionsView.hide()
else
icon.addClass 'expanded'
@collectionsView.show()
gotoDatabase: (event) =>
console.log 'gotoDatabase'
| Remove function to open collections when clicking on the database label in the tree | Remove function to open collections when clicking on the database label in the tree
| CoffeeScript | mit | stevehook/mongo-manager,stevehook/mongo-manager,stevehook/mongo-manager |
3be91fe6463f4b64474ec9c02b49748be22bd767 | app/assets/javascripts/martian_components/components/utils/full_height_header.coffee | app/assets/javascripts/martian_components/components/utils/full_height_header.coffee | # USE
# If the element is not a component, add full-height-header attribute to the tag.
# With a component, add 'full_height_header: true' to the persisted options
class @MC.Utils.FullHeightHeader
@autoInit: ->
$('[full-height-header]').each (i, el) => new @($(el))
constructor: (@el) ->
@component = @el.data('component')
if @component
@inner = @component.inner
else
@inner = @el
@lastWidth = null
@offset = @inner.offset().top
@compute()
$(window).on 'resize', @compute
compute: =>
return false if @lastWidth == $(window).width()
@inner.css('height', $(window).height() - @offset)
@lastWidth = $(window).width()
@el.trigger 'compute.fullHeightHeader.MC'
| # USE
# If the element is not a component, add full-height-header attribute to the tag.
# With a component, add 'full_height_header: true' to the persisted options
class @MC.Utils.FullHeightHeader
@autoInit: ->
$('[full-height-header]').each (i, el) => new @($(el))
constructor: (@el) ->
@el.data('fullHeightHeader', @)
@component = @el.data('component')
if @component
@inner = @component.inner
else
@inner = @el
@lastWidth = null
@compute()
$(window).on 'resize', =>
@compute() unless @lastWidth == $(window).width()
@lastWidth = $(window).width()
compute: =>
@inner.css('height', $(window).height() - @inner.offset().top)
@el.trigger 'compute.fullHeightHeader.MC'
| Update Utils.FullHeightHeader. Put instance into @el so @el can access @compute() | Update Utils.FullHeightHeader. Put instance into @el so @el can access @compute()
| CoffeeScript | mit | polomarte/martian_components,polomarte/martian_components,polomarte/martian_components |
fcae688b43af527feba63986a9248c6f09d03c91 | app/assets/javascripts/components/GlobalHeader.js.cjsx | app/assets/javascripts/components/GlobalHeader.js.cjsx | $ ->
GlobalHeader = React.createClass
propTypes:
imagePath: React.PropTypes.string.isRequired
imageTitle: React.PropTypes.string.isRequired
render: ->
<h1 className="GlobalHeader-heading">
<img src={@props.imagePath} alt={@props.imageTitle} title={@props.imageTitle} />
</h1>
globalHeader = document.querySelector('.GlobalHeader')
imagePath = globalHeader.dataset.headerImagePath
imageTitle = globalHeader.dataset.headerImageTitle
React.render(<GlobalHeader imagePath={imagePath} imageTitle={imageTitle} />, globalHeader)
| $ ->
GlobalHeader = React.createClass
propTypes:
imagePath: React.PropTypes.string.isRequired
imageTitle: React.PropTypes.string.isRequired
render: ->
<h1 className="GlobalHeader-heading">
<a href="https://github.com/ruedap/nekostagram">
<img src={@props.imagePath} alt={@props.imageTitle} title={@props.imageTitle} />
</a>
</h1>
globalHeader = document.querySelector('.GlobalHeader')
imagePath = globalHeader.dataset.headerImagePath
imageTitle = globalHeader.dataset.headerImageTitle
React.render(<GlobalHeader imagePath={imagePath} imageTitle={imageTitle} />, globalHeader)
| Add link to global header | Add link to global header
| CoffeeScript | mit | ruedap/nekostagram,ruedap/nekostagram,ruedap/nekostagram,ruedap/nekostagram |
b4f0b765563f5aae24f33cba3f3cb9875a479d34 | app/assets/javascripts/neighborly/neighborly.js.coffee | app/assets/javascripts/neighborly/neighborly.js.coffee | #= require_self
#= require_tree .
window.Neighborly =
Common:
initPage: ->
that = this
unless window.Turbolinks is undefined
$(document).bind "page:fetch", ->
that.Loading.show()
$(document).bind "page:restore", ->
that.Loading.hide()
$(document).bind "page:change", ->
$(window).scrollTop(0)
try
FB.XFBML.parse()
try
twttr.widgets.load()
init: ->
$(document).foundation('reveal', {animation: 'fadeIn', animationSpeed: 100})
$(document).foundation()
finish: ->
Loading:
show: ->
$('#loading #back-overlay, #loading #front-overlay').fadeIn(2)
hide: ->
$('#loading #back-overlay, #loading #front-overlay').fadeOut(2)
| #= require_self
#= require_tree .
window.Neighborly =
Common:
initPage: ->
that = this
unless window.Turbolinks is undefined
$(document).bind "page:fetch", ->
that.Loading.show()
$(document).bind "page:restore", ->
that.Loading.hide()
$(document).bind "page:change", ->
$(window).scrollTop(0)
try
FB.XFBML.parse()
try
twttr.widgets.load()
init: ->
$(document).foundation('reveal', {animation: 'fadeIn', animationSpeed: 100})
$(document).foundation()
$('.search-button').click ->
if $('.discover-form-input').val() != ''
$('form.discover-form').submit()
else
$('.discover-form-input').toggleClass('show').focus()
return false
finish: ->
Loading:
show: ->
$('#loading #back-overlay, #loading #front-overlay').fadeIn(2)
hide: ->
$('#loading #back-overlay, #loading #front-overlay').fadeOut(2)
| Add javascript for search button | Add javascript for search button
| CoffeeScript | mit | MicroPasts/micropasts-crowdfunding,jinutm/silverprod,raksonibs/raimcrowd,MicroPasts/micropasts-crowdfunding,rockkhuya/taydantay,jinutm/silverme,jinutm/silverclass,jinutm/silverclass,jinutm/silvfinal,raksonibs/raimcrowd,raksonibs/raimcrowd,jinutm/silveralms.com,jinutm/silverclass,jinutm/silveralms.com,jinutm/silveralms.com,jinutm/silverpro,gustavoguichard/neighborly,jinutm/silvfinal,jinutm/silvfinal,jinutm/silverprod,MicroPasts/micropasts-crowdfunding,raksonibs/raimcrowd,jinutm/silverpro,jinutm/silverme,jinutm/silverprod,rockkhuya/taydantay,MicroPasts/micropasts-crowdfunding,jinutm/silverpro,gustavoguichard/neighborly,jinutm/silverme,rockkhuya/taydantay,gustavoguichard/neighborly |
de635410498f0fb3bd293a8636c20bf759b54c68 | lms/static/coffee/spec/requirejs_spec.coffee | lms/static/coffee/spec/requirejs_spec.coffee | describe "RequireJS", ->
beforeEach ->
@addMatchers
requirejsTobeUndefined: ->
typeof requirejs is "undefined"
requireTobeUndefined: ->
typeof require is "undefined"
defineTobeUndefined: ->
typeof define is "undefined"
it "check that the RequireJS object is present in the global namespace", ->
expect(RequireJS).toEqual jasmine.any(Object)
expect(window.RequireJS).toEqual jasmine.any(Object)
it "check that requirejs(), require(), and define() are not in the global namespace", ->
expect({}).requirejsTobeUndefined()
expect({}).requireTobeUndefined()
expect({}).defineTobeUndefined()
expect(window.requirejs).not.toBeDefined()
expect(window.require).not.toBeDefined()
expect(window.define).not.toBeDefined()
| describe "RequireJS", ->
beforeEach ->
@addMatchers
requirejsTobeUndefined: ->
typeof requirejs is "undefined"
requireTobeUndefined: ->
typeof require is "undefined"
defineTobeUndefined: ->
typeof define is "undefined"
it "check that the RequireJS object is present in the global namespace", ->
expect(RequireJS).toEqual jasmine.any(Object)
expect(window.RequireJS).toEqual jasmine.any(Object)
it "check that requirejs(), require(), and define() are not in the global namespace", ->
expect({}).requirejsTobeUndefined()
expect({}).requireTobeUndefined()
expect({}).defineTobeUndefined()
expect(window.requirejs).not.toBeDefined()
expect(window.require).not.toBeDefined()
expect(window.define).not.toBeDefined()
it "check that the RequireJS has requirejs(), require(), and define() functions as its properties", ->
expect(RequireJS.requirejs).toEqual jasmine.any(Function)
expect(RequireJS.require).toEqual jasmine.any(Function)
expect(RequireJS.define).toEqual jasmine.any(Function)
| Work on RequireJS Jasmine test. | Work on RequireJS Jasmine test.
| CoffeeScript | agpl-3.0 | motion2015/a3,sameetb-cuelogic/edx-platform-test,UXE/local-edx,CredoReference/edx-platform,JCBarahona/edX,zubair-arbi/edx-platform,tanmaykm/edx-platform,ahmedaljazzar/edx-platform,rationalAgent/edx-platform-custom,kursitet/edx-platform,kxliugang/edx-platform,Shrhawk/edx-platform,xinjiguaike/edx-platform,PepperPD/edx-pepper-platform,vikas1885/test1,stvstnfrd/edx-platform,zofuthan/edx-platform,doismellburning/edx-platform,beacloudgenius/edx-platform,zhenzhai/edx-platform,Semi-global/edx-platform,andyzsf/edx,kmoocdev2/edx-platform,IITBinterns13/edx-platform-dev,mbareta/edx-platform-ft,hamzehd/edx-platform,DefyVentures/edx-platform,Lektorium-LLC/edx-platform,yokose-ks/edx-platform,ubc/edx-platform,y12uc231/edx-platform,xinjiguaike/edx-platform,chand3040/cloud_that,angelapper/edx-platform,chauhanhardik/populo,jzoldak/edx-platform,synergeticsedx/deployment-wipro,hmcmooc/muddx-platform,ampax/edx-platform-backup,mtlchun/edx,antoviaque/edx-platform,beacloudgenius/edx-platform,AkA84/edx-platform,DNFcode/edx-platform,Unow/edx-platform,praveen-pal/edx-platform,jruiperezv/ANALYSE,WatanabeYasumasa/edx-platform,UOMx/edx-platform,teltek/edx-platform,solashirai/edx-platform,pomegranited/edx-platform,shashank971/edx-platform,hmcmooc/muddx-platform,Livit/Livit.Learn.EdX,shubhdev/openedx,adoosii/edx-platform,dsajkl/123,msegado/edx-platform,hkawasaki/kawasaki-aio8-1,ahmadiga/min_edx,peterm-itr/edx-platform,EduPepperPDTesting/pepper2013-testing,edry/edx-platform,ampax/edx-platform,cognitiveclass/edx-platform,devs1991/test_edx_docmode,inares/edx-platform,zerobatu/edx-platform,simbs/edx-platform,caesar2164/edx-platform,ampax/edx-platform-backup,zubair-arbi/edx-platform,Ayub-Khan/edx-platform,alu042/edx-platform,jonathan-beard/edx-platform,motion2015/a3,peterm-itr/edx-platform,chudaol/edx-platform,nikolas/edx-platform,appsembler/edx-platform,ESOedX/edx-platform,wwj718/edx-platform,prarthitm/edxplatform,torchingloom/edx-platform,fintech-circle/edx-platform,arifsetiawan/edx-platform,mbareta/edx-platform-ft,wwj718/edx-platform,Lektorium-LLC/edx-platform,jazkarta/edx-platform-for-isc,edry/edx-platform,utecuy/edx-platform,iivic/BoiseStateX,B-MOOC/edx-platform,jamesblunt/edx-platform,jelugbo/tundex,devs1991/test_edx_docmode,solashirai/edx-platform,adoosii/edx-platform,raccoongang/edx-platform,iivic/BoiseStateX,cognitiveclass/edx-platform,PepperPD/edx-pepper-platform,praveen-pal/edx-platform,jswope00/griffinx,dcosentino/edx-platform,MakeHer/edx-platform,Softmotions/edx-platform,eduNEXT/edx-platform,SravanthiSinha/edx-platform,edx/edx-platform,doganov/edx-platform,pku9104038/edx-platform,Edraak/edx-platform,itsjeyd/edx-platform,pabloborrego93/edx-platform,waheedahmed/edx-platform,nanolearningllc/edx-platform-cypress,polimediaupv/edx-platform,morenopc/edx-platform,jamesblunt/edx-platform,valtech-mooc/edx-platform,shabab12/edx-platform,jolyonb/edx-platform,msegado/edx-platform,Softmotions/edx-platform,shabab12/edx-platform,shubhdev/edx-platform,IndonesiaX/edx-platform,deepsrijit1105/edx-platform,IONISx/edx-platform,cecep-edu/edx-platform,alexthered/kienhoc-platform,defance/edx-platform,torchingloom/edx-platform,bitifirefly/edx-platform,antoviaque/edx-platform,Edraak/edraak-platform,etzhou/edx-platform,EduPepperPDTesting/pepper2013-testing,deepsrijit1105/edx-platform,eemirtekin/edx-platform,Ayub-Khan/edx-platform,xuxiao19910803/edx-platform,eestay/edx-platform,nanolearningllc/edx-platform-cypress-2,tanmaykm/edx-platform,eduNEXT/edx-platform,Shrhawk/edx-platform,nagyistoce/edx-platform,dkarakats/edx-platform,Edraak/edx-platform,nanolearningllc/edx-platform-cypress-2,abdoosh00/edraak,mjirayu/sit_academy,ak2703/edx-platform,xinjiguaike/edx-platform,beacloudgenius/edx-platform,motion2015/a3,shubhdev/edx-platform,y12uc231/edx-platform,ESOedX/edx-platform,kamalx/edx-platform,arbrandes/edx-platform,mbareta/edx-platform-ft,Edraak/circleci-edx-platform,mjirayu/sit_academy,angelapper/edx-platform,CredoReference/edx-platform,philanthropy-u/edx-platform,itsjeyd/edx-platform,shubhdev/edxOnBaadal,gsehub/edx-platform,pomegranited/edx-platform,openfun/edx-platform,eemirtekin/edx-platform,atsolakid/edx-platform,kmoocdev/edx-platform,motion2015/edx-platform,ESOedX/edx-platform,olexiim/edx-platform,hmcmooc/muddx-platform,valtech-mooc/edx-platform,defance/edx-platform,ampax/edx-platform-backup,ZLLab-Mooc/edx-platform,benpatterson/edx-platform,jzoldak/edx-platform,marcore/edx-platform,edx/edx-platform,appsembler/edx-platform,10clouds/edx-platform,4eek/edx-platform,JioEducation/edx-platform,LICEF/edx-platform,auferack08/edx-platform,antonve/s4-project-mooc,ubc/edx-platform,hamzehd/edx-platform,eduNEXT/edx-platform,fly19890211/edx-platform,Softmotions/edx-platform,torchingloom/edx-platform,antonve/s4-project-mooc,sudheerchintala/LearnEraPlatForm,arifsetiawan/edx-platform,fly19890211/edx-platform,DefyVentures/edx-platform,OmarIthawi/edx-platform,Softmotions/edx-platform,ferabra/edx-platform,zerobatu/edx-platform,ak2703/edx-platform,jolyonb/edx-platform,atsolakid/edx-platform,Livit/Livit.Learn.EdX,TsinghuaX/edx-platform,4eek/edx-platform,caesar2164/edx-platform,wwj718/edx-platform,chand3040/cloud_that,nanolearningllc/edx-platform-cypress,bdero/edx-platform,chudaol/edx-platform,shabab12/edx-platform,kamalx/edx-platform,ovnicraft/edx-platform,vismartltd/edx-platform,dsajkl/reqiop,jelugbo/tundex,EduPepperPD/pepper2013,dkarakats/edx-platform,4eek/edx-platform,jonathan-beard/edx-platform,alexthered/kienhoc-platform,MakeHer/edx-platform,eemirtekin/edx-platform,zhenzhai/edx-platform,EDUlib/edx-platform,y12uc231/edx-platform,Unow/edx-platform,hkawasaki/kawasaki-aio8-1,polimediaupv/edx-platform,syjeon/new_edx,nttks/edx-platform,xuxiao19910803/edx-platform,doganov/edx-platform,TsinghuaX/edx-platform,motion2015/edx-platform,kmoocdev2/edx-platform,jruiperezv/ANALYSE,eestay/edx-platform,iivic/BoiseStateX,fintech-circle/edx-platform,rationalAgent/edx-platform-custom,nttks/edx-platform,jswope00/griffinx,shashank971/edx-platform,nttks/jenkins-test,praveen-pal/edx-platform,alexthered/kienhoc-platform,ferabra/edx-platform,beni55/edx-platform,nttks/jenkins-test,Endika/edx-platform,ferabra/edx-platform,mbareta/edx-platform-ft,4eek/edx-platform,Edraak/circleci-edx-platform,pomegranited/edx-platform,don-github/edx-platform,jjmiranda/edx-platform,AkA84/edx-platform,bdero/edx-platform,AkA84/edx-platform,Livit/Livit.Learn.EdX,beni55/edx-platform,etzhou/edx-platform,fintech-circle/edx-platform,jamesblunt/edx-platform,Edraak/edraak-platform,SivilTaram/edx-platform,MSOpenTech/edx-platform,marcore/edx-platform,cpennington/edx-platform,raccoongang/edx-platform,cyanna/edx-platform,shubhdev/edxOnBaadal,jswope00/griffinx,zhenzhai/edx-platform,procangroup/edx-platform,Kalyzee/edx-platform,carsongee/edx-platform,OmarIthawi/edx-platform,hkawasaki/kawasaki-aio8-2,atsolakid/edx-platform,nanolearningllc/edx-platform-cypress,pelikanchik/edx-platform,beni55/edx-platform,kamalx/edx-platform,procangroup/edx-platform,msegado/edx-platform,pdehaye/theming-edx-platform,Stanford-Online/edx-platform,beacloudgenius/edx-platform,Edraak/edx-platform,fly19890211/edx-platform,sudheerchintala/LearnEraPlatForm,shurihell/testasia,pepeportela/edx-platform,xuxiao19910803/edx,Shrhawk/edx-platform,pelikanchik/edx-platform,jamesblunt/edx-platform,vasyarv/edx-platform,cecep-edu/edx-platform,zhenzhai/edx-platform,tiagochiavericosta/edx-platform,alexthered/kienhoc-platform,nagyistoce/edx-platform,yokose-ks/edx-platform,kxliugang/edx-platform,jazztpt/edx-platform,polimediaupv/edx-platform,TeachAtTUM/edx-platform,rhndg/openedx,rismalrv/edx-platform,mtlchun/edx,simbs/edx-platform,shashank971/edx-platform,wwj718/edx-platform,chauhanhardik/populo_2,kxliugang/edx-platform,UOMx/edx-platform,edx-solutions/edx-platform,tanmaykm/edx-platform,solashirai/edx-platform,fly19890211/edx-platform,nttks/jenkins-test,xingyepei/edx-platform,devs1991/test_edx_docmode,rue89-tech/edx-platform,openfun/edx-platform,martynovp/edx-platform,longmen21/edx-platform,ak2703/edx-platform,wwj718/ANALYSE,cognitiveclass/edx-platform,wwj718/ANALYSE,BehavioralInsightsTeam/edx-platform,nanolearningllc/edx-platform-cypress,kmoocdev2/edx-platform,bitifirefly/edx-platform,Lektorium-LLC/edx-platform,jazkarta/edx-platform,mcgachey/edx-platform,LICEF/edx-platform,waheedahmed/edx-platform,ampax/edx-platform-backup,appliedx/edx-platform,UXE/local-edx,carsongee/edx-platform,bitifirefly/edx-platform,shashank971/edx-platform,polimediaupv/edx-platform,ZLLab-Mooc/edx-platform,xingyepei/edx-platform,nttks/edx-platform,beacloudgenius/edx-platform,itsjeyd/edx-platform,kmoocdev2/edx-platform,dcosentino/edx-platform,shubhdev/openedx,a-parhom/edx-platform,mjirayu/sit_academy,DNFcode/edx-platform,Ayub-Khan/edx-platform,nanolearningllc/edx-platform-cypress-2,J861449197/edx-platform,arifsetiawan/edx-platform,syjeon/new_edx,MSOpenTech/edx-platform,teltek/edx-platform,edx-solutions/edx-platform,cselis86/edx-platform,pdehaye/theming-edx-platform,inares/edx-platform,mtlchun/edx,IITBinterns13/edx-platform-dev,LearnEra/LearnEraPlaftform,proversity-org/edx-platform,devs1991/test_edx_docmode,ak2703/edx-platform,chrisndodge/edx-platform,ESOedX/edx-platform,doganov/edx-platform,halvertoluke/edx-platform,louyihua/edx-platform,tiagochiavericosta/edx-platform,jswope00/GAI,EduPepperPDTesting/pepper2013-testing,louyihua/edx-platform,procangroup/edx-platform,lduarte1991/edx-platform,shurihell/testasia,peterm-itr/edx-platform,motion2015/edx-platform,benpatterson/edx-platform,abdoosh00/edraak,a-parhom/edx-platform,kalebhartje/schoolboost,DefyVentures/edx-platform,chauhanhardik/populo_2,shubhdev/edxOnBaadal,kursitet/edx-platform,mahendra-r/edx-platform,cpennington/edx-platform,nttks/edx-platform,jzoldak/edx-platform,EduPepperPDTesting/pepper2013-testing,morenopc/edx-platform,utecuy/edx-platform,TeachAtTUM/edx-platform,ovnicraft/edx-platform,LearnEra/LearnEraPlaftform,waheedahmed/edx-platform,mjirayu/sit_academy,dkarakats/edx-platform,mushtaqak/edx-platform,mjirayu/sit_academy,chrisndodge/edx-platform,auferack08/edx-platform,andyzsf/edx,edx-solutions/edx-platform,franosincic/edx-platform,devs1991/test_edx_docmode,ahmadio/edx-platform,jruiperezv/ANALYSE,Edraak/edx-platform,MakeHer/edx-platform,ampax/edx-platform,DefyVentures/edx-platform,vasyarv/edx-platform,rhndg/openedx,mitocw/edx-platform,nanolearningllc/edx-platform-cypress-2,analyseuc3m/ANALYSE-v1,longmen21/edx-platform,abdoosh00/edx-rtl-final,IONISx/edx-platform,mcgachey/edx-platform,bigdatauniversity/edx-platform,polimediaupv/edx-platform,B-MOOC/edx-platform,xuxiao19910803/edx-platform,zofuthan/edx-platform,inares/edx-platform,Edraak/edraak-platform,chudaol/edx-platform,adoosii/edx-platform,pabloborrego93/edx-platform,AkA84/edx-platform,eduNEXT/edunext-platform,nttks/jenkins-test,chrisndodge/edx-platform,ZLLab-Mooc/edx-platform,jazkarta/edx-platform-for-isc,EduPepperPD/pepper2013,shubhdev/openedx,miptliot/edx-platform,sudheerchintala/LearnEraPlatForm,amir-qayyum-khan/edx-platform,miptliot/edx-platform,ahmadiga/min_edx,shashank971/edx-platform,SravanthiSinha/edx-platform,deepsrijit1105/edx-platform,leansoft/edx-platform,jbzdak/edx-platform,10clouds/edx-platform,jbzdak/edx-platform,msegado/edx-platform,bigdatauniversity/edx-platform,ak2703/edx-platform,inares/edx-platform,EduPepperPDTesting/pepper2013-testing,jolyonb/edx-platform,yokose-ks/edx-platform,deepsrijit1105/edx-platform,playm2mboy/edx-platform,waheedahmed/edx-platform,vasyarv/edx-platform,iivic/BoiseStateX,valtech-mooc/edx-platform,CredoReference/edx-platform,knehez/edx-platform,playm2mboy/edx-platform,teltek/edx-platform,CourseTalk/edx-platform,chrisndodge/edx-platform,zofuthan/edx-platform,beni55/edx-platform,cecep-edu/edx-platform,kmoocdev/edx-platform,louyihua/edx-platform,nanolearningllc/edx-platform-cypress-2,ahmadio/edx-platform,synergeticsedx/deployment-wipro,ahmedaljazzar/edx-platform,halvertoluke/edx-platform,tanmaykm/edx-platform,IITBinterns13/edx-platform-dev,MSOpenTech/edx-platform,SravanthiSinha/edx-platform,syjeon/new_edx,pdehaye/theming-edx-platform,appliedx/edx-platform,antonve/s4-project-mooc,openfun/edx-platform,jazkarta/edx-platform,TeachAtTUM/edx-platform,apigee/edx-platform,cecep-edu/edx-platform,kmoocdev/edx-platform,naresh21/synergetics-edx-platform,procangroup/edx-platform,etzhou/edx-platform,nikolas/edx-platform,knehez/edx-platform,romain-li/edx-platform,OmarIthawi/edx-platform,DNFcode/edx-platform,zofuthan/edx-platform,dkarakats/edx-platform,doismellburning/edx-platform,motion2015/a3,EduPepperPDTesting/pepper2013-testing,jswope00/GAI,SravanthiSinha/edx-platform,waheedahmed/edx-platform,cselis86/edx-platform,jbassen/edx-platform,kalebhartje/schoolboost,wwj718/ANALYSE,bigdatauniversity/edx-platform,longmen21/edx-platform,rhndg/openedx,Edraak/edx-platform,stvstnfrd/edx-platform,bdero/edx-platform,arbrandes/edx-platform,openfun/edx-platform,EDUlib/edx-platform,AkA84/edx-platform,nanolearning/edx-platform,mushtaqak/edx-platform,amir-qayyum-khan/edx-platform,msegado/edx-platform,TsinghuaX/edx-platform,SivilTaram/edx-platform,morpheby/levelup-by,UOMx/edx-platform,torchingloom/edx-platform,caesar2164/edx-platform,adoosii/edx-platform,ovnicraft/edx-platform,wwj718/ANALYSE,pku9104038/edx-platform,mjg2203/edx-platform-seas,jazkarta/edx-platform,PepperPD/edx-pepper-platform,ubc/edx-platform,zubair-arbi/edx-platform,vismartltd/edx-platform,morenopc/edx-platform,ubc/edx-platform,morpheby/levelup-by,motion2015/a3,martynovp/edx-platform,longmen21/edx-platform,zerobatu/edx-platform,MakeHer/edx-platform,vismartltd/edx-platform,pku9104038/edx-platform,stvstnfrd/edx-platform,a-parhom/edx-platform,B-MOOC/edx-platform,jbzdak/edx-platform,solashirai/edx-platform,RPI-OPENEDX/edx-platform,tiagochiavericosta/edx-platform,ubc/edx-platform,lduarte1991/edx-platform,chauhanhardik/populo_2,dsajkl/123,ahmadio/edx-platform,amir-qayyum-khan/edx-platform,zubair-arbi/edx-platform,rhndg/openedx,zhenzhai/edx-platform,gymnasium/edx-platform,ampax/edx-platform,shurihell/testasia,rationalAgent/edx-platform-custom,LICEF/edx-platform,etzhou/edx-platform,Semi-global/edx-platform,vikas1885/test1,Softmotions/edx-platform,pelikanchik/edx-platform,hastexo/edx-platform,shubhdev/edx-platform,hastexo/edx-platform,pomegranited/edx-platform,amir-qayyum-khan/edx-platform,abdoosh00/edraak,benpatterson/edx-platform,utecuy/edx-platform,halvertoluke/edx-platform,simbs/edx-platform,stvstnfrd/edx-platform,philanthropy-u/edx-platform,mtlchun/edx,zadgroup/edx-platform,IONISx/edx-platform,halvertoluke/edx-platform,gymnasium/edx-platform,hkawasaki/kawasaki-aio8-1,benpatterson/edx-platform,torchingloom/edx-platform,jazkarta/edx-platform-for-isc,playm2mboy/edx-platform,rhndg/openedx,mahendra-r/edx-platform,chauhanhardik/populo_2,jazztpt/edx-platform,rismalrv/edx-platform,nikolas/edx-platform,olexiim/edx-platform,praveen-pal/edx-platform,IONISx/edx-platform,vasyarv/edx-platform,jamiefolsom/edx-platform,vikas1885/test1,hastexo/edx-platform,vikas1885/test1,proversity-org/edx-platform,Endika/edx-platform,TsinghuaX/edx-platform,cselis86/edx-platform,cyanna/edx-platform,mtlchun/edx,jjmiranda/edx-platform,dsajkl/123,edx-solutions/edx-platform,xinjiguaike/edx-platform,jonathan-beard/edx-platform,antonve/s4-project-mooc,nikolas/edx-platform,sudheerchintala/LearnEraPlatForm,edry/edx-platform,MSOpenTech/edx-platform,vismartltd/edx-platform,Unow/edx-platform,JioEducation/edx-platform,valtech-mooc/edx-platform,romain-li/edx-platform,fly19890211/edx-platform,IITBinterns13/edx-platform-dev,franosincic/edx-platform,Unow/edx-platform,naresh21/synergetics-edx-platform,SivilTaram/edx-platform,pabloborrego93/edx-platform,mahendra-r/edx-platform,Ayub-Khan/edx-platform,MSOpenTech/edx-platform,rue89-tech/edx-platform,martynovp/edx-platform,Stanford-Online/edx-platform,hkawasaki/kawasaki-aio8-0,iivic/BoiseStateX,BehavioralInsightsTeam/edx-platform,kmoocdev2/edx-platform,xuxiao19910803/edx,prarthitm/edxplatform,zadgroup/edx-platform,JCBarahona/edX,xingyepei/edx-platform,eduNEXT/edunext-platform,edx/edx-platform,teltek/edx-platform,shubhdev/edxOnBaadal,jruiperezv/ANALYSE,franosincic/edx-platform,eduNEXT/edunext-platform,kalebhartje/schoolboost,knehez/edx-platform,appliedx/edx-platform,BehavioralInsightsTeam/edx-platform,ahmedaljazzar/edx-platform,xuxiao19910803/edx-platform,utecuy/edx-platform,alu042/edx-platform,alu042/edx-platform,lduarte1991/edx-platform,dcosentino/edx-platform,PepperPD/edx-pepper-platform,defance/edx-platform,ferabra/edx-platform,chand3040/cloud_that,jamiefolsom/edx-platform,UOMx/edx-platform,chauhanhardik/populo,doismellburning/edx-platform,gymnasium/edx-platform,abdoosh00/edx-rtl-final,chauhanhardik/populo,rationalAgent/edx-platform-custom,CredoReference/edx-platform,lduarte1991/edx-platform,shurihell/testasia,raccoongang/edx-platform,Edraak/circleci-edx-platform,DNFcode/edx-platform,benpatterson/edx-platform,syjeon/new_edx,appliedx/edx-platform,jamiefolsom/edx-platform,jbzdak/edx-platform,pdehaye/theming-edx-platform,eemirtekin/edx-platform,bigdatauniversity/edx-platform,xingyepei/edx-platform,jjmiranda/edx-platform,beni55/edx-platform,IndonesiaX/edx-platform,pepeportela/edx-platform,y12uc231/edx-platform,hkawasaki/kawasaki-aio8-2,marcore/edx-platform,shubhdev/edx-platform,cognitiveclass/edx-platform,Endika/edx-platform,simbs/edx-platform,jonathan-beard/edx-platform,nagyistoce/edx-platform,defance/edx-platform,4eek/edx-platform,peterm-itr/edx-platform,synergeticsedx/deployment-wipro,dsajkl/reqiop,ovnicraft/edx-platform,PepperPD/edx-pepper-platform,IONISx/edx-platform,shubhdev/edx-platform,wwj718/ANALYSE,zadgroup/edx-platform,IndonesiaX/edx-platform,antoviaque/edx-platform,kmoocdev/edx-platform,leansoft/edx-platform,gsehub/edx-platform,Kalyzee/edx-platform,ferabra/edx-platform,eduNEXT/edx-platform,jamiefolsom/edx-platform,martynovp/edx-platform,leansoft/edx-platform,jswope00/griffinx,nanolearning/edx-platform,marcore/edx-platform,B-MOOC/edx-platform,nanolearning/edx-platform,cselis86/edx-platform,Edraak/edraak-platform,ahmadio/edx-platform,vismartltd/edx-platform,shurihell/testasia,ahmadiga/min_edx,prarthitm/edxplatform,SravanthiSinha/edx-platform,jamesblunt/edx-platform,ZLLab-Mooc/edx-platform,don-github/edx-platform,mushtaqak/edx-platform,mjg2203/edx-platform-seas,eestay/edx-platform,prarthitm/edxplatform,pabloborrego93/edx-platform,auferack08/edx-platform,10clouds/edx-platform,naresh21/synergetics-edx-platform,rationalAgent/edx-platform-custom,JCBarahona/edX,edx/edx-platform,mitocw/edx-platform,RPI-OPENEDX/edx-platform,cyanna/edx-platform,kmoocdev/edx-platform,etzhou/edx-platform,chauhanhardik/populo,edry/edx-platform,ovnicraft/edx-platform,zadgroup/edx-platform,xuxiao19910803/edx,carsongee/edx-platform,cselis86/edx-platform,eduNEXT/edunext-platform,jswope00/GAI,longmen21/edx-platform,dkarakats/edx-platform,leansoft/edx-platform,jamiefolsom/edx-platform,morenopc/edx-platform,abdoosh00/edx-rtl-final,Edraak/circleci-edx-platform,shubhdev/openedx,mitocw/edx-platform,bigdatauniversity/edx-platform,jazkarta/edx-platform,olexiim/edx-platform,solashirai/edx-platform,CourseTalk/edx-platform,sameetb-cuelogic/edx-platform-test,OmarIthawi/edx-platform,nanolearning/edx-platform,EduPepperPD/pepper2013,caesar2164/edx-platform,Lektorium-LLC/edx-platform,playm2mboy/edx-platform,EDUlib/edx-platform,unicri/edx-platform,hmcmooc/muddx-platform,knehez/edx-platform,jazztpt/edx-platform,playm2mboy/edx-platform,itsjeyd/edx-platform,EDUlib/edx-platform,shabab12/edx-platform,arifsetiawan/edx-platform,adoosii/edx-platform,apigee/edx-platform,xinjiguaike/edx-platform,kamalx/edx-platform,don-github/edx-platform,mcgachey/edx-platform,edry/edx-platform,jbassen/edx-platform,hamzehd/edx-platform,LICEF/edx-platform,motion2015/edx-platform,analyseuc3m/ANALYSE-v1,a-parhom/edx-platform,Shrhawk/edx-platform,rue89-tech/edx-platform,y12uc231/edx-platform,IndonesiaX/edx-platform,jelugbo/tundex,RPI-OPENEDX/edx-platform,arbrandes/edx-platform,unicri/edx-platform,DefyVentures/edx-platform,jelugbo/tundex,IndonesiaX/edx-platform,don-github/edx-platform,cyanna/edx-platform,devs1991/test_edx_docmode,dsajkl/reqiop,gymnasium/edx-platform,wwj718/edx-platform,chand3040/cloud_that,abdoosh00/edx-rtl-final,raccoongang/edx-platform,sameetb-cuelogic/edx-platform-test,Ayub-Khan/edx-platform,abdoosh00/edraak,WatanabeYasumasa/edx-platform,apigee/edx-platform,rue89-tech/edx-platform,nanolearning/edx-platform,UXE/local-edx,proversity-org/edx-platform,zadgroup/edx-platform,arbrandes/edx-platform,inares/edx-platform,atsolakid/edx-platform,romain-li/edx-platform,EduPepperPD/pepper2013,Semi-global/edx-platform,cecep-edu/edx-platform,nttks/jenkins-test,romain-li/edx-platform,hkawasaki/kawasaki-aio8-2,philanthropy-u/edx-platform,cpennington/edx-platform,jazztpt/edx-platform,pepeportela/edx-platform,kursitet/edx-platform,B-MOOC/edx-platform,kxliugang/edx-platform,sameetb-cuelogic/edx-platform-test,hkawasaki/kawasaki-aio8-2,jruiperezv/ANALYSE,tiagochiavericosta/edx-platform,eestay/edx-platform,MakeHer/edx-platform,kxliugang/edx-platform,doismellburning/edx-platform,shubhdev/openedx,hkawasaki/kawasaki-aio8-1,auferack08/edx-platform,chand3040/cloud_that,mjg2203/edx-platform-seas,Stanford-Online/edx-platform,sameetb-cuelogic/edx-platform-test,EduPepperPD/pepper2013,jazkarta/edx-platform-for-isc,JCBarahona/edX,pelikanchik/edx-platform,dcosentino/edx-platform,doganov/edx-platform,Livit/Livit.Learn.EdX,kursitet/edx-platform,kalebhartje/schoolboost,kalebhartje/schoolboost,zubair-arbi/edx-platform,unicri/edx-platform,philanthropy-u/edx-platform,miptliot/edx-platform,openfun/edx-platform,hastexo/edx-platform,J861449197/edx-platform,cyanna/edx-platform,J861449197/edx-platform,ahmadiga/min_edx,jswope00/GAI,ampax/edx-platform,mcgachey/edx-platform,appliedx/edx-platform,ahmedaljazzar/edx-platform,xingyepei/edx-platform,hkawasaki/kawasaki-aio8-0,alexthered/kienhoc-platform,BehavioralInsightsTeam/edx-platform,doganov/edx-platform,atsolakid/edx-platform,dsajkl/reqiop,mushtaqak/edx-platform,valtech-mooc/edx-platform,zerobatu/edx-platform,angelapper/edx-platform,appsembler/edx-platform,angelapper/edx-platform,WatanabeYasumasa/edx-platform,fintech-circle/edx-platform,hamzehd/edx-platform,hkawasaki/kawasaki-aio8-0,jswope00/griffinx,chauhanhardik/populo_2,halvertoluke/edx-platform,mahendra-r/edx-platform,jzoldak/edx-platform,carsongee/edx-platform,zerobatu/edx-platform,rismalrv/edx-platform,nttks/edx-platform,dsajkl/123,jonathan-beard/edx-platform,nanolearningllc/edx-platform-cypress,eestay/edx-platform,vikas1885/test1,Kalyzee/edx-platform,antonve/s4-project-mooc,appsembler/edx-platform,chauhanhardik/populo,WatanabeYasumasa/edx-platform,LearnEra/LearnEraPlaftform,chudaol/edx-platform,naresh21/synergetics-edx-platform,hamzehd/edx-platform,doismellburning/edx-platform,rismalrv/edx-platform,unicri/edx-platform,jazkarta/edx-platform-for-isc,eemirtekin/edx-platform,dcosentino/edx-platform,mjg2203/edx-platform-seas,JioEducation/edx-platform,arifsetiawan/edx-platform,ZLLab-Mooc/edx-platform,mahendra-r/edx-platform,olexiim/edx-platform,UXE/local-edx,don-github/edx-platform,andyzsf/edx,pepeportela/edx-platform,pomegranited/edx-platform,mitocw/edx-platform,Semi-global/edx-platform,zofuthan/edx-platform,yokose-ks/edx-platform,jbassen/edx-platform,xuxiao19910803/edx,dsajkl/123,Semi-global/edx-platform,gsehub/edx-platform,jbassen/edx-platform,kursitet/edx-platform,analyseuc3m/ANALYSE-v1,RPI-OPENEDX/edx-platform,unicri/edx-platform,devs1991/test_edx_docmode,Edraak/circleci-edx-platform,nikolas/edx-platform,pku9104038/edx-platform,xuxiao19910803/edx,devs1991/test_edx_docmode,jazkarta/edx-platform,SivilTaram/edx-platform,rue89-tech/edx-platform,jbzdak/edx-platform,jolyonb/edx-platform,rismalrv/edx-platform,synergeticsedx/deployment-wipro,ampax/edx-platform-backup,martynovp/edx-platform,10clouds/edx-platform,yokose-ks/edx-platform,JioEducation/edx-platform,xuxiao19910803/edx-platform,nagyistoce/edx-platform,gsehub/edx-platform,TeachAtTUM/edx-platform,nagyistoce/edx-platform,mcgachey/edx-platform,bdero/edx-platform,SivilTaram/edx-platform,cpennington/edx-platform,J861449197/edx-platform,alu042/edx-platform,morpheby/levelup-by,apigee/edx-platform,CourseTalk/edx-platform,ahmadiga/min_edx,LearnEra/LearnEraPlaftform,ahmadio/edx-platform,cognitiveclass/edx-platform,antoviaque/edx-platform,simbs/edx-platform,romain-li/edx-platform,franosincic/edx-platform,RPI-OPENEDX/edx-platform,vasyarv/edx-platform,analyseuc3m/ANALYSE-v1,chudaol/edx-platform,jbassen/edx-platform,mushtaqak/edx-platform,leansoft/edx-platform,shubhdev/edxOnBaadal,hkawasaki/kawasaki-aio8-0,CourseTalk/edx-platform,olexiim/edx-platform,miptliot/edx-platform,kamalx/edx-platform,bitifirefly/edx-platform,utecuy/edx-platform,LICEF/edx-platform,tiagochiavericosta/edx-platform,Shrhawk/edx-platform,jazztpt/edx-platform,louyihua/edx-platform,Kalyzee/edx-platform,JCBarahona/edX,morpheby/levelup-by,andyzsf/edx,Kalyzee/edx-platform,jjmiranda/edx-platform,morenopc/edx-platform,proversity-org/edx-platform,franosincic/edx-platform,bitifirefly/edx-platform,motion2015/edx-platform,J861449197/edx-platform,Stanford-Online/edx-platform,DNFcode/edx-platform,Endika/edx-platform,knehez/edx-platform,jelugbo/tundex |
1c5686e9bffb90ccba3e0077e68e1e8f03ac5882 | lib/builder.coffee | lib/builder.coffee | _ = require "underscore-plus"
module.exports =
class Builder
constructor: ->
@envPathKey = switch process.env.platform
when "win32" then "Path"
else "PATH"
run: -> null
constructArgs: -> null
parseLogFile: (texFilePath) -> null
constructChildProcessOptions: ->
env = _.clone(process.env)
path = @constructPath()
env[@envPathKey] = path if path?.length
options = env: env
constructPath: ->
texPath = atom.config.get("latex.texPath")
texPath?.replace("$PATH", process.env[@envPathKey])
resolveLogFilePath: (texFilePath) ->
outputDirectory = atom.config.get("latex.outputDirectory") ? ""
currentDirectory = path.dirname(texFilePath)
fileName = path.basename(texFilePath).replace(/\.tex$/, ".log")
logFilePath = path.join(currentDirectory, outputDirectory, fileName)
| _ = require "underscore-plus"
module.exports =
class Builder
constructor: ->
@envPathKey = switch process.env.platform
when "win32" then "Path"
else "PATH"
run: (args, callback) -> null
constructArgs: (filePath) -> null
parseLogFile: (texFilePath) -> null
constructChildProcessOptions: ->
env = _.clone(process.env)
path = @constructPath()
env[@envPathKey] = path if path?.length
options = env: env
constructPath: ->
texPath = atom.config.get("latex.texPath")
texPath?.replace("$PATH", process.env[@envPathKey])
resolveLogFilePath: (texFilePath) ->
outputDirectory = atom.config.get("latex.outputDirectory") ? ""
currentDirectory = path.dirname(texFilePath)
fileName = path.basename(texFilePath).replace(/\.tex$/, ".log")
logFilePath = path.join(currentDirectory, outputDirectory, fileName)
| Adjust `Builder` signature to match implementations | Adjust `Builder` signature to match implementations
| CoffeeScript | mit | WoodyWoodsta/atom-latex,thomasjo/atom-latex,thomasjo/atom-latex,WoodyWoodsta/atom-latex,thomasjo/atom-latex |
4efdf95846dcea4b95153fa41f4825a870dd0cfc | lib/builder.coffee | lib/builder.coffee | _ = require "underscore-plus"
module.exports =
class Builder
constructor: ->
@envPathKey = switch process.env.platform
when "win32" then "Path"
else "PATH"
run: (args, callback) -> null
constructArgs: (filePath) -> null
parseLogFile: (texFilePath) -> null
constructChildProcessOptions: ->
env = _.clone(process.env)
path = @constructPath()
env[@envPathKey] = path if path?.length
options = env: env
constructPath: ->
texPath = atom.config.get("latex.texPath")
texPath?.replace("$PATH", process.env[@envPathKey])
resolveLogFilePath: (texFilePath) ->
outputDirectory = atom.config.get("latex.outputDirectory") ? ""
currentDirectory = path.dirname(texFilePath)
fileName = path.basename(texFilePath).replace(/\.tex$/, ".log")
logFilePath = path.join(currentDirectory, outputDirectory, fileName)
| _ = require "underscore-plus"
path = require "path"
module.exports =
class Builder
constructor: ->
@envPathKey = switch process.env.platform
when "win32" then "Path"
else "PATH"
run: (args, callback) -> null
constructArgs: (filePath) -> null
parseLogFile: (texFilePath) -> null
constructChildProcessOptions: ->
env = _.clone(process.env)
childPath = @constructPath()
env[@envPathKey] = childPath if childPath?.length
options = env: env
constructPath: ->
texPath = atom.config.get("latex.texPath")
texPath?.replace("$PATH", process.env[@envPathKey])
resolveLogFilePath: (texFilePath) ->
outputDirectory = atom.config.get("latex.outputDirectory") ? ""
currentDirectory = path.dirname(texFilePath)
fileName = path.basename(texFilePath).replace(/\.tex$/, ".log")
logFilePath = path.join(currentDirectory, outputDirectory, fileName)
| Fix bug due to accidental use of `path` module | Fix bug due to accidental use of `path` module
The function `Builder::resolveLogFilePath` uses `path` module rather than
the `path` variable. Changes variable name to `childPath` and requires
the `path` module.
Closes #28
| CoffeeScript | mit | thomasjo/atom-latex,WoodyWoodsta/atom-latex,WoodyWoodsta/atom-latex,thomasjo/atom-latex,thomasjo/atom-latex |
19e9388dea8d7b3cdf8991df2f14d04ccd91f8b8 | src/api/settings.coffee | src/api/settings.coffee | settings =
# to customize, set environmental var BASE_URL when building or running webpack-dev-server
# Currently is set on an endpoint by endpoint basis until all are implemented by BE
# baseUrl: process?.env?.BASE_URL
endpoints:
'exercise.*.send.save':
url: 'api/steps/{id}'
method: 'PATCH'
completedEvent: 'exercise.{id}.receive.save'
'exercise.*.send.complete':
url: 'api/steps/{id}/completed'
method: 'PUT'
completedEvent: 'exercise.{id}.receive.complete'
'exercise.*.send.fetch':
url: 'api/steps/{id}'
method: 'GET'
completedEvent: 'exercise.{id}.receive.fetch'
'task.*.send.fetch':
url: 'api/tasks/{id}'
method: 'GET'
completedEvent: 'task.{id}.receive.fetch'
'task.*.send.fetchByModule':
url: 'api/cc/tasks/{collectionUUID}/{moduleUUID}'
method: 'GET'
baseUrl: process?.env?.BASE_URL
completedEvent: 'task.{collectionUUID}/{moduleUUID}.receive.fetchByModule'
'user.send.statusUpdate':
url: 'auth/status.json'
method: 'GET'
failureEvent: 'user.recieve.loadFailure'
baseUrl: process?.env?.BASE_URL
completedEvent: 'user.receive.statusUpdate'
module.exports = settings
| settings =
# to customize, set environmental var BASE_URL when building or running webpack-dev-server
# Currently is set on an endpoint by endpoint basis until all are implemented by BE
# baseUrl: process?.env?.BASE_URL
endpoints:
'exercise.*.send.save':
url: 'api/steps/{id}'
method: 'PATCH'
completedEvent: 'exercise.{id}.receive.save'
'exercise.*.send.complete':
url: 'api/steps/{id}/completed'
method: 'PUT'
completedEvent: 'exercise.{id}.receive.complete'
'exercise.*.send.fetch':
url: 'api/steps/{id}'
method: 'GET'
completedEvent: 'exercise.{id}.receive.fetch'
'task.*.send.fetch':
url: 'api/tasks/{id}'
method: 'GET'
completedEvent: 'task.{id}.receive.fetch'
'task.*.send.fetchByModule':
url: 'api/cc/tasks/{collectionUUID}/{moduleUUID}'
method: 'GET'
baseUrl: process?.env?.BASE_URL
completedEvent: 'task.{collectionUUID}/{moduleUUID}.receive.fetchByModule'
'user.send.statusUpdate':
url: 'auth/status.json'
method: 'GET'
useCredentials: true
failureEvent: 'user.recieve.loadFailure'
baseUrl: process?.env?.BASE_URL
completedEvent: 'user.receive.statusUpdate'
module.exports = settings
| Allow /auth/status to use credentials (cookies) | Allow /auth/status to use credentials (cookies)
| CoffeeScript | agpl-3.0 | openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js |
c6847671c9595d47241807146799753e7e37456a | test/user/menu.spec.coffee | test/user/menu.spec.coffee | {Testing, expect, sinon, _} = require 'openstax-react-components/test/helpers'
Menu = require 'user/menu'
User = require 'user/model'
Course = require 'course/model'
sandbox = null
describe 'User menu component', ->
beforeEach ->
@props =
course: new Course(ecosystem_book_uuid: 'test-collection-uuid')
sandbox = sinon.sandbox.create()
afterEach ->
sandbox.restore()
describe 'course options', ->
beforeEach ->
sandbox.stub(User, 'isLoggedIn').returns(true)
it 'renders for registration when course is not registered', ->
sinon.stub(@props.course, 'isRegistered').returns(false)
Testing.renderComponent( Menu, props: @props ).then ({dom}) ->
expect(dom.textContent).to.match(/Register for Course/)
it 'renders modification when registered', ->
sinon.stub(@props.course, 'isRegistered').returns(true)
Testing.renderComponent( Menu, props: @props ).then ({dom}) ->
expect(dom.textContent).to.match(/Change Course and ID/)
| {Testing, expect, sinon, _} = require 'openstax-react-components/test/helpers'
Menu = require 'user/menu'
User = require 'user/model'
Course = require 'course/model'
sandbox = null
describe 'User menu component', ->
beforeEach ->
@props =
course: new Course(ecosystem_book_uuid: 'test-collection-uuid')
sandbox = sinon.sandbox.create()
afterEach ->
sandbox.restore()
describe 'course options', ->
beforeEach ->
sandbox.stub(User, 'isLoggedIn').returns(true)
it 'renders for registration when course is not registered', ->
sinon.stub(@props.course, 'isRegistered').returns(false)
Testing.renderComponent( Menu, props: @props ).then ({dom}) ->
expect(dom.textContent).to.match(/Register for Course/)
it 'renders modification when registered', ->
sinon.stub(@props.course, 'isRegistered').returns(true)
Testing.renderComponent( Menu, props: @props ).then ({dom}) ->
expect(dom.textContent).to.match(/Change Course/)
expect(dom.textContent).to.match(/Change student ID/)
| Update menu test to match new options | Update menu test to match new options
| CoffeeScript | agpl-3.0 | openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js |
4507c87d55adbc01040a98d6f3aca9c0bf2d555d | app/js/jail_iframe/classes/notification.coffee | app/js/jail_iframe/classes/notification.coffee | FactlinkJailRoot.showShouldSelectTextNotification = ->
showNotification
message: 'To create an annotation, select a statement and click the Factlink button.'
type_classes: 'fl-message-icon-add'
FactlinkJailRoot.showLoadedNotification = ->
showNotification
message: 'Factlink is loaded!'
type_classes: 'fl-message-icon-time fl-message-success'
in_screen_time = 3000
removal_delay = 1000 # Should be larger than notification_transition_time
content = """
<div class="fl-message">
<div class="fl-message-icon"></div><span class="fl-message-content fl-js-message"></span>
</div>
""".trim()
showNotification = (options) ->
$el = $(content)
setMessage = -> $el.find('.fl-js-message').text(options.message)
render = ->
$el.addClass(options.type_classes)
setMessage()
FactlinkJailRoot.$factlinkCoreContainer.append($el)
positionElement()
$el.addClass 'factlink-control-visible'
setTimeout(remove, in_screen_time)
positionElement = ->
$el.css
top: '65px',
left: '50%',
marginLeft: "-#{$el.width()/2}px"
remove = ->
$el.removeClass 'factlink-control-visible'
setTimeout (-> $el.remove()), removal_delay
render()
return
| FactlinkJailRoot.showShouldSelectTextNotification = ->
showNotification
message: 'To create an annotation, select a statement and click the Factlink button.'
type_classes: 'fl-message-icon-add'
FactlinkJailRoot.showLoadedNotification = ->
showNotification
message: 'Factlink is loaded!'
type_classes: 'fl-message-icon-time fl-message-success'
in_screen_time = 3000
removal_delay = 350 # Should be larger than notification_transition_time
content = """
<div class="fl-message">
<div class="fl-message-icon"></div><span class="fl-message-content fl-js-message"></span>
</div>
""".trim()
showNotification = (options) ->
$el = $(content)
setMessage = -> $el.find('.fl-js-message').text(options.message)
render = ->
$el.addClass(options.type_classes)
setMessage()
FactlinkJailRoot.$factlinkCoreContainer.append($el)
positionElement()
$el.addClass 'factlink-control-visible'
setTimeout(remove, in_screen_time)
positionElement = ->
$el.css
top: '65px',
left: '50%',
marginLeft: "-#{$el.width()/2}px"
remove = ->
$el.removeClass 'factlink-control-visible'
setTimeout (-> $el.remove()), removal_delay
render()
return
| Trim remove_delay down closer to transition duration | Trim remove_delay down closer to transition duration
| CoffeeScript | mit | Factlink/js-library,Factlink/js-library,Factlink/js-library |
0eefed1e133759afc1f06986bccf2792a9fcefa1 | app/assets/javascripts/events.coffee | app/assets/javascripts/events.coffee | # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
$ ->
$('#starts-at-datetime-picker').datetimepicker
locale: 'de'
$('#ends-at-datetime-picker').datetimepicker
locale: 'de'
| # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
$ ->
$('#starts-at-datetime-picker').datetimepicker
locale: 'de'
$('#ends-at-datetime-picker').datetimepicker
locale: 'de'
$(document).on "fields_added.nested_form_fields", (event, param) ->
$(dateField).datetimepicker(
locale: 'de'
) for dateField in $(event.target).find('.date')
| Fix added shifts' datetimepickers not working | Fix added shifts' datetimepickers not working
| CoffeeScript | agpl-3.0 | where2help/where2help,where2help/where2help,where2help/where2help |
da975b5807d2df8f40266578991646447887adac | scripts/pr-status.coffee | scripts/pr-status.coffee | # Description:
# Get the CI status reported to GitHub for a repo and pull request
#
# Dependencies:
# "githubot": "0.4.x"
#
# Configuration:
# HUBOT_GITHUB_TOKEN
# HUBOT_GITHUB_USER
# HUBOT_GITHUB_API
#
# Commands:
# hubot repo show <repo> - shows activity of repository
#
# Notes:
# HUBOT_GITHUB_API allows you to set a custom URL path (for Github enterprise users)
#
# Author:
# mattr-
module.exports = (robot) ->
github = require("githubot")(robot)
robot.respond /status (\w+\/\w+)?\s*#?(\d+)/i, (msg) ->
repo = github.qualified_repo msg.match[1]
pr_number = msg.match[2]
base_url = process.env.HUBOT_GITHUB_API || 'https://api.github.com'
pull_url = "#{base_url}/repos/#{repo}/pulls/#{pr_number}"
github.get pull_url, (pull) ->
github.get pull.statuses_url, (status) ->
last_status = status[0]
msg.send "#{last_status.state} - #{last_status.target_url}"
| # Description:
# Get the CI status reported to GitHub for a repo and pull request
#
# Dependencies:
# "githubot": "0.4.x"
#
# Configuration:
# HUBOT_GITHUB_TOKEN
# HUBOT_GITHUB_USER
# HUBOT_GITHUB_API
#
# Commands:
# hubot status jekyll/jekyll 2004
# hubot status 2004
#
# Notes:
# HUBOT_GITHUB_API allows you to set a custom URL path (for Github enterprise users)
#
# Author:
# mattr-
module.exports = (robot) ->
github = require("githubot")(robot)
robot.respond /status (\w+\/\w+)?\s*#?(\d+)/i, (msg) ->
repo = github.qualified_repo msg.match[1]
pr_number = msg.match[2]
base_url = process.env.HUBOT_GITHUB_API || 'https://api.github.com'
pull_url = "#{base_url}/repos/#{repo}/pulls/#{pr_number}"
github.get pull_url, (pull) ->
github.get pull.statuses_url, (status) ->
last_status = status[0]
msg.send "#{last_status.state} - #{last_status.target_url}"
| Update Commands section of header | Update Commands section of header
| CoffeeScript | mit | jekyll/hyde,octopress/octobopper |
0e478ff501334eddc633cb7384eb087bf51fc2fc | app/assets/javascripts/admin/orders/controllers/bulk_invoice_controller.js.coffee | app/assets/javascripts/admin/orders/controllers/bulk_invoice_controller.js.coffee | angular.module("admin.orders").controller "bulkInvoiceCtrl", ($scope, $http, $timeout) ->
$scope.createBulkInvoice = ->
$scope.invoice_id = null
$scope.poll = 1
$scope.loading = true
$scope.message = null
$scope.error = null
$http.post('/admin/orders/invoices', {order_ids: $scope.selected_orders}).success (data) ->
$scope.invoice_id = data
$scope.pollBulkInvoice()
$scope.pollBulkInvoice = ->
$timeout($scope.nextPoll, 5000)
$scope.nextPoll = ->
$http.get('/admin/orders/invoices/'+$scope.invoice_id+'/poll').success (data) ->
$scope.loading = false
$scope.message = t('js.admin.orders.index.bulk_invoice_created')
.error (data) ->
$scope.poll++
if $scope.poll > 10
$scope.loading = false
$scope.error = t('js.admin.orders.index.bulk_invoice_failed')
return
$scope.pollBulkInvoice()
| angular.module("admin.orders").controller "bulkInvoiceCtrl", ($scope, $http, $timeout) ->
$scope.createBulkInvoice = ->
$scope.invoice_id = null
$scope.poll = 1
$scope.loading = true
$scope.message = null
$scope.error = null
$http.post('/admin/orders/invoices', {order_ids: $scope.selected_orders}).success (data) ->
$scope.invoice_id = data
$scope.pollBulkInvoice()
$scope.pollBulkInvoice = ->
$timeout($scope.nextPoll, 5000)
$scope.nextPoll = ->
$http.get('/admin/orders/invoices/'+$scope.invoice_id+'/poll').success (data) ->
$scope.loading = false
$scope.message = t('js.admin.orders.index.bulk_invoice_created')
.error (data) ->
$scope.poll++
if $scope.poll > 30
$scope.loading = false
$scope.error = t('js.admin.orders.index.bulk_invoice_failed')
return
$scope.pollBulkInvoice()
| Increase polling to 150 seconds maximum before showing error message. | Increase polling to 150 seconds maximum before showing error message.
| CoffeeScript | agpl-3.0 | Matt-Yorkley/openfoodnetwork,Matt-Yorkley/openfoodnetwork,lin-d-hop/openfoodnetwork,Matt-Yorkley/openfoodnetwork,openfoodfoundation/openfoodnetwork,openfoodfoundation/openfoodnetwork,openfoodfoundation/openfoodnetwork,lin-d-hop/openfoodnetwork,mkllnk/openfoodnetwork,mkllnk/openfoodnetwork,lin-d-hop/openfoodnetwork,mkllnk/openfoodnetwork,lin-d-hop/openfoodnetwork,Matt-Yorkley/openfoodnetwork,openfoodfoundation/openfoodnetwork,mkllnk/openfoodnetwork |
96f22912dc92880700cae88feea12c7af87edd48 | spec/helpers-spec.coffee | spec/helpers-spec.coffee | describe 'helpers', ->
helpers = require('../lib/helpers')
beforeEach ->
atom.notifications.clear()
describe '::error', ->
it 'adds an error notification', ->
helpers.error(new Error())
expect(atom.notifications.getNotifications().length).toBe(1)
describe '::shouldTriggerLinter', ->
normalLinter =
grammarScopes: ['*']
scope: 'file'
lintOnFly: false
lint: ->
lintOnFly =
grammarScopes: ['*']
scope: 'file'
lintOnFly: true
lint: ->
bufferModifying =
grammarScopes: ['*']
scope: 'file'
lintOnFly: false
lint: ->
it 'accepts a wildcard grammarScope', ->
expect(helpers.shouldTriggerLinter(normalLinter, false, ['*'])).toBe(true)
it 'runs lintOnFly ones on both save and lintOnFly', ->
expect(helpers.shouldTriggerLinter(lintOnFly, false, ['*'])).toBe(true)
expect(helpers.shouldTriggerLinter(lintOnFly, true, ['*'])).toBe(true)
it "doesn't run save ones on fly", ->
expect(helpers.shouldTriggerLinter(normalLinter, true, ['*'])).toBe(false)
| describe 'helpers', ->
helpers = require('../lib/helpers')
beforeEach ->
atom.notifications.clear()
describe '::showError', ->
it 'adds an error notification', ->
helpers.showError(new Error())
expect(atom.notifications.getNotifications().length).toBe(1)
describe '::shouldTriggerLinter', ->
normalLinter =
grammarScopes: ['*']
scope: 'file'
lintOnFly: false
lint: ->
lintOnFly =
grammarScopes: ['*']
scope: 'file'
lintOnFly: true
lint: ->
bufferModifying =
grammarScopes: ['*']
scope: 'file'
lintOnFly: false
lint: ->
it 'accepts a wildcard grammarScope', ->
expect(helpers.shouldTriggerLinter(normalLinter, false, ['*'])).toBe(true)
it 'runs lintOnFly ones on both save and lintOnFly', ->
expect(helpers.shouldTriggerLinter(lintOnFly, false, ['*'])).toBe(true)
expect(helpers.shouldTriggerLinter(lintOnFly, true, ['*'])).toBe(true)
it "doesn't run save ones on fly", ->
expect(helpers.shouldTriggerLinter(normalLinter, true, ['*'])).toBe(false)
| Upgrade helper specs to match latest module | :arrow_up: Upgrade helper specs to match latest module
| CoffeeScript | mit | steelbrain/linter,atom-community/linter,AtomLinter/Linter |
6fac942cbaad10e2531492b0020f0df0ae8a05b6 | js/binding/src/binding.coffee | js/binding/src/binding.coffee | do (_=_, $ = jQuery || null, JEFRi = JEFRi) ->
JEFRi.Template.rendered.entity :> ([entity, $render]) ->
definition = entity._definition()
for field, property of definition.properties
behaviors.editField entity, field, property, $render
behaviors =
editField: (entity, field, property, $parent) ->
$view = $parent.find(".#{entity._type()}._property.#{field}:first")
$edit = JEFRi.Template.render.property(entity._type(), field, entity[field](), 'edit')
$edit.find('input').blur blur = (e) ->
$edit.replaceWith $view
$view.click click
null
$view.click click = (e) ->
$view.replaceWith $edit
$input = $edit.find('input')
$input.blur blur
$input.focus()
null
null
null | do (_=_, $ = jQuery || null, JEFRi = JEFRi) ->
JEFRi.Template.rendered.entity :> ([entity, $render]) ->
definition = entity._definition()
for field, property of definition.properties
behaviors.editField entity, field, property, $render
behaviors =
editField: (entity, field, property, $parent) ->
$view = $parent.find(".#{entity._type()}._property.#{field}:first")
$edit = JEFRi.Template.render.property(entity._type(), field, entity[field](), 'edit')
$edit.find('input').blur blur = (e) ->
newValue = $edit.find('input').val();
$view = JEFRi.Template.render.property(entity._type(), field, newValue, 'view')
entity[field](newValue)
$edit.replaceWith $view
$view.click click
null
$view.click click = (e) ->
$view.replaceWith $edit
$input = $edit.find('input')
$input.blur blur
$input.focus()
null
null
null | Update view and entity on value change. | Update view and entity on value change.
| CoffeeScript | mit | DavidSouther/JEFRi,DavidSouther/JEFRi,DavidSouther/JEFRi,DavidSouther/JEFRi |
ea88407f92ff18acdcd7dadef4cb7b0ec322f9bc | app/assets/javascripts/repositories.js.coffee | app/assets/javascripts/repositories.js.coffee | #= require leaflet
$ ->
map = L.map('map').setView [51.505, -0.09], 2
L.tileLayer('http://{s}.tile.cloudmade.com/aff7873cf13349fe803e6a003f5c62bc/997/256/{z}/{x}/{y}.png', {
attribution: "Metadata Census",
maxZoom: 18
}).addTo(map)
| #= require leaflet
$ ->
map = L.map('map').setView [51.505, -0.09], 2
L.tileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.png', {
attribution: null,
subdomains: '1234',
type: 'osm',
}).addTo(map)
| Replace Leaflet tile with MapQuest tile | Replace Leaflet tile with MapQuest tile
I have replaced the Leaflet tile with the MaoQuest-OSM Tile.
Signed-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>
| CoffeeScript | mit | platzhirsch/metadata-census |
0f4d8bf51c8f49a1dd33cca848034e8cb3df630a | src/extensions/outline-view/src/keymap.coffee | src/extensions/outline-view/src/keymap.coffee | window.keymap.bindKeys '.editor'
'meta-j': 'outline-view:toggle'
'f3': 'outline-view:jump-to-declaration'
| window.keymap.bindKeys '.editor'
'meta-j': 'outline-view:toggle'
'meta-.': 'outline-view:jump-to-declaration'
| Use meta-. to jump to declaration | Use meta-. to jump to declaration
| CoffeeScript | mit | woss/atom,Jonekee/atom,bj7/atom,Locke23rus/atom,prembasumatary/atom,svanharmelen/atom,bradgearon/atom,niklabh/atom,matthewclendening/atom,transcranial/atom,chfritz/atom,palita01/atom,harshdattani/atom,tisu2tisu/atom,burodepeper/atom,tjkr/atom,Andrey-Pavlov/atom,SlimeQ/atom,scv119/atom,Shekharrajak/atom,0x73/atom,Jdesk/atom,fang-yufeng/atom,isghe/atom,ivoadf/atom,codex8/atom,codex8/atom,nrodriguez13/atom,panuchart/atom,FoldingText/atom,jjz/atom,qiujuer/atom,abcP9110/atom,G-Baby/atom,Arcanemagus/atom,rmartin/atom,liuxiong332/atom,deoxilix/atom,rsvip/aTom,deepfox/atom,RobinTec/atom,crazyquark/atom,matthewclendening/atom,fscherwi/atom,abcP9110/atom,yomybaby/atom,kc8wxm/atom,ilovezy/atom,pkdevbox/atom,stinsonga/atom,ralphtheninja/atom,harshdattani/atom,CraZySacX/atom,RuiDGoncalves/atom,liuderchi/atom,mnquintana/atom,charleswhchan/atom,Ju2ender/atom,Rychard/atom,me6iaton/atom,ReddTea/atom,kevinrenaers/atom,toqz/atom,deepfox/atom,KENJU/atom,sekcheong/atom,FoldingText/atom,basarat/atom,AlbertoBarrago/atom,seedtigo/atom,Shekharrajak/atom,kandros/atom,matthewclendening/atom,acontreras89/atom,rlugojr/atom,hpham04/atom,n-riesco/atom,pengshp/atom,bradgearon/atom,jtrose2/atom,stinsonga/atom,AlexxNica/atom,targeter21/atom,ralphtheninja/atom,wiggzz/atom,kandros/atom,darwin/atom,yangchenghu/atom,pkdevbox/atom,Austen-G/BlockBuilder,champagnez/atom,scippio/atom,russlescai/atom,originye/atom,tony612/atom,einarmagnus/atom,andrewleverette/atom,bsmr-x-script/atom,MjAbuz/atom,boomwaiza/atom,omarhuanca/atom,AlisaKiatkongkumthon/atom,rmartin/atom,Locke23rus/atom,gisenberg/atom,medovob/atom,sillvan/atom,Abdillah/atom,mnquintana/atom,qiujuer/atom,vhutheesing/atom,codex8/atom,palita01/atom,gontadu/atom,sekcheong/atom,liuderchi/atom,Jandersoft/atom,me6iaton/atom,paulcbetts/atom,fang-yufeng/atom,batjko/atom,me-benni/atom,lovesnow/atom,scv119/atom,amine7536/atom,mnquintana/atom,Rodjana/atom,devoncarew/atom,elkingtonmcb/atom,bencolon/atom,GHackAnonymous/atom,RobinTec/atom,harshdattani/atom,russlescai/atom,fscherwi/atom,jordanbtucker/atom,tony612/atom,beni55/atom,pombredanne/atom,ilovezy/atom,g2p/atom,targeter21/atom,hagb4rd/atom,chengky/atom,sotayamashita/atom,Mokolea/atom,seedtigo/atom,rmartin/atom,acontreras89/atom,nrodriguez13/atom,KENJU/atom,kandros/atom,mertkahyaoglu/atom,gisenberg/atom,rsvip/aTom,kdheepak89/atom,nvoron23/atom,targeter21/atom,lisonma/atom,toqz/atom,charleswhchan/atom,bcoe/atom,SlimeQ/atom,kaicataldo/atom,Jdesk/atom,mdumrauf/atom,vinodpanicker/atom,yomybaby/atom,hellendag/atom,jtrose2/atom,abcP9110/atom,dsandstrom/atom,lovesnow/atom,prembasumatary/atom,Rodjana/atom,kjav/atom,mrodalgaard/atom,avdg/atom,nvoron23/atom,Galactix/atom,kittens/atom,svanharmelen/atom,woss/atom,yamhon/atom,ali/atom,deepfox/atom,DiogoXRP/atom,tmunro/atom,Mokolea/atom,Dennis1978/atom,Shekharrajak/atom,hpham04/atom,001szymon/atom,hpham04/atom,burodepeper/atom,fredericksilva/atom,mostafaeweda/atom,bsmr-x-script/atom,BogusCurry/atom,crazyquark/atom,phord/atom,Shekharrajak/atom,mnquintana/atom,stinsonga/atom,vcarrera/atom,chengky/atom,sebmck/atom,ashneo76/atom,john-kelly/atom,Neron-X5/atom,qskycolor/atom,jacekkopecky/atom,nucked/atom,dkfiresky/atom,jjz/atom,bolinfest/atom,AdrianVovk/substance-ide,johnhaley81/atom,john-kelly/atom,alfredxing/atom,mostafaeweda/atom,devoncarew/atom,Abdillah/atom,synaptek/atom,oggy/atom,nucked/atom,Ju2ender/atom,devmario/atom,devoncarew/atom,jtrose2/atom,yalexx/atom,gisenberg/atom,yangchenghu/atom,g2p/atom,mostafaeweda/atom,rjattrill/atom,ReddTea/atom,CraZySacX/atom,atom/atom,liuderchi/atom,palita01/atom,oggy/atom,matthewclendening/atom,medovob/atom,xream/atom,vinodpanicker/atom,tjkr/atom,kaicataldo/atom,pombredanne/atom,pengshp/atom,liuxiong332/atom,dsandstrom/atom,YunchengLiao/atom,florianb/atom,githubteacher/atom,tmunro/atom,githubteacher/atom,burodepeper/atom,decaffeinate-examples/atom,atom/atom,batjko/atom,alfredxing/atom,pombredanne/atom,gabrielPeart/atom,brumm/atom,jlord/atom,jacekkopecky/atom,NunoEdgarGub1/atom,GHackAnonymous/atom,FoldingText/atom,ardeshirj/atom,fedorov/atom,Klozz/atom,splodingsocks/atom,mertkahyaoglu/atom,Galactix/atom,devmario/atom,Mokolea/atom,AlexxNica/atom,BogusCurry/atom,chfritz/atom,FIT-CSE2410-A-Bombs/atom,originye/atom,crazyquark/atom,panuchart/atom,hpham04/atom,mdumrauf/atom,acontreras89/atom,rxkit/atom,Austen-G/BlockBuilder,sillvan/atom,lisonma/atom,dannyflax/atom,bryonwinger/atom,ironbox360/atom,alexandergmann/atom,tisu2tisu/atom,darwin/atom,ilovezy/atom,Abdillah/atom,GHackAnonymous/atom,wiggzz/atom,ppamorim/atom,fredericksilva/atom,codex8/atom,synaptek/atom,sxgao3001/atom,fredericksilva/atom,batjko/atom,einarmagnus/atom,davideg/atom,NunoEdgarGub1/atom,kdheepak89/atom,sebmck/atom,fang-yufeng/atom,davideg/atom,vcarrera/atom,russlescai/atom,chengky/atom,nvoron23/atom,lisonma/atom,sxgao3001/atom,rookie125/atom,RobinTec/atom,ardeshirj/atom,Hasimir/atom,liuderchi/atom,Rychard/atom,constanzaurzua/atom,hharchani/atom,t9md/atom,kaicataldo/atom,bencolon/atom,Neron-X5/atom,cyzn/atom,codex8/atom,isghe/atom,Sangaroonaom/atom,andrewleverette/atom,me6iaton/atom,woss/atom,hharchani/atom,paulcbetts/atom,vinodpanicker/atom,mrodalgaard/atom,toqz/atom,hellendag/atom,ali/atom,mostafaeweda/atom,me6iaton/atom,jacekkopecky/atom,amine7536/atom,Arcanemagus/atom,me6iaton/atom,AdrianVovk/substance-ide,dsandstrom/atom,lpommers/atom,pkdevbox/atom,jjz/atom,wiggzz/atom,NunoEdgarGub1/atom,gzzhanghao/atom,yomybaby/atom,alexandergmann/atom,AlbertoBarrago/atom,florianb/atom,bryonwinger/atom,kevinrenaers/atom,AlexxNica/atom,gabrielPeart/atom,brumm/atom,vinodpanicker/atom,fscherwi/atom,Jonekee/atom,yalexx/atom,0x73/atom,prembasumatary/atom,qskycolor/atom,vhutheesing/atom,constanzaurzua/atom,Jandersolutions/atom,rjattrill/atom,dannyflax/atom,constanzaurzua/atom,helber/atom,darwin/atom,vjeux/atom,davideg/atom,daxlab/atom,ivoadf/atom,john-kelly/atom,BogusCurry/atom,charleswhchan/atom,PKRoma/atom,abcP9110/atom,isghe/atom,RuiDGoncalves/atom,Galactix/atom,tony612/atom,ali/atom,jacekkopecky/atom,h0dgep0dge/atom,qskycolor/atom,KENJU/atom,CraZySacX/atom,FoldingText/atom,t9md/atom,ashneo76/atom,Jandersoft/atom,decaffeinate-examples/atom,ReddTea/atom,boomwaiza/atom,constanzaurzua/atom,kdheepak89/atom,hagb4rd/atom,qskycolor/atom,devmario/atom,rxkit/atom,vhutheesing/atom,Jonekee/atom,ezeoleaf/atom,paulcbetts/atom,YunchengLiao/atom,splodingsocks/atom,matthewclendening/atom,prembasumatary/atom,ReddTea/atom,synaptek/atom,NunoEdgarGub1/atom,isghe/atom,fredericksilva/atom,KENJU/atom,h0dgep0dge/atom,russlescai/atom,panuchart/atom,sillvan/atom,mertkahyaoglu/atom,t9md/atom,Klozz/atom,Ingramz/atom,0x73/atom,fedorov/atom,Shekharrajak/atom,efatsi/atom,dsandstrom/atom,transcranial/atom,qiujuer/atom,pombredanne/atom,alexandergmann/atom,acontreras89/atom,lisonma/atom,Austen-G/BlockBuilder,amine7536/atom,dannyflax/atom,sotayamashita/atom,stuartquin/atom,bryonwinger/atom,Rodjana/atom,abe33/atom,h0dgep0dge/atom,Andrey-Pavlov/atom,kevinrenaers/atom,Abdillah/atom,woss/atom,dijs/atom,yangchenghu/atom,johnrizzo1/atom,lovesnow/atom,Jandersolutions/atom,dijs/atom,Hasimir/atom,rookie125/atom,ralphtheninja/atom,YunchengLiao/atom,xream/atom,hellendag/atom,bencolon/atom,sekcheong/atom,Jdesk/atom,ykeisuke/atom,hharchani/atom,gabrielPeart/atom,dkfiresky/atom,Klozz/atom,execjosh/atom,folpindo/atom,ezeoleaf/atom,jordanbtucker/atom,hharchani/atom,yamhon/atom,rsvip/aTom,jlord/atom,sebmck/atom,gontadu/atom,fedorov/atom,targeter21/atom,dkfiresky/atom,ObviouslyGreen/atom,kittens/atom,G-Baby/atom,isghe/atom,DiogoXRP/atom,jeremyramin/atom,rlugojr/atom,jordanbtucker/atom,kdheepak89/atom,kjav/atom,me-benni/atom,ppamorim/atom,niklabh/atom,basarat/atom,MjAbuz/atom,einarmagnus/atom,scv119/atom,john-kelly/atom,Jandersolutions/atom,devmario/atom,mdumrauf/atom,kjav/atom,sxgao3001/atom,sxgao3001/atom,githubteacher/atom,mrodalgaard/atom,fedorov/atom,jlord/atom,stuartquin/atom,anuwat121/atom,crazyquark/atom,atom/atom,ObviouslyGreen/atom,erikhakansson/atom,kjav/atom,avdg/atom,deepfox/atom,fedorov/atom,rjattrill/atom,tjkr/atom,devoncarew/atom,nrodriguez13/atom,Galactix/atom,hakatashi/atom,gzzhanghao/atom,abe33/atom,woss/atom,brettle/atom,brettle/atom,fang-yufeng/atom,n-riesco/atom,chengky/atom,splodingsocks/atom,n-riesco/atom,fredericksilva/atom,DiogoXRP/atom,Huaraz2/atom,Ju2ender/atom,boomwaiza/atom,synaptek/atom,davideg/atom,ReddTea/atom,gisenberg/atom,scippio/atom,Andrey-Pavlov/atom,lpommers/atom,yalexx/atom,omarhuanca/atom,Arcanemagus/atom,Neron-X5/atom,ykeisuke/atom,lovesnow/atom,folpindo/atom,sebmck/atom,johnhaley81/atom,nvoron23/atom,Galactix/atom,kc8wxm/atom,fang-yufeng/atom,rlugojr/atom,sillvan/atom,basarat/atom,kc8wxm/atom,mertkahyaoglu/atom,yomybaby/atom,constanzaurzua/atom,bradgearon/atom,tanin47/atom,bcoe/atom,abe33/atom,me-benni/atom,ilovezy/atom,Andrey-Pavlov/atom,ezeoleaf/atom,hagb4rd/atom,phord/atom,Neron-X5/atom,AlisaKiatkongkumthon/atom,rookie125/atom,Dennis1978/atom,florianb/atom,jeremyramin/atom,phord/atom,Neron-X5/atom,MjAbuz/atom,Jdesk/atom,einarmagnus/atom,yalexx/atom,devmario/atom,vjeux/atom,elkingtonmcb/atom,Jandersolutions/atom,champagnez/atom,liuxiong332/atom,yomybaby/atom,hagb4rd/atom,andrewleverette/atom,kc8wxm/atom,tanin47/atom,dkfiresky/atom,Ingramz/atom,johnhaley81/atom,bj7/atom,Jandersoft/atom,ilovezy/atom,johnrizzo1/atom,vjeux/atom,AlbertoBarrago/atom,omarhuanca/atom,ppamorim/atom,Austen-G/BlockBuilder,deoxilix/atom,oggy/atom,cyzn/atom,anuwat121/atom,basarat/atom,kc8wxm/atom,deepfox/atom,sebmck/atom,elkingtonmcb/atom,Huaraz2/atom,nucked/atom,001szymon/atom,jjz/atom,Rychard/atom,sekcheong/atom,abcP9110/atom,svanharmelen/atom,mertkahyaoglu/atom,jtrose2/atom,cyzn/atom,NunoEdgarGub1/atom,FoldingText/atom,basarat/atom,Abdillah/atom,FIT-CSE2410-A-Bombs/atom,001szymon/atom,dannyflax/atom,ykeisuke/atom,decaffeinate-examples/atom,chfritz/atom,dannyflax/atom,SlimeQ/atom,Dennis1978/atom,erikhakansson/atom,folpindo/atom,AlisaKiatkongkumthon/atom,kittens/atom,efatsi/atom,SlimeQ/atom,champagnez/atom,sxgao3001/atom,G-Baby/atom,ardeshirj/atom,helber/atom,KENJU/atom,liuxiong332/atom,helber/atom,FoldingText/atom,dsandstrom/atom,RobinTec/atom,davideg/atom,vcarrera/atom,medovob/atom,bcoe/atom,batjko/atom,Jandersoft/atom,jeremyramin/atom,xream/atom,kdheepak89/atom,batjko/atom,gzzhanghao/atom,hpham04/atom,yalexx/atom,anuwat121/atom,scippio/atom,niklabh/atom,0x73/atom,paulcbetts/atom,erikhakansson/atom,ali/atom,brettle/atom,mnquintana/atom,florianb/atom,daxlab/atom,prembasumatary/atom,FIT-CSE2410-A-Bombs/atom,basarat/atom,GHackAnonymous/atom,rxkit/atom,n-riesco/atom,ezeoleaf/atom,GHackAnonymous/atom,execjosh/atom,dannyflax/atom,Hasimir/atom,hagb4rd/atom,hakatashi/atom,RobinTec/atom,rmartin/atom,bcoe/atom,sotayamashita/atom,mostafaeweda/atom,PKRoma/atom,Ju2ender/atom,kjav/atom,omarhuanca/atom,Andrey-Pavlov/atom,jjz/atom,ironbox360/atom,Ingramz/atom,tanin47/atom,hakatashi/atom,jacekkopecky/atom,efatsi/atom,qskycolor/atom,jlord/atom,sillvan/atom,stinsonga/atom,n-riesco/atom,lpommers/atom,beni55/atom,decaffeinate-examples/atom,rsvip/aTom,kittens/atom,ivoadf/atom,jacekkopecky/atom,RuiDGoncalves/atom,Austen-G/BlockBuilder,charleswhchan/atom,rmartin/atom,toqz/atom,tisu2tisu/atom,gontadu/atom,MjAbuz/atom,Hasimir/atom,sekcheong/atom,stuartquin/atom,jlord/atom,scv119/atom,yamhon/atom,vjeux/atom,dkfiresky/atom,bj7/atom,crazyquark/atom,kittens/atom,brumm/atom,g2p/atom,john-kelly/atom,toqz/atom,Sangaroonaom/atom,ali/atom,MjAbuz/atom,lisonma/atom,vcarrera/atom,acontreras89/atom,YunchengLiao/atom,YunchengLiao/atom,transcranial/atom,amine7536/atom,tony612/atom,rsvip/aTom,AdrianVovk/substance-ide,Ju2ender/atom,bryonwinger/atom,h0dgep0dge/atom,pombredanne/atom,tmunro/atom,russlescai/atom,Hasimir/atom,qiujuer/atom,targeter21/atom,florianb/atom,ppamorim/atom,dijs/atom,einarmagnus/atom,vjeux/atom,seedtigo/atom,Jdesk/atom,charleswhchan/atom,beni55/atom,qiujuer/atom,hharchani/atom,oggy/atom,execjosh/atom,SlimeQ/atom,bolinfest/atom,Austen-G/BlockBuilder,vcarrera/atom,ashneo76/atom,daxlab/atom,bolinfest/atom,avdg/atom,nvoron23/atom,oggy/atom,devoncarew/atom,rjattrill/atom,tony612/atom,liuxiong332/atom,jtrose2/atom,Sangaroonaom/atom,synaptek/atom,amine7536/atom,hakatashi/atom,PKRoma/atom,alfredxing/atom,Jandersolutions/atom,bcoe/atom,Jandersoft/atom,johnrizzo1/atom,vinodpanicker/atom,chengky/atom,gisenberg/atom,Huaraz2/atom,ObviouslyGreen/atom,lovesnow/atom,originye/atom,bsmr-x-script/atom,ironbox360/atom,pengshp/atom,deoxilix/atom,splodingsocks/atom,omarhuanca/atom,ppamorim/atom,Locke23rus/atom |
2d9fac51ced00510d05483790149a0baed18a2e9 | plugins/bitbucket-issues/index.coffee | plugins/bitbucket-issues/index.coffee | NotificationPlugin = require "../../notification-plugin"
url = require "url"
qs = require 'qs'
class BitbucketIssue extends NotificationPlugin
@receiveEvent: (config, event, callback) ->
query_object =
"title": @title(event)
"content": @markdownBody(event)
"kind": config.kind
"priority": config.priority
# Send the request
@request
.post(url.resolve(config.url, "/api/1.0/repositories/#{config.repo}/issues"))
.timeout(4000)
.auth(config.username, config.password)
.set('Accept', 'application/json')
.send(qs.stringify(query_object))
.on "error", (err) ->
callback(err)
.end (res) ->
return callback({status: res.error.status, message: res.error.message, body: res.body}) if res.error
callback null,
id: res.body.local_id
url: url.resolve(config.url, "#{res.body.resource_uri}")
module.exports = BitbucketIssue | NotificationPlugin = require "../../notification-plugin"
url = require "url"
qs = require 'qs'
class BitbucketIssue extends NotificationPlugin
BASE_URL = "https://bitbucket.org"
@receiveEvent: (config, event, callback) ->
query_object =
"title": @title(event)
"content": @markdownBody(event)
"kind": config.kind
"priority": config.priority
# Send the request
@request
.post(url.resolve(BASE_URL, "/api/1.0/repositories/#{config.repo}/issues"))
.timeout(4000)
.auth(config.username, config.password)
.set('Accept', 'application/json')
.send(qs.stringify(query_object))
.on "error", (err) ->
callback(err)
.end (res) ->
return callback({status: res.error.status, message: res.error.message, body: res.body}) if res.error
callback null,
id: res.body.local_id
url: url.resolve(BASE_URL, "#{res.body.resource_uri}")
module.exports = BitbucketIssue | Fix Bitbucket to use url | Fix Bitbucket to use url | CoffeeScript | mit | kstream001/bugsnag-notification-plugins,6wunderkinder/bugsnag-notification-plugins,korealert/bugsnag-notification-plugins,sharesight/bugsnag-notification-plugins,indirect/bugsnag-notification-plugins,korealert/bugsnag-notification-plugins,6wunderkinder/bugsnag-notification-plugins,jacobmarshall/bugsnag-notification-plugins,cagedata/bugsnag-notification-plugins |
b36c3209ff60f93387e9ed91e7b0ad1d211b7d1e | src/set/set_proxy.coffee | src/set/set_proxy.coffee | #= require ../object
#= require ./set
class Batman.SetProxy extends Batman.Object
constructor: (@base) ->
super()
@length = @base.length
@base.on 'itemsWereAdded', (items...) =>
@set 'length', @base.length
@fire('itemsWereAdded', items...)
@base.on 'itemsWereRemoved', (items...) =>
@set 'length', @base.length
@fire('itemsWereRemoved', items...)
Batman.extend @prototype, Batman.Enumerable
filter: (f) ->
r = new Batman.Set()
@reduce(((r, e) -> r.add(e) if f(e); r), r)
replace: ->
length = @property('length')
length.isolate()
result = @base.replace.apply(@, arguments)
length.expose()
result
for k in ['add', 'remove', 'find', 'clear', 'has', 'merge', 'toArray', 'isEmpty', 'indexedBy', 'indexedByUnique', 'sortedBy']
do (k) =>
@::[k] = -> @base[k](arguments...)
Batman.Set._applySetAccessors(@)
@accessor 'length',
get: ->
@registerAsMutableSource()
@length
set: (_, v) -> @length = v
| #= require ../object
#= require ./set
class Batman.SetProxy extends Batman.Object
constructor: (@base) ->
super()
@length = @base.length
@base.on 'itemsWereAdded', (items...) =>
@set 'length', @base.length
@fire('itemsWereAdded', items...)
@base.on 'itemsWereRemoved', (items...) =>
@set 'length', @base.length
@fire('itemsWereRemoved', items...)
Batman.extend @prototype, Batman.Enumerable
filter: (f) ->
r = new Batman.Set()
@reduce(((r, e) -> r.add(e) if f(e); r), r)
replace: ->
length = @property('length')
length.isolate()
result = @base.replace.apply(@, arguments)
length.expose()
result
Batman.Set._applySetAccessors(@)
for k in ['add', 'remove', 'find', 'clear', 'has', 'merge', 'toArray', 'isEmpty', 'indexedBy', 'indexedByUnique', 'sortedBy']
do (k) =>
@::[k] = -> @base[k](arguments...)
@accessor 'length',
get: ->
@registerAsMutableSource()
@length
set: (_, v) -> @length = v
| Apply setAccessors to SetSort before we override them. | Apply setAccessors to SetSort before we override them.
| CoffeeScript | mit | getshuvo/batman,getshuvo/batman |
97ed1072c8041693ae2a262800791ea1268e6b84 | test/runtime_test.coffee | test/runtime_test.coffee | assert = require("assert")
SpyReader = require "./helpers/spy_reader"
ts = require("..")
{ repeat, seq } = ts.rules
grammar = ts.grammar
name: 'trivial_grammar'
start: 'paragraph'
rules:
paragraph: -> repeat(@sentence)
sentence: -> seq repeat(@word), "."
word: -> /\w+/
cCode = ts.compile(grammar)
libPath = ts.buildParser(grammar.name, cCode)
parser = ts.loadParserLib(libPath, grammar.name)
describe "documents", ->
doc = null
beforeEach ->
doc = new ts.Document()
doc.setParser(parser)
it "reads the entire input", ->
reader = new SpyReader("see spot run. spot runs fast.", 3)
doc.setInput(reader)
assert.deepEqual(reader.chunksRead, [
"see", " sp", "ot ", "run",
". s", "pot", " ru", "ns ", "fas", "t.", "", ""
])
it "parses the input", ->
reader = new SpyReader("see spot run. spot runs fast.", 3)
doc.setInput(reader)
assert.equal(doc.toString(), "Document: (paragraph (sentence (word) (word) (word)) (sentence (word) (word) (word)))")
| assert = require("assert")
SpyReader = require "./helpers/spy_reader"
ts = require("..")
{ repeat, seq } = ts.rules
grammar = ts.grammar
name: 'trivial_grammar'
rules:
paragraph: -> repeat(@sentence)
sentence: -> seq repeat(@word), "."
word: -> /\w+/
cCode = ts.compile(grammar)
libPath = ts.buildParser(grammar.name, cCode)
parser = ts.loadParserLib(libPath, grammar.name)
describe "documents", ->
doc = null
beforeEach ->
doc = new ts.Document()
doc.setParser(parser)
it "reads the entire input", ->
reader = new SpyReader("see spot run. spot runs fast.", 3)
doc.setInput(reader)
assert.deepEqual(reader.chunksRead, [
"see", " sp", "ot ", "run",
". s", "pot", " ru", "ns ", "fas", "t.", "", ""
])
it "parses the input", ->
reader = new SpyReader("see spot run. spot runs fast.", 3)
doc.setInput(reader)
assert.equal(doc.toString(), "Document: (paragraph (sentence (word) (word) (word)) (sentence (word) (word) (word)))")
| Remove unused grammar property in runtime test | Remove unused grammar property in runtime test | CoffeeScript | mit | tree-sitter/node-tree-sitter,maxbrunsfeld/node-tree-sitter,maxbrunsfeld/node-tree-sitter,tree-sitter/node-tree-sitter,maxbrunsfeld/node-tree-sitter,tree-sitter/node-tree-sitter |
88b8de107f425a4fb4ca3fdba1711d52cdcbf57e | app/assets/javascripts/components/article_form.js.coffee | app/assets/javascripts/components/article_form.js.coffee | @ArticleForm = React.createClass
getInitialState: ->
articleUrl: ''
handleValueChange: (e) ->
valueName = e.target.name
@setState
"#{ valueName }": e.target.value
"status": "process"
valid: ->
@state.articleUrl
handleSubmit: (e) ->
e.preventDefault()
$.post '', { article: @state }, (data) =>
@props.handleNewArticle data
@setState @getInitialState()
, 'JSON'
render: ->
React.DOM.form
className: 'form-input'
onSubmit: @handleSubmit
React.DOM.div
className: 'input-group'
React.DOM.input
type: 'text'
className: 'form-control'
placeholder: 'Enter an articles URL to get some mood music!'
name: 'articleUrl'
value: @state.articleUrl
onChange: @handleValueChange
React.DOM.span
className: 'input-group-button'
React.DOM.button
className: 'btn btn-danger'
type: 'submit'
disabled: !@valid()
'Search for some music!' | @ArticleForm = React.createClass
getInitialState: ->
articleURL: ''
handleValueChange: (e) ->
valueName = e.target.name
@setState
"#{ valueName }": e.target.value
"status": "process"
valid: ->
@state.articleURL
handleSubmit: (e) ->
e.preventDefault()
$.post '', { article: @state }, (data) =>
@props.handleNewArticle data
@setState @getInitialState()
, 'JSON'
render: ->
React.DOM.form
className: 'form-input'
onSubmit: @handleSubmit
React.DOM.div
className: 'input-group'
React.DOM.input
type: 'text'
className: 'form-control'
placeholder: 'Enter an articles URL to get some mood music!'
name: 'articleURL'
value: @state.articleURL
onChange: @handleValueChange
React.DOM.span
className: 'input-group-button'
React.DOM.button
className: 'btn btn-danger'
type: 'submit'
disabled: !@valid()
'Search for some music!' | Revert "Url not URL because i goofed the init" | Revert "Url not URL because i goofed the init"
This reverts commit 8c2947981032ac59636de68f39db7ac7afb90718.
| CoffeeScript | mit | anticlergygang/heroku-moody-articles,anticlergygang/heroku-moody-articles,anticlergygang/heroku-moody-articles |
e8a7687236ef360c929a31e14a03ad78842ac74e | app/assets/javascripts/sprangular/services/status.coffee | app/assets/javascripts/sprangular/services/status.coffee | Sprangular.service "Status", ($rootScope, $translate) ->
status =
initialized: false
pageTitle: "Home"
bodyClasses: {default: true}
requestedPath: null
httpLoading: false
routeChanging: false
cachedProducts: []
meta: {}
isLoading: ->
@httpLoading || @routeChanging
cacheProducts: (list) ->
status.cachedProducts = status.cachedProducts.concat(list)
findCachedProduct: (slug) ->
_.find status.cachedProducts, (product) ->
product.slug == slug
setPageTitle: (translation_key) ->
$translate(translation_key).then (text) ->
status.pageTitle = text
# addBodyClass('open', 'focused')
addBodyClass: ->
@_eachClass arguments, (classes, klass) ->
classes[klass] = true
# removeBodyClass('open', 'focused')
removeBodyClass: ->
@_eachClass arguments, (classes, klass) ->
classes[klass] = false
# toggleBodyClass('open', 'focused')
toggleBodyClass: ->
@_eachClass arguments, (classes, klass) ->
classes[klass] = !classes[klass]
_eachClass: (args, fn) ->
self = this
_.each args, (klass) -> fn(self.bodyClasses, klass)
$rootScope.$on '$routeChangeSuccess', ->
status.bodyClasses = {default: true}
$rootScope.$watch (-> status.isLoading()), (loading) ->
event = if loading then 'start' else 'end'
$rootScope.$broadcast("loading.#{event}")
status
| Sprangular.service "Status", ($rootScope, $translate) ->
status =
initialized: false
pageTitle: "Home"
bodyClasses: {default: true}
requestedPath: null
httpLoading: false
routeChanging: false
cachedProducts: []
meta: {}
isLoading: ->
@httpLoading || @routeChanging
cacheProducts: (list) ->
status.cachedProducts = status.cachedProducts.concat(list)
findCachedProduct: (slug) ->
_.find status.cachedProducts, (product) ->
product.slug == slug
setPageTitle: (translation_key) ->
$translate(translation_key).then (text) ->
status.pageTitle = text
# addBodyClass('open', 'focused')
addBodyClass: ->
@_eachClass arguments, (classes, klass) ->
classes[klass] = true
# removeBodyClass('open', 'focused')
removeBodyClass: ->
@_eachClass arguments, (classes, klass) ->
classes[klass] = false
# toggleBodyClass('open', 'focused')
toggleBodyClass: ->
@_eachClass arguments, (classes, klass) ->
classes[klass] = !classes[klass]
_eachClass: (args, fn) ->
self = this
_.each args, (klass) -> fn(self.bodyClasses, klass)
$rootScope.$on '$routeChangeSuccess', ->
status.bodyClasses = {default: true}
$rootScope.$watch (-> status.isLoading()), (loading) ->
if loading
status.addBodyClass('loading')
$rootScope.$broadcast("loading.start")
else
status.removeBodyClass('loading')
$rootScope.$broadcast("loading.end")
status
| Add `.loading` class to body when `Status.isLoading` | Add `.loading` class to body when `Status.isLoading`
| CoffeeScript | mit | sprangular/sprangular,sprangular/sprangular,sprangular/sprangular |
48dc6bf0f07bc909ed7b26e7fd495a2b0b5dc37d | apps/pro_buyer/index.coffee | apps/pro_buyer/index.coffee | express = require 'express'
adminOnly = require '../../lib/middleware/admin_only'
JSONPage = require '../../components/json_page'
app = module.exports = express()
app.set 'views', __dirname
app.set 'view engine', 'jade'
page = new JSONPage
name: 'professional-buyer',
paths:
show: '/professional-buyer'
edit: '/professional-buyer/edit'
{ data, edit, upload } = require('../../components/json_page/routes')(page)
{ get, middleware } = require('./routes')(page)
app.get page.paths.show, adminOnly, get.landing
app.get page.paths.show + '/data', adminOnly, data
app.get page.paths.edit, adminOnly, edit
app.post page.paths.edit, adminOnly, upload
app.get page.paths.show + '/complete', adminOnly, middleware, get.complete
| express = require 'express'
adminOnly = require '../../lib/middleware/admin_only'
JSONPage = require '../../components/json_page'
app = module.exports = express()
app.set 'views', __dirname
app.set 'view engine', 'jade'
page = new JSONPage
name: 'professional-buyer',
paths:
show: '/professional-buyer'
edit: '/professional-buyer/edit'
{ data, edit, upload } = require('../../components/json_page/routes')(page)
{ get, middleware } = require('./routes')(page)
app.get page.paths.show, get.landing
app.get "#{page.paths.show}/data", adminOnly, data
app.get page.paths.edit, adminOnly, edit
app.post page.paths.edit, adminOnly, upload
app.get "#{page.paths.show}/complete", middleware.isLoggedIn, get.complete
| Update naming and remove admin restrictions | Update naming and remove admin restrictions
| CoffeeScript | mit | anandaroop/force,izakp/force,kanaabe/force,dblock/force,yuki24/force,izakp/force,kanaabe/force,erikdstock/force,izakp/force,dblock/force,kanaabe/force,anandaroop/force,damassi/force,mzikherman/force,cavvia/force-1,mzikherman/force,kanaabe/force,joeyAghion/force,oxaudo/force,eessex/force,artsy/force,artsy/force-public,dblock/force,erikdstock/force,joeyAghion/force,xtina-starr/force,oxaudo/force,erikdstock/force,joeyAghion/force,damassi/force,xtina-starr/force,izakp/force,eessex/force,mzikherman/force,oxaudo/force,yuki24/force,erikdstock/force,oxaudo/force,xtina-starr/force,artsy/force-public,anandaroop/force,damassi/force,anandaroop/force,joeyAghion/force,artsy/force,xtina-starr/force,artsy/force,damassi/force,mzikherman/force,yuki24/force,eessex/force,kanaabe/force,cavvia/force-1,cavvia/force-1,cavvia/force-1,eessex/force,yuki24/force,artsy/force |
4f67758caa6097e5b78b809b6711b37c1e05e9bf | server/controllers/stack_application.coffee | server/controllers/stack_application.coffee | request = require("request-json")
fs = require('fs')
slugify = require 'cozy-slug'
{AppManager} = require '../lib/paas'
spawn = require('child_process').spawn
log = require('printit')
prefix: "applications"
StackApplication = require '../models/stack_application'
localizationManager = require '../helpers/localization_manager'
sendError = (res, err, code=500) ->
err ?=
stack: null
message: localizationManager.t "server error"
console.log "Sending error to client:"
console.log err.stack
res.send code,
error: true
success: false
message: err.message
stack: err.stack
module.exports =
get: (req, res, next) ->
StackApplication.all (err, apps) ->
if err then next err
else res.send rows: apps
update: (req, res, next) ->
manager = new AppManager()
manager.updateStack (err, result) ->
if err?
log.error err
sendError res, err
else
res.send 200
reboot: (req, res, next) ->
manager = new AppManager()
manager.restartController (err, result) ->
if err?
log.error err
sendError res, err
else
res.send 200
| request = require("request-json")
fs = require('fs')
slugify = require 'cozy-slug'
spawn = require('child_process').spawn
log = require('printit')
prefix: "applications"
{AppManager} = require '../lib/paas'
StackApplication = require '../models/stack_application'
localizationManager = require '../helpers/localization_manager'
sendError = (res, err, code=500) ->
err ?=
stack: null
message: localizationManager.t "server error"
console.log "Sending error to client:"
console.log err.stack
res.send code,
error: true
success: false
message: err.message
stack: err.stack
module.exports =
get: (req, res, next) ->
StackApplication.all (err, apps) ->
if err then next err
else res.send rows: apps
update: (req, res, next) ->
manager = new AppManager()
manager.updateStack (err, result) ->
if err?
log.error err
sendError res, err
else
res.send 200
reboot: (req, res, next) ->
manager = new AppManager()
manager.restartController (err, result) ->
if err?
log.error err
sendError res, err
else
res.send 200
| Clean requires in stack application module (server) | Clean requires in stack application module (server)
| CoffeeScript | agpl-3.0 | frankrousseau/cozy-home,jsilvestre/cozy-home,frankrousseau/cozy-home,jsilvestre/cozy-home,clochix/cozy-home,lemelon/cozy-home,clochix/cozy-home,babolivier/cozy-home,babolivier/cozy-home,lemelon/cozy-home |
533bb0a832f47886d749b1303b2de567c4c86ee6 | test/integration/home_nologin.coffee | test/integration/home_nologin.coffee | should = require 'should'
{wd40, browser} = require('../wd40')
url = 'http://localhost:3001'
describe 'Home page (not logged in)', ->
before (done) ->
wd40.init ->
browser.get url, done
before (done) =>
wd40.getText 'body', (err, text) =>
@bodyText = text
done()
it 'tells me about the platform for data science', =>
@bodyText.toLowerCase().should.include 'data science'
it 'gives me a link to sign up for an account', (done) ->
browser.elementByPartialLinkText 'Sign up', (err, link) ->
should.exist link
link.getAttribute 'href', (err, href) ->
href.should.include '/pricing'
done()
it 'tells me about ScraperWiki Data Services', =>
@bodyText.toLowerCase().should.include 'data services'
after (done) ->
browser.quit ->
done()
| should = require 'should'
{wd40, browser} = require('../wd40')
url = 'http://localhost:3001'
describe 'Home page (not logged in)', ->
before (done) ->
wd40.init ->
browser.get url, done
before (done) =>
wd40.getText 'body', (err, text) =>
@bodyText = text
done()
it 'tells me about the platform for data science', =>
@bodyText.toLowerCase().should.include 'data science'
it 'gives me a link to sign up for an account', (done) ->
browser.elementByPartialLinkText 'Sign up', (err, link) ->
should.exist link
link.getAttribute 'href', (err, href) ->
href.should.include '/pricing'
done()
it 'tells me about ScraperWiki Data Services', =>
@bodyText.toLowerCase().should.include 'services'
after (done) ->
browser.quit ->
done()
| Fix home not logged in test | Fix home not logged in test
| CoffeeScript | agpl-3.0 | scraperwiki/custard,scraperwiki/custard,scraperwiki/custard |
ab53865d66ca40fd705aa251598458f010c47fbd | test/node_http_client.spec.coffee | test/node_http_client.spec.coffee | # Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
helpers = require('./helpers')
AWS = helpers.AWS
MockClient = helpers.MockClient
describe 'AWS.NodeHttpClient', ->
http = new AWS.NodeHttpClient()
describe 'handleRequest', ->
it 'emits httpError in error event', ->
done = false
req = new AWS.Request(endpoint: 'invalid', config: region: 'empty')
resp = new AWS.Response(req)
req.on 'httpError', (cbErr, cbResp) ->
expect(cbErr instanceof Error).toBeTruthy()
expect(cbResp).toBe(resp)
done = true
runs -> http.handleRequest(req, resp)
waitsFor -> done
| # Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
helpers = require('./helpers')
AWS = helpers.AWS
MockClient = helpers.MockClient
describe 'AWS.NodeHttpClient', ->
http = new AWS.NodeHttpClient()
describe 'handleRequest', ->
it 'emits httpError in error event', ->
done = false
endpoint = new AWS.Endpoint('http://invalid')
req = new AWS.Request(endpoint: endpoint, config: region: 'empty')
resp = new AWS.Response(req)
req.on 'httpError', (cbErr, cbResp) ->
expect(cbErr instanceof Error).toBeTruthy()
expect(cbResp).toBe(resp)
done = true
runs -> http.handleRequest(req, resp)
waitsFor -> done
| Build correct endpoint in NodeHttpClient test | Build correct endpoint in NodeHttpClient test
| CoffeeScript | apache-2.0 | chrisradek/aws-sdk-js,GlideMe/aws-sdk-js,ugie/aws-sdk-js,prestomation/aws-sdk-js,odeke-em/aws-sdk-js,guymguym/aws-sdk-js,aws/aws-sdk-js,LiuJoyceC/aws-sdk-js,jippeholwerda/aws-sdk-js,mapbox/aws-sdk-js,jmswhll/aws-sdk-js,GlideMe/aws-sdk-js,dconnolly/aws-sdk-js,AdityaManohar/aws-sdk-js,misfitdavidl/aws-sdk-js,j3tm0t0/aws-sdk-js,misfitdavidl/aws-sdk-js,Blufe/aws-sdk-js,aws/aws-sdk-js,ugie/aws-sdk-js,MitocGroup/aws-sdk-js,odeke-em/aws-sdk-js,jippeholwerda/aws-sdk-js,guymguym/aws-sdk-js,chrisradek/aws-sdk-js,guymguym/aws-sdk-js,jeskew/aws-sdk-js,jeskew/aws-sdk-js,grimurjonsson/aws-sdk-js,guymguym/aws-sdk-js,LiuJoyceC/aws-sdk-js,mapbox/aws-sdk-js,AdityaManohar/aws-sdk-js,LiuJoyceC/aws-sdk-js,chrisradek/aws-sdk-js,jeskew/aws-sdk-js,prembasumatary/aws-sdk-js,MitocGroup/aws-sdk-js,michael-donat/aws-sdk-js,Blufe/aws-sdk-js,mapbox/aws-sdk-js,dconnolly/aws-sdk-js,aws/aws-sdk-js,jippeholwerda/aws-sdk-js,GlideMe/aws-sdk-js,prembasumatary/aws-sdk-js,grimurjonsson/aws-sdk-js,dconnolly/aws-sdk-js,j3tm0t0/aws-sdk-js,j3tm0t0/aws-sdk-js,beni55/aws-sdk-js,mohamed-kamal/aws-sdk-js,AdityaManohar/aws-sdk-js,prembasumatary/aws-sdk-js,prestomation/aws-sdk-js,jmswhll/aws-sdk-js,chrisradek/aws-sdk-js,MitocGroup/aws-sdk-js,prestomation/aws-sdk-js,ugie/aws-sdk-js,beni55/aws-sdk-js,aws/aws-sdk-js,misfitdavidl/aws-sdk-js,GlideMe/aws-sdk-js,mohamed-kamal/aws-sdk-js,jmswhll/aws-sdk-js,jeskew/aws-sdk-js,grimurjonsson/aws-sdk-js,michael-donat/aws-sdk-js,beni55/aws-sdk-js,odeke-em/aws-sdk-js,Blufe/aws-sdk-js,mohamed-kamal/aws-sdk-js,michael-donat/aws-sdk-js |
61031e8a31884da551f8b596bd48be83767d3402 | lib/markdown-preview-view.coffee | lib/markdown-preview-view.coffee | fs = require 'fs'
$ = require 'jquery'
ScrollView = require 'scroll-view'
{$$$} = require 'space-pen'
module.exports =
class MarkdownPreviewView extends ScrollView
registerDeserializer(this)
@deserialize: ({path}) ->
new MarkdownPreviewView(project.bufferForPath(path))
@content: ->
@div class: 'markdown-preview', tabindex: -1
initialize: (@buffer) ->
super
@fetchRenderedMarkdown()
serialize: ->
deserializer: 'MarkdownPreviewView'
path: @buffer.getPath()
getTitle: ->
"Markdown Preview – #{@buffer.getBaseName()}"
getUri: ->
"markdown-preview:#{@buffer.getPath()}"
setErrorHtml: ->
@html $$$ ->
@h2 'Previewing Markdown Failed'
@h3 'Possible Reasons'
@ul =>
@li =>
@span 'You aren\'t online or are unable to reach '
@a 'github.com', href: 'https://github.com'
@span '.'
setLoading: ->
@html($$$ -> @div class: 'markdown-spinner', 'Loading Markdown...')
fetchRenderedMarkdown: (text) ->
@setLoading()
$.ajax
url: 'https://api.github.com/markdown'
type: 'POST'
dataType: 'html'
contentType: 'application/json; charset=UTF-8'
data: JSON.stringify
mode: 'markdown'
text: @buffer.getText()
success: (html) => @html(html)
error: => @setErrorHtml()
| fs = require 'fs'
$ = require 'jquery'
ScrollView = require 'scroll-view'
{$$$} = require 'space-pen'
module.exports =
class MarkdownPreviewView extends ScrollView
registerDeserializer(this)
@deserialize: ({path}) ->
new MarkdownPreviewView(project.bufferForPath(path))
@content: ->
@div class: 'markdown-preview', tabindex: -1
initialize: (@buffer) ->
super
@fetchRenderedMarkdown()
@on 'core:move-up', => @scrollUp()
@on 'core:move-down', => @scrollDown()
serialize: ->
deserializer: 'MarkdownPreviewView'
path: @buffer.getPath()
getTitle: ->
"Markdown Preview – #{@buffer.getBaseName()}"
getUri: ->
"markdown-preview:#{@buffer.getPath()}"
setErrorHtml: ->
@html $$$ ->
@h2 'Previewing Markdown Failed'
@h3 'Possible Reasons'
@ul =>
@li =>
@span 'You aren\'t online or are unable to reach '
@a 'github.com', href: 'https://github.com'
@span '.'
setLoading: ->
@html($$$ -> @div class: 'markdown-spinner', 'Loading Markdown...')
fetchRenderedMarkdown: (text) ->
@setLoading()
$.ajax
url: 'https://api.github.com/markdown'
type: 'POST'
dataType: 'html'
contentType: 'application/json; charset=UTF-8'
data: JSON.stringify
mode: 'markdown'
text: @buffer.getText()
success: (html) => @html(html)
error: => @setErrorHtml()
| Allow markdown preview view to be scrolled with core:move-up/move-down | Allow markdown preview view to be scrolled with core:move-up/move-down
| CoffeeScript | mit | makyo/markdown-preview,atom/markdown-preview,danielgtaylor/atom-api-blueprint-preview,rugk/markdown-preview,ArnaudRinquin/markdown-preview,Galadirith/markdown-preview,grimmer0125/markdown-preview-kramdown,tkssharma/markdown-preview,sctlee/markdown-preview |
71ac993cfc9b521cbb2492d2ce31943d08bb84ab | algo/binary-search.coffee | algo/binary-search.coffee |
{ isListAscending } = require './is-list-ascending.coffee'
_binarySearch = (sortedList, needle)->
return -1 if sortedList.length is 0
mid = Math.floor (sortedList.length / 2)
return mid if sortedList[mid] is needle
if sortedList[mid] > needle
return _binarySearch sortedList[0..mid - 1], needle
else
res = _binarySearch sortedList[mid+1..sortedList.length], needle
return (if res is -1 then -1 else res + mid + 1)
@binarySearch = (sortedList, needle)->
throw new Error 'Unsorted List' unless isListAscending sortedList
return _binarySearch sortedList, needle
|
{ isListAscending } = require './is-list-ascending.coffee'
_binarySearch = (sortedList, needle, start, end)->
return -1 if end < start
mid = Math.floor (start + ((end - start) / 2))
return mid if sortedList[mid] is needle
if sortedList[mid] > needle
return _binarySearch sortedList, needle, start, mid - 1
else
return _binarySearch sortedList, needle, mid + 1, end
@binarySearch = (sortedList, needle)->
throw new Error 'Unsorted List' unless isListAscending sortedList
return _binarySearch sortedList, needle, 0, sortedList.length-1
| Revert "CHECKPOINT re-implemented binarySearch using slices" | Revert "CHECKPOINT re-implemented binarySearch using slices"
This reverts commit 4454540a3858f512861e376414f8ab41e9da7662.
| CoffeeScript | mit | iShafayet/algorithms-in-coffeescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.